aboutsummaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2009-07-31 14:34:01 -0700
committerJames Dong <jdong@google.com>2009-07-31 14:34:01 -0700
commitdc952b9620458fa2556409b6632e09c0093898c9 (patch)
tree77135b96f32507c8305673614393c9d6ca69b7b3 /android
parent9b083bbbcad9b66f8eca8dba00de4051f141d077 (diff)
downloadopencore-dc952b9620458fa2556409b6632e09c0093898c9.tar.gz
Fix incorrect OpenCore component parameter negotiation timing for frame size and frame rate
bug 2024374
Diffstat (limited to 'android')
-rw-r--r--android/author/authordriver.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/android/author/authordriver.cpp b/android/author/authordriver.cpp
index 27fb5a1d0..80b24f4d4 100644
--- a/android/author/authordriver.cpp
+++ b/android/author/authordriver.cpp
@@ -569,6 +569,24 @@ void AuthorDriver::handleSetVideoEncoder(set_video_encoder_command *ac)
}
mVideoEncoder = ac->ve;
+ // Set video encoding frame rate and video frame size only when the
+ // video input MIO is set.
+ if (mVideoInputMIO) {
+ if (mVideoFrameRate == 0) {
+ mVideoFrameRate = DEFAULT_VIDEO_FRAME_RATE;
+ }
+ clipVideoFrameRate();
+ ((AndroidCameraInput *)mVideoInputMIO)->SetFrameRate(mVideoFrameRate);
+
+ if (mVideoWidth == 0) {
+ mVideoWidth = DEFAULT_VIDEO_WIDTH;
+ }
+ if (mVideoHeight == 0) {
+ mVideoHeight = DEFAULT_VIDEO_HEIGHT;
+ }
+ clipVideoFrameSize();
+ ((AndroidCameraInput *)mVideoInputMIO)->SetFrameSize(mVideoWidth, mVideoHeight);
+ }
OSCL_TRY(error, mAuthor->AddMediaTrack(*mVideoNode, iVideoEncoderMimeType, mSelectedComposer, mVideoEncoderConfig, ac));
OSCL_FIRST_CATCH_ANY(error, commandFailed(ac));
@@ -905,26 +923,6 @@ void AuthorDriver::handleSetParameters(set_parameters_command *ac) {
void AuthorDriver::handlePrepare(author_command *ac)
{
LOGV("handlePrepare");
-
- // Set video encoding frame rate and video frame size only when the
- // video input MIO is set.
- if (mVideoInputMIO) {
- if (mVideoFrameRate == 0) {
- mVideoFrameRate = DEFAULT_VIDEO_FRAME_RATE;
- }
- clipVideoFrameRate();
- ((AndroidCameraInput *)mVideoInputMIO)->SetFrameRate(mVideoFrameRate);
-
- if (mVideoWidth == 0) {
- mVideoWidth = DEFAULT_VIDEO_WIDTH;
- }
- if (mVideoHeight == 0) {
- mVideoHeight = DEFAULT_VIDEO_HEIGHT;
- }
- clipVideoFrameSize();
- ((AndroidCameraInput *)mVideoInputMIO)->SetFrameSize(mVideoWidth, mVideoHeight);
- }
-
int error = 0;
OSCL_TRY(error, mAuthor->Init(ac));
OSCL_FIRST_CATCH_ANY(error, commandFailed(ac));