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

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

Start OMX HAL implementation.

Bug: 31399200

Test: None
Change-Id: I7ba9af10f76ec178c7df72e0202add30864b73c3
parent 0bdd9ffd
Loading
Loading
Loading
Loading
+22 −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 := \
    GraphicBufferSource.cpp \
    Omx.cpp \
    OmxBufferSource.cpp \
    OmxNode.cpp \
    OmxObserver.cpp \

LOCAL_SHARED_LIBRARIES := \
    libhidlbase \
    libhidltransport \
    libhwbinder \
    libutils \
    android.hardware.media.omx@1.0 \
    android.hardware.graphics.common@1.0 \
    android.hardware.media@1.0 \

include $(BUILD_SHARED_LIBRARY)
+66 −0
Original line number Diff line number Diff line
#include "GraphicBufferSource.h"

namespace android {
namespace hardware {
namespace media {
namespace omx {
namespace V1_0 {
namespace implementation {

// Methods from ::android::hardware::media::omx::V1_0::IGraphicBufferSource follow.
Return<Status> GraphicBufferSource::configure(const sp<IOmxNode>& omxNode, Dataspace dataspace) {
    // TODO implement
    return ::android::hardware::media::omx::V1_0::Status {};
}

Return<Status> GraphicBufferSource::setSuspend(bool suspend) {
    // TODO implement
    return ::android::hardware::media::omx::V1_0::Status {};
}

Return<Status> GraphicBufferSource::setRepeatPreviousFrameDelayUs(int64_t repeatAfterUs) {
    // TODO implement
    return ::android::hardware::media::omx::V1_0::Status {};
}

Return<Status> GraphicBufferSource::setMaxFps(float maxFps) {
    // TODO implement
    return ::android::hardware::media::omx::V1_0::Status {};
}

Return<Status> GraphicBufferSource::setTimeLapseConfig(int64_t timePerFrameUs, int64_t timePerCaptureUs) {
    // TODO implement
    return ::android::hardware::media::omx::V1_0::Status {};
}

Return<Status> GraphicBufferSource::setStartTimeUs(int64_t startTimeUs) {
    // TODO implement
    return ::android::hardware::media::omx::V1_0::Status {};
}

Return<Status> GraphicBufferSource::setColorAspects(const ColorAspects& aspects) {
    // TODO implement
    return ::android::hardware::media::omx::V1_0::Status {};
}

Return<Status> GraphicBufferSource::setTimeOffsetUs(int64_t timeOffsetUs) {
    // TODO implement
    return ::android::hardware::media::omx::V1_0::Status {};
}

Return<Status> GraphicBufferSource::signalEndOfInputStream() {
    // TODO implement
    return ::android::hardware::media::omx::V1_0::Status {};
}


IGraphicBufferSource* HIDL_FETCH_IGraphicBufferSource(const char* /* name */) {
    return new GraphicBufferSource();
}

} // namespace implementation
}  // namespace V1_0
}  // namespace omx
}  // namespace media
}  // namespace hardware
}  // namespace android
+50 −0
Original line number Diff line number Diff line
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0__GRAPHICBUFFERSOURCE_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0__GRAPHICBUFFERSOURCE_H

#include <android/hardware/media/omx/1.0/IGraphicBufferSource.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>

namespace android {
namespace hardware {
namespace media {
namespace omx {
namespace V1_0 {
namespace implementation {

using ::android::hardware::graphics::common::V1_0::Dataspace;
using ::android::hardware::media::omx::V1_0::ColorAspects;
using ::android::hardware::media::omx::V1_0::IGraphicBufferSource;
using ::android::hardware::media::omx::V1_0::IOmxNode;
using ::android::hardware::media::omx::V1_0::Status;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;

struct GraphicBufferSource : public IGraphicBufferSource {
    // Methods from ::android::hardware::media::omx::V1_0::IGraphicBufferSource follow.
    Return<Status> configure(const sp<IOmxNode>& omxNode, Dataspace dataspace) override;
    Return<Status> setSuspend(bool suspend) override;
    Return<Status> setRepeatPreviousFrameDelayUs(int64_t repeatAfterUs) override;
    Return<Status> setMaxFps(float maxFps) override;
    Return<Status> setTimeLapseConfig(int64_t timePerFrameUs, int64_t timePerCaptureUs) override;
    Return<Status> setStartTimeUs(int64_t startTimeUs) override;
    Return<Status> setColorAspects(const ColorAspects& aspects) override;
    Return<Status> setTimeOffsetUs(int64_t timeOffsetUs) override;
    Return<Status> signalEndOfInputStream() override;

};

extern "C" IGraphicBufferSource* HIDL_FETCH_IGraphicBufferSource(const char* name);

}  // namespace implementation
}  // namespace V1_0
}  // namespace omx
}  // namespace media
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_MEDIA_OMX_V1_0__GRAPHICBUFFERSOURCE_H
+31 −0
Original line number Diff line number Diff line
#include "Omx.h"

namespace android {
namespace hardware {
namespace media {
namespace omx {
namespace V1_0 {
namespace implementation {

// Methods from ::android::hardware::media::omx::V1_0::IOmx follow.
Return<void> Omx::listNodes(listNodes_cb _hidl_cb) {
    // TODO implement
    return Void();
}

Return<void> Omx::allocateNode(const hidl_string& name, const sp<IOmxObserver>& observer, allocateNode_cb _hidl_cb) {
    // TODO implement
    return Void();
}


IOmx* HIDL_FETCH_IOmx(const char* /* name */) {
    return new Omx();
}

} // namespace implementation
}  // namespace V1_0
}  // namespace omx
}  // namespace media
}  // namespace hardware
}  // namespace android
+42 −0
Original line number Diff line number Diff line
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0__OMX_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0__OMX_H

#include <android/hardware/media/omx/1.0/IOmx.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>

namespace android {
namespace hardware {
namespace media {
namespace omx {
namespace V1_0 {
namespace implementation {

using ::android::hardware::media::omx::V1_0::IOmx;
using ::android::hardware::media::omx::V1_0::IOmxNode;
using ::android::hardware::media::omx::V1_0::IOmxObserver;
using ::android::hardware::media::omx::V1_0::Status;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;

struct Omx : public IOmx {
    // Methods from ::android::hardware::media::omx::V1_0::IOmx follow.
    Return<void> listNodes(listNodes_cb _hidl_cb) override;
    Return<void> allocateNode(const hidl_string& name, const sp<IOmxObserver>& observer, allocateNode_cb _hidl_cb) override;

};

extern "C" IOmx* HIDL_FETCH_IOmx(const char* name);

}  // namespace implementation
}  // namespace V1_0
}  // namespace omx
}  // namespace media
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_MEDIA_OMX_V1_0__OMX_H
Loading