summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-04-30 18:25:13 -0700
committerLajos Molnar <lajos@google.com>2015-04-30 18:53:52 -0700
commit31de88566257d5546cf4eee9064d96926a4b0c24 (patch)
treee9c0052eec98f1a68a8beb94c00ddefbec8aa6b6 /cmds
parent850206ed9ebc6c663a957a656966bce2604dc170 (diff)
downloadframeworks_av-31de88566257d5546cf4eee9064d96926a4b0c24.zip
frameworks_av-31de88566257d5546cf4eee9064d96926a4b0c24.tar.gz
frameworks_av-31de88566257d5546cf4eee9064d96926a4b0c24.tar.bz2
stagefright: cmds: resolve compiler warnings
Change-Id: I21af2b463231e864781a70ae7667afe37eba9df8
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/Android.mk27
-rw-r--r--cmds/stagefright/SimplePlayer.cpp23
-rw-r--r--cmds/stagefright/codec.cpp26
-rw-r--r--cmds/stagefright/mediafilter.cpp8
-rw-r--r--cmds/stagefright/muxer.cpp5
-rw-r--r--cmds/stagefright/record.cpp4
-rw-r--r--cmds/stagefright/sf2.cpp8
-rw-r--r--cmds/stagefright/stagefright.cpp2
-rw-r--r--cmds/stagefright/stream.cpp4
9 files changed, 58 insertions, 49 deletions
diff --git a/cmds/stagefright/Android.mk b/cmds/stagefright/Android.mk
index 0e3bc68..20c0094 100644
--- a/cmds/stagefright/Android.mk
+++ b/cmds/stagefright/Android.mk
@@ -17,7 +17,8 @@ LOCAL_C_INCLUDES:= \
$(TOP)/frameworks/native/include/media/openmax \
external/jpeg \
-LOCAL_CFLAGS += -Wno-multichar
+LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
+LOCAL_CLANG := true
LOCAL_MODULE_TAGS := optional
@@ -40,7 +41,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
@@ -63,7 +65,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
@@ -87,7 +90,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
@@ -110,7 +114,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
@@ -133,7 +138,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
@@ -157,7 +163,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
@@ -199,7 +206,8 @@ LOCAL_C_INCLUDES += $(intermediates)
LOCAL_STATIC_LIBRARIES:= \
libstagefright_mediafilter
-LOCAL_CFLAGS += -Wno-multichar
+LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
+LOCAL_CLANG := true
LOCAL_MODULE_TAGS := optional
@@ -222,7 +230,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/cmds/stagefright/SimplePlayer.cpp b/cmds/stagefright/SimplePlayer.cpp
index ac1a547..bd33d86 100644
--- a/cmds/stagefright/SimplePlayer.cpp
+++ b/cmds/stagefright/SimplePlayer.cpp
@@ -21,6 +21,7 @@
#include "SimplePlayer.h"
#include <gui/Surface.h>
+
#include <media/AudioTrack.h>
#include <media/ICrypto.h>
#include <media/IMediaHTTPService.h>
@@ -428,12 +429,12 @@ status_t SimplePlayer::onDoMoreStuff() {
err = state->mCodec->dequeueInputBuffer(&index);
if (err == OK) {
- ALOGV("dequeued input buffer on track %d",
+ ALOGV("dequeued input buffer on track %zu",
mStateByTrackIndex.keyAt(i));
state->mAvailInputBufferIndices.push_back(index);
} else {
- ALOGV("dequeueInputBuffer on track %d returned %d",
+ ALOGV("dequeueInputBuffer on track %zu returned %d",
mStateByTrackIndex.keyAt(i), err);
}
} while (err == OK);
@@ -448,7 +449,7 @@ status_t SimplePlayer::onDoMoreStuff() {
&info.mFlags);
if (err == OK) {
- ALOGV("dequeued output buffer on track %d",
+ ALOGV("dequeued output buffer on track %zu",
mStateByTrackIndex.keyAt(i));
state->mAvailOutputBufferInfos.push_back(info);
@@ -459,7 +460,7 @@ status_t SimplePlayer::onDoMoreStuff() {
err = state->mCodec->getOutputBuffers(&state->mBuffers[1]);
CHECK_EQ(err, (status_t)OK);
} else {
- ALOGV("dequeueOutputBuffer on track %d returned %d",
+ ALOGV("dequeueOutputBuffer on track %zu returned %d",
mStateByTrackIndex.keyAt(i), err);
}
} while (err == OK
@@ -502,7 +503,7 @@ status_t SimplePlayer::onDoMoreStuff() {
0);
CHECK_EQ(err, (status_t)OK);
- ALOGV("enqueued input data on track %d", trackIndex);
+ ALOGV("enqueued input data on track %zu", trackIndex);
err = mExtractor->advance();
CHECK_EQ(err, (status_t)OK);
@@ -528,8 +529,8 @@ status_t SimplePlayer::onDoMoreStuff() {
bool release = true;
if (lateByUs > 30000ll) {
- ALOGI("track %d buffer late by %lld us, dropping.",
- mStateByTrackIndex.keyAt(i), lateByUs);
+ ALOGI("track %zu buffer late by %lld us, dropping.",
+ mStateByTrackIndex.keyAt(i), (long long)lateByUs);
state->mCodec->releaseOutputBuffer(info->mIndex);
} else {
if (state->mAudioTrack != NULL) {
@@ -558,8 +559,8 @@ status_t SimplePlayer::onDoMoreStuff() {
break;
}
} else {
- ALOGV("track %d buffer early by %lld us.",
- mStateByTrackIndex.keyAt(i), -lateByUs);
+ ALOGV("track %zu buffer early by %lld us.",
+ mStateByTrackIndex.keyAt(i), (long long)-lateByUs);
break;
}
}
@@ -569,7 +570,7 @@ status_t SimplePlayer::onDoMoreStuff() {
}
status_t SimplePlayer::onOutputFormatChanged(
- size_t trackIndex, CodecState *state) {
+ size_t trackIndex __unused, CodecState *state) {
sp<AMessage> format;
status_t err = state->mCodec->getOutputFormat(&format);
@@ -640,7 +641,7 @@ void SimplePlayer::renderAudio(
if (delayUs > 2000ll) {
ALOGW("AudioTrack::write took %lld us, numFramesAvailableToWrite=%u, "
"numFramesWritten=%u",
- delayUs, numFramesAvailableToWrite, numFramesWritten);
+ (long long)delayUs, numFramesAvailableToWrite, numFramesWritten);
}
info->mOffset += nbytes;
diff --git a/cmds/stagefright/codec.cpp b/cmds/stagefright/codec.cpp
index d987250..dae9bbe 100644
--- a/cmds/stagefright/codec.cpp
+++ b/cmds/stagefright/codec.cpp
@@ -108,7 +108,7 @@ static int decode(
continue;
}
- ALOGV("selecting track %d", i);
+ ALOGV("selecting track %zu", i);
err = extractor->selectTrack(i);
CHECK_EQ(err, (status_t)OK);
@@ -151,7 +151,7 @@ static int decode(
CHECK_EQ((status_t)OK, codec->getInputBuffers(&state->mInBuffers));
CHECK_EQ((status_t)OK, codec->getOutputBuffers(&state->mOutBuffers));
- ALOGV("got %d input and %d output buffers",
+ ALOGV("got %zu input and %zu output buffers",
state->mInBuffers.size(), state->mOutBuffers.size());
}
@@ -172,7 +172,7 @@ static int decode(
err = state->mCodec->dequeueInputBuffer(&index, kTimeout);
if (err == OK) {
- ALOGV("filling input buffer %d", index);
+ ALOGV("filling input buffer %zu", index);
const sp<ABuffer> &buffer = state->mInBuffers.itemAt(index);
@@ -209,7 +209,7 @@ static int decode(
state->mCodec->dequeueInputBuffer(&index, kTimeout);
if (err == OK) {
- ALOGV("signalling input EOS on track %d", i);
+ ALOGV("signalling input EOS on track %zu", i);
err = state->mCodec->queueInputBuffer(
index,
@@ -258,8 +258,8 @@ static int decode(
kTimeout);
if (err == OK) {
- ALOGV("draining output buffer %d, time = %lld us",
- index, presentationTimeUs);
+ ALOGV("draining output buffer %zu, time = %lld us",
+ index, (long long)presentationTimeUs);
++state->mNumBuffersDecoded;
state->mNumBytesDecoded += size;
@@ -293,7 +293,7 @@ static int decode(
CHECK_EQ((status_t)OK,
state->mCodec->getOutputBuffers(&state->mOutBuffers));
- ALOGV("got %d output buffers", state->mOutBuffers.size());
+ ALOGV("got %zu output buffers", state->mOutBuffers.size());
} else if (err == INFO_FORMAT_CHANGED) {
sp<AMessage> format;
CHECK_EQ((status_t)OK, state->mCodec->getOutputFormat(&format));
@@ -313,17 +313,17 @@ static int decode(
CHECK_EQ((status_t)OK, state->mCodec->release());
if (state->mIsAudio) {
- printf("track %zu: %" PRId64 " bytes received. %.2f KB/sec\n",
+ printf("track %zu: %lld bytes received. %.2f KB/sec\n",
i,
- state->mNumBytesDecoded,
+ (long long)state->mNumBytesDecoded,
state->mNumBytesDecoded * 1E6 / 1024 / elapsedTimeUs);
} else {
- printf("track %zu: %" PRId64 " frames decoded, %.2f fps. %" PRId64
+ printf("track %zu: %lld frames decoded, %.2f fps. %lld"
" bytes received. %.2f KB/sec\n",
i,
- state->mNumBuffersDecoded,
+ (long long)state->mNumBuffersDecoded,
state->mNumBuffersDecoded * 1E6 / elapsedTimeUs,
- state->mNumBytesDecoded,
+ (long long)state->mNumBytesDecoded,
state->mNumBytesDecoded * 1E6 / 1024 / elapsedTimeUs);
}
}
@@ -418,7 +418,7 @@ int main(int argc, char **argv) {
ssize_t displayWidth = info.w;
ssize_t displayHeight = info.h;
- ALOGV("display is %ld x %ld\n", displayWidth, displayHeight);
+ ALOGV("display is %zd x %zd\n", displayWidth, displayHeight);
control = composerClient->createSurface(
String8("A Surface"),
diff --git a/cmds/stagefright/mediafilter.cpp b/cmds/stagefright/mediafilter.cpp
index f77b38b..1183112 100644
--- a/cmds/stagefright/mediafilter.cpp
+++ b/cmds/stagefright/mediafilter.cpp
@@ -81,7 +81,7 @@ struct SaturationRSFilter : RenderScriptWrapper::RSFilterCallback {
return OK;
}
- status_t handleSetParameters(const sp<AMessage> &msg) {
+ status_t handleSetParameters(const sp<AMessage> &msg __unused) {
return OK;
}
@@ -101,7 +101,7 @@ struct NightVisionRSFilter : RenderScriptWrapper::RSFilterCallback {
return OK;
}
- status_t handleSetParameters(const sp<AMessage> &msg) {
+ status_t handleSetParameters(const sp<AMessage> &msg __unused) {
return OK;
}
@@ -121,7 +121,7 @@ struct ARGBToRGBARSFilter : RenderScriptWrapper::RSFilterCallback {
return OK;
}
- status_t handleSetParameters(const sp<AMessage> &msg) {
+ status_t handleSetParameters(const sp<AMessage> &msg __unused) {
return OK;
}
@@ -597,7 +597,7 @@ static int decode(
if (err == OK) {
ALOGV("draining decoded buffer %zu, time = %lld us",
- frame.index, frame.presentationTimeUs);
+ frame.index, (long long)frame.presentationTimeUs);
++(state->mNumBuffersDecoded);
diff --git a/cmds/stagefright/muxer.cpp b/cmds/stagefright/muxer.cpp
index 461b56c..0029aec 100644
--- a/cmds/stagefright/muxer.cpp
+++ b/cmds/stagefright/muxer.cpp
@@ -53,7 +53,6 @@ static void usage(const char *me) {
using namespace android;
static int muxing(
- const android::sp<android::ALooper> &looper,
const char *path,
bool useAudio,
bool useVideo,
@@ -137,7 +136,7 @@ static int muxing(
}
}
- ALOGV("selecting track %d", i);
+ ALOGV("selecting track %zu", i);
err = extractor->selectTrack(i);
CHECK_EQ(err, (status_t)OK);
@@ -308,7 +307,7 @@ int main(int argc, char **argv) {
sp<ALooper> looper = new ALooper;
looper->start();
- int result = muxing(looper, argv[0], useAudio, useVideo, outputFileName,
+ int result = muxing(argv[0], useAudio, useVideo, outputFileName,
enableTrim, trimStartTimeMs, trimEndTimeMs, rotationDegrees);
looper->stop();
diff --git a/cmds/stagefright/record.cpp b/cmds/stagefright/record.cpp
index fdc352e..594c933 100644
--- a/cmds/stagefright/record.cpp
+++ b/cmds/stagefright/record.cpp
@@ -32,13 +32,13 @@
using namespace android;
+static const int32_t kAudioBitRate = 12200;
+#if 0
static const int32_t kFramerate = 24; // fps
static const int32_t kIFramesIntervalSec = 1;
static const int32_t kVideoBitRate = 512 * 1024;
-static const int32_t kAudioBitRate = 12200;
static const int64_t kDurationUs = 10000000LL; // 10 seconds
-#if 0
class DummySource : public MediaSource {
public:
diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp
index 172dc36..891d84b 100644
--- a/cmds/stagefright/sf2.cpp
+++ b/cmds/stagefright/sf2.cpp
@@ -328,14 +328,14 @@ private:
CHECK(size >= 7);
CHECK_EQ((unsigned)ptr[0], 1u); // configurationVersion == 1
- uint8_t profile = ptr[1];
- uint8_t level = ptr[3];
+ uint8_t profile __unused = ptr[1];
+ uint8_t level __unused = ptr[3];
// There is decodable content out there that fails the following
// assertion, let's be lenient for now...
// CHECK((ptr[4] >> 2) == 0x3f); // reserved
- size_t lengthSize = 1 + (ptr[4] & 3);
+ size_t lengthSize __unused = 1 + (ptr[4] & 3);
// commented out check below as H264_QVGA_500_NO_AUDIO.3gp
// violates it...
@@ -491,7 +491,7 @@ private:
if (sizeNeeded > sizeLeft) {
if (outBuffer->size() == 0) {
- ALOGE("Unable to fit even a single input buffer of size %d.",
+ ALOGE("Unable to fit even a single input buffer of size %zu.",
sizeNeeded);
}
CHECK_GT(outBuffer->size(), 0u);
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 318b56d..a9c6eda 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -965,7 +965,7 @@ int main(int argc, char **argv) {
OMXClient client;
status_t err = client.connect();
- for (int k = 0; k < argc; ++k) {
+ for (int k = 0; k < argc && err == OK; ++k) {
bool syncInfoPresent = true;
const char *filename = argv[k];
diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp
index 0566d14..1a40e53 100644
--- a/cmds/stagefright/stream.cpp
+++ b/cmds/stagefright/stream.cpp
@@ -269,7 +269,7 @@ struct MyClient : public BnMediaPlayerClient {
: mEOS(false) {
}
- virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) {
+ virtual void notify(int msg, int ext1 __unused, int ext2 __unused, const Parcel *obj __unused) {
Mutex::Autolock autoLock(mLock);
if (msg == MEDIA_ERROR || msg == MEDIA_PLAYBACK_COMPLETE) {
@@ -318,7 +318,7 @@ int main(int argc, char **argv) {
ssize_t displayWidth = info.w;
ssize_t displayHeight = info.h;
- ALOGV("display is %d x %d\n", displayWidth, displayHeight);
+ ALOGV("display is %zd x %zd\n", displayWidth, displayHeight);
sp<SurfaceControl> control =
composerClient->createSurface(