--- a/multimediacommscontroller/mmcccontroller/data/102073F6.rss Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmcccontroller/data/102073F6.rss Fri May 14 15:11:40 2010 +0300
@@ -41,7 +41,7 @@
version_no = KIpappsrvEcomVersionNumber;
display_name = "MCC Controller";
default_data = "";
- opaque_data = "<a>0x400000";
+ opaque_data = "<a>0x400000<t>0x5000";
}
};
}
--- a/multimediacommscontroller/mmcccontroller/src/mcccamerahandler.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmcccontroller/src/mcccamerahandler.cpp Fri May 14 15:11:40 2010 +0300
@@ -731,10 +731,16 @@
void CMccCameraHandler::DoPowerOnComplete( TInt aError )
{
__CONTROLLER_INT1( "CMccCameraHandler::DoPowerOnComplete, with value", aError )
+
if ( aError == KErrNone )
{
iState = EPowered;
+ // Notify observers about success, important to do before VF handling
+ // as VF behaves more nicely at enabling when it sees that media recorder
+ // is already using camera.
+ NotifyObservers( aError );
+
// Viewfinder was enabled before resource release, enable again.
// Also set old camera settings.
if ( iViewFinderEnabled )
@@ -757,10 +763,10 @@
{
__CONTROLLER_INT1( "CMccCameraHandler::DoPowerOnComplete, powering failed", aError )
iState = EFailed;
- }
-
- // Notify observers about success or failure
- NotifyObservers( aError );
+
+ // Notify observers about failure
+ NotifyObservers( aError );
+ }
__CONTROLLER( "CMccCameraHandler::DoPowerOnComplete, exit" )
}
--- a/multimediacommscontroller/mmccfilesourcesink/inc/mccfilesourceimpl.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccfilesourcesink/inc/mccfilesourceimpl.h Fri May 14 15:11:40 2010 +0300
@@ -283,6 +283,8 @@
void StopEofTimer();
void EofTimerExpiredL(); // from MMccEofTimerObserver
+
+ void InvalidVideoFrame( TBool aInvalid = EFalse );
public:
--- a/multimediacommscontroller/mmccfilesourcesink/inc/mccfilevideo.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccfilesourcesink/inc/mccfilevideo.h Fri May 14 15:11:40 2010 +0300
@@ -26,6 +26,9 @@
#include "mccfilesourcetypebase.h"
+
+const TUint KMccReadFrameFailCountMax = 20;
+
// FORWARD DECLARATIONS
class CMccFileSourceImpl;
class MMccResources;
@@ -112,6 +115,9 @@
TBool iIsVideoLeft;
TBool iIsFirstFrame;
TFourCC iFourCC;
+
+ TInt iReadFrameFailCount;
+ TBool iSendReadFrameFailEvent;
MMccResources* iMccResources;
TUint32 iEndpointId;
--- a/multimediacommscontroller/mmccfilesourcesink/src/mccfilesink.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccfilesourcesink/src/mccfilesink.cpp Fri May 14 15:11:40 2010 +0300
@@ -582,6 +582,7 @@
{
iAddToTimestamp += ( currDifference + averageTimeStampDifference );
iTimestamps.Reset();
+ iPausedDuration = 0;
__FILESINK_CONTROLL_INT1("CMccFileSink::TimeToPlay, iAddToTimestamp=", iAddToTimestamp )
}
--- a/multimediacommscontroller/mmccfilesourcesink/src/mccfilesourceimpl.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccfilesourcesink/src/mccfilesourceimpl.cpp Fri May 14 15:11:40 2010 +0300
@@ -1086,6 +1086,27 @@
return startNeeded;
}
+
+// -----------------------------------------------------------------------------
+// CMccFileSourceImpl::InvalidVideoFrame()
+// -----------------------------------------------------------------------------
+//
+void CMccFileSourceImpl::InvalidVideoFrame( TBool aInvalid )
+ {
+ __FILESOURCE_CONTROLL(
+ "CMccFileSourceImpl::InvalidVideoFrame" )
+ if( aInvalid )
+ {
+ SendStreamEventToClient( KMccEventCategoryStream,
+ KMccStreamIdle );
+ }
+ else
+ {
+ SendStreamEventToClient( KMccEventCategoryStream,
+ KMccStreamPlaying );
+ }
+ }
+
#ifndef EKA2
// DLL interface code
--- a/multimediacommscontroller/mmccfilesourcesink/src/mccfilevideo.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccfilesourcesink/src/mccfilevideo.cpp Fri May 14 15:11:40 2010 +0300
@@ -402,11 +402,27 @@
{
__FILESOURCE_CONTROLL( "CMccFileVideo::ReadFrameL, reading frame, NOT OK" )
CleanupStack::PopAndDestroy( mediaBuffer );
+ if( !iSendReadFrameFailEvent )
+ {
+ iReadFrameFailCount++;
+ if( iReadFrameFailCount >= KMccReadFrameFailCountMax )
+ {
+ iSendReadFrameFailEvent = ETrue;
+ iSource.InvalidVideoFrame( ETrue );
+ }
+ }
}
else
{
__FILESOURCE_CONTROLL_INT1( "CMccFileVideo::ReadFrameL, reading frame, OK, position",
iPosition )
+
+ if( iSendReadFrameFailEvent )
+ {
+ iSendReadFrameFailEvent = EFalse;
+ iReadFrameFailCount = 0;
+ iSource.InvalidVideoFrame( EFalse );
+ }
DoTimingCorrection( iPosition );
--- a/multimediacommscontroller/mmccvideosourcesink/group/videosourcesink.mmp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/group/videosourcesink.mmp Fri May 14 15:11:40 2010 +0300
@@ -35,7 +35,6 @@
SOURCE mccvideojitterbuffer.cpp
SOURCE mccvideosourceimpl.cpp
SOURCE mccvideosourcewrapper.cpp
-SOURCE mccredrawhandler.cpp
SOURCE mccvideosourcekeyretriever.cpp
#if (defined WINS)
--- a/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosinkimpl.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosinkimpl.h Fri May 14 15:11:40 2010 +0300
@@ -61,7 +61,6 @@
class CMccVideoSinkUser;
class MAsyncEventHandler;
class MDataSource;
-class CMccRedrawHandler;
// CLASS DECLARATION
@@ -453,6 +452,10 @@
TBool AllUsersReady();
+ void UpdateScreenTransparencyL(const TMccVideoSinkSetting& aSettings);
+ void DeleteWindowingElements();
+ void CreateWindowingElementsL(const TMccVideoSinkSetting& aSettings);
+
private: // Data
RWsSession iRwSession;
@@ -489,8 +492,6 @@
TBool iPrerollSet;
- CMccRedrawHandler* iRedrawHandler;
-
TUint32 iNumPacketsEnqueued;
TTimeIntervalMicroSeconds iPos;
--- a/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosourceimpl.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosourceimpl.h Fri May 14 15:11:40 2010 +0300
@@ -392,7 +392,7 @@
void RateAdaptationRequestL( const TMccEvent& aInputData,
TMccEvent& aOutputData );
- void DoCodecSpecificConfigurationL( TUid& aEncoderUid );
+ void DoCodecSpecificConfigurationL( TUid& aEncoderUid,TBool& aForceEncapsulationType );
HBufC8* GetFmtpLC( const TMccCodecInfo& aCodecInfo );
--- a/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosourcewrapper.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosourcewrapper.h Fri May 14 15:11:40 2010 +0300
@@ -63,7 +63,8 @@
TInt aCameraHandle,
const TDesC8& aVideoMimeType = KNullDesC8,
TFourCC aAudioType = KFourCCNULL,
- TUid aEncoderUid = KNullUid );
+ TUid aEncoderUid = KNullUid,
+ TBool aForceEncapsulationType = EFalse );
void PlayL();
--- a/multimediacommscontroller/mmccvideosourcesink/src/mccvideosinkimpl.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/src/mccvideosinkimpl.cpp Fri May 14 15:11:40 2010 +0300
@@ -31,7 +31,6 @@
#include "mmcccodecamr.h"
#include "mccvideosinkuser.h"
#include "mccdef.h"
-#include "mccredrawhandler.h"
#include "mccinternaldef.h"
#include <videoplayer2.h>
@@ -139,44 +138,7 @@
__V_SOURCESINK_CONTROLL_INT1( "CMccVideoSinkImpl rotation:",
iSettings.iRotation )
- // Create window group
- TInt groupId = iRwSession.GetFocusWindowGroup();
- iRwGroup = new (ELeave) RWindowGroup( iRwSession );
-
- User::LeaveIfError( iRwGroup->Construct( groupId, EFalse ) );
- iRwGroup->SetName( KMccWindowGroupName );
-
- // TBD: use also iWindowOrdinalPriority
- iRwGroup->SetOrdinalPosition( iSettings.iWindowOrdinalPosition );
-
- // Create screen device
- iDev = new (ELeave) CWsScreenDevice( iRwSession );
- User::LeaveIfError( iDev->Construct( iSettings.iDeviceIndex ) );
-
- // Create window
- iRw = new (ELeave) RWindow( iRwSession );
-
- User::LeaveIfError( iRw->Construct( *iRwGroup, (TUint32)iRw ) );
-
- iRw->SetPosition( iSettings.iLocation );
- iRw->SetSize( iSettings.iSize );
-
- iRw->SetOrdinalPosition( iSettings.iWindowOrdinalPosition );
-
- __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: creating graphics context ..." )
- User::LeaveIfError( iDev->CreateContext( iGc ) );
- __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: graphics context created!" )
-
-
- iRw->Activate();
-
- iRwSession.Flush();
-
- __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: creating redraw handler" )
-
- iRedrawHandler = CMccRedrawHandler::NewL( iRwSession, *iRw, *iGc );
-
- __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: created redraw handler" )
+ CreateWindowingElementsL(iSettings);
// Videoplayer needs to be created last, otherwise destruction
// order causes problems
@@ -245,14 +207,10 @@
}
delete iVideoPlayer;
-
- delete iRedrawHandler;
+ iVideoPlayer = NULL;
- delete iGc;
- delete iDev;
+ DeleteWindowingElements();
- delete iRw;
- delete iRwGroup;
iRwSession.Close();
delete iServerName;
@@ -419,7 +377,6 @@
}
else
{
- iRedrawHandler->BlackDrawingL( ETrue );
SendStreamEventToClient( KMccStreamStarted, iCurrentUser );
SetStartedOnce( userEntry, ETrue );
}
@@ -777,8 +734,6 @@
user.PacketOverflowState() != CMccVideoSinkUser::EOccured &&
dataSize >= KMccMinPacketSize )
{
- iRedrawHandler->BlackDrawingL( EFalse );
-
__V_SOURCESINK_CONTROLL(
"CMccVideoSinkImpl::EmptyBufferL, sending packet to helix" )
@@ -837,16 +792,11 @@
__V_SOURCESINK_CONTROLL_INT1( "CMccVideoSinkImpl rotation:",
aSettings.iRotation )
- __ASSERT_ALWAYS( iRw && iRwGroup && iDev, User::Leave( KErrNotReady ) );
+ // Need to recreate windowing stuff, otherwise orientation switch does not work
+ DeleteWindowingElements();
+ CreateWindowingElementsL(aSettings);
- // TBD: use also aSettings.iWindowOrdinalPriority
- iRwGroup->SetOrdinalPosition( aSettings.iWindowOrdinalPosition );
-
- iRw->SetPosition( aSettings.iLocation );
- iRw->SetSize( aSettings.iSize );
- iRw->SetOrdinalPosition( aSettings.iWindowOrdinalPosition );
-
- iRwSession.Flush();
+ UpdateScreenTransparencyL(aSettings);
SetDisplayWindowL( iRwSession, *iDev, *iRw );
@@ -1946,6 +1896,97 @@
}
return allUsersReady;
}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMccVideoSinkImpl::UpdateScreenTransparencyL(const TMccVideoSinkSetting& aSettings)
+ {
+ __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::UpdateScreenTransparencyL" )
+ __ASSERT_ALWAYS( iGc && iRw, User::Leave( KErrNotReady ) );
+ TRect vfRect( TPoint( 0, 0 ), aSettings.iSize );
+ iGc->Activate( *iRw );
+ iRw->Invalidate( vfRect );
+ iRw->BeginRedraw( vfRect );
+ iGc->CancelClippingRect();
+ iGc->SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+ iGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
+ iGc->SetBrushColor( TRgb( 0, 0, 0, 0 ) );
+ iGc->DrawRect( vfRect );
+ iRw->EndRedraw();
+ iGc->Deactivate();
+ iRwSession.Flush();
+ __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::UpdateScreenTransparencyL, exit" )
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMccVideoSinkImpl::DeleteWindowingElements()
+ {
+ __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::DeleteWindowingElements" )
+ if ( iVideoPlayer && iRw )
+ {
+ __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: removing window from player" )
+ iVideoPlayer->RemoveDisplayWindow( *iRw );
+ }
+ delete iGc;
+ iGc = NULL;
+ delete iDev;
+ iDev = NULL;
+ delete iRw;
+ iRw = NULL;
+ delete iRwGroup;
+ iRwGroup = NULL;
+ __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::DeleteWindowingElements, exit" )
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMccVideoSinkImpl::CreateWindowingElementsL(const TMccVideoSinkSetting& aSettings)
+ {
+ __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::CreateWindowingElementsL" )
+
+ __ASSERT_ALWAYS( !iGc && !iDev && !iRw && !iRwGroup, User::Leave( KErrAlreadyExists ) );
+
+ TInt groupId = iRwSession.GetFocusWindowGroup();
+ iRwGroup = new (ELeave) RWindowGroup( iRwSession );
+
+ User::LeaveIfError( iRwGroup->Construct( groupId, EFalse ) );
+ iRwGroup->SetName( KMccWindowGroupName );
+
+ // TBD: use also iWindowOrdinalPriority
+ iRwGroup->SetOrdinalPosition( aSettings.iWindowOrdinalPosition );
+ iRwGroup->AutoForeground( EFalse );
+
+ // Create screen device
+ iDev = new (ELeave) CWsScreenDevice( iRwSession );
+ User::LeaveIfError( iDev->Construct( aSettings.iDeviceIndex ) );
+
+ // Create window
+ iRw = new (ELeave) RWindow( iRwSession );
+
+ User::LeaveIfError( iRw->Construct( *iRwGroup, (TUint32)iRw ) );
+
+ iRw->SetPosition( aSettings.iLocation );
+ iRw->SetSize( aSettings.iSize );
+
+ iRw->SetOrdinalPosition( aSettings.iWindowOrdinalPosition );
+
+ __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: creating graphics context ..." )
+ User::LeaveIfError( iDev->CreateContext( iGc ) );
+ __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: graphics context created!" )
+
+ iRw->Activate();
+
+ iRwSession.Flush();
+
+ __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::CreateWindowingElementsL, exit" )
+ }
// End of file
--- a/multimediacommscontroller/mmccvideosourcesink/src/mccvideosourceimpl.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/src/mccvideosourceimpl.cpp Fri May 14 15:11:40 2010 +0300
@@ -166,13 +166,14 @@
__V_SOURCESINK_CONTROLL( "CMccVideoSourceImpl::SourcePrimeL, prepare fully" )
TUid encoderUid( KNullUid );
- DoCodecSpecificConfigurationL( encoderUid );
+ TBool forceEncapsulationType( EFalse );
+ DoCodecSpecificConfigurationL( encoderUid, forceEncapsulationType );
__ASSERT_ALWAYS( iVideoCodecFourCC, User::Leave( KErrNotReady ) );
__V_SOURCESINK_CONTROLL( "CMccVideoSourceImpl::SourcePrimeL, opening source" )
iMediaRecorder->OpenL( iAudioSource, iCameraHandler->Handle(),
- *iVideoCodecFourCC, iAudioFourCC, encoderUid ) ;
+ *iVideoCodecFourCC, iAudioFourCC, encoderUid, forceEncapsulationType ) ;
}
}
else
@@ -1218,7 +1219,8 @@
// CMccVideoSourceImpl::DoCodecSpecificConfigurationL
// ---------------------------------------------------------------------------
//
-void CMccVideoSourceImpl::DoCodecSpecificConfigurationL( TUid& aEncoderUid )
+void CMccVideoSourceImpl::DoCodecSpecificConfigurationL(
+ TUid& aEncoderUid, TBool& aForceEncapsulationType )
{
__V_SOURCESINK_CONTROLL( "CMccVideoSourceImpl::DoCodecSpecificConfigurationL" )
@@ -1264,6 +1266,7 @@
__V_SOURCESINK_CONTROLL_INT1( "CMccVideoSourceImpl::DoCodecSpecificConfigurationL, EncodingDecodingDeviceUid:",
iVideoCodec.iEncodingDecodingDevice.iUid )
aEncoderUid = iVideoCodec.iEncodingDecodingDevice;
+ aForceEncapsulationType = ETrue;
}
else
{
--- a/multimediacommscontroller/mmccvideosourcesink/src/mccvideosourcewrapper.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/src/mccvideosourcewrapper.cpp Fri May 14 15:11:40 2010 +0300
@@ -89,7 +89,8 @@
TInt aCameraHandle,
const TDesC8& aVideoMimeType,
TFourCC aAudioType,
- TUid aEncoderUid )
+ TUid aEncoderUid,
+ TBool aForceEncapsulationType )
{
__V_SOURCESINK_CONTROLL( "CMccVideoSourceWrapper::OpenL" )
@@ -109,9 +110,12 @@
__V_SOURCESINK_CONTROLL_INT1( "SetPreferredVideoEncoderL, uid:",
aEncoderUid.iUid )
iMediaRecorder->SetPreferredVideoEncoderL( aEncoderUid );
+ }
+ if ( aForceEncapsulationType )
+ {
__V_SOURCESINK_CONTROLL( "SetPreferredVideoEncapsulationL" )
iMediaRecorder->SetPreferredVideoEncapsulationL( EDuElementaryStream );
- }
+ }
__V_SOURCESINK_CONTROLL( "SetVideoCodingOptionsL" )
//set mediarecorder to insert GOB:s
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/group/UT_CMCCVideoSourceSink.mmp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/group/UT_CMCCVideoSourceSink.mmp Fri May 14 15:11:40 2010 +0300
@@ -44,7 +44,6 @@
SOURCE MccVideoSource.cpp
SOURCE MccVideoSourceWrapper.cpp
SOURCE MccVideoSourceSinkFactory.cpp
-SOURCE MccRedrawHandler.cpp
SOURCE mccvideosourcekeyretriever.cpp
SOURCEPATH ../src
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/src/UT_CMCCVideoSinkImpl.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/src/UT_CMCCVideoSinkImpl.cpp Fri May 14 15:11:40 2010 +0300
@@ -41,6 +41,7 @@
#include "Mcctesteventhandler.h"
#include "mmcccodecamr.h"
#include "mccvideosinkuser.h"
+#include "ws_stubs_helper.h"
const TInt KVideoSinkTestFramerateNormal = 15;
@@ -761,10 +762,16 @@
settings.iRotation = EMccNone;
// No change
+ TWsStubsHelper::Reset();
+ TInt numWindowCreated = TWsStubsHelper::NumWindowsCreated();
iSinkImpl->UpdateSettingsL( settings, EFalse );
+ EUNIT_ASSERT( numWindowCreated == TWsStubsHelper::NumWindowsCreated() );
+ EUNIT_ASSERT( TWsStubsHelper::CurrentDrawMode() != CGraphicsContext::EDrawModeWriteAlpha );
// Force
iSinkImpl->UpdateSettingsL( settings, ETrue );
+ EUNIT_ASSERT( ++numWindowCreated == TWsStubsHelper::NumWindowsCreated() ); // Window was recreated
+ EUNIT_ASSERT( TWsStubsHelper::CurrentDrawMode() == CGraphicsContext::EDrawModeWriteAlpha );
// Settings changed
settings.iRotation = EMccClockwise180Degree;
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/src/UT_CMCCVideoSourceImpl.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/src/UT_CMCCVideoSourceImpl.cpp Fri May 14 15:11:40 2010 +0300
@@ -338,6 +338,11 @@
iSourceImpl->SetVideoCodecL( codecInfo );
iSourceImpl->SourcePrimeL();
EUNIT_ASSERT( iSourceImpl->iVideoCodecFourCC->Des().FindF( KH263SdpName ) != KErrNotFound );
+ // Encoder uid should not be set in case of H263 is used
+ CCMRMediaRecorderStub* stub =
+ reinterpret_cast<CCMRMediaRecorderStub*>( iSourceImpl->iMediaRecorder->iMediaRecorder );
+ EUNIT_ASSERT( stub->iEncoderUid == KNullUid );
+ EUNIT_ASSERT( stub->iEncapsulation != EDuElementaryStream ); // Not forced in H263 case
}
void UT_CMccVideoSourceImpl::UT_CMccVideoSourceImpl_SourcePrimeL2L( )
@@ -436,6 +441,7 @@
CCMRMediaRecorderStub* stub =
reinterpret_cast<CCMRMediaRecorderStub*>( iSourceImpl->iMediaRecorder->iMediaRecorder );
EUNIT_ASSERT( stub->iEncoderUid != KNullUid );
+ EUNIT_ASSERT( stub->iEncapsulation == EDuElementaryStream ); // Forced in AVC case
// Multiple codecs prepare
iSourceImpl->SourceStopL();
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/stubs/inc/CCMRMediaRecorder.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/stubs/inc/CCMRMediaRecorder.h Fri May 14 15:11:40 2010 +0300
@@ -546,6 +546,8 @@
TUid iEncoderUid;
+ TVideoDataUnitEncapsulation iEncapsulation;
+
};
#endif // CCMRMEDIARECORDER_H
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/stubs/src/CCMRMediaRecorder_STUB.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/stubs/src/CCMRMediaRecorder_STUB.cpp Fri May 14 15:11:40 2010 +0300
@@ -36,6 +36,7 @@
{
iCurrentState = CCMRMediaRecorderStub::EStateNone;
iVideoBitrate = 64000;
+ iEncapsulation = EDuGenericPayload;
}
CCMRMediaRecorderStub::~CCMRMediaRecorderStub()
@@ -231,9 +232,10 @@
iEncoderUid = aEncoder;
}
-void CCMRMediaRecorderStub::SetPreferredVideoEncapsulationL(TVideoDataUnitEncapsulation /*aCapsulation*/)
+void CCMRMediaRecorderStub::SetPreferredVideoEncapsulationL(TVideoDataUnitEncapsulation aCapsulation)
{
iLastFunctionCall = ETestPreferredEncapsulation;
+ iEncapsulation = aCapsulation;
}
// STUB STUFF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimediacommscontroller/tsrc/stubs/inc/ws_stubs_helper.h Fri May 14 15:11:40 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+#ifndef WSSTUBSHELPER_H
+#define WSSTUBSHELPER_H
+
+// INCLUDES
+#include <w32std.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*
+*/
+class TWsStubsHelper
+ {
+public:
+ static CGraphicsContext::TDrawMode CurrentDrawMode();
+ static TInt NumWindowsCreated();
+ static void Reset();
+
+ };
+
+#endif // WSSTUBSHELPER_H
+
+// End of File
--- a/multimediacommscontroller/tsrc/stubs/src/ws_stubs.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommscontroller/tsrc/stubs/src/ws_stubs.cpp Fri May 14 15:11:40 2010 +0300
@@ -16,6 +16,26 @@
*/
#include <w32std.h>
+#include "ws_stubs_helper.h"
+
+static CGraphicsContext::TDrawMode testDrawMode = CGraphicsContext::EDrawModeAND;
+static TInt testNumWindowsCreated = 0;
+
+CGraphicsContext::TDrawMode TWsStubsHelper::CurrentDrawMode()
+{
+ return testDrawMode;
+}
+
+TInt TWsStubsHelper::NumWindowsCreated()
+{
+ return testNumWindowsCreated;
+}
+
+void TWsStubsHelper::Reset()
+{
+ testDrawMode = CGraphicsContext::EDrawModeAND;
+ testNumWindowsCreated = 0;
+}
// -----------------------------------------------------------------------------
// CWindowGc
@@ -48,8 +68,9 @@
}
void CWindowGc::SetDrawMode( TDrawMode aDrawingMode )
{
-
+ testDrawMode = aDrawingMode;
}
+
void CWindowGc::Deactivate()
{
@@ -145,6 +166,7 @@
}
TInt RWindow::Construct(const RWindowTreeNode &parent,TUint32 aHandle)
{
+ testNumWindowsCreated++;
return KErrNone;
}
void RWindow::BeginRedraw(const TRect &aRect)
@@ -262,6 +284,11 @@
return KErrNone;
}
+void RWindowGroup::AutoForeground(TBool /*aState*/)
+ {
+
+ }
+
// -----------------------------------------------------------------------------
// RDrawableWindow
// -----------------------------------------------------------------------------
--- a/multimediacommsengine/mmceshared/src/mcecomcodec.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmceshared/src/mcecomcodec.cpp Fri May 14 15:11:40 2010 +0300
@@ -228,7 +228,14 @@
const TDesC8& /*aFmtpValue*/,
TBool /*aIsStrictMatch*/ )
{
- return aRtpmapValue.FindF( iSdpName ) == 0;
+ // find MIME type
+ TInt slashPos = aRtpmapValue.Find( _L8( "/" ) );
+ if ( slashPos != KErrNotFound )
+ {
+ return aRtpmapValue.Left(slashPos).Compare( iSdpName ) == 0;
+ }
+
+ return aRtpmapValue.FindF(iSdpName) == 0;
}
// -----------------------------------------------------------------------------
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/inc/mcesdpsession.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/inc/mcesdpsession.h Fri May 14 15:11:40 2010 +0300
@@ -409,7 +409,8 @@
// old local port, used for refresh
TUint iOldLocalMediaPort;
-
+
+ TBool iStoreRemoteOrigin;
//definitions for unit testing
MCEMM_UT_DEFINITIONS
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemedianegotiated.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemedianegotiated.cpp Fri May 14 15:11:40 2010 +0300
@@ -286,9 +286,11 @@
TMceSipWarningCode TMceMediaNegotiated::TMceAnswererEndState::DecodeL( CSdpDocument& aSdpDocument )
{
MCEMM_DEBUG("TMceMediaNegotiated::TMceAnswererEndState::DecodeL(), Entry ");
-
+
+ iSession.SdpSession().iStoreRemoteOrigin = EFalse;
TMceSipWarningCode code =
iSession.SdpSession().DecodeOfferL( aSdpDocument, iSession );
+ iSession.SdpSession().iStoreRemoteOrigin = ETrue;
MCEMM_DEBUG("TMceMediaNegotiated::TMceAnswererEndState::DecodeL(), Exit ");
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesdpsession.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesdpsession.cpp Fri May 14 15:11:40 2010 +0300
@@ -95,7 +95,8 @@
iOOldSchoolProceeding( 0 ),
iOOldSchoolCompleted( 0 ),
iIsMaster( ETrue ),
- iOldLocalMediaPort( 0 )
+ iOldLocalMediaPort( 0 ),
+ iStoreRemoteOrigin ( ETrue )
{
iSessionId = GetRandomNumber();
iSessionVersion = GetRandomNumber();
@@ -508,11 +509,15 @@
MCEMM_DEBUG("CMceSdpSession::DecodeOfferL(), Exit ")
return KMceSipWarnIncompatibleMediaFormat;
}
-
- // store the remote o= field
- StoreRemoteOriginL();
- // store the remote a= field
- StoreRemoteMediaFieldsL();
+
+ //avoid to store the value second time when in nat environment
+ if ( iStoreRemoteOrigin )
+ {
+ // store the remote o= field
+ StoreRemoteOriginL();
+ // store the remote a= field
+ StoreRemoteMediaFieldsL();
+ }
//set remote ip address
result = SetRemoteIpAddressL( aSession, aSdpDocument );
@@ -921,7 +926,28 @@
CSdpConnectionField* connfield = aSdpDocument.ConnectionField();
const TInetAddr* inetAddr = NULL;
- if( connfield )
+ // find "c-" line from media level
+ TInt index = 0;
+ TBool found = ETrue;
+ while( found && index < mediaLines.Count() )
+ {
+ RPointerArray<CSdpConnectionField>& connfields =
+ mediaLines[index]->ConnectionFields();
+
+ if ( mediaLines[index++]->Port() > 0 )
+ {
+ TInt cfindex = 0;
+ TBool cffound = EFalse;
+ while( !cffound && cfindex < connfields.Count() )
+ {
+ inetAddr = connfields[cfindex++]->InetAddress();
+ cffound = MCE_NOT_NULL_PTR( inetAddr );
+ }
+ found = cffound;
+ }
+ }
+
+ if( connfield && !found )
{
inetAddr = connfield->InetAddress();
if( inetAddr )
@@ -931,29 +957,6 @@
MCE_SET_REMOTE_IP_ADDR( &aSession, inetAddress );
}
}
-
- if ( !inetAddr )
- {
- TInt index = 0;
- TBool found = ETrue;
- while( found && index < mediaLines.Count() )
- {
- RPointerArray<CSdpConnectionField>& connfields =
- mediaLines[index]->ConnectionFields();
-
- if ( mediaLines[index++]->Port() > 0 )
- {
- TInt cfindex = 0;
- TBool cffound = EFalse;
- while( !cffound && cfindex < connfields.Count() )
- {
- inetAddr = connfields[cfindex++]->InetAddress();
- cffound = MCE_NOT_NULL_PTR( inetAddr );
- }
- found = cffound;
- }
- }
- }
if ( inetAddr )
{
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/inc/UT_CMCESdpSession.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/inc/UT_CMCESdpSession.h Fri May 14 15:11:40 2010 +0300
@@ -120,6 +120,8 @@
void UT_CMceSdpSession_DecodeOfferL_2L();
void UT_CMceSdpSession_DecodeOfferL_3L( );
+
+ void UT_CMceSdpSession_DecodeOfferL_4L( );
void UT_CMceSdpSession_ForkLL();
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/src/UT_CMCESdpSession.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/src/UT_CMCESdpSession.cpp Fri May 14 15:11:40 2010 +0300
@@ -210,10 +210,10 @@
_LIT8( KConnectionField2, "v=0\r\n\
o=- 123 123 IN IP4 0.0.0.0\r\n\
s=-\r\n\
-c=IN IP4 10.36.7.239\r\n\
+c=IN IP4 10.36.7.229\r\n\
t=0 0\r\n\
m=audio 5000/1 RTP/AVP 96\r\n\
-c=IN IP4 10.36.7.229\r\n\
+c=IN IP4 10.36.7.239\r\n\
a=rtpmap:96 AMR/8000\r\n\
m=video 0 RTP/AVP 97\r\n\
c=IN IP4 193.65.182.50\r\n");
@@ -1333,6 +1333,35 @@
CleanupStack::PopAndDestroy( offer3 );
}
+
+void UT_CMceSdpSession::UT_CMceSdpSession_DecodeOfferL_4L()
+ {
+ iSdpSession->SetMediaSession( iInSession );
+ iInSession->AttachSDPSessionL( *iSdpSession );
+
+ TInetAddr remoteIP;
+ remoteIP.SetAddress( INET_ADDR( 10,10,10,10 ) );
+
+ _LIT8( KMyUserName, "username" );
+ const TInt64 KSessionId( 1234 );
+ const TInt64 KSessionVersion( 5678 );
+ CSdpOriginField* remoteorigin =
+ CSdpOriginField::NewL( KMyUserName, KSessionId, KSessionVersion, remoteIP );
+ iSdpSession->iRemoteOrigin = remoteorigin;
+
+ iSdpSession->iStoreRemoteOrigin = EFalse;
+ CSdpDocument* offer = CSdpDocument::DecodeL( KMceMMTestSdpMessage_MT_Confield_In_MediaLine );
+ CleanupStack::PushL( offer );
+ TInt err = iSdpSession->DecodeOfferL( *offer, *iInSession );
+ EUNIT_ASSERT( err == KErrNone );
+ EUNIT_ASSERT( iSdpSession->iRemoteOrigin->InetAddress()->CmpAddr( remoteIP ) );
+
+ iSdpSession->iStoreRemoteOrigin = ETrue;
+ err = iSdpSession->DecodeOfferL( *offer, *iInSession );
+ EUNIT_ASSERT( err == KErrNone );
+ EUNIT_ASSERT( !iSdpSession->iRemoteOrigin->InetAddress()->CmpAddr( remoteIP ) );
+ CleanupStack::PopAndDestroy( offer );
+ }
void UT_CMceSdpSession::UT_CMceSdpSession_DecodeOfferLL_CreateAnswer_NOK_1( )
{
@@ -2851,6 +2880,13 @@
"DecodeOffer3L",
"FUNCTIONALITY",
SetupL, UT_CMceSdpSession_DecodeOfferL_3L, Teardown)
+
+EUNIT_TEST(
+ "iStoreRemoteOrigin - test",
+ "CMceSdpSession",
+ "DecodeOffer4L",
+ "FUNCTIONALITY",
+ SetupL, UT_CMceSdpSession_DecodeOfferL_4L, Teardown)
EUNIT_TEST(
"ForkL - test",
--- a/multimediacommsengine/mmcesrv/mmceserver/src/mcesipmanager.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmceserver/src/mcesipmanager.cpp Fri May 14 15:11:40 2010 +0300
@@ -1084,5 +1084,21 @@
}
}
}
+
+ // Update orphan subsessions
+ RPointerArray<CMceCsSubSession>& orphanSubSessions = iOrphanSubSessions->SubSessions();
+ TInt orphanSubSessionCount = orphanSubSessions.Count();
+
+ for ( TInt j = 0; j < orphanSubSessionCount; ++j )
+ {
+ CSIPProfile& subSessionProfile = orphanSubSessions[ j ]->Profile();
+ if ( &subSessionProfile == &aOldProfile )
+ {
+ MCESRV_DEBUG_DVALUE("update orphan subsession profile, j", j )
+ MCESRV_DEBUG_DVALUES("oldProfile", (TInt)&aOldProfile,
+ "newProfile", (TInt)&aNewProfile )
+ orphanSubSessions[ j ]->SetProfile( aNewProfile );
+ }
+ }
MCESRV_DEBUG("CMceSipManager::UpdateProfileToSubSessions, Exit")
}
--- a/multimediacommsengine/mmcesrv/mmceserver/src/mcestateestablished.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmceserver/src/mcestateestablished.cpp Fri May 14 15:11:40 2010 +0300
@@ -27,7 +27,7 @@
#include "mcenatmacros.h"
#include "mcesdpsession.h"
#include "mcesrvlogs.h"
-
+#include "mcenatsipsession.h"
// -----------------------------------------------------------------------------
// CMceStateEstablished::CMceStateEstablished
@@ -180,7 +180,12 @@
//and thus, refresh is launched (INVITE)
case EMceSessionRefresh:
{
- session.Actions().EncodeL();
+ session.Actions().EncodeL();
+ if ( session.IsNatSession() )
+ {
+ CMceNatSipSession* natSession = static_cast<CMceNatSipSession*>( &session );
+ natSession->CreateOfferL();
+ }
session.FCActions().UpdateFCOfferL( *session.Offer() );
session.Actions().SendSessionRefreshL();
break;
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/inc/UT_CMCESIPManager.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/inc/UT_CMCESIPManager.h Fri May 14 15:11:40 2010 +0300
@@ -102,6 +102,8 @@
void UT_CMceSipManager_SIPClientL();
void UT_CMceSipManager_OrphanSubSessionCountL();
+
+ void UT_CMceSipManager_UpdateProfileToSubSessionsL();
private: // Data
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/src/UT_CMCESIPManager.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/src/UT_CMCESIPManager.cpp Fri May 14 15:11:40 2010 +0300
@@ -480,6 +480,43 @@
EUNIT_ASSERT( iManager->OrphanSubSessionCount() == 0 );
}
+void UT_CMceSipManager::UT_CMceSipManager_UpdateProfileToSubSessionsL()
+ {
+ iIds.iProfileID = 1;
+ iIds.iManagerType = KMceCSSIPSession;
+ iIds.iDialogType = KMceDlgTypeInvite;
+
+ CDesC8ArrayFlat* params = new (ELeave) CDesC8ArrayFlat( KMceArrayGranularity );
+ CleanupStack::PushL( params );
+ params->AppendL( _L8("User <user2@host>") );
+ params->AppendL( _L8("User <user@host>") );
+
+ CMceCsSubSession* subsession =
+ iManager->CreateSubSessionL( *iSession, iIds, *params );
+ CleanupStack::PushL( subsession );
+
+ CSIPProfile& profileOld = subsession->Profile();
+ EUNIT_ASSERT( &profileOld != NULL );
+ CSIPProfile& profileNew = iManager->ProfileL( 2 );
+ EUNIT_ASSERT( &profileNew != NULL );
+
+ CMceCsSessionImplementation& session = iManager->iClients[ 0 ]->Implementation();
+ RPointerArray<CMceCsSubSession>& subSessions = session.SubSessions();
+ subSessions.AppendL(subsession);
+
+ iManager->UpdateProfileToSubSessions(profileNew, profileOld);
+ EUNIT_ASSERT(&subsession->Profile() == &profileNew)
+ subSessions.Remove(0);
+
+ iManager->AddOrphanSubSessionL( subsession );
+ iManager->UpdateProfileToSubSessions(profileOld, profileNew);
+ RPointerArray<CMceCsSubSession>& orphanSubSessions = iManager->iOrphanSubSessions->SubSessions();
+ EUNIT_ASSERT(&subsession->Profile() == &profileOld)
+
+ CleanupStack::Pop( subsession );
+ CleanupStack::PopAndDestroy( params );
+ }
+
// TEST TABLE
@@ -621,6 +658,12 @@
"FUNCTIONALITY",
SetupL, UT_CMceSipManager_OrphanSubSessionCountL, Teardown)
+EUNIT_TEST(
+ "UpdateProfileToSubSessions - test ",
+ "CMceSipManager",
+ "UpdateProfileToSubSessions",
+ "FUNCTIONALITY",
+ SetupL, UT_CMceSipManager_UpdateProfileToSubSessionsL, Teardown)
EUNIT_END_TEST_TABLE
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/inc/sipprofile.h Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/inc/sipprofile.h Fri May 14 15:11:40 2010 +0300
@@ -325,6 +325,11 @@
*/
void ClearRegistry();
+ /**
+ * Set context id
+ */
+ void SetContextId(TInt aContextId);
+
public: // for unittesting
void SetParam( TUint aParam, HBufC8* aValue );
@@ -377,6 +382,8 @@
HBufC8* iRequestUriUser;
HBufC8* iContactHeader;
+ TInt iContextId;
+
//definitions for unit testing
MCESRV_UT_DEFINITIONS
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/src/sipprofile.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/src/sipprofile.cpp Fri May 14 15:11:40 2010 +0300
@@ -191,7 +191,7 @@
}
if( aParam == KSIPProfileId )
{
- aVal = 1;
+ aVal = ContextId();
}
return ret;
}
@@ -279,7 +279,7 @@
// -----------------------------------------------------------------------------
//
CSIPProfile::CSIPProfile():
- iEnabled(EFalse)
+ iEnabled(EFalse), iContextId(1)
{
}
@@ -307,6 +307,11 @@
{
return ETrue;
}
+
+void CSIPProfile::SetContextId(TInt aContextId)
+ {
+ iContextId = aContextId;
+ }
// -----------------------------------------------------------------------------
// CSIPProfile::ContextId
@@ -314,7 +319,7 @@
//
TUint32 CSIPProfile::ContextId() const
{
- return 1;
+ return iContextId;
}
// -----------------------------------------------------------------------------
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/src/sipprofileregistrybase.cpp Fri Apr 23 23:37:24 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/src/sipprofileregistrybase.cpp Fri May 14 15:11:40 2010 +0300
@@ -52,9 +52,13 @@
// stubs
CSIPProfileRegistry* reg = (CSIPProfileRegistry*) this;
CSIPProfile* profile = CSIPProfile::NewLC(reg);
+ CSIPProfile* profile2 = CSIPProfile::NewLC(reg);
+ profile2->SetContextId(2);
aProfiles.AppendL ( profile );
+ aProfiles.AppendL ( profile2 );
+ CleanupStack::Pop( profile2 );
CleanupStack::Pop( profile );
@@ -72,8 +76,12 @@
CSIPProfileRegistry* reg = (CSIPProfileRegistry*) this;
CSIPProfile* profile = CSIPProfile::NewLC( reg );
+ CSIPProfile* profile2 = CSIPProfile::NewLC(reg);
+ profile2->SetContextId(2);
aProfiles.AppendL ( profile );
+ aProfiles.AppendL ( profile2 );
+ CleanupStack::Pop( profile2 );
CleanupStack::Pop( profile );
}