Loading include/media/OMXBuffer.h +35 −4 Original line number Diff line number Diff line Loading @@ -24,12 +24,27 @@ namespace android { class OMXBuffer; // This is needed temporarily for the OMX HIDL transition. namespace hardware { namespace media { namespace omx { namespace V1_0 { struct CodecBuffer; namespace implementation { inline bool wrapAs(::android::hardware::media::omx::V1_0::CodecBuffer* t, ::android::OMXBuffer const& l); inline bool convertTo(::android::OMXBuffer* l, ::android::hardware::media::omx::V1_0::CodecBuffer const& t); }}}}} class GraphicBuffer; class IMemory; class MediaCodecBuffer; class NativeHandle; class OMXNodeInstance; struct OMXNodeInstance; // TODO: After complete HIDL transition, this class would be replaced by // CodecBuffer. class OMXBuffer { public: // sPreset is used in places where we are referring to a pre-registered Loading @@ -43,6 +58,10 @@ public: // |codecBuffer|'s size (or 0 if |codecBuffer| is NULL). OMXBuffer(const sp<MediaCodecBuffer> &codecBuffer); // Constructs a buffer of type kBufferTypePreset with a specified // mRangeLength. explicit OMXBuffer(OMX_U32 rangeLength); // Constructs a buffer of type kBufferTypeSharedMem. OMXBuffer(const sp<IMemory> &mem); Loading @@ -59,7 +78,15 @@ public: ~OMXBuffer(); private: friend class OMXNodeInstance; friend struct OMXNodeInstance; // This is needed temporarily for OMX HIDL transition. friend inline bool (::android::hardware::media::omx::V1_0::implementation:: wrapAs)(::android::hardware::media::omx::V1_0::CodecBuffer* t, OMXBuffer const& l); friend inline bool (::android::hardware::media::omx::V1_0::implementation:: convertTo)(OMXBuffer* l, ::android::hardware::media::omx::V1_0::CodecBuffer const& t); enum BufferType { kBufferTypeInvalid = 0, Loading @@ -85,8 +112,12 @@ private: // kBufferTypeNativeHandle sp<NativeHandle> mNativeHandle; OMXBuffer(const OMXBuffer &); OMXBuffer &operator=(const OMXBuffer &); // Move assignment OMXBuffer &operator=(OMXBuffer&&); // Deleted copy constructor and assignment. OMXBuffer(const OMXBuffer&) = delete; OMXBuffer& operator=(const OMXBuffer&) = delete; }; } // namespace android Loading include/media/OMXFenceParcelable.h +20 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,18 @@ namespace android { struct OMXFenceParcelable; // This is needed temporarily for the OMX HIDL transition. namespace hardware { struct hidl_handle; namespace media { namespace omx { namespace V1_0 { namespace implementation { void wrapAs(::android::OMXFenceParcelable* l, ::android::hardware::hidl_handle const& t); bool convertTo(::android::OMXFenceParcelable* l, ::android::hardware::hidl_handle const& t); }}}}} struct OMXFenceParcelable : public Parcelable { OMXFenceParcelable() : mFenceFd(-1) {} OMXFenceParcelable(int fenceFd) : mFenceFd(fenceFd) {} Loading @@ -36,6 +48,14 @@ private: OMXFenceParcelable &operator=(const OMXFenceParcelable &); int mFenceFd; // This is needed temporarily for OMX HIDL transition. friend void (::android::hardware::media::omx::V1_0::implementation:: wrapAs)(OMXFenceParcelable* l, ::android::hardware::hidl_handle const& t); friend bool (::android::hardware::media::omx::V1_0::implementation:: convertTo)(OMXFenceParcelable* l, ::android::hardware::hidl_handle const& t); }; inline status_t OMXFenceParcelable::readFromParcel(const Parcel* parcel) { Loading media/libmedia/OMXBuffer.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,11 @@ OMXBuffer::OMXBuffer(const sp<MediaCodecBuffer>& codecBuffer) mRangeLength(codecBuffer != NULL ? codecBuffer->size() : 0) { } OMXBuffer::OMXBuffer(OMX_U32 rangeLength) : mBufferType(kBufferTypePreset), mRangeLength(rangeLength) { } OMXBuffer::OMXBuffer(const sp<IMemory> &mem) : mBufferType(kBufferTypeSharedMem), mMem(mem) { Loading Loading @@ -133,6 +138,15 @@ status_t OMXBuffer::readFromParcel(const Parcel *parcel) { return OK; } OMXBuffer& OMXBuffer::operator=(OMXBuffer&& source) { mBufferType = std::move(source.mBufferType); mRangeLength = std::move(source.mRangeLength); mMem = std::move(source.mMem); mGraphicBuffer = std::move(source.mGraphicBuffer); mNativeHandle = std::move(source.mNativeHandle); return *this; } } // namespace android Loading media/libstagefright/omx/hal/1.0/Android.mk +19 −3 Original line number Diff line number Diff line Loading @@ -4,19 +4,35 @@ include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.media.omx@1.0-impl LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := \ GraphicBufferSource.cpp \ WGraphicBufferSource.cpp \ WOmx.cpp \ WOmxBufferSource.cpp \ WOmxNode.cpp \ WOmxObserver.cpp \ Omx.cpp \ OmxBufferSource.cpp \ OmxNode.cpp \ OmxObserver.cpp \ LOCAL_SHARED_LIBRARIES := \ libmedia \ libstagefright_foundation \ libstagefright_omx \ libui \ libhidlbase \ libhidltransport \ libhwbinder \ libutils \ libcutils \ libbinder \ android.hardware.media.omx@1.0 \ android.hardware.graphics.common@1.0 \ android.hardware.media@1.0 \ android.hidl.base@1.0 \ LOCAL_C_INCLUDES += \ $(TOP) \ $(TOP)/frameworks/av/include/media \ $(TOP)/frameworks/av/media/libstagefright/include \ $(TOP)/frameworks/native/include/media/hardware \ $(TOP)/frameworks/native/include/media/openmax include $(BUILD_SHARED_LIBRARY) Loading
include/media/OMXBuffer.h +35 −4 Original line number Diff line number Diff line Loading @@ -24,12 +24,27 @@ namespace android { class OMXBuffer; // This is needed temporarily for the OMX HIDL transition. namespace hardware { namespace media { namespace omx { namespace V1_0 { struct CodecBuffer; namespace implementation { inline bool wrapAs(::android::hardware::media::omx::V1_0::CodecBuffer* t, ::android::OMXBuffer const& l); inline bool convertTo(::android::OMXBuffer* l, ::android::hardware::media::omx::V1_0::CodecBuffer const& t); }}}}} class GraphicBuffer; class IMemory; class MediaCodecBuffer; class NativeHandle; class OMXNodeInstance; struct OMXNodeInstance; // TODO: After complete HIDL transition, this class would be replaced by // CodecBuffer. class OMXBuffer { public: // sPreset is used in places where we are referring to a pre-registered Loading @@ -43,6 +58,10 @@ public: // |codecBuffer|'s size (or 0 if |codecBuffer| is NULL). OMXBuffer(const sp<MediaCodecBuffer> &codecBuffer); // Constructs a buffer of type kBufferTypePreset with a specified // mRangeLength. explicit OMXBuffer(OMX_U32 rangeLength); // Constructs a buffer of type kBufferTypeSharedMem. OMXBuffer(const sp<IMemory> &mem); Loading @@ -59,7 +78,15 @@ public: ~OMXBuffer(); private: friend class OMXNodeInstance; friend struct OMXNodeInstance; // This is needed temporarily for OMX HIDL transition. friend inline bool (::android::hardware::media::omx::V1_0::implementation:: wrapAs)(::android::hardware::media::omx::V1_0::CodecBuffer* t, OMXBuffer const& l); friend inline bool (::android::hardware::media::omx::V1_0::implementation:: convertTo)(OMXBuffer* l, ::android::hardware::media::omx::V1_0::CodecBuffer const& t); enum BufferType { kBufferTypeInvalid = 0, Loading @@ -85,8 +112,12 @@ private: // kBufferTypeNativeHandle sp<NativeHandle> mNativeHandle; OMXBuffer(const OMXBuffer &); OMXBuffer &operator=(const OMXBuffer &); // Move assignment OMXBuffer &operator=(OMXBuffer&&); // Deleted copy constructor and assignment. OMXBuffer(const OMXBuffer&) = delete; OMXBuffer& operator=(const OMXBuffer&) = delete; }; } // namespace android Loading
include/media/OMXFenceParcelable.h +20 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,18 @@ namespace android { struct OMXFenceParcelable; // This is needed temporarily for the OMX HIDL transition. namespace hardware { struct hidl_handle; namespace media { namespace omx { namespace V1_0 { namespace implementation { void wrapAs(::android::OMXFenceParcelable* l, ::android::hardware::hidl_handle const& t); bool convertTo(::android::OMXFenceParcelable* l, ::android::hardware::hidl_handle const& t); }}}}} struct OMXFenceParcelable : public Parcelable { OMXFenceParcelable() : mFenceFd(-1) {} OMXFenceParcelable(int fenceFd) : mFenceFd(fenceFd) {} Loading @@ -36,6 +48,14 @@ private: OMXFenceParcelable &operator=(const OMXFenceParcelable &); int mFenceFd; // This is needed temporarily for OMX HIDL transition. friend void (::android::hardware::media::omx::V1_0::implementation:: wrapAs)(OMXFenceParcelable* l, ::android::hardware::hidl_handle const& t); friend bool (::android::hardware::media::omx::V1_0::implementation:: convertTo)(OMXFenceParcelable* l, ::android::hardware::hidl_handle const& t); }; inline status_t OMXFenceParcelable::readFromParcel(const Parcel* parcel) { Loading
media/libmedia/OMXBuffer.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,11 @@ OMXBuffer::OMXBuffer(const sp<MediaCodecBuffer>& codecBuffer) mRangeLength(codecBuffer != NULL ? codecBuffer->size() : 0) { } OMXBuffer::OMXBuffer(OMX_U32 rangeLength) : mBufferType(kBufferTypePreset), mRangeLength(rangeLength) { } OMXBuffer::OMXBuffer(const sp<IMemory> &mem) : mBufferType(kBufferTypeSharedMem), mMem(mem) { Loading Loading @@ -133,6 +138,15 @@ status_t OMXBuffer::readFromParcel(const Parcel *parcel) { return OK; } OMXBuffer& OMXBuffer::operator=(OMXBuffer&& source) { mBufferType = std::move(source.mBufferType); mRangeLength = std::move(source.mRangeLength); mMem = std::move(source.mMem); mGraphicBuffer = std::move(source.mGraphicBuffer); mNativeHandle = std::move(source.mNativeHandle); return *this; } } // namespace android Loading
media/libstagefright/omx/hal/1.0/Android.mk +19 −3 Original line number Diff line number Diff line Loading @@ -4,19 +4,35 @@ include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.media.omx@1.0-impl LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := \ GraphicBufferSource.cpp \ WGraphicBufferSource.cpp \ WOmx.cpp \ WOmxBufferSource.cpp \ WOmxNode.cpp \ WOmxObserver.cpp \ Omx.cpp \ OmxBufferSource.cpp \ OmxNode.cpp \ OmxObserver.cpp \ LOCAL_SHARED_LIBRARIES := \ libmedia \ libstagefright_foundation \ libstagefright_omx \ libui \ libhidlbase \ libhidltransport \ libhwbinder \ libutils \ libcutils \ libbinder \ android.hardware.media.omx@1.0 \ android.hardware.graphics.common@1.0 \ android.hardware.media@1.0 \ android.hidl.base@1.0 \ LOCAL_C_INCLUDES += \ $(TOP) \ $(TOP)/frameworks/av/include/media \ $(TOP)/frameworks/av/media/libstagefright/include \ $(TOP)/frameworks/native/include/media/hardware \ $(TOP)/frameworks/native/include/media/openmax include $(BUILD_SHARED_LIBRARY)