diff options
author | Mathias Agopian <mathias@google.com> | 2010-01-25 19:00:00 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-01-29 14:51:06 -0800 |
commit | 867d2f6ce668968e463eb86b856d21525f12fd67 (patch) | |
tree | cc65f1c037d980841d0f075e2625ac37ac338f28 | |
parent | bbe1ed453aa0407237127fb45a30ba8ffd9e0941 (diff) | |
download | frameworks_av-867d2f6ce668968e463eb86b856d21525f12fd67.zip frameworks_av-867d2f6ce668968e463eb86b856d21525f12fd67.tar.gz frameworks_av-867d2f6ce668968e463eb86b856d21525f12fd67.tar.bz2 |
Simplify the MemoryDealer implementation
At some point the implementation became complicated because of
SurfaceFlinger's special needs, since we are now relying on gralloc
we can go back to much simpler MemoryDealer.
Removed HeapInterface and AllocatorInterface, since those don't need
to be paramterized anymore. Merged SimpleMemory and Allocation.
Made SimplisticAllocator non virtual.
Removed MemoryDealer flags (READ_ONLY, PAGE_ALIGNED)
Removed a lot of unneeded code.
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 1 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 1 | ||||
-rw-r--r-- | media/libmediaplayerservice/MetadataRetrieverClient.cpp | 4 | ||||
-rw-r--r-- | media/libstagefright/OMXCodec.cpp | 2 | ||||
-rw-r--r-- | media/libstagefright/omx/tests/OMXHarness.cpp | 2 |
5 files changed, 4 insertions, 6 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index f4165ff..7bbd0b2 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -32,7 +32,6 @@ #include <binder/IServiceManager.h> #include <utils/Log.h> -#include <binder/MemoryDealer.h> #include <binder/Parcel.h> #include <binder/IPCThreadState.h> #include <utils/Timers.h> diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index ad0f42e..74852dc 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -32,7 +32,6 @@ #include <media/AudioTrack.h> #include <utils/Log.h> -#include <binder/MemoryDealer.h> #include <binder/Parcel.h> #include <binder/IPCThreadState.h> #include <utils/Timers.h> diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/media/libmediaplayerservice/MetadataRetrieverClient.cpp index 66de2ee..162bebb 100644 --- a/media/libmediaplayerservice/MetadataRetrieverClient.cpp +++ b/media/libmediaplayerservice/MetadataRetrieverClient.cpp @@ -253,7 +253,7 @@ sp<IMemory> MetadataRetrieverClient::captureFrame() return NULL; } size_t size = sizeof(VideoFrame) + frame->mSize; - mThumbnailDealer = new MemoryDealer(size); + mThumbnailDealer = new MemoryDealer(size, "MetadataRetrieverClient"); if (mThumbnailDealer == NULL) { LOGE("failed to create MemoryDealer"); delete frame; @@ -294,7 +294,7 @@ sp<IMemory> MetadataRetrieverClient::extractAlbumArt() return NULL; } size_t size = sizeof(MediaAlbumArt) + albumArt->mSize; - mAlbumArtDealer = new MemoryDealer(size); + mAlbumArtDealer = new MemoryDealer(size, "MetadataRetrieverClient"); if (mAlbumArtDealer == NULL) { LOGE("failed to create MemoryDealer object"); delete albumArt; diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 986dcb2..e17fbb8 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1183,7 +1183,7 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { } size_t totalSize = def.nBufferCountActual * def.nBufferSize; - mDealer[portIndex] = new MemoryDealer(totalSize); + mDealer[portIndex] = new MemoryDealer(totalSize, "OMXCodec"); for (OMX_U32 i = 0; i < def.nBufferCountActual; ++i) { sp<IMemory> mem = mDealer[portIndex]->allocate(def.nBufferSize); diff --git a/media/libstagefright/omx/tests/OMXHarness.cpp b/media/libstagefright/omx/tests/OMXHarness.cpp index 6c36163..51fcaf5 100644 --- a/media/libstagefright/omx/tests/OMXHarness.cpp +++ b/media/libstagefright/omx/tests/OMXHarness.cpp @@ -286,7 +286,7 @@ status_t Harness::testStateTransitions( return OK; } - sp<MemoryDealer> dealer = new MemoryDealer(8 * 1024 * 1024); + sp<MemoryDealer> dealer = new MemoryDealer(8 * 1024 * 1024, "OMXHarness"); IOMX::node_id node; status_t err = |