diff options
author | Martin Storsjo <martin@martin.st> | 2014-12-27 20:56:28 +0200 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2015-06-03 08:50:18 -0700 |
commit | 77f101b342b6d206b6f530991f3333dfedeebab6 (patch) | |
tree | 2cf7ca5a5971aa2afef9ed13f73d1d15bf3be0a0 /media/libstagefright/Utils.cpp | |
parent | 186e9c456945f642107ec1d9990068ea36772d25 (diff) | |
download | frameworks_av-77f101b342b6d206b6f530991f3333dfedeebab6.zip frameworks_av-77f101b342b6d206b6f530991f3333dfedeebab6.tar.gz frameworks_av-77f101b342b6d206b6f530991f3333dfedeebab6.tar.bz2 |
Translate codec specific data for mp4v-es for MediaMuxer
The existing translations for H264 and AAC are written too broadly,
matching any video or audio codec, while they in fact are very
specific for these codecs.
This fixes muxing mp4v-es into .mp4 files using MediaMuxer.
Bug: 17956215
Bug: http://b.android.com/90138
Change-Id: I7de04c5e517a1cde07c8fc18463053355d7cf6ae
Diffstat (limited to 'media/libstagefright/Utils.cpp')
-rw-r--r-- | media/libstagefright/Utils.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp index 413628d..6828b54 100644 --- a/media/libstagefright/Utils.cpp +++ b/media/libstagefright/Utils.cpp @@ -601,16 +601,18 @@ void convertMessageToMetaData(const sp<AMessage> &msg, sp<MetaData> &meta) { // reassemble the csd data into its original form sp<ABuffer> csd0; if (msg->findBuffer("csd-0", &csd0)) { - if (mime.startsWith("video/")) { // do we need to be stricter than this? + if (mime == MEDIA_MIMETYPE_VIDEO_AVC) { sp<ABuffer> csd1; if (msg->findBuffer("csd-1", &csd1)) { char avcc[1024]; // that oughta be enough, right? size_t outsize = reassembleAVCC(csd0, csd1, avcc); meta->setData(kKeyAVCC, kKeyAVCC, avcc, outsize); } - } else if (mime.startsWith("audio/")) { + } else if (mime == MEDIA_MIMETYPE_AUDIO_AAC || mime == MEDIA_MIMETYPE_VIDEO_MPEG4) { int csd0size = csd0->size(); char esds[csd0size + 31]; + // The written ESDS is actually for an audio stream, but it's enough + // for transporting the CSD to muxers. reassembleESDS(csd0, esds); meta->setData(kKeyESDS, kKeyESDS, esds, sizeof(esds)); } |