diff options
author | Dheeraj Sharma <dheerajs@google.com> | 2011-02-10 16:55:37 -0800 |
---|---|---|
committer | Dheeraj Sharma <dheerajs@google.com> | 2011-02-10 18:21:58 -0800 |
commit | 4f4efef8357f4d8b23ccfb1b29db34175bf72627 (patch) | |
tree | 392962cab24a56c136497e8930624e2a759dac15 | |
parent | b4ce81da6664b5029406a78be71c39af055a4d29 (diff) | |
download | frameworks_av-4f4efef8357f4d8b23ccfb1b29db34175bf72627.zip frameworks_av-4f4efef8357f4d8b23ccfb1b29db34175bf72627.tar.gz frameworks_av-4f4efef8357f4d8b23ccfb1b29db34175bf72627.tar.bz2 |
Fix for issue : 3439708 Last frame is missing effect
Change-Id: I533695f4154d4ebce4e8f1ff39a622ca4fd62430
-rw-r--r-- | libvideoeditor/lvpp/PreviewPlayer.cpp | 17 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/VideoEditorPreviewController.cpp | 20 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/VideoEditorPreviewController.h | 5 |
3 files changed, 28 insertions, 14 deletions
diff --git a/libvideoeditor/lvpp/PreviewPlayer.cpp b/libvideoeditor/lvpp/PreviewPlayer.cpp index 23a01bb..0892ce7 100644 --- a/libvideoeditor/lvpp/PreviewPlayer.cpp +++ b/libvideoeditor/lvpp/PreviewPlayer.cpp @@ -808,10 +808,7 @@ void PreviewPlayer::onVideoEvent() { finishSeekIfNecessary(-1); LOGV("PreviewPlayer: onVideoEvent EOS reached."); mFlags |= VIDEO_AT_EOS; - if (mOverlayUpdateEventPosted) { - mOverlayUpdateEventPosted = false; - postOverlayUpdateEvent_l(); - } + mOverlayUpdateEventPosted = false; postStreamDoneEvent_l(err); return; } @@ -937,10 +934,7 @@ void PreviewPlayer::onVideoEvent() { mFlags |= VIDEO_AT_EOS; mFlags |= AUDIO_AT_EOS; LOGV("PreviewPlayer: onVideoEvent timeUs > mPlayEndTime; send EOS.."); - if (mOverlayUpdateEventPosted) { - mOverlayUpdateEventPosted = false; - postOverlayUpdateEvent_l(); - } + mOverlayUpdateEventPosted = false; postStreamDoneEvent_l(ERROR_END_OF_STREAM); return; } @@ -961,7 +955,6 @@ void PreviewPlayer::onVideoEvent() { ((mEffectsSettings[i].uiStartTime+mEffectsSettings[i].uiDuration) >= (((timeUs+mDecVideoTsStoryBoard)/1000)-mPlayBeginTimeMsec)) && (mEffectsSettings[i].uiDuration != 0)) { - setVideoPostProcessingNode( mEffectsSettings[i].VideoEffectType, TRUE); } @@ -975,7 +968,6 @@ void PreviewPlayer::onVideoEvent() { if (mCurrentVideoEffect & VIDEO_EFFECT_FRAMING) { mCurrentVideoEffect &= ~VIDEO_EFFECT_FRAMING; //never apply framing here. if (!mOverlayUpdateEventPosted) { - // Find the effect in effectSettings array int index; for (index = 0; index < mNumberEffects; index++) { @@ -1058,10 +1050,7 @@ void PreviewPlayer::onVideoEvent() { LOGV("PreviewPlayer: onVideoEvent EOS."); mFlags |= VIDEO_AT_EOS; mFlags |= AUDIO_AT_EOS; - if (mOverlayUpdateEventPosted) { - mOverlayUpdateEventPosted = false; - postOverlayUpdateEvent_l(); - } + mOverlayUpdateEventPosted = false; postStreamDoneEvent_l(ERROR_END_OF_STREAM); } else { diff --git a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp index e7a767a..e6f6052 100755 --- a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp +++ b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp @@ -50,6 +50,7 @@ VideoEditorPreviewController::VideoEditorPreviewController() mOutputVideoWidth(0),
mOutputVideoHeight(0),
bStopThreadInProgress(false),
+ mOverlayState(OVERLAY_CLEAR),
mSemThreadWait(NULL) {
LOGV("VideoEditorPreviewController");
mRenderingMode = M4xVSS_kBlackBorders;
@@ -138,6 +139,8 @@ VideoEditorPreviewController::~VideoEditorPreviewController() { mTarget = NULL;
}
+ mOverlayState = OVERLAY_CLEAR;
+
LOGV("~VideoEditorPreviewController returns");
}
@@ -1128,6 +1131,21 @@ void VideoEditorPreviewController::notify( pController->mJniCookie, MSG_TYPE_PROGRESS_INDICATION,
&playedDuration);
+ if ((pController->mOverlayState == OVERLAY_UPDATE) &&
+ (pController->mCurrentClipNumber !=
+ (pController->mNumberClipsToPreview-1))) {
+ VideoEditorCurretEditInfo *pEditInfo =
+ (VideoEditorCurretEditInfo*)M4OSA_malloc(sizeof(VideoEditorCurretEditInfo),
+ M4VS, (M4OSA_Char*)"Current Edit info");
+ pEditInfo->overlaySettingsIndex = ext2;
+ pEditInfo->clipIndex = pController->mCurrentClipNumber;
+ pController->mOverlayState == OVERLAY_CLEAR;
+ if (pController->mJniCallback != NULL) {
+ pController->mJniCallback(pController->mJniCookie,
+ MSG_TYPE_OVERLAY_CLEAR, pEditInfo);
+ }
+ M4OSA_free((M4OSA_MemAddr32)pEditInfo);
+ }
M4OSA_semaphorePost(pController->mSemThreadWait);
break;
}
@@ -1194,9 +1212,11 @@ void VideoEditorPreviewController::notify( LOGV("pController->mCurrentClipNumber = %d",pController->mCurrentClipNumber);
if (pController->mJniCallback != NULL) {
if (ext1 == 1) {
+ pController->mOverlayState = OVERLAY_UPDATE;
pController->mJniCallback(pController->mJniCookie,
MSG_TYPE_OVERLAY_UPDATE, pEditInfo);
} else {
+ pController->mOverlayState = OVERLAY_CLEAR;
pController->mJniCallback(pController->mJniCookie,
MSG_TYPE_OVERLAY_CLEAR, pEditInfo);
}
diff --git a/libvideoeditor/lvpp/VideoEditorPreviewController.h b/libvideoeditor/lvpp/VideoEditorPreviewController.h index 2a2a665..be40c7c 100755 --- a/libvideoeditor/lvpp/VideoEditorPreviewController.h +++ b/libvideoeditor/lvpp/VideoEditorPreviewController.h @@ -51,6 +51,10 @@ typedef enum { VePlayerAutoStop
} VePlayerState;
+typedef enum {
+ OVERLAY_UPDATE = 0,
+ OVERLAY_CLEAR
+} OverlayState;
// Callback mechanism from PreviewController to Jni */
typedef void (*jni_progress_callback_fct)(void* cookie, M4OSA_UInt32 msgType, void *argc);
@@ -117,6 +121,7 @@ private: M4OSA_UInt32 mFirstPreviewClipBeginTime;
M4OSA_UInt32 mLastPreviewClipEndTime;
M4OSA_UInt32 mVideoStoryBoardTimeMsUptoFirstPreviewClip;
+ OverlayState mOverlayState;
M4xVSS_MediaRendering mRenderingMode;
uint32_t mOutputVideoWidth;
|