diff options
author | Rajneesh Chowdury <rajneeshc@google.com> | 2011-09-22 13:00:36 -0700 |
---|---|---|
committer | Rajneesh Chowdury <rajneeshc@google.com> | 2011-09-23 14:17:26 -0700 |
commit | eaf349aaffc89c3ff754ddef856c80097b5a79a2 (patch) | |
tree | 3ec1a57d5726478cec7aab0d2f438b4874a7fb8c | |
parent | 738a66268a5d4ad948714dc095711cb4a21997f3 (diff) | |
download | frameworks_av-eaf349aaffc89c3ff754ddef856c80097b5a79a2.zip frameworks_av-eaf349aaffc89c3ff754ddef856c80097b5a79a2.tar.gz frameworks_av-eaf349aaffc89c3ff754ddef856c80097b5a79a2.tar.bz2 |
Fix for 5205420 compression domain trimming fallback mechanism
Transcode if clip's profile or level exceeds encoder's supported
profile or level.
Change-Id: Ib2f678828a58657b095ef6ef219fd0aa2bdccf91
-rwxr-xr-x | libvideoeditor/vss/src/M4VSS3GPP_Edit.c | 36 | ||||
-rwxr-xr-x | libvideoeditor/vss/src/M4xVSS_API.c | 27 |
2 files changed, 43 insertions, 20 deletions
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c index d9330f5..708c6e5 100755 --- a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c +++ b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c @@ -1047,19 +1047,29 @@ M4OSA_ERR M4VSS3GPP_editOpen( M4VSS3GPP_EditContext pContext, } for (i=0; i<pC->uiClipNumber; i++) { - if ((pC->pClipList[i].ClipProperties.VideoStreamType != - pC->xVSS.outputVideoFormat)|| - (pC->pClipList[i].ClipProperties.uiVideoWidth != - pC->ewc.uiVideoWidth) || - (pC->pClipList[i].ClipProperties.uiVideoHeight != - pC->ewc.uiVideoHeight) || - (pC->pClipList[i].ClipProperties.VideoStreamType == - M4VIDEOEDITING_kH264) || - (pC->pClipList[i].ClipProperties.VideoStreamType == - M4VIDEOEDITING_kMPEG4 && - pC->pClipList[i].ClipProperties.uiVideoTimeScale != - pC->ewc.uiVideoTimeScale)) { - pC->pClipList[i].bTranscodingRequired = M4OSA_TRUE; + if (pC->pClipList[i].bTranscodingRequired == M4OSA_FALSE) { + /** If not transcoded in Analysis phase, check + * if transcoding required now + */ + if ((pC->pClipList[i].ClipProperties.VideoStreamType != + pC->xVSS.outputVideoFormat)|| + (pC->pClipList[i].ClipProperties.uiVideoWidth != + pC->ewc.uiVideoWidth) || + (pC->pClipList[i].ClipProperties.uiVideoHeight != + pC->ewc.uiVideoHeight) || + (pC->pClipList[i].ClipProperties.VideoStreamType == + M4VIDEOEDITING_kH264) || + (pC->pClipList[i].ClipProperties.VideoStreamType == + M4VIDEOEDITING_kMPEG4 && + pC->pClipList[i].ClipProperties.uiVideoTimeScale != + pC->ewc.uiVideoTimeScale)) { + pC->pClipList[i].bTranscodingRequired = M4OSA_TRUE; + } + } else { + /** If bTranscodingRequired is true, it means the clip has + * been transcoded in Analysis phase. + */ + pC->pClipList[i].bTranscodingRequired = M4OSA_FALSE; } } /** diff --git a/libvideoeditor/vss/src/M4xVSS_API.c b/libvideoeditor/vss/src/M4xVSS_API.c index 2ff1a88..de69cd1 100755 --- a/libvideoeditor/vss/src/M4xVSS_API.c +++ b/libvideoeditor/vss/src/M4xVSS_API.c @@ -49,6 +49,7 @@ Begin of xVSS API /* RC: to delete unecessary temp files on the fly */ #include "M4VSS3GPP_InternalTypes.h" +#include <utils/Log.h> /** ****************************************************************************** @@ -2430,6 +2431,19 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext, audioIsDifferent = M4OSA_FALSE; } } + /* Here check the clip video profile and level, if it exceeds + * the profile and level of export file, then the file need + * to be transcoded(do not do compress domain trim) */ + if ((fileProperties.uiVideoProfile > + xVSS_context->pSettings->xVSS.outputVideoProfile) || + (fileProperties.uiVideoLevel > + xVSS_context->pSettings->xVSS.outputVideoLevel)) { + /* Set bTranscodingRequired to TRUE to indicate the video will be + * transcoded in MCS. */ + xVSS_context->pSettings->pClipList[i]->bTranscodingRequired = + M4OSA_TRUE; + videoIsDifferent = M4OSA_TRUE; + } if( videoIsDifferent == M4OSA_TRUE || audioIsDifferent == M4OSA_TRUE) { @@ -5799,13 +5813,12 @@ M4OSA_ERR M4xVSS_Step( M4OSA_Context pContext, M4OSA_UInt8 *pProgress ) return err; } int32_t index = xVSS_context->pMCScurrentParams->videoclipnumber; - if(xVSS_context->pSettings->pClipList[index]->bTranscodingRequired - == M4OSA_FALSE) { - /*the cuts are done in the MCS, so we need to replace - the beginCutTime and endCutTime to keep the entire video*/ - xVSS_context->pSettings->pClipList[index]->uiBeginCutTime = 0; - xVSS_context->pSettings->pClipList[index]->uiEndCutTime = 0; - } + + /* The cuts are done in the MCS, so we need to replace + the beginCutTime and endCutTime to keep the entire video*/ + xVSS_context->pSettings->pClipList[index]->uiBeginCutTime = 0; + xVSS_context->pSettings->pClipList[index]->uiEndCutTime = 0; + M4OSA_TRACE1_1("M4xVSS_Step: \ M4xVSS_internalStartTranscoding returned \ |