summaryrefslogtreecommitdiffstats
path: root/media/libmedia/IMediaMetadataRetriever.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-12-02 17:42:08 -0800
committerJames Dong <jdong@google.com>2010-12-03 15:32:47 -0800
commit16afe2fb439cab6125bb46a07a8078d4ce1c1ea5 (patch)
tree146e5ad9abfa370d35b2a8912a4887356764b1e2 /media/libmedia/IMediaMetadataRetriever.cpp
parent1cc73922339a110d7ffc47e8842f958492dd85bf (diff)
downloadframeworks_av-16afe2fb439cab6125bb46a07a8078d4ce1c1ea5.zip
frameworks_av-16afe2fb439cab6125bb46a07a8078d4ce1c1ea5.tar.gz
frameworks_av-16afe2fb439cab6125bb46a07a8078d4ce1c1ea5.tar.bz2
Prepare for publishing MediaMetadataRetriever as public API
step one: o replaced captureFrame with getFrameAtTime o removed getMode bug - 2433195 Change-Id: I38a8cecef29014692f0b08b8818326e3ebb40a12
Diffstat (limited to 'media/libmedia/IMediaMetadataRetriever.cpp')
-rw-r--r--media/libmedia/IMediaMetadataRetriever.cpp34
1 files changed, 11 insertions, 23 deletions
diff --git a/media/libmedia/IMediaMetadataRetriever.cpp b/media/libmedia/IMediaMetadataRetriever.cpp
index e529d25..0193e25 100644
--- a/media/libmedia/IMediaMetadataRetriever.cpp
+++ b/media/libmedia/IMediaMetadataRetriever.cpp
@@ -82,8 +82,7 @@ enum {
SET_DATA_SOURCE_URL,
SET_DATA_SOURCE_FD,
SET_MODE,
- GET_MODE,
- CAPTURE_FRAME,
+ GET_FRAME_AT_TIME,
EXTRACT_ALBUM_ART,
EXTRACT_METADATA,
};
@@ -133,23 +132,17 @@ public:
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;
@@ -222,20 +215,15 @@ status_t BnMediaMetadataRetriever::onTransact(
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());