summaryrefslogtreecommitdiffstats
path: root/media/tests/omxjpegdecoder
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-12-16 13:13:27 -0800
committerAndreas Huber <andih@google.com>2009-12-16 13:13:27 -0800
commit987dbde838014e5f0c55a63acdd2a9a002b140cc (patch)
tree402fcfe6769271b476e94feba16b779681c55552 /media/tests/omxjpegdecoder
parentb5362167abb1dc6858fcb2d7b7e212683ae255a5 (diff)
downloadframeworks_base-987dbde838014e5f0c55a63acdd2a9a002b140cc.zip
frameworks_base-987dbde838014e5f0c55a63acdd2a9a002b140cc.tar.gz
frameworks_base-987dbde838014e5f0c55a63acdd2a9a002b140cc.tar.bz2
Fix full stagefright build in master, various warnings/errors in omx_jpeg_decoder
Diffstat (limited to 'media/tests/omxjpegdecoder')
-rw-r--r--media/tests/omxjpegdecoder/SkOmxPixelRef.cpp2
-rw-r--r--media/tests/omxjpegdecoder/SkOmxPixelRef.h4
-rw-r--r--media/tests/omxjpegdecoder/jpeg_decoder_bench.cpp2
-rw-r--r--media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp20
-rw-r--r--media/tests/omxjpegdecoder/omx_jpeg_decoder.h8
5 files changed, 18 insertions, 18 deletions
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<OMXCodec> decoder) {
+ sp<MediaSource> 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<OMXCodec> decoder);
+ sp<MediaSource> decoder);
virtual ~SkOmxPixelRef();
//! Return the allocation size for the pixels
@@ -40,7 +40,7 @@ protected:
private:
MediaBuffer* mBuffer;
- sp<OMXCodec> mDecoder;
+ sp<MediaSource> 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<OMXCodec> decoder = getDecoder(&mClient, source);
+ sp<MediaSource> decoder = getDecoder(&mClient, source);
return decodeSource(decoder, source, bm);
}
@@ -127,21 +127,21 @@ JPEGSource* OmxJpegImageDecoder::prepareMediaSource(SkStream* stream) {
return new JPEGSource(dataSource);
}
-sp<OMXCodec> OmxJpegImageDecoder::getDecoder(
+sp<MediaSource> OmxJpegImageDecoder::getDecoder(
OMXClient *client, const sp<MediaSource>& source) {
sp<MetaData> meta = source->getFormat();
- sp<OMXCodec> decoder = OMXCodec::Create(
+ sp<MediaSource> decoder = OMXCodec::Create(
client->interface(), meta, false /* createEncoder */, source);
CHECK(decoder != NULL);
return decoder;
}
-bool OmxJpegImageDecoder::decodeSource(sp<OMXCodec> decoder,
+bool OmxJpegImageDecoder::decodeSource(sp<MediaSource> decoder,
const sp<MediaSource>& 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<OMXCodec> decoder,
return true;
}
-void OmxJpegImageDecoder::installPixelRef(MediaBuffer *buffer, sp<OMXCodec> decoder,
+void OmxJpegImageDecoder::installPixelRef(MediaBuffer *buffer, sp<MediaSource> 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<OMXCodec> getDecoder(OMXClient* client, const sp<MediaSource>& source);
- bool decodeSource(sp<OMXCodec> decoder, const sp<MediaSource>& source,
+ sp<MediaSource> getDecoder(OMXClient* client, const sp<MediaSource>& source);
+ bool decodeSource(sp<MediaSource> decoder, const sp<MediaSource>& source,
SkBitmap* bm);
- void installPixelRef(MediaBuffer* buffer, sp<OMXCodec> decoder,
+ void installPixelRef(MediaBuffer* buffer, sp<MediaSource> decoder,
SkBitmap* bm);
void configBitmapSize(SkBitmap* bm, SkBitmap::Config pref, int width,
int height);