diff options
author | James Dong <jdong@google.com> | 2010-12-02 17:42:08 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-01-12 17:12:46 -0800 |
commit | 95304d5488ba465f19cc788f1c7394218c2ea2d1 (patch) | |
tree | 5f5269238a292e0e747cbfa2a01e6a2fb24615b8 /media/libmedia | |
parent | e49051406baa71cb63d5754d33908ce3df201af1 (diff) | |
download | frameworks_av-95304d5488ba465f19cc788f1c7394218c2ea2d1.zip frameworks_av-95304d5488ba465f19cc788f1c7394218c2ea2d1.tar.gz frameworks_av-95304d5488ba465f19cc788f1c7394218c2ea2d1.tar.bz2 |
Squash commits of the following patches, cherry-picked from other branch - do not merge.
o Prepare for publishing MediaMetadataRetriever as public API
step one:
o replaced captureFrame with getFrameAtTime
o removed getMode
o Replace MediaMetadataRetriever.captureFrame() with MediaMetadataRetriever.getFrameAtTime()
as part of the preparation for publishing MediaMetadataRetriever as public Java API
o Remove captureFrame from MediaMetadataRetriever.java class
It has been replaced by getFrameAtTime() method
o Replace extractAlbumArt() with getEmbeddedPicture() in MediaMetadataRetriever.java
o Publish MediaMetadataRetriever.java as public API
o Removed setMode() methods and related mode constants
o Removed some of the unused the metadata keys
o Updated the javadoc
o part of a multi-project change.
bug - 3309041
Change-Id: I2efb6e8b8d52897186b016cb4efda6862f5584c4
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/IMediaMetadataRetriever.cpp | 50 | ||||
-rw-r--r-- | media/libmedia/mediametadataretriever.cpp | 28 |
2 files changed, 14 insertions, 64 deletions
diff --git a/media/libmedia/IMediaMetadataRetriever.cpp b/media/libmedia/IMediaMetadataRetriever.cpp index e529d25..d5298c9 100644 --- a/media/libmedia/IMediaMetadataRetriever.cpp +++ b/media/libmedia/IMediaMetadataRetriever.cpp @@ -81,9 +81,7 @@ enum { DISCONNECT = IBinder::FIRST_CALL_TRANSACTION, SET_DATA_SOURCE_URL, SET_DATA_SOURCE_FD, - SET_MODE, - GET_MODE, - CAPTURE_FRAME, + GET_FRAME_AT_TIME, EXTRACT_ALBUM_ART, EXTRACT_METADATA, }; @@ -124,32 +122,17 @@ public: return reply.readInt32(); } - status_t setMode(int mode) - { - Parcel data, reply; - data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor()); - data.writeInt32(mode); - remote()->transact(SET_MODE, data, &reply); - return reply.readInt32(); - } - - status_t getMode(int* mode) const - { - Parcel data, reply; - data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor()); - remote()->transact(GET_MODE, data, &reply); - *mode = reply.readInt32(); - return reply.readInt32(); - } - - sp<IMemory> captureFrame() + sp<IMemory> getFrameAtTime(int64_t timeUs, int option) { + LOGV("getTimeAtTime: time(%lld us) and option(%d)", timeUs, option); Parcel data, reply; data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor()); + data.writeInt64(timeUs); + data.writeInt32(option); #ifndef DISABLE_GROUP_SCHEDULE_HACK sendSchedPolicy(data); #endif - remote()->transact(CAPTURE_FRAME, data, &reply); + remote()->transact(GET_FRAME_AT_TIME, data, &reply); status_t ret = reply.readInt32(); if (ret != NO_ERROR) { return NULL; @@ -216,26 +199,15 @@ status_t BnMediaMetadataRetriever::onTransact( reply->writeInt32(setDataSource(fd, offset, length)); return NO_ERROR; } break; - case SET_MODE: { - CHECK_INTERFACE(IMediaMetadataRetriever, data, reply); - int mode = data.readInt32(); - reply->writeInt32(setMode(mode)); - return NO_ERROR; - } break; - case GET_MODE: { - CHECK_INTERFACE(IMediaMetadataRetriever, data, reply); - int mode; - status_t status = getMode(&mode); - reply->writeInt32(mode); - reply->writeInt32(status); - return NO_ERROR; - } break; - case CAPTURE_FRAME: { + case GET_FRAME_AT_TIME: { CHECK_INTERFACE(IMediaMetadataRetriever, data, reply); + int64_t timeUs = data.readInt64(); + int option = data.readInt32(); + LOGV("getTimeAtTime: time(%lld us) and option(%d)", timeUs, option); #ifndef DISABLE_GROUP_SCHEDULE_HACK setSchedPolicy(data); #endif - sp<IMemory> bitmap = captureFrame(); + sp<IMemory> bitmap = getFrameAtTime(timeUs, option); if (bitmap != 0) { // Don't send NULL across the binder interface reply->writeInt32(NO_ERROR); reply->writeStrongBinder(bitmap->asBinder()); diff --git a/media/libmedia/mediametadataretriever.cpp b/media/libmedia/mediametadataretriever.cpp index e2712ba..8dfcb3b 100644 --- a/media/libmedia/mediametadataretriever.cpp +++ b/media/libmedia/mediametadataretriever.cpp @@ -123,37 +123,15 @@ status_t MediaMetadataRetriever::setDataSource(int fd, int64_t offset, int64_t l return mRetriever->setDataSource(fd, offset, length); } -status_t MediaMetadataRetriever::setMode(int mode) +sp<IMemory> MediaMetadataRetriever::getFrameAtTime(int64_t timeUs, int option) { - LOGV("setMode(%d)", mode); - Mutex::Autolock _l(mLock); - if (mRetriever == 0) { - LOGE("retriever is not initialized"); - return INVALID_OPERATION; - } - return mRetriever->setMode(mode); -} - -status_t MediaMetadataRetriever::getMode(int* mode) -{ - LOGV("getMode"); - Mutex::Autolock _l(mLock); - if (mRetriever == 0) { - LOGE("retriever is not initialized"); - return INVALID_OPERATION; - } - return mRetriever->getMode(mode); -} - -sp<IMemory> MediaMetadataRetriever::captureFrame() -{ - LOGV("captureFrame"); + LOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option); Mutex::Autolock _l(mLock); if (mRetriever == 0) { LOGE("retriever is not initialized"); return NULL; } - return mRetriever->captureFrame(); + return mRetriever->getFrameAtTime(timeUs, option); } const char* MediaMetadataRetriever::extractMetadata(int keyCode) |