diff options
author | Gloria Wang <gwang@google.com> | 2011-02-02 14:12:49 -0800 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2011-02-15 17:16:22 -0800 |
commit | c5b0abf900474b204c367093984ff60da4fba09c (patch) | |
tree | e1d205abe7f7174cc450a8dc43e5919a247c6cc7 /media/libstagefright/mpeg2ts | |
parent | 4c030b56160918117776b4379dcc1e258b854e2d (diff) | |
download | frameworks_base-c5b0abf900474b204c367093984ff60da4fba09c.zip frameworks_base-c5b0abf900474b204c367093984ff60da4fba09c.tar.gz frameworks_base-c5b0abf900474b204c367093984ff60da4fba09c.tar.bz2 |
Add AAC extractor
Change-Id: Iedb08525ac72e65ba98e5c791734da0720a0e3f6
Diffstat (limited to 'media/libstagefright/mpeg2ts')
-rw-r--r-- | media/libstagefright/mpeg2ts/ESQueue.cpp | 48 | ||||
-rw-r--r-- | media/libstagefright/mpeg2ts/ESQueue.h | 4 |
2 files changed, 0 insertions, 52 deletions
diff --git a/media/libstagefright/mpeg2ts/ESQueue.cpp b/media/libstagefright/mpeg2ts/ESQueue.cpp index 73efdfe..dcaf9f7 100644 --- a/media/libstagefright/mpeg2ts/ESQueue.cpp +++ b/media/libstagefright/mpeg2ts/ESQueue.cpp @@ -341,54 +341,6 @@ int64_t ElementaryStreamQueue::fetchTimestamp(size_t size) { return timeUs; } -// static -sp<MetaData> ElementaryStreamQueue::MakeAACCodecSpecificData( - unsigned profile, unsigned sampling_freq_index, - unsigned channel_configuration) { - sp<MetaData> meta = new MetaData; - meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_AAC); - - CHECK_LE(sampling_freq_index, 11u); - static const int32_t kSamplingFreq[] = { - 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, - 16000, 12000, 11025, 8000 - }; - meta->setInt32(kKeySampleRate, kSamplingFreq[sampling_freq_index]); - meta->setInt32(kKeyChannelCount, channel_configuration); - - static const uint8_t kStaticESDS[] = { - 0x03, 22, - 0x00, 0x00, // ES_ID - 0x00, // streamDependenceFlag, URL_Flag, OCRstreamFlag - - 0x04, 17, - 0x40, // Audio ISO/IEC 14496-3 - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - - 0x05, 2, - // AudioSpecificInfo follows - - // oooo offf fccc c000 - // o - audioObjectType - // f - samplingFreqIndex - // c - channelConfig - }; - sp<ABuffer> csd = new ABuffer(sizeof(kStaticESDS) + 2); - memcpy(csd->data(), kStaticESDS, sizeof(kStaticESDS)); - - csd->data()[sizeof(kStaticESDS)] = - ((profile + 1) << 3) | (sampling_freq_index >> 1); - - csd->data()[sizeof(kStaticESDS) + 1] = - ((sampling_freq_index << 7) & 0x80) | (channel_configuration << 3); - - meta->setData(kKeyESDS, 0, csd->data(), csd->size()); - - return meta; -} - struct NALPosition { size_t nalOffset; size_t nalSize; diff --git a/media/libstagefright/mpeg2ts/ESQueue.h b/media/libstagefright/mpeg2ts/ESQueue.h index 5b7957e..d081995 100644 --- a/media/libstagefright/mpeg2ts/ESQueue.h +++ b/media/libstagefright/mpeg2ts/ESQueue.h @@ -61,10 +61,6 @@ private: // returns its timestamp in us (or -1 if no time information). int64_t fetchTimestamp(size_t size); - static sp<MetaData> MakeAACCodecSpecificData( - unsigned profile, unsigned sampling_freq_index, - unsigned channel_configuration); - DISALLOW_EVIL_CONSTRUCTORS(ElementaryStreamQueue); }; |