From: Andreas Huber Date: Mon, 12 Aug 2013 17:08:23 +0000 (-0700) Subject: Support for "request-sync" parameter in ACodec X-Git-Tag: android-x86-4.4-r1~202 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b8689b31813f55cbc1bf8e9ca0d46a9ee113e38a;p=android-x86%2Fframeworks-av.git Support for "request-sync" parameter in ACodec Also returns errors to caller instead of asserting... Change-Id: Id3018655a2b3da4289167fba16af907350a511ae --- diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 5aefa58e9e..36549d1b76 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -4123,13 +4123,28 @@ status_t ACodec::setParameters(const sp ¶ms) { if (params->findInt32("drop-input-frames", &dropInputFrames)) { bool suspend = dropInputFrames != 0; - CHECK_EQ((status_t)OK, - mOMX->setInternalOption( + status_t err = + mOMX->setInternalOption( mNode, kPortIndexInput, IOMX::INTERNAL_OPTION_SUSPEND, &suspend, - sizeof(suspend))); + sizeof(suspend)); + + if (err != OK) { + ALOGE("Failed to set parameter 'drop-input-frames' (err %d)", err); + return err; + } + } + + int32_t dummy; + if (params->findInt32("request-sync", &dummy)) { + status_t err = requestIDRFrame(); + + if (err != OK) { + ALOGE("Requesting a sync frame failed w/ err %d", err); + return err; + } } return OK;