diff options
Diffstat (limited to 'media')
114 files changed, 363 insertions, 288 deletions
diff --git a/media/libmedia/Android.mk b/media/libmedia/Android.mk index 78baa43..0c18828 100644 --- a/media/libmedia/Android.mk +++ b/media/libmedia/Android.mk @@ -7,6 +7,9 @@ LOCAL_SRC_FILES:= \ LOCAL_MODULE:= libmedia_helper LOCAL_MODULE_TAGS := optional +LOCAL_C_FLAGS += -Werror -Wall +LOCAL_CLANG := true + include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) @@ -84,5 +87,8 @@ LOCAL_C_INCLUDES := \ $(call include-path-for, audio-effects) \ $(call include-path-for, audio-utils) +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true + include $(BUILD_SHARED_LIBRARY) diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index e9ee169..2ed50e8 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -477,7 +477,6 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, audio_io_handle const void *param2) { ALOGV("ioConfigChanged() event %d", event); const OutputDescriptor *desc; - audio_stream_type_t stream; if (ioHandle == AUDIO_IO_HANDLE_NONE) return; diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 30d4355..055556f 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1663,7 +1663,8 @@ nsecs_t AudioTrack::processAudioBuffer() // AudioSystem cache. We should not exit here but after calling the callback so // that the upper layers can recreate the track if (!isOffloadedOrDirect_l() || (mSequence == mObservedSequence)) { - status_t status = restoreTrack_l("processAudioBuffer"); + status_t status __unused = restoreTrack_l("processAudioBuffer"); + // FIXME unused status // after restoration, continue below to make sure that the loop and buffer events // are notified because they have been cleared from mCblk->mFlags above. } diff --git a/media/libmedia/AudioTrackShared.cpp b/media/libmedia/AudioTrackShared.cpp index ba67b40..aee9fc2 100644 --- a/media/libmedia/AudioTrackShared.cpp +++ b/media/libmedia/AudioTrackShared.cpp @@ -619,8 +619,9 @@ status_t ServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush) // Rather than shutting down on a corrupt flush, just treat it as a full flush if (!(0 <= filled && (size_t) filled <= mFrameCount)) { ALOGE("mFlush %#x -> %#x, front %#x, rear %#x, mask %#x, newFront %#x, " - "filled %d=%#x", - mFlush, flush, front, rear, mask, newFront, filled, filled); + "filled %zd=%#x", + mFlush, flush, front, rear, + (unsigned)mask, newFront, filled, (unsigned)filled); newFront = rear; } mFlush = flush; diff --git a/media/libmedia/CharacterEncodingDetector.cpp b/media/libmedia/CharacterEncodingDetector.cpp index 41994dc..3020136 100644 --- a/media/libmedia/CharacterEncodingDetector.cpp +++ b/media/libmedia/CharacterEncodingDetector.cpp @@ -89,7 +89,6 @@ void CharacterEncodingDetector::detectAndConvert() { // try combined detection of artist/album/title etc. char buf[1024]; buf[0] = 0; - int idx; bool allprintable = true; for (int i = 0; i < size; i++) { const char *name = mNames.getEntry(i); @@ -169,7 +168,6 @@ void CharacterEncodingDetector::detectAndConvert() { const char *name = mNames.getEntry(i); uint8_t* src = (uint8_t *)mValues.getEntry(i); int len = strlen((char *)src); - uint8_t* dest = src; ALOGV("@@@ checking %s", name); const char *s = mValues.getEntry(i); diff --git a/media/libmedia/IMediaLogService.cpp b/media/libmedia/IMediaLogService.cpp index 230749e..1536337 100644 --- a/media/libmedia/IMediaLogService.cpp +++ b/media/libmedia/IMediaLogService.cpp @@ -45,7 +45,7 @@ public: data.writeStrongBinder(IInterface::asBinder(shared)); data.writeInt64((int64_t) size); data.writeCString(name); - status_t status = remote()->transact(REGISTER_WRITER, data, &reply); + status_t status __unused = remote()->transact(REGISTER_WRITER, data, &reply); // FIXME ignores status } @@ -53,7 +53,7 @@ public: Parcel data, reply; data.writeInterfaceToken(IMediaLogService::getInterfaceDescriptor()); data.writeStrongBinder(IInterface::asBinder(shared)); - status_t status = remote()->transact(UNREGISTER_WRITER, data, &reply); + status_t status __unused = remote()->transact(UNREGISTER_WRITER, data, &reply); // FIXME ignores status } diff --git a/media/libmedia/IResourceManagerService.cpp b/media/libmedia/IResourceManagerService.cpp index 95a2d1c..7ae946d 100644 --- a/media/libmedia/IResourceManagerService.cpp +++ b/media/libmedia/IResourceManagerService.cpp @@ -38,11 +38,9 @@ enum { template <typename T> static void writeToParcel(Parcel *data, const Vector<T> &items) { size_t size = items.size(); - size_t sizePosition = data->dataPosition(); // truncates size, but should be okay for this usecase data->writeUint32(static_cast<uint32_t>(size)); for (size_t i = 0; i < size; i++) { - size_t position = data->dataPosition(); items[i].writeToParcel(data); } } @@ -121,7 +119,6 @@ status_t BnResourceManagerService::onTransact( switch (code) { case CONFIG: { CHECK_INTERFACE(IResourceManagerService, data, reply); - int pid = data.readInt32(); sp<IResourceManagerClient> client( interface_cast<IResourceManagerClient>(data.readStrongBinder())); Vector<MediaResourcePolicy> policies; diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp index 47f9258..ae0061f 100644 --- a/media/libmedia/MediaProfiles.cpp +++ b/media/libmedia/MediaProfiles.cpp @@ -532,7 +532,6 @@ void MediaProfiles::checkAndAddRequiredProfilesIfNecessary() { CHECK(refIndex != -1); RequiredProfileRefInfo *info; camcorder_quality refQuality; - VideoCodec *codec = NULL; // Check high and low from either camcorder profile, timelapse profile // or high speed profile, but not all of them. Default, check camcorder profile diff --git a/media/libmedia/MediaResource.cpp b/media/libmedia/MediaResource.cpp index 8be01bc..eea2c43 100644 --- a/media/libmedia/MediaResource.cpp +++ b/media/libmedia/MediaResource.cpp @@ -50,7 +50,7 @@ void MediaResource::writeToParcel(Parcel *parcel) const { String8 MediaResource::toString() const { String8 str; - str.appendFormat("%s/%s:%llu", mType.string(), mSubType.string(), mValue); + str.appendFormat("%s/%s:%llu", mType.string(), mSubType.string(), (unsigned long long)mValue); return str; } diff --git a/media/libmedia/MediaResourcePolicy.cpp b/media/libmedia/MediaResourcePolicy.cpp index 2bb996a..139a38c 100644 --- a/media/libmedia/MediaResourcePolicy.cpp +++ b/media/libmedia/MediaResourcePolicy.cpp @@ -42,7 +42,7 @@ void MediaResourcePolicy::writeToParcel(Parcel *parcel) const { String8 MediaResourcePolicy::toString() const { String8 str; - str.appendFormat("%s:%llu", mType.string(), mValue); + str.appendFormat("%s:%llu", mType.string(), (unsigned long long)mValue); return str; } diff --git a/media/libmedia/MemoryLeakTrackUtil.cpp b/media/libmedia/MemoryLeakTrackUtil.cpp index d31f721..554dbae 100644 --- a/media/libmedia/MemoryLeakTrackUtil.cpp +++ b/media/libmedia/MemoryLeakTrackUtil.cpp @@ -173,7 +173,7 @@ void dumpMemoryAddresses(int fd) #else // Does nothing -void dumpMemoryAddresses(int fd) {} +void dumpMemoryAddresses(int fd __unused) {} #endif } // namespace android diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp index 2cc4685..6da5348 100644 --- a/media/libmedia/ToneGenerator.cpp +++ b/media/libmedia/ToneGenerator.cpp @@ -984,7 +984,6 @@ void ToneGenerator::stopTone() { if ((mStartTime.tv_sec != 0) && (clock_gettime(CLOCK_MONOTONIC, &stopTime) == 0)) { time_t sec = stopTime.tv_sec - mStartTime.tv_sec; long nsec = stopTime.tv_nsec - mStartTime.tv_nsec; - long durationMs; if (nsec < 0) { --sec; nsec += 1000000000; diff --git a/media/libmediaplayerservice/Android.mk b/media/libmediaplayerservice/Android.mk index 4b31715..2c4e719 100644 --- a/media/libmediaplayerservice/Android.mk +++ b/media/libmediaplayerservice/Android.mk @@ -54,6 +54,9 @@ LOCAL_C_INCLUDES := \ $(TOP)/frameworks/native/include/media/openmax \ $(TOP)/external/tremolo/Tremolo \ +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true + LOCAL_MODULE:= libmediaplayerservice LOCAL_32_BIT_ONLY := true diff --git a/media/libmediaplayerservice/Crypto.cpp b/media/libmediaplayerservice/Crypto.cpp index f639193..147d35f 100644 --- a/media/libmediaplayerservice/Crypto.cpp +++ b/media/libmediaplayerservice/Crypto.cpp @@ -89,7 +89,7 @@ void Crypto::findFactoryForScheme(const uint8_t uuid[16]) { // first check cache Vector<uint8_t> uuidVector; - uuidVector.appendArray(uuid, sizeof(uuid)); + uuidVector.appendArray(uuid, sizeof(uuid[0]) * 16); ssize_t index = mUUIDToLibraryPathMap.indexOfKey(uuidVector); if (index >= 0) { if (loadLibraryForScheme(mUUIDToLibraryPathMap[index], uuid)) { diff --git a/media/libmediaplayerservice/Drm.cpp b/media/libmediaplayerservice/Drm.cpp index 62cf3e5..8ca8769 100644 --- a/media/libmediaplayerservice/Drm.cpp +++ b/media/libmediaplayerservice/Drm.cpp @@ -209,7 +209,7 @@ void Drm::findFactoryForScheme(const uint8_t uuid[16]) { // first check cache Vector<uint8_t> uuidVector; - uuidVector.appendArray(uuid, sizeof(uuid)); + uuidVector.appendArray(uuid, sizeof(uuid[0]) * 16); ssize_t index = mUUIDToLibraryPathMap.indexOfKey(uuidVector); if (index >= 0) { if (loadLibraryForScheme(mUUIDToLibraryPathMap[index], uuid)) { @@ -776,7 +776,7 @@ status_t Drm::signRSA(Vector<uint8_t> const &sessionId, return mPlugin->signRSA(sessionId, algorithm, message, wrappedKey, signature); } -void Drm::binderDied(const wp<IBinder> &the_late_who) +void Drm::binderDied(const wp<IBinder> &the_late_who __unused) { mEventLock.lock(); mListener.clear(); diff --git a/media/libmediaplayerservice/Drm.h b/media/libmediaplayerservice/Drm.h index 1591738..c4013b8 100644 --- a/media/libmediaplayerservice/Drm.h +++ b/media/libmediaplayerservice/Drm.h @@ -26,8 +26,8 @@ namespace android { -struct DrmFactory; -struct DrmPlugin; +class DrmFactory; +class DrmPlugin; struct DrmSessionClientInterface; struct Drm : public BnDrm, diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index 8e2e214..87003c5 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -413,7 +413,7 @@ status_t MediaPlayerService::AudioOutput::dump(int fd, const Vector<String16>& a return NO_ERROR; } -status_t MediaPlayerService::Client::dump(int fd, const Vector<String16>& args) const +status_t MediaPlayerService::Client::dump(int fd, const Vector<String16>& args) { const size_t SIZE = 256; char buffer[SIZE]; @@ -1461,8 +1461,6 @@ status_t MediaPlayerService::AudioOutput::open( } ALOGV("open(%u, %d, 0x%x, 0x%x, %d, %d 0x%x)", sampleRate, channelCount, channelMask, format, bufferCount, mSessionId, flags); - uint32_t afSampleRate; - size_t afFrameCount; size_t frameCount; // offloading is only supported in callback mode for now. diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h index 2a95ce1..6ddfe14 100644 --- a/media/libmediaplayerservice/MediaPlayerService.h +++ b/media/libmediaplayerservice/MediaPlayerService.h @@ -304,7 +304,7 @@ private: int ext1, int ext2, const Parcel *obj); pid_t pid() const { return mPid; } - virtual status_t dump(int fd, const Vector<String16>& args) const; + virtual status_t dump(int fd, const Vector<String16>& args); int getAudioSessionId() { return mAudioSessionId; } diff --git a/media/libmediaplayerservice/MediaRecorderClient.cpp b/media/libmediaplayerservice/MediaRecorderClient.cpp index 4d4de9b..319ebb0 100644 --- a/media/libmediaplayerservice/MediaRecorderClient.cpp +++ b/media/libmediaplayerservice/MediaRecorderClient.cpp @@ -325,7 +325,7 @@ status_t MediaRecorderClient::setClientName(const String16& clientName) { return mRecorder->setClientName(clientName); } -status_t MediaRecorderClient::dump(int fd, const Vector<String16>& args) const { +status_t MediaRecorderClient::dump(int fd, const Vector<String16>& args) { if (mRecorder != NULL) { return mRecorder->dump(fd, args); } diff --git a/media/libmediaplayerservice/MediaRecorderClient.h b/media/libmediaplayerservice/MediaRecorderClient.h index a444b6c..b45344b 100644 --- a/media/libmediaplayerservice/MediaRecorderClient.h +++ b/media/libmediaplayerservice/MediaRecorderClient.h @@ -54,7 +54,7 @@ public: virtual status_t init(); virtual status_t close(); virtual status_t release(); - virtual status_t dump(int fd, const Vector<String16>& args) const; + virtual status_t dump(int fd, const Vector<String16>& args); virtual sp<IGraphicBufferProducer> querySurfaceMediaSource(); private: diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/media/libmediaplayerservice/MetadataRetrieverClient.cpp index 80804a7..6ef4c1f 100644 --- a/media/libmediaplayerservice/MetadataRetrieverClient.cpp +++ b/media/libmediaplayerservice/MetadataRetrieverClient.cpp @@ -57,7 +57,7 @@ MetadataRetrieverClient::~MetadataRetrieverClient() disconnect(); } -status_t MetadataRetrieverClient::dump(int fd, const Vector<String16>& /*args*/) const +status_t MetadataRetrieverClient::dump(int fd, const Vector<String16>& /*args*/) { const size_t SIZE = 256; char buffer[SIZE]; diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.h b/media/libmediaplayerservice/MetadataRetrieverClient.h index ce52b91..e71a29e 100644 --- a/media/libmediaplayerservice/MetadataRetrieverClient.h +++ b/media/libmediaplayerservice/MetadataRetrieverClient.h @@ -54,7 +54,7 @@ public: virtual sp<IMemory> extractAlbumArt(); virtual const char* extractMetadata(int keyCode); - virtual status_t dump(int fd, const Vector<String16>& args) const; + virtual status_t dump(int fd, const Vector<String16>& args); private: friend class MediaPlayerService; diff --git a/media/libmediaplayerservice/RemoteDisplay.h b/media/libmediaplayerservice/RemoteDisplay.h index 82a0116..1a48981 100644 --- a/media/libmediaplayerservice/RemoteDisplay.h +++ b/media/libmediaplayerservice/RemoteDisplay.h @@ -28,7 +28,7 @@ namespace android { struct ALooper; struct ANetworkSession; -struct IRemoteDisplayClient; +class IRemoteDisplayClient; struct WifiDisplaySource; struct RemoteDisplay : public BnRemoteDisplay { diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp index 55763f0..fb21c73 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -916,7 +916,6 @@ sp<MediaSource> StagefrightRecorder::createAudioSource() { } sp<AMessage> format = new AMessage; - const char *mime; switch (mAudioEncoder) { case AUDIO_ENCODER_AMR_NB: case AUDIO_ENCODER_DEFAULT: diff --git a/media/libmediaplayerservice/StagefrightRecorder.h b/media/libmediaplayerservice/StagefrightRecorder.h index f34c229..8fa5bfa 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.h +++ b/media/libmediaplayerservice/StagefrightRecorder.h @@ -37,7 +37,7 @@ struct AudioSource; class MediaProfiles; class IGraphicBufferProducer; class SurfaceMediaSource; -class ALooper; +struct ALooper; struct StagefrightRecorder : public MediaRecorderBase { StagefrightRecorder(); diff --git a/media/libmediaplayerservice/VideoFrameScheduler.h b/media/libmediaplayerservice/VideoFrameScheduler.h index 84b27b4..b1765c9 100644 --- a/media/libmediaplayerservice/VideoFrameScheduler.h +++ b/media/libmediaplayerservice/VideoFrameScheduler.h @@ -24,7 +24,7 @@ namespace android { -struct ISurfaceComposer; +class ISurfaceComposer; struct VideoFrameScheduler : public RefBase { VideoFrameScheduler(); diff --git a/media/libmediaplayerservice/nuplayer/Android.mk b/media/libmediaplayerservice/nuplayer/Android.mk index fca08e2..20193c3 100644 --- a/media/libmediaplayerservice/nuplayer/Android.mk +++ b/media/libmediaplayerservice/nuplayer/Android.mk @@ -25,6 +25,9 @@ LOCAL_C_INCLUDES := \ $(TOP)/frameworks/av/media/libmediaplayerservice \ $(TOP)/frameworks/native/include/media/openmax +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true + LOCAL_MODULE:= libstagefright_nuplayer LOCAL_MODULE_TAGS := eng diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp index 8f1cd57..b7a88e7 100644 --- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp +++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp @@ -703,7 +703,7 @@ void NuPlayer::GenericSource::onPollBuffering() { stopBufferingIfNecessary(); } } else if (cachedDataRemaining >= 0) { - ALOGV("onPollBuffering: cachedDataRemaining %d bytes", + ALOGV("onPollBuffering: cachedDataRemaining %zd bytes", cachedDataRemaining); if (cachedDataRemaining < kLowWaterMarkBytes) { @@ -790,7 +790,7 @@ void NuPlayer::GenericSource::onMessageReceived(const sp<AMessage> &msg) { } readBuffer(trackType, timeUs, &actualTimeUs, formatChange); readBuffer(counterpartType, -1, NULL, formatChange); - ALOGV("timeUs %lld actualTimeUs %lld", timeUs, actualTimeUs); + ALOGV("timeUs %lld actualTimeUs %lld", (long long)timeUs, (long long)actualTimeUs); break; } diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.h b/media/libmediaplayerservice/nuplayer/GenericSource.h index 2f6e78e..7fab051 100644 --- a/media/libmediaplayerservice/nuplayer/GenericSource.h +++ b/media/libmediaplayerservice/nuplayer/GenericSource.h @@ -31,13 +31,13 @@ class DecryptHandle; class DrmManagerClient; struct AnotherPacketSource; struct ARTSPController; -struct DataSource; -struct IDataSource; +class DataSource; +class IDataSource; struct IMediaHTTPService; struct MediaSource; class MediaBuffer; struct NuCachedSource2; -struct WVMExtractor; +class WVMExtractor; struct NuPlayer::GenericSource : public NuPlayer::Source { GenericSource(const sp<AMessage> ¬ify, bool uidValid, uid_t uid); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index dbe934c..a028b01 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -971,7 +971,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { CHECK(msg->findInt32("needNotify", &needNotify)); ALOGV("kWhatSeek seekTimeUs=%lld us, needNotify=%d", - seekTimeUs, needNotify); + (long long)seekTimeUs, needNotify); mDeferredActions.push_back( new FlushDecoderAction(FLUSH_CMD_FLUSH /* audio */, @@ -1336,8 +1336,6 @@ void NuPlayer::updateVideoSize( } int32_t displayWidth, displayHeight; - int32_t cropLeft, cropTop, cropRight, cropBottom; - if (outputFormat != NULL) { int32_t width, height; CHECK(outputFormat->findInt32("width", &width)); @@ -1574,7 +1572,7 @@ void NuPlayer::processDeferredActions() { void NuPlayer::performSeek(int64_t seekTimeUs, bool needNotify) { ALOGV("performSeek seekTimeUs=%lld us (%.2f secs), needNotify(%d)", - seekTimeUs, + (long long)seekTimeUs, seekTimeUs / 1E6, needNotify); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h index c0205b6..14bdb01 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h @@ -26,7 +26,7 @@ namespace android { struct ABuffer; struct AMessage; -struct IDataSource; +class IDataSource; class MetaData; struct NuPlayerDriver; diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerCCDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerCCDecoder.cpp index cf3e8ad..ac3c6b6 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerCCDecoder.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerCCDecoder.cpp @@ -51,6 +51,7 @@ static bool isNullPad(CCData *cc) { return cc->mData1 < 0x10 && cc->mData2 < 0x10; } +static void dumpBytePair(const sp<ABuffer> &ccBuf) __attribute__ ((unused)); static void dumpBytePair(const sp<ABuffer> &ccBuf) { size_t offset = 0; AString out; diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderBase.h b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderBase.h index e09fe04..262f5d5 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderBase.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderBase.h @@ -26,7 +26,7 @@ namespace android { struct ABuffer; struct MediaCodec; -struct MediaBuffer; +class MediaBuffer; struct NuPlayer::DecoderBase : public AHandler { DecoderBase(const sp<AMessage> ¬ify); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp index 827bdc1..f8be16a 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp @@ -856,7 +856,7 @@ void NuPlayer::Renderer::onDrainVideoQueue() { if (tooLate) { ALOGV("video late by %lld us (%.2f secs)", - mVideoLateByUs, mVideoLateByUs / 1E6); + (long long)mVideoLateByUs, mVideoLateByUs / 1E6); } else { int64_t mediaUs = 0; mMediaClock->getMediaTime(realTimeUs, &mediaUs); @@ -1178,7 +1178,7 @@ void NuPlayer::Renderer::onPause() { ALOGW("Renderer::onPause() called while already paused!"); return; } - int64_t currentPositionUs; + { Mutex::Autolock autoLock(mLock); ++mAudioDrainGeneration; @@ -1196,7 +1196,7 @@ void NuPlayer::Renderer::onPause() { startAudioOffloadPauseTimeout(); } - ALOGV("now paused audio queue has %d entries, video has %d entries", + ALOGV("now paused audio queue has %zu entries, video has %zu entries", mAudioQueue.size(), mVideoQueue.size()); } @@ -1289,7 +1289,7 @@ int64_t NuPlayer::Renderer::getPlayedOutAudioDurationUs(int64_t nowUs) { CHECK_EQ(res, (status_t)OK); numFramesPlayedAt = nowUs; numFramesPlayedAt += 1000LL * mAudioSink->latency() / 2; /* XXX */ - //ALOGD("getPosition: %d %lld", numFramesPlayed, numFramesPlayedAt); + //ALOGD("getPosition: %u %lld", numFramesPlayed, (long long)numFramesPlayedAt); } //CHECK_EQ(numFramesPlayed & (1 << 31), 0); // can't be negative until 12.4 hrs, test diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h index 1b0c2df..ef1ba13 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h @@ -28,7 +28,7 @@ namespace android { struct ABuffer; -struct MediaBuffer; +class MediaBuffer; struct NuPlayer::Source : public AHandler { enum Flags { diff --git a/media/libmediaplayerservice/tests/Android.mk b/media/libmediaplayerservice/tests/Android.mk index 7bc78ff..8cbf782 100644 --- a/media/libmediaplayerservice/tests/Android.mk +++ b/media/libmediaplayerservice/tests/Android.mk @@ -18,6 +18,9 @@ LOCAL_C_INCLUDES := \ frameworks/av/include \ frameworks/av/media/libmediaplayerservice \ +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true + LOCAL_32_BIT_ONLY := true include $(BUILD_NATIVE_TEST) diff --git a/media/libmediaplayerservice/tests/DrmSessionManager_test.cpp b/media/libmediaplayerservice/tests/DrmSessionManager_test.cpp index d3e760b..de350a1 100644 --- a/media/libmediaplayerservice/tests/DrmSessionManager_test.cpp +++ b/media/libmediaplayerservice/tests/DrmSessionManager_test.cpp @@ -98,17 +98,17 @@ protected: mDrmSessionManager->addSession(kTestPid2, mTestDrm2, mSessionId2); mDrmSessionManager->addSession(kTestPid2, mTestDrm2, mSessionId3); const PidSessionInfosMap& map = sessionMap(); - EXPECT_EQ(2, map.size()); + EXPECT_EQ(2u, map.size()); ssize_t index1 = map.indexOfKey(kTestPid1); ASSERT_GE(index1, 0); const SessionInfos& infos1 = map[index1]; - EXPECT_EQ(1, infos1.size()); + EXPECT_EQ(1u, infos1.size()); ExpectEqSessionInfo(infos1[0], mTestDrm1, mSessionId1, 0); ssize_t index2 = map.indexOfKey(kTestPid2); ASSERT_GE(index2, 0); const SessionInfos& infos2 = map[index2]; - EXPECT_EQ(2, infos2.size()); + EXPECT_EQ(2u, infos2.size()); ExpectEqSessionInfo(infos2[0], mTestDrm2, mSessionId2, 1); ExpectEqSessionInfo(infos2[1], mTestDrm2, mSessionId3, 2); } @@ -185,11 +185,11 @@ TEST_F(DrmSessionManagerTest, removeSession) { mDrmSessionManager->removeSession(mSessionId2); const PidSessionInfosMap& map = sessionMap(); - EXPECT_EQ(2, map.size()); + EXPECT_EQ(2u, map.size()); const SessionInfos& infos1 = map.valueFor(kTestPid1); const SessionInfos& infos2 = map.valueFor(kTestPid2); - EXPECT_EQ(1, infos1.size()); - EXPECT_EQ(1, infos2.size()); + EXPECT_EQ(1u, infos1.size()); + EXPECT_EQ(1u, infos2.size()); // mSessionId2 has been removed. ExpectEqSessionInfo(infos2[0], mTestDrm2, mSessionId3, 2); } @@ -207,7 +207,7 @@ TEST_F(DrmSessionManagerTest, removeDrm) { const PidSessionInfosMap& map = sessionMap(); const SessionInfos& infos2 = map.valueFor(kTestPid2); - EXPECT_EQ(1, infos2.size()); + EXPECT_EQ(1u, infos2.size()); // mTestDrm2 has been removed. ExpectEqSessionInfo(infos2[0], drm, sessionId, 3); } @@ -220,7 +220,7 @@ TEST_F(DrmSessionManagerTest, reclaimSession) { EXPECT_FALSE(mDrmSessionManager->reclaimSession(50)); EXPECT_TRUE(mDrmSessionManager->reclaimSession(10)); - EXPECT_EQ(1, mTestDrm1->reclaimedSessions().size()); + EXPECT_EQ(1u, mTestDrm1->reclaimedSessions().size()); EXPECT_TRUE(isEqualSessionId(mSessionId1, mTestDrm1->reclaimedSessions()[0])); mDrmSessionManager->removeSession(mSessionId1); @@ -233,7 +233,7 @@ TEST_F(DrmSessionManagerTest, reclaimSession) { mDrmSessionManager->addSession(15, drm, sessionId); EXPECT_TRUE(mDrmSessionManager->reclaimSession(18)); - EXPECT_EQ(1, mTestDrm2->reclaimedSessions().size()); + EXPECT_EQ(1u, mTestDrm2->reclaimedSessions().size()); // mSessionId2 is reclaimed. EXPECT_TRUE(isEqualSessionId(mSessionId2, mTestDrm2->reclaimedSessions()[0])); } diff --git a/media/libstagefright/AACExtractor.cpp b/media/libstagefright/AACExtractor.cpp index 196f6ee..45e8a30 100644 --- a/media/libstagefright/AACExtractor.cpp +++ b/media/libstagefright/AACExtractor.cpp @@ -360,7 +360,7 @@ bool SniffAAC( pos += len; ALOGV("skipped ID3 tag, new starting offset is %lld (0x%016llx)", - pos, pos); + (long long)pos, (long long)pos); } uint8_t header[2]; diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 45f6339..da22f11 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -629,14 +629,23 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( return err; } - err = native_window_set_buffers_geometry( + err = native_window_set_buffers_dimensions( mNativeWindow.get(), def.format.video.nFrameWidth, - def.format.video.nFrameHeight, + def.format.video.nFrameHeight); + + if (err != 0) { + ALOGE("native_window_set_buffers_dimensions failed: %s (%d)", + strerror(-err), -err); + return err; + } + + err = native_window_set_buffers_format( + mNativeWindow.get(), def.format.video.eColorFormat); if (err != 0) { - ALOGE("native_window_set_buffers_geometry failed: %s (%d)", + ALOGE("native_window_set_buffers_format failed: %s (%d)", strerror(-err), -err); return err; } @@ -990,7 +999,7 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() { CHECK_EQ(metaData->eType, kMetadataBufferTypeGrallocSource); ALOGV("replaced oldest buffer #%u with age %u (%p/%p stored in %p)", - oldest - &mBuffers[kPortIndexOutput][0], + (unsigned)(oldest - &mBuffers[kPortIndexOutput][0]), mDequeueCounter - oldest->mDequeuedAt, metaData->pHandle, oldest->mGraphicBuffer->handle, oldest->mData->base()); @@ -1598,7 +1607,7 @@ status_t ACodec::configureCodec( err = setupG711Codec(encoder, sampleRate, numChannels); } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC)) { - int32_t numChannels, sampleRate, compressionLevel = -1; + int32_t numChannels = 0, sampleRate = 0, compressionLevel = -1; if (encoder && (!msg->findInt32("channel-count", &numChannels) || !msg->findInt32("sample-rate", &sampleRate))) { @@ -3926,9 +3935,7 @@ void ACodec::sendFormatChange(const sp<AMessage> &reply) { if (mSkipCutBuffer != NULL) { size_t prevbufsize = mSkipCutBuffer->size(); if (prevbufsize != 0) { - ALOGW("Replacing SkipCutBuffer holding %d " - "bytes", - prevbufsize); + ALOGW("Replacing SkipCutBuffer holding %zu bytes", prevbufsize); } } mSkipCutBuffer = new SkipCutBuffer( @@ -3984,10 +3991,16 @@ status_t ACodec::pushBlankBuffersToNativeWindow() { return err; } - err = native_window_set_buffers_geometry(mNativeWindow.get(), 1, 1, - HAL_PIXEL_FORMAT_RGBX_8888); + err = native_window_set_buffers_dimensions(mNativeWindow.get(), 1, 1); + if (err != NO_ERROR) { + ALOGE("error pushing blank frames: set_buffers_dimensions failed: %s (%d)", + strerror(-err), -err); + goto error; + } + + err = native_window_set_buffers_format(mNativeWindow.get(), HAL_PIXEL_FORMAT_RGBX_8888); if (err != NO_ERROR) { - ALOGE("error pushing blank frames: set_buffers_geometry failed: %s (%d)", + ALOGE("error pushing blank frames: set_buffers_format failed: %s (%d)", strerror(-err), -err); goto error; } @@ -4218,7 +4231,7 @@ bool ACodec::BaseState::onOMXMessage(const sp<AMessage> &msg) { // there is a possibility that this is an outstanding message for a // codec that we have already destroyed - if (mCodec->mNode == NULL) { + if (mCodec->mNode == 0) { ALOGI("ignoring message as already freed component: %s", msg->debugString().c_str()); return true; @@ -4290,13 +4303,13 @@ bool ACodec::BaseState::onOMXMessage(const sp<AMessage> &msg) { bool ACodec::BaseState::onOMXEvent( OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) { if (event != OMX_EventError) { - ALOGV("[%s] EVENT(%d, 0x%08lx, 0x%08lx)", + ALOGV("[%s] EVENT(%d, 0x%08x, 0x%08x)", mCodec->mComponentName.c_str(), event, data1, data2); return false; } - ALOGE("[%s] ERROR(0x%08lx)", mCodec->mComponentName.c_str(), data1); + ALOGE("[%s] ERROR(0x%08x)", mCodec->mComponentName.c_str(), data1); // verify OMX component sends back an error we expect. OMX_ERRORTYPE omxError = (OMX_ERRORTYPE)data1; @@ -4310,7 +4323,7 @@ bool ACodec::BaseState::onOMXEvent( } bool ACodec::BaseState::onOMXEmptyBufferDone(IOMX::buffer_id bufferID) { - ALOGV("[%s] onOMXEmptyBufferDone %p", + ALOGV("[%s] onOMXEmptyBufferDone %u", mCodec->mComponentName.c_str(), bufferID); BufferInfo *info = @@ -4436,7 +4449,7 @@ void ACodec::BaseState::onInputBufferFilled(const sp<AMessage> &msg) { } if (buffer != info->mData) { - ALOGV("[%s] Needs to copy input data for buffer %p. (%p != %p)", + ALOGV("[%s] Needs to copy input data for buffer %u. (%p != %p)", mCodec->mComponentName.c_str(), bufferID, buffer.get(), info->mData.get()); @@ -4446,18 +4459,18 @@ void ACodec::BaseState::onInputBufferFilled(const sp<AMessage> &msg) { } if (flags & OMX_BUFFERFLAG_CODECCONFIG) { - ALOGV("[%s] calling emptyBuffer %p w/ codec specific data", + ALOGV("[%s] calling emptyBuffer %u w/ codec specific data", mCodec->mComponentName.c_str(), bufferID); } else if (flags & OMX_BUFFERFLAG_EOS) { - ALOGV("[%s] calling emptyBuffer %p w/ EOS", + ALOGV("[%s] calling emptyBuffer %u w/ EOS", mCodec->mComponentName.c_str(), bufferID); } else { #if TRACK_BUFFER_TIMING - ALOGI("[%s] calling emptyBuffer %p w/ time %lld us", - mCodec->mComponentName.c_str(), bufferID, timeUs); + ALOGI("[%s] calling emptyBuffer %u w/ time %lld us", + mCodec->mComponentName.c_str(), bufferID, (long long)timeUs); #else - ALOGV("[%s] calling emptyBuffer %p w/ time %lld us", - mCodec->mComponentName.c_str(), bufferID, timeUs); + ALOGV("[%s] calling emptyBuffer %u w/ time %lld us", + mCodec->mComponentName.c_str(), bufferID, (long long)timeUs); #endif } @@ -4511,7 +4524,7 @@ void ACodec::BaseState::onInputBufferFilled(const sp<AMessage> &msg) { mCodec->mComponentName.c_str()); } - ALOGV("[%s] calling emptyBuffer %p signalling EOS", + ALOGV("[%s] calling emptyBuffer %u signalling EOS", mCodec->mComponentName.c_str(), bufferID); CHECK_EQ(mCodec->mOMX->emptyBuffer( @@ -4812,7 +4825,7 @@ void ACodec::UninitializedState::stateEntered() { } mCodec->mNativeWindow.clear(); - mCodec->mNode = NULL; + mCodec->mNode = 0; mCodec->mOMX.clear(); mCodec->mQuirks = 0; mCodec->mFlags = 0; @@ -4890,7 +4903,7 @@ void ACodec::UninitializedState::onSetup( bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { ALOGV("onAllocateComponent"); - CHECK(mCodec->mNode == NULL); + CHECK(mCodec->mNode == 0); OMXClient client; CHECK_EQ(client.connect(), (status_t)OK); @@ -4938,7 +4951,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { } sp<CodecObserver> observer = new CodecObserver; - IOMX::node_id node = NULL; + IOMX::node_id node = 0; status_t err = OMX_ErrorComponentNotFound; for (size_t matchIndex = 0; matchIndex < matchingCodecs.size(); @@ -4958,10 +4971,10 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { ALOGW("Allocating component '%s' failed, try next one.", componentName.c_str()); } - node = NULL; + node = 0; } - if (node == NULL) { + if (node == 0) { if (!mime.empty()) { ALOGE("Unable to instantiate a %scoder for type '%s' with err %#x.", encoder ? "en" : "de", mime.c_str(), err); @@ -5109,7 +5122,7 @@ bool ACodec::LoadedState::onConfigureComponent( const sp<AMessage> &msg) { ALOGV("onConfigureComponent"); - CHECK(mCodec->mNode != NULL); + CHECK(mCodec->mNode != 0); AString mime; CHECK(msg->findString("mime", &mime)); @@ -5449,7 +5462,7 @@ void ACodec::ExecutingState::submitRegularOutputBuffers() { CHECK_EQ((int)info->mStatus, (int)BufferInfo::OWNED_BY_US); } - ALOGV("[%s] calling fillBuffer %p", + ALOGV("[%s] calling fillBuffer %u", mCodec->mComponentName.c_str(), info->mBufferID); CHECK_EQ(mCodec->mOMX->fillBuffer(mCodec->mNode, info->mBufferID), @@ -5523,7 +5536,7 @@ bool ACodec::ExecutingState::onMessageReceived(const sp<AMessage> &msg) { case kWhatFlush: { ALOGV("[%s] ExecutingState flushing now " - "(codec owns %d/%d input, %d/%d output).", + "(codec owns %zu/%zu input, %zu/%zu output).", mCodec->mComponentName.c_str(), mCodec->countBuffersOwnedByComponent(kPortIndexInput), mCodec->mBuffers[kPortIndexInput].size(), @@ -5705,7 +5718,7 @@ bool ACodec::ExecutingState::onOMXEvent( } else if (data2 == OMX_IndexConfigCommonOutputCrop) { mCodec->mSentFormat = false; } else { - ALOGV("[%s] OMX_EventPortSettingsChanged 0x%08lx", + ALOGV("[%s] OMX_EventPortSettingsChanged 0x%08x", mCodec->mComponentName.c_str(), data2); } @@ -6035,8 +6048,8 @@ bool ACodec::FlushingState::onMessageReceived(const sp<AMessage> &msg) { bool ACodec::FlushingState::onOMXEvent( OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) { - ALOGV("[%s] FlushingState onOMXEvent(%d,%ld)", - mCodec->mComponentName.c_str(), event, data1); + ALOGV("[%s] FlushingState onOMXEvent(%u,%d)", + mCodec->mComponentName.c_str(), event, (OMX_S32)data1); switch (event) { case OMX_EventCmdComplete: diff --git a/media/libstagefright/Android.mk b/media/libstagefright/Android.mk index 0ba6743..45581f3 100644 --- a/media/libstagefright/Android.mk +++ b/media/libstagefright/Android.mk @@ -123,7 +123,8 @@ LOCAL_SHARED_LIBRARIES += \ libdl \ libRScpp \ -LOCAL_CFLAGS += -Wno-multichar +LOCAL_CFLAGS += -Wno-multichar -Werror -Wall +LOCAL_CLANG := true LOCAL_MODULE:= libstagefright diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 87eef1e..c14625d 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -360,7 +360,7 @@ status_t AwesomePlayer::setDataSource( return setDataSource_l(dataSource); } -status_t AwesomePlayer::setDataSource(const sp<IStreamSource> &source) { +status_t AwesomePlayer::setDataSource(const sp<IStreamSource> &source __unused) { return INVALID_OPERATION; } @@ -422,7 +422,7 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) { mBitrate = totalBitRate; - ALOGV("mBitrate = %lld bits/sec", mBitrate); + ALOGV("mBitrate = %lld bits/sec", (long long)mBitrate); { Mutex::Autolock autoLock(mStatsLock); @@ -1722,7 +1722,7 @@ void AwesomePlayer::finishSeekIfNecessary(int64_t videoTimeUs) { // we are now resuming. Signal new position to media time provider. // Cannot signal another SEEK_COMPLETE, as existing clients may not expect // multiple SEEK_COMPLETE responses to a single seek() request. - if (mSeekNotificationSent && abs(mSeekTimeUs - videoTimeUs) > 10000) { + if (mSeekNotificationSent && llabs((long long)(mSeekTimeUs - videoTimeUs)) > 10000) { // notify if we are resuming more than 10ms away from desired seek time notifyListener_l(MEDIA_SKIPPED); } @@ -2358,7 +2358,7 @@ status_t AwesomePlayer::finishSetDataSource_l() { } CHECK_GE(metaDataSize, 0ll); - ALOGV("metaDataSize = %lld bytes", metaDataSize); + ALOGV("metaDataSize = %lld bytes", (long long)metaDataSize); } usleep(200000); diff --git a/media/libstagefright/CallbackDataSource.cpp b/media/libstagefright/CallbackDataSource.cpp index e16cef7..2e0745f 100644 --- a/media/libstagefright/CallbackDataSource.cpp +++ b/media/libstagefright/CallbackDataSource.cpp @@ -72,7 +72,7 @@ ssize_t CallbackDataSource::readAt(off64_t offset, void* data, size_t size) { } // Sanity check. CHECK((size_t)numRead <= numToRead && numRead >= 0 && - numRead <= bufferSize); + (size_t)numRead <= bufferSize); memcpy(((uint8_t*)data) + totalNumRead, mMemory->pointer(), numRead); numLeft -= numRead; totalNumRead += numRead; diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index ad12bdd..1b788f3 100644 --- a/media/libstagefright/CameraSource.cpp +++ b/media/libstagefright/CameraSource.cpp @@ -851,11 +851,11 @@ status_t CameraSource::read( } void CameraSource::dataCallbackTimestamp(int64_t timestampUs, - int32_t msgType, const sp<IMemory> &data) { - ALOGV("dataCallbackTimestamp: timestamp %" PRId64 " us", timestampUs); + int32_t msgType __unused, const sp<IMemory> &data) { + ALOGV("dataCallbackTimestamp: timestamp %lld us", (long long)timestampUs); Mutex::Autolock autoLock(mLock); if (!mStarted || (mNumFramesReceived == 0 && timestampUs < mStartTimeUs)) { - ALOGV("Drop frame at %" PRId64 "/%" PRId64 " us", timestampUs, mStartTimeUs); + ALOGV("Drop frame at %lld/%lld us", (long long)timestampUs, (long long)mStartTimeUs); releaseOneRecordingFrame(data); return; } @@ -913,7 +913,7 @@ void CameraSource::ProxyListener::dataCallbackTimestamp( mSource->dataCallbackTimestamp(timestamp / 1000, msgType, dataPtr); } -void CameraSource::DeathNotifier::binderDied(const wp<IBinder>& who) { +void CameraSource::DeathNotifier::binderDied(const wp<IBinder>& who __unused) { ALOGI("Camera recording proxy died"); } diff --git a/media/libstagefright/FLACExtractor.cpp b/media/libstagefright/FLACExtractor.cpp index fa7251c..8b972b7 100644 --- a/media/libstagefright/FLACExtractor.cpp +++ b/media/libstagefright/FLACExtractor.cpp @@ -651,10 +651,10 @@ MediaBuffer *FLACParser::readBuffer(bool doSeek, FLAC__uint64 sample) if (doSeek) { // We implement the seek callback, so this works without explicit flush if (!FLAC__stream_decoder_seek_absolute(mDecoder, sample)) { - ALOGE("FLACParser::readBuffer seek to sample %llu failed", sample); + ALOGE("FLACParser::readBuffer seek to sample %lld failed", (long long)sample); return NULL; } - ALOGV("FLACParser::readBuffer seek to sample %llu succeeded", sample); + ALOGV("FLACParser::readBuffer seek to sample %lld succeeded", (long long)sample); } else { if (!FLAC__stream_decoder_process_single(mDecoder)) { ALOGE("FLACParser::readBuffer process_single failed"); diff --git a/media/libstagefright/FileSource.cpp b/media/libstagefright/FileSource.cpp index f0db76b..565f156 100644 --- a/media/libstagefright/FileSource.cpp +++ b/media/libstagefright/FileSource.cpp @@ -111,7 +111,7 @@ ssize_t FileSource::readAt(off64_t offset, void *data, size_t size) { } else { off64_t result = lseek64(mFd, offset + mOffset, SEEK_SET); if (result == -1) { - ALOGE("seek to %lld failed", offset + mOffset); + ALOGE("seek to %lld failed", (long long)(offset + mOffset)); return UNKNOWN_ERROR; } diff --git a/media/libstagefright/HTTPBase.cpp b/media/libstagefright/HTTPBase.cpp index 77a652a..068a77f 100644 --- a/media/libstagefright/HTTPBase.cpp +++ b/media/libstagefright/HTTPBase.cpp @@ -34,10 +34,10 @@ HTTPBase::HTTPBase() : mNumBandwidthHistoryItems(0), mTotalTransferTimeUs(0), mTotalTransferBytes(0), + mMaxBandwidthHistoryItems(100), mPrevBandwidthMeasureTimeUs(0), mPrevEstimatedBandWidthKbps(0), - mBandWidthCollectFreqMs(5000), - mMaxBandwidthHistoryItems(100) { + mBandWidthCollectFreqMs(5000) { } void HTTPBase::addBandwidthMeasurement( diff --git a/media/libstagefright/MP3Extractor.cpp b/media/libstagefright/MP3Extractor.cpp index 4a63152..55e3c19 100644 --- a/media/libstagefright/MP3Extractor.cpp +++ b/media/libstagefright/MP3Extractor.cpp @@ -82,7 +82,7 @@ static bool Resync( *inout_pos += len; ALOGV("skipped ID3 tag, new starting offset is %lld (0x%016llx)", - *inout_pos, *inout_pos); + (long long)*inout_pos, (long long)*inout_pos); } if (post_id3_pos != NULL) { @@ -103,9 +103,9 @@ static bool Resync( uint8_t *tmp = buf; do { - if (pos >= *inout_pos + kMaxBytesChecked) { + if (pos >= (off64_t)(*inout_pos + kMaxBytesChecked)) { // Don't scan forever. - ALOGV("giving up at offset %lld", pos); + ALOGV("giving up at offset %lld", (long long)pos); break; } @@ -155,7 +155,7 @@ static bool Resync( continue; } - ALOGV("found possible 1st frame at %lld (header = 0x%08x)", pos, header); + ALOGV("found possible 1st frame at %lld (header = 0x%08x)", (long long)pos, header); // We found what looks like a valid frame, // now find its successors. @@ -186,7 +186,7 @@ static bool Resync( break; } - ALOGV("found subsequent frame #%d at %lld", j + 2, test_pos); + ALOGV("found subsequent frame #%d at %lld", j + 2, (long long)test_pos); test_pos += test_frame_size; } diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 28a9ed9..6573afc 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -503,7 +503,7 @@ status_t MPEG4Extractor::readMetaData() { } else if (offset <= orig_offset) { // only continue parsing if the offset was advanced, // otherwise we might end up in an infinite loop - ALOGE("did not advance: 0x%lld->0x%lld", orig_offset, offset); + ALOGE("did not advance: %lld->%lld", (long long)orig_offset, (long long)offset); err = ERROR_MALFORMED; break; } else if (err == UNKNOWN_ERROR) { @@ -761,7 +761,7 @@ static void convertTimeToDate(int64_t time_1904, String8 *s) { } status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { - ALOGV("entering parseChunk %lld/%d", *offset, depth); + ALOGV("entering parseChunk %lld/%d", (long long)*offset, depth); uint32_t hdr[2]; if (mDataSource->readAt(*offset, hdr, 8) < 8) { return ERROR_IO; @@ -805,7 +805,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { char chunk[5]; MakeFourCCString(chunk_type, chunk); - ALOGV("chunk: %s @ %lld, %d", chunk, *offset, depth); + ALOGV("chunk: %s @ %lld, %d", chunk, (long long)*offset, depth); if (kUseHexDump) { static const char kWhitespace[] = " "; @@ -1724,7 +1724,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { char buffer[23]; if (chunk_data_size != 7 && chunk_data_size != 23) { - ALOGE("Incorrect D263 box size %lld", chunk_data_size); + ALOGE("Incorrect D263 box size %lld", (long long)chunk_data_size); return ERROR_MALFORMED; } @@ -2015,7 +2015,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { if (mFileMetaData != NULL) { ALOGV("chunk_data_size = %lld and data_offset = %lld", - chunk_data_size, data_offset); + (long long)chunk_data_size, (long long)data_offset); sp<ABuffer> buffer = new ABuffer(chunk_data_size + 1); if (mDataSource->readAt( data_offset, buffer->data(), chunk_data_size) != (ssize_t)chunk_data_size) { @@ -2433,7 +2433,7 @@ status_t MPEG4Extractor::parseITunesMetaData(off64_t offset, size_t size) { uint32_t metadataKey = 0; char chunk[5]; MakeFourCCString(mPath[4], chunk); - ALOGV("meta: %s @ %lld", chunk, offset); + ALOGV("meta: %s @ %lld", chunk, (long long)offset); switch ((int32_t)mPath[4]) { case FOURCC(0xa9, 'a', 'l', 'b'): { @@ -2937,7 +2937,7 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio( } if (kUseHexDump) { - printf("ESD of size %d\n", csd_size); + printf("ESD of size %zu\n", csd_size); hexdump(csd, csd_size); } @@ -3344,7 +3344,7 @@ status_t MPEG4Source::parseChunk(off64_t *offset) { char chunk[5]; MakeFourCCString(chunk_type, chunk); - ALOGV("MPEG4Source chunk %s @ %llx", chunk, *offset); + ALOGV("MPEG4Source chunk %s @ %#llx", chunk, (long long)*offset); off64_t chunk_data_size = *offset + chunk_size - data_offset; @@ -3801,7 +3801,7 @@ status_t MPEG4Source::parseTrackFragmentRun(off64_t offset, off64_t size) { sampleCtsOffset = 0; } - if (size < (off64_t)sampleCount * bytesPerSample) { + if (size < (off64_t)(sampleCount * bytesPerSample)) { return -EINVAL; } @@ -4553,7 +4553,7 @@ static bool BetterSniffMPEG4( char chunkstring[5]; MakeFourCCString(chunkType, chunkstring); - ALOGV("saw chunk type %s, size %" PRIu64 " @ %lld", chunkstring, chunkSize, offset); + ALOGV("saw chunk type %s, size %" PRIu64 " @ %lld", chunkstring, chunkSize, (long long)offset); switch (chunkType) { case FOURCC('f', 't', 'y', 'p'): { @@ -4616,7 +4616,7 @@ static bool BetterSniffMPEG4( *meta = new AMessage; (*meta)->setInt64("meta-data-size", moovAtomEndOffset); - ALOGV("found metadata size: %lld", moovAtomEndOffset); + ALOGV("found metadata size: %lld", (long long)moovAtomEndOffset); } return true; diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index 3d83e83..beb12ec 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -63,9 +63,11 @@ static const uint8_t kNalUnitTypeSeqParamSet = 0x07; static const uint8_t kNalUnitTypePicParamSet = 0x08; static const int64_t kInitialDelayTimeUs = 700000LL; -static const char kMetaKey_Model[] = "com.android.model"; static const char kMetaKey_Version[] = "com.android.version"; +#ifdef SHOW_MODEL_BUILD +static const char kMetaKey_Model[] = "com.android.model"; static const char kMetaKey_Build[] = "com.android.build"; +#endif static const char kMetaKey_CaptureFps[] = "com.android.capture.fps"; /* uncomment to include model and build in meta */ @@ -372,8 +374,8 @@ MPEG4Writer::MPEG4Writer(int fd) mLatitudex10000(0), mLongitudex10000(0), mAreGeoTagsAvailable(false), - mMetaKeys(new AMessage()), - mStartTimeOffsetMs(-1) { + mStartTimeOffsetMs(-1), + mMetaKeys(new AMessage()) { addDeviceMeta(); } diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index 8688d9b..5ae79e6 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -308,10 +308,10 @@ MediaCodec::MediaCodec(const sp<ALooper> &looper) mCodec(NULL), mReplyID(0), mFlags(0), - mResourceManagerClient(new ResourceManagerClient(this)), - mResourceManagerService(new ResourceManagerServiceProxy()), mStickyError(OK), mSoftRenderer(NULL), + mResourceManagerClient(new ResourceManagerClient(this)), + mResourceManagerService(new ResourceManagerServiceProxy()), mBatteryStatNotified(false), mIsVideo(false), mVideoWidth(0), diff --git a/media/libstagefright/MediaCodecListOverrides.cpp b/media/libstagefright/MediaCodecListOverrides.cpp index 3c54f34..265b1ea 100644 --- a/media/libstagefright/MediaCodecListOverrides.cpp +++ b/media/libstagefright/MediaCodecListOverrides.cpp @@ -130,7 +130,7 @@ static size_t doProfileCodecs( while (err == OK && codecs.size() < kMaxInstances) { sp<ALooper> looper = new ALooper; looper->setName("MediaCodec_looper"); - ALOGV("doProfileCodecs for codec #%u", codecs.size()); + ALOGV("doProfileCodecs for codec #%zu", codecs.size()); ALOGV("doProfileCodecs start looper"); looper->start( false /* runOnCallingThread */, false /* canCallJava */, ANDROID_PRIORITY_AUDIO); @@ -234,7 +234,7 @@ void profileCodecs( if (max > 0) { CodecSettings settings; char maxStr[32]; - sprintf(maxStr, "%u", max); + sprintf(maxStr, "%zu", max); settings.add("max-supported-instances", maxStr); AString key = name; @@ -302,10 +302,10 @@ void exportResultsToXML(const char *fileName, const KeyedVector<AString, CodecSe char *buf = (char *)malloc(size); if (fread(buf, size, 1, f) == 1) { overrides.setTo(buf, size); -#if LOG_NDEBUG == 0 - ALOGV("Existing overrides:"); - printLongString(buf, size); -#endif + if (!LOG_NDEBUG) { + ALOGV("Existing overrides:"); + printLongString(buf, size); + } } else { ALOGE("Failed to read %s", fileName); } @@ -385,10 +385,10 @@ void exportResultsToXML(const char *fileName, const KeyedVector<AString, CodecSe } } -#if LOG_NDEBUG == 0 - ALOGV("New overrides:"); - printLongString(overrides.c_str(), overrides.size()); -#endif + if (!LOG_NDEBUG) { + ALOGV("New overrides:"); + printLongString(overrides.c_str(), overrides.size()); + } f = fopen(fileName, "wb"); if (f == NULL) { diff --git a/media/libstagefright/MediaCodecListOverrides.h b/media/libstagefright/MediaCodecListOverrides.h index f97ce63..c6cc2ea 100644 --- a/media/libstagefright/MediaCodecListOverrides.h +++ b/media/libstagefright/MediaCodecListOverrides.h @@ -26,7 +26,7 @@ namespace android { -class MediaCodecInfo; +struct MediaCodecInfo; bool splitString(const AString &s, const AString &delimiter, AString *s1, AString *s2); diff --git a/media/libstagefright/MediaCodecSource.cpp b/media/libstagefright/MediaCodecSource.cpp index 6568d25..b272448 100644 --- a/media/libstagefright/MediaCodecSource.cpp +++ b/media/libstagefright/MediaCodecSource.cpp @@ -682,7 +682,6 @@ void MediaCodecSource::onMessageReceived(const sp<AMessage> &msg) { size_t size; int64_t timeUs; int32_t flags; - native_handle_t* handle = NULL; CHECK(msg->findInt32("index", &index)); CHECK(msg->findSize("offset", &offset)); diff --git a/media/libstagefright/MidiExtractor.cpp b/media/libstagefright/MidiExtractor.cpp index 66fab77..f6b8c84 100644 --- a/media/libstagefright/MidiExtractor.cpp +++ b/media/libstagefright/MidiExtractor.cpp @@ -217,7 +217,7 @@ status_t MidiEngine::releaseBuffers() { } status_t MidiEngine::seekTo(int64_t positionUs) { - ALOGV("seekTo %lld", positionUs); + ALOGV("seekTo %lld", (long long)positionUs); EAS_RESULT result = EAS_Locate(mEasData, mEasHandle, positionUs / 1000, false); return result == EAS_SUCCESS ? OK : UNKNOWN_ERROR; } diff --git a/media/libstagefright/NuCachedSource2.cpp b/media/libstagefright/NuCachedSource2.cpp index 8d70e50..1c53b40 100644 --- a/media/libstagefright/NuCachedSource2.cpp +++ b/media/libstagefright/NuCachedSource2.cpp @@ -503,7 +503,7 @@ void NuCachedSource2::restartPrefetcherIfNecessary_l( ssize_t NuCachedSource2::readAt(off64_t offset, void *data, size_t size) { Mutex::Autolock autoSerializer(mSerializer); - ALOGV("readAt offset %lld, size %zu", offset, size); + ALOGV("readAt offset %lld, size %zu", (long long)offset, size); Mutex::Autolock autoLock(mLock); if (mDisconnecting) { @@ -579,7 +579,7 @@ size_t NuCachedSource2::approxDataRemaining_l(status_t *finalStatus) const { ssize_t NuCachedSource2::readInternal(off64_t offset, void *data, size_t size) { CHECK_LE(size, (size_t)mHighwaterThresholdBytes); - ALOGV("readInternal offset %lld size %zu", offset, size); + ALOGV("readInternal offset %lld size %zu", (long long)offset, size); Mutex::Autolock autoLock(mLock); @@ -640,7 +640,7 @@ status_t NuCachedSource2::seekInternal_l(off64_t offset) { return OK; } - ALOGI("new range: offset= %lld", offset); + ALOGI("new range: offset= %lld", (long long)offset); mCacheOffset = offset; @@ -719,10 +719,10 @@ void NuCachedSource2::updateCacheParamsFromString(const char *s) { mKeepAliveIntervalUs = kDefaultKeepAliveIntervalUs; } - ALOGV("lowwater = %zu bytes, highwater = %zu bytes, keepalive = %" PRId64 " us", + ALOGV("lowwater = %zu bytes, highwater = %zu bytes, keepalive = %lld us", mLowwaterThresholdBytes, mHighwaterThresholdBytes, - mKeepAliveIntervalUs); + (long long)mKeepAliveIntervalUs); } // static diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 4d30069..8d4bab8 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1057,7 +1057,7 @@ status_t OMXCodec::getVideoProfileLevel( const sp<MetaData>& meta, const CodecProfileLevel& defaultProfileLevel, CodecProfileLevel &profileLevel) { - CODEC_LOGV("Default profile: %ld, level %ld", + CODEC_LOGV("Default profile: %u, level #x%x", defaultProfileLevel.mProfile, defaultProfileLevel.mLevel); // Are the default profile and level overwriten? @@ -1283,7 +1283,7 @@ status_t OMXCodec::setVideoOutputFormat( success = success && meta->findInt32(kKeyHeight, &height); CHECK(success); - CODEC_LOGV("setVideoOutputFormat width=%ld, height=%ld", width, height); + CODEC_LOGV("setVideoOutputFormat width=%d, height=%d", width, height); OMX_VIDEO_CODINGTYPE compressionFormat = OMX_VIDEO_CodingUnused; if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_AVC, mime)) { @@ -1650,7 +1650,7 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { return err; } - CODEC_LOGV("allocating %lu buffers of size %lu on %s port", + CODEC_LOGV("allocating %u buffers of size %u on %s port", def.nBufferCountActual, def.nBufferSize, portIndex == kPortIndexInput ? "input" : "output"); @@ -1723,7 +1723,7 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { mPortBuffers[portIndex].push(info); - CODEC_LOGV("allocated buffer %p on %s port", buffer, + CODEC_LOGV("allocated buffer %u on %s port", buffer, portIndex == kPortIndexInput ? "input" : "output"); } @@ -1745,7 +1745,7 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { if (mSkipCutBuffer != NULL) { size_t prevbuffersize = mSkipCutBuffer->size(); if (prevbuffersize != 0) { - ALOGW("Replacing SkipCutBuffer holding %d bytes", prevbuffersize); + ALOGW("Replacing SkipCutBuffer holding %zu bytes", prevbuffersize); } } mSkipCutBuffer = new SkipCutBuffer(delay * frameSize, padding * frameSize); @@ -1825,14 +1825,23 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { return err; } - err = native_window_set_buffers_geometry( + err = native_window_set_buffers_dimensions( mNativeWindow.get(), def.format.video.nFrameWidth, - def.format.video.nFrameHeight, + def.format.video.nFrameHeight); + + if (err != 0) { + ALOGE("native_window_set_buffers_dimensions failed: %s (%d)", + strerror(-err), -err); + return err; + } + + err = native_window_set_buffers_format( + mNativeWindow.get(), def.format.video.eColorFormat); if (err != 0) { - ALOGE("native_window_set_buffers_geometry failed: %s (%d)", + ALOGE("native_window_set_buffers_format failed: %s (%d)", strerror(-err), -err); return err; } @@ -1873,7 +1882,7 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { } } - ALOGV("native_window_set_usage usage=0x%lx", usage); + ALOGV("native_window_set_usage usage=0x%x", usage); err = native_window_set_usage( mNativeWindow.get(), usage | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP); if (err != 0) { @@ -2069,10 +2078,16 @@ status_t OMXCodec::pushBlankBuffersToNativeWindow() { return err; } - err = native_window_set_buffers_geometry(mNativeWindow.get(), 1, 1, - HAL_PIXEL_FORMAT_RGBX_8888); + err = native_window_set_buffers_dimensions(mNativeWindow.get(), 1, 1); + if (err != NO_ERROR) { + ALOGE("error pushing blank frames: set_buffers_dimensions failed: %s (%d)", + strerror(-err), -err); + goto error; + } + + err = native_window_set_buffers_format(mNativeWindow.get(), HAL_PIXEL_FORMAT_RGBX_8888); if (err != NO_ERROR) { - ALOGE("error pushing blank frames: set_buffers_geometry failed: %s (%d)", + ALOGE("error pushing blank frames: set_buffers_format failed: %s (%d)", strerror(-err), -err); goto error; } @@ -2708,7 +2723,7 @@ void OMXCodec::onCmdComplete(OMX_COMMANDTYPE cmd, OMX_U32 data) { default: { - CODEC_LOGV("CMD_COMPLETE(%d, %ld)", cmd, data); + CODEC_LOGV("CMD_COMPLETE(%d, %u)", cmd, data); break; } } @@ -2734,7 +2749,7 @@ void OMXCodec::onStateChange(OMX_STATETYPE newState) { if (countBuffersWeOwn(mPortBuffers[kPortIndexInput]) != mPortBuffers[kPortIndexInput].size()) { ALOGE("Codec did not return all input buffers " - "(received %d / %d)", + "(received %zu / %zu)", countBuffersWeOwn(mPortBuffers[kPortIndexInput]), mPortBuffers[kPortIndexInput].size()); TRESPASS(); @@ -2743,7 +2758,7 @@ void OMXCodec::onStateChange(OMX_STATETYPE newState) { if (countBuffersWeOwn(mPortBuffers[kPortIndexOutput]) != mPortBuffers[kPortIndexOutput].size()) { ALOGE("Codec did not return all output buffers " - "(received %d / %d)", + "(received %zu / %zu)", countBuffersWeOwn(mPortBuffers[kPortIndexOutput]), mPortBuffers[kPortIndexOutput].size()); TRESPASS(); @@ -2847,7 +2862,7 @@ status_t OMXCodec::freeBuffersOnPort( CHECK(info->mStatus == OWNED_BY_US || info->mStatus == OWNED_BY_NATIVE_WINDOW); - CODEC_LOGV("freeing buffer %p on port %ld", info->mBuffer, portIndex); + CODEC_LOGV("freeing buffer %u on port %u", info->mBuffer, portIndex); status_t err = freeBuffer(portIndex, i); @@ -2894,7 +2909,7 @@ status_t OMXCodec::freeBuffer(OMX_U32 portIndex, size_t bufIndex) { } void OMXCodec::onPortSettingsChanged(OMX_U32 portIndex) { - CODEC_LOGV("PORT_SETTINGS_CHANGED(%ld)", portIndex); + CODEC_LOGV("PORT_SETTINGS_CHANGED(%u)", portIndex); CHECK(mState == EXECUTING || mState == EXECUTING_TO_IDLE); CHECK_EQ(portIndex, (OMX_U32)kPortIndexOutput); @@ -2921,7 +2936,7 @@ bool OMXCodec::flushPortAsync(OMX_U32 portIndex) { CHECK(mState == EXECUTING || mState == RECONFIGURING || mState == EXECUTING_TO_IDLE); - CODEC_LOGV("flushPortAsync(%ld): we own %d out of %d buffers already.", + CODEC_LOGV("flushPortAsync(%u): we own %zu out of %zu buffers already.", portIndex, countBuffersWeOwn(mPortBuffers[portIndex]), mPortBuffers[portIndex].size()); @@ -2950,7 +2965,7 @@ void OMXCodec::disablePortAsync(OMX_U32 portIndex) { CHECK_EQ((int)mPortStatus[portIndex], (int)ENABLED); mPortStatus[portIndex] = DISABLING; - CODEC_LOGV("sending OMX_CommandPortDisable(%ld)", portIndex); + CODEC_LOGV("sending OMX_CommandPortDisable(%u)", portIndex); status_t err = mOMX->sendCommand(mNode, OMX_CommandPortDisable, portIndex); CHECK_EQ(err, (status_t)OK); @@ -2964,7 +2979,7 @@ status_t OMXCodec::enablePortAsync(OMX_U32 portIndex) { CHECK_EQ((int)mPortStatus[portIndex], (int)DISABLED); mPortStatus[portIndex] = ENABLING; - CODEC_LOGV("sending OMX_CommandPortEnable(%ld)", portIndex); + CODEC_LOGV("sending OMX_CommandPortEnable(%u)", portIndex); return mOMX->sendCommand(mNode, OMX_CommandPortEnable, portIndex); } @@ -3037,7 +3052,7 @@ OMXCodec::BufferInfo *OMXCodec::findInputBufferByDataPointer(void *ptr) { if (info->mData == ptr) { CODEC_LOGV( - "input buffer data ptr = %p, buffer_id = %p", + "input buffer data ptr = %p, buffer_id = %u", ptr, info->mBuffer); @@ -3147,7 +3162,7 @@ bool OMXCodec::drainInputBuffer(BufferInfo *info) { if (srcBuffer->meta_data()->findInt64( kKeyTargetTime, &targetTimeUs) && targetTimeUs >= 0) { - CODEC_LOGV("targetTimeUs = %lld us", targetTimeUs); + CODEC_LOGV("targetTimeUs = %lld us", (long long)targetTimeUs); mTargetTimeUs = targetTimeUs; } else { mTargetTimeUs = -1; @@ -3181,7 +3196,7 @@ bool OMXCodec::drainInputBuffer(BufferInfo *info) { if (offset == 0) { CODEC_LOGE( "Codec's input buffers are too small to accomodate " - "buffer read from source (info->mSize = %d, srcLength = %d)", + "buffer read from source (info->mSize = %zu, srcLength = %zu)", info->mSize, srcBuffer->range_length()); srcBuffer->release(); @@ -3287,10 +3302,10 @@ bool OMXCodec::drainInputBuffer(BufferInfo *info) { info = findEmptyInputBuffer(); } - CODEC_LOGV("Calling emptyBuffer on buffer %p (length %d), " + CODEC_LOGV("Calling emptyBuffer on buffer %u (length %zu), " "timestamp %lld us (%.2f secs)", info->mBuffer, offset, - timestampUs, timestampUs / 1E6); + (long long)timestampUs, timestampUs / 1E6); err = mOMX->emptyBuffer( mNode, info->mBuffer, 0, offset, @@ -3315,7 +3330,7 @@ void OMXCodec::fillOutputBuffer(BufferInfo *info) { return; } - CODEC_LOGV("Calling fillBuffer on buffer %p", info->mBuffer); + CODEC_LOGV("Calling fillBuffer on buffer %u", info->mBuffer); status_t err = mOMX->fillBuffer(mNode, info->mBuffer); if (err != OK) { @@ -3372,7 +3387,7 @@ status_t OMXCodec::waitForBufferFilled_l() { } status_t err = mBufferFilled.waitRelative(mLock, kBufferFilledEventTimeOutNs); if (err != OK) { - CODEC_LOGE("Timed out waiting for output buffers: %d/%d", + CODEC_LOGE("Timed out waiting for output buffers: %zu/%zu", countBuffersWeOwn(mPortBuffers[kPortIndexInput]), countBuffersWeOwn(mPortBuffers[kPortIndexOutput])); } @@ -3627,7 +3642,7 @@ void OMXCodec::setG711Format(int32_t sampleRate, int32_t numChannels) { void OMXCodec::setImageOutputFormat( OMX_COLOR_FORMATTYPE format, OMX_U32 width, OMX_U32 height) { - CODEC_LOGV("setImageOutputFormat(%ld, %ld)", width, height); + CODEC_LOGV("setImageOutputFormat(%u, %u)", width, height); #if 0 OMX_INDEXTYPE index; @@ -4281,14 +4296,14 @@ void OMXCodec::initOutputFormat(const sp<MetaData> &inputFormat) { if ((OMX_U32)numChannels != params.nChannels) { ALOGV("Codec outputs a different number of channels than " "the input stream contains (contains %d channels, " - "codec outputs %ld channels).", + "codec outputs %u channels).", numChannels, params.nChannels); } if (sampleRate != (int32_t)params.nSamplingRate) { ALOGV("Codec outputs at different sampling rate than " "what the input stream contains (contains data at " - "%d Hz, codec outputs %lu Hz)", + "%d Hz, codec outputs %u Hz)", sampleRate, params.nSamplingRate); } @@ -4390,8 +4405,7 @@ void OMXCodec::initOutputFormat(const sp<MetaData> &inputFormat) { mNode, OMX_IndexConfigCommonOutputCrop, &rect, sizeof(rect)); - CODEC_LOGI( - "video dimensions are %ld x %ld", + CODEC_LOGI("video dimensions are %u x %u", video_def->nFrameWidth, video_def->nFrameHeight); if (err == OK) { @@ -4409,8 +4423,7 @@ void OMXCodec::initOutputFormat(const sp<MetaData> &inputFormat) { rect.nLeft + rect.nWidth - 1, rect.nTop + rect.nHeight - 1); - CODEC_LOGI( - "Crop rect is %ld x %ld @ (%ld, %ld)", + CODEC_LOGI("Crop rect is %u x %u @ (%d, %d)", rect.nWidth, rect.nHeight, rect.nLeft, rect.nTop); } else { mOutputFormat->setRect( diff --git a/media/libstagefright/OggExtractor.cpp b/media/libstagefright/OggExtractor.cpp index 6e32494..d577034 100644 --- a/media/libstagefright/OggExtractor.cpp +++ b/media/libstagefright/OggExtractor.cpp @@ -250,7 +250,7 @@ status_t MyVorbisExtractor::findNextPage( if (!memcmp(signature, "OggS", 4)) { if (*pageOffset > startOffset) { ALOGV("skipped %lld bytes of junk to reach next frame", - *pageOffset - startOffset); + (long long)(*pageOffset - startOffset)); } return OK; @@ -277,7 +277,7 @@ status_t MyVorbisExtractor::findPrevGranulePosition( prevGuess = 0; } - ALOGV("backing up %lld bytes", pageOffset - prevGuess); + ALOGV("backing up %lld bytes", (long long)(pageOffset - prevGuess)); status_t err = findNextPage(prevGuess, &prevPageOffset); if (err != OK) { @@ -295,7 +295,7 @@ status_t MyVorbisExtractor::findPrevGranulePosition( } ALOGV("prevPageOffset at %lld, pageOffset at %lld", - prevPageOffset, pageOffset); + (long long)prevPageOffset, (long long)pageOffset); for (;;) { Page prevPage; @@ -320,7 +320,7 @@ status_t MyVorbisExtractor::seekToTime(int64_t timeUs) { off64_t pos = timeUs * approxBitrate() / 8000000ll; - ALOGV("seeking to offset %lld", pos); + ALOGV("seeking to offset %lld", (long long)pos); return seekToOffset(pos); } @@ -348,7 +348,7 @@ status_t MyVorbisExtractor::seekToTime(int64_t timeUs) { const TOCEntry &entry = mTableOfContents.itemAt(left); ALOGV("seeking to entry %zu / %zu at offset %lld", - left, mTableOfContents.size(), entry.mPageOffset); + left, mTableOfContents.size(), (long long)entry.mPageOffset); return seekToOffset(entry.mPageOffset); } @@ -391,8 +391,8 @@ ssize_t MyVorbisExtractor::readPage(off64_t offset, Page *page) { ssize_t n; if ((n = mSource->readAt(offset, header, sizeof(header))) < (ssize_t)sizeof(header)) { - ALOGV("failed to read %zu bytes at offset 0x%016llx, got %zd bytes", - sizeof(header), offset, n); + ALOGV("failed to read %zu bytes at offset %#016llx, got %zd bytes", + sizeof(header), (long long)offset, n); if (n < 0) { return n; @@ -505,8 +505,8 @@ status_t MyVorbisExtractor::readNextPacket(MediaBuffer **out, bool conf) { packetSize); if (n < (ssize_t)packetSize) { - ALOGV("failed to read %zu bytes at 0x%016llx, got %zd bytes", - packetSize, dataOffset, n); + ALOGV("failed to read %zu bytes at %#016llx, got %zd bytes", + packetSize, (long long)dataOffset, n); return ERROR_IO; } diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp index aba64d5..7f98485 100644 --- a/media/libstagefright/SampleTable.cpp +++ b/media/libstagefright/SampleTable.cpp @@ -230,7 +230,7 @@ status_t SampleTable::setSampleToChunkParams( return ERROR_MALFORMED; } - if (SIZE_MAX / sizeof(SampleToChunkEntry) <= mNumSampleToChunkOffsets) + if (SIZE_MAX / sizeof(SampleToChunkEntry) <= (size_t)mNumSampleToChunkOffsets) return ERROR_OUT_OF_RANGE; mSampleToChunkEntries = diff --git a/media/libstagefright/VBRISeeker.cpp b/media/libstagefright/VBRISeeker.cpp index e988f6d..8a0fcac 100644 --- a/media/libstagefright/VBRISeeker.cpp +++ b/media/libstagefright/VBRISeeker.cpp @@ -122,7 +122,7 @@ sp<VBRISeeker> VBRISeeker::CreateFromSource( seeker->mSegments.push(numBytes); - ALOGV("entry #%zu: %u offset 0x%016llx", i, numBytes, offset); + ALOGV("entry #%zu: %u offset %#016llx", i, numBytes, (long long)offset); offset += numBytes; } @@ -163,7 +163,7 @@ bool VBRISeeker::getOffsetForTime(int64_t *timeUs, off64_t *pos) { *pos += mSegments.itemAt(segmentIndex++); } - ALOGV("getOffsetForTime %" PRId64 " us => 0x%016llx", *timeUs, *pos); + ALOGV("getOffsetForTime %lld us => 0x%016llx", (long long)*timeUs, (long long)*pos); *timeUs = nowUs; diff --git a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp index 8388472..08e956a 100644 --- a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp +++ b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp @@ -191,7 +191,7 @@ status_t SoftAVC::setParams(size_t stride) { s_ctl_ip.u4_size = sizeof(ivd_ctl_set_config_ip_t); s_ctl_op.u4_size = sizeof(ivd_ctl_set_config_op_t); - ALOGV("Set the run-time (dynamic) parameters stride = %u", stride); + ALOGV("Set the run-time (dynamic) parameters stride = %zu", stride); status = ivdec_api_function(mCodecCtx, (void *)&s_ctl_ip, (void *)&s_ctl_op); if (status != IV_SUCCESS) { @@ -452,7 +452,7 @@ status_t SoftAVC::initDecoder() { uint32_t bufferSize = displaySizeY * 3 / 2; mFlushOutBuffer = (uint8_t *)ivd_aligned_malloc(128, bufferSize); if (NULL == mFlushOutBuffer) { - ALOGE("Could not allocate flushOutputBuffer of size %zu", bufferSize); + ALOGE("Could not allocate flushOutputBuffer of size %u", bufferSize); return NO_MEMORY; } diff --git a/media/libstagefright/codecs/avcenc/SoftAVCEnc.cpp b/media/libstagefright/codecs/avcenc/SoftAVCEnc.cpp index bf5e353..06b2163 100644 --- a/media/libstagefright/codecs/avcenc/SoftAVCEnc.cpp +++ b/media/libstagefright/codecs/avcenc/SoftAVCEnc.cpp @@ -681,7 +681,7 @@ OMX_ERRORTYPE SoftAVC::initEncoder() { /* Allocate array to hold memory records */ mMemRecords = (iv_mem_rec_t *)malloc(mNumMemRecords * sizeof(iv_mem_rec_t)); if (NULL == mMemRecords) { - ALOGE("Unable to allocate memory for hold memory records: Size %d", + ALOGE("Unable to allocate memory for hold memory records: Size %zu", mNumMemRecords * sizeof(iv_mem_rec_t)); mSignalledError = true; notify(OMX_EventError, OMX_ErrorUndefined, 0, 0); @@ -744,7 +744,7 @@ OMX_ERRORTYPE SoftAVC::initEncoder() { ps_mem_rec->pv_base = ive_aligned_malloc( ps_mem_rec->u4_mem_alignment, ps_mem_rec->u4_mem_size); if (ps_mem_rec->pv_base == NULL) { - ALOGE("Allocation failure for mem record id %d size %d\n", i, + ALOGE("Allocation failure for mem record id %zu size %u\n", i, ps_mem_rec->u4_mem_size); mSignalledError = true; notify(OMX_EventError, OMX_ErrorUndefined, 0, 0); diff --git a/media/libstagefright/codecs/avcenc/SoftAVCEnc.h b/media/libstagefright/codecs/avcenc/SoftAVCEnc.h index c4e26a9..2b35d45 100644 --- a/media/libstagefright/codecs/avcenc/SoftAVCEnc.h +++ b/media/libstagefright/codecs/avcenc/SoftAVCEnc.h @@ -25,7 +25,7 @@ namespace android { -struct MediaBuffer; +class MediaBuffer; #define CODEC_MAX_CORES 4 #define LEN_STATUS_BUFFER (10 * 1024) diff --git a/media/libstagefright/codecs/hevcdec/SoftHEVC.cpp b/media/libstagefright/codecs/hevcdec/SoftHEVC.cpp index cddd176..5c05a0e 100644 --- a/media/libstagefright/codecs/hevcdec/SoftHEVC.cpp +++ b/media/libstagefright/codecs/hevcdec/SoftHEVC.cpp @@ -143,7 +143,7 @@ status_t SoftHEVC::setParams(size_t stride) { s_ctl_ip.u4_size = sizeof(ivd_ctl_set_config_ip_t); s_ctl_op.u4_size = sizeof(ivd_ctl_set_config_op_t); - ALOGV("Set the run-time (dynamic) parameters stride = %u", stride); + ALOGV("Set the run-time (dynamic) parameters stride = %zu", stride); status = ivdec_api_function(mCodecCtx, (void *)&s_ctl_ip, (void *)&s_ctl_op); @@ -408,7 +408,7 @@ status_t SoftHEVC::initDecoder() { uint32_t bufferSize = displaySizeY * 3 / 2; mFlushOutBuffer = (uint8_t *)ivd_aligned_malloc(128, bufferSize); if (NULL == mFlushOutBuffer) { - ALOGE("Could not allocate flushOutputBuffer of size %zu", bufferSize); + ALOGE("Could not allocate flushOutputBuffer of size %u", bufferSize); return NO_MEMORY; } diff --git a/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp b/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp index fb7394b..e382f4c 100644 --- a/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp +++ b/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp @@ -156,7 +156,7 @@ status_t SoftMPEG2::setParams(size_t stride) { s_ctl_ip.u4_size = sizeof(ivd_ctl_set_config_ip_t); s_ctl_op.u4_size = sizeof(ivd_ctl_set_config_op_t); - ALOGV("Set the run-time (dynamic) parameters stride = %u", stride); + ALOGV("Set the run-time (dynamic) parameters stride = %zu", stride); status = ivdec_api_function(mCodecCtx, (void *)&s_ctl_ip, (void *)&s_ctl_op); if (status != IV_SUCCESS) { @@ -394,7 +394,7 @@ status_t SoftMPEG2::initDecoder() { uint32_t bufferSize = displaySizeY * 3 / 2; mFlushOutBuffer = (uint8_t *)ivd_aligned_malloc(128, bufferSize); if (NULL == mFlushOutBuffer) { - ALOGE("Could not allocate flushOutputBuffer of size %zu", bufferSize); + ALOGE("Could not allocate flushOutputBuffer of size %u", bufferSize); return NO_MEMORY; } diff --git a/media/libstagefright/colorconversion/Android.mk b/media/libstagefright/colorconversion/Android.mk index 59a64ba..4f7c48f 100644 --- a/media/libstagefright/colorconversion/Android.mk +++ b/media/libstagefright/colorconversion/Android.mk @@ -9,6 +9,9 @@ LOCAL_C_INCLUDES := \ $(TOP)/frameworks/native/include/media/openmax \ $(TOP)/hardware/msm7k +LOCAL_CFLAGS += -Werror +LOCAL_CLANG := true + LOCAL_MODULE:= libstagefright_color_conversion include $(BUILD_STATIC_LIBRARY) diff --git a/media/libstagefright/filters/Android.mk b/media/libstagefright/filters/Android.mk index 36ab444..179f054 100644 --- a/media/libstagefright/filters/Android.mk +++ b/media/libstagefright/filters/Android.mk @@ -20,7 +20,8 @@ LOCAL_C_INCLUDES := \ intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) LOCAL_C_INCLUDES += $(intermediates) -LOCAL_CFLAGS += -Wno-multichar +LOCAL_CFLAGS += -Wno-multichar -Werror -Wall +LOCAL_CLANG := true LOCAL_MODULE:= libstagefright_mediafilter diff --git a/media/libstagefright/filters/ColorConvert.cpp b/media/libstagefright/filters/ColorConvert.cpp index a5039f9..a8d5dd2 100644 --- a/media/libstagefright/filters/ColorConvert.cpp +++ b/media/libstagefright/filters/ColorConvert.cpp @@ -93,8 +93,8 @@ void convertYUV420spToRGB888( void convertRGBAToARGB( uint8_t *src, int32_t width, int32_t height, uint32_t stride, uint8_t *dest) { - for (size_t i = 0; i < height; ++i) { - for (size_t j = 0; j < width; ++j) { + for (int32_t i = 0; i < height; ++i) { + for (int32_t j = 0; j < width; ++j) { uint8_t r = *src++; uint8_t g = *src++; uint8_t b = *src++; diff --git a/media/libstagefright/filters/GraphicBufferListener.cpp b/media/libstagefright/filters/GraphicBufferListener.cpp index 66374ba..a606315 100644 --- a/media/libstagefright/filters/GraphicBufferListener.cpp +++ b/media/libstagefright/filters/GraphicBufferListener.cpp @@ -40,7 +40,7 @@ status_t GraphicBufferListener::init( status_t err = mConsumer->setMaxAcquiredBufferCount(bufferCount); if (err != NO_ERROR) { - ALOGE("Unable to set BQ max acquired buffer count to %u: %d", + ALOGE("Unable to set BQ max acquired buffer count to %zu: %d", bufferCount, err); return err; } diff --git a/media/libstagefright/filters/MediaFilter.cpp b/media/libstagefright/filters/MediaFilter.cpp index 0a09575..ecbda36 100644 --- a/media/libstagefright/filters/MediaFilter.cpp +++ b/media/libstagefright/filters/MediaFilter.cpp @@ -804,7 +804,7 @@ void MediaFilter::onSignalEndOfInputStream() { eosBuf->mGeneration = mGeneration; eosBuf->mData->setRange(0, 0); postDrainThisBuffer(eosBuf); - ALOGV("Posted EOS on output buffer %zu", eosBuf->mBufferID); + ALOGV("Posted EOS on output buffer %u", eosBuf->mBufferID); } mPortEOS[kPortIndexOutput] = true; diff --git a/media/libstagefright/foundation/Android.mk b/media/libstagefright/foundation/Android.mk index 08355c7..c68264c 100644 --- a/media/libstagefright/foundation/Android.mk +++ b/media/libstagefright/foundation/Android.mk @@ -29,7 +29,8 @@ LOCAL_SHARED_LIBRARIES := \ liblog \ libpowermanager -LOCAL_CFLAGS += -Wno-multichar -Werror +LOCAL_CFLAGS += -Wno-multichar -Werror -Wall +LOCAL_CLANG := true LOCAL_MODULE:= libstagefright_foundation diff --git a/media/libstagefright/http/Android.mk b/media/libstagefright/http/Android.mk index 7f3307d..5fb51c1 100644 --- a/media/libstagefright/http/Android.mk +++ b/media/libstagefright/http/Android.mk @@ -21,7 +21,8 @@ LOCAL_MODULE:= libstagefright_http_support LOCAL_CFLAGS += -Wno-multichar -LOCAL_CFLAGS += -Werror +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true include $(BUILD_SHARED_LIBRARY) diff --git a/media/libstagefright/httplive/Android.mk b/media/libstagefright/httplive/Android.mk index 93b7935..2639deb 100644 --- a/media/libstagefright/httplive/Android.mk +++ b/media/libstagefright/httplive/Android.mk @@ -12,7 +12,8 @@ LOCAL_C_INCLUDES:= \ $(TOP)/frameworks/av/media/libstagefright \ $(TOP)/frameworks/native/include/media/openmax -LOCAL_CFLAGS += -Werror +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true LOCAL_SHARED_LIBRARIES := \ libbinder \ diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h index 86d0498..56cd702 100644 --- a/media/libstagefright/httplive/LiveSession.h +++ b/media/libstagefright/httplive/LiveSession.h @@ -30,7 +30,7 @@ namespace android { struct ABuffer; struct AReplyToken; struct AnotherPacketSource; -struct DataSource; +class DataSource; struct HTTPBase; struct IMediaHTTPService; struct LiveDataSource; diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp index a4e523d..e44b0d9 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.cpp +++ b/media/libstagefright/httplive/PlaylistFetcher.cpp @@ -750,8 +750,6 @@ void PlaylistFetcher::queueDiscontinuity( } void PlaylistFetcher::onMonitorQueue() { - bool downloadMore = false; - // in the middle of an unfinished download, delay // playlist refresh as it'll change seq numbers if (!mDownloadState->hasSavedState()) { diff --git a/media/libstagefright/httplive/PlaylistFetcher.h b/media/libstagefright/httplive/PlaylistFetcher.h index bb14a0d..95de9c3 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.h +++ b/media/libstagefright/httplive/PlaylistFetcher.h @@ -27,7 +27,7 @@ namespace android { struct ABuffer; struct AnotherPacketSource; -struct DataSource; +class DataSource; struct HTTPBase; struct LiveDataSource; struct M3UParser; diff --git a/media/libstagefright/id3/Android.mk b/media/libstagefright/id3/Android.mk index 2194c38..68bd017 100644 --- a/media/libstagefright/id3/Android.mk +++ b/media/libstagefright/id3/Android.mk @@ -4,7 +4,8 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ ID3.cpp -LOCAL_CFLAGS += -Werror +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true LOCAL_MODULE := libstagefright_id3 @@ -17,7 +18,8 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ testid3.cpp -LOCAL_CFLAGS += -Werror +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true LOCAL_SHARED_LIBRARIES := \ libstagefright libutils liblog libbinder libstagefright_foundation diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h index 4704ad3..8bba804 100644 --- a/media/libstagefright/include/AwesomePlayer.h +++ b/media/libstagefright/include/AwesomePlayer.h @@ -31,20 +31,20 @@ namespace android { -struct AudioPlayer; +class AudioPlayer; struct ClockEstimator; -struct IDataSource; -struct MediaBuffer; +class IDataSource; +class MediaBuffer; struct MediaExtractor; struct MediaSource; struct NuCachedSource2; -struct IGraphicBufferProducer; +class IGraphicBufferProducer; class DrmManagerClinet; class DecryptHandle; class TimedTextDriver; -struct WVMExtractor; +class WVMExtractor; struct AwesomeRenderer : public RefBase { AwesomeRenderer() {} diff --git a/media/libstagefright/include/MPEG2PSExtractor.h b/media/libstagefright/include/MPEG2PSExtractor.h index fb76564..22cb02d 100644 --- a/media/libstagefright/include/MPEG2PSExtractor.h +++ b/media/libstagefright/include/MPEG2PSExtractor.h @@ -28,7 +28,7 @@ namespace android { struct ABuffer; struct AMessage; struct Track; -struct String8; +class String8; struct MPEG2PSExtractor : public MediaExtractor { MPEG2PSExtractor(const sp<DataSource> &source); diff --git a/media/libstagefright/include/MPEG2TSExtractor.h b/media/libstagefright/include/MPEG2TSExtractor.h index db1187d..4dd340c 100644 --- a/media/libstagefright/include/MPEG2TSExtractor.h +++ b/media/libstagefright/include/MPEG2TSExtractor.h @@ -30,7 +30,7 @@ struct AnotherPacketSource; struct ATSParser; class DataSource; struct MPEG2TSSource; -struct String8; +class String8; struct MPEG2TSExtractor : public MediaExtractor { MPEG2TSExtractor(const sp<DataSource> &source); diff --git a/media/libstagefright/include/OMX.h b/media/libstagefright/include/OMX.h index e8c4970..b5487fa 100644 --- a/media/libstagefright/include/OMX.h +++ b/media/libstagefright/include/OMX.h @@ -24,7 +24,7 @@ namespace android { struct OMXMaster; -class OMXNodeInstance; +struct OMXNodeInstance; class OMX : public BnOMX, public IBinder::DeathRecipient { diff --git a/media/libstagefright/include/OMXNodeInstance.h b/media/libstagefright/include/OMXNodeInstance.h index 104dcfc..d87b408 100644 --- a/media/libstagefright/include/OMXNodeInstance.h +++ b/media/libstagefright/include/OMXNodeInstance.h @@ -27,7 +27,7 @@ namespace android { class IOMXObserver; struct OMXMaster; -struct GraphicBufferSource; +class GraphicBufferSource; struct OMXNodeInstance { OMXNodeInstance( diff --git a/media/libstagefright/include/SampleIterator.h b/media/libstagefright/include/SampleIterator.h index 60c9e7e..7053247 100644 --- a/media/libstagefright/include/SampleIterator.h +++ b/media/libstagefright/include/SampleIterator.h @@ -18,7 +18,7 @@ namespace android { -struct SampleTable; +class SampleTable; struct SampleIterator { SampleIterator(SampleTable *table); diff --git a/media/libstagefright/include/StagefrightMetadataRetriever.h b/media/libstagefright/include/StagefrightMetadataRetriever.h index 96a35f3..fd739d0 100644 --- a/media/libstagefright/include/StagefrightMetadataRetriever.h +++ b/media/libstagefright/include/StagefrightMetadataRetriever.h @@ -25,7 +25,7 @@ namespace android { -struct DataSource; +class DataSource; class MediaExtractor; struct StagefrightMetadataRetriever : public MediaMetadataRetrieverInterface { diff --git a/media/libstagefright/include/TimedEventQueue.h b/media/libstagefright/include/TimedEventQueue.h index 2963150..890f7e8 100644 --- a/media/libstagefright/include/TimedEventQueue.h +++ b/media/libstagefright/include/TimedEventQueue.h @@ -46,7 +46,7 @@ struct TimedEventQueue { virtual void fire(TimedEventQueue *queue, int64_t now_us) = 0; private: - friend class TimedEventQueue; + friend struct TimedEventQueue; event_id mEventID; diff --git a/media/libstagefright/include/VBRISeeker.h b/media/libstagefright/include/VBRISeeker.h index 1a2bf9f..c57d571 100644 --- a/media/libstagefright/include/VBRISeeker.h +++ b/media/libstagefright/include/VBRISeeker.h @@ -24,7 +24,7 @@ namespace android { -struct DataSource; +class DataSource; struct VBRISeeker : public MP3Seeker { static sp<VBRISeeker> CreateFromSource( diff --git a/media/libstagefright/include/XINGSeeker.h b/media/libstagefright/include/XINGSeeker.h index c408576..cce04f0 100644 --- a/media/libstagefright/include/XINGSeeker.h +++ b/media/libstagefright/include/XINGSeeker.h @@ -22,7 +22,7 @@ namespace android { -struct DataSource; +class DataSource; struct XINGSeeker : public MP3Seeker { static sp<XINGSeeker> CreateFromSource( diff --git a/media/libstagefright/matroska/Android.mk b/media/libstagefright/matroska/Android.mk index 446ff8c..1e8c2b2 100644 --- a/media/libstagefright/matroska/Android.mk +++ b/media/libstagefright/matroska/Android.mk @@ -8,7 +8,8 @@ LOCAL_C_INCLUDES:= \ $(TOP)/external/libvpx/libwebm \ $(TOP)/frameworks/native/include/media/openmax \ -LOCAL_CFLAGS += -Wno-multichar -Werror +LOCAL_CFLAGS += -Wno-multichar -Werror -Wall +LOCAL_CLANG := true LOCAL_MODULE:= libstagefright_matroska diff --git a/media/libstagefright/mpeg2ts/Android.mk b/media/libstagefright/mpeg2ts/Android.mk index c17a0b7..16b0160 100644 --- a/media/libstagefright/mpeg2ts/Android.mk +++ b/media/libstagefright/mpeg2ts/Android.mk @@ -13,7 +13,8 @@ LOCAL_C_INCLUDES:= \ $(TOP)/frameworks/av/media/libstagefright \ $(TOP)/frameworks/native/include/media/openmax -LOCAL_CFLAGS += -Werror +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true LOCAL_MODULE:= libstagefright_mpeg2ts diff --git a/media/libstagefright/omx/Android.mk b/media/libstagefright/omx/Android.mk index 07ea605..5f0f567 100644 --- a/media/libstagefright/omx/Android.mk +++ b/media/libstagefright/omx/Android.mk @@ -31,6 +31,8 @@ LOCAL_SHARED_LIBRARIES := \ libdl LOCAL_MODULE:= libstagefright_omx +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true include $(BUILD_SHARED_LIBRARY) diff --git a/media/libstagefright/omx/FrameDropper.cpp b/media/libstagefright/omx/FrameDropper.cpp index 9fba0b7..9a4952e 100644 --- a/media/libstagefright/omx/FrameDropper.cpp +++ b/media/libstagefright/omx/FrameDropper.cpp @@ -50,20 +50,23 @@ bool FrameDropper::shouldDrop(int64_t timeUs) { if (mDesiredMinTimeUs < 0) { mDesiredMinTimeUs = timeUs + mMinIntervalUs; - ALOGV("first frame %lld, next desired frame %lld", timeUs, mDesiredMinTimeUs); + ALOGV("first frame %lld, next desired frame %lld", + (long long)timeUs, (long long)mDesiredMinTimeUs); return false; } if (timeUs < (mDesiredMinTimeUs - kMaxJitterUs)) { ALOGV("drop frame %lld, desired frame %lld, diff %lld", - timeUs, mDesiredMinTimeUs, mDesiredMinTimeUs - timeUs); + (long long)timeUs, (long long)mDesiredMinTimeUs, + (long long)(mDesiredMinTimeUs - timeUs)); return true; } int64_t n = (timeUs - mDesiredMinTimeUs + kMaxJitterUs) / mMinIntervalUs; mDesiredMinTimeUs += (n + 1) * mMinIntervalUs; ALOGV("keep frame %lld, next desired frame %lld, diff %lld", - timeUs, mDesiredMinTimeUs, mDesiredMinTimeUs - timeUs); + (long long)timeUs, (long long)mDesiredMinTimeUs, + (long long)(mDesiredMinTimeUs - timeUs)); return false; } diff --git a/media/libstagefright/omx/GraphicBufferSource.h b/media/libstagefright/omx/GraphicBufferSource.h index 1067472..718d2ee 100644 --- a/media/libstagefright/omx/GraphicBufferSource.h +++ b/media/libstagefright/omx/GraphicBufferSource.h @@ -30,7 +30,7 @@ namespace android { -class FrameDropper; +struct FrameDropper; /* * This class is used to feed OMX codecs from a Surface via BufferQueue. @@ -240,7 +240,7 @@ private: Vector<CodecBuffer> mCodecBuffers; //// - friend class AHandlerReflector<GraphicBufferSource>; + friend struct AHandlerReflector<GraphicBufferSource>; enum { kWhatRepeatLastFrame, diff --git a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp index 801a1bd..04303c4 100644 --- a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp +++ b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp @@ -598,7 +598,7 @@ void SimpleSoftOMXComponent::checkTransitions() { if (port->mTransition == PortInfo::DISABLING) { if (port->mBuffers.empty()) { - ALOGV("Port %d now disabled.", i); + ALOGV("Port %zu now disabled.", i); port->mTransition = PortInfo::NONE; notify(OMX_EventCmdComplete, OMX_CommandPortDisable, i, NULL); @@ -607,7 +607,7 @@ void SimpleSoftOMXComponent::checkTransitions() { } } else if (port->mTransition == PortInfo::ENABLING) { if (port->mDef.bPopulated == OMX_TRUE) { - ALOGV("Port %d now enabled.", i); + ALOGV("Port %zu now enabled.", i); port->mTransition = PortInfo::NONE; port->mDef.bEnabled = OMX_TRUE; @@ -628,14 +628,14 @@ void SimpleSoftOMXComponent::addPort(const OMX_PARAM_PORTDEFINITIONTYPE &def) { info->mTransition = PortInfo::NONE; } -void SimpleSoftOMXComponent::onQueueFilled(OMX_U32 portIndex) { +void SimpleSoftOMXComponent::onQueueFilled(OMX_U32 portIndex __unused) { } -void SimpleSoftOMXComponent::onPortFlushCompleted(OMX_U32 portIndex) { +void SimpleSoftOMXComponent::onPortFlushCompleted(OMX_U32 portIndex __unused) { } void SimpleSoftOMXComponent::onPortEnableCompleted( - OMX_U32 portIndex, bool enabled) { + OMX_U32 portIndex __unused, bool enabled __unused) { } List<SimpleSoftOMXComponent::BufferInfo *> & diff --git a/media/libstagefright/omx/tests/Android.mk b/media/libstagefright/omx/tests/Android.mk index 9be637a..02e97f1 100644 --- a/media/libstagefright/omx/tests/Android.mk +++ b/media/libstagefright/omx/tests/Android.mk @@ -11,7 +11,8 @@ LOCAL_C_INCLUDES := \ $(TOP)/frameworks/av/media/libstagefright \ $(TOP)/frameworks/native/include/media/openmax -LOCAL_CFLAGS += -Werror +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true LOCAL_MODULE := omx_tests @@ -37,4 +38,7 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_C_INCLUDES := \ frameworks/av/media/libstagefright/omx \ +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true + include $(BUILD_NATIVE_TEST) diff --git a/media/libstagefright/omx/tests/FrameDropper_test.cpp b/media/libstagefright/omx/tests/FrameDropper_test.cpp index 4ac72c4..f966b5e 100644 --- a/media/libstagefright/omx/tests/FrameDropper_test.cpp +++ b/media/libstagefright/omx/tests/FrameDropper_test.cpp @@ -100,7 +100,8 @@ protected: for (size_t i = 0; i < size; ++i) { int jitter = GetJitter(i); int64_t testTimeUs = frames[i].timeUs + jitter; - printf("time %lld, testTime %lld, jitter %d\n", frames[i].timeUs, testTimeUs, jitter); + printf("time %lld, testTime %lld, jitter %d\n", + (long long)frames[i].timeUs, (long long)testTimeUs, jitter); EXPECT_EQ(frames[i].shouldDrop, mFrameDropper->shouldDrop(testTimeUs)); } } diff --git a/media/libstagefright/rtsp/ARTPWriter.h b/media/libstagefright/rtsp/ARTPWriter.h index fdc8d23..be8bc13 100644 --- a/media/libstagefright/rtsp/ARTPWriter.h +++ b/media/libstagefright/rtsp/ARTPWriter.h @@ -32,7 +32,7 @@ namespace android { struct ABuffer; -struct MediaBuffer; +class MediaBuffer; struct ARTPWriter : public MediaWriter { ARTPWriter(int fd); diff --git a/media/libstagefright/rtsp/Android.mk b/media/libstagefright/rtsp/Android.mk index 9fedb71..c5e8c35 100644 --- a/media/libstagefright/rtsp/Android.mk +++ b/media/libstagefright/rtsp/Android.mk @@ -31,7 +31,8 @@ ifeq ($(TARGET_ARCH),arm) LOCAL_CFLAGS += -Wno-psabi endif -LOCAL_CFLAGS += -Werror +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -54,7 +55,8 @@ LOCAL_C_INCLUDES:= \ frameworks/av/media/libstagefright \ $(TOP)/frameworks/native/include/media/openmax -LOCAL_CFLAGS += -Wno-multichar +LOCAL_CFLAGS += -Wno-multichar -Werror -Wall +LOCAL_CLANG := true LOCAL_MODULE_TAGS := optional diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h index 0642343..00f071b 100644 --- a/media/libstagefright/rtsp/MyHandler.h +++ b/media/libstagefright/rtsp/MyHandler.h @@ -651,7 +651,7 @@ struct MyHandler : public AHandler { int32_t result; CHECK(msg->findInt32("result", &result)); - ALOGI("SETUP(%d) completed with result %d (%s)", + ALOGI("SETUP(%zu) completed with result %d (%s)", index, result, strerror(-result)); if (result == OK) { @@ -1012,7 +1012,7 @@ struct MyHandler : public AHandler { int32_t eos; if (msg->findInt32("eos", &eos)) { - ALOGI("received BYE on track index %d", trackIndex); + ALOGI("received BYE on track index %zu", trackIndex); if (!mAllTracksHaveTime && dataReceivedOnAllChannels()) { ALOGI("No time established => fake existing data"); @@ -1564,7 +1564,7 @@ private: new APacketSource(mSessionDesc, index); if (source->initCheck() != OK) { - ALOGW("Unsupported format. Ignoring track #%d.", index); + ALOGW("Unsupported format. Ignoring track #%zu.", index); sp<AMessage> reply = new AMessage('setu', this); reply->setSize("index", index); @@ -1606,7 +1606,7 @@ private: info->mTimeScale = timescale; info->mEOSReceived = false; - ALOGV("track #%d URL=%s", mTracks.size(), trackURL.c_str()); + ALOGV("track #%zu URL=%s", mTracks.size(), trackURL.c_str()); AString request = "SETUP "; request.append(trackURL); @@ -1731,8 +1731,8 @@ private: } void onTimeUpdate(int32_t trackIndex, uint32_t rtpTime, uint64_t ntpTime) { - ALOGV("onTimeUpdate track %d, rtpTime = 0x%08x, ntpTime = 0x%016llx", - trackIndex, rtpTime, ntpTime); + ALOGV("onTimeUpdate track %d, rtpTime = 0x%08x, ntpTime = %#016llx", + trackIndex, rtpTime, (long long)ntpTime); int64_t ntpTimeUs = (int64_t)(ntpTime * 1E6 / (1ll << 32)); @@ -1851,8 +1851,8 @@ private: return false; } - ALOGV("track %d rtpTime=%d mediaTimeUs = %lld us (%.2f secs)", - trackIndex, rtpTime, mediaTimeUs, mediaTimeUs / 1E6); + ALOGV("track %d rtpTime=%u mediaTimeUs = %lld us (%.2f secs)", + trackIndex, rtpTime, (long long)mediaTimeUs, mediaTimeUs / 1E6); accessUnit->meta()->setInt64("timeUs", mediaTimeUs); diff --git a/media/libstagefright/tests/Android.mk b/media/libstagefright/tests/Android.mk index 51e1c78..111e6c5 100644 --- a/media/libstagefright/tests/Android.mk +++ b/media/libstagefright/tests/Android.mk @@ -31,6 +31,9 @@ LOCAL_C_INCLUDES := \ frameworks/av/media/libstagefright/include \ $(TOP)/frameworks/native/include/media/openmax \ +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true + LOCAL_32_BIT_ONLY := true include $(BUILD_NATIVE_TEST) @@ -60,6 +63,9 @@ LOCAL_C_INCLUDES := \ frameworks/av/media/libstagefright/include \ $(TOP)/frameworks/native/include/media/openmax \ +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true + include $(BUILD_NATIVE_TEST) include $(CLEAR_VARS) @@ -87,6 +93,9 @@ LOCAL_C_INCLUDES := \ LOCAL_32_BIT_ONLY := true +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true + include $(BUILD_NATIVE_TEST) # Include subdirectory makefiles diff --git a/media/libstagefright/tests/DummyRecorder.h b/media/libstagefright/tests/DummyRecorder.h index 1cbea1b..cd4d0ee 100644 --- a/media/libstagefright/tests/DummyRecorder.h +++ b/media/libstagefright/tests/DummyRecorder.h @@ -24,7 +24,7 @@ namespace android { -class MediaSource; +struct MediaSource; class MediaBuffer; class DummyRecorder { diff --git a/media/libstagefright/tests/MediaCodecListOverrides_test.cpp b/media/libstagefright/tests/MediaCodecListOverrides_test.cpp index cacaa84..170cde3 100644 --- a/media/libstagefright/tests/MediaCodecListOverrides_test.cpp +++ b/media/libstagefright/tests/MediaCodecListOverrides_test.cpp @@ -278,7 +278,7 @@ TEST_F(MediaCodecListOverridesTest, exportResultsToExistingFile) { rewind(f); char *buf = (char *)malloc(size); - EXPECT_EQ(1, fread(buf, size, 1, f)); + EXPECT_EQ((size_t)1, fread(buf, size, 1, f)); overrides.setTo(buf, size); fclose(f); free(buf); @@ -303,7 +303,7 @@ TEST_F(MediaCodecListOverridesTest, exportResultsToEmptyFile) { rewind(f); char *buf = (char *)malloc(size); - EXPECT_EQ(1, fread(buf, size, 1, f)); + EXPECT_EQ((size_t)1, fread(buf, size, 1, f)); overrides.setTo(buf, size); fclose(f); free(buf); diff --git a/media/libstagefright/timedtext/Android.mk b/media/libstagefright/timedtext/Android.mk index 6a8b9fc..58fb12f 100644 --- a/media/libstagefright/timedtext/Android.mk +++ b/media/libstagefright/timedtext/Android.mk @@ -9,7 +9,8 @@ LOCAL_SRC_FILES:= \ TimedTextSRTSource.cpp \ TimedTextPlayer.cpp -LOCAL_CFLAGS += -Wno-multichar -Werror +LOCAL_CFLAGS += -Wno-multichar -Werror -Wall +LOCAL_CLANG := true LOCAL_C_INCLUDES:= \ $(TOP)/frameworks/av/include/media/stagefright/timedtext \ diff --git a/media/libstagefright/timedtext/test/Android.mk b/media/libstagefright/timedtext/test/Android.mk index 9a9fde2..e0e0e0d 100644 --- a/media/libstagefright/timedtext/test/Android.mk +++ b/media/libstagefright/timedtext/test/Android.mk @@ -26,4 +26,7 @@ LOCAL_SHARED_LIBRARIES := \ libstagefright_foundation \ libutils +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true + include $(BUILD_NATIVE_TEST) diff --git a/media/libstagefright/timedtext/test/TimedTextSRTSource_test.cpp b/media/libstagefright/timedtext/test/TimedTextSRTSource_test.cpp index 3a06d61..211e732 100644 --- a/media/libstagefright/timedtext/test/TimedTextSRTSource_test.cpp +++ b/media/libstagefright/timedtext/test/TimedTextSRTSource_test.cpp @@ -63,10 +63,10 @@ public: } virtual ssize_t readAt(off64_t offset, void *data, size_t size) { - if (offset >= mSize) return 0; + if ((size_t)offset >= mSize) return 0; ssize_t avail = mSize - offset; - if (avail > size) { + if ((size_t)avail > size) { avail = size; } memcpy(data, mData + offset, avail); diff --git a/media/libstagefright/webm/Android.mk b/media/libstagefright/webm/Android.mk index 7081463..bc53c56 100644 --- a/media/libstagefright/webm/Android.mk +++ b/media/libstagefright/webm/Android.mk @@ -1,8 +1,10 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_CPPFLAGS += -D__STDINT_LIMITS \ - -Werror +LOCAL_CPPFLAGS += -D__STDINT_LIMITS + +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true LOCAL_SRC_FILES:= EbmlUtil.cpp \ WebmElement.cpp \ diff --git a/media/libstagefright/wifi-display/Android.mk b/media/libstagefright/wifi-display/Android.mk index f70454a..fb28624 100644 --- a/media/libstagefright/wifi-display/Android.mk +++ b/media/libstagefright/wifi-display/Android.mk @@ -30,6 +30,9 @@ LOCAL_SHARED_LIBRARIES:= \ libui \ libutils \ +LOCAL_CFLAGS += -Wno-multichar -Werror -Wall +LOCAL_CLANG := true + LOCAL_MODULE:= libstagefright_wfd LOCAL_MODULE_TAGS:= optional diff --git a/media/libstagefright/wifi-display/VideoFormats.cpp b/media/libstagefright/wifi-display/VideoFormats.cpp index 2f4af5b..dbc511c 100644 --- a/media/libstagefright/wifi-display/VideoFormats.cpp +++ b/media/libstagefright/wifi-display/VideoFormats.cpp @@ -248,8 +248,8 @@ void VideoFormats::getProfileLevel( } if (bestProfile == -1 || bestLevel == -1) { - ALOGE("Profile or level not set for resolution type %d, index %d", - type, index); + ALOGE("Profile or level not set for resolution type %d, index %zu", + type, index); bestProfile = PROFILE_CBP; bestLevel = LEVEL_31; } @@ -382,7 +382,6 @@ bool VideoFormats::parseFormatSpec(const char *spec) { disableAll(); unsigned native, dummy; - unsigned res[3]; size_t size = strlen(spec); size_t offset = 0; @@ -507,7 +506,7 @@ bool VideoFormats::PickBestFormat( continue; } - ALOGV("type %u, index %u, %u x %u %c%u supported", + ALOGV("type %zu, index %zu, %zu x %zu %c%zu supported", i, j, width, height, interlaced ? 'i' : 'p', framesPerSecond); uint32_t score = width * height * framesPerSecond; diff --git a/media/libstagefright/wifi-display/rtp/RTPSender.cpp b/media/libstagefright/wifi-display/rtp/RTPSender.cpp index 4e72533..c66a898 100644 --- a/media/libstagefright/wifi-display/rtp/RTPSender.cpp +++ b/media/libstagefright/wifi-display/rtp/RTPSender.cpp @@ -252,8 +252,6 @@ status_t RTPSender::queueTSPackets( int64_t timeUs; CHECK(tsPackets->meta()->findInt64("timeUs", &timeUs)); - const size_t numTSPackets = tsPackets->size() / 188; - size_t srcOffset = 0; while (srcOffset < tsPackets->size()) { sp<ABuffer> udpPacket = @@ -672,8 +670,8 @@ status_t RTPSender::onRTCPData(const sp<ABuffer> &buffer) { default: { - ALOGW("Unknown RTCP packet type %u of size %d", - (unsigned)data[1], headerLength); + ALOGW("Unknown RTCP packet type %u of size %zu", + (unsigned)data[1], headerLength); break; } } @@ -764,7 +762,7 @@ status_t RTPSender::parseTSFB(const uint8_t *data, size_t size) { return OK; } -status_t RTPSender::parseAPP(const uint8_t *data, size_t size) { +status_t RTPSender::parseAPP(const uint8_t *data, size_t size __unused) { if (!memcmp("late", &data[8], 4)) { int64_t avgLatencyUs = (int64_t)U64_AT(&data[12]); int64_t maxLatencyUs = (int64_t)U64_AT(&data[20]); diff --git a/media/libstagefright/wifi-display/source/Converter.cpp b/media/libstagefright/wifi-display/source/Converter.cpp index 8368945..471152e 100644 --- a/media/libstagefright/wifi-display/source/Converter.cpp +++ b/media/libstagefright/wifi-display/source/Converter.cpp @@ -747,7 +747,7 @@ status_t Converter::doMoreWork() { buffer->meta()->setInt64("timeUs", timeUs); ALOGV("[%s] time %lld us (%.2f secs)", - mIsVideo ? "video" : "audio", timeUs, timeUs / 1E6); + mIsVideo ? "video" : "audio", (long long)timeUs, timeUs / 1E6); memcpy(buffer->data(), outbuf->base() + offset, size); diff --git a/media/libstagefright/wifi-display/source/Converter.h b/media/libstagefright/wifi-display/source/Converter.h index 5876e07..b182990 100644 --- a/media/libstagefright/wifi-display/source/Converter.h +++ b/media/libstagefright/wifi-display/source/Converter.h @@ -23,7 +23,7 @@ namespace android { struct ABuffer; -struct IGraphicBufferProducer; +class IGraphicBufferProducer; struct MediaCodec; #define ENABLE_SILENCE_DETECTION 0 diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.cpp b/media/libstagefright/wifi-display/source/PlaybackSession.cpp index 6080943..5e2f0bf 100644 --- a/media/libstagefright/wifi-display/source/PlaybackSession.cpp +++ b/media/libstagefright/wifi-display/source/PlaybackSession.cpp @@ -508,7 +508,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( } else if (what == Converter::kWhatEOS) { CHECK_EQ(what, Converter::kWhatEOS); - ALOGI("output EOS on track %d", trackIndex); + ALOGI("output EOS on track %zu", trackIndex); ssize_t index = mTracks.indexOfKey(trackIndex); CHECK_GE(index, 0); @@ -581,7 +581,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( CHECK(msg->findSize("trackIndex", &trackIndex)); if (what == Track::kWhatStopped) { - ALOGI("Track %d stopped", trackIndex); + ALOGI("Track %zu stopped", trackIndex); sp<Track> track = mTracks.valueFor(trackIndex); looper()->unregisterHandler(track->id()); @@ -821,21 +821,27 @@ void WifiDisplaySource::PlaybackSession::schedulePullExtractor() { return; } + int64_t delayUs = 1000000; // default delay is 1 sec int64_t sampleTimeUs; status_t err = mExtractor->getSampleTime(&sampleTimeUs); - int64_t nowUs = ALooper::GetNowUs(); + if (err == OK) { + int64_t nowUs = ALooper::GetNowUs(); - if (mFirstSampleTimeRealUs < 0ll) { - mFirstSampleTimeRealUs = nowUs; - mFirstSampleTimeUs = sampleTimeUs; - } + if (mFirstSampleTimeRealUs < 0ll) { + mFirstSampleTimeRealUs = nowUs; + mFirstSampleTimeUs = sampleTimeUs; + } - int64_t whenUs = sampleTimeUs - mFirstSampleTimeUs + mFirstSampleTimeRealUs; + int64_t whenUs = sampleTimeUs - mFirstSampleTimeUs + mFirstSampleTimeRealUs; + delayUs = whenUs - nowUs; + } else { + ALOGW("could not get sample time (%d)", err); + } sp<AMessage> msg = new AMessage(kWhatPullExtractorSample, this); msg->setInt32("generation", mPullExtractorGeneration); - msg->post(whenUs - nowUs); + msg->post(delayUs); mPullExtractorPending = true; } diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.h b/media/libstagefright/wifi-display/source/PlaybackSession.h index 2824143..4cd1a75 100644 --- a/media/libstagefright/wifi-display/source/PlaybackSession.h +++ b/media/libstagefright/wifi-display/source/PlaybackSession.h @@ -26,7 +26,7 @@ namespace android { struct ABuffer; struct IHDCP; -struct IGraphicBufferProducer; +class IGraphicBufferProducer; struct MediaPuller; struct MediaSource; struct MediaSender; diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp index 14d0951..332fe16 100644 --- a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp +++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp @@ -881,7 +881,7 @@ status_t WifiDisplaySource::onReceiveM3Response( &framesPerSecond, &interlaced)); - ALOGI("Picked video resolution %u x %u %c%u", + ALOGI("Picked video resolution %zu x %zu %c%zu", width, height, interlaced ? 'i' : 'p', framesPerSecond); ALOGI("Picked AVC profile %d, level %d", diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.h b/media/libstagefright/wifi-display/source/WifiDisplaySource.h index 0f779e4..c417cf5 100644 --- a/media/libstagefright/wifi-display/source/WifiDisplaySource.h +++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.h @@ -29,7 +29,7 @@ namespace android { struct AReplyToken; struct IHDCP; -struct IRemoteDisplayClient; +class IRemoteDisplayClient; struct ParsedMessage; // Represents the RTSP server acting as a wifi display source. diff --git a/media/libstagefright/yuv/Android.mk b/media/libstagefright/yuv/Android.mk index bb86dfc..dc67288 100644 --- a/media/libstagefright/yuv/Android.mk +++ b/media/libstagefright/yuv/Android.mk @@ -12,7 +12,7 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE:= libstagefright_yuv -LOCAL_CFLAGS += -Werror - +LOCAL_CFLAGS += -Werror -Wall +LOCAL_CLANG := true include $(BUILD_SHARED_LIBRARY) |