Merge branch 'main' into ci/gilbok-lee/update_public
authorGilbok Lee <gilbok.lee@samsung.com>
Tue, 5 Mar 2024 06:20:27 +0000 (15:20 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Tue, 5 Mar 2024 06:20:27 +0000 (15:20 +0900)
25 files changed:
.github/CODEOWNERS [new file with mode: 0644]
CMakeLists.txt
esplusplayer.pc.in
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 135c035..a6073d4 100644 (file)
@@ -7,6 +7,11 @@ SET(PC_NAME "esplusplayer")
 SET(PC_LDFLAGS "-lesplusplayer -lmixer")
 SET(PC_CFLAGS "-I/usr/include/esplusplayer_capi -I/usr/include/mixer")
 
+IF(${TIZEN_PUBLIC} STREQUAL "ON")
+SET(PC_REQUIRED "capi-media-sound-manager")
+SET(PC_CFLAGS "${PC_CFLAGS} -DTIZEN_FEATURE_PUBLIC")
+ENDIF(${TIZEN_PUBLIC} STREQUAL "ON")
+
 SET(INC_DIR ${PROJECT_SOURCE_DIR}/include/)
 INCLUDE_DIRECTORIES(${INC_DIR})
 SET(CMAKE_INSTALL_PREFIX /usr)
index 8625c6f..a319c7d 100644 (file)
@@ -6,5 +6,6 @@ libdir = @LIB_INSTALL_DIR@
 Name: @PC_NAME@
 Description: @PACKAGE_DESCRYPTION@
 Version: @VERSION@
+Requires: @PC_REQUIRED@
 Libs: -L${libdir} @PC_LDFLAGS@
 Cflags : @PC_CFLAGS@
index 756cdcb..54e967d 100644 (file)
 #include <utility>
 #include <vector>
 
+#ifdef TIZEN_FEATURE_PUBLIC
+#include <sound_manager.h>
+#endif
+
 #ifdef USE_MIXER
 #include "mixer/mixer.h"
 #endif
@@ -1334,6 +1338,25 @@ 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; }
+
+  /**
+   * @brief     Set sound stream information
+   * @param     [in] stream_info : sound stream information
+   * @pre       The player state must be set to #EsState::kIdle.
+   * @post      None
+   * @return    @c True on success, otherwise @c False
+   * @exception  None
+   */
+  virtual bool SetSoundStreamInfo(const sound_stream_info_h stream_info) {
+    return false;
+  }
+#endif
   // LCOV_EXCL_STOP
 
  protected:
index 93e78c1..7b8abfa 100644 (file)
@@ -60,12 +60,15 @@ 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{
+struct DecoderBufferTime {
   uint64_t pts = 0;
   uint64_t system_time = 0;
-} ;
+};
 
 /**
  * @brief Enumerations for the state of getting decoded packet
index 7a7a4dc..dc5db67 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 2a2d52a..adcb859 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 4f26314..51861bd 100755 (executable)
 #ifndef __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
 #define __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
 
+#ifdef TIZEN_FEATURE_PUBLIC
+#include <media/sound_manager.h>
+#endif
+
 #include "esplusplayer_capi/buffer.h"
 #include "esplusplayer_capi/display.h"
 #include "esplusplayer_capi/drm.h"
@@ -3958,6 +3962,62 @@ 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);
+
+/**
+ * @brief     Set sound stream information
+ * @param     [in] handle      : esplusplayer handle.
+ * @param     [in] stream_info : sound stream information
+ * @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_set_sound_stream_info(esplayer, stream_info);
+ *            // ... your codes ...
+ *            esplusplayer_close(esplayer);
+ * @endcode
+ * @pre       The player state must be set to #ESPLUSPLAYER_STATE_IDLE
+ * @post      None
+ * @exception None
+ * @see       esplusplayer_open()
+ */
+int esplusplayer_set_sound_stream_info(esplusplayer_handle handle,
+                                       const sound_stream_info_h stream_info);
+#endif
 #ifdef __cplusplus
 }
 #endif
index 75db547..78e3f09 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 e97b285..0219847 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 38ed4e3..a14219d 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
@@ -8,7 +9,6 @@
 Name:       esplusplayer
 Summary:    new multimedia streaming player
 Version:    1.3.7
-Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
@@ -24,22 +24,32 @@ BuildRequires:  pkgconfig(elementary)
 BuildRequires:  pkgconfig(ecore)
 BuildRequires:  pkgconfig(evas)
 BuildRequires:  pkgconfig(ecore-wl2)
+%if %{with TIZEN_PUBLIC}
+BuildRequires:  pkgconfig(libtrackrenderer)
+BuildRequires:  pkgconfig(capi-media-sound-manager)
+# for test
+BuildRequires:  pkgconfig(capi-mediademuxer)
+BuildRequires:  pkgconfig(appcore-efl)
+%else
 BuildRequires:  pkgconfig(tv-resource-manager)
+BuildRequires:  pkgconfig(drmdecrypt)
+BuildRequires:  pkgconfig(context-aware-api)
+%if ("%{_vd_cfg_product_type}" != "AUDIO")
+BuildRequires:  pkgconfig(graphics-control)
+%endif
+BuildRequires:  pkgconfig(capi-trackrenderer-tv)
+BuildRequires:  pkgconfig(logger)
+%endif
+
 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)
-%endif
 
 %if ("%{sec_buildconf_product_lite_tizen}" == "n")
 # for ut
@@ -99,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}
 
@@ -121,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"
@@ -132,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")
@@ -157,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 dc95d9c..6a62e6a 100644 (file)
@@ -21,11 +21,16 @@ 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"
                "drmdecrypt")
 
+IF(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(dependents ${dependents} "tv-resource-manager")
+ELSE(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(dependents ${dependents} "capi-media-sound-manager")
+ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
+
 INCLUDE(FindPkgConfig)
 
 IF(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l)
index a2b1a91..8f0b2d6 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;
@@ -162,7 +174,7 @@ class DecodedScaledPacketList : public AbstractDecodedPacketList {
  public:
   explicit DecodedScaledPacketList() { LOG_DEBUG("created"); }
   virtual ~DecodedScaledPacketList() { LOG_DEBUG("destroyed"); }
-// LCOV_EXCL_START
+  // LCOV_EXCL_START
   virtual void GetFreeTbmSurface(void** ptr, bool is_scale_change) {
     std::unique_lock<std::mutex> lk(mtx_);
     if (is_scale_change) {
@@ -253,7 +265,7 @@ class DecodedScaledPacketList : public AbstractDecodedPacketList {
       return false;
     });
   }
-// LCOV_EXCL_STOP
+  // LCOV_EXCL_STOP
 
   virtual void Clear() override {
     std::unique_lock<std::mutex> lk(mtx_);
@@ -268,7 +280,7 @@ class DecodedScaledPacketList : public AbstractDecodedPacketList {
   }
 
  protected:
-// LCOV_EXCL_START
+  // LCOV_EXCL_START
   virtual bool IsAvailableInternal() override {
     if (GetList().size() > kMaxAvailableSize_) return false;
     return true;
@@ -293,7 +305,7 @@ class DecodedScaledPacketList : public AbstractDecodedPacketList {
       }
     }
   }
-// LCOV_EXCL_STOP
+  // LCOV_EXCL_STOP
 
  private:
   const std::uint32_t kMaxAvailableSize_ = 5;
index 9a57424..2deec7d 100644 (file)
@@ -18,7 +18,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"
@@ -158,6 +160,10 @@ class EsPlayer : public EsPlusPlayer {
   bool GetVideoStreamRotationInfo(VideoRotation* rotation) override;
   bool SetSimpleMixOutBufferLevel(
       const PlayerSimpleMixOutBufferLevel level) override;
+#ifdef TIZEN_FEATURE_PUBLIC
+  bool EnableVideoHole(bool value) override;
+  bool SetSoundStreamInfo(const sound_stream_info_h stream_info) override;
+#endif  // TIZEN_FEATURE_PUBLIC
 
  private:
   using SubmitPacketOperator =
@@ -216,7 +222,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
index a022e13..9096ef6 100755 (executable)
@@ -18,7 +18,9 @@
 
 #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"
@@ -294,9 +296,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_();
 }
 
@@ -325,9 +329,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);
@@ -514,7 +521,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);
@@ -546,8 +555,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;
 }
