Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eeac97b1 authored by Pawin Vongmasa's avatar Pawin Vongmasa
Browse files

Split Treble conversion module into two sides: impl and utils.

impl is on the HAL side. utils is on the framework side.

Test: Compiles
Bug: 31399200
Change-Id: Ib88a80f406fa2b897aa7c65f5faba6cdd9d6a700
parent f62ea801
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -36,7 +36,14 @@ namespace implementation {
            ::android::OMXBuffer const& l);
    inline bool convertTo(::android::OMXBuffer* l,
            ::android::hardware::media::omx::V1_0::CodecBuffer const& t);
}}}}}
}
namespace utils {
    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;
@@ -93,6 +100,12 @@ private:
    friend inline bool (::android::hardware::media::omx::V1_0::implementation::
            convertTo)(OMXBuffer* l,
            ::android::hardware::media::omx::V1_0::CodecBuffer const& t);
    friend inline bool (::android::hardware::media::omx::V1_0::utils::
            wrapAs)(::android::hardware::media::omx::V1_0::CodecBuffer* t,
            OMXBuffer const& l);
    friend inline bool (::android::hardware::media::omx::V1_0::utils::
            convertTo)(OMXBuffer* l,
            ::android::hardware::media::omx::V1_0::CodecBuffer const& t);

    enum BufferType {
        kBufferTypeInvalid = 0,
+16 −2
Original line number Diff line number Diff line
@@ -26,12 +26,20 @@ 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 {
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);
}}}}}
}
namespace utils {
    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) {}
@@ -56,6 +64,12 @@ private:
    friend bool (::android::hardware::media::omx::V1_0::implementation::
            convertTo)(OMXFenceParcelable* l,
            ::android::hardware::hidl_handle const& t);
    friend void (::android::hardware::media::omx::V1_0::utils::
            wrapAs)(OMXFenceParcelable* l,
            ::android::hardware::hidl_handle const& t);
    friend bool (::android::hardware::media::omx::V1_0::utils::
            convertTo)(OMXFenceParcelable* l,
            ::android::hardware::hidl_handle const& t);
};

inline status_t OMXFenceParcelable::readFromParcel(const Parcel* parcel) {
+1 −43
Original line number Diff line number Diff line
LOCAL_PATH := $(call my-dir)
include $(call all-makefiles-under,$(LOCAL_PATH))
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.media.omx@1.0-impl
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
    WGraphicBufferSource.cpp \
    WOmx.cpp \
    WOmxBufferProducer.cpp \
    WOmxBufferSource.cpp \
    WOmxNode.cpp \
    WOmxObserver.cpp \
    WOmxProducerListener.cpp \
    Omx.cpp \
    OmxNode.cpp \

LOCAL_SHARED_LIBRARIES := \
    libmedia \
    libstagefright_foundation \
    libstagefright_omx \
    libui \
    libgui \
    libhidlbase \
    libhidltransport \
    libhwbinder \
    libhidlmemory \
    libutils \
    libcutils \
    libbinder \
    liblog \
    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/av/media/libstagefright/omx \
        $(TOP)/frameworks/native/include/media/hardware \
        $(TOP)/frameworks/native/include/media/openmax \
        $(TOP)/frameworks/native/include \

include $(BUILD_SHARED_LIBRARY)
+45 −0
Original line number Diff line number Diff line
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.media.omx@1.0-impl
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
    WGraphicBufferSource.cpp \
    WOmx.cpp \
    WOmxBufferProducer.cpp \
    WOmxBufferSource.cpp \
    WOmxNode.cpp \
    WOmxObserver.cpp \
    WOmxProducerListener.cpp \
    Omx.cpp \
    OmxNode.cpp \

LOCAL_SHARED_LIBRARIES := \
    libmedia \
    libstagefright_foundation \
    libstagefright_omx \
    libui \
    libgui \
    libhidlbase \
    libhidltransport \
    libhwbinder \
    libhidlmemory \
    libutils \
    libcutils \
    libbinder \
    liblog \
    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/av/media/libstagefright/omx \
        $(TOP)/frameworks/native/include/media/hardware \
        $(TOP)/frameworks/native/include/media/openmax \
        $(TOP)/frameworks/native/include \

include $(BUILD_SHARED_LIBRARY)
Loading