From 16afe2fb439cab6125bb46a07a8078d4ce1c1ea5 Mon Sep 17 00:00:00 2001 From: James Dong Date: Thu, 2 Dec 2010 17:42:08 -0800 Subject: Prepare for publishing MediaMetadataRetriever as public API step one: o replaced captureFrame with getFrameAtTime o removed getMode bug - 2433195 Change-Id: I38a8cecef29014692f0b08b8818326e3ebb40a12 --- media/libmedia/IMediaMetadataRetriever.cpp | 34 ++++++++++-------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'media/libmedia/IMediaMetadataRetriever.cpp') 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 captureFrame() + sp 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 bitmap = captureFrame(); + sp bitmap = getFrameAtTime(timeUs, option); if (bitmap != 0) { // Don't send NULL across the binder interface reply->writeInt32(NO_ERROR); reply->writeStrongBinder(bitmap->asBinder()); -- cgit v1.1