@@ -715,8 +726,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)) {
@@ -736,9 +749,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);
 }
 
@@ -776,7 +791,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);
@@ -809,7 +826,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);
@@ -878,7 +897,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) {
@@ -893,7 +914,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) {
@@ -1170,7 +1193,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);
@@ -2995,6 +3020,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;
@@ -3017,12 +3043,37 @@ 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);
+}
+
+bool EsPlayer::SetSoundStreamInfo(const sound_stream_info_h stream_info) {
+  if (state_manager_.GetState() != EsState::kIdle) {
+    LOG_ERROR_P(this, "Invalid State , current %d",
+                state_manager_.GetStateEnum());
+    return false;
+  }
+  if (!stream_info) {
+    LOG_ERROR_P(this, "stream_info is null");
+    return false;
+  }
+  return trackrenderer_->SetSoundStreamInfo(stream_info);
+}
+#endif
+
 namespace es_conf {
 
 void LoadIniProperty(const Json::Value& root) {
index e28a0b3..f35c970 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);
@@ -2418,3 +2430,24 @@ 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);
+}
+
+int esplusplayer_set_sound_stream_info(esplusplayer_handle handle,
+                                       const sound_stream_info_h stream_info) {
+  LOG_ENTER_P(cast_(handle))
+  if (is_null_(handle) || is_null_(stream_info))
+    return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
+
+  auto ret = cast_(handle)->SetSoundStreamInfo(stream_info);
+  return convert_return_type_(ret);
+}
+#endif
index 126768e..e9fb4a8 100644 (file)
@@ -13,11 +13,16 @@ 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")
+ELSE(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(dependents ${dependents} "capi-media-sound-manager")
+ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
 
 INCLUDE(FindPkgConfig)
 
@@ -50,11 +55,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..69b17d3 100644 (file)
@@ -12,7 +12,8 @@
 
 #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 +87,8 @@ 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 6611a15..cf1fd9b 100644 (file)
@@ -228,6 +228,10 @@ 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);
+  bool SetSoundStreamInfo(const sound_stream_info_h stream_info);
+#endif
 
  private:
   TrackRendererAdapter();
index 48f0759..6e835fb 100644 (file)
@@ -4,21 +4,21 @@
 
 #include <cassert>
 
-#ifndef PLUPLAYER_DOWNLOADABLE_APP_TVPLUS
+#if defined(TIZEN_FEATURE_PUBLIC) || !defined(PLUPLAYER_DOWNLOADABLE_APP_TVPLUS)
 #include "tzplatform_config.h"
 #endif
 
 namespace esplusplayer {
 
 namespace esplusplayer_cfg {
-  
+
 const char* GetIniPath() {
   const char* path =
-    tzplatform_mkpath(TZ_SYS_RO_ETC, "multimedia/esplusplayer.ini");
+      tzplatform_mkpath(TZ_SYS_RO_ETC, "multimedia/esplusplayer.ini");
   assert(path);
   return path;
 }
 
-} // namespace esplusplayer_cfg
+}  // namespace esplusplayer_cfg
 
-} // namespace esplusplayer
\ No newline at end of file
+}  // namespace esplusplayer
\ No newline at end of file
index 038ab65..d1ae7f0 100644 (file)
@@ -1028,6 +1028,18 @@ bool TrackRendererAdapter::SetVideoStreamRotationInfo(
   }
   return true;
 }
+
+#ifdef TIZEN_FEATURE_PUBLIC
+bool TrackRendererAdapter::EnableVideoHole(bool value) {
+  return (trackrenderer_enable_video_hole(handle_, value) != kFailed);
+}
+
+bool TrackRendererAdapter::SetSoundStreamInfo(
+    const sound_stream_info_h stream_info) {
+  return (trackrenderer_set_sound_stream_info(handle_, stream_info) != kFailed);
+}
+#endif
+
 // LCOV_EXCL_START
 
 /////////////////////////////////////////////
