summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Fernandes <dannyfernandes@google.com>2011-02-16 11:37:12 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-16 11:37:12 -0800
commitc3e1e1e4207a655bf5a3ecf9b9e41700e54a3c86 (patch)
treef5a8756cc9dfad4e29ec2e606419661e0bf54a7f
parenta5a42c5ceb98942909d84b20d44a920eed85a8cf (diff)
parentf58e4c332ecf8c0cd6037b010256d0b4c56e6a17 (diff)
downloadframeworks_av-c3e1e1e4207a655bf5a3ecf9b9e41700e54a3c86.zip
frameworks_av-c3e1e1e4207a655bf5a3ecf9b9e41700e54a3c86.tar.gz
frameworks_av-c3e1e1e4207a655bf5a3ecf9b9e41700e54a3c86.tar.bz2
Merge "Fixed issue 3443078 overlay flicker on transition in exported video"
-rwxr-xr-xlibvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h1
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_Edit.c2
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_EditVideo.c38
-rwxr-xr-xlibvideoeditor/vss/src/M4xVSS_internal.c28
4 files changed, 45 insertions, 24 deletions
diff --git a/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h b/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h
index 069b84d..bc29b2a 100755
--- a/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h
+++ b/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h
@@ -610,6 +610,7 @@ typedef struct
M4OSA_UInt8 nbActiveEffects1; /**< Numbers of active effects RC */
M4OSA_Bool m_bClipExternalHasStarted; /**< Flag to indicate that an
external effect is active */
+ M4OSA_Int32 iInOutTimeOffset;
} M4VSS3GPP_InternalEditContext;
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c
index d495186..acdbfdc 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c
@@ -229,6 +229,8 @@ M4OSA_ERR M4VSS3GPP_editInit( M4VSS3GPP_EditContext *pContext,
pC->bIsMMS = M4OSA_FALSE;
+ pC->iInOutTimeOffset = 0;
+
/**
* Return with no error */
M4OSA_TRACE3_0("M4VSS3GPP_editInit(): returning M4NO_ERROR");
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c b/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c
index 9870426..2dfd07b 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c
@@ -93,12 +93,18 @@ M4OSA_ERR M4VSS3GPP_intEditStepVideo( M4VSS3GPP_InternalEditContext *pC )
M4OSA_UInt16 offset;
/**
- * Check if we reached end cut */
- // Decorrelate input and output encoding timestamp to handle encoder prefetch
- if ( ((M4OSA_Int32)(pC->ewc.dInputVidCts) - pC->pC1->iVoffset) >= pC->pC1->iEndTime )
+ * Check if we reached end cut. Decorrelate input and output encoding
+ * timestamp to handle encoder prefetch
+ */
+ if ( ((M4OSA_Int32)(pC->ewc.dInputVidCts) - pC->pC1->iVoffset
+ + pC->iInOutTimeOffset) >= pC->pC1->iEndTime )
{
/* Re-adjust video to precise cut time */
- // Decorrelate input and output encoding timestamp to handle encoder prefetch
+ pC->iInOutTimeOffset = ((M4OSA_Int32)(pC->ewc.dInputVidCts))
+ - pC->pC1->iVoffset + pC->iInOutTimeOffset - pC->pC1->iEndTime;
+ if ( pC->iInOutTimeOffset < 0 ) {
+ pC->iInOutTimeOffset = 0;
+ }
/**
* Video is done for this clip */
@@ -1974,9 +1980,11 @@ M4VSS3GPP_intCheckVideoEffects( M4VSS3GPP_InternalEditContext *pC,
if(uiClipNumber ==1)
{
- if ((t >= (M4OSA_Int32)(pFx->uiStartTime)) && /**< Are we after the start time of the effect? */
- (t < (M4OSA_Int32)(pFx->uiStartTime + pFx->uiDuration)) ) /**< Are we into the effect duration? */
- {
+ /**< Are we after the start time of the effect?
+ * or Are we into the effect duration?
+ */
+ if ( (t >= (M4OSA_Int32)(pFx->uiStartTime)) &&
+ (t <= (M4OSA_Int32)(pFx->uiStartTime + pFx->uiDuration)) ) {
/**
* Set the active effect(s) */
pC->pActiveEffectsList[i] = pC->nbEffects-1-uiFxIndex;
@@ -1993,17 +2001,19 @@ M4VSS3GPP_intCheckVideoEffects( M4VSS3GPP_InternalEditContext *pC,
}
/**
- * The third effect has the highest priority, then the second one, then the first one.
- * Hence, as soon as we found an active effect, we can get out of this loop */
-
+ * The third effect has the highest priority, then the
+ * second one, then the first one. Hence, as soon as we
+ * found an active effect, we can get out of this loop.
+ */
}
}
else
{
- if ((t + pC->pTransitionList[uiClipIndex].uiTransitionDuration >=
- (M4OSA_Int32)(pFx->uiStartTime)) && (t + pC->pTransitionList[uiClipIndex].uiTransitionDuration
- < (M4OSA_Int32)(pFx->uiStartTime + pFx->uiDuration)) ) /**< Are we into the effect duration? */
- {
+ /**< Are we into the effect duration? */
+ if ( (t + pC->pTransitionList[uiClipIndex].uiTransitionDuration
+ >= (M4OSA_Int32)(pFx->uiStartTime))
+ && (t + pC->pTransitionList[uiClipIndex].uiTransitionDuration
+ <= (M4OSA_Int32)(pFx->uiStartTime + pFx->uiDuration)) ) {
/**
* Set the active effect(s) */
pC->pActiveEffectsList1[i] = pC->nbEffects-1-uiFxIndex;
diff --git a/libvideoeditor/vss/src/M4xVSS_internal.c b/libvideoeditor/vss/src/M4xVSS_internal.c
index 71a8929..b56d524 100755
--- a/libvideoeditor/vss/src/M4xVSS_internal.c
+++ b/libvideoeditor/vss/src/M4xVSS_internal.c
@@ -4135,11 +4135,15 @@ M4OSA_ERR M4VSS3GPP_externalVideoEffectFraming( M4OSA_Void *userData,
if(pProgress->uiProgress >= 0 && pProgress->uiProgress \
< (M4OSA_UInt32)(alphaBlendingStruct->m_fadeInTime*10))
{
- alphaBlending = ((M4OSA_Float)(alphaBlendingStruct->m_middle\
- - alphaBlendingStruct->m_start)\
- *pProgress->uiProgress/(alphaBlendingStruct->m_fadeInTime*10));
- alphaBlending += alphaBlendingStruct->m_start;
- alphaBlending /= 100;
+ if(alphaBlendingStruct->m_fadeInTime == 0) {
+ alphaBlending = alphaBlendingStruct->m_start / 100;
+ } else {
+ alphaBlending = ((M4OSA_Float)(alphaBlendingStruct->m_middle\
+ - alphaBlendingStruct->m_start)\
+ *pProgress->uiProgress/(alphaBlendingStruct->m_fadeInTime*10));
+ alphaBlending += alphaBlendingStruct->m_start;
+ alphaBlending /= 100;
+ }
}
else if(pProgress->uiProgress >= (M4OSA_UInt32)(alphaBlendingStruct->\
m_fadeInTime*10) && pProgress->uiProgress < 1000\
@@ -4151,11 +4155,15 @@ M4OSA_ERR M4VSS3GPP_externalVideoEffectFraming( M4OSA_Void *userData,
else if(pProgress->uiProgress >= 1000 - (M4OSA_UInt32)\
(alphaBlendingStruct->m_fadeOutTime*10))
{
- alphaBlending = ((M4OSA_Float)(alphaBlendingStruct->m_middle \
- - alphaBlendingStruct->m_end))*(1000 - pProgress->uiProgress)\
- /(alphaBlendingStruct->m_fadeOutTime*10);
- alphaBlending += alphaBlendingStruct->m_end;
- alphaBlending /= 100;
+ if(alphaBlendingStruct->m_fadeOutTime == 0) {
+ alphaBlending = alphaBlendingStruct->m_end / 100;
+ } else {
+ alphaBlending = ((M4OSA_Float)(alphaBlendingStruct->m_middle \
+ - alphaBlendingStruct->m_end))*(1000 - pProgress->uiProgress)\
+ /(alphaBlendingStruct->m_fadeOutTime*10);
+ alphaBlending += alphaBlendingStruct->m_end;
+ alphaBlending /= 100;
+ }
}
}
/**/