From 987dbde838014e5f0c55a63acdd2a9a002b140cc Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 16 Dec 2009 13:13:27 -0800 Subject: Fix full stagefright build in master, various warnings/errors in omx_jpeg_decoder --- media/tests/omxjpegdecoder/SkOmxPixelRef.cpp | 2 +- media/tests/omxjpegdecoder/SkOmxPixelRef.h | 4 ++-- media/tests/omxjpegdecoder/jpeg_decoder_bench.cpp | 2 +- media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp | 20 ++++++++++---------- media/tests/omxjpegdecoder/omx_jpeg_decoder.h | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'media/tests/omxjpegdecoder') diff --git a/media/tests/omxjpegdecoder/SkOmxPixelRef.cpp b/media/tests/omxjpegdecoder/SkOmxPixelRef.cpp index 3acc0ee..dfdf676 100644 --- a/media/tests/omxjpegdecoder/SkOmxPixelRef.cpp +++ b/media/tests/omxjpegdecoder/SkOmxPixelRef.cpp @@ -22,7 +22,7 @@ using namespace android; SkOmxPixelRef::SkOmxPixelRef(SkColorTable* ctable, MediaBuffer* buffer, - sp decoder) { + sp decoder) { mBuffer = buffer; mDecoder = decoder; mSize = buffer->size(); diff --git a/media/tests/omxjpegdecoder/SkOmxPixelRef.h b/media/tests/omxjpegdecoder/SkOmxPixelRef.h index 4ab5a73..afedcbd 100644 --- a/media/tests/omxjpegdecoder/SkOmxPixelRef.h +++ b/media/tests/omxjpegdecoder/SkOmxPixelRef.h @@ -27,7 +27,7 @@ namespace android { class SkOmxPixelRef : public SkPixelRef { public: SkOmxPixelRef(SkColorTable* ctable, MediaBuffer* buffer, - sp decoder); + sp decoder); virtual ~SkOmxPixelRef(); //! Return the allocation size for the pixels @@ -40,7 +40,7 @@ protected: private: MediaBuffer* mBuffer; - sp mDecoder; + sp mDecoder; size_t mSize; SkColorTable* mCTable; diff --git a/media/tests/omxjpegdecoder/jpeg_decoder_bench.cpp b/media/tests/omxjpegdecoder/jpeg_decoder_bench.cpp index 78b89ca..2d05a49 100644 --- a/media/tests/omxjpegdecoder/jpeg_decoder_bench.cpp +++ b/media/tests/omxjpegdecoder/jpeg_decoder_bench.cpp @@ -79,7 +79,7 @@ int testDecodePixels(SkImageDecoder* decoder, SkStream* stream, } else { int64_t delay = getNowUs() - startTime; printf("Decoding Time in PixelsMode %.1f msec.\n", delay / 1000.0f); - char* filename = "/sdcard/omxJpegDecodedBitmap.rgba"; + const char* filename = "/sdcard/omxJpegDecodedBitmap.rgba"; return storeBitmapToFile(bitmap, filename); } } diff --git a/media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp b/media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp index 8d02f46..f229f9d 100644 --- a/media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp +++ b/media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp @@ -38,7 +38,7 @@ using namespace android; -static void getJpegOutput(MediaBuffer* buffer, char* filename) { +static void getJpegOutput(MediaBuffer* buffer, const char* filename) { int size = buffer->range_length(); int offset = buffer->range_offset(); FILE *pFile = fopen(filename, "w+"); @@ -59,9 +59,9 @@ static void getJpegOutput(MediaBuffer* buffer, char* filename) { return; } -extern int storeBitmapToFile(SkBitmap* bitmap, char* filename) { +extern int storeBitmapToFile(SkBitmap* bitmap, const char* filename) { bitmap->lockPixels(); - void* data = bitmap->getPixels(); + uint8_t* data = (uint8_t *)bitmap->getPixels(); int size = bitmap->getSize(); FILE* fp = fopen(filename, "w+"); @@ -113,11 +113,11 @@ bool OmxJpegImageDecoder::onDecode(SkStream* stream, // mode == DecodePixels if (!this->allocPixelRef(bm, NULL)) { - LOGI(LOG_TAG, "Cannot allocPixelRef()!"); + LOGI("Cannot allocPixelRef()!"); return false; } - sp decoder = getDecoder(&mClient, source); + sp decoder = getDecoder(&mClient, source); return decodeSource(decoder, source, bm); } @@ -127,21 +127,21 @@ JPEGSource* OmxJpegImageDecoder::prepareMediaSource(SkStream* stream) { return new JPEGSource(dataSource); } -sp OmxJpegImageDecoder::getDecoder( +sp OmxJpegImageDecoder::getDecoder( OMXClient *client, const sp& source) { sp meta = source->getFormat(); - sp decoder = OMXCodec::Create( + sp decoder = OMXCodec::Create( client->interface(), meta, false /* createEncoder */, source); CHECK(decoder != NULL); return decoder; } -bool OmxJpegImageDecoder::decodeSource(sp decoder, +bool OmxJpegImageDecoder::decodeSource(sp decoder, const sp& source, SkBitmap* bm) { status_t rt = decoder->start(); if (rt != OK) { - LOGE(LOG_TAG, "Cannot start OMX Decoder!"); + LOGE("Cannot start OMX Decoder!"); return false; } int64_t startTime = getNowUs(); @@ -171,7 +171,7 @@ bool OmxJpegImageDecoder::decodeSource(sp decoder, return true; } -void OmxJpegImageDecoder::installPixelRef(MediaBuffer *buffer, sp decoder, +void OmxJpegImageDecoder::installPixelRef(MediaBuffer *buffer, sp decoder, SkBitmap* bm) { // set bm's pixelref based on the data in buffer. diff --git a/media/tests/omxjpegdecoder/omx_jpeg_decoder.h b/media/tests/omxjpegdecoder/omx_jpeg_decoder.h index 21e2ae6..7d8bac0 100644 --- a/media/tests/omxjpegdecoder/omx_jpeg_decoder.h +++ b/media/tests/omxjpegdecoder/omx_jpeg_decoder.h @@ -30,7 +30,7 @@ using namespace android; -extern int storeBitmapToFile(SkBitmap* bitmap, char* filename); +extern int storeBitmapToFile(SkBitmap* bitmap, const char* filename); class OmxJpegImageDecoder : public SkImageDecoder { public: @@ -47,10 +47,10 @@ protected: private: JPEGSource* prepareMediaSource(SkStream* stream); - sp getDecoder(OMXClient* client, const sp& source); - bool decodeSource(sp decoder, const sp& source, + sp getDecoder(OMXClient* client, const sp& source); + bool decodeSource(sp decoder, const sp& source, SkBitmap* bm); - void installPixelRef(MediaBuffer* buffer, sp decoder, + void installPixelRef(MediaBuffer* buffer, sp decoder, SkBitmap* bm); void configBitmapSize(SkBitmap* bm, SkBitmap::Config pref, int width, int height); -- cgit v1.1