--- a/multimediacommscontroller/mmccfilesourcesink/inc/mccfilesink.h Thu Sep 02 20:49:29 2010 +0300
+++ b/multimediacommscontroller/mmccfilesourcesink/inc/mccfilesink.h Fri Sep 17 08:32:38 2010 +0300
@@ -230,6 +230,8 @@
TBool iDecSpecInfoProvided;
TBool iKeyFrameProvided;
+
+ TInt64 iCurrAvgTimestampDifference;
#ifdef EUNIT_TEST
friend class UT_CMccFileSink;
--- a/multimediacommscontroller/mmccfilesourcesink/src/mccfilesink.cpp Thu Sep 02 20:49:29 2010 +0300
+++ b/multimediacommscontroller/mmccfilesourcesink/src/mccfilesink.cpp Fri Sep 17 08:32:38 2010 +0300
@@ -33,7 +33,8 @@
const TInt KMccMaxNumTimestamps = 5;
-const TInt KMccTimestampDifferenceMultiplier = 10;
+// used for Calculate Average Timestamp
+const TInt KMccDefaultAvgTimestampDiff = 66000;
// ============================ MEMBER FUNCTIONS ===============================
@@ -71,7 +72,8 @@
// -----------------------------------------------------------------------------
//
CMccFileSink::CMccFileSink() :
- CMccDataSink( KMccFileSinkUid )
+ CMccDataSink( KMccFileSinkUid ),
+ iCurrAvgTimestampDifference( KMccDefaultAvgTimestampDiff )
{
iVideoCodec.iFourCC = TFourCC( KMccFourCCIdH263 );
// FJKI-7J58CB no use case for audio in file, hence removing the audio track capability
@@ -565,6 +567,10 @@
averageTimeStampDifference = averageTimeStampDifference / ( KMccMaxNumTimestamps - 1 );
}
+ if ( averageTimeStampDifference > 0 )
+ {
+ iCurrAvgTimestampDifference = averageTimeStampDifference;
+ }
if ( aCurrentTimestamp > iPreviousTimestamp )
{
@@ -574,19 +580,19 @@
}
iTimestamps.AppendL( aCurrentTimestamp.Int64() );
}
- else
+ else if ( aCurrentTimestamp < iPreviousTimestamp )
{
- TInt64 currDifference = iPreviousTimestamp.Int64() - aCurrentTimestamp.Int64();
- if ( averageTimeStampDifference != 0 &&
- currDifference > ( averageTimeStampDifference * KMccTimestampDifferenceMultiplier ) )
- {
- iAddToTimestamp += ( currDifference + averageTimeStampDifference );
- iTimestamps.Reset();
- iPausedDuration = 0;
+ TInt64 currDifference = iPreviousTimestamp.Int64() - aCurrentTimestamp.Int64();
+ iAddToTimestamp += ( currDifference + iCurrAvgTimestampDifference );
+ iTimestamps.Reset();
+ iPausedDuration = 0;
- __FILESINK_CONTROLL_INT1("CMccFileSink::TimeToPlay, iAddToTimestamp=", iAddToTimestamp )
- }
+ __FILESINK_CONTROLL_INT1("CMccFileSink::TimeToPlay, iAddToTimestamp=", iAddToTimestamp )
}
+ else
+ {
+ // NOP
+ }
}
// -----------------------------------------------------------------------------
--- a/multimediacommscontroller/mmccfilesourcesink/tsrc/ut_filesourcesink/Inc/UT_CMccFileSink.h Thu Sep 02 20:49:29 2010 +0300
+++ b/multimediacommscontroller/mmccfilesourcesink/tsrc/ut_filesourcesink/Inc/UT_CMccFileSink.h Fri Sep 17 08:32:38 2010 +0300
@@ -141,6 +141,8 @@
void UT_CMccFileSink_UpdateActiveUserL();
+ void UT_CMccFileSink_CalculateAverageTimestampDifferenceL();
+
private: // Helpers
CMccTestEventHandler* AddUserL( TBool aIsAvc = EFalse );
--- a/multimediacommscontroller/mmccfilesourcesink/tsrc/ut_filesourcesink/Src/UT_CMccFileSink.cpp Thu Sep 02 20:49:29 2010 +0300
+++ b/multimediacommscontroller/mmccfilesourcesink/tsrc/ut_filesourcesink/Src/UT_CMccFileSink.cpp Fri Sep 17 08:32:38 2010 +0300
@@ -613,6 +613,41 @@
EUNIT_ASSERT_EQUALS( iFileSink->iActiveUserIndex, 1 );
EUNIT_ASSERT( iFileSink->iAsyncEventHandler == iEventHandler2 );
}
+
+void UT_CMccFileSink::UT_CMccFileSink_CalculateAverageTimestampDifferenceL()
+ {
+ const TInt KMccMaxNumTimestamps = 5;
+ const TInt KMccTimestampDifferenceMultiplier = 10;
+ TInt originalTime(1000);
+ TInt timeIncrement(1000);
+
+ iFileSink->iCurrAvgTimestampDifference = 0;
+
+ // Ask so long that average timestamp difference can be calculated
+ for (TInt i = 0; i < (KMccTimestampDifferenceMultiplier + 2); i++)
+ {
+ TTimeIntervalMicroSeconds timeToPlay = iFileSink->TimeToPlayL(
+ TTimeIntervalMicroSeconds(originalTime));
+
+ EUNIT_ASSERT_EQUALS( timeToPlay.Int64(), originalTime );
+
+ originalTime += timeIncrement;
+ }
+
+ EUNIT_ASSERT_EQUALS( iFileSink->iTimestamps.Count(), KMccMaxNumTimestamps );
+ EUNIT_ASSERT_GREATER( iFileSink->iCurrAvgTimestampDifference, 0 );
+
+ iFileSink->iTimestamps.Reset();
+ iFileSink->iPreviousTimestamp = 500;
+ iFileSink->TimeToPlayL( TTimeIntervalMicroSeconds( originalTime ) );
+ EUNIT_ASSERT_GREATER( iFileSink->iTimestamps.Count(), 0 );
+
+ originalTime = 1000;
+ iFileSink->iAddToTimestamp = 0;
+ iFileSink->iPreviousTimestamp = 1010;
+ iFileSink->TimeToPlayL( TTimeIntervalMicroSeconds( originalTime ) );
+ EUNIT_ASSERT_GREATER( iFileSink->iAddToTimestamp, 0 );
+ }
// HELPERS
@@ -812,6 +847,13 @@
"UpdateActiveUserL",
"FUNCTIONALITY",
SetupL, UT_CMccFileSink_UpdateActiveUserL, Teardown)
+
+EUNIT_TEST(
+ "CalculateAverageTimestampDifferenceL - test ",
+ "CMccFileSink",
+ "CalculateAverageTimestampDifferenceL",
+ "FUNCTIONALITY",
+ SetupL, UT_CMccFileSink_CalculateAverageTimestampDifferenceL, Teardown)
EUNIT_END_TEST_TABLE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml Fri Sep 17 08:32:38 2010 +0300
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0">
+ <package id="ipappsrv" name="IP App Services" levels="framework generic server conn plugin">
+ <collection id="ipappsrv_plat" name="IP App Services Platform Interfaces" level="plugin">
+ <component id="transcoder_api" name="Transcoder API" class="api" filter="s60">
+ <meta rel="Api" href="ipappsrv_plat/transcoder_api/transcoder_api.metaxml"/>
+ <unit bldFile="ipappsrv_plat/transcoder_api/group"/>
+ </component>
+ <component id="comms_event_api" name="Comms Event API" class="api" filter="s60">
+ <meta rel="Api" href="ipappsrv_plat/comms_event_api/comms_event_api.metaxml"/>
+ <unit bldFile="ipappsrv_plat/comms_event_api/group"/>
+ </component>
+ <component id="floor_control_api" name="Floor Control API" class="api" filter="s60">
+ <meta rel="Api" href="ipappsrv_plat/floor_control_api/floor_control_api.metaxml"/>
+ <unit bldFile="ipappsrv_plat/floor_control_api/group"/>
+ </component>
+ <component id="media_control_api" name="Media Control API" class="api" filter="s60">
+ <meta rel="Api" href="ipappsrv_plat/media_control_api/media_control_api.metaxml"/>
+ <unit bldFile="ipappsrv_plat/media_control_api/group"/>
+ </component>
+ <component id="multimedia_comms_api" name="Multimedia Comms API" class="api" filter="s60">
+ <meta rel="Api" href="ipappsrv_plat/multimedia_comms_api/multimedia_comms_api.metaxml"/>
+ <unit bldFile="ipappsrv_plat/multimedia_comms_api/group"/>
+ </component>
+ <component id="nat_settings_api" name="NAT Settings API" class="api" filter="s60">
+ <meta rel="Api" href="ipappsrv_plat/nat_settings_api/nat_settings_api.metaxml"/>
+ <unit bldFile="ipappsrv_plat/nat_settings_api/group"/>
+ </component>
+ </collection>
+ <collection id="natfw" name="NAT Framework" level="framework">
+ <!-- collection is really a component. Need to move down a directory -->
+ <component id="natfw_build" filter="s60" name="NAT Framework Build" introduced="^2">
+ <unit bldFile="natfw/group"/>
+ </component>
+ </collection>
+ <collection id="multimediacommscontroller" name="Multimedia Comms Controller" level="conn">
+ <!-- collection is really a component. Need to move down a directory -->
+ <component id="multimediacommscontroller_build" filter="s60" name="Multimedia Comms Controller Build">
+ <unit bldFile="multimediacommscontroller/group"/>
+ </component>
+ </collection>
+ <collection id="multimediacommsengine" name="Multimedia Comms Engine" level="generic">
+ <!-- collection is really a component. Need to move down a directory -->
+ <component id="multimediacommsengine_build" filter="s60" name="Multimedia Comms Engine Build">
+ <unit bldFile="multimediacommsengine/group"/>
+ </component>
+ </collection>
+ <collection id="natplugins" name="NAT Plugins" level="plugin">
+ <component id="natpcliprovisioningnatfwadapter" filter="s60" name="Client Provisioning NAT Framework Traversal Adapter" class="plugin" introduced="^2">
+ <unit bldFile="natplugins/natpcliprovisioningnatfwadapter/group"/>
+ </component>
+ <component id="natpdevmgmtnatfwadapter" filter="s60" name="Device Management NAT Framework Traversal Adapter" class="plugin">
+ <unit bldFile="natplugins/natpdevmgmtnatfwadapter/group"/>
+ </component>
+ <component id="natptraversalcontroller" filter="s60" name="NAT Traversal Controller" class="plugin">
+ <unit bldFile="natplugins/natptraversalcontroller/group"/>
+ </component>
+ <component id="natpnatfwsdpprovider" filter="s60" name="NAT Framework SDP Provider" class="plugin">
+ <unit bldFile="natplugins/natpnatfwsdpprovider/group"/>
+ </component>
+ </collection>
+ <collection id="ipappsrv_info" name="IP App Services Info" level="plugin">
+ <component id="ipappsrv_build" name="IP App Services Build" filter="s60">
+ <!-- remove the #includes from here and rename as xxx ROM or move iby/sis files into another component-->
+ <unit mrp="group"/>
+ </component>
+ </collection>
+ </package>
+</SystemDefinition>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml Fri Sep 17 08:32:38 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="mw"/>