Loading include/media/IOMX.h +11 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ class IMemory; class IOMXObserver; class IOMXRenderer; class ISurface; class Surface; class IOMX : public IInterface { public: Loading Loading @@ -87,6 +88,16 @@ public: OMX_COLOR_FORMATTYPE colorFormat, size_t encodedWidth, size_t encodedHeight, size_t displayWidth, size_t displayHeight) = 0; // Note: This method is _not_ virtual, it exists as a wrapper around // the virtual "createRenderer" method above facilitating extraction // of the ISurface from a regular Surface. sp<IOMXRenderer> createRenderer( const sp<Surface> &surface, const char *componentName, OMX_COLOR_FORMATTYPE colorFormat, size_t encodedWidth, size_t encodedHeight, size_t displayWidth, size_t displayHeight); }; struct omx_message { Loading media/libmedia/IOMX.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #include <binder/Parcel.h> #include <media/IOMX.h> #include <ui/ISurface.h> #include <ui/Surface.h> namespace android { Loading @@ -29,6 +30,18 @@ enum { RENDERER_RENDER, }; sp<IOMXRenderer> IOMX::createRenderer( const sp<Surface> &surface, const char *componentName, OMX_COLOR_FORMATTYPE colorFormat, size_t encodedWidth, size_t encodedHeight, size_t displayWidth, size_t displayHeight) { return createRenderer( surface->getISurface(), componentName, colorFormat, encodedWidth, encodedHeight, displayWidth, displayHeight); } static void *readVoidStar(const Parcel *parcel) { // FIX if sizeof(void *) != sizeof(int32) return (void *)parcel->readInt32(); Loading media/libstagefright/MediaPlayerImpl.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -646,15 +646,21 @@ void MediaPlayerImpl::populateISurface() { success = success && meta->findInt32(kKeyHeight, &decodedHeight); assert(success); const sp<ISurface> &isurface = mSurface.get() != NULL ? mSurface->getISurface() : mISurface; if (mSurface.get() != NULL) { mVideoRenderer = mClient.interface()->createRenderer( isurface, component, mSurface, component, (OMX_COLOR_FORMATTYPE)format, decodedWidth, decodedHeight, mVideoWidth, mVideoHeight); } else { mVideoRenderer = mClient.interface()->createRenderer( mISurface, component, (OMX_COLOR_FORMATTYPE)format, decodedWidth, decodedHeight, mVideoWidth, mVideoHeight); } } void MediaPlayerImpl::depopulateISurface() { Loading Loading
include/media/IOMX.h +11 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ class IMemory; class IOMXObserver; class IOMXRenderer; class ISurface; class Surface; class IOMX : public IInterface { public: Loading Loading @@ -87,6 +88,16 @@ public: OMX_COLOR_FORMATTYPE colorFormat, size_t encodedWidth, size_t encodedHeight, size_t displayWidth, size_t displayHeight) = 0; // Note: This method is _not_ virtual, it exists as a wrapper around // the virtual "createRenderer" method above facilitating extraction // of the ISurface from a regular Surface. sp<IOMXRenderer> createRenderer( const sp<Surface> &surface, const char *componentName, OMX_COLOR_FORMATTYPE colorFormat, size_t encodedWidth, size_t encodedHeight, size_t displayWidth, size_t displayHeight); }; struct omx_message { Loading
media/libmedia/IOMX.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #include <binder/Parcel.h> #include <media/IOMX.h> #include <ui/ISurface.h> #include <ui/Surface.h> namespace android { Loading @@ -29,6 +30,18 @@ enum { RENDERER_RENDER, }; sp<IOMXRenderer> IOMX::createRenderer( const sp<Surface> &surface, const char *componentName, OMX_COLOR_FORMATTYPE colorFormat, size_t encodedWidth, size_t encodedHeight, size_t displayWidth, size_t displayHeight) { return createRenderer( surface->getISurface(), componentName, colorFormat, encodedWidth, encodedHeight, displayWidth, displayHeight); } static void *readVoidStar(const Parcel *parcel) { // FIX if sizeof(void *) != sizeof(int32) return (void *)parcel->readInt32(); Loading
media/libstagefright/MediaPlayerImpl.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -646,15 +646,21 @@ void MediaPlayerImpl::populateISurface() { success = success && meta->findInt32(kKeyHeight, &decodedHeight); assert(success); const sp<ISurface> &isurface = mSurface.get() != NULL ? mSurface->getISurface() : mISurface; if (mSurface.get() != NULL) { mVideoRenderer = mClient.interface()->createRenderer( isurface, component, mSurface, component, (OMX_COLOR_FORMATTYPE)format, decodedWidth, decodedHeight, mVideoWidth, mVideoHeight); } else { mVideoRenderer = mClient.interface()->createRenderer( mISurface, component, (OMX_COLOR_FORMATTYPE)format, decodedWidth, decodedHeight, mVideoWidth, mVideoHeight); } } void MediaPlayerImpl::depopulateISurface() { Loading