harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp
branchRCL_3
changeset 63 e538444823de
parent 47 b73252188534
equal deleted inserted replaced
57:2872ae438bf7 63:e538444823de
    33 _LIT( KRtpClipMimetype, "application/x-nokia-teh-rtp" );
    33 _LIT( KRtpClipMimetype, "application/x-nokia-teh-rtp" );
    34 
    34 
    35 // Enough size to recognize file and read metaheader
    35 // Enough size to recognize file and read metaheader
    36 const TInt KFileBufferSize( KMaxMetaHeaderLength );
    36 const TInt KFileBufferSize( KMaxMetaHeaderLength );
    37 
    37 
    38 CHarvesterRtpPluginPropertyDefs::CHarvesterRtpPluginPropertyDefs() : CBase(),
    38 CHarvesterRtpPluginPropertyDefs::CHarvesterRtpPluginPropertyDefs() : CBase()
    39     iCreationDatePropertyDef( NULL )
       
    40 	{
    39 	{
    41 	}
    40 	}
    42 
    41 
    43 void CHarvesterRtpPluginPropertyDefs::ConstructL( CMdEObjectDef& aObjectDef )
    42 void CHarvesterRtpPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef)
    44     {
       
    45     SetByObjectDefL( aObjectDef );
       
    46     }
       
    47 
       
    48 CHarvesterRtpPluginPropertyDefs* CHarvesterRtpPluginPropertyDefs::NewL()
       
    49     {
       
    50     CHarvesterRtpPluginPropertyDefs* self = 
       
    51         new (ELeave) CHarvesterRtpPluginPropertyDefs();
       
    52     return self;
       
    53     }
       
    54 
       
    55 void CHarvesterRtpPluginPropertyDefs::SetByObjectDefL( CMdEObjectDef& aObjectDef )
       
    56 	{
    43 	{
    57 	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
    44 	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
    58 	
    45 	
    59 	// Common property definitions
    46 	// Common property definitions
    60 	CMdEObjectDef& objectDef = nsDef.GetObjectDefL( MdeConstants::Object::KBaseObject );
    47 	CMdEObjectDef& objectDef = nsDef.GetObjectDefL( MdeConstants::Object::KBaseObject );
    72 	CMdEObjectDef& videoDef = nsDef.GetObjectDefL( MdeConstants::Video::KVideoObject );
    59 	CMdEObjectDef& videoDef = nsDef.GetObjectDefL( MdeConstants::Video::KVideoObject );
    73 	iAgeProfilePropertyDef = &videoDef.GetPropertyDefL( MdeConstants::Video::KAgeProfileProperty );
    60 	iAgeProfilePropertyDef = &videoDef.GetPropertyDefL( MdeConstants::Video::KAgeProfileProperty );
    74 	iRecordingFlagsPropertyDef = &videoDef.GetPropertyDefL( MdeConstants::Video::KRecordingFlagsProperty );
    61 	iRecordingFlagsPropertyDef = &videoDef.GetPropertyDefL( MdeConstants::Video::KRecordingFlagsProperty );
    75 	}
    62 	}
    76 
    63 
       
    64 CHarvesterRtpPluginPropertyDefs* CHarvesterRtpPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
       
    65 	{
       
    66 	CHarvesterRtpPluginPropertyDefs* self = 
       
    67 		new (ELeave) CHarvesterRtpPluginPropertyDefs();
       
    68 	CleanupStack::PushL( self );
       
    69 	self->ConstructL( aObjectDef );
       
    70 	CleanupStack::Pop( self );
       
    71 	return self;
       
    72 	}
       
    73 
    77 // ======== MEMBER FUNCTIONS ========
    74 // ======== MEMBER FUNCTIONS ========
    78 
    75 
    79 // ---------------------------------------------------------------------------
    76 // ---------------------------------------------------------------------------
    80 // Default constructor
    77 // Default constructor
    81 // ---------------------------------------------------------------------------
    78 // ---------------------------------------------------------------------------
    90 //
    87 //
    91 void CHarvesterRtpPlugin::ConstructL()
    88 void CHarvesterRtpPlugin::ConstructL()
    92     {
    89     {
    93     WRITELOG( "CHarvesterRtpPlugin::ConstructL()" );
    90     WRITELOG( "CHarvesterRtpPlugin::ConstructL()" );
    94     SetPriority( KHarvesterPriorityHarvestingPlugin - 1 );
    91     SetPriority( KHarvesterPriorityHarvestingPlugin - 1 );
    95     iPropDefs = CHarvesterRtpPluginPropertyDefs::NewL();
       
    96     }
    92     }
    97 
    93 
    98 // ---------------------------------------------------------------------------
    94 // ---------------------------------------------------------------------------
    99 // Constructor
    95 // Constructor
   100 // ---------------------------------------------------------------------------
    96 // ---------------------------------------------------------------------------
   264     TBool aIsAdd)
   260     TBool aIsAdd)
   265     {
   261     {
   266     WRITELOG( "CHarvesterRtpPlugin::HandleObjectPropertiesL()" );
   262     WRITELOG( "CHarvesterRtpPlugin::HandleObjectPropertiesL()" );
   267 
   263 
   268     CMdEObject& mdeObject = aHD.MdeObject();
   264     CMdEObject& mdeObject = aHD.MdeObject();
   269      
   265     
   270     InitPropDefsL( mdeObject.Def() );
   266     if( !iPropDefs )
       
   267 		{
       
   268 		CMdEObjectDef& objectDef = mdeObject.Def();
       
   269 		iPropDefs = CHarvesterRtpPluginPropertyDefs::NewL( objectDef );
       
   270 		}
   271 
   271 
   272     TTimeIntervalSeconds timeOffset = User::UTCOffset();
   272     TTimeIntervalSeconds timeOffset = User::UTCOffset();
   273     TTime localModifiedTime = aClipDetails.iModifiedDate + timeOffset;
   273     TTime localModifiedTime = aClipDetails.iModifiedDate + timeOffset;
   274     
   274     
   275     if( ! mdeObject.Placeholder() )
   275     if( ! mdeObject.Placeholder() )
   338         }
   338         }
   339 
   339 
   340     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   340     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   341     		*iPropDefs->iRecordingFlagsPropertyDef, &flags, aIsAdd );
   341     		*iPropDefs->iRecordingFlagsPropertyDef, &flags, aIsAdd );
   342     }
   342     }
   343 
       
   344 void CHarvesterRtpPlugin::InitPropDefsL( CMdEObjectDef& aObjectDef )
       
   345     {
       
   346     if( !iPropDefs->iCreationDatePropertyDef )
       
   347         {
       
   348         iPropDefs->SetByObjectDefL( aObjectDef );
       
   349         }
       
   350     }
       
   351 
       
   352