diff options
author | vivek mehta <mvivek@codeaurora.org> | 2012-12-04 11:46:08 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2012-12-23 21:26:55 -0800 |
commit | 3a05365a93afccc5bb7db3bdc9f5d2efef69c8d3 (patch) | |
tree | 9384cf4640e68fb4eb9652bc6549b75ed074f5e0 /media/libstagefright/MPEG4Extractor.cpp | |
parent | 97343328d2920ec95fb06794b65ec467bce793af (diff) | |
download | frameworks_av-3a05365a93afccc5bb7db3bdc9f5d2efef69c8d3.zip frameworks_av-3a05365a93afccc5bb7db3bdc9f5d2efef69c8d3.tar.gz frameworks_av-3a05365a93afccc5bb7db3bdc9f5d2efef69c8d3.tar.bz2 |
Squashed commit of audio changes from CodeAurora
libstagefright: Add QC specific media format
- Add QC specific media extensions
- Add QC specific media definitions
Change-Id: I7dca90be3b977701d9537f5e017117790a030f1f
audio: Compile AudioParameter as shared library
- AudioParameter as shared lib is needed by BT
support in WFD source.
Change-Id: I464b428ace0cbb57ce6bf7bf3b57d51a7d56f032
libstagefright: Send flush on both i/p and o/p ports together
- ANR occurs in music due to race condition in OMX component if
flush is issued separately for i/p and o/p ports as DSP only
handles simultaneous flush on i/p and o/p ports.
Change-Id: I5b16cd5a9b57c857dc8bed489d2663b8f54769e3
libstagefright: Enable extended A\V format
- Add new files to support extended A\V format
Change-Id: I1e61d78d35b868d55fd8e99f95de8cab9c465db4
libstagefright: Framework to plug-in propritory parser
- Extend the current framework to plug-in propritory
parser
Change-Id: Ia586a3048420ddf1515261f20035589447263b7b
audio: add support for QCOM audio formats
- Add support for EVRC, QCELP, and WMA formats.
Change-Id: Iaf80f982fc8b08617132dbd7d524a1748866745c
frameworks/av: Support Tunnel Playback
- Implement DirectTrack and DirectTrackClient
- DirectTrack exposes API to client so it can create a direct
output.
- DirectTrackClient allows notifications to be sent to the
client from DirectTrack
- DirectTrack is being used for Tunnel Audio
Change-Id: I2fbb18a781d8e44b8d65da9a357f6e39375f063a
frameworks/av: Support LPA Playback
Add support to enable Playback in LPA mode
Change-Id: I1b8ac4904f4735017d62f3757ede7bbb56e62fd3
audio: Send correct channel mask in voice call recording.
-Using popCount function to get channel count gives incorrect value on
voice call recording.
-Only STEREO and MONO bits to be considered to count
channels on input
Change-Id: I04c2c802422e868bdba0538ff8623dbf9eb659fe
libstagefright: Thumbnail mode initial commit
- use sync frame decoding mode when kClientNeedsFrameBuffer
is set for hardware decoders
- hardware decoder will only expect I frames, OMXCodec will
set EOS on first ETB to stop more frames from being pulled
- skip EOS check on FTB so that the first frame will be
handled
Change-Id: I0e8974e088fdcc468e27764861c128cfe291499f
audio: Add support for QCOM's VOIP solution
Change-Id: I1150f536fa204b535ca4019fdaa84f33f4695d93
audio: define QCOM audio parameters
- Define QCOM audio paramters for FM, VOIP,
fluence, SSR, and A2DP
Change-Id: I29d02e37685846f6d4f00dee02e2726b015eaae7
Add ifdefs for QCOM enhanced features
Change-Id: Ic8e5fe6ecc058466ced71030883b1af6c2bc055c
Diffstat (limited to 'media/libstagefright/MPEG4Extractor.cpp')
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index dc8e4a3..62ba826 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -40,6 +40,9 @@ #include <media/stagefright/MetaData.h> #include <media/stagefright/Utils.h> #include <utils/String8.h> +#ifdef QCOM_HARDWARE +#include <QCMediaDefs.h> +#endif namespace android { @@ -257,6 +260,28 @@ static const char *FourCC2MIME(uint32_t fourcc) { case FOURCC('a', 'v', 'c', '1'): return MEDIA_MIMETYPE_VIDEO_AVC; +#ifdef QCOM_HARDWARE + case FOURCC('s', 'q', 'c', 'p'): + return MEDIA_MIMETYPE_AUDIO_QCELP; + + case FOURCC('s', 'e', 'v', 'c'): + return MEDIA_MIMETYPE_AUDIO_EVRC; + + case FOURCC('d', 't', 's', 'c'): + case FOURCC('d', 't', 's', 'h'): + case FOURCC('d', 't', 's', 'l'): + return MEDIA_MIMETYPE_AUDIO_DTS; + + case FOURCC('d', 't', 's', 'e'): + return MEDIA_MIMETYPE_AUDIO_DTS_LBR; + + case FOURCC('a', 'c', '-', '3'): + return MEDIA_MIMETYPE_AUDIO_AC3; + + case FOURCC('e', 'c', '-', '3'): + return MEDIA_MIMETYPE_AUDIO_EAC3; +#endif + default: CHECK(!"should not be here."); return NULL; @@ -921,6 +946,17 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { case FOURCC('m', 'p', '4', 'a'): case FOURCC('s', 'a', 'm', 'r'): case FOURCC('s', 'a', 'w', 'b'): +#ifdef QCOM_HARDWARE + case FOURCC('.', 'm', 'p', '3'): + case FOURCC('s', 'e', 'v', 'c'): + case FOURCC('s', 'q', 'c', 'p'): + case FOURCC('d', 't', 's', 'c'): + case FOURCC('d', 't', 's', 'h'): + case FOURCC('d', 't', 's', 'l'): + case FOURCC('d', 't', 's', 'e'): + case FOURCC('a', 'c', '-', '3'): + case FOURCC('e', 'c', '-', '3'): +#endif { uint8_t buffer[8 + 20]; if (chunk_data_size < (ssize_t)sizeof(buffer)) { @@ -961,7 +997,16 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { mLastTrack->meta->setInt32(kKeySampleRate, sample_rate); off64_t stop_offset = *offset + chunk_size; - *offset = data_offset + sizeof(buffer); +#ifdef QCOM_HARDWARE + if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_MPEG, FourCC2MIME(chunk_type)) || + !strcasecmp(MEDIA_MIMETYPE_AUDIO_AMR_WB, FourCC2MIME(chunk_type))) { + // ESD is not required in mp3 + // amr wb with damr atom corrupted can cause the clip to not play + *offset = stop_offset; + } else +#endif + *offset = data_offset + sizeof(buffer); + while (*offset < stop_offset) { status_t err = parseChunk(offset, depth + 1); if (err != OK) { @@ -1219,6 +1264,18 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { break; } +#ifdef QCOM_HARDWARE + case FOURCC('d', 'd', 't', 's'): + case FOURCC('d', 'a', 'c', '3'): + case FOURCC('d', 'e', 'c', '3'): + { + //no information need to be passed here, just log and end + ALOGV("ddts/dac3/dec3 pass from mpeg4 extractor"); + *offset += chunk_size; + break; + } +#endif + case FOURCC('a', 'v', 'c', 'C'): { char buffer[256]; @@ -1799,6 +1856,14 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio( return ERROR_MALFORMED; } +#ifdef QCOM_HARDWARE + if (objectTypeIndication == 0xA0) { + // This isn't MPEG4 audio at all, it's EVRC + mLastTrack->meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_EVRC); + return OK; + } +#endif + if (objectTypeIndication == 0xe1) { // This isn't MPEG4 audio at all, it's QCELP 14k... mLastTrack->meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_QCELP); @@ -2313,6 +2378,9 @@ static bool LegacySniffMPEG4( } if (!memcmp(header, "ftyp3gp", 7) || !memcmp(header, "ftypmp42", 8) +#ifdef QCOM_HARDWARE + || !memcmp(header, "ftyp3g2a", 8) || !memcmp(header, "ftyp3g2b", 8) || !memcmp(header, "ftyp3g2c", 8) +#endif || !memcmp(header, "ftyp3gr6", 8) || !memcmp(header, "ftyp3gs6", 8) || !memcmp(header, "ftyp3ge6", 8) || !memcmp(header, "ftyp3gg6", 8) || !memcmp(header, "ftypisom", 8) || !memcmp(header, "ftypM4V ", 8) |