summaryrefslogtreecommitdiffstats
path: root/libvideoeditor/vss/src
diff options
context:
space:
mode:
Diffstat (limited to 'libvideoeditor/vss/src')
-rwxr-xr-xlibvideoeditor/vss/src/Android.mk1
-rwxr-xr-xlibvideoeditor/vss/src/M4PTO3GPP_API.c62
-rwxr-xr-xlibvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c265
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c27
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_ClipAnalysis.c333
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_Edit.c351
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_EditVideo.c18
-rwxr-xr-xlibvideoeditor/vss/src/M4xVSS_API.c26
-rwxr-xr-xlibvideoeditor/vss/src/M4xVSS_internal.c8
9 files changed, 336 insertions, 755 deletions
diff --git a/libvideoeditor/vss/src/Android.mk b/libvideoeditor/vss/src/Android.mk
index 11483fa..2001f0d 100755
--- a/libvideoeditor/vss/src/Android.mk
+++ b/libvideoeditor/vss/src/Android.mk
@@ -69,6 +69,7 @@ LOCAL_C_INCLUDES += \
$(TOP)/frameworks/media/libvideoeditor/vss/common/inc \
$(TOP)/frameworks/media/libvideoeditor/vss/stagefrightshells/inc \
$(TOP)/frameworks/base/services/audioflinger \
+ $(TOP)/frameworks/base/include/media/stagefright/openmax
LOCAL_SHARED_LIBRARIES += libdl
diff --git a/libvideoeditor/vss/src/M4PTO3GPP_API.c b/libvideoeditor/vss/src/M4PTO3GPP_API.c
index 2d4afdf..042ffb7 100755
--- a/libvideoeditor/vss/src/M4PTO3GPP_API.c
+++ b/libvideoeditor/vss/src/M4PTO3GPP_API.c
@@ -311,7 +311,6 @@ M4OSA_ERR M4PTO3GPP_Open(M4PTO3GPP_Context pContext, M4PTO3GPP_Params* pParams)
* Video Format */
if( (M4VIDEOEDITING_kH263 != pParams->OutputVideoFormat) &&
(M4VIDEOEDITING_kMPEG4 != pParams->OutputVideoFormat) &&
- (M4VIDEOEDITING_kMPEG4_EMP != pParams->OutputVideoFormat) &&
(M4VIDEOEDITING_kH264 != pParams->OutputVideoFormat)) {
M4OSA_TRACE1_0("M4PTO3GPP_Open: Undefined output video format");
return ERR_PTO3GPP_UNDEFINED_OUTPUT_VIDEO_FORMAT;
@@ -1003,8 +1002,7 @@ M4OSA_ERR M4PTO3GPP_Close(M4PTO3GPP_Context pContext)
{
/* HW encoder: fetch the DSI from the shell video encoder, and feed it to the writer before
closing it. */
- if ( (M4VIDEOEDITING_kMPEG4_EMP == pC->m_Params.OutputVideoFormat)
- || (M4VIDEOEDITING_kMPEG4 == pC->m_Params.OutputVideoFormat)
+ if ((M4VIDEOEDITING_kMPEG4 == pC->m_Params.OutputVideoFormat)
|| (M4VIDEOEDITING_kH264 == pC->m_Params.OutputVideoFormat))
{
osaErr = pC->m_pEncoderInt->pFctGetOption(pC->m_pMp4EncoderContext,
@@ -1226,7 +1224,6 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
M4ENCODER_Format encFormat;
M4ENCODER_AdvancedParams EncParams; /**< Encoder advanced parameters */
M4SYS_StreamIDValue optionValue;
- M4OSA_Bool bActivateEmp = M4OSA_FALSE;
M4OSA_TRACE3_1("M4PTO3GPP_Ready4Processing called with pC=0x%x", pC);
@@ -1243,7 +1240,6 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
* Get the correct encoder interface */
switch(pC->m_Params.OutputVideoFormat)
{
- case M4VIDEOEDITING_kMPEG4_EMP: bActivateEmp = M4OSA_TRUE; /* no break */
case M4VIDEOEDITING_kMPEG4:
#ifdef M4VSS_SUPPORT_ENCODER_MPEG4
err = VideoEditorVideoEncoder_getInterface_MPEG4(&encFormat, &pC->m_pEncoderInt,
@@ -1407,7 +1403,6 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
* Video format */
switch(pC->m_Params.OutputVideoFormat)
{
- case M4VIDEOEDITING_kMPEG4_EMP :
case M4VIDEOEDITING_kMPEG4 :
EncParams.Format = M4ENCODER_kMPEG4;
break;
@@ -1482,28 +1477,6 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
}
/**
- * In case of EMP, we have to explicitely give an emp ftyp to the writer */
- if(M4OSA_TRUE == bActivateEmp)
- {
- M4VIDEOEDITING_FtypBox ftyp;
-
- ftyp.major_brand = M4VIDEOEDITING_BRAND_3GP4;
- ftyp.minor_version = M4VIDEOEDITING_BRAND_0000;
- ftyp.nbCompatibleBrands = 2;
- ftyp.compatible_brands[0] = M4VIDEOEDITING_BRAND_3GP4;
- ftyp.compatible_brands[1] = M4VIDEOEDITING_BRAND_EMP;
-
- err = pC->m_pWriterGlobInt->pFctSetOption(pC->m_p3gpWriterContext,
- (M4OSA_UInt32)M4WRITER_kSetFtypBox, (M4OSA_DataOption) &ftyp);
- if (M4NO_ERROR != err)
- {
- M4OSA_TRACE1_1("M4PTO3GPP_Ready4Processing:\
- m_pWriterGlobInt->pFctSetOption(M4WRITER_kSetFtypBox) returns 0x%x!", err);
- return err;
- }
- }
-
- /**
* Allocate and fill the video stream structures for the writer */
pC->m_pWriterVideoStream =
(M4SYS_StreamDescription*)M4OSA_32bitAlignedMalloc(sizeof(M4SYS_StreamDescription), M4PTO3GPP,
@@ -1541,7 +1514,6 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
* Video format */
switch(pC->m_Params.OutputVideoFormat)
{
- case M4VIDEOEDITING_kMPEG4_EMP:
case M4VIDEOEDITING_kMPEG4:
pC->m_pWriterVideoStream->streamType = M4SYS_kMPEG_4; break;
case M4VIDEOEDITING_kH263:
@@ -1709,28 +1681,20 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
EncParams.bInternalRegulation = M4OSA_TRUE; //M4OSA_FALSE;
EncParams.uiStartingQuantizerValue = M4PTO3GPP_QUANTIZER_STEP;
+ EncParams.videoProfile = pC->m_Params.videoProfile;
+ EncParams.videoLevel = pC->m_Params.videoLevel;
+
/**
* Other encoder settings */
- if(M4OSA_TRUE == bActivateEmp)
- {
- EncParams.uiHorizontalSearchRange = 15; /* set value */
- EncParams.uiVerticalSearchRange = 15; /* set value */
- EncParams.bErrorResilience = M4OSA_FALSE; /* no error resilience */
- EncParams.uiIVopPeriod = 15; /* one I frame every 15 frames */
- EncParams.uiMotionEstimationTools = 1; /* M4V_MOTION_EST_TOOLS_NO_4MV */
- EncParams.bAcPrediction = M4OSA_FALSE; /* no AC prediction */
- EncParams.bDataPartitioning = M4OSA_FALSE; /* no data partitioning */
- }
- else
- {
- EncParams.uiHorizontalSearchRange = 0; /* use default */
- EncParams.uiVerticalSearchRange = 0; /* use default */
- EncParams.bErrorResilience = M4OSA_FALSE; /* no error resilience */
- EncParams.uiIVopPeriod = 15; /* use default */
- EncParams.uiMotionEstimationTools = 0; /* M4V_MOTION_EST_TOOLS_ALL */
- EncParams.bAcPrediction = M4OSA_TRUE; /* use AC prediction */
- EncParams.bDataPartitioning = M4OSA_FALSE; /* no data partitioning */
- }
+
+ EncParams.uiHorizontalSearchRange = 0; /* use default */
+ EncParams.uiVerticalSearchRange = 0; /* use default */
+ EncParams.bErrorResilience = M4OSA_FALSE; /* no error resilience */
+ EncParams.uiIVopPeriod = 15; /* use default */
+ EncParams.uiMotionEstimationTools = 0; /* M4V_MOTION_EST_TOOLS_ALL */
+ EncParams.bAcPrediction = M4OSA_TRUE; /* use AC prediction */
+ EncParams.bDataPartitioning = M4OSA_FALSE; /* no data partitioning */
+
/**
* Create video encoder */
diff --git a/libvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c b/libvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c
index 4150070..3026ab9 100755
--- a/libvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c
+++ b/libvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c
@@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+#include "utils/Log.h"
#include "M4OSA_Types.h"
#include "M4OSA_Debug.h"
#include "M4VD_EXTERNAL_Interface.h"
#include "M4VD_Tools.h"
-
+#include "M4_VideoEditingCommon.h"
+#include "OMX_Video.h"
/**
************************************************************************
* @file M4VD_EXTERNAL_BitstreamParser.c
@@ -28,6 +29,58 @@
************************************************************************
*/
+typedef struct {
+ M4OSA_UInt8 code;
+ M4OSA_Int32 profile;
+ M4OSA_Int32 level;
+} codeProfileLevel;
+
+static codeProfileLevel mpeg4ProfileLevelTable[] = {
+ {0x01, OMX_VIDEO_MPEG4ProfileSimple, OMX_VIDEO_MPEG4Level1},
+ {0x02, OMX_VIDEO_MPEG4ProfileSimple, OMX_VIDEO_MPEG4Level2},
+ {0x03, OMX_VIDEO_MPEG4ProfileSimple, OMX_VIDEO_MPEG4Level3},
+ {0x04, OMX_VIDEO_MPEG4ProfileSimple, OMX_VIDEO_MPEG4Level4a},
+ {0x05, OMX_VIDEO_MPEG4ProfileSimple, OMX_VIDEO_MPEG4Level5},
+ {0x08, OMX_VIDEO_MPEG4ProfileSimple, OMX_VIDEO_MPEG4Level0},
+ {0x11, OMX_VIDEO_MPEG4ProfileSimpleScalable,OMX_VIDEO_MPEG4Level1},
+ {0x12, OMX_VIDEO_MPEG4ProfileSimpleScalable,OMX_VIDEO_MPEG4Level2},
+ {0x21, OMX_VIDEO_MPEG4ProfileCore, OMX_VIDEO_MPEG4Level1},
+ {0x22, OMX_VIDEO_MPEG4ProfileCore, OMX_VIDEO_MPEG4Level2},
+ {0x32, OMX_VIDEO_MPEG4ProfileMain, OMX_VIDEO_MPEG4Level2},
+ {0x33, OMX_VIDEO_MPEG4ProfileMain, OMX_VIDEO_MPEG4Level3},
+ {0x34, OMX_VIDEO_MPEG4ProfileMain, OMX_VIDEO_MPEG4Level4},
+ {0x42, OMX_VIDEO_MPEG4ProfileNbit, OMX_VIDEO_MPEG4Level2},
+ {0x51, OMX_VIDEO_MPEG4ProfileScalableTexture, OMX_VIDEO_MPEG4Level1},
+ {0x61, OMX_VIDEO_MPEG4ProfileSimpleFace, OMX_VIDEO_MPEG4Level1},
+ {0x62, OMX_VIDEO_MPEG4ProfileSimpleFace, OMX_VIDEO_MPEG4Level2},
+ {0x71, OMX_VIDEO_MPEG4ProfileBasicAnimated, OMX_VIDEO_MPEG4Level1},
+ {0x72, OMX_VIDEO_MPEG4ProfileBasicAnimated, OMX_VIDEO_MPEG4Level2},
+ {0x81, OMX_VIDEO_MPEG4ProfileHybrid, OMX_VIDEO_MPEG4Level1},
+ {0x82, OMX_VIDEO_MPEG4ProfileHybrid, OMX_VIDEO_MPEG4Level2},
+ {0x91, OMX_VIDEO_MPEG4ProfileAdvancedRealTime, OMX_VIDEO_MPEG4Level1},
+ {0x92, OMX_VIDEO_MPEG4ProfileAdvancedRealTime, OMX_VIDEO_MPEG4Level2},
+ {0x93, OMX_VIDEO_MPEG4ProfileAdvancedRealTime, OMX_VIDEO_MPEG4Level3},
+ {0x94, OMX_VIDEO_MPEG4ProfileAdvancedRealTime, OMX_VIDEO_MPEG4Level4},
+ {0xa1, OMX_VIDEO_MPEG4ProfileCoreScalable, OMX_VIDEO_MPEG4Level1},
+ {0xa2, OMX_VIDEO_MPEG4ProfileCoreScalable, OMX_VIDEO_MPEG4Level2},
+ {0xa3, OMX_VIDEO_MPEG4ProfileCoreScalable, OMX_VIDEO_MPEG4Level3},
+ {0xb1, OMX_VIDEO_MPEG4ProfileAdvancedCoding, OMX_VIDEO_MPEG4Level1},
+ {0xb2, OMX_VIDEO_MPEG4ProfileAdvancedCoding, OMX_VIDEO_MPEG4Level2},
+ {0xb3, OMX_VIDEO_MPEG4ProfileAdvancedCoding, OMX_VIDEO_MPEG4Level3},
+ {0xb4, OMX_VIDEO_MPEG4ProfileAdvancedCoding, OMX_VIDEO_MPEG4Level4},
+ {0xc1, OMX_VIDEO_MPEG4ProfileAdvancedCore, OMX_VIDEO_MPEG4Level1},
+ {0xc2, OMX_VIDEO_MPEG4ProfileAdvancedCore, OMX_VIDEO_MPEG4Level2},
+ {0xd1, OMX_VIDEO_MPEG4ProfileAdvancedScalable, OMX_VIDEO_MPEG4Level1},
+ {0xd2, OMX_VIDEO_MPEG4ProfileAdvancedScalable, OMX_VIDEO_MPEG4Level2},
+ {0xd3, OMX_VIDEO_MPEG4ProfileAdvancedScalable, OMX_VIDEO_MPEG4Level3},
+ {0xf0, OMX_VIDEO_MPEG4ProfileAdvancedSimple, OMX_VIDEO_MPEG4Level0},
+ {0xf1, OMX_VIDEO_MPEG4ProfileAdvancedSimple, OMX_VIDEO_MPEG4Level1},
+ {0xf2, OMX_VIDEO_MPEG4ProfileAdvancedSimple, OMX_VIDEO_MPEG4Level2},
+ {0xf3, OMX_VIDEO_MPEG4ProfileAdvancedSimple, OMX_VIDEO_MPEG4Level3},
+ {0xf4, OMX_VIDEO_MPEG4ProfileAdvancedSimple, OMX_VIDEO_MPEG4Level4},
+ {0xf5, OMX_VIDEO_MPEG4ProfileAdvancedSimple, OMX_VIDEO_MPEG4Level5}
+};
+
M4OSA_UInt32 M4VD_EXTERNAL_GetBitsFromMemory(M4VS_Bitstream_ctxt* parsingCtxt,
M4OSA_UInt32 nb_bits)
{
@@ -434,90 +487,212 @@ M4OSA_ERR M4DECODER_EXTERNAL_ParseVideoDSI(M4OSA_UInt8* pVol, M4OSA_Int32 aVolSi
return M4NO_ERROR;
}
-M4OSA_ERR M4DECODER_EXTERNAL_ParseAVCDSI(M4OSA_UInt8* pDSI, M4OSA_Int32 DSISize,
- M4DECODER_AVCProfileLevel *profile)
-{
- M4OSA_ERR err = M4NO_ERROR;
- M4OSA_Bool NALSPS_and_Profile0Found = M4OSA_FALSE;
+M4OSA_ERR getAVCProfileAndLevel(M4OSA_UInt8* pDSI, M4OSA_Int32 DSISize,
+ M4OSA_Int32 *pProfile, M4OSA_Int32 *pLevel) {
+
M4OSA_UInt16 index = 28; /* the 29th byte is SPS start */
M4OSA_Bool constraintSet3;
- if (DSISize <= index) {
- M4OSA_TRACE1_0("M4DECODER_EXTERNAL_ParseAVCDSI: DSI is invalid");
- *profile = M4DECODER_AVC_kProfile_and_Level_Out_Of_Range;
+ if ((pProfile == M4OSA_NULL) || (pLevel == M4OSA_NULL)) {
return M4ERR_PARAMETER;
}
- /* check for baseline profile */
- if(((pDSI[index] & 0x1f) == 0x07) && (pDSI[index+1] == 0x42))
- {
- NALSPS_and_Profile0Found = M4OSA_TRUE;
+ if ((DSISize <= index) || (pDSI == M4OSA_NULL)) {
+ LOGE("getAVCProfileAndLevel: DSI is invalid");
+ *pProfile = M4VIDEOEDITING_VIDEO_UNKNOWN_PROFILE;
+ *pLevel = M4VIDEOEDITING_VIDEO_UNKNOWN_LEVEL;
+ return M4ERR_PARAMETER;
}
- if(M4OSA_FALSE == NALSPS_and_Profile0Found)
- {
- M4OSA_TRACE1_1("M4DECODER_EXTERNAL_ParseAVCDSI: index bad = %d", index);
- *profile = M4DECODER_AVC_kProfile_and_Level_Out_Of_Range;
+ constraintSet3 = (pDSI[index+2] & 0x10);
+ LOGV("getAVCProfileAndLevel profile_byte %d, level_byte: %d constrain3flag",
+ pDSI[index+1], pDSI[index+3], constraintSet3);
+
+ switch (pDSI[index+1]) {
+ case 66:
+ *pProfile = OMX_VIDEO_AVCProfileBaseline;
+ break;
+ case 77:
+ *pProfile = OMX_VIDEO_AVCProfileMain;
+ break;
+ case 88:
+ *pProfile = OMX_VIDEO_AVCProfileExtended;
+ break;
+ case 100:
+ *pProfile = OMX_VIDEO_AVCProfileHigh;
+ break;
+ case 110:
+ *pProfile = OMX_VIDEO_AVCProfileHigh10;
+ break;
+ case 122:
+ *pProfile = OMX_VIDEO_AVCProfileHigh422;
+ break;
+ case 244:
+ *pProfile = OMX_VIDEO_AVCProfileHigh444;
+ break;
+ default:
+ *pProfile = M4VIDEOEDITING_VIDEO_UNKNOWN_PROFILE;
}
- else
- {
- M4OSA_TRACE1_1("M4DECODER_EXTERNAL_ParseAVCDSI: index = %d", index);
- constraintSet3 = (pDSI[index+2] & 0x10);
- M4OSA_TRACE1_1("M4DECODER_EXTERNAL_ParseAVCDSI: level = %d", pDSI[index+3]);
- switch(pDSI[index+3])
- {
+
+ switch (pDSI[index+3]) {
case 10:
- *profile = M4DECODER_AVC_kProfile_0_Level_1;
+ *pLevel = OMX_VIDEO_AVCLevel1;
break;
case 11:
- if(constraintSet3)
- *profile = M4DECODER_AVC_kProfile_0_Level_1b;
+ if (constraintSet3)
+ *pLevel = OMX_VIDEO_AVCLevel1b;
else
- *profile = M4DECODER_AVC_kProfile_0_Level_1_1;
+ *pLevel = OMX_VIDEO_AVCLevel11;
break;
case 12:
- *profile = M4DECODER_AVC_kProfile_0_Level_1_2;
+ *pLevel = OMX_VIDEO_AVCLevel12;
break;
case 13:
- *profile = M4DECODER_AVC_kProfile_0_Level_1_3;
+ *pLevel = OMX_VIDEO_AVCLevel13;
break;
case 20:
- *profile = M4DECODER_AVC_kProfile_0_Level_2;
+ *pLevel = OMX_VIDEO_AVCLevel2;
break;
case 21:
- *profile = M4DECODER_AVC_kProfile_0_Level_2_1;
+ *pLevel = OMX_VIDEO_AVCLevel21;
break;
case 22:
- *profile = M4DECODER_AVC_kProfile_0_Level_2_2;
+ *pLevel = OMX_VIDEO_AVCLevel22;
break;
case 30:
- *profile = M4DECODER_AVC_kProfile_0_Level_3;
+ *pLevel = OMX_VIDEO_AVCLevel3;
break;
case 31:
- *profile = M4DECODER_AVC_kProfile_0_Level_3_1;
+ *pLevel = OMX_VIDEO_AVCLevel31;
break;
case 32:
- *profile = M4DECODER_AVC_kProfile_0_Level_3_2;
+ *pLevel = OMX_VIDEO_AVCLevel32;
break;
case 40:
- *profile = M4DECODER_AVC_kProfile_0_Level_4;
+ *pLevel = OMX_VIDEO_AVCLevel4;
break;
case 41:
- *profile = M4DECODER_AVC_kProfile_0_Level_4_1;
+ *pLevel = OMX_VIDEO_AVCLevel41;
break;
case 42:
- *profile = M4DECODER_AVC_kProfile_0_Level_4_2;
+ *pLevel = OMX_VIDEO_AVCLevel42;
break;
case 50:
- *profile = M4DECODER_AVC_kProfile_0_Level_5;
+ *pLevel = OMX_VIDEO_AVCLevel5;
break;
case 51:
- *profile = M4DECODER_AVC_kProfile_0_Level_5_1;
+ *pLevel = OMX_VIDEO_AVCLevel51;
break;
default:
- *profile = M4DECODER_AVC_kProfile_and_Level_Out_Of_Range;
- }
+ *pLevel = M4VIDEOEDITING_VIDEO_UNKNOWN_LEVEL;
}
- return err;
+ LOGI("getAVCProfileAndLevel profile %ld level %ld", *pProfile, *pLevel);
+ return M4NO_ERROR;
}
+M4OSA_ERR getH263ProfileAndLevel(M4OSA_UInt8* pDSI, M4OSA_Int32 DSISize,
+ M4OSA_Int32 *pProfile, M4OSA_Int32 *pLevel) {
+
+ M4OSA_UInt16 index = 7; /* the 5th and 6th bytes contain the level and profile */
+
+ if ((pProfile == M4OSA_NULL) || (pLevel == M4OSA_NULL)) {
+ LOGE("getH263ProfileAndLevel invalid pointer for pProfile");
+ return M4ERR_PARAMETER;
+ }
+
+ if ((DSISize < index) || (pDSI == M4OSA_NULL)) {
+ LOGE("getH263ProfileAndLevel: DSI is invalid");
+ *pProfile = M4VIDEOEDITING_VIDEO_UNKNOWN_PROFILE;
+ *pLevel = M4VIDEOEDITING_VIDEO_UNKNOWN_LEVEL;
+ return M4ERR_PARAMETER;
+ }
+ LOGV("getH263ProfileAndLevel profile_byte %d, level_byte",
+ pDSI[6], pDSI[5]);
+ /* get the H263 level */
+ switch (pDSI[5]) {
+ case 10:
+ *pLevel = OMX_VIDEO_H263Level10;
+ break;
+ case 20:
+ *pLevel = OMX_VIDEO_H263Level20;
+ break;
+ case 30:
+ *pLevel = OMX_VIDEO_H263Level30;
+ break;
+ case 40:
+ *pLevel = OMX_VIDEO_H263Level40;
+ break;
+ case 45:
+ *pLevel = OMX_VIDEO_H263Level45;
+ break;
+ case 50:
+ *pLevel = OMX_VIDEO_H263Level50;
+ break;
+ case 60:
+ *pLevel = OMX_VIDEO_H263Level60;
+ break;
+ case 70:
+ *pLevel = OMX_VIDEO_H263Level70;
+ break;
+ default:
+ *pLevel = M4VIDEOEDITING_VIDEO_UNKNOWN_LEVEL;
+ }
+
+ /* get H263 profile */
+ switch (pDSI[6]) {
+ case 0:
+ *pProfile = OMX_VIDEO_H263ProfileBaseline;
+ break;
+ case 1:
+ *pProfile = OMX_VIDEO_H263ProfileH320Coding;
+ break;
+ case 2:
+ *pProfile = OMX_VIDEO_H263ProfileBackwardCompatible;
+ break;
+ case 3:
+ *pProfile = OMX_VIDEO_H263ProfileISWV2;
+ break;
+ case 4:
+ *pProfile = OMX_VIDEO_H263ProfileISWV3;
+ break;
+ case 5:
+ *pProfile = OMX_VIDEO_H263ProfileHighCompression;
+ break;
+ case 6:
+ *pProfile = OMX_VIDEO_H263ProfileInternet;
+ break;
+ case 7:
+ *pProfile = OMX_VIDEO_H263ProfileInterlace;
+ break;
+ case 8:
+ *pProfile = OMX_VIDEO_H263ProfileHighLatency;
+ break;
+ default:
+ *pProfile = M4VIDEOEDITING_VIDEO_UNKNOWN_PROFILE;
+ }
+ LOGI("getH263ProfileAndLevel profile %ld level %ld", *pProfile, *pLevel);
+ return M4NO_ERROR;
+}
+
+M4OSA_ERR getMPEG4ProfileAndLevel(M4OSA_UInt8 profileAndLevel,
+ M4OSA_Int32 *pProfile, M4OSA_Int32 *pLevel) {
+
+ M4OSA_UInt32 i = 0;
+ M4OSA_UInt32 length = 0;
+ if ((pProfile == M4OSA_NULL) || (pLevel == M4OSA_NULL)) {
+ return M4ERR_PARAMETER;
+ }
+ LOGV("getMPEG4ProfileAndLevel profileAndLevel %d", profileAndLevel);
+ length = sizeof(mpeg4ProfileLevelTable) /sizeof(mpeg4ProfileLevelTable[0]);
+ *pProfile = M4VIDEOEDITING_VIDEO_UNKNOWN_PROFILE;
+ *pLevel = M4VIDEOEDITING_VIDEO_UNKNOWN_LEVEL;
+ for (i = 0; i < length; i++) {
+ if (mpeg4ProfileLevelTable[i].code == profileAndLevel) {
+ *pProfile = mpeg4ProfileLevelTable[i].profile;
+ *pLevel = mpeg4ProfileLevelTable[i].level;
+ break;
+ }
+ }
+ LOGI("getMPEG4ProfileAndLevel profile %ld level %ld", *pProfile, *pLevel);
+ return M4NO_ERROR;
+}
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c b/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c
index c2bdd75..bf0bc06 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c
@@ -178,7 +178,6 @@ M4OSA_ERR M4VSS3GPP_audioMixingInit( M4VSS3GPP_AudioMixingContext *pContext,
pC->ewc.VideoStreamType = M4SYS_kVideoUnknown;
pC->ewc.bVideoDataPartitioning = M4OSA_FALSE;
pC->ewc.pVideoOutputDsi = M4OSA_NULL;
- pC->ewc.bActivateEmp = M4OSA_FALSE;
pC->ewc.AudioStreamType = M4SYS_kAudioUnknown;
pC->ewc.uiNbChannels = 1;
pC->ewc.pAudioOutputDsi = M4OSA_NULL;
@@ -925,16 +924,16 @@ M4VSS3GPP_intAudioMixingOpen( M4VSS3GPP_InternalAudioMixingContext *pC,
pC->pInputClipCtxt->pSettings->ClipProperties.uiVideoTimeScale;
pC->ewc.bVideoDataPartitioning =
pC->pInputClipCtxt->pSettings->ClipProperties.bMPEG4dataPartition;
-
+ pC->ewc.outputVideoProfile =
+ pC->pInputClipCtxt->pSettings->ClipProperties.uiVideoProfile;
+ pC->ewc.outputVideoLevel =
+ pC->pInputClipCtxt->pSettings->ClipProperties.uiVideoLevel;
switch( pC->pInputClipCtxt->pSettings->ClipProperties.VideoStreamType )
{
case M4VIDEOEDITING_kH263:
pC->ewc.VideoStreamType = M4SYS_kH263;
break;
- case M4VIDEOEDITING_kMPEG4_EMP:
- pC->ewc.bActivateEmp = M4OSA_TRUE; /* no break */
-
case M4VIDEOEDITING_kMPEG4:
pC->ewc.VideoStreamType = M4SYS_kMPEG_4;
break;
@@ -3906,6 +3905,8 @@ static M4OSA_ERR M4VSS3GPP_intAudioMixingCreateVideoEncoder(
EncParams.FrameWidth = pC->ewc.uiVideoWidth;
EncParams.FrameHeight = pC->ewc.uiVideoHeight;
EncParams.uiTimeScale = pC->ewc.uiVideoTimeScale;
+ EncParams.videoProfile = pC->ewc.outputVideoProfile;
+ EncParams.videoLevel = pC->ewc.outputVideoLevel;
/* No strict regulation in video editor */
/* Because of the effects and transitions we should allow more flexibility */
@@ -3977,19 +3978,6 @@ static M4OSA_ERR M4VSS3GPP_intAudioMixingCreateVideoEncoder(
return M4VSS3GPP_ERR_EDITING_UNSUPPORTED_VIDEO_FORMAT;
}
- /* In case of EMP we overwrite certain parameters */
- if( M4OSA_TRUE == pC->ewc.bActivateEmp )
- {
- EncParams.uiHorizontalSearchRange = 15; /* set value */
- EncParams.uiVerticalSearchRange = 15; /* set value */
- EncParams.bErrorResilience = M4OSA_FALSE; /* no error resilience */
- EncParams.uiIVopPeriod = 15; /* one I frame every 15 frames */
- EncParams.uiMotionEstimationTools = 1; /* M4V_MOTION_EST_TOOLS_NO_4MV */
- EncParams.bAcPrediction = M4OSA_FALSE; /* no AC prediction */
- EncParams.uiStartingQuantizerValue = 10; /* initial QP = 10 */
- EncParams.bDataPartitioning = M4OSA_FALSE; /* no data partitioning */
- }
-
EncParams.Bitrate =
pC->pInputClipCtxt->pSettings->ClipProperties.uiVideoBitrate;
@@ -4014,7 +4002,8 @@ static M4OSA_ERR M4VSS3GPP_intAudioMixingCreateVideoEncoder(
pC->ewc.encoderState = M4VSS3GPP_kEncoderClosed;
M4OSA_TRACE1_0(
"M4VSS3GPP_intAudioMixingCreateVideoEncoder: calling encoder pFctOpen");
-
+ M4OSA_TRACE1_2("vss: audio mix encoder open profile :%d, level %d",
+ EncParams.videoProfile, EncParams.videoLevel);
err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctOpen(pC->ewc.pEncContext,
&pC->ewc.WriterVideoAU, &EncParams);
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_ClipAnalysis.c b/libvideoeditor/vss/src/M4VSS3GPP_ClipAnalysis.c
index 723c0c1..e2c6d7a 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_ClipAnalysis.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_ClipAnalysis.c
@@ -33,12 +33,8 @@
#include "M4VSS3GPP_InternalTypes.h"
#include "M4VSS3GPP_InternalFunctions.h"
#include "M4VSS3GPP_InternalConfig.h"
-
-
-#ifdef M4VSS_ENABLE_EXTERNAL_DECODERS
#include "M4VD_EXTERNAL_Interface.h"
-#endif
/**
* OSAL headers */
@@ -377,10 +373,10 @@ M4OSA_ERR M4VSS3GPP_intBuildAnalysis( M4VSS3GPP_ClipContext *pClipCtxt,
pClipProperties->uiVideoHeight = 0;
pClipProperties->uiVideoTimeScale = 0;
pClipProperties->fAverageFrameRate = 0.0;
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kProfile_and_Level_Out_Of_Range;
- pClipProperties->uiH263level = 0;
- pClipProperties->uiVideoProfile = 0;
+ pClipProperties->uiVideoProfile =
+ M4VIDEOEDITING_VIDEO_UNKNOWN_PROFILE;
+ pClipProperties->uiVideoLevel =
+ M4VIDEOEDITING_VIDEO_UNKNOWN_LEVEL;
pClipProperties->bMPEG4dataPartition = M4OSA_FALSE;
pClipProperties->bMPEG4rvlc = M4OSA_FALSE;
pClipProperties->bMPEG4resynchMarker = M4OSA_FALSE;
@@ -403,7 +399,6 @@ M4OSA_ERR M4VSS3GPP_intBuildAnalysis( M4VSS3GPP_ClipContext *pClipCtxt,
pClipProperties->VideoStreamType = M4VIDEOEDITING_kMPEG4;
-#ifdef M4VSS_ENABLE_EXTERNAL_DECODERS
/* This issue is so incredibly stupid that it's depressing. Basically, a file can be analysed
outside of any context (besides that of the clip itself), so that for instance two clips can
be checked for compatibility before allocating an edit context for editing them. But this
@@ -422,10 +417,9 @@ M4OSA_ERR M4VSS3GPP_intBuildAnalysis( M4VSS3GPP_ClipContext *pClipCtxt,
whatsoever). */
err = M4DECODER_EXTERNAL_ParseVideoDSI(pClipCtxt->pVideoStream->
- m_basicProperties.m_pDecoderSpecificInfo,
- pClipCtxt->pVideoStream->
- m_basicProperties.m_decoderSpecificInfoSize,
- &DecConfigInfo, &dummySize);
+ m_basicProperties.m_pDecoderSpecificInfo,
+ pClipCtxt->pVideoStream->m_basicProperties.m_decoderSpecificInfoSize,
+ &DecConfigInfo, &dummySize);
if( M4NO_ERROR != err )
{
@@ -435,252 +429,66 @@ M4OSA_ERR M4VSS3GPP_intBuildAnalysis( M4VSS3GPP_ClipContext *pClipCtxt,
return err;
}
- #else /* an external decoder cannot be present, so we can rely on the
- software decoder to be installed already */
- /* Get MPEG-4 decoder config. */
-
- err = pClipCtxt->ShellAPI.m_pVideoDecoder->m_pFctGetOption(
- pClipCtxt->pViDecCtxt,
- M4DECODER_MPEG4_kOptionID_DecoderConfigInfo,
- &DecConfigInfo);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1("M4VSS3GPP_intBuildAnalysis(): m_pFctGetOption(DecConfigInfo)\
- returns 0x%x", err);
- return err;
- }
-
- #endif /* M4VSS_ENABLE_EXTERNAL_DECODERS */
-
- pClipProperties->uiVideoProfile = DecConfigInfo.uiProfile;
- pClipProperties->uiVideoTimeScale = DecConfigInfo.uiTimeScale;
+ pClipProperties->uiVideoTimeScale =
+ DecConfigInfo.uiTimeScale;
pClipProperties->bMPEG4dataPartition =
DecConfigInfo.bDataPartition;
- pClipProperties->bMPEG4rvlc = DecConfigInfo.bUseOfRVLC;
+ pClipProperties->bMPEG4rvlc =
+ DecConfigInfo.bUseOfRVLC;
pClipProperties->bMPEG4resynchMarker =
DecConfigInfo.uiUseOfResynchMarker;
-
- /* Supported enum value for profile and level */
- switch( pClipProperties->uiVideoProfile )
- {
- case 0x08:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kMPEG4_SP_Level_0;
- break;
-
- case 0x09:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kMPEG4_SP_Level_0b;
- break;
-
- case 0x01:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kMPEG4_SP_Level_1;
- break;
-
- case 0x02:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kMPEG4_SP_Level_2;
- break;
-
- case 0x03:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kMPEG4_SP_Level_3;
- break;
-
- case 0x04:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kMPEG4_SP_Level_4a;
- break;
-
- case 0x05:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kMPEG4_SP_Level_5;
- break;
+ err = getMPEG4ProfileAndLevel(DecConfigInfo.uiProfile,
+ &(pClipProperties->uiVideoProfile),
+ &(pClipProperties->uiVideoLevel));
+ if (M4NO_ERROR != err) {
+ M4OSA_TRACE1_1("M4VSS3GPP_intBuildAnalysis(): \
+ getMPEG4ProfileAndLevel returns 0x%08X", err);
+ return err;
}
break;
case M4DA_StreamTypeVideoH263:
pClipProperties->VideoStreamType = M4VIDEOEDITING_kH263;
-
- /* Get H263 level, which is sixth byte in the DSI */
- pClipProperties->uiH263level = pClipCtxt->pVideoStream->
- m_basicProperties.m_pDecoderSpecificInfo[5];
- /* Get H263 profile, which is fifth byte in the DSI */
- pClipProperties->uiVideoProfile = pClipCtxt->pVideoStream->
- m_basicProperties.m_pDecoderSpecificInfo[6];
/* H263 time scale is always 30000 */
pClipProperties->uiVideoTimeScale = 30000;
- /* Supported enum value for profile and level */
- if( pClipProperties->uiVideoProfile == 0 )
- {
- switch( pClipProperties->uiH263level )
- {
- case 10:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH263_Profile_0_Level_10;
- break;
-
- case 20:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH263_Profile_0_Level_20;
- break;
-
- case 30:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH263_Profile_0_Level_30;
- break;
-
- case 40:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH263_Profile_0_Level_40;
- break;
-
- case 45:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH263_Profile_0_Level_45;
- break;
- }
+ err = getH263ProfileAndLevel(pClipCtxt->pVideoStream->
+ m_basicProperties.m_pDecoderSpecificInfo,
+ pClipCtxt->pVideoStream->m_basicProperties.m_decoderSpecificInfoSize,
+ &pClipProperties->uiVideoProfile,
+ &pClipProperties->uiVideoLevel);
+ if (M4NO_ERROR != err) {
+ M4OSA_TRACE1_1("M4VSS3GPP_intBuildAnalysis(): \
+ getH263ProfileAndLevel returns 0x%08X", err);
+ return err;
}
break;
case M4DA_StreamTypeVideoMpeg4Avc:
pClipProperties->VideoStreamType = M4VIDEOEDITING_kH264;
-#ifdef M4VSS_ENABLE_EXTERNAL_DECODERS
-
- err = M4DECODER_EXTERNAL_ParseAVCDSI(pClipCtxt->pVideoStream->
- m_basicProperties.m_pDecoderSpecificInfo,
- pClipCtxt->pVideoStream->
- m_basicProperties.m_decoderSpecificInfoSize,
- &AVCProfle);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intBuildAnalysis(): \
- M4DECODER_EXTERNAL_ParseAVCDSI returns 0x%08X",
- err);
- return err;
- }
-
-#else /* an external decoder cannot be present, so we can rely on the
- software decoder to be installed already */
-
- err = pClipCtxt->ShellAPI.m_pVideoDecoder->m_pFctGetOption(
- pClipCtxt->pViDecCtxt,
- M4DECODER_kOptionID_AVCProfileAndLevel, &AVCProfle);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intBuildAnalysis(): m_pFctGetOption(AVCProfileInfo)\
- returns 0x%x", err);
+ err = getAVCProfileAndLevel(pClipCtxt->pVideoStream->
+ m_basicProperties.m_pDecoderSpecificInfo,
+ pClipCtxt->pVideoStream->m_basicProperties.m_decoderSpecificInfoSize,
+ &pClipProperties->uiVideoProfile,
+ &pClipProperties->uiVideoLevel);
+ if (M4NO_ERROR != err) {
+ M4OSA_TRACE1_1("M4VSS3GPP_intBuildAnalysis(): \
+ getAVCProfileAndLevel returns 0x%08X", err);
return err;
}
-
-#endif /* M4VSS_ENABLE_EXTERNAL_DECODERS */
-
- switch( AVCProfle )
- {
- case M4DECODER_AVC_kProfile_0_Level_1:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_1;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_1b:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_1b;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_1_1:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_1_1;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_1_2:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_1_2;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_1_3:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_1_3;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_2:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_2;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_2_1:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_2_1;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_2_2:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_2_2;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_3:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_3;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_3_1:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_3_1;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_3_2:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_3_2;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_4:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_4;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_4_1:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_4_1;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_4_2:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_4_2;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_5:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_5;
- break;
-
- case M4DECODER_AVC_kProfile_0_Level_5_1:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kH264_Profile_0_Level_5_1;
- break;
-
- case M4DECODER_AVC_kProfile_and_Level_Out_Of_Range:
- default:
- pClipProperties->ProfileAndLevel =
- M4VIDEOEDITING_kProfile_and_Level_Out_Of_Range;
- }
-
break;
default:
M4OSA_TRACE1_1(
"M4VSS3GPP_intBuildAnalysis: unknown input video format (0x%x),\
- returning M4NO_ERROR",pClipCtxt->pVideoStream->m_basicProperties.m_streamType);
- return
- M4NO_ERROR; /**< We do not return error here.
- The video format compatibility check will be done latter */
+ returning M4NO_ERROR",
+ pClipCtxt->pVideoStream->m_basicProperties.m_streamType);
+
+ /** We do not return error here.
+ * The video format compatibility check will be done latter */
+ return M4NO_ERROR;
}
pClipProperties->uiClipVideoDuration =
@@ -838,16 +646,6 @@ M4OSA_ERR M4VSS3GPP_intBuildAnalysis( M4VSS3GPP_ClipContext *pClipCtxt,
pClipCtxt->pReaderContext,
M4READER_kOptionID_3gpFtypBox, &pClipProperties->ftyp);
- if( M4NO_ERROR == err )
- {
- M4OSA_UInt8 i;
-
- for ( i = 0; i < pClipProperties->ftyp.nbCompatibleBrands; i++ )
- if( M4VIDEOEDITING_BRAND_EMP
- == pClipProperties->ftyp.compatible_brands[i] )
- pClipProperties->VideoStreamType = M4VIDEOEDITING_kMPEG4_EMP;
- }
-
/**
* We write the VSS 3GPP version in the clip analysis to be sure the integrator doesn't
* mix older analysis results with newer libraries */
@@ -916,59 +714,12 @@ M4OSA_ERR M4VSS3GPP_intCheckClipCompatibleWithVssEditing(
if( M4VIDEOEDITING_kNoneVideo
!= pClipProperties->VideoStreamType ) /**< if there is a video stream */
{
- /**
- * Check video format is MPEG-4 or H263 */
+ /* Check video format is MPEG-4, H263 or H264 */
switch( pClipProperties->VideoStreamType )
{
case M4VIDEOEDITING_kH263:
- if( M4VIDEOEDITING_kProfile_and_Level_Out_Of_Range
- == pClipProperties->ProfileAndLevel )
- {
- M4OSA_TRACE1_0(
- "M4VSS3GPP_intCheckClipCompatibleWithVssEditing():\
- unsupported H263 profile");
- video_err = M4VSS3GPP_ERR_EDITING_UNSUPPORTED_H263_PROFILE;
- break;
- }
- uiNbOfValidStreams++;
- pClipProperties->bVideoIsEditable = M4OSA_TRUE;
- break;
-
- case M4VIDEOEDITING_kMPEG4_EMP:
case M4VIDEOEDITING_kMPEG4:
- if( M4VIDEOEDITING_kProfile_and_Level_Out_Of_Range
- == pClipProperties->ProfileAndLevel )
- {
- M4OSA_TRACE1_0(
- "M4VSS3GPP_intCheckClipCompatibleWithVssEditing():\
- unsupported MPEG-4 profile");
- video_err = M4VSS3GPP_ERR_EDITING_UNSUPPORTED_MPEG4_PROFILE;
- break;
- }
-
- if( M4OSA_TRUE == pClipProperties->bMPEG4rvlc )
- {
- M4OSA_TRACE1_0(
- "M4VSS3GPP_intCheckClipCompatibleWithVssEditing():\
- unsupported MPEG-4 RVLC tool");
- video_err = M4VSS3GPP_ERR_EDITING_UNSUPPORTED_MPEG4_RVLC;
- break;
- }
- uiNbOfValidStreams++;
- pClipProperties->bVideoIsEditable = M4OSA_TRUE;
- break;
-
case M4VIDEOEDITING_kH264:
- if( M4VIDEOEDITING_kProfile_and_Level_Out_Of_Range
- == pClipProperties->ProfileAndLevel )
- {
- M4OSA_TRACE1_0(
- "M4VSS3GPP_intCheckClipCompatibleWithVssEditing():\
- unsupported H264 profile");
- video_err = M4VSS3GPP_ERR_EDITING_UNSUPPORTED_H264_PROFILE;
- break;
- }
-
uiNbOfValidStreams++;
pClipProperties->bVideoIsEditable = M4OSA_TRUE;
break;
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c
index 5bde983..9ac15a9 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c
@@ -189,7 +189,6 @@ M4OSA_ERR M4VSS3GPP_editInit( M4VSS3GPP_EditContext *pContext,
pC->ewc.bVideoDataPartitioning = M4OSA_FALSE;
pC->ewc.pVideoOutputDsi = M4OSA_NULL;
pC->ewc.uiVideoOutputDsiSize = 0;
- pC->ewc.bActivateEmp = M4OSA_FALSE;
pC->ewc.AudioStreamType = M4SYS_kAudioUnknown;
pC->ewc.uiNbChannels = 1;
pC->ewc.uiAudioBitrate = 0;
@@ -332,10 +331,10 @@ M4VSS3GPP_editCreateClipSettings( M4VSS3GPP_ClipSettings *pClipSettings,
pClipSettings->ClipProperties.uiVideoHeight = 0;
pClipSettings->ClipProperties.uiVideoTimeScale = 0;
pClipSettings->ClipProperties.fAverageFrameRate = 0.0;
- pClipSettings->ClipProperties.ProfileAndLevel =
- M4VIDEOEDITING_kProfile_and_Level_Out_Of_Range;
- pClipSettings->ClipProperties.uiH263level = 0;
- pClipSettings->ClipProperties.uiVideoProfile = 0;
+ pClipSettings->ClipProperties.uiVideoProfile =
+ M4VIDEOEDITING_VIDEO_UNKNOWN_PROFILE;
+ pClipSettings->ClipProperties.uiVideoLevel =
+ M4VIDEOEDITING_VIDEO_UNKNOWN_LEVEL;
pClipSettings->ClipProperties.bMPEG4dataPartition = M4OSA_FALSE;
pClipSettings->ClipProperties.bMPEG4rvlc = M4OSA_FALSE;
pClipSettings->ClipProperties.bMPEG4resynchMarker = M4OSA_FALSE;
@@ -951,6 +950,9 @@ M4OSA_ERR M4VSS3GPP_editOpen( M4VSS3GPP_EditContext pContext,
pC->ewc.uiVideoTimeScale = 30;
pC->ewc.bVideoDataPartitioning = 0;
+ /* Set output video profile and level */
+ pC->ewc.outputVideoProfile = pC->xVSS.outputVideoProfile;
+ pC->ewc.outputVideoLevel = pC->xVSS.outputVideoLevel;
switch(pC->xVSS.outputVideoFormat) {
case M4VIDEOEDITING_kH263:
@@ -2303,32 +2305,6 @@ M4VSS3GPP_intCreate3GPPOutputFile( M4VSS3GPP_EncodeWriteContext *pC_ewc,
return err;
}
- /**
- * In case of EMP, we have to explicitely give an emp ftyp to the writer */
- if( M4OSA_TRUE == pC_ewc->bActivateEmp )
- {
- M4VIDEOEDITING_FtypBox ftyp;
-
- ftyp.major_brand = M4VIDEOEDITING_BRAND_3GP4;
- ftyp.minor_version = M4VIDEOEDITING_BRAND_0000;
- ftyp.nbCompatibleBrands = 2;
- ftyp.compatible_brands[0] = M4VIDEOEDITING_BRAND_3GP4;
- ftyp.compatible_brands[1] = M4VIDEOEDITING_BRAND_EMP;
-
- err = pC_ShellAPI->pWriterGlobalFcts->pFctSetOption(
- pC_ewc->p3gpWriterContext,
- M4WRITER_kSetFtypBox, (M4OSA_DataOption) &ftyp);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intCreate3GPPOutputFile:\
- pWriterGlobalFcts->pFctSetOption(M4WRITER_kSetFtypBox) returns 0x%x!",
- err);
- return err;
- }
- }
-
if( M4SYS_kVideoUnknown != pC_ewc->VideoStreamType )
{
/**
@@ -2610,8 +2586,6 @@ static M4OSA_ERR
M4VSS3GPP_intComputeOutputVideoAndAudioDsi( M4VSS3GPP_InternalEditContext *pC,
M4OSA_UInt8 uiMasterClip )
{
- M4OSA_UInt8 uiCurrentLevel, uiNewLevel;
- M4OSA_UInt8 uiCurrentProf, uiNewProf;
M4OSA_Int32 iResynchMarkerDsiIndex;
M4_StreamHandler *pStreamForDsi;
M4VSS3GPP_ClipContext *pClip;
@@ -2660,313 +2634,20 @@ M4VSS3GPP_intComputeOutputVideoAndAudioDsi( M4VSS3GPP_InternalEditContext *pC,
pC->ewc.pVideoOutputDsi[4] = 0;
/**
- * We take the max level of all input streams, but 10 is the minimum */
- uiCurrentLevel = 10;
-
- for ( i = 0; i < pC->uiClipNumber; i++ )
- {
- if(pC->pClipList[i].bTranscodingRequired == M4OSA_FALSE) {
- uiNewLevel = pC->pClipList[i].ClipProperties.uiH263level;
- if (uiNewLevel > uiCurrentLevel) {
- uiCurrentLevel = uiNewLevel;
- }
- }
- }
-
- /**
- * Level is the sixth byte i the DSI */
- pC->ewc.pVideoOutputDsi[5] = uiCurrentLevel;
+ * Level is the sixth byte in the DSI */
+ pC->ewc.pVideoOutputDsi[5] = pC->xVSS.outputVideoLevel;
/**
- * Profile is always 0, and it's the seventh byte in the DSI */
- pC->ewc.pVideoOutputDsi[6] = 0;
+ * Profile is the seventh byte in the DSI*/
+ pC->ewc.pVideoOutputDsi[6] = pC->xVSS.outputVideoProfile;
}
/**
* MPEG-4 case */
- else if( M4SYS_kMPEG_4 == pC->ewc.VideoStreamType )
- {
- /**
- * Profile combination rules:
- * 8 and x -> x
- * 1, 2 or 3 -> max
- * 9 and 1 -> 2
- * 9 and 2 -> 2
- * 9 and 3 -> 3
- */
-
- /**
- * Note:
- * The part of the output video encoded by the VSS3GPP
- * have a profile of 8.
- * Since 8 is the less "strong" profile (8 and x --> x),
- * we can check only the input clips to compute the
- * profile of the output combined clip.
- */
-
- /**
- * Start with profile of the first clip */
- M4OSA_TRACE1_0("M4VSS3GPP_intComputeOutputVideoAndAudioDsi: \
- get DSI for Mpeg4 stream");
- if(M4OSA_NULL == pC->ewc.pEncContext) {
- M4OSA_TRACE1_0("M4VSS3GPP_intComputeOutputVideoAndAudioDsi: \
- pC->ewc.pEncContext is NULL");
- err = M4VSS3GPP_intCreateVideoEncoder(pC);
- if(M4NO_ERROR != err) {
- M4OSA_TRACE1_1("M4VSS3GPP_intComputeOutputVideoAndAudioDsi: \
- M4VSS3GPP_intCreateVideoEncoder returned error 0x%x", err);
- }
- }
- if(M4OSA_NULL != pC->ewc.pEncContext) {
- err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctGetOption(
- pC->ewc.pEncContext, M4ENCODER_kOptionID_EncoderHeader,
- (M4OSA_DataOption)&encHeader);
- if ( (M4NO_ERROR != err) || (M4OSA_NULL == encHeader->pBuf)) {
- M4OSA_TRACE1_1("M4VSS3GPP_intComputeOutputVideoAndAudioDsi: \
- failed to get the encoder header (err 0x%x)", err);
- M4OSA_TRACE1_2("M4VSS3GPP_intComputeOutputVideoAndAudioDsi: \
- encHeader->pBuf=0x%x, size=0x%x", encHeader->pBuf,
- encHeader->Size);
- }
- }
- err = M4DECODER_EXTERNAL_ParseVideoDSI((M4OSA_UInt8 *)encHeader->pBuf,
- encHeader->Size, &DecConfigInfo, &dummySize);
- if (M4NO_ERROR != err) {
- M4OSA_TRACE1_1("M4VSS3GPP_intBuildAnalysis(): \
- M4DECODER_EXTERNAL_ParseVideoDSI returns 0x%08X", err);
- return err;
- }
-
- uiCurrentProf = DecConfigInfo.uiProfile;
-
- /**
- * Combine current profile with the one of the next clip */
- for (i=0; i<pC->uiClipNumber; i++) {
- if(pC->pClipList[i].bTranscodingRequired == M4OSA_FALSE) {
- uiNewProf = pC->pClipList[i].ClipProperties.uiVideoProfile;
-
- switch( uiNewProf )
- {
- case 8:
- /**< 8 + x --> x */
- /**< uiCurrentProf is not updated */
- break;
-
- case 1:
- case 2:
- case 3:
- switch( uiCurrentProf )
- {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- /**< 1, 2, 3, 4 or 5 -> max */
- uiCurrentProf = (uiCurrentProf > uiNewProf)
- ? uiCurrentProf : uiNewProf;
- break;
-
- case 8: /**< 8 + x -> x */
- uiCurrentProf = uiNewProf;
- break;
-
- case 9:
- /**< 9 and 1 -> 2 */
- /**< 9 and 2 -> 2 */
- /**< 9 and 3 -> 3 */
- /**< 9 and 4 -> 4 */
- /**< 9 and 5 -> 5 */
- uiCurrentProf = (uiNewProf > 2) ? uiNewProf : 2;
- break;
- }
- break;
-
- case 9:
- switch( uiCurrentProf )
- {
- case 1:
- case 2:
- case 3:
- /**< 9 and 1 -> 2 */
- /**< 9 and 2 -> 2 */
- /**< 9 and 3 -> 3 */
- uiCurrentProf =
- (uiCurrentProf > 2) ? uiCurrentProf : 2;
- break;
-
- case 9: /**< 9 + x -> x */
- case 8: /**< 8 + x -> x */
- uiCurrentProf = uiNewProf;
- break;
- }
- }
- }
- }
-
- /**
- * Look for the DSI of an input video stream which would use the Resynch. Marker tool */
- i = 0;
- iResynchMarkerDsiIndex =
- 0; /**< By default we take the first DSI (if we find no Resynch Marker DSI) */
-
- while( i < pC->uiClipNumber )
- {
- if ((M4OSA_TRUE ==
- pC->pClipList[i].ClipProperties.bMPEG4resynchMarker) &&
- (pC->pClipList[i].bTranscodingRequired == M4OSA_FALSE)) {
- iResynchMarkerDsiIndex = i;
- break; /**< we found it, get out the while loop */
- }
- i++;
- }
-
- /**
- * Get the DSI of the clip found. If it is the first clip, it is already opened.
- * Else we must open it (and later close it...) */
- if( 0 == iResynchMarkerDsiIndex )
- {
- for (i=0; i<pC->uiClipNumber; i++) {
- if(pC->pClipList[i].bTranscodingRequired == M4OSA_FALSE) {
- /**
- * We can use the fast open mode and the skip audio mode
- to get the DSI */
- err = M4VSS3GPP_intClipInit(&pClip, pC->pOsaFileReadPtr);
- if (M4NO_ERROR != err) {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intComputeOutputVideoAndAudioDsi: \
- M4VSS3GPP_intClipInit() returns 0x%x!", err);
- if (M4OSA_NULL != pClip) {
- M4VSS3GPP_intClipCleanUp(pClip);
- }
- return err;
- }
- err = M4VSS3GPP_intClipOpen(
- pClip, &pC->pClipList[i],
- M4OSA_TRUE, M4OSA_TRUE,
- M4OSA_TRUE);
- if (M4NO_ERROR != err) {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intComputeOutputVideoAndAudioDsi: \
- M4VSS3GPP_intClipOpen() returns 0x%x!", err);
- M4VSS3GPP_intClipCleanUp(pClip);
- return err;
- }
- pStreamForDsi = &(pClip->pVideoStream->m_basicProperties);
- /*got the DSI */
-
- bGetDSiFromEncoder = M4OSA_TRUE;
-
- break;
- }
- }
- if(bGetDSiFromEncoder == M4OSA_FALSE) {
- /**
- * Allocate and copy the new DSI */
- pC->ewc.pVideoOutputDsi = (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(
- encHeader->Size, M4VSS3GPP, (M4OSA_Char *)"ewc dsi (MPEG4)");
- if (M4OSA_NULL == pC->ewc.pVideoOutputDsi) {
- M4OSA_TRACE1_0(
- "M4VSS3GPP_intComputeOutputVideoAndAudioDsi(): \
- unable to allocate pVideoOutputDsi (MPEG4)");
- return M4ERR_ALLOC;
- }
- pC->ewc.uiVideoOutputDsiSize = (M4OSA_UInt16)encHeader->Size;
- memcpy((void *)pC->ewc.pVideoOutputDsi,
- (void *)encHeader->pBuf, pC->ewc.uiVideoOutputDsiSize);
-
- }
-
- err = M4VSS3GPP_intDestroyVideoEncoder(pC);
- if(M4NO_ERROR != err) {
- M4OSA_TRACE1_1("M4VSS3GPP_intComputeOutputVideoAndAudioDsi: \
- M4VSS3GPP_intDestroyVideoEncoder error 0x%x", err);
- }
- }
- else
- {
- /**
- * We can use the fast open mode and the skip audio mode to get the DSI */
- err = M4VSS3GPP_intClipInit(&pClip, pC->pOsaFileReadPtr);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intComputeOutputVideoAndAudioDsi:\
- M4VSS3GPP_intClipInit() returns 0x%x!",
- err);
-
- if( M4OSA_NULL != pClip )
- {
- M4VSS3GPP_intClipCleanUp(pClip);
- }
- return err;
- }
-
- err = M4VSS3GPP_intClipOpen(pClip,
- &pC->pClipList[iResynchMarkerDsiIndex], M4OSA_TRUE,
- M4OSA_TRUE, M4OSA_TRUE);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intComputeOutputVideoAndAudioDsi:\
- M4VSS3GPP_intClipOpen() returns 0x%x!",
- err);
- M4VSS3GPP_intClipCleanUp(pClip);
- return err;
- }
-
- pStreamForDsi = &(pClip->pVideoStream->m_basicProperties);
- }
-
- if(pC->ewc.pVideoOutputDsi == M4OSA_NULL) {
-
- /**
- * Allocate and copy the new DSI */
- pC->ewc.pVideoOutputDsi = (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(
- pStreamForDsi->m_decoderSpecificInfoSize,
- M4VSS3GPP, (M4OSA_Char *)"pC->ewc.pVideoOutputDsi (MPEG4)");
-
- if( M4OSA_NULL == pC->ewc.pVideoOutputDsi )
- {
- M4OSA_TRACE1_0(
- "M4VSS3GPP_intComputeOutputVideoAndAudioDsi():\
- unable to allocate pVideoOutputDsi (MPEG4), returning M4ERR_ALLOC");
- return M4ERR_ALLOC;
- }
- pC->ewc.uiVideoOutputDsiSize =
- (M4OSA_UInt16)pStreamForDsi->m_decoderSpecificInfoSize;
- memcpy((void *)pC->ewc.pVideoOutputDsi,
- (void *)pStreamForDsi->m_pDecoderSpecificInfo,
- pC->ewc.uiVideoOutputDsiSize);
- }
-
- /**
- * We rewrite the profile in the output DSI because it may not be the good one
- * The profile and level is always at byte number 4 */
- (pC->ewc.pVideoOutputDsi)[4] = uiCurrentProf;
-
- /**
- * If a clip has been temporarily opened to get its DSI, close it */
- if( M4OSA_NULL != pClip )
- {
- err = M4VSS3GPP_intClipCleanUp(pClip);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intComputeOutputVideoAndAudioDsi:\
- M4VSS3GPP_intClipCleanUp() returns 0x%x!",
- err);
- return err;
- }
- }
- }
- else if( M4SYS_kH264 == pC->ewc.VideoStreamType )
- {
+ else if( M4SYS_kMPEG_4 == pC->ewc.VideoStreamType ||
+ M4SYS_kH264 == pC->ewc.VideoStreamType) {
- /* For H.264 encoder case
+ /* For MPEG4 and H.264 encoder case
* Fetch the DSI from the shell video encoder, and feed it to the writer before
closing it. */
@@ -3008,7 +2689,7 @@ M4VSS3GPP_intComputeOutputVideoAndAudioDsi( M4VSS3GPP_InternalEditContext *pC,
{
M4OSA_TRACE1_0(
"M4VSS3GPP_intComputeOutputVideoAndAudioDsi:\
- send DSI for H264 stream to 3GP writer");
+ send DSI for video stream to 3GP writer");
/**
* Allocate and copy the new DSI */
@@ -3020,7 +2701,7 @@ M4VSS3GPP_intComputeOutputVideoAndAudioDsi( M4VSS3GPP_InternalEditContext *pC,
{
M4OSA_TRACE1_0(
"M4VSS3GPP_intComputeOutputVideoAndAudioDsi():\
- unable to allocate pVideoOutputDsi (H264), returning M4ERR_ALLOC");
+ unable to allocate pVideoOutputDsi, returning M4ERR_ALLOC");
return M4ERR_ALLOC;
}
pC->ewc.uiVideoOutputDsiSize = (M4OSA_UInt16)encHeader->Size;
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c b/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c
index e6271ea..b880dc3 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c
@@ -2294,6 +2294,11 @@ M4OSA_ERR M4VSS3GPP_intCreateVideoEncoder( M4VSS3GPP_InternalEditContext *pC )
EncParams.uiStartingQuantizerValue = 10; /* initial QP = 10 */
EncParams.bDataPartitioning = M4OSA_FALSE; /* no data partitioning */
+ /**
+ * Set the video profile and level */
+ EncParams.videoProfile = pC->ewc.outputVideoProfile;
+ EncParams.videoLevel= pC->ewc.outputVideoLevel;
+
switch ( pC->ewc.VideoStreamType )
{
case M4SYS_kH263:
@@ -2350,19 +2355,6 @@ M4OSA_ERR M4VSS3GPP_intCreateVideoEncoder( M4VSS3GPP_InternalEditContext *pC )
return M4VSS3GPP_ERR_EDITING_UNSUPPORTED_VIDEO_FORMAT;
}
- /* In case of EMP we overwrite certain parameters */
- if( M4OSA_TRUE == pC->ewc.bActivateEmp )
- {
- EncParams.uiHorizontalSearchRange = 15; /* set value */
- EncParams.uiVerticalSearchRange = 15; /* set value */
- EncParams.bErrorResilience = M4OSA_FALSE; /* no error resilience */
- EncParams.uiIVopPeriod = 15; /* one I frame every 15 frames */
- EncParams.uiMotionEstimationTools = 1; /* M4V_MOTION_EST_TOOLS_NO_4MV */
- EncParams.bAcPrediction = M4OSA_FALSE; /* no AC prediction */
- EncParams.uiStartingQuantizerValue = 10; /* initial QP = 10 */
- EncParams.bDataPartitioning = M4OSA_FALSE; /* no data partitioning */
- }
-
if( pC->bIsMMS == M4OSA_FALSE )
{
EncParams.Bitrate = pC->xVSS.outputVideoBitrate;
diff --git a/libvideoeditor/vss/src/M4xVSS_API.c b/libvideoeditor/vss/src/M4xVSS_API.c
index 6bf8c81..a654f88 100755
--- a/libvideoeditor/vss/src/M4xVSS_API.c
+++ b/libvideoeditor/vss/src/M4xVSS_API.c
@@ -33,7 +33,8 @@
#include "M4OSA_CharStar.h"
// StageFright encoders require %16 resolution
#include "M4ENCODER_common.h"
-
+#include "M4DECODER_Common.h"
+#include "VideoEditorVideoDecoder.h"
/**
* VSS 3GPP API definition */
@@ -664,6 +665,10 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
!= pSettings->xVSS.outputVideoSize
|| xVSS_context->pSettings->xVSS.outputVideoFormat
!= pSettings->xVSS.outputVideoFormat
+ || xVSS_context->pSettings->xVSS.outputVideoProfile
+ != pSettings->xVSS.outputVideoProfile
+ || xVSS_context->pSettings->xVSS.outputVideoLevel
+ != pSettings->xVSS.outputVideoLevel
|| xVSS_context->pSettings->xVSS.outputAudioFormat
!= pSettings->xVSS.outputAudioFormat
|| xVSS_context->pSettings->xVSS.bAudioMono
@@ -796,6 +801,10 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/* Copy settings from user given structure to our "local" structure */
xVSS_context->pSettings->xVSS.outputVideoFormat =
pSettings->xVSS.outputVideoFormat;
+ xVSS_context->pSettings->xVSS.outputVideoProfile =
+ pSettings->xVSS.outputVideoProfile;
+ xVSS_context->pSettings->xVSS.outputVideoLevel =
+ pSettings->xVSS.outputVideoLevel;
xVSS_context->pSettings->xVSS.outputVideoSize =
pSettings->xVSS.outputVideoSize;
xVSS_context->pSettings->xVSS.outputAudioFormat =
@@ -888,8 +897,6 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
&& xVSS_context->pSettings->xVSS.outputVideoFormat
!= M4VIDEOEDITING_kH263
&& xVSS_context->pSettings->xVSS.outputVideoFormat
- != M4VIDEOEDITING_kMPEG4_EMP
- && xVSS_context->pSettings->xVSS.outputVideoFormat
!= M4VIDEOEDITING_kH264 )
{
xVSS_context->pSettings->xVSS.outputVideoFormat =
@@ -2498,6 +2505,10 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
pParams->OutputVideoFormat =
xVSS_context->pSettings->xVSS.outputVideoFormat;
+ pParams->outputVideoProfile =
+ xVSS_context->pSettings->xVSS.outputVideoProfile;
+ pParams->outputVideoLevel =
+ xVSS_context->pSettings->xVSS.outputVideoLevel;
pParams->OutputVideoFrameRate =
xVSS_context->pSettings->videoFrameRate;
pParams->OutputVideoFrameSize =
@@ -6317,3 +6328,12 @@ M4OSA_ERR M4xVSS_getVSS3GPPContext( M4OSA_Context pContext,
return err;
}
+
+M4OSA_ERR M4xVSS_getVideoDecoderCapabilities(M4DECODER_VideoDecoders **decoders) {
+ M4OSA_ERR err = M4NO_ERROR;
+
+ // Call the decoder api directly
+ // to get all the video decoder capablities.
+ err = VideoEditorVideoDecoder_getVideoDecodersAndCapabilities(decoders);
+ return err;
+}
diff --git a/libvideoeditor/vss/src/M4xVSS_internal.c b/libvideoeditor/vss/src/M4xVSS_internal.c
index 66e3b80..f4f4137 100755
--- a/libvideoeditor/vss/src/M4xVSS_internal.c
+++ b/libvideoeditor/vss/src/M4xVSS_internal.c
@@ -108,6 +108,8 @@ M4OSA_ERR M4xVSS_internalStartTranscoding(M4OSA_Context pContext)
MCS parameters chained list */
Params.OutputFileType = xVSS_context->pMCScurrentParams->OutputFileType;
Params.OutputVideoFormat = xVSS_context->pMCScurrentParams->OutputVideoFormat;
+ Params.outputVideoProfile= xVSS_context->pMCScurrentParams->outputVideoProfile;
+ Params.outputVideoLevel = xVSS_context->pMCScurrentParams->outputVideoLevel;
Params.OutputVideoFrameSize = xVSS_context->pMCScurrentParams->OutputVideoFrameSize;
Params.OutputVideoFrameRate = xVSS_context->pMCScurrentParams->OutputVideoFrameRate;
Params.OutputAudioFormat = xVSS_context->pMCScurrentParams->OutputAudioFormat;
@@ -1520,6 +1522,8 @@ M4OSA_ERR M4xVSS_internalStartConvertPictureTo3gp(M4OSA_Context pContext)
Params.OutputVideoFrameSize = xVSS_context->pSettings->xVSS.outputVideoSize;
Params.OutputVideoFormat = xVSS_context->pSettings->xVSS.outputVideoFormat;
+ Params.videoProfile = xVSS_context->pSettings->xVSS.outputVideoProfile;
+ Params.videoLevel = xVSS_context->pSettings->xVSS.outputVideoLevel;
/**
* Generate "dummy" amr file containing silence in temporary folder */
@@ -2370,6 +2374,10 @@ M4OSA_ERR M4xVSS_internalGenerateEditedFile(M4OSA_Context pContext)
xVSS_context->pSettings->xVSS.outputAudioBitrate ;
pVSSContext->xVSS.bAudioMono =
xVSS_context->pSettings->xVSS.bAudioMono;
+ pVSSContext->xVSS.outputVideoProfile =
+ xVSS_context->pSettings->xVSS.outputVideoProfile;
+ pVSSContext->xVSS.outputVideoLevel =
+ xVSS_context->pSettings->xVSS.outputVideoLevel;
/* In case of MMS use case, we fill directly into the VSS context the targeted bitrate */
if(xVSS_context->targetedBitrate != 0)
{