diff options
Diffstat (limited to 'media/libstagefright/MPEG4Extractor.cpp')
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index d922dc0..087f345 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -265,6 +265,8 @@ status_t MPEG4DataSource::setCachedRange(off64_t offset, size_t size) { //////////////////////////////////////////////////////////////////////////////// +static const bool kUseHexDump = false; + static void hexdump(const void *_data, size_t size) { const uint8_t *data = (const uint8_t *)_data; size_t offset = 0; @@ -607,7 +609,6 @@ status_t MPEG4Extractor::parseDrmSINF( if (size < 0) { return ERROR_IO; } - int32_t classSize = size; data_offset += numOfBytes; while(size >= 11 ) { @@ -668,7 +669,6 @@ status_t MPEG4Extractor::parseDrmSINF( if (size < 0) { return ERROR_IO; } - classSize = size; data_offset += numOfBytes; while (size > 0) { @@ -766,7 +766,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { return ERROR_IO; } uint64_t chunk_size = ntohl(hdr[0]); - uint32_t chunk_type = ntohl(hdr[1]); + int32_t chunk_type = ntohl(hdr[1]); off64_t data_offset = *offset + 8; if (chunk_size == 1) { @@ -806,23 +806,23 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { MakeFourCCString(chunk_type, chunk); ALOGV("chunk: %s @ %lld, %d", chunk, *offset, depth); -#if 0 - static const char kWhitespace[] = " "; - const char *indent = &kWhitespace[sizeof(kWhitespace) - 1 - 2 * depth]; - printf("%sfound chunk '%s' of size %" PRIu64 "\n", indent, chunk, chunk_size); + if (kUseHexDump) { + static const char kWhitespace[] = " "; + const char *indent = &kWhitespace[sizeof(kWhitespace) - 1 - 2 * depth]; + printf("%sfound chunk '%s' of size %" PRIu64 "\n", indent, chunk, chunk_size); - char buffer[256]; - size_t n = chunk_size; - if (n > sizeof(buffer)) { - n = sizeof(buffer); - } - if (mDataSource->readAt(*offset, buffer, n) - < (ssize_t)n) { - return ERROR_IO; - } + char buffer[256]; + size_t n = chunk_size; + if (n > sizeof(buffer)) { + n = sizeof(buffer); + } + if (mDataSource->readAt(*offset, buffer, n) + < (ssize_t)n) { + return ERROR_IO; + } - hexdump(buffer, n); -#endif + hexdump(buffer, n); + } PathAdder autoAdder(&mPath, chunk_type); @@ -1298,7 +1298,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { return ERROR_IO; } - uint16_t data_ref_index = U16_AT(&buffer[6]); + uint16_t data_ref_index __unused = U16_AT(&buffer[6]); uint32_t num_channels = U16_AT(&buffer[16]); uint16_t sample_size = U16_AT(&buffer[18]); @@ -1351,7 +1351,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { return ERROR_IO; } - uint16_t data_ref_index = U16_AT(&buffer[6]); + uint16_t data_ref_index __unused = U16_AT(&buffer[6]); uint16_t width = U16_AT(&buffer[6 + 18]); uint16_t height = U16_AT(&buffer[6 + 20]); @@ -1867,7 +1867,6 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { if (chunk_data_size < 24) { return ERROR_IO; } - uint32_t duration; Trex trex; if (!mDataSource->getUInt32(data_offset + 4, &trex.track_ID) || !mDataSource->getUInt32(data_offset + 8, &trex.default_sample_description_index) || @@ -2139,7 +2138,7 @@ status_t MPEG4Extractor::parseTrackHeader( return ERROR_IO; } - uint64_t ctime, mtime, duration; + uint64_t ctime __unused, mtime __unused, duration __unused; int32_t id; if (version == 1) { @@ -2161,12 +2160,13 @@ status_t MPEG4Extractor::parseTrackHeader( size_t matrixOffset = dynSize + 16; int32_t a00 = U32_AT(&buffer[matrixOffset]); int32_t a01 = U32_AT(&buffer[matrixOffset + 4]); - int32_t dx = U32_AT(&buffer[matrixOffset + 8]); int32_t a10 = U32_AT(&buffer[matrixOffset + 12]); int32_t a11 = U32_AT(&buffer[matrixOffset + 16]); - int32_t dy = U32_AT(&buffer[matrixOffset + 20]); #if 0 + int32_t dx = U32_AT(&buffer[matrixOffset + 8]); + int32_t dy = U32_AT(&buffer[matrixOffset + 20]); + ALOGI("x' = %.2f * x + %.2f * y + %.2f", a00 / 65536.0f, a01 / 65536.0f, dx / 65536.0f); ALOGI("y' = %.2f * x + %.2f * y + %.2f", @@ -2227,7 +2227,7 @@ status_t MPEG4Extractor::parseITunesMetaData(off64_t offset, size_t size) { char chunk[5]; MakeFourCCString(mPath[4], chunk); ALOGV("meta: %s @ %lld", chunk, offset); - switch (mPath[4]) { + switch ((int32_t)mPath[4]) { case FOURCC(0xa9, 'a', 'l', 'b'): { metadataKey = kKeyAlbum; @@ -2718,10 +2718,10 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio( return ERROR_MALFORMED; } -#if 0 - printf("ESD of size %d\n", csd_size); - hexdump(csd, csd_size); -#endif + if (kUseHexDump) { + printf("ESD of size %d\n", csd_size); + hexdump(csd, csd_size); + } if (csd_size == 0) { // There's no further information, i.e. no codec specific data @@ -2772,7 +2772,7 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio( if (objectType == AOT_SBR || objectType == AOT_PS) {//SBR specific config per 14496-3 table 1.13 uint32_t extFreqIndex = br.getBits(4); - int32_t extSampleRate; + int32_t extSampleRate __unused; if (extFreqIndex == 15) { if (csd_size < 8) { return ERROR_MALFORMED; @@ -2822,12 +2822,12 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio( if (objectType == AOT_AAC_LC || objectType == AOT_ER_AAC_LC || objectType == AOT_ER_AAC_LD || objectType == AOT_ER_AAC_SCAL || objectType == AOT_ER_BSAC) { - const int32_t frameLengthFlag = br.getBits(1); + const int32_t frameLengthFlag __unused = br.getBits(1); const int32_t dependsOnCoreCoder = br.getBits(1); if (dependsOnCoreCoder ) { - const int32_t coreCoderDelay = br.getBits(14); + const int32_t coreCoderDelay __unused = br.getBits(14); } int32_t extensionFlag = -1; @@ -2856,54 +2856,54 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio( if (numChannels == 0) { int32_t channelsEffectiveNum = 0; int32_t channelsNum = 0; - const int32_t ElementInstanceTag = br.getBits(4); - const int32_t Profile = br.getBits(2); - const int32_t SamplingFrequencyIndex = br.getBits(4); + const int32_t ElementInstanceTag __unused = br.getBits(4); + const int32_t Profile __unused = br.getBits(2); + const int32_t SamplingFrequencyIndex __unused = br.getBits(4); const int32_t NumFrontChannelElements = br.getBits(4); const int32_t NumSideChannelElements = br.getBits(4); const int32_t NumBackChannelElements = br.getBits(4); const int32_t NumLfeChannelElements = br.getBits(2); - const int32_t NumAssocDataElements = br.getBits(3); - const int32_t NumValidCcElements = br.getBits(4); + const int32_t NumAssocDataElements __unused = br.getBits(3); + const int32_t NumValidCcElements __unused = br.getBits(4); const int32_t MonoMixdownPresent = br.getBits(1); if (MonoMixdownPresent != 0) { - const int32_t MonoMixdownElementNumber = br.getBits(4); + const int32_t MonoMixdownElementNumber __unused = br.getBits(4); } const int32_t StereoMixdownPresent = br.getBits(1); if (StereoMixdownPresent != 0) { - const int32_t StereoMixdownElementNumber = br.getBits(4); + const int32_t StereoMixdownElementNumber __unused = br.getBits(4); } const int32_t MatrixMixdownIndexPresent = br.getBits(1); if (MatrixMixdownIndexPresent != 0) { - const int32_t MatrixMixdownIndex = br.getBits(2); - const int32_t PseudoSurroundEnable = br.getBits(1); + const int32_t MatrixMixdownIndex __unused = br.getBits(2); + const int32_t PseudoSurroundEnable __unused = br.getBits(1); } int i; for (i=0; i < NumFrontChannelElements; i++) { const int32_t FrontElementIsCpe = br.getBits(1); - const int32_t FrontElementTagSelect = br.getBits(4); + const int32_t FrontElementTagSelect __unused = br.getBits(4); channelsNum += FrontElementIsCpe ? 2 : 1; } for (i=0; i < NumSideChannelElements; i++) { const int32_t SideElementIsCpe = br.getBits(1); - const int32_t SideElementTagSelect = br.getBits(4); + const int32_t SideElementTagSelect __unused = br.getBits(4); channelsNum += SideElementIsCpe ? 2 : 1; } for (i=0; i < NumBackChannelElements; i++) { const int32_t BackElementIsCpe = br.getBits(1); - const int32_t BackElementTagSelect = br.getBits(4); + const int32_t BackElementTagSelect __unused = br.getBits(4); channelsNum += BackElementIsCpe ? 2 : 1; } channelsEffectiveNum = channelsNum; for (i=0; i < NumLfeChannelElements; i++) { - const int32_t LfeElementTagSelect = br.getBits(4); + const int32_t LfeElementTagSelect __unused = br.getBits(4); channelsNum += 1; } ALOGV("mpeg4 audio channelsNum = %d", channelsNum); |