diff options
author | James Dong <jdong@google.com> | 2011-06-17 15:13:42 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-06-17 15:28:07 -0700 |
commit | 05e65807d48c2c7b954af82eda0532a48948e96a (patch) | |
tree | b4c55b2cde1de371ec29b5f8feb0004d1ff952b1 /media/libstagefright | |
parent | daeba2d6b9df5252afacec835a23340e5d9910ec (diff) | |
download | frameworks_av-05e65807d48c2c7b954af82eda0532a48948e96a.zip frameworks_av-05e65807d48c2c7b954af82eda0532a48948e96a.tar.gz frameworks_av-05e65807d48c2c7b954af82eda0532a48948e96a.tar.bz2 |
Use system property to control whether we will enable B frame support in MPEG4Writer
o This is to work around a bug in crespo's video encoder output timestamp
related-to-bug: 4600191,4724339
Change-Id: I485c1e044bd2f604b318692efd6433345cfc6487
Diffstat (limited to 'media/libstagefright')
-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 |