diff options
author | Elliott Hughes <enh@google.com> | 2014-06-12 00:15:39 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-12 00:15:39 +0000 |
commit | 7903bb2b3065d58cc75637900922b434f50024d9 (patch) | |
tree | 33e825d96a3c1ca8a7778d50068e738d0cfa7272 /include/private | |
parent | 14c403fbab456a4a63586a767fbae498f5f8c260 (diff) | |
parent | 2a8270e6944fb3addfcba87f6885aaad196b8b88 (diff) | |
download | frameworks_av-7903bb2b3065d58cc75637900922b434f50024d9.zip frameworks_av-7903bb2b3065d58cc75637900922b434f50024d9.tar.gz frameworks_av-7903bb2b3065d58cc75637900922b434f50024d9.tar.bz2 |
am 2a8270e6: am c323737d: Merge "Offer a type-safe album art interface."
* commit '2a8270e6944fb3addfcba87f6885aaad196b8b88':
Offer a type-safe album art interface.
Diffstat (limited to 'include/private')
-rw-r--r-- | include/private/media/VideoFrame.h | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/include/private/media/VideoFrame.h b/include/private/media/VideoFrame.h index a211ed9..5dd425b 100644 --- a/include/private/media/VideoFrame.h +++ b/include/private/media/VideoFrame.h @@ -25,64 +25,6 @@ namespace android { -// A simple buffer to hold binary data -class MediaAlbumArt -{ -public: - MediaAlbumArt(): mSize(0), mData(0) {} - - explicit MediaAlbumArt(const char* url) { - mSize = 0; - mData = NULL; - FILE *in = fopen(url, "r"); - if (!in) { - return; - } - fseek(in, 0, SEEK_END); - mSize = ftell(in); // Allocating buffer of size equals to the external file size. - if (mSize == 0 || (mData = new uint8_t[mSize]) == NULL) { - fclose(in); - if (mSize != 0) { - mSize = 0; - } - return; - } - rewind(in); - if (fread(mData, 1, mSize, in) != mSize) { // Read failed. - delete[] mData; - mData = NULL; - mSize = 0; - return; - } - fclose(in); - } - - MediaAlbumArt(const MediaAlbumArt& copy) { - mSize = copy.mSize; - mData = NULL; // initialize it first - if (mSize > 0 && copy.mData != NULL) { - mData = new uint8_t[copy.mSize]; - if (mData != NULL) { - memcpy(mData, copy.mData, mSize); - } else { - mSize = 0; - } - } - } - - ~MediaAlbumArt() { - if (mData != 0) { - delete[] mData; - } - } - - // Intentional public access modifier: - // We have to know the internal structure in order to share it between - // processes? - uint32_t mSize; // Number of bytes in mData - uint8_t* mData; // Actual binary data -}; - // Represents a color converted (RGB-based) video frame // with bitmap pixels stored in FrameBuffer class VideoFrame |