Init code for public
authorGilbok Lee <gilbok.lee@samsung.com>
Wed, 27 Sep 2023 00:40:17 +0000 (09:40 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 27 Sep 2023 05:01:10 +0000 (14:01 +0900)
23 files changed:
.github/CODEOWNERS [new file with mode: 0644]
include/esplusplayer/esplusplayer.h
include/esplusplayer/types/buffer.h
include/esplusplayer_capi/buffer.h
include/esplusplayer_capi/espacket.h
include/esplusplayer_capi/esplusplayer_capi.h
include/esplusplayer_capi/event.h
include/esplusplayer_capi/matroska_color.h
packaging/esplusplayer.spec
src/esplusplayer/CMakeLists.txt
src/esplusplayer/include_internal/esplayer/decoded_pkt_list.h
src/esplusplayer/include_internal/esplayer/esplayer.h
src/esplusplayer/src/esplayer.cpp
src/esplusplayer/src/esplusplayer_capi.cpp
src/plusplayer-core/CMakeLists.txt
src/plusplayer-core/include_internal/core/decoderinputbuffer.h
src/plusplayer-core/include_internal/core/trackrendereradapter.h
src/plusplayer-core/src/plusplayer_cfg.cpp
src/plusplayer-core/src/trackrendereradapter.cpp
src/plusplayer-core/src/trackrendereradapter_utils.cpp
ut/CMakeLists.txt
ut/src/tc_regression.cpp
ut/src/utils/utility.cpp

diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644 (file)
index 0000000..b8b24be
--- /dev/null
@@ -0,0 +1 @@
+* @tizen-vault/espp-public
index 756cdcb..b0efbe2 100644 (file)
@@ -1334,6 +1334,13 @@ class EsPlusPlayer : private boost::noncopyable {
     return false;
   }
 
+#ifdef TIZEN_FEATURE_PUBLIC
+  /**
+   * @brief     Provided api for enabling video hole
+   * @return    @c True on success, otherwise @c False
+   */
+  virtual bool EnableVideoHole(bool value) { return false; }
+#endif
   // LCOV_EXCL_STOP
 
  protected:
index 93e78c1..3edc5e4 100644 (file)
@@ -60,6 +60,9 @@ struct DecodedVideoPacket {
   uint64_t duration = 0;
   tbm_surface_h surface_data = nullptr;  // tbm_surface
   void* scaler_index = nullptr;
+#ifdef TIZEN_FEATURE_PUBLIC
+  void* buffer_addr = nullptr;
+#endif
 };
 
 struct DecoderBufferTime{
index 326aa4c..4c38b64 100644 (file)
 #ifndef __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_BUFFER_H__
 #define __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_BUFFER_H__
 
-#include <cstdint>
-
 #ifdef __cplusplus
+#include <cstdint>
 extern "C" {
+#else
+#include <stdint.h>
 #endif
 
 /**
index 50bf18a..a223821 100644 (file)
 #ifndef __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPACKET_H__
 #define __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPACKET_H__
 
-#include <cstdint>
 
 #include "esplusplayer_capi/matroska_color.h"
 #include "esplusplayer_capi/stream.h"
 
 #ifdef __cplusplus
+#include <cstdint>
 extern "C" {
+#else
+#include <stdint.h>
 #endif
 
 /**
index 15ddae3..7f53e33 100644 (file)
@@ -3937,6 +3937,35 @@ int esplusplayer_get_video_stream_rotation_info(
 int esplusplayer_set_simple_mix_out_buffer_level(
     esplusplayer_handle handle, esplusplayer_simple_mix_out_buffer_level level);
 
+
+#ifdef TIZEN_FEATURE_PUBLIC
+/**
+ * @brief     Provided api for enabling video hole.
+ * @param     [in] handle : esplusplayer handle.
+ * @param     [in] value : the value of video hole.
+ *            (@c true = video hole enabled, @c false = video hole disabled)
+ * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of esplusplayer_error_type
+ *            values will be returned.
+ * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
+ * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
+ * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
+ * @code
+ *            esplusplayer_open(esplayer);
+ *            esplusplayer_enable_video_hole(esplayer, false);
+ *            // ... your codes ...
+ *            esplusplayer_close(esplayer);
+ * @endcode
+ * @pre       The player state must not be #ESPLUSPLAYER_STATE_NONE.
+ * @remark    To disable video hole, esplusplayer_decoded_video_frame_buffer_type() must
+ *            not be set to #ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE.
+ *            To enable video hole, esplusplayer_set_display() must be set to #ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY
+ * @post      None
+ * @exception None
+ * @see       esplusplayer_set_video_frame_buffer_type()
+ *            esplusplayer_set_media_packet_video_decoded_cb()
+ */
+int esplusplayer_enable_video_hole(esplusplayer_handle handle, const bool value);
+#endif
 #ifdef __cplusplus
 }
 #endif
index 63a71e0..da393f3 100644 (file)
 #ifndef __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_EVENT_H__
 #define __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_EVENT_H__
 
-#include <cstdint>
-
 #ifdef __cplusplus
+#include <cstdint>
 extern "C" {
+#else
+#include <stdint.h>
 #endif
 
 /**
index 561ada5..eb78eb9 100644 (file)
 #ifndef __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_MATROSKA_COLOR_H__
 #define __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_MATROSKA_COLOR_H__
 
-#include <cstdint>
-
 #ifdef __cplusplus
+#include <cstdint>
 extern "C" {
+#else
+#include <stdint.h>
 #endif
 
 /**
index 85ac289..c95ea5c 100644 (file)
@@ -1,4 +1,5 @@
 #%bcond_with : disable ESPLUSPLAYER_UT by default, %bcond_without : enable ESPLUSPLAYER_UT
+%bcond_without TIZEN_PUBLIC
 %if ("%{_vd_cfg_product_type}" != "AUDIO")
 %bcond_without ESPLUSPLAYER_UT
 %else
@@ -24,25 +25,31 @@ BuildRequires:  pkgconfig(elementary)
 BuildRequires:  pkgconfig(ecore)
 BuildRequires:  pkgconfig(evas)
 BuildRequires:  pkgconfig(ecore-wl2)
+%if %{with TIZEN_PUBLIC}
+BuildRequires:  pkgconfig(libtrackrenderer)
+%else
 BuildRequires:  pkgconfig(tv-resource-manager)
-BuildRequires:  pkgconfig(libtzplatform-config)
-BuildRequires:  pkgconfig(jsoncpp)
-BuildRequires:  pkgconfig(icu-i18n)
 BuildRequires:  pkgconfig(drmdecrypt)
-BuildRequires:  pkgconfig(logger)
-BuildRequires:  pkgconfig(gio-2.0)
-BuildRequires:  pkgconfig(libtbm)
 BuildRequires:  pkgconfig(context-aware-api)
-BuildRequires:  pkgconfig(capi-trackrenderer-tv)
-BuildRequires:  pkgconfig(libtbm)
-BuildRequires:  pkgconfig(capi-system-info)
-
 %if ("%{_vd_cfg_product_type}" != "AUDIO")
 BuildRequires:  pkgconfig(graphics-control)
 BuildRequires:  pkgconfig(libavoc)
 %else
 BuildRequires:  pkgconfig(libavoc-av)
 %endif
+BuildRequires:  pkgconfig(capi-trackrenderer-tv)
+BuildRequires:  pkgconfig(logger)
+%endif
+
+BuildRequires:  pkgconfig(libtzplatform-config)
+BuildRequires:  pkgconfig(jsoncpp)
+BuildRequires:  pkgconfig(icu-i18n)
+BuildRequires:  pkgconfig(gio-2.0)
+BuildRequires:  pkgconfig(libtbm)
+
+BuildRequires:  pkgconfig(libtbm)
+BuildRequires:  pkgconfig(capi-system-info)
+
 
 %if ("%{sec_buildconf_product_lite_tizen}" == "n")
 # for ut
@@ -102,10 +109,13 @@ cp %{SOURCE1001} .
 %package ut-component-tomato
 Summary: Test package with TOMATO
 BuildRequires:  gtest-devel
+%if %{without TIZEN_PUBLIC}
 BuildRequires:  pkgconfig(video-capture)
 BuildRequires:  pkgconfig(audio-control)
-BuildRequires:  libjpeg-turbo-devel
 BuildRequires:  pkgconfig(video-sink)
+%endif
+BuildRequires:  libjpeg-turbo-devel
+
 #BuildRequires:  pkgconfig(capi-system-info)
 Requires: %{name} = %{version}-%{release}
 
@@ -124,6 +134,12 @@ This package is for test
 export CFLAGS+=" -Wno-deprecated-declarations"
 export CXXFLAGS+=" -Wno-deprecated-declarations"
 
+%if %{with TIZEN_PUBLIC}
+export CFLAGS+=" -DTIZEN_FEATURE_PUBLIC"
+export CXXFLAGS+=" -DTIZEN_FEATURE_PUBLIC"
+%define TIZEN_PUBLIC ON
+%define USE_MIXER no
+%else
 %if ("%{_vd_cfg_product_type}" == "AUDIO")
 export CFLAGS+=" -DIS_AUDIO_PRODUCT"
 export CXXFLAGS+=" -DIS_AUDIO_PRODUCT"
@@ -135,6 +151,8 @@ export CXXFLAGS+=" -DUSE_MIXER"
 %define PRODUCT_TYPE_AUDIO no
 %define USE_MIXER yes
 %endif
+%define TIZEN_PUBLIC OFF
+%endif
 
 #TODO: check AV type is used or not
 %if ("%{_vd_cfg_product_type}" == "AV")
@@ -160,18 +178,21 @@ export LDFLAGS+=" -lgcov"
 
 export CXXFLAGS+=" -Wno-pessimizing-move"
 
+%if %{without TIZEN_PUBLIC}
 %ifarch aarch64
 export CXXFLAGS+=" -DDRM_MAPI_AARCH_64"
 %endif
+%endif
 
 %if ("%{sec_buildconf_product_lite_tizen}" == "n")
 %if %{with ESPLUSPLAYER_UT}
-%cmake . -DESPLUSPLAYER_BUILD_UT=ON -DPRODUCT_TYPE_AUDIO=%PRODUCT_TYPE_AUDIO -DUSE_MIXER=%USE_MIXER
+%cmake . -DESPLUSPLAYER_BUILD_UT=ON -DPRODUCT_TYPE_AUDIO=%PRODUCT_TYPE_AUDIO -DUSE_MIXER=%USE_MIXER -DTIZEN_PUBLIC=%TIZEN_PUBLIC
 %else
-%cmake . -DPRODUCT_TYPE_AUDIO=%PRODUCT_TYPE_AUDIO -DUSE_MIXER=%USE_MIXER
+%cmake . -DPRODUCT_TYPE_AUDIO=%PRODUCT_TYPE_AUDIO -DUSE_MIXER=%USE_MIXER -DTIZEN_PUBLIC=%TIZEN_PUBLIC
 %endif
 %else
-%cmake . -DPRODUCT_TYPE_AUDIO=%PRODUCT_TYPE_AUDIO -DUSE_MIXER=%USE_MIXER
+%cmake . -DPRODUCT_TYPE_AUDIO=%PRODUCT_TYPE_AUDIO -DUSE_MIXER=%USE_MIXER -DTIZEN_PUBLIC=%TIZEN_PUBLIC
+
 %endif
 
 make %{?jobs:-j%jobs}
index a698fde..b050e3d 100644 (file)
@@ -21,15 +21,17 @@ SET(${fw_name}_CXXFLAGS "-Wall -Werror -std=c++17 -fPIC -fno-lto -Wl,-z,relro -f
 
 SET(dependents "gstreamer-1.0 glib-2.0 dlog"
                "boost"
-               "tv-resource-manager"
                "elementary ecore ecore-wl2"
                "jsoncpp")
 
+IF(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(dependents ${dependents} ""tv-resource-manager"")
 IF(${PRODUCT_TYPE_AUDIO} STREQUAL "no")
 SET(dependents ${dependents} "libavoc")
 ELSE(${PRODUCT_TYPE_AUDIO} STREQUAL "no")
 SET(dependents ${dependents} "libavoc-av")
 ENDIF(${PRODUCT_TYPE_AUDIO} STREQUAL "no")
+ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
 
 INCLUDE(FindPkgConfig)
 
index a2b1a91..58b4eb2 100644 (file)
@@ -11,6 +11,9 @@
 #include <functional>
 #include <list>
 #include <memory>
+#ifdef TIZEN_FEATURE_PUBLIC
+#include <gst/gst.h>
+#endif
 
 #include "core/utils/plusplayer_log.h"
 #include "esplusplayer/types/buffer.h"
 namespace {
 // LCOV_EXCL_START
 void DecodedPacketDeleter(esplusplayer_decoded_video_packet* packet) {
+#ifndef TIZEN_FEATURE_PUBLIC
   if (packet == nullptr || packet->surface_data == nullptr) return;
+#else
+  if (packet == nullptr) return;
+  if (packet->private_data) { // hw dec
+    gst_buffer_unref((GstBuffer *)packet->private_data);
+    packet->private_data = nullptr;
+  }
+  if (packet->surface_data == nullptr) return;
+#endif
   // LOG_DEBUG("packet[%p] deleted", packet);
   tbm_surface_destroy(static_cast<tbm_surface_h>(packet->surface_data));
   packet->surface_data = NULL;
-// LCOV_EXCL_STOP  
+// LCOV_EXCL_STOP
 }
 }  // namespace
 
@@ -40,7 +52,7 @@ struct CmaBufferInfo {
   bool destroy_flag = false;
 };
 
-// LCOV_EXCL_START 
+// LCOV_EXCL_START
 class AbstractDecodedPacketList : public DecodedPacketManagerInterface {
  public:
   explicit AbstractDecodedPacketList() = default;
index 97d9d4a..67e7c88 100644 (file)
@@ -16,7 +16,9 @@
 #include <vector>
 
 #include "core/decoderinputbuffer.h"
+#ifndef TIZEN_FEATURE_PUBLIC
 #include "core/kpi.h"
+#endif
 #include "core/trackrendereradapter.h"
 #ifdef USE_MIXER
 #include "mixer/mixerticket.h"
@@ -214,7 +216,9 @@ class EsPlayer : public EsPlusPlayer {
   void ResetContextForStop_();
   void GetSrcQueueCurrentSize_(const TrackType& type, uint64_t* byte_size,
                                uint64_t* time_size);
+#ifndef TIZEN_FEATURE_PUBLIC
   kpi::EsCodecLoggerKeys MakeKpiKeys_();
+#endif
 #ifdef USE_MIXER
   bool PrepareVideoMixingMode_(std::vector<Track>* tracks);
 #endif // USE_MIXER
@@ -281,6 +285,10 @@ class EsPlayer : public EsPlusPlayer {
   };
 #endif // USE_MIXER
 
+#ifdef TIZEN_FEATURE_PUBLIC
+  bool EnableVideoHole(bool value) override;
+#endif
+
  private:
   std::vector<Track> track_;
   NeedData need_data_[kTrackTypeMax];
index d097633..b5f0997 100644 (file)
 #include <sstream>
 #include <thread>
 
+#ifndef TIZEN_FEATURE_PUBLIC
 #ifdef SOUNDBAR_PRODUCT
 #include "avoc_av_audio.h"
 #else
 #include "avoc.h"
 #endif
+#endif
 #include "core/gst_utils.h"
 #include "core/track_util.h"
+#ifndef TIZEN_FEATURE_PUBLIC
 #include "core/utils/caf_logger.h"
+#endif
 #include "core/utils/performance_checker.h"
 #include "core/utils/plusplayer_cfg.h"
 #include "core/utils/plusplayer_log.h"
@@ -299,9 +303,11 @@ inline bool IsExclusiveLowLatencyMode(std::uint32_t current_mode,
 
 EsPlayer::EsPlayer() {
   std::call_once(es_conf::loaded, [this]() { es_conf::LoadIniFile(); });
+#ifndef TIZEN_FEATURE_PUBLIC
   if (CafLogger::Initialize() != true) {
     LOG_INFO("CAF Dbus not connect.");
   }
+#endif
   InitValuesFromIni_();
 }
 
@@ -330,9 +336,12 @@ bool EsPlayer::Open() {
     performance_checker::End(start, "Open");
     return true;
   };
+
+#ifndef TIZEN_FEATURE_PUBLIC
   CafLogger::SetUniqueNumber();
   caf_unique_number = CafLogger::GetUniqueNumber();
   CafLogger::LogMessage(CafEventType::kIdle, caf_unique_number);
+#endif
 
   es_event::Open event{op};
   return state_manager_.ProcessEvent(event);
@@ -519,7 +528,9 @@ bool EsPlayer::Start() {
     return true;
   };
 
+#ifndef TIZEN_FEATURE_PUBLIC
   CafLogger::LogMessage(CafEventType::kPlaying, caf_unique_number);
+#endif
 
   es_event::Start event{op};
   return state_manager_.ProcessEvent(event);
@@ -551,8 +562,10 @@ bool EsPlayer::Stop() {
     LOG_INFO_P(this, "Wait , Wait Prepare() Done...");
   }
 
+#ifndef TIZEN_FEATURE_PUBLIC
   CafLogger::LogMessage(CafEventType::kIdle, caf_unique_number);
   CafLogger::StopLoggingThread();
+#endif
 
   return res;
 }
@@ -720,8 +733,10 @@ bool EsPlayer::Prepare_() {
     return true;
   };
 
+#ifndef TIZEN_FEATURE_PUBLIC
   CafLogger::StartLoggingThread();
   CafLogger::LogMessage(CafEventType::kReady, caf_unique_number);
+#endif
 
   es_event::Prepare event{op};
   if (!state_manager_.ProcessEvent(event)) {
@@ -741,9 +756,11 @@ void EsPlayer::PrepareTask_() {
     LOG_INFO_P(this, "call OnPrepareDone End");
   }
 
+#ifndef TIZEN_FEATURE_PUBLIC
   kpi::CodecLogger logger;
   kpi::EsCodecLoggerKeys event_keys = MakeKpiKeys_();
   logger.SendKpi(ret, event_keys);
+#endif
   LOG_LEAVE_P(this);
 }
 
@@ -781,7 +798,9 @@ bool EsPlayer::Pause() {
         internal::ConvertToStreamType(track.type), true);
   }
 
+#ifndef TIZEN_FEATURE_PUBLIC
   CafLogger::LogMessage(CafEventType::kPaused, caf_unique_number);
+#endif
 
   es_event::Pause event{op};
   return state_manager_.ProcessEvent(event);
@@ -814,7 +833,9 @@ bool EsPlayer::Resume() {
         internal::ConvertToStreamType(track.type), true);
   }
 
+#ifndef TIZEN_FEATURE_PUBLIC
   CafLogger::LogMessage(CafEventType::kPlaying, caf_unique_number);
+#endif
 
   es_event::Resume event{op};
   return state_manager_.ProcessEvent(event);
@@ -883,7 +904,9 @@ void EsPlayer::SetAppInfo(const PlayerAppInfo& app_info) {
   app_info_ = app_info;
   trackrenderer_->SetAppInfo(app_info);
   LOG_INFO("Appid [%s]", app_info.id.c_str());
+#ifndef TIZEN_FEATURE_PUBLIC
   CafLogger::SetAppId(app_info.id);
+#endif
 }
 
 void EsPlayer::SetAppInfoEx(const PlayerAppInfoEx& app_info) {
@@ -898,7 +921,9 @@ void EsPlayer::SetAppInfoEx(const PlayerAppInfoEx& app_info) {
   app_info_.type = app_info.type;
   trackrenderer_->SetAppInfoEx(app_info);
   LOG_INFO("Appid [%s]", app_info_.id.c_str());
+#ifndef TIZEN_FEATURE_PUBLIC
   CafLogger::SetAppId(app_info_.id);
+#endif
 }
 
 bool EsPlayer::SetPlaybackRate(const double rate, const bool audio_mute) {
@@ -1175,7 +1200,9 @@ bool EsPlayer::SetStream_(const Track& track) {
     return true;
   };
 
+#ifndef TIZEN_FEATURE_PUBLIC
   CafLogger::LogMessage(CafEventType::kStreamReady, caf_unique_number);
+#endif
 
   es_event::SetStream event{op};
   return state_manager_.ProcessEvent(event);
@@ -1980,6 +2007,7 @@ ErrorType EsPlayer::SetFmmMode() {
   }
 
   int onoff = 0;
+#ifndef TIZEN_FEATURE_PUBLIC
 #ifdef SOUNDBAR_PRODUCT
   return ErrorType::kInvalidState;
 #else
@@ -1987,6 +2015,7 @@ ErrorType EsPlayer::SetFmmMode() {
   LOG_ERROR_P(this, "avoc get fmm ret [%d]  onoff[%d]", avoc_ret, onoff);
   if (avoc_ret == AVOC_EXIT_FAILURE) return ErrorType::kInvalidState;
 #endif
+#endif
   ErrorType ret = ErrorType::kNone;
 
   constexpr int fmm_auto_off = 0;
@@ -2983,6 +3012,7 @@ bool EsPlayer::SetSimpleMixOutBufferLevel(
   return trackrenderer_->SetSimpleMixOutBufferLevel(converted_level);
 }
 
+#ifndef TIZEN_FEATURE_PUBLIC
 kpi::EsCodecLoggerKeys EsPlayer::MakeKpiKeys_() {
   kpi::EsCodecLoggerKeys event_info;
   event_info.app_id = app_info_.id;
@@ -3004,12 +3034,24 @@ kpi::EsCodecLoggerKeys EsPlayer::MakeKpiKeys_() {
   }
   return event_info;
 }
+#endif
 
 void EsPlayer::InitValuesFromIni_() {
   force_audio_swdecoder_use_ = es_conf::ini_property["force_sw_audio_codec"];
   force_video_swdecoder_use_ = es_conf::ini_property["force_sw_video_codec"];
 }
 
+#ifdef TIZEN_FEATURE_PUBLIC
+bool EsPlayer::EnableVideoHole(bool value) {
+  if (state_manager_.GetState() < EsState::kIdle) {
+    LOG_ERROR_P(this, "Invalid State , current %d",
+                state_manager_.GetStateEnum());
+    return false;
+  }
+  return trackrenderer_->EnableVideoHole(value);
+}
+#endif
+
 namespace es_conf {
 
 void LoadIniProperty(const Json::Value& root) {
index 6e998f2..0a2fc6f 100644 (file)
@@ -307,7 +307,11 @@ class listener_bridge : public esplusplayer::EsEventListener {
     _pkt->pts = packet.pts;
     _pkt->duration = packet.duration;
     _pkt->surface_data = static_cast<void*>(packet.surface_data);
+#ifdef TIZEN_FETURE_PUBLIC
+    _pkt->private_data = packet.buffer_addr;
+#else
     _pkt->private_data = packet.scaler_index;
+#endif
     if (decoded_pkt_mgr_ && decoded_pkt_mgr_->TryToAdd(_pkt)) {
       this->media_packet_video_decoded_cb_(
           _pkt, media_packet_video_decoded_cb_userdata_);
@@ -1501,7 +1505,11 @@ std::shared_ptr<DecodedPacketManagerInterface> CreateDecodedPacketManager(
           _pkt.pts = pkt->pts;
           _pkt.duration = pkt->duration;
           _pkt.surface_data = static_cast<tbm_surface_h>(pkt->surface_data);
+#ifdef TIZEN_FEATURE_PUBLIC
+          _pkt.buffer_addr = pkt->private_data;
+#else
           _pkt.scaler_index = pkt->private_data;
+#endif
           return cast_(handle)->ReturnDecodedPacket(_pkt);
         });
   return mgr;
@@ -1924,7 +1932,11 @@ int esplusplayer_get_decoded_video_packet(
     packet->pts = _packet.pts;
     packet->duration = _packet.duration;
     packet->surface_data = static_cast<void*>(_packet.surface_data);
+#ifdef TIZEN_FEATURE_PUBLIC
+    packet->private_data = _packet.buffer_addr;
+#else
     packet->private_data = _packet.scaler_index;
+#endif
   }
   if (state) {
     *state = convert_get_decoded_video_frame_status_(_state);
@@ -2419,3 +2431,13 @@ int esplusplayer_set_simple_mix_out_buffer_level(
   return convert_return_type_(cast_(handle)->SetSimpleMixOutBufferLevel(
       static_cast<PlayerSimpleMixOutBufferLevel>(level)));
 }
+
+#ifdef TIZEN_FEATURE_PUBLIC
+int esplusplayer_enable_video_hole(esplusplayer_handle handle, const bool value) {
+  LOG_ENTER_P(cast_(handle))
+  if (is_null_(handle)) return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
+
+  auto ret = cast_(handle)->EnableVideoHole(value);
+  return convert_return_type_(ret);
+}
+#endif
index 126768e..00cacbd 100644 (file)
@@ -13,11 +13,14 @@ SET(ADD_LIBS
 SET(${fw_name}_CXXFLAGS "-Wall -Werror -std=c++14 -fPIC -Wl,-z,relro -fstack-protector -DEFL_BETA_API_SUPPORT")
 
 SET(dependents "gstreamer-1.0 dlog capi-system-info"
-               "boost"               
-               "context-aware-api"
-               "libtzplatform-config"
-               "drmdecrypt"
-               "logger")
+               "boost"
+               "libtzplatform-config")
+
+IF(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(dependents ${dependents} "context-aware-api"
+                             "drmdecrypt"
+                             "logger")
+ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
 
 INCLUDE(FindPkgConfig)
 
@@ -50,11 +53,15 @@ SET(CC_SRCS
   ${PROJECT_SOURCE_DIR}/src/plusplayer_cfg.cpp
   ${PROJECT_SOURCE_DIR}/src/trackrendereradapter.cpp
   ${PROJECT_SOURCE_DIR}/src/trackrendereradapter_utils.cpp
-  ${PROJECT_SOURCE_DIR}/src/kpi.cpp
   ${PROJECT_SOURCE_DIR}/src/decodedvideopacketex.cpp
   ${PROJECT_SOURCE_DIR}/src/videoframetypestrategy.cpp
-  ${PROJECT_SOURCE_DIR}/src/caf_logger.cpp
-)
+  )
+
+IF(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(CC_SRCS ${CC_SRCS}
+  ${PROJECT_SOURCE_DIR}/src/kpi.cpp
+  ${PROJECT_SOURCE_DIR}/src/caf_logger.cpp)
+ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
 
 ADD_LIBRARY(${fw_name} SHARED ${CC_SRCS})
 
index aa145ff..53c8e0e 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "gst/gst.h"
 // temporary until drmdecrypt platform interfaces are added into rootstrap
-#ifndef PLUPLAYER_DOWNLOADABLE_APP_TVPLUS
+#if !defined(TIZEN_FEATURE_PUBLIC) && !defined(PLUPLAYER_DOWNLOADABLE_APP_TVPLUS)
 #include <drmdecrypt/drmdecrypt_api.h>
 #endif
 
@@ -86,7 +86,7 @@ class DecoderInputBuffer : private boost::noncopyable {
   }
 
   void ReleaseTZHandle_(GstBuffer* buffer) {
-#ifndef PLUPLAYER_DOWNLOADABLE_APP_TVPLUS
+#if !defined(TIZEN_FEATURE_PUBLIC) && !defined(PLUPLAYER_DOWNLOADABLE_APP_TVPLUS)
     GstStructure* tzqdata = GST_STRUCTURE(gst_mini_object_get_qdata(
         GST_MINI_OBJECT(buffer),
         g_quark_from_static_string("GstTzHandleData")));
index 30908c2..e7f3793 100755 (executable)
@@ -227,6 +227,9 @@ class TrackRendererAdapter {
   bool GetDecodingTime(StreamType type, int32_t* time_millisecond);
   bool SetVideoStreamRotationInfo(const VideoRotation& rotation);
   bool SetSimpleMixOutBufferLevel(const int& level);
+#ifdef TIZEN_FEATURE_PUBLIC
+  bool EnableVideoHole(bool value);
+#endif
 
  private:
   TrackRendererAdapter();
index 48f0759..1a86b9f 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <cassert>
 
-#ifndef PLUPLAYER_DOWNLOADABLE_APP_TVPLUS
+#if defined(TIZEN_FEATURE_PUBLIC) || !defined(PLUPLAYER_DOWNLOADABLE_APP_TVPLUS)
 #include "tzplatform_config.h"
 #endif
 
index 86a6df9..9d4089e 100644 (file)
@@ -1024,6 +1024,13 @@ bool TrackRendererAdapter::SetVideoStreamRotationInfo(
   }
   return true;
 }
+
+#ifdef TIZEN_FEATURE_PUBLIC
+bool TrackRendererAdapter::EnableVideoHole(bool value) {
+  return (trackrenderer_enable_video_hole(handle_, value) != kFailed);
+}
+#endif
+
 // LCOV_EXCL_START
 
 /////////////////////////////////////////////
index 9d46f79..8bdbdc5 100644 (file)
@@ -13,6 +13,9 @@ namespace esplusplayer {
 namespace adapter_utils {
 
 void InitTrack(TrackRendererTrack* track) {
+#ifdef TIZEN_FEATURE_PUBLIC
+  memset(track, 0x00, sizeof(TrackRendererTrack));
+#endif
   track->index = kTrackRendererInvalidTrackIndex;  // int index
   track->id = 0;                                   // int id
   track->mimetype = nullptr;                       // const char* mimetype
@@ -508,7 +511,11 @@ DecodedVideoPacket ConvertToDecodedVideoPacket(
   _packet.pts = packet->pts;
   _packet.duration = packet->duration;
   _packet.surface_data = static_cast<tbm_surface_h>(packet->surface_data);
+#ifdef TIZEN_FEATURE_PUBLIC
+  _packet.buffer_addr = packet->buffer_addr;
+#else
   _packet.scaler_index = packet->scaler_index;
+#endif
   return _packet;
 }
 
@@ -518,7 +525,11 @@ TrackRendererDecodedVideoPacket ConvertToDecodedVideoPacket(
   _packet.pts = packet.pts;
   _packet.duration = packet.duration;
   _packet.surface_data = static_cast<tbm_surface_h>(packet.surface_data);
+#ifdef TIZEN_FEATURE_PUBLIC
+  _packet.buffer_addr = packet.buffer_addr;
+#else
   _packet.scaler_index = packet.scaler_index;
+#endif
   return _packet;
 }
 
index bcce70e..0bf7256 100644 (file)
@@ -26,12 +26,17 @@ ENDIF(${USE_MIXER} STREQUAL "yes")
 
 SET(dependents "gstreamer-1.0 glib-2.0 gstreamer-plugins-base-1.0 gstreamer-app-1.0 dlog gtest gmock"
                "boost"
-               "tv-resource-manager appcore-efl elementary ecore evas ecore-wl2"
-               "libavoc"
-               "video-capture libturbojpeg libjpeg"
-               "audio-control video-sink capi-system-info"
+               "appcore-efl elementary ecore evas ecore-wl2"
+               " libturbojpeg libjpeg capi-system-info"
                )
 
+IF(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(dependents ${dependents} "tv-resource-manager r"
+                             "video-capture audio-control video-sink"
+                             "libavoc"
+                             )
+ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
+
 INCLUDE(FindPkgConfig)
 IF(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l)
 pkg_check_modules(${fw_name} REQUIRED ${dependents})
@@ -56,17 +61,27 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}
   ${PROJECT_SOURCE_DIR}/src/plusplayer-core/include_internal
   ${PROJECT_SOURCE_DIR}/src/esplusplayer/include_internal
+  )
+
+IF(${TIZEN_PUBLIC} STREQUAL "OFF")
+INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/mixer/include_internal
 )
+ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
+
+include_directories(/usr/include/ecore-wayland-1)
 
 FILE(GLOB UT_SRC
   src/utils/*.cpp
   src/esplusplayer/tclist.cpp
   src/ut_main.cpp
-  src/ut_cloudgame.cpp
   src/tc_regression.cpp
 )
 
+IF(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(UT_SRC ${UT_SRC} src/ut_cloudgame.cpp)
+ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
+
 IF(${USE_MIXER} STREQUAL "yes")
 SET(UT_MIXER_SRC
   src/mixer/constant.cpp
index 208d969..1f88872 100644 (file)
@@ -3,7 +3,9 @@
 #include <gmock/gmock.h>
 #include <gst/gst.h>
 #include <gtest/gtest.h>
+#ifndef TIZEN_FEATURE_PUBLIC
 #include <rm_api.h>
+#endif
 
 #include <condition_variable>
 #include <iostream>
@@ -238,6 +240,7 @@ class Context {
   Signal<bool, false> prepared_;
 };
 
+#ifndef TIZEN_FEATURE_PUBLIC
 struct ResourceManager {
   explicit ResourceManager() {
     rm_register(&ResourceManager::OnResourceConflicted, this, &rm_handle,
@@ -271,7 +274,7 @@ struct ResourceManager {
   int rm_handle = -1;
   int count = 0;
 };
-
+#endif
 }  // namespace
 
 class RegressionTest : public ::testing::Test {
@@ -319,8 +322,8 @@ TEST_F(RegressionTest, RendererConflictOnVideoPeekMode) {
   ASSERT_TRUE(ctx->WaitForPrepareDone()) << "Prepare failed";
   ASSERT_TRUE(ctx->Start());
 
+#ifndef TIZEN_FEATURE_PUBLIC
   std::this_thread::sleep_for(std::chrono::seconds(2));
-
   {
     ::ResourceManager rm;
     rm.RaiseResourceConflict(RM_CATEGORY_SCALER);
@@ -328,6 +331,7 @@ TEST_F(RegressionTest, RendererConflictOnVideoPeekMode) {
   }
 
   std::this_thread::sleep_for(std::chrono::seconds(2));
+#endif
 
   ASSERT_TRUE(ctx->Stop());
 }
\ No newline at end of file
index 8e4ee44..da03093 100644 (file)
@@ -17,6 +17,9 @@
 #include <fstream>
 #include <jconfig.h>
 #include <jpeglib.h>
+#ifdef TIZEN_FEATURE_PUBLIC
+#include <system_info.h>
+#else
 #include <capi-system-info/system_info.h>
 #include <capi-system-info/system_info_key.h>
 #include <system-type/system_type_enum.h>
@@ -24,6 +27,7 @@
 #include "capi-video-capture.h"
 #include "iaudio-control.hpp"
 #include "diagnosis-audio-control.hpp"
+#endif
 
 using namespace std;
 using namespace esplusplayer;
@@ -47,8 +51,10 @@ void Utility::ThreadSleep(long ms) {
 
 Utility::Utility() {
   appwindow_.reset(new esplusplayer_ut::AppWindow(0, 0, 1920, 1080));
+#ifndef TIZEN_FEATURE_PUBLIC
   audioControl = IAudioControl::getInstance();
   audioDiagnoser = DiagnosisAudioControl::getInstance();
+#endif
 }
 
 Utility::~Utility() {}
@@ -266,6 +272,7 @@ unsigned int Gcd(unsigned int u, unsigned int v) {
   return u << shift;
 }
 
+#ifndef TIZEN_FEATURE_PUBLIC
 void ResizeCopy(unsigned int m_width, unsigned int m_height,
                 unsigned int m_rwidth, unsigned int m_rheight,
                 char* c_ptr, char* y_ptr, unsigned char* dest,
@@ -494,6 +501,7 @@ bool Utility::IsAudioMute() {
   EXPECT_EQ(audioDiagnoser->Diagnosis_GetBoolean(0, "main out mute", &audioMute), 0);
   return (audioMute != 0);
 }
+#endif
 
 int Utility::GetPlayingTimeForManualTestInMsec() {
   // If you want to adjust the playingTime for the TC which use this method,