index 5666638..bde1350 100755 (executable)
@@ -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..d3475f6 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>
@@ -34,7 +36,7 @@ class Context {
     std::unique_ptr<EsStreamReader> reader = nullptr;
     bool ready_to_push = false;
 
-    explicit StreamContext(const std::string &path,
+    explicit StreamContext(const std::stringpath,
                            esplusplayer_stream_type type) noexcept {
       reader = std::make_unique<EsStreamReader>(path, type);
     }
@@ -113,7 +115,7 @@ class Context {
     return prepared_.result;
   }
 
-  bool SetDisplay(void *window) {
+  bool SetDisplay(voidwindow) {
     return esplusplayer_set_display(handle_, ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,
                                     window) == ESPLUSPLAYER_ERROR_TYPE_NONE;
   }
@@ -138,7 +140,7 @@ class Context {
   }
 
  public:
-  static Context *Create(const std::string &path) {
+  static Context* Create(const std::string& path) {
     if (path.empty()) {
       return nullptr;
     }
@@ -153,7 +155,7 @@ class Context {
   }
 
  private:
-  explicit Context(const std::string &path) : path_(path) {}
+  explicit Context(const std::stringpath) : path_(path) {}
 
   bool Init() {
     video_ = std::make_unique<StreamContext>(path_ + "video/",
@@ -209,23 +211,23 @@ class Context {
   }
 
  private:
-  static void OnError(const esplusplayer_error_type, void *) {
+  static void OnError(const esplusplayer_error_type, void*) {
     std::cout << "Error happened" << std::endl;
   }
-  static void OnResourceConflicted(void *) {
+  static void OnResourceConflicted(void*) {
     std::cout << "Resource conflicted" << std::endl;
   }
-  static void OnPrepared(bool ret, void *userdata) {
+  static void OnPrepared(bool ret, voiduserdata) {
     std::cout << "Prepared" << std::endl;
-    auto *ctx = static_cast<Context *>(userdata);
+    auto* ctx = static_cast<Context*>(userdata);
     ctx->StartDataFeedingTask(ESPLUSPLAYER_STREAM_TYPE_VIDEO);
     ctx->StartDataFeedingTask(ESPLUSPLAYER_STREAM_TYPE_AUDIO);
     ctx->SignalPrepareDone(ret);
   }
   static void OnReadyToPrepare(const esplusplayer_stream_type type,
-                               void *userdata) {
+                               voiduserdata) {
     std::cout << "Ready to prepare" << std::endl;
-    auto *ctx = static_cast<Context *>(userdata);
+    auto* ctx = static_cast<Context*>(userdata);
     ctx->StartDataFeedingTask(type);
   }
 
@@ -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,
@@ -263,15 +266,15 @@ struct ResourceManager {
   }
 
   static rm_cb_result OnResourceConflicted(int handle, rm_callback_type event,
-                                           rm_device_request_s *info,
-                                           void *data) {
+                                           rm_device_request_sinfo,
+                                           voiddata) {
     return RM_CB_RESULT_OK;
   }
 
   int rm_handle = -1;
   int count = 0;
 };
-
+#endif
 }  // namespace
 
 class RegressionTest : public ::testing::Test {
@@ -287,10 +290,10 @@ class RegressionTest : public ::testing::Test {
   }
 
  protected:
-  static ::Environment *window_;
+  static ::Environmentwindow_;
 };
 
-::Environment *RegressionTest::window_ = nullptr;
+::EnvironmentRegressionTest::window_ = nullptr;
 
 /*
  * [[ DF230714-00327 ]]
@@ -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 65ba9c3..83a498f 100644 (file)
@@ -9,7 +9,6 @@
 #include <jpeglib.h>
 #include <math.h>
 #include <poll.h>
-#include <system-type/system_type_enum.h>
 #include <unistd.h>
 
 #include <algorithm>
 #include <fstream>
 #include <memory>
 
+#include "ut/include/esplusplayer/eseventlistener.hpp"
+#include "ut/include/esplusplayer/esreader.hpp"
+#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>
+
 #include "capi-video-capture.h"
 #include "diagnosis-audio-control.hpp"
 #include "iaudio-control.hpp"
 #include "ivideocapture.hpp"
-#include "ut/include/esplusplayer/eseventlistener.hpp"
-#include "ut/include/esplusplayer/esreader.hpp"
+#endif
 
 using namespace std;
 using namespace esplusplayer;
@@ -47,8 +54,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 +275,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, unsigned int color_format) {
@@ -494,6 +504,7 @@ bool Utility::IsAudioMute() {
       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,