diff options
author | Andreas Huber <andih@google.com> | 2013-11-12 00:21:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-11-12 00:21:51 +0000 |
commit | caee8747b7df3b1119426594d4ba1c0e300ff6db (patch) | |
tree | 72ea1e3c92a17f003907943f1c8929ee136f0c79 | |
parent | e100b813c4d833b48b48b74100ad0b9a82c46954 (diff) | |
parent | 89b31a3f670d8bec87bed50aaad9bcd8edec66b6 (diff) | |
download | frameworks_av-caee8747b7df3b1119426594d4ba1c0e300ff6db.zip frameworks_av-caee8747b7df3b1119426594d4ba1c0e300ff6db.tar.gz frameworks_av-caee8747b7df3b1119426594d4ba1c0e300ff6db.tar.bz2 |
Merge "configure bitrate and bitrate mode at encoder initialization for VP8/9" into klp-dev
-rw-r--r-- | include/media/stagefright/ACodec.h | 1 | ||||
-rw-r--r-- | media/libstagefright/ACodec.cpp | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index a8ffd4a..e796ab3 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -264,6 +264,7 @@ private: status_t setupMPEG4EncoderParameters(const sp<AMessage> &msg); status_t setupH263EncoderParameters(const sp<AMessage> &msg); status_t setupAVCEncoderParameters(const sp<AMessage> &msg); + status_t setupVPXEncoderParameters(const sp<AMessage> &msg); status_t verifySupportForProfileAndLevel(int32_t profile, int32_t level); diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 92a5361..528fdb9 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -1909,6 +1909,11 @@ status_t ACodec::setupVideoEncoder(const char *mime, const sp<AMessage> &msg) { err = setupAVCEncoderParameters(msg); break; + case OMX_VIDEO_CodingVP8: + case OMX_VIDEO_CodingVP9: + err = setupVPXEncoderParameters(msg); + break; + default: break; } @@ -2240,6 +2245,17 @@ status_t ACodec::setupAVCEncoderParameters(const sp<AMessage> &msg) { return configureBitrate(bitrate, bitrateMode); } +status_t ACodec::setupVPXEncoderParameters(const sp<AMessage> &msg) { + int32_t bitrate; + if (!msg->findInt32("bitrate", &bitrate)) { + return INVALID_OPERATION; + } + + OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg); + + return configureBitrate(bitrate, bitrateMode); +} + status_t ACodec::verifySupportForProfileAndLevel( int32_t profile, int32_t level) { OMX_VIDEO_PARAM_PROFILELEVELTYPE params; |