diff options
author | James Dong <jdong@google.com> | 2011-06-17 15:50:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-17 15:50:19 -0700 |
commit | d11f591b45008147cf0854b2af8712692cef6f03 (patch) | |
tree | fd889b31116d1b2b24724e3e9006d1e4867f9ad1 /media | |
parent | ee452bcc06c6a42ecc78a154bb4fb9366e9178eb (diff) | |
parent | bf8116f28da187933a255ba3719b9265ecd1d98b (diff) | |
download | frameworks_base-d11f591b45008147cf0854b2af8712692cef6f03.zip frameworks_base-d11f591b45008147cf0854b2af8712692cef6f03.tar.gz frameworks_base-d11f591b45008147cf0854b2af8712692cef6f03.tar.bz2 |
Merge "Use system property to control whether we will enable B frame support in MPEG4Writer"
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index 28add18..58f03a0 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -1975,7 +1975,17 @@ status_t MPEG4Writer::Track::threadEntry() { int64_t previousPausedDurationUs = 0; int64_t timestampUs = 0; int64_t cttsDeltaTimeUs = 0; + bool hasBFrames = false; +#if 1 + // XXX: Samsung's video encoder's output buffer timestamp + // is not correct. see bug 4724339 + char value[PROPERTY_VALUE_MAX]; + if (property_get("rw.media.record.hasb", value, NULL) && + (!strcasecmp(value, "true") || !strcasecmp(value, "1"))) { + hasBFrames = true; + } +#endif if (mIsAudio) { prctl(PR_SET_NAME, (unsigned long)"AudioTrackEncoding", 0, 0, 0); } else { @@ -2118,7 +2128,7 @@ status_t MPEG4Writer::Track::threadEntry() { timestampUs -= previousPausedDurationUs; CHECK(timestampUs >= 0); - if (!mIsAudio) { + if (!mIsAudio && hasBFrames) { /* * Composition time: timestampUs * Decoding time: decodingTimeUs |