Fix the broken build of omxjpegdecoder: http://b/2299035.

1) Add the include path for jni.h.

2) Rename InitCheck() and read_at() to initCheck() and readAt(),
   repectively in StreamSource, as done in DataSource.

3) Add back the definition of SkJPEGImageDecoder to jpeg_decoder_bench.cpp.
   Need to do so because SkJPEGImageDecoder is not defined in a header file.
This commit is contained in:
Wei-Ta Chen
2009-12-03 23:19:19 +08:00
parent f623fbc45d
commit b355012797
4 changed files with 16 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ LOCAL_SHARED_LIBRARIES := \
libstagefright
LOCAL_C_INCLUDES := \
$(JNI_H_INCLUDE) \
$(TOP)/external/jpeg \
$(TOP)/external/skia/include/config \
$(TOP)/external/skia/include/core \

View File

@@ -31,11 +31,11 @@ StreamSource::~StreamSource() {
mStream = NULL;
}
status_t StreamSource::InitCheck() const {
status_t StreamSource::initCheck() const {
return mStream != NULL ? OK : NO_INIT;
}
ssize_t StreamSource::read_at(off_t offset, void *data, size_t size) {
ssize_t StreamSource::readAt(off_t offset, void *data, size_t size) {
Mutex::Autolock autoLock(mLock);
mStream->rewind();

View File

@@ -31,8 +31,8 @@ class StreamSource : public DataSource {
public:
// Pass the ownership of SkStream to StreamSource.
StreamSource(SkStream *SkStream);
status_t InitCheck() const;
virtual ssize_t read_at(off_t offset, void *data, size_t size);
virtual status_t initCheck() const;
virtual ssize_t readAt(off_t offset, void *data, size_t size);
virtual status_t getSize(off_t *size);
protected:

View File

@@ -25,6 +25,17 @@
#include "SkStream.h"
#include "omx_jpeg_decoder.h"
class SkJPEGImageDecoder : public SkImageDecoder {
public:
virtual Format getFormat() const {
return kJPEG_Format;
}
protected:
virtual bool onDecode(SkStream* stream, SkBitmap* bm,
SkBitmap::Config pref, Mode);
};
int nullObjectReturn(const char msg[]) {
if (msg) {
SkDebugf("--- %s\n", msg);