diff options
| author | 2014-03-27 17:31:00 -0400 | |
|---|---|---|
| committer | 2014-03-27 17:36:18 -0400 | |
| commit | 7a3878cd8f5fd18cf43b2760f108f8c8a3e1794d (patch) | |
| tree | ea339d6046615caecea2f988fae2329538d5d6cb | |
| parent | f0d019c4e4ef5ec9b03330c8441aa1356036cc60 (diff) | |
Remove SkOmxPixelRef to fix build.
Recent changes to SkPixelRef (from which SkOmxPixelRef inherited)
added abstract functions which SkOmxPixelRef does not implement.
Solution: remove SkOmxPixelRef, which is completely unused. The only
code that created one was commented out at the same time as it was
added in 2009, so there's likely no benefit to reviving it.
Change-Id: Icbf2537fcc03fd464fd791ff91659a1812019623
| -rw-r--r-- | media/tests/omxjpegdecoder/Android.mk | 1 | ||||
| -rw-r--r-- | media/tests/omxjpegdecoder/SkOmxPixelRef.cpp | 46 | ||||
| -rw-r--r-- | media/tests/omxjpegdecoder/SkOmxPixelRef.h | 52 | ||||
| -rw-r--r-- | media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp | 16 | ||||
| -rw-r--r-- | media/tests/omxjpegdecoder/omx_jpeg_decoder.h | 2 |
5 files changed, 0 insertions, 117 deletions
diff --git a/media/tests/omxjpegdecoder/Android.mk b/media/tests/omxjpegdecoder/Android.mk index 95ae33bc29a1..b0bc5d4a2e36 100644 --- a/media/tests/omxjpegdecoder/Android.mk +++ b/media/tests/omxjpegdecoder/Android.mk @@ -19,7 +19,6 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ omx_jpeg_decoder.cpp \ jpeg_decoder_bench.cpp \ - SkOmxPixelRef.cpp \ StreamSource.cpp LOCAL_SHARED_LIBRARIES := \ diff --git a/media/tests/omxjpegdecoder/SkOmxPixelRef.cpp b/media/tests/omxjpegdecoder/SkOmxPixelRef.cpp deleted file mode 100644 index a25e854fa991..000000000000 --- a/media/tests/omxjpegdecoder/SkOmxPixelRef.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <media/stagefright/foundation/ADebug.h> -#include <SkBitmap.h> - -#include "SkOmxPixelRef.h" - -using namespace android; - -SkOmxPixelRef::SkOmxPixelRef(SkColorTable* ctable, MediaBuffer* buffer, - sp<MediaSource> decoder) { - mBuffer = buffer; - mDecoder = decoder; - mSize = buffer->size(); - mCTable = ctable; - SkSafeRef(mCTable); -} - -SkOmxPixelRef::~SkOmxPixelRef() { - mBuffer->release(); - CHECK_EQ(mDecoder->stop(), (status_t)OK); - SkSafeUnref(mCTable); -} - -void* SkOmxPixelRef::onLockPixels(SkColorTable** ct) { - *ct = mCTable; - return mBuffer->data(); -} - -void SkOmxPixelRef::onUnlockPixels() { - // nothing to do -} diff --git a/media/tests/omxjpegdecoder/SkOmxPixelRef.h b/media/tests/omxjpegdecoder/SkOmxPixelRef.h deleted file mode 100644 index 374604c39dae..000000000000 --- a/media/tests/omxjpegdecoder/SkOmxPixelRef.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SKOMXPIXELREF_DEFINED -#define SKOMXPIXELREF_DEFINED - -#include <media/stagefright/MediaBuffer.h> -#include <media/stagefright/OMXClient.h> -#include <media/stagefright/OMXCodec.h> -#include <SkPixelRef.h> - -namespace android { - -class SkOmxPixelRef : public SkPixelRef { -public: - SkOmxPixelRef(SkColorTable* ctable, MediaBuffer* buffer, - sp<MediaSource> decoder); - virtual ~SkOmxPixelRef(); - - //! Return the allocation size for the pixels - size_t getSize() const { return mSize; } - - SK_DECLARE_UNFLATTENABLE_OBJECT() -protected: - // overrides from SkPixelRef - virtual void* onLockPixels(SkColorTable**); - virtual void onUnlockPixels(); - -private: - MediaBuffer* mBuffer; - sp<MediaSource> mDecoder; - size_t mSize; - SkColorTable* mCTable; - - typedef SkPixelRef INHERITED; -}; - -} // namespace android -#endif // SKOMXPIXELREF_DEFINED diff --git a/media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp b/media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp index 53f04bc6079c..3dd988eea63b 100644 --- a/media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp +++ b/media/tests/omxjpegdecoder/omx_jpeg_decoder.cpp @@ -34,7 +34,6 @@ #include <SkMallocPixelRef.h> #include "omx_jpeg_decoder.h" -#include "SkOmxPixelRef.h" #include "StreamSource.h" using namespace android; @@ -158,10 +157,6 @@ bool OmxJpegImageDecoder::decodeSource(sp<MediaSource> decoder, printf("Duration in decoder->read(): %.1f (msecs). \n", duration / 1E3 ); - /* Mark the code for now, since we attend to copy buffer to SkBitmap. - // Install pixelRef to Bitmap. - installPixelRef(buffer, decoder, bm);*/ - // Copy pixels from buffer to bm. // May need to check buffer->rawBytes() == bm->rawBytes(). CHECK_EQ(buffer->size(), bm->getSize()); @@ -172,17 +167,6 @@ bool OmxJpegImageDecoder::decodeSource(sp<MediaSource> decoder, return true; } -void OmxJpegImageDecoder::installPixelRef(MediaBuffer *buffer, sp<MediaSource> decoder, - SkBitmap* bm) { - - // set bm's pixelref based on the data in buffer. - SkAutoLockPixels alp(*bm); - SkPixelRef* pr = new SkOmxPixelRef(NULL, buffer, decoder); - bm->setPixelRef(pr)->unref(); - bm->lockPixels(); - return; -} - void OmxJpegImageDecoder::configBitmapSize(SkBitmap* bm, SkBitmap::Config pref, int width, int height) { bm->setConfig(getColorSpaceConfig(pref), width, height, 0, kOpaque_SkAlphaType); diff --git a/media/tests/omxjpegdecoder/omx_jpeg_decoder.h b/media/tests/omxjpegdecoder/omx_jpeg_decoder.h index a313877ac808..e431e724183f 100644 --- a/media/tests/omxjpegdecoder/omx_jpeg_decoder.h +++ b/media/tests/omxjpegdecoder/omx_jpeg_decoder.h @@ -49,8 +49,6 @@ private: 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<MediaSource> decoder, - SkBitmap* bm); void configBitmapSize(SkBitmap* bm, SkBitmap::Config pref, int width, int height); SkBitmap::Config getColorSpaceConfig(SkBitmap::Config pref); |