From 377b2ec9a2885f9b6405b07ba900a9e3f4349c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20PETIT?= Date: Mon, 3 Feb 2014 12:35:36 +0000 Subject: Make frameworks/av 64-bit compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contains the necessary changes to make frameworks/av build and work on a 64-bit machine. Signed-off-by: Craig Barber Signed-off-by: Kévin PETIT Signed-off-by: Ashok Bhat Signed-off-by: Marcus Oakland Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43 --- media/libstagefright/AACWriter.cpp | 4 +-- media/libstagefright/AMRWriter.cpp | 4 +-- media/libstagefright/AudioSource.cpp | 2 +- media/libstagefright/AwesomePlayer.cpp | 29 +++++++++++----------- media/libstagefright/MPEG4Extractor.cpp | 2 +- media/libstagefright/MPEG4Writer.cpp | 19 +++++++------- media/libstagefright/MetaData.cpp | 7 +++--- .../StagefrightMetadataRetriever.cpp | 7 +++--- .../codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp | 8 +++--- .../libstagefright/codecs/m4v_h263/enc/src/dct.cpp | 12 ++++----- .../codecs/m4v_h263/enc/src/fastcodemb.cpp | 4 +-- .../codecs/m4v_h263/enc/src/motion_comp.cpp | 2 +- .../codecs/m4v_h263/enc/src/sad_inline.h | 2 +- .../codecs/on2/h264dec/source/h264bsd_util.h | 3 ++- media/libstagefright/id3/testid3.cpp | 4 +-- media/libstagefright/omx/OMX.cpp | 2 +- media/libstagefright/omx/tests/OMXHarness.cpp | 7 +++--- media/libstagefright/tests/DummyRecorder.cpp | 2 +- 18 files changed, 63 insertions(+), 57 deletions(-) (limited to 'media/libstagefright') diff --git a/media/libstagefright/AACWriter.cpp b/media/libstagefright/AACWriter.cpp index a6f7cfb..c9bcaba 100644 --- a/media/libstagefright/AACWriter.cpp +++ b/media/libstagefright/AACWriter.cpp @@ -171,7 +171,7 @@ status_t AACWriter::reset() { void *dummy; pthread_join(mThread, &dummy); - status_t err = (status_t) dummy; + status_t err = static_cast(reinterpret_cast(dummy)); { status_t status = mSource->stop(); if (err == OK && @@ -200,7 +200,7 @@ bool AACWriter::exceedsFileDurationLimit() { // static void *AACWriter::ThreadWrapper(void *me) { - return (void *) static_cast(me)->threadFunc(); + return (void *)(uintptr_t)static_cast(me)->threadFunc(); } /* diff --git a/media/libstagefright/AMRWriter.cpp b/media/libstagefright/AMRWriter.cpp index 8d5eec8..3fe247a 100644 --- a/media/libstagefright/AMRWriter.cpp +++ b/media/libstagefright/AMRWriter.cpp @@ -162,7 +162,7 @@ status_t AMRWriter::reset() { void *dummy; pthread_join(mThread, &dummy); - status_t err = (status_t) dummy; + status_t err = static_cast(reinterpret_cast(dummy)); { status_t status = mSource->stop(); if (err == OK && @@ -191,7 +191,7 @@ bool AMRWriter::exceedsFileDurationLimit() { // static void *AMRWriter::ThreadWrapper(void *me) { - return (void *) static_cast(me)->threadFunc(); + return (void *)(uintptr_t) static_cast(me)->threadFunc(); } status_t AMRWriter::threadFunc() { diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp index d7223d9..f0d1a14 100644 --- a/media/libstagefright/AudioSource.cpp +++ b/media/libstagefright/AudioSource.cpp @@ -308,7 +308,7 @@ status_t AudioSource::dataCallback(const AudioRecord::Buffer& audioBuffer) { if (numLostBytes > 0) { // Loss of audio frames should happen rarely; thus the LOGW should // not cause a logging spam - ALOGW("Lost audio record data: %d bytes", numLostBytes); + ALOGW("Lost audio record data: %zu bytes", numLostBytes); } while (numLostBytes > 0) { diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index aae6800..29c007a 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -19,6 +19,7 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "AwesomePlayer" #define ATRACE_TAG ATRACE_TAG_VIDEO +#include #include #include @@ -725,7 +726,7 @@ void AwesomePlayer::onBufferingUpdate() { if ((mFlags & PLAYING) && !eos && (cachedDataRemaining < kLowWaterMarkBytes)) { - ALOGI("cache is running low (< %d) , pausing.", + ALOGI("cache is running low (< %zu) , pausing.", kLowWaterMarkBytes); modifyFlags(CACHE_UNDERRUN, SET); pause_l(); @@ -734,12 +735,12 @@ void AwesomePlayer::onBufferingUpdate() { notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START); } else if (eos || cachedDataRemaining > kHighWaterMarkBytes) { if (mFlags & CACHE_UNDERRUN) { - ALOGI("cache has filled up (> %d), resuming.", + ALOGI("cache has filled up (> %zu), resuming.", kHighWaterMarkBytes); modifyFlags(CACHE_UNDERRUN, CLEAR); play_l(); } else if (mFlags & PREPARING) { - ALOGV("cache has filled up (> %d), prepare is done", + ALOGV("cache has filled up (> %zu), prepare is done", kHighWaterMarkBytes); finishAsyncPrepare_l(); } @@ -2295,8 +2296,8 @@ status_t AwesomePlayer::finishSetDataSource_l() { sniffedMIME = tmp.string(); if (meta == NULL - || !meta->findInt64( - "meta-data-size", &metaDataSize)) { + || !meta->findInt64("meta-data-size", + reinterpret_cast(&metaDataSize))) { metaDataSize = kHighWaterMarkBytes; } @@ -2583,12 +2584,12 @@ status_t AwesomePlayer::getTrackInfo(Parcel *reply) const { status_t AwesomePlayer::selectAudioTrack_l( const sp& source, size_t trackIndex) { - ALOGI("selectAudioTrack_l: trackIndex=%d, mFlags=0x%x", trackIndex, mFlags); + ALOGI("selectAudioTrack_l: trackIndex=%zu, mFlags=0x%x", trackIndex, mFlags); { Mutex::Autolock autoLock(mStatsLock); if ((ssize_t)trackIndex == mActiveAudioTrackIndex) { - ALOGI("Track %d is active. Does nothing.", trackIndex); + ALOGI("Track %zu is active. Does nothing.", trackIndex); return OK; } //mStats.mFlags = mFlags; @@ -2661,7 +2662,7 @@ status_t AwesomePlayer::selectTrack(size_t trackIndex, bool select) { trackCount += mTextDriver->countExternalTracks(); } if (trackIndex >= trackCount) { - ALOGE("Track index (%d) is out of range [0, %d)", trackIndex, trackCount); + ALOGE("Track index (%zu) is out of range [0, %zu)", trackIndex, trackCount); return ERROR_OUT_OF_RANGE; } @@ -2673,14 +2674,14 @@ status_t AwesomePlayer::selectTrack(size_t trackIndex, bool select) { isAudioTrack = !strncasecmp(mime, "audio/", 6); if (!isAudioTrack && strcasecmp(mime, MEDIA_MIMETYPE_TEXT_3GPP) != 0) { - ALOGE("Track %d is not either audio or timed text", trackIndex); + ALOGE("Track %zu is not either audio or timed text", trackIndex); return ERROR_UNSUPPORTED; } } if (isAudioTrack) { if (!select) { - ALOGE("Deselect an audio track (%d) is not supported", trackIndex); + ALOGE("Deselect an audio track (%zu) is not supported", trackIndex); return ERROR_UNSUPPORTED; } return selectAudioTrack_l(mExtractor->getTrack(trackIndex), trackIndex); @@ -2818,7 +2819,7 @@ status_t AwesomePlayer::dump(int fd, const Vector &args) const { fprintf(out, ", flags(0x%08x)", mStats.mFlags); if (mStats.mBitrate >= 0) { - fprintf(out, ", bitrate(%lld bps)", mStats.mBitrate); + fprintf(out, ", bitrate(%" PRId64 " bps)", mStats.mBitrate); } fprintf(out, "\n"); @@ -2826,7 +2827,7 @@ status_t AwesomePlayer::dump(int fd, const Vector &args) const { for (size_t i = 0; i < mStats.mTracks.size(); ++i) { const TrackStat &stat = mStats.mTracks.itemAt(i); - fprintf(out, " Track %d\n", i + 1); + fprintf(out, " Track %zu\n", i + 1); fprintf(out, " MIME(%s)", stat.mMIME.string()); if (!stat.mDecoderName.isEmpty()) { @@ -2838,8 +2839,8 @@ status_t AwesomePlayer::dump(int fd, const Vector &args) const { if ((ssize_t)i == mStats.mVideoTrackIndex) { fprintf(out, " videoDimensions(%d x %d), " - "numVideoFramesDecoded(%lld), " - "numVideoFramesDropped(%lld)\n", + "numVideoFramesDecoded(%" PRId64 "), " + "numVideoFramesDropped(%" PRId64 ")\n", mStats.mVideoWidth, mStats.mVideoHeight, mStats.mNumVideoFramesDecoded, diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 4f1c5b3..6a33ce6 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -260,7 +260,7 @@ static void hexdump(const void *_data, size_t size) { const uint8_t *data = (const uint8_t *)_data; size_t offset = 0; while (offset < size) { - printf("0x%04x ", offset); + printf("0x%04zx ", offset); size_t n = size - offset; if (n > 16) { diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index a0f17b5..e7d3cc2 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -16,6 +16,7 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "MPEG4Writer" +#include #include #include @@ -417,7 +418,7 @@ status_t MPEG4Writer::Track::dump( result.append(buffer); snprintf(buffer, SIZE, " frames encoded : %d\n", mStszTableEntries->count()); result.append(buffer); - snprintf(buffer, SIZE, " duration encoded : %lld us\n", mTrackDurationUs); + snprintf(buffer, SIZE, " duration encoded : %" PRId64 " us\n", mTrackDurationUs); result.append(buffer); ::write(fd, result.string(), result.size()); return OK; @@ -1404,7 +1405,7 @@ void MPEG4Writer::Track::addOneSttsTableEntry( size_t sampleCount, int32_t duration) { if (duration == 0) { - ALOGW("0-duration samples found: %d", sampleCount); + ALOGW("0-duration samples found: %zu", sampleCount); } mSttsTableEntries->add(htonl(sampleCount)); mSttsTableEntries->add(htonl(duration)); @@ -1584,7 +1585,7 @@ void MPEG4Writer::writeAllChunks() { sendSessionSummary(); mChunkInfos.clear(); - ALOGD("%d chunks are written in the last batch", outstandingChunks); + ALOGD("%zu chunks are written in the last batch", outstandingChunks); } bool MPEG4Writer::findChunkToWrite(Chunk *chunk) { @@ -1774,7 +1775,7 @@ status_t MPEG4Writer::Track::stop() { void *dummy; pthread_join(mThread, &dummy); - status_t err = (status_t) dummy; + status_t err = static_cast(reinterpret_cast(dummy)); ALOGD("Stopping %s track source", mIsAudio? "Audio": "Video"); { @@ -1797,7 +1798,7 @@ void *MPEG4Writer::Track::ThreadWrapper(void *me) { Track *track = static_cast(me); status_t err = track->threadEntry(); - return (void *) err; + return (void *)(uintptr_t)err; } static void getNalUnitType(uint8_t byte, uint8_t* type) { @@ -1869,7 +1870,7 @@ status_t MPEG4Writer::Track::copyAVCCodecSpecificData( // 2 bytes for each of the parameter set length field // plus the 7 bytes for the header if (size < 4 + 7) { - ALOGE("Codec specific data length too short: %d", size); + ALOGE("Codec specific data length too short: %zu", size); return ERROR_MALFORMED; } @@ -1938,7 +1939,7 @@ status_t MPEG4Writer::Track::parseAVCCodecSpecificData( } if (nSeqParamSets > 0x1F) { - ALOGE("Too many seq parameter sets (%d) found", nSeqParamSets); + ALOGE("Too many seq parameter sets (%zu) found", nSeqParamSets); return ERROR_MALFORMED; } } @@ -1951,7 +1952,7 @@ status_t MPEG4Writer::Track::parseAVCCodecSpecificData( return ERROR_MALFORMED; } if (nPicParamSets > 0xFF) { - ALOGE("Too many pic parameter sets (%d) found", nPicParamSets); + ALOGE("Too many pic parameter sets (%zd) found", nPicParamSets); return ERROR_MALFORMED; } } @@ -1981,7 +1982,7 @@ status_t MPEG4Writer::Track::makeAVCCodecSpecificData( } if (size < 4) { - ALOGE("Codec specific data length too short: %d", size); + ALOGE("Codec specific data length too short: %zu", size); return ERROR_MALFORMED; } diff --git a/media/libstagefright/MetaData.cpp b/media/libstagefright/MetaData.cpp index 1daead7..74234a6 100644 --- a/media/libstagefright/MetaData.cpp +++ b/media/libstagefright/MetaData.cpp @@ -16,6 +16,7 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "MetaData" +#include #include #include @@ -307,7 +308,7 @@ String8 MetaData::typed_data::asString() const { const void *data = storage(); switch(mType) { case TYPE_NONE: - out = String8::format("no type, size %d)", mSize); + out = String8::format("no type, size %zu)", mSize); break; case TYPE_C_STRING: out = String8::format("(char*) %s", (const char *)data); @@ -316,7 +317,7 @@ String8 MetaData::typed_data::asString() const { out = String8::format("(int32_t) %d", *(int32_t *)data); break; case TYPE_INT64: - out = String8::format("(int64_t) %lld", *(int64_t *)data); + out = String8::format("(int64_t) %" PRId64, *(int64_t *)data); break; case TYPE_FLOAT: out = String8::format("(float) %f", *(float *)data); @@ -333,7 +334,7 @@ String8 MetaData::typed_data::asString() const { } default: - out = String8::format("(unknown type %d, size %d)", mType, mSize); + out = String8::format("(unknown type %d, size %zu)", mType, mSize); if (mSize <= 48) { // if it's less than three lines of hex data, dump it AString foo; hexdump(data, mSize, 0, &foo); diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp index 19af4fb..fcd9a85 100644 --- a/media/libstagefright/StagefrightMetadataRetriever.cpp +++ b/media/libstagefright/StagefrightMetadataRetriever.cpp @@ -16,6 +16,7 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "StagefrightMetadataRetriever" +#include #include #include "include/StagefrightMetadataRetriever.h" @@ -488,7 +489,7 @@ void StagefrightMetadataRetriever::parseMetaData() { size_t numTracks = mExtractor->countTracks(); char tmp[32]; - sprintf(tmp, "%d", numTracks); + sprintf(tmp, "%zu", numTracks); mMetaData.add(METADATA_KEY_NUM_TRACKS, String8(tmp)); @@ -545,7 +546,7 @@ void StagefrightMetadataRetriever::parseMetaData() { } // The duration value is a string representing the duration in ms. - sprintf(tmp, "%lld", (maxDurationUs + 500) / 1000); + sprintf(tmp, "%" PRId64, (maxDurationUs + 500) / 1000); mMetaData.add(METADATA_KEY_DURATION, String8(tmp)); if (hasAudio) { @@ -573,7 +574,7 @@ void StagefrightMetadataRetriever::parseMetaData() { if (mSource->getSize(&sourceSize) == OK) { int64_t avgBitRate = (int64_t)(sourceSize * 8E6 / maxDurationUs); - sprintf(tmp, "%lld", avgBitRate); + sprintf(tmp, "%" PRId64, avgBitRate); mMetaData.add(METADATA_KEY_BITRATE, String8(tmp)); } } diff --git a/media/libstagefright/codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp b/media/libstagefright/codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp index e23f23d..fe9e7dc 100644 --- a/media/libstagefright/codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp +++ b/media/libstagefright/codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp @@ -96,7 +96,7 @@ int GetPredAdvancedBy0x0( offset = width - B_SIZE; /* offset for prev */ offset2 = (pred_width_rnd >> 1) - 4; /* offset for pred_block */ - tmp = (uint32)prev & 0x3; + tmp = (uintptr_t)prev & 0x3; pred_block -= offset2; /* preset */ if (tmp == 0) /* word-aligned */ @@ -203,7 +203,7 @@ int GetPredAdvancedBy0x1( /* Branch based on pixel location (half-pel or full-pel) for x and y */ pred_block -= offset2; /* preset */ - tmp = (uint32)prev & 3; + tmp = (uintptr_t)prev & 3; mask = 254; mask |= (mask << 8); mask |= (mask << 16); /* 0xFEFEFEFE */ @@ -532,7 +532,7 @@ int GetPredAdvancedBy1x0( /* Branch based on pixel location (half-pel or full-pel) for x and y */ pred_block -= offset2; /* preset */ - tmp = (uint32)prev & 3; + tmp = (uintptr_t)prev & 3; mask = 254; mask |= (mask << 8); mask |= (mask << 16); /* 0xFEFEFEFE */ @@ -884,7 +884,7 @@ int GetPredAdvancedBy1x1( mask |= (mask << 8); mask |= (mask << 16); /* 0x3f3f3f3f */ - tmp = (uint32)prev & 3; + tmp = (uintptr_t)prev & 3; pred_block -= 4; /* preset */ diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/dct.cpp b/media/libstagefright/codecs/m4v_h263/enc/src/dct.cpp index fa50eeb..fa4ae23 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/src/dct.cpp +++ b/media/libstagefright/codecs/m4v_h263/enc/src/dct.cpp @@ -250,7 +250,7 @@ extern "C" out[40] = k4 ; /* row 5 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -455,7 +455,7 @@ extern "C" out[8] = k5 ; /* row 1 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -635,7 +635,7 @@ extern "C" out[8] = k5 ; /* row 1 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -846,7 +846,7 @@ extern "C" out[40] = k4 ; /* row 5 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -1033,7 +1033,7 @@ extern "C" out[8] = k5 ; /* row 1 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -1195,7 +1195,7 @@ extern "C" out[8] = k5 ; /* row 1 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/fastcodemb.cpp b/media/libstagefright/codecs/m4v_h263/enc/src/fastcodemb.cpp index 6fd41c3..0ad39a6 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/src/fastcodemb.cpp +++ b/media/libstagefright/codecs/m4v_h263/enc/src/fastcodemb.cpp @@ -572,7 +572,7 @@ Int Sad8x8(UChar *cur, UChar *prev, Int width) cur2 = cur2 & (mask << 8); /* mask first and third bytes */ sum2 = sum2 + ((UInt)cur2 >> 8); } - while ((UInt)curInt < (UInt)end); + while ((uintptr_t)curInt < (uintptr_t)end); cur1 = sum4 - (sum2 << 8); /* get even-sum */ cur1 = cur1 + sum2; /* add 16 bit even-sum and odd-sum*/ @@ -611,7 +611,7 @@ Int getBlockSum(UChar *cur, Int width) load2 = load2 & (mask << 8); /* even bytes */ sum2 += ((UInt)load2 >> 8); /* sum even bytes, 16 bit */ } - while ((UInt)curInt < (UInt)end); + while ((uintptr_t)curInt < (uintptr_t)end); load1 = sum4 - (sum2 << 8); /* get even-sum */ load1 = load1 + sum2; /* add 16 bit even-sum and odd-sum*/ load1 = load1 + (load1 << 16); /* add upper and lower 16 bit sum */ diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/motion_comp.cpp b/media/libstagefright/codecs/m4v_h263/enc/src/motion_comp.cpp index b81d278..06e8926 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/src/motion_comp.cpp +++ b/media/libstagefright/codecs/m4v_h263/enc/src/motion_comp.cpp @@ -1959,7 +1959,7 @@ void PutSkippedBlock(UChar *rec, UChar *prev, Int lx) dst += offset; src += offset; } - while ((UInt)src < (UInt)end); + while ((uintptr_t)src < (uintptr_t)end); return ; } diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/sad_inline.h b/media/libstagefright/codecs/m4v_h263/enc/src/sad_inline.h index ba77dfd..b865f23 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/src/sad_inline.h +++ b/media/libstagefright/codecs/m4v_h263/enc/src/sad_inline.h @@ -85,7 +85,7 @@ extern "C" x9 = 0x80808080; /* const. */ - x8 = (uint32)ref & 0x3; + x8 = (uintptr_t)ref & 0x3; if (x8 == 3) goto SadMBOffset3; if (x8 == 2) diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h index cb3adda..216ad04 100755 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h @@ -42,6 +42,7 @@ #include #endif +#include #include "basetype.h" #include "h264bsd_stream.h" #include "h264bsd_image.h" @@ -150,7 +151,7 @@ } #define ALIGN(ptr, bytePos) \ - (ptr + ( ((bytePos - (int)ptr) & (bytePos - 1)) / sizeof(*ptr) )) + (ptr + ( ((bytePos - (uintptr_t)ptr) & (bytePos - 1)) / sizeof(*ptr) )) extern const u32 h264bsdQpC[52]; diff --git a/media/libstagefright/id3/testid3.cpp b/media/libstagefright/id3/testid3.cpp index bc4572c..b2f4188 100644 --- a/media/libstagefright/id3/testid3.cpp +++ b/media/libstagefright/id3/testid3.cpp @@ -33,7 +33,7 @@ static void hexdump(const void *_data, size_t size) { const uint8_t *data = (const uint8_t *)_data; size_t offset = 0; while (offset < size) { - printf("0x%04x ", offset); + printf("0x%04zx ", offset); size_t n = size - offset; if (n > 16) { @@ -101,7 +101,7 @@ void scanFile(const char *path) { const void *data = tag.getAlbumArt(&dataSize, &mime); if (data) { - printf("found album art: size=%d mime='%s'\n", dataSize, + printf("found album art: size=%zu mime='%s'\n", dataSize, mime.string()); hexdump(data, dataSize > 128 ? 128 : dataSize); diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp index 84a0e10..274f2eb 100644 --- a/media/libstagefright/omx/OMX.cpp +++ b/media/libstagefright/omx/OMX.cpp @@ -479,7 +479,7 @@ OMX_ERRORTYPE OMX::OnFillBufferDone( OMX::node_id OMX::makeNodeID(OMXNodeInstance *instance) { // mLock is already held. - node_id node = (node_id)++mNodeCounter; + node_id node = (node_id)(uintptr_t)++mNodeCounter; mNodeIDToInstance.add(node, instance); return node; diff --git a/media/libstagefright/omx/tests/OMXHarness.cpp b/media/libstagefright/omx/tests/OMXHarness.cpp index 4bee808..44e4f9d 100644 --- a/media/libstagefright/omx/tests/OMXHarness.cpp +++ b/media/libstagefright/omx/tests/OMXHarness.cpp @@ -16,6 +16,7 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "OMXHarness" +#include #include #include "OMXHarness.h" @@ -711,11 +712,11 @@ status_t Harness::testSeek( int64_t bufferTimeUs; CHECK(buffer->meta_data()->findInt64(kKeyTime, &bufferTimeUs)); if (!CloseEnough(bufferTimeUs, actualSeekTimeUs)) { - printf("\n * Attempted seeking to %lld us (%.2f secs)", + printf("\n * Attempted seeking to %" PRId64 " us (%.2f secs)", requestedSeekTimeUs, requestedSeekTimeUs / 1E6); - printf("\n * Nearest keyframe is at %lld us (%.2f secs)", + printf("\n * Nearest keyframe is at %" PRId64 " us (%.2f secs)", actualSeekTimeUs, actualSeekTimeUs / 1E6); - printf("\n * Returned buffer was at %lld us (%.2f secs)\n\n", + printf("\n * Returned buffer was at %" PRId64 " us (%.2f secs)\n\n", bufferTimeUs, bufferTimeUs / 1E6); buffer->release(); diff --git a/media/libstagefright/tests/DummyRecorder.cpp b/media/libstagefright/tests/DummyRecorder.cpp index ac37b28..8f17088 100644 --- a/media/libstagefright/tests/DummyRecorder.cpp +++ b/media/libstagefright/tests/DummyRecorder.cpp @@ -61,7 +61,7 @@ status_t DummyRecorder::stop() { mSource->stop(); void *dummy; pthread_join(mThread, &dummy); - status_t err = (status_t) dummy; + status_t err = static_cast(reinterpret_cast(dummy)); ALOGV("Ending the reading thread"); return err; -- cgit v1.1