diff -r 33a5d2bbf6fc -r 73a1feb507fb mmsharing/mmshengine/inc/musengclipsession.h --- a/mmsharing/mmshengine/inc/musengclipsession.h Thu Aug 19 09:51:39 2010 +0300 +++ b/mmsharing/mmshengine/inc/musengclipsession.h Tue Aug 31 15:12:07 2010 +0300 @@ -23,116 +23,35 @@ #include "musengmceoutsession.h" #include "musunittesting.h" - class MMusEngClipSessionObserver; class CMusEngLiveSession; class CMceFileSource; class CMceAudioStream; class CMceVideoStream; class CMceAudioCodec; +class CMusEngClipVideoPlayer; + class CMusEngClipSession : public CMusEngMceOutSession { MUS_UNITTEST( UT_CMusEngClipSession ) + MUS_UNITTEST( UT_CMusEngMceSession ) - public: + public: // Constructors and destructor /** - * + * Constructor */ - IMPORT_C static CMusEngClipSession* NewL( - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngClipSessionObserver& aClipSessionObserver, - TUint aSipProfileId = 0 ); + static CMusEngClipSession* NewL(); /** - * + * Destructor */ ~CMusEngClipSession(); - - public: // new API - - /** - * Sets file to be shared during session. - * @pre File cannot be DRM protected - * @post InviteL can be called - * @leave One of the system wide error codes - * @param aFileName Name of the file to be shared - */ - IMPORT_C void SetClipL( const TDesC& aFileName ); - - /** - * Starts or stops fast forwarding the clip. Clip is left paused after - * stopping the fast forwarding. - * @pre Session is ongoing - * @param aUseFFWD ETrue to start FFWD, EFalse to stop it. - */ - IMPORT_C void FastForwardL( TBool aUseFFWD ); - - /** - * Starts or stops fast rewinding the clip. Clip is left paused after - * stopping the fast rewinding. - * @pre Session is ongoing - * @param aUseFRWD ETrue to start FRWD, EFalse to stop it. - */ - IMPORT_C void FastRewindL( TBool aUseFRWD ); - - /** - * Returns current position as time interval. - */ - IMPORT_C TTimeIntervalSeconds PositionL(); - - /** - * Returns duration of current clip as time interval - */ - IMPORT_C TTimeIntervalSeconds DurationL(); - - /** - * - */ - IMPORT_C void SetPositionL (const TTimeIntervalSeconds &aPosition); - - /** - * Starts transcoding of file. After the transcoding is complete, - * file to be shared is changed into the transcoded file. - * @pre MMusEngClipSessionObserver::TranscodingNeeded is called - * @param aFileName Name of the transcoding output file. - */ - IMPORT_C void TranscodeL( const TFileName& aFileName ); - - /** - * Cancels transcoding of file. - * @pre TranscodeL has been called succesfully and transcoding - * is not completed - */ - IMPORT_C void CancelTranscodeL(); - - - public: // implementation of virtual API from CMusEngMceOutSession - - /** - * Resumes previously paused session. - * Continues showing file on display, resumes clip's audio, continues - * playing file and enables streaming to network. - * @leave KErrNotReady if called during FFWD or FRWD - */ - IMPORT_C void PlayL(); - - /** - * Pauses session. - * Holds display, mutes clip's audio, pauses file and - * disables all streaming to network. - * @leave KErrNotReady if called during FFWD or FRWD - */ - IMPORT_C void PauseL(); - - /** - * Tells whether session is paused or not - */ - IMPORT_C TBool IsPlayingL(); + public: // from MLcSession + + MLcVideoPlayer* LocalVideoPlayer(); protected: // implementation of virtual helper from CMusEngMceOutSession @@ -173,86 +92,26 @@ private: - /** - * - */ - CMusEngClipSession( MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngClipSessionObserver& aClipSessionObserver, - const TRect& aRect ); + CMusEngClipSession(); - /** - * @leave KErrPermissionDenied if file is DRM protected - */ - void ConstructL( TUint aSipProfileId ); + void ConstructL(); private: // HELPERS - - /** - * - */ - TBool IsProtectedFileL( const TDesC& aClipFile ); void AddAmrCodecL( CMceAudioStream& aAudioStream ); - void AddVideoCodecL( CMceVideoStream& aVideoStream, TBool aIgnoreNegotiated = EFalse ); - - TBool HasClipEnded(); + void AddVideoCodecL( CMceVideoStream& aVideoStream ); - TBool IsRewindFromEnd(); - - /** - * Returns current position as microseconds. - */ - TTimeIntervalMicroSeconds PositionMicroSecondsL(); - - /** - * Constructs audio stream structure during session completion and adds - * it to session. - * @param aLocalBundle All local streams are supposed to be added to - * this bundle - * @pre iSession != NULL - */ void ConstructAudioStructureL( CMceStreamBundle& aLocalBundle ); - void DetermineBufferingPeriod( CMceMediaStream& aStream ); - - TBool IsH264Supported() const; - - void HandleTranscodingFailureL( TInt aError ); - - TInt DoCompleteTranscoding(); - - void DeleteTranscodingDestinationFileL(); + void DetermineBufferingPeriod( CMceMediaStream& aStream ); private: // Data - - /** - * Reference to live session observer interface. - */ - MMusEngClipSessionObserver& iClipSessionObserver; - TFileName iFileName; - - TBool iTranscodingOngoing; - - TTime iFFWDStartTime; - TTime iFRWDStartTime; - + CMusEngClipVideoPlayer* iClipVideoPlayer; TTime iBufferingStartedTime; - TTimeIntervalMicroSeconds iBufferingPeriod; - - TTimeIntervalMicroSeconds iDelayFileEndingPos; - TTimeIntervalMicroSeconds iPreviousPos; - TBool iClipEnded; - - TFileName iTranscodingDestFileName; - TBool iRewindedToBeginning; - TBool iTranscodingRequiredDueMissingOptions; - TBool iPause; - }; -#endif +#endif // MUSHENGCLIPSESSION_H