Loading cmds/stagefright/stagefright.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -870,7 +870,9 @@ int main(int argc, char **argv) { sp<IMemory> mem = retriever->getFrameAtTime(-1, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC); MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC, HAL_PIXEL_FORMAT_RGB_565, false /*metaOnly*/); if (mem != NULL) { failed = false; Loading media/libmedia/IMediaMetadataRetriever.cpp +24 −6 Original line number Diff line number Diff line Loading @@ -127,22 +127,32 @@ public: return reply.readInt32(); } status_t setDataSource(const sp<IDataSource>& source) status_t setDataSource(const sp<IDataSource>& source, const char *mime) { Parcel data, reply; data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor()); data.writeStrongBinder(IInterface::asBinder(source)); if (mime != NULL) { data.writeInt32(1); data.writeCString(mime); } else { data.writeInt32(0); } remote()->transact(SET_DATA_SOURCE_CALLBACK, data, &reply); return reply.readInt32(); } sp<IMemory> getFrameAtTime(int64_t timeUs, int option) sp<IMemory> getFrameAtTime(int64_t timeUs, int option, int colorFormat, bool metaOnly) { ALOGV("getTimeAtTime: time(%" PRId64 " us) and option(%d)", timeUs, option); ALOGV("getTimeAtTime: time(%" PRId64 " us), option(%d), colorFormat(%d) metaOnly(%d)", timeUs, option, colorFormat, metaOnly); Parcel data, reply; data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor()); data.writeInt64(timeUs); data.writeInt32(option); data.writeInt32(colorFormat); data.writeInt32(metaOnly); #ifndef DISABLE_GROUP_SCHEDULE_HACK sendSchedPolicy(data); #endif Loading Loading @@ -258,7 +268,12 @@ status_t BnMediaMetadataRetriever::onTransact( if (source == NULL) { reply->writeInt32(BAD_VALUE); } else { reply->writeInt32(setDataSource(source)); int32_t hasMime = data.readInt32(); const char *mime = NULL; if (hasMime) { mime = data.readCString(); } reply->writeInt32(setDataSource(source, mime)); } return NO_ERROR; } break; Loading @@ -266,11 +281,14 @@ status_t BnMediaMetadataRetriever::onTransact( CHECK_INTERFACE(IMediaMetadataRetriever, data, reply); int64_t timeUs = data.readInt64(); int option = data.readInt32(); ALOGV("getTimeAtTime: time(%" PRId64 " us) and option(%d)", timeUs, option); int colorFormat = data.readInt32(); bool metaOnly = (data.readInt32() != 0); ALOGV("getTimeAtTime: time(%" PRId64 " us), option(%d), colorFormat(%d), metaOnly(%d)", timeUs, option, colorFormat, metaOnly); #ifndef DISABLE_GROUP_SCHEDULE_HACK setSchedPolicy(data); #endif sp<IMemory> bitmap = getFrameAtTime(timeUs, option); sp<IMemory> bitmap = getFrameAtTime(timeUs, option, colorFormat, metaOnly); if (bitmap != 0) { // Don't send NULL across the binder interface reply->writeInt32(NO_ERROR); reply->writeStrongBinder(IInterface::asBinder(bitmap)); Loading media/libmedia/include/media/IMediaMetadataRetriever.h +5 −4 Original line number Diff line number Diff line Loading @@ -19,13 +19,12 @@ #define ANDROID_IMEDIAMETADATARETRIEVER_H #include <binder/IInterface.h> #include <binder/Parcel.h> #include <binder/IMemory.h> #include <utils/KeyedVector.h> #include <utils/RefBase.h> namespace android { class Parcel; class IDataSource; struct IMediaHTTPService; Loading @@ -41,8 +40,10 @@ public: const KeyedVector<String8, String8> *headers = NULL) = 0; virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; virtual status_t setDataSource(const sp<IDataSource>& dataSource) = 0; virtual sp<IMemory> getFrameAtTime(int64_t timeUs, int option) = 0; virtual status_t setDataSource( const sp<IDataSource>& dataSource, const char *mime) = 0; virtual sp<IMemory> getFrameAtTime( int64_t timeUs, int option, int colorFormat, bool metaOnly) = 0; virtual sp<IMemory> extractAlbumArt() = 0; virtual const char* extractMetadata(int keyCode) = 0; }; Loading media/libmedia/include/media/MediaMetadataRetrieverInterface.h +6 −3 Original line number Diff line number Diff line Loading @@ -41,8 +41,9 @@ public: const KeyedVector<String8, String8> *headers = NULL) = 0; virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; virtual status_t setDataSource(const sp<DataSource>& source) = 0; virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) = 0; virtual status_t setDataSource(const sp<DataSource>& source, const char *mime) = 0; virtual VideoFrame* getFrameAtTime( int64_t timeUs, int option, int colorFormat, bool metaOnly) = 0; virtual MediaAlbumArt* extractAlbumArt() = 0; virtual const char* extractMetadata(int keyCode) = 0; }; Loading @@ -54,7 +55,9 @@ public: MediaMetadataRetrieverInterface() {} virtual ~MediaMetadataRetrieverInterface() {} virtual VideoFrame* getFrameAtTime(int64_t /*timeUs*/, int /*option*/) { return NULL; } virtual VideoFrame* getFrameAtTime( int64_t /*timeUs*/, int /*option*/, int /*colorFormat*/, bool /*metaOnly*/) { return NULL; } virtual MediaAlbumArt* extractAlbumArt() { return NULL; } virtual const char* extractMetadata(int /*keyCode*/) { return NULL; } }; Loading media/libmedia/include/media/mediametadataretriever.h +4 −2 Original line number Diff line number Diff line Loading @@ -76,8 +76,10 @@ public: const KeyedVector<String8, String8> *headers = NULL); status_t setDataSource(int fd, int64_t offset, int64_t length); status_t setDataSource(const sp<IDataSource>& dataSource); sp<IMemory> getFrameAtTime(int64_t timeUs, int option); status_t setDataSource( const sp<IDataSource>& dataSource, const char *mime = NULL); sp<IMemory> getFrameAtTime(int64_t timeUs, int option, int colorFormat = 0, bool metaOnly = false); sp<IMemory> extractAlbumArt(); const char* extractMetadata(int keyCode); Loading Loading
cmds/stagefright/stagefright.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -870,7 +870,9 @@ int main(int argc, char **argv) { sp<IMemory> mem = retriever->getFrameAtTime(-1, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC); MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC, HAL_PIXEL_FORMAT_RGB_565, false /*metaOnly*/); if (mem != NULL) { failed = false; Loading
media/libmedia/IMediaMetadataRetriever.cpp +24 −6 Original line number Diff line number Diff line Loading @@ -127,22 +127,32 @@ public: return reply.readInt32(); } status_t setDataSource(const sp<IDataSource>& source) status_t setDataSource(const sp<IDataSource>& source, const char *mime) { Parcel data, reply; data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor()); data.writeStrongBinder(IInterface::asBinder(source)); if (mime != NULL) { data.writeInt32(1); data.writeCString(mime); } else { data.writeInt32(0); } remote()->transact(SET_DATA_SOURCE_CALLBACK, data, &reply); return reply.readInt32(); } sp<IMemory> getFrameAtTime(int64_t timeUs, int option) sp<IMemory> getFrameAtTime(int64_t timeUs, int option, int colorFormat, bool metaOnly) { ALOGV("getTimeAtTime: time(%" PRId64 " us) and option(%d)", timeUs, option); ALOGV("getTimeAtTime: time(%" PRId64 " us), option(%d), colorFormat(%d) metaOnly(%d)", timeUs, option, colorFormat, metaOnly); Parcel data, reply; data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor()); data.writeInt64(timeUs); data.writeInt32(option); data.writeInt32(colorFormat); data.writeInt32(metaOnly); #ifndef DISABLE_GROUP_SCHEDULE_HACK sendSchedPolicy(data); #endif Loading Loading @@ -258,7 +268,12 @@ status_t BnMediaMetadataRetriever::onTransact( if (source == NULL) { reply->writeInt32(BAD_VALUE); } else { reply->writeInt32(setDataSource(source)); int32_t hasMime = data.readInt32(); const char *mime = NULL; if (hasMime) { mime = data.readCString(); } reply->writeInt32(setDataSource(source, mime)); } return NO_ERROR; } break; Loading @@ -266,11 +281,14 @@ status_t BnMediaMetadataRetriever::onTransact( CHECK_INTERFACE(IMediaMetadataRetriever, data, reply); int64_t timeUs = data.readInt64(); int option = data.readInt32(); ALOGV("getTimeAtTime: time(%" PRId64 " us) and option(%d)", timeUs, option); int colorFormat = data.readInt32(); bool metaOnly = (data.readInt32() != 0); ALOGV("getTimeAtTime: time(%" PRId64 " us), option(%d), colorFormat(%d), metaOnly(%d)", timeUs, option, colorFormat, metaOnly); #ifndef DISABLE_GROUP_SCHEDULE_HACK setSchedPolicy(data); #endif sp<IMemory> bitmap = getFrameAtTime(timeUs, option); sp<IMemory> bitmap = getFrameAtTime(timeUs, option, colorFormat, metaOnly); if (bitmap != 0) { // Don't send NULL across the binder interface reply->writeInt32(NO_ERROR); reply->writeStrongBinder(IInterface::asBinder(bitmap)); Loading
media/libmedia/include/media/IMediaMetadataRetriever.h +5 −4 Original line number Diff line number Diff line Loading @@ -19,13 +19,12 @@ #define ANDROID_IMEDIAMETADATARETRIEVER_H #include <binder/IInterface.h> #include <binder/Parcel.h> #include <binder/IMemory.h> #include <utils/KeyedVector.h> #include <utils/RefBase.h> namespace android { class Parcel; class IDataSource; struct IMediaHTTPService; Loading @@ -41,8 +40,10 @@ public: const KeyedVector<String8, String8> *headers = NULL) = 0; virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; virtual status_t setDataSource(const sp<IDataSource>& dataSource) = 0; virtual sp<IMemory> getFrameAtTime(int64_t timeUs, int option) = 0; virtual status_t setDataSource( const sp<IDataSource>& dataSource, const char *mime) = 0; virtual sp<IMemory> getFrameAtTime( int64_t timeUs, int option, int colorFormat, bool metaOnly) = 0; virtual sp<IMemory> extractAlbumArt() = 0; virtual const char* extractMetadata(int keyCode) = 0; }; Loading
media/libmedia/include/media/MediaMetadataRetrieverInterface.h +6 −3 Original line number Diff line number Diff line Loading @@ -41,8 +41,9 @@ public: const KeyedVector<String8, String8> *headers = NULL) = 0; virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; virtual status_t setDataSource(const sp<DataSource>& source) = 0; virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) = 0; virtual status_t setDataSource(const sp<DataSource>& source, const char *mime) = 0; virtual VideoFrame* getFrameAtTime( int64_t timeUs, int option, int colorFormat, bool metaOnly) = 0; virtual MediaAlbumArt* extractAlbumArt() = 0; virtual const char* extractMetadata(int keyCode) = 0; }; Loading @@ -54,7 +55,9 @@ public: MediaMetadataRetrieverInterface() {} virtual ~MediaMetadataRetrieverInterface() {} virtual VideoFrame* getFrameAtTime(int64_t /*timeUs*/, int /*option*/) { return NULL; } virtual VideoFrame* getFrameAtTime( int64_t /*timeUs*/, int /*option*/, int /*colorFormat*/, bool /*metaOnly*/) { return NULL; } virtual MediaAlbumArt* extractAlbumArt() { return NULL; } virtual const char* extractMetadata(int /*keyCode*/) { return NULL; } }; Loading
media/libmedia/include/media/mediametadataretriever.h +4 −2 Original line number Diff line number Diff line Loading @@ -76,8 +76,10 @@ public: const KeyedVector<String8, String8> *headers = NULL); status_t setDataSource(int fd, int64_t offset, int64_t length); status_t setDataSource(const sp<IDataSource>& dataSource); sp<IMemory> getFrameAtTime(int64_t timeUs, int option); status_t setDataSource( const sp<IDataSource>& dataSource, const char *mime = NULL); sp<IMemory> getFrameAtTime(int64_t timeUs, int option, int colorFormat = 0, bool metaOnly = false); sp<IMemory> extractAlbumArt(); const char* extractMetadata(int keyCode); Loading