summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-09-28 11:34:41 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-28 12:47:57 -0700
commit3a0ef0dc71f3776d115f30d87f1d8867daefea88 (patch)
tree0156b1ffe3663b676b37de5a96921713ba78df1a /media/libstagefright/ACodec.cpp
parente646b2d26459ca30667097e9600ee3f57ebfd228 (diff)
downloadframeworks_av-3a0ef0dc71f3776d115f30d87f1d8867daefea88.zip
frameworks_av-3a0ef0dc71f3776d115f30d87f1d8867daefea88.tar.gz
frameworks_av-3a0ef0dc71f3776d115f30d87f1d8867daefea88.tar.bz2
Tell the encoder to emit SPS/PPS before IDR frames in wifi display code.
Change-Id: Ic40e09b66784dd2e370d30b688d50561a47ab85a related-to-bug: 7245308
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index af7a459..2b4220f 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -32,6 +32,8 @@
#include <media/stagefright/OMXClient.h>
#include <media/stagefright/OMXCodec.h>
+#include <media/hardware/HardwareAPI.h>
+
#include <OMX_Component.h>
#include "include/avc_utils.h"
@@ -881,6 +883,33 @@ status_t ACodec::configureCodec(
}
}
+ int32_t prependSPSPPS;
+ if (encoder
+ && msg->findInt32("prepend-sps-pps-to-idr-frames", &prependSPSPPS)
+ && prependSPSPPS != 0) {
+ OMX_INDEXTYPE index;
+ err = mOMX->getExtensionIndex(
+ mNode,
+ "OMX.google.android.index.prependSPSPPSToIDRFrames",
+ &index);
+
+ if (err == OK) {
+ PrependSPSPPSToIDRFramesParams params;
+ InitOMXParams(&params);
+ params.bEnable = OMX_TRUE;
+
+ err = mOMX->setParameter(
+ mNode, index, &params, sizeof(params));
+ }
+
+ if (err != OK) {
+ ALOGE("Encoder could not be configured to emit SPS/PPS before "
+ "IDR frames. (err %d)", err);
+
+ return err;
+ }
+ }
+
if (!strncasecmp(mime, "video/", 6)) {
if (encoder) {
err = setupVideoEncoder(mime, msg);