multimediacommscontroller/mmccfilesourcesink/inc/mccfilevideo.h
changeset 0 1bce908db942
child 12 91f50911ea81
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MCCFILEVIDEO_H
       
    22 #define MCCFILEVIDEO_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <mmf/common/mmfutilities.h>
       
    26 
       
    27 #include "mccfilesourcetypebase.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CMccFileSourceImpl;
       
    31 class MMccResources;
       
    32 
       
    33 class CMccFileVideo : public CMccFileSourceTypeBase
       
    34 	{
       
    35 public:
       
    36     static CMccFileVideo* NewL( CMccFileSourceImpl& aSource, 
       
    37                                 MMccResources* aMccResources = NULL,
       
    38                                 TUint32 aEndpointId = 0 );
       
    39 
       
    40 	~CMccFileVideo();
       
    41 	
       
    42 public:
       
    43 
       
    44     void FillBufferL( CMMFBuffer* aBuffer, MDataSink* aConsumer );
       
    45 	void DoSetPositionL( TUint32 aPosition );
       
    46   	CCMRMediaBuffer::TBufferType Type();
       
    47     TUint32 Position();
       
    48     TUint32 Duration();
       
    49     TUint32 AudioBitRate();
       
    50     TSize VideoFrameSize();
       
    51     TReal VideoFrameRateL();
       
    52 	void StartTimerL();
       
    53 	TFourCC GetFourCC();
       
    54 	TCallBack TickCallBack();
       
    55 	HBufC8* GetConfigKeyL();
       
    56 
       
    57 public:
       
    58     static TInt TickVideoL( TAny* aObject );
       
    59 	void ReadFrameL();
       
    60 	
       
    61 public:
       
    62     
       
    63     TBool ParseUpdateVideoDescriptions( MP4Handle aMP4Handle );
       
    64     
       
    65 private:
       
    66 
       
    67  	CMccFileVideo( CMccFileSourceImpl& aSource, 
       
    68                    MMccResources* aMccResources,
       
    69                    TUint32 aEndpointId );
       
    70  	
       
    71     void ConstructL();
       
    72     	
       
    73 private:
       
    74 
       
    75     /** 
       
    76     *Marks NALU boundaries for H264 frames
       
    77     */
       
    78 	void MarkWithNALUDelimiters( const TInt aAccessUnitSize, TDes8& aBuffer );
       
    79 	
       
    80 	/**
       
    81 	* Extracts Seq. Param NALUs & Pic Param NALUs from H264 decoder specific info
       
    82 	* @param "aBufferOut"
       
    83 	*		  creates buffer and fills with NALUs, NULL if no NALUs were present
       
    84 	* @param aSdpFormat, ETrue if sdp format buffer should be returned
       
    85 	*/
       
    86 	void ExtractH264ParameterSetNALUsL( HBufC8** aBufferOut, 
       
    87 	                                    TBool aSdpFormat = EFalse );
       
    88 	
       
    89 	/**
       
    90 	* Check whether parameter set NALUs should be inserted at current moment.
       
    91 	* @return ETrue is parameter set NALUs should be inserted now
       
    92 	*/	
       
    93 	TBool InsertParameterSetNALUs();
       
    94 	
       
    95 	TBool IsAVC();
       
    96 	
       
    97 	TTimeIntervalMicroSeconds GetTimeStamp();
       
    98 	
       
    99 	void WriteBufferL();
       
   100 
       
   101 private: //data
       
   102  
       
   103 	TUint32 iLength;
       
   104 	TUint32 iType;
       
   105 	TUint32 iWidth;
       
   106 	TUint32 iHeight;
       
   107 	TUint32 iBufferSize;
       
   108 	TUint32 iFrameSize;
       
   109 	TUint32 iLevel;
       
   110 
       
   111 	TReal   iFrameRate;
       
   112 	TBool   iIsVideoLeft;
       
   113 	TBool   iIsFirstFrame;
       
   114 	TFourCC	iFourCC;
       
   115     
       
   116 	MMccResources* iMccResources;
       
   117 	TUint32 iEndpointId;
       
   118     CCMRMediaBuffer::TBufferType iBufferType;
       
   119     
       
   120     HBufC8* iAVCNALUsBuffer;
       
   121     TTime iInsertParameterSetsTime;
       
   122     TBool iInsertParameterSets;
       
   123 
       
   124     
       
   125 private:   
       
   126    	#ifdef EUNIT_TEST
       
   127         friend class UT_CMccFileAudio;
       
   128     #endif
       
   129 	};
       
   130 
       
   131 #endif // MCCFILEVIDEO_H
       
   132 
       
   133 // end of file