Merge "Frameworks/base: Wall Werror in media/tests"
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
ifeq ($(TARGET_ARCH),arm)
|
|
||||||
|
|
||||||
LOCAL_PATH:= $(call my-dir)
|
LOCAL_PATH:= $(call my-dir)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_MODULE:= shared_mem_test
|
LOCAL_MODULE:= shared_mem_test
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
shared_mem_test.cpp
|
shared_mem_test.cpp
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
libc \
|
libc \
|
||||||
libcutils \
|
libcutils \
|
||||||
@@ -14,8 +15,9 @@ LOCAL_SHARED_LIBRARIES := \
|
|||||||
libbinder \
|
libbinder \
|
||||||
libhardware_legacy \
|
libhardware_legacy \
|
||||||
libmedia
|
libmedia
|
||||||
|
|
||||||
LOCAL_MODULE_TAGS := tests
|
LOCAL_MODULE_TAGS := tests
|
||||||
|
|
||||||
include $(BUILD_EXECUTABLE)
|
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||||
|
|
||||||
endif
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|||||||
@@ -133,12 +133,8 @@ int AudioTrackTest::Test01() {
|
|||||||
************************************************************/
|
************************************************************/
|
||||||
void AudioTrackTest::Generate(short *buffer, long bufferSz, long amplitude, unsigned long &phi, long dPhi)
|
void AudioTrackTest::Generate(short *buffer, long bufferSz, long amplitude, unsigned long &phi, long dPhi)
|
||||||
{
|
{
|
||||||
long pi13 = 25736; // 2^13*pi
|
|
||||||
// fill buffer
|
// fill buffer
|
||||||
for(int i0=0; i0<bufferSz; i0++) {
|
for(int i0=0; i0<bufferSz; i0++) {
|
||||||
long sample;
|
|
||||||
long l0, l1;
|
|
||||||
|
|
||||||
buffer[i0] = ComputeSine( amplitude, phi);
|
buffer[i0] = ComputeSine( amplitude, phi);
|
||||||
phi += dPhi;
|
phi += dPhi;
|
||||||
}
|
}
|
||||||
@@ -210,7 +206,7 @@ int main() {
|
|||||||
* global main
|
* global main
|
||||||
*
|
*
|
||||||
************************************************************/
|
************************************************************/
|
||||||
int main(int argc, char *argv[]) {
|
int main() {
|
||||||
|
|
||||||
return android::main();
|
return android::main();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,4 +42,6 @@ LOCAL_MODULE := jpeg_bench
|
|||||||
|
|
||||||
LOCAL_MODULE_TAGS := optional
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||||
|
|
||||||
include $(BUILD_EXECUTABLE)
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|||||||
@@ -20,7 +20,11 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
#include <SkStream.h>
|
#include <SkStream.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
#include <media/stagefright/DataSource.h>
|
#include <media/stagefright/DataSource.h>
|
||||||
#include <media/stagefright/MediaErrors.h>
|
#include <media/stagefright/MediaErrors.h>
|
||||||
#include <utils/threads.h>
|
#include <utils/threads.h>
|
||||||
|
|||||||
@@ -20,9 +20,13 @@
|
|||||||
|
|
||||||
#include <binder/ProcessState.h>
|
#include <binder/ProcessState.h>
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
#include "SkBitmap.h"
|
#include "SkBitmap.h"
|
||||||
#include "SkImageDecoder.h"
|
#include "SkImageDecoder.h"
|
||||||
#include "SkStream.h"
|
#include "SkStream.h"
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
#include "omx_jpeg_decoder.h"
|
#include "omx_jpeg_decoder.h"
|
||||||
|
|
||||||
class SkJPEGImageDecoder : public SkImageDecoder {
|
class SkJPEGImageDecoder : public SkImageDecoder {
|
||||||
@@ -101,6 +105,11 @@ int testDecoder(SkImageDecoder* decoder, char* filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
if (argc < 2) {
|
||||||
|
printf("Need a parameter!\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
android::ProcessState::self()->startThreadPool();
|
android::ProcessState::self()->startThreadPool();
|
||||||
|
|
||||||
printf("Decoding jpeg with libjpeg...\n");
|
printf("Decoding jpeg with libjpeg...\n");
|
||||||
|
|||||||
@@ -30,35 +30,18 @@
|
|||||||
#include <media/stagefright/MetaData.h>
|
#include <media/stagefright/MetaData.h>
|
||||||
#include <media/stagefright/OMXClient.h>
|
#include <media/stagefright/OMXClient.h>
|
||||||
#include <media/stagefright/OMXCodec.h>
|
#include <media/stagefright/OMXCodec.h>
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
#include <SkImage.h>
|
#include <SkImage.h>
|
||||||
#include <SkMallocPixelRef.h>
|
#include <SkMallocPixelRef.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
#include "omx_jpeg_decoder.h"
|
#include "omx_jpeg_decoder.h"
|
||||||
#include "StreamSource.h"
|
#include "StreamSource.h"
|
||||||
|
|
||||||
using namespace android;
|
using namespace android;
|
||||||
|
|
||||||
static void getJpegOutput(MediaBuffer* buffer, const char* filename) {
|
|
||||||
int size = buffer->range_length();
|
|
||||||
int offset = buffer->range_offset();
|
|
||||||
FILE *pFile = fopen(filename, "w+");
|
|
||||||
|
|
||||||
if (pFile == NULL) {
|
|
||||||
printf("Error: cannot open %s.\n", filename);
|
|
||||||
} else {
|
|
||||||
char* data = (char*) buffer->data();
|
|
||||||
data += offset;
|
|
||||||
while (size > 0) {
|
|
||||||
int numChars = fwrite(data, sizeof(char), 1024, pFile);
|
|
||||||
int numBytes = numChars * sizeof(char);
|
|
||||||
size -= numBytes;
|
|
||||||
data += numBytes;
|
|
||||||
}
|
|
||||||
fclose(pFile);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern int storeBitmapToFile(SkBitmap* bitmap, const char* filename) {
|
extern int storeBitmapToFile(SkBitmap* bitmap, const char* filename) {
|
||||||
bitmap->lockPixels();
|
bitmap->lockPixels();
|
||||||
uint8_t* data = (uint8_t *)bitmap->getPixels();
|
uint8_t* data = (uint8_t *)bitmap->getPixels();
|
||||||
@@ -140,7 +123,7 @@ sp<MediaSource> OmxJpegImageDecoder::getDecoder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool OmxJpegImageDecoder::decodeSource(sp<MediaSource> decoder,
|
bool OmxJpegImageDecoder::decodeSource(sp<MediaSource> decoder,
|
||||||
const sp<MediaSource>& source, SkBitmap* bm) {
|
const sp<MediaSource>& /* source */, SkBitmap* bm) {
|
||||||
status_t rt = decoder->start();
|
status_t rt = decoder->start();
|
||||||
if (rt != OK) {
|
if (rt != OK) {
|
||||||
ALOGE("Cannot start OMX Decoder!");
|
ALOGE("Cannot start OMX Decoder!");
|
||||||
@@ -169,7 +152,7 @@ bool OmxJpegImageDecoder::decodeSource(sp<MediaSource> decoder,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OmxJpegImageDecoder::configBitmapSize(SkBitmap* bm, SkColorType pref,
|
void OmxJpegImageDecoder::configBitmapSize(SkBitmap* bm, SkColorType /* pref */,
|
||||||
int width, int height) {
|
int width, int height) {
|
||||||
// Set the color space to ARGB_8888 for now (ignoring pref)
|
// Set the color space to ARGB_8888 for now (ignoring pref)
|
||||||
// because of limitation in hardware support.
|
// because of limitation in hardware support.
|
||||||
|
|||||||
@@ -25,8 +25,12 @@
|
|||||||
#include <media/stagefright/MediaSource.h>
|
#include <media/stagefright/MediaSource.h>
|
||||||
#include <media/stagefright/OMXClient.h>
|
#include <media/stagefright/OMXClient.h>
|
||||||
#include <media/stagefright/OMXCodec.h>
|
#include <media/stagefright/OMXCodec.h>
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
#include <SkImageDecoder.h>
|
#include <SkImageDecoder.h>
|
||||||
#include <SkStream.h>
|
#include <SkStream.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
using namespace android;
|
using namespace android;
|
||||||
|
|
||||||
|
|||||||
@@ -26,5 +26,6 @@ LOCAL_SHARED_LIBRARIES:= \
|
|||||||
LOCAL_MODULE:= invoke_mock_media_player
|
LOCAL_MODULE:= invoke_mock_media_player
|
||||||
LOCAL_MODULE_TAGS := tests eng
|
LOCAL_MODULE_TAGS := tests eng
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class Player: public MediaPlayerBase
|
|||||||
virtual bool hardwareOutput() {return true;}
|
virtual bool hardwareOutput() {return true;}
|
||||||
|
|
||||||
virtual status_t setDataSource(
|
virtual status_t setDataSource(
|
||||||
const sp<IMediaHTTPService> &httpService,
|
const sp<IMediaHTTPService>& /* httpService */,
|
||||||
const char *url,
|
const char *url,
|
||||||
const KeyedVector<String8, String8> *) {
|
const KeyedVector<String8, String8> *) {
|
||||||
ALOGV("setDataSource %s", url);
|
ALOGV("setDataSource %s", url);
|
||||||
@@ -69,24 +69,28 @@ class Player: public MediaPlayerBase
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) {return OK;}
|
virtual status_t setDataSource(int /* fd */, int64_t /* offset */, int64_t /* length */) {
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
virtual status_t setVideoSurfaceTexture(
|
virtual status_t setVideoSurfaceTexture(
|
||||||
const sp<IGraphicBufferProducer>& bufferProducer) {return OK;}
|
const sp<IGraphicBufferProducer>& /* bufferProducer */) {
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
virtual status_t prepare() { return OK; }
|
virtual status_t prepare() { return OK; }
|
||||||
virtual status_t prepareAsync() { return OK; }
|
virtual status_t prepareAsync() { return OK; }
|
||||||
virtual status_t start() { return OK; }
|
virtual status_t start() { return OK; }
|
||||||
virtual status_t stop() { return OK; }
|
virtual status_t stop() { return OK; }
|
||||||
virtual status_t pause() { return OK; }
|
virtual status_t pause() { return OK; }
|
||||||
virtual bool isPlaying() { return true; }
|
virtual bool isPlaying() { return true; }
|
||||||
virtual status_t seekTo(int msec) {return OK;}
|
virtual status_t seekTo(int /* msec */) { return OK; }
|
||||||
virtual status_t getCurrentPosition(int *msec) {return OK;}
|
virtual status_t getCurrentPosition(int* /* msec */) { return OK; }
|
||||||
virtual status_t getDuration(int *msec) {return OK;}
|
virtual status_t getDuration(int* /* msec */) { return OK; }
|
||||||
virtual status_t reset() {return OK;}
|
virtual status_t reset() {return OK;}
|
||||||
virtual status_t setLooping(int loop) {return OK;}
|
virtual status_t setLooping(int /* loop */) { return OK; }
|
||||||
virtual player_type playerType() {return TEST_PLAYER;}
|
virtual player_type playerType() {return TEST_PLAYER;}
|
||||||
virtual status_t invoke(const Parcel& request, Parcel *reply);
|
virtual status_t invoke(const Parcel& request, Parcel *reply);
|
||||||
virtual status_t setParameter(int key, const Parcel &request) {return OK;}
|
virtual status_t setParameter(int /* key */, const Parcel& /* request */) { return OK; }
|
||||||
virtual status_t getParameter(int key, Parcel *reply) {return OK;}
|
virtual status_t getParameter(int /* key */, Parcel* /* reply */) { return OK; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user