From 9758c69c180d6fa6ade952b54e538a1f07aa4168 Mon Sep 17 00:00:00 2001 From: Yao.Liu Date: Wed, 18 Oct 2017 03:13:37 +0000 Subject: hwc2: set_omx_pts for video layer PD# NONE Change-Id: I6ca4a19c4ee7436fcff10689a54ce1a21ac4c898 Signed-off-by: Yao.Liu --- diff --git a/hwc2/common/devices/PhysicalDevice.cpp b/hwc2/common/devices/PhysicalDevice.cpp index fe0616b..7976b8c 100644 --- a/hwc2/common/devices/PhysicalDevice.cpp +++ b/hwc2/common/devices/PhysicalDevice.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #define FBIOPUT_OSD_CURSOR 0x451a @@ -56,7 +57,8 @@ PhysicalDevice::PhysicalDevice(hwc2_display_t id, Hwcomposer& hwc, DeviceControl mGE2DComposeFrameCount(0), mDirectComposeFrameCount(0), mGetInitState(false), - mInitialized(false) { + mInitialized(false), + mOmxVideoHandle(0){ CTRACE(); switch (id) { @@ -87,6 +89,10 @@ PhysicalDevice::~PhysicalDevice() { WARN_IF_NOT_DEINIT(); clearFenceList(mHwcCurReleaseFences); clearFenceList(mHwcPriorReleaseFences); + if (mOmxVideoHandle != 0) { + closeamvideo(); + mOmxVideoHandle = 0; + } } bool PhysicalDevice::initialize() { @@ -1224,6 +1230,9 @@ int32_t PhysicalDevice::validateDisplay(uint32_t* outNumTypes, continue; } #endif + if (hnd && hnd->flags & private_handle_t::PRIV_FLAGS_VIDEO_OMX) { + set_omx_pts((char*)hnd->base, &mOmxVideoHandle); + } if (videoLayer && (layer->getZ() < videoLayer->getZ())) { DTRACE("Layer covered by video layer."); diff --git a/hwc2/include/PhysicalDevice.h b/hwc2/include/PhysicalDevice.h index d3c3ab6..5f547e0 100644 --- a/hwc2/include/PhysicalDevice.h +++ b/hwc2/include/PhysicalDevice.h @@ -264,6 +264,9 @@ private: //rever the scaled displayframe, for we use the vpp scale. float mReverseScaleX; float mReverseScaleY; + + //omx handle for set omx pts + int32_t mOmxVideoHandle; }; -- cgit