h264_enc/arih264encwrapper/export_hdr/arivideoenccommon.h
changeset 0 bb31fbe78861
equal deleted inserted replaced
-1:000000000000 0:bb31fbe78861
       
     1 /*
       
     2 * Copyright (c) 2009 Aricent and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "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 * Aricent - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Defines the structures shared by HwDevice and wrapper
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef ARIVIDEOENCCOMMON_H
       
    20 #define ARIVIDEOENCCOMMON_H
       
    21 
       
    22 #include <e32def.h>
       
    23 #include <devvideobase.h>
       
    24 #include <avc.h>
       
    25 
       
    26 #define MAX_SCALABILITY_LAYERS 1
       
    27 
       
    28 
       
    29 //Control SUB MEssages
       
    30 enum TSetCommands
       
    31 	{
       
    32 	CONTROL_CMD_SET_BIT_RATE =	2051,
       
    33 	CONTROL_CMD_SET_FRAME_RATE = 2052,
       
    34 	CONTROL_CMD_SET_FORCED_I_FRAME = 2053,
       
    35 	CONTROL_CMD_SET_GOVLENGTH = 2054,
       
    36 	CONTROL_CMD_SET_CHANNEL_PACKET_LOSS_RATE = 2059,
       
    37 	CONTROL_CMD_SET_CHANNEL_BIT_ERROR_RATE = 2060,
       
    38 	CONTROL_CMD_SET_SEGMENT_TARGET_SIZE = 2061,
       
    39 	CONTROL_CMD_SET_RATE_CONTROL_OPTIONS = 2062,
       
    40 	CONTROL_CMD_SET_COMMIT_OPTIONS = 2065,
       
    41 	CONTROL_CMD_SET_COMPLEXITY_LEVEL = 2068,
       
    42 	CONTROL_CMD_SET_SLICELOSS  = 2069,
       
    43 	CONTROL_CMD_SET_PACKET_SIZE = 2070,
       
    44 	CONTROL_CMD_SET_PACKET_MODE = 2071,
       
    45 	CONTROL_CMD_SET_FRAME_MODE  = 2072
       
    46 	};
       
    47 
       
    48 enum TGetCommands
       
    49 	{
       
    50 	CONTROL_CMD_GET_CONFIG_HEADER = 3051,
       
    51 	CONTROL_CMD_GET_PACKET_OFFSET_DATA,
       
    52 	CONTROL_CMD_GET_MAX_FRAME_SIZE,
       
    53 	CONTROL_CMD_GET_MAX_NUM_PACKETS,
       
    54 	CONTROL_CMD_GET_CONFIG_LENGTH,
       
    55 	CONTROL_CMD_GET_PICTURES_SKIPPED
       
    56 	
       
    57 	
       
    58 	};
       
    59 	
       
    60 /*
       
    61 	Enumeration covering SetInputFormatL, SetOutputFormatL, SetInputDevice, 
       
    62 	SetNumBitrateLayersL, SetScalabilityLayerTypeL, SetGlobalReferenceOptions,
       
    63 	SetBufferOptionsL, SetMinRandomAccessRate,SetSourceMemoryL of Hw Device.
       
    64     All these seven methods can be called only before
       
    65     Initialize.
       
    66 */
       
    67 
       
    68 enum TOutputFormat
       
    69     {
       
    70 	EH264		=	0x00000001,
       
    71     };
       
    72 
       
    73 
       
    74 enum TPanicCodes
       
    75 	{
       
    76 	EPanicArgument=1,
       
    77 	EPanicInitializationPreCondViolation,
       
    78 	EPanicNotSupported,
       
    79 	EPanicNotPaused,
       
    80 	EPanicNotFreezed,
       
    81 	EPanicInvalidState,
       
    82 	EPanicAlreadyStopped
       
    83 	};
       
    84 
       
    85 enum TEncBeforeInitialize
       
    86     {
       
    87     EEncBeforeInitNone     =   0x00000000,
       
    88 	EEncInputFormat		=	0x00000001,
       
    89 	EEncOutputFormat		=	0x00000002,
       
    90 	EEncInputDevice		=	0x00000004,
       
    91 	EEncNumBitrateLayers	=	0x00000008,
       
    92 	EEncScalabilityLayer	=	0x00000010,
       
    93 	EEncGlobalRefOptions	=	0x00000020,
       
    94 	EEncBufferOptions		=	0x00000040,
       
    95     EEncRandomAccessRate   =	0x00000080,
       
    96     EEncSourceMemory       =   0x00000100,
       
    97     EEncInpBufferOptions   =   0x00000200,
       
    98 	EEncErrorProtectionLevelFEC = 0x00000400,
       
    99 	EEncSegmentTargetSize = 0x00000800,
       
   100 	EEncCodingStandardSpecificOptions	=	0x00001000,
       
   101 	EEncOutputRectSize	=	0x00002000,
       
   102 	EEncErrorsExpected	=	0x00004000,
       
   103 	EEncSourceCamera = 0x00008000,
       
   104 	EEncComplexityLevel = 0x00010000,
       
   105 	EEncLayerRefOptions	=	0x00020000,
       
   106 	};
       
   107 
       
   108 class TH264EncLayerReferenceOptions
       
   109 {
       
   110 public:
       
   111 	TUint	iMaxReferencePictures;
       
   112 	TUint	iMaxPictureOrderDelay;
       
   113 
       
   114 	TH264EncLayerReferenceOptions () :
       
   115 		iMaxReferencePictures (1),
       
   116 		iMaxPictureOrderDelay (0)
       
   117 	{
       
   118 	}
       
   119 };
       
   120 
       
   121 /*
       
   122  * slice loss structure 
       
   123 */
       
   124 class TH264EncSliceLoss
       
   125 {
       
   126 public:
       
   127 		TUint iFirstMacroblock;
       
   128 		TUint iNumMacroblocks;
       
   129 
       
   130 	TH264EncSliceLoss() :
       
   131 		iFirstMacroblock (0),
       
   132 		iNumMacroblocks (0)
       
   133 	{
       
   134 	}
       
   135 };
       
   136 
       
   137 /* 
       
   138  *	Parameters used by the HwDevice which are sent to codec
       
   139 */
       
   140 
       
   141 class TH264EncInitParams
       
   142     {
       
   143 public:
       
   144 	// Specifies which parameters are being sent in the Initialize method
       
   145     TUint32         	        iBeforeInitialize;
       
   146 	TUint32						iAfterInitialize;
       
   147 	
       
   148 	// For SetInputFormatL
       
   149 	TUncompressedVideoFormat	iInputFormat;
       
   150 	TInt32						iAspectRatio;
       
   151 	TSize						iPictureSize;
       
   152 
       
   153 	// For SetOutputFormatL
       
   154 	TOutputFormat               iOutputFormat;
       
   155 	TVideoDataUnitType			iDataUnitType; 
       
   156 	TVideoDataUnitEncapsulation iDataEncapsulation;
       
   157     TBool						iSegmentationAllowed;
       
   158 
       
   159     // For SetSourceMemoryL
       
   160     TReal                       iMaxPictureRate;
       
   161     TBool                       iConstantPictureRate;
       
   162     TBool                       iProcessRealtime;
       
   163     TUint                       iNumInputBuffers;
       
   164     TSize                       iInputSize;
       
   165 
       
   166 	// For SetNumBitrateLayersL
       
   167 	TUint						iNumBitRateLayers;
       
   168 	
       
   169 	// For SetScalabilityLayerTypeL
       
   170 	TUint						iLayer;
       
   171 	TScalabilityType			iScalabilityType;
       
   172 	
       
   173 	// For SetGlobalReferenceOptions & SetLayerReferenceOptions
       
   174 	TH264EncLayerReferenceOptions	iLayerReferenceOptions[
       
   175 	                             	               MAX_SCALABILITY_LAYERS];
       
   176 	
       
   177 	// For SetBufferOptionsL
       
   178 	TUint iMaxPreEncoderBufferPictures;
       
   179 	THrdVbvSpecification iHrdVbvSpec;
       
   180 	T3gppHrdVbvParams iHrdVbvParams;
       
   181 	TUint iMaxOutputBufferSize;
       
   182 	TUint iMaxCodedPictureSize;
       
   183 	TUint iMaxCodedSegmentSize;
       
   184 	TUint iMinNumOutputBuffers;
       
   185 
       
   186 	// For SetErrorProtectionLevelL
       
   187 	TUint iFECStrength;
       
   188 
       
   189     // For SetRamdomAccessRate
       
   190     TReal                       iRandomAccessRate;
       
   191 
       
   192 	// For SetOutputRectL
       
   193 	TRect	iOutputRect;
       
   194 
       
   195 	// For SetCodingStandardSpecificOptionsL
       
   196 	TAvcVideoMode		iCodingStandardSpecificOptions;
       
   197 
       
   198 
       
   199 	// For SetErrorsExpected
       
   200 	TBool iBitErrors;
       
   201 	TBool iPacketLosses;
       
   202 
       
   203 	// For SetMinRandomAccessRate
       
   204 	TReal iRate;
       
   205 	TInt  iLevel;
       
   206 
       
   207 	TUint iBitRate;
       
   208     TReal iTargetPictureRate; 
       
   209 	// complexity level
       
   210 	TUint iComplexityLevel;
       
   211 	
       
   212 	//for H324AnnexK VTFastCallSetUp
       
   213 	TBool iVTFastCallSetUp;
       
   214     };
       
   215 
       
   216 
       
   217 class TPictureCountersInfo
       
   218     {
       
   219 public:
       
   220     TUint iPicturesSkippedBufferOverflow;
       
   221     TUint iPicturesSkippedProcPower;
       
   222     TUint iPicturesSkippedRateControl;
       
   223     TUint iPicturesProcessed;
       
   224     TUint iInputPictures;
       
   225     };
       
   226 
       
   227 #endif //ARIVIDEOENCCOMMON_H