diff --git a/packages/video_player_videohole/tizen/inc/ftpw_video_player_videohole.h b/packages/video_player_videohole/tizen/inc/ftpw_video_player_videohole.h new file mode 100644 index 000000000..63f0ee808 --- /dev/null +++ b/packages/video_player_videohole/tizen/inc/ftpw_video_player_videohole.h @@ -0,0 +1,121 @@ +// Copyright 2026 Samsung Electronics Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +#ifndef FLUTTER_TIZEN_PLUGINS_WRAPPER_VIDEO_PLAYER_VIDEOHOLE_H_ +#define FLUTTER_TIZEN_PLUGINS_WRAPPER_VIDEO_PLAYER_VIDEOHOLE_H_ + +#include +#include + +#define MAX_STRING_NAME_LEN 255 +#define MMPLAYER_FOUR_CC_LEN 14 +#define PLAYER_LANG_NAME_SIZE 10 + +typedef struct { + char fourCC[MMPLAYER_FOUR_CC_LEN + 1]; /**< codec fourcc */ + char name[MAX_STRING_NAME_LEN]; /**< name: video/audio, it maybe not exit in + some track*/ + /*dynamic infos in hls,ss,dash streams*/ + int width; /**< resolution width */ + int height; /**< resolution height */ + int bit_rate; /**< bitrate in bps */ +} player_video_track_info_v2; + +typedef struct { + char fourCC[MMPLAYER_FOUR_CC_LEN + 1]; /**< codec fourcc */ + char language[PLAYER_LANG_NAME_SIZE]; /**< language info*/ + /*dynamic infos in hls,ss,dash streams*/ + int sample_rate; /**< sample rate in this track*/ + int channel; /**< channel in this track*/ + int bit_rate; /**< bitrate in this track*/ +} player_audio_track_info_v2; + +typedef struct { + char fourCC[MMPLAYER_FOUR_CC_LEN + 1]; /**< codec fourcc */ + char language[PLAYER_LANG_NAME_SIZE]; /**< language info*/ + int subtitle_type; /**< text subtitle = 0, picture subtitle = 1 */ +} player_subtitle_track_info_v2; + +typedef enum { + PLAYER_DRM_TYPE_EME = 14, +} player_drm_type_e; + +typedef enum { + PLAYER_ADAPTIVE_INFO_LIVE_DURATION = 3, + PLAYER_ADAPTIVE_INFO_IS_LIVE = 19, +} player_adaptive_Info_e; + +typedef enum { + CENC = 0, + KEYIDS = 1, + WEBM = 2, +} drm_init_data_type; + +typedef bool (*security_init_complete_cb)(int *drmhandle, unsigned int length, + unsigned char *psshdata, + void *user_data); +typedef int (*set_drm_init_data_cb)(drm_init_data_type init_type, void *data, + int data_length, void *user_data); + +typedef enum { + DM_ERROR_NONE = 0, + DM_ERROR_INVALID_SESSION = 21, +} dm_error_e; + +typedef struct SetDataParam_s { + void *param1; /**< Parameter 1 */ + void *param2; /**< Parameter 2 */ + void *param3; /**< Parameter 3 */ + void *param4; /**< Parameter 4 */ +} SetDataParam_t; + +typedef void *DRMSessionHandle_t; + +#ifdef __cplusplus +extern "C" { +#endif + +// Native libraries remain loaded for the process lifetime (callbacks may +// outlive calls). + +int ftpw_video_player_videohole_player_set_ecore_wl_display( + void *player, int type, void *ecore_wl_window, int x, int y, int width, + int height); +int ftpw_video_player_videohole_player_set_drm_handle( + void *player, player_drm_type_e drm_type, int drm_handle); +int ftpw_video_player_videohole_player_set_drm_init_complete_cb( + void *player, security_init_complete_cb callback, void *user_data); +int ftpw_video_player_videohole_player_set_drm_init_data_cb( + void *player, set_drm_init_data_cb callback, void *user_data); +int ftpw_video_player_videohole_player_get_adaptive_streaming_info( + void *player, void *adaptive_info, int adaptive_type); +int ftpw_video_player_videohole_player_get_track_count_v2(void *player, + int type, + int *pcount); +int ftpw_video_player_videohole_player_get_video_track_info_v2( + void *player, int index, player_video_track_info_v2 **track_info); +int ftpw_video_player_videohole_player_get_audio_track_info_v2( + void *player, int index, player_audio_track_info_v2 **track_info); +int ftpw_video_player_videohole_player_get_subtitle_track_info_v2( + void *player, int index, player_subtitle_track_info_v2 **track_info); +bool ftpw_video_player_videohole_device_power_is_standby(void); +int ftpw_video_player_videohole_DMGRSetData(DRMSessionHandle_t drm_session, + const char *data_type, + void *input_data); +int ftpw_video_player_videohole_DMGRGetData(DRMSessionHandle_t drm_session, + const char *data_type, + void *output_data); +void ftpw_video_player_videohole_DMGRSetDRMLocalMode(void); +DRMSessionHandle_t ftpw_video_player_videohole_DMGRCreateDRMSession( + const char *drm_sub_type); +bool ftpw_video_player_videohole_DMGRSecurityInitCompleteCB( + int *drm_handle, unsigned int len, unsigned char *pssh_data, + void *user_data); +int ftpw_video_player_videohole_DMGRReleaseDRMSession( + DRMSessionHandle_t drm_session); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/packages/video_player_videohole/tizen/lib/aarch64/libftpw_video_player_videohole.so b/packages/video_player_videohole/tizen/lib/aarch64/libftpw_video_player_videohole.so new file mode 100755 index 000000000..efff22182 Binary files /dev/null and b/packages/video_player_videohole/tizen/lib/aarch64/libftpw_video_player_videohole.so differ diff --git a/packages/video_player_videohole/tizen/lib/armel/libftpw_video_player_videohole.so b/packages/video_player_videohole/tizen/lib/armel/libftpw_video_player_videohole.so new file mode 100755 index 000000000..b6bbc1c2e Binary files /dev/null and b/packages/video_player_videohole/tizen/lib/armel/libftpw_video_player_videohole.so differ diff --git a/packages/video_player_videohole/tizen/lib/i586/libftpw_video_player_videohole.so b/packages/video_player_videohole/tizen/lib/i586/libftpw_video_player_videohole.so new file mode 100755 index 000000000..e6560853f Binary files /dev/null and b/packages/video_player_videohole/tizen/lib/i586/libftpw_video_player_videohole.so differ diff --git a/packages/video_player_videohole/tizen/lib/x86_64/libftpw_video_player_videohole.so b/packages/video_player_videohole/tizen/lib/x86_64/libftpw_video_player_videohole.so new file mode 100755 index 000000000..f0257c57d Binary files /dev/null and b/packages/video_player_videohole/tizen/lib/x86_64/libftpw_video_player_videohole.so differ diff --git a/packages/video_player_videohole/tizen/project_def.prop b/packages/video_player_videohole/tizen/project_def.prop index e4b3eb48b..cd80a2851 100644 --- a/packages/video_player_videohole/tizen/project_def.prop +++ b/packages/video_player_videohole/tizen/project_def.prop @@ -18,3 +18,6 @@ USER_CPP_UNDEFS = USER_INC_DIRS = inc src USER_INC_FILES = USER_CPP_INC_FILES = + +USER_LIB_DIRS += lib/${BUILD_ARCH} +USER_LIBS += ftpw_video_player_videohole diff --git a/packages/video_player_videohole/tizen/src/device_proxy.cc b/packages/video_player_videohole/tizen/src/device_proxy.cc deleted file mode 100644 index 53e686365..000000000 --- a/packages/video_player_videohole/tizen/src/device_proxy.cc +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2025 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "device_proxy.h" - -#include - -#include "log.h" - -typedef power_state_e (*FunDevicePowerGetState)(void); - -DeviceProxy::DeviceProxy() { - power_state_handle_ = dlopen("libdeviced.so.1", RTLD_LAZY); - if (power_state_handle_ == nullptr) { - LOG_ERROR("Failed to open libdeviced.so.1"); - } -} - -DeviceProxy::~DeviceProxy() { - if (power_state_handle_) { - dlclose(power_state_handle_); - power_state_handle_ = nullptr; - } -} - -power_state_e DeviceProxy::device_power_get_state(void) { - if (!power_state_handle_) { - LOG_ERROR("power_state_handle_ is invalid."); - return POWER_STATE_ERROR; - } - FunDevicePowerGetState device_power_get_state = - reinterpret_cast( - dlsym(power_state_handle_, "device_power_get_state")); - if (!device_power_get_state) { - LOG_ERROR("Failed to find device_power_get_state function."); - return POWER_STATE_ERROR; - } - return device_power_get_state(); -} diff --git a/packages/video_player_videohole/tizen/src/device_proxy.h b/packages/video_player_videohole/tizen/src/device_proxy.h deleted file mode 100644 index ee218b2da..000000000 --- a/packages/video_player_videohole/tizen/src/device_proxy.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2025 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLUTTER_PLUGIN_DEVICE_PROXY_H_ -#define FLUTTER_PLUGIN_DEVICE_PROXY_H_ - -typedef enum { - POWER_STATE_NORMAL, /**< Normal state */ - POWER_STATE_PICTUREOFF, /**< Picture off state */ - POWER_STATE_STANDBY, /**< Background Standby state */ - POWER_STATE_OFF, /**< Cold Standby state */ - POWER_STATE_SUSPEND_STANDBY, /**< Suspend Standby state */ - POWER_STATE_ERROR /**< Error state */ -} power_state_e; - -class DeviceProxy { - public: - DeviceProxy(); - ~DeviceProxy(); - power_state_e device_power_get_state(void); - - private: - void* power_state_handle_ = nullptr; -}; - -#endif // FLUTTER_PLUGIN_DEVICE_PROXY_H_ diff --git a/packages/video_player_videohole/tizen/src/drm_manager.cc b/packages/video_player_videohole/tizen/src/drm_manager.cc index 56af62eac..1fbb37d6a 100644 --- a/packages/video_player_videohole/tizen/src/drm_manager.cc +++ b/packages/video_player_videohole/tizen/src/drm_manager.cc @@ -8,7 +8,7 @@ #include #include "drm_license_helper.h" -#include "drm_manager_proxy.h" +#include "ftpw_video_player_videohole.h" #include "log.h" static std::string GetDrmSubType(int drm_type) { @@ -21,20 +21,7 @@ static std::string GetDrmSubType(int drm_type) { } } -DrmManager::DrmManager() : drm_type_(DM_TYPE_NONE) { - drm_manager_proxy_ = OpenDrmManagerProxy(); - if (drm_manager_proxy_) { - int ret = InitDrmManagerProxy(drm_manager_proxy_); - if (ret != DM_ERROR_NONE) { - LOG_ERROR("[DrmManager] Fail to initialize DRM manager: %s", - get_error_message(ret)); - CloseDrmManagerProxy(drm_manager_proxy_); - drm_manager_proxy_ = nullptr; - } - } else { - LOG_ERROR("[DrmManager] Fail to dlopen libdrmmanager."); - } - +DrmManager::DrmManager() : drm_type_(DRM_TYPE_NONE) { // Initialize GMainContext and license request state main_context_ = std::unique_ptr( g_main_context_ref_thread_default()); @@ -58,27 +45,18 @@ DrmManager::~DrmManager() { } main_context_.reset(); - - if (drm_manager_proxy_) { - CloseDrmManagerProxy(drm_manager_proxy_); - drm_manager_proxy_ = nullptr; - } } bool DrmManager::CreateDrmSession(int drm_type, bool local_mode) { - if (!drm_manager_proxy_) { - LOG_ERROR("[DrmManager] Invalid handle of libdrmmanager."); - return false; - } - if (local_mode) { - DMGRSetDRMLocalMode(); + ftpw_video_player_videohole_DMGRSetDRMLocalMode(); } drm_type_ = drm_type; std::string sub_type = GetDrmSubType(drm_type); LOG_INFO("[DrmManager] drm type is %s", sub_type.c_str()); - drm_session_ = DMGRCreateDRMSession(DM_TYPE_EME, sub_type.c_str()); + drm_session_ = ftpw_video_player_videohole_DMGRCreateDRMSession( + sub_type.c_str()); if (!drm_session_) { LOG_ERROR("[DrmManager] Fail to create drm session."); return false; @@ -89,7 +67,8 @@ bool DrmManager::CreateDrmSession(int drm_type, bool local_mode) { SetDataParam_t configure_param = {}; configure_param.param1 = reinterpret_cast(OnDrmManagerError); configure_param.param2 = drm_session_; - int ret = DMGRSetData(drm_session_, "error_event_callback", &configure_param); + int ret = ftpw_video_player_videohole_DMGRSetData( + drm_session_, "error_event_callback", &configure_param); if (ret != DM_ERROR_NONE) { LOG_ERROR( "[DrmManager] Fail to set error_event_callback to drm session: %s", @@ -125,14 +104,15 @@ void DrmManager::StopDrmSession() { SetDataParam_t challenge_data_param = {}; challenge_data_param.param1 = nullptr; challenge_data_param.param2 = nullptr; - int ret = DMGRSetData(drm_session_, "eme_request_key_callback", - &challenge_data_param); + int ret = ftpw_video_player_videohole_DMGRSetData( + drm_session_, "eme_request_key_callback", &challenge_data_param); if (ret != DM_ERROR_NONE) { LOG_ERROR("[DrmManager] Fail to unset eme_request_key_callback: %s", get_error_message(ret)); } - ret = DMGRSetData(drm_session_, "Finalize", nullptr); + ret = ftpw_video_player_videohole_DMGRSetData(drm_session_, "Finalize", + nullptr); if (ret != DM_ERROR_NONE) { LOG_ERROR("[DrmManager] Fail to set finalize to drm session: %s", @@ -146,7 +126,7 @@ void DrmManager::ReleaseDrmSession() { return; } - int ret = DMGRReleaseDRMSession(drm_session_); + int ret = ftpw_video_player_videohole_DMGRReleaseDRMSession(drm_session_); if (ret != DM_ERROR_NONE) { LOG_ERROR("[DrmManager] Fail to release drm session: %s", get_error_message(ret)); @@ -157,7 +137,8 @@ void DrmManager::ReleaseDrmSession() { bool DrmManager::GetDrmHandle(int *handle) { if (drm_session_) { *handle = 0; - int ret = DMGRGetData(drm_session_, "drm_handle", handle); + int ret = ftpw_video_player_videohole_DMGRGetData(drm_session_, + "drm_handle", handle); if (ret != DM_ERROR_NONE) { LOG_ERROR("[DrmManager] Fail to get drm_handle from drm session: %s", get_error_message(ret)); @@ -180,7 +161,8 @@ int DrmManager::UpdatePsshData(const void *data, int length) { SetDataParam_t pssh_data_param = {}; pssh_data_param.param1 = const_cast(data); pssh_data_param.param2 = reinterpret_cast(length); - int ret = DMGRSetData(drm_session_, "update_pssh_data", &pssh_data_param); + int ret = ftpw_video_player_videohole_DMGRSetData( + drm_session_, "update_pssh_data", &pssh_data_param); if (DM_ERROR_NONE != ret) { LOG_ERROR("[DrmManager] Fail to set update_pssh_data to drm session: %s", get_error_message(ret)); @@ -200,8 +182,8 @@ bool DrmManager::SecurityInitCompleteCB(int *drm_handle, unsigned int len, } security_param.param2 = drm_session_; - return DMGRSecurityInitCompleteCB(drm_handle, len, pssh_data, - &security_param); + return ftpw_video_player_videohole_DMGRSecurityInitCompleteCB( + drm_handle, len, pssh_data, &security_param); } int DrmManager::SetChallenge(const std::string &media_url) { @@ -213,8 +195,8 @@ int DrmManager::SetChallenge(const std::string &media_url) { SetDataParam_t challenge_data_param = {}; challenge_data_param.param1 = reinterpret_cast(OnChallengeData); challenge_data_param.param2 = this; - int ret = DMGRSetData(drm_session_, "eme_request_key_callback", - &challenge_data_param); + int ret = ftpw_video_player_videohole_DMGRSetData( + drm_session_, "eme_request_key_callback", &challenge_data_param); if (ret != DM_ERROR_NONE) { LOG_ERROR( "[DrmManager] Fail to set eme_request_key_callback to drm session: " @@ -223,8 +205,9 @@ int DrmManager::SetChallenge(const std::string &media_url) { return ret; } - ret = DMGRSetData(drm_session_, "set_playready_manifest", - static_cast(const_cast(media_url.c_str()))); + ret = ftpw_video_player_videohole_DMGRSetData( + drm_session_, "set_playready_manifest", + static_cast(const_cast(media_url.c_str()))); if (ret != DM_ERROR_NONE) { LOG_ERROR( "[DrmManager] Fail to set set_playready_manifest to drm session: %s", @@ -232,7 +215,8 @@ int DrmManager::SetChallenge(const std::string &media_url) { return ret; } - ret = DMGRSetData(drm_session_, "Initialize", nullptr); + ret = ftpw_video_player_videohole_DMGRSetData(drm_session_, "Initialize", + nullptr); if (ret != DM_ERROR_NONE) { LOG_ERROR("[DrmManager] Fail to set initialize to drm session: %s", get_error_message(ret)); @@ -299,7 +283,8 @@ void DrmManager::InstallKey(void *session_id, void *response_data, license_param.param1 = session_id; license_param.param2 = response_data; license_param.param3 = response_len; - int ret = DMGRSetData(drm_session_, "install_eme_key", &license_param); + int ret = ftpw_video_player_videohole_DMGRSetData( + drm_session_, "install_eme_key", &license_param); if (ret != DM_ERROR_NONE) { LOG_ERROR("[DrmManager] Fail to install eme key: %s", get_error_message(ret)); diff --git a/packages/video_player_videohole/tizen/src/drm_manager.h b/packages/video_player_videohole/tizen/src/drm_manager.h index 5881e54b6..f129b1699 100644 --- a/packages/video_player_videohole/tizen/src/drm_manager.h +++ b/packages/video_player_videohole/tizen/src/drm_manager.h @@ -11,8 +11,6 @@ #include #include -#include "drm_manager_proxy.h" - class DrmManager { public: typedef enum { @@ -61,7 +59,6 @@ class DrmManager { request_license_channel_; void *drm_session_ = nullptr; - void *drm_manager_proxy_ = nullptr; int drm_type_; std::string license_server_url_; diff --git a/packages/video_player_videohole/tizen/src/drm_manager_proxy.cc b/packages/video_player_videohole/tizen/src/drm_manager_proxy.cc deleted file mode 100644 index 5a59c9c14..000000000 --- a/packages/video_player_videohole/tizen/src/drm_manager_proxy.cc +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "drm_manager_proxy.h" - -#include - -FuncDMGRSetData DMGRSetData = nullptr; -FuncDMGRGetData DMGRGetData = nullptr; -FuncDMGRSetDRMLocalMode DMGRSetDRMLocalMode = nullptr; -FuncDMGRCreateDRMSession DMGRCreateDRMSession = nullptr; -FuncDMGRSecurityInitCompleteCB DMGRSecurityInitCompleteCB = nullptr; -FuncDMGRReleaseDRMSession DMGRReleaseDRMSession = nullptr; - -void* OpenDrmManagerProxy() { return dlopen("libdrmmanager.so.0", RTLD_LAZY); } - -int InitDrmManagerProxy(void* handle) { - if (!handle) { - return DM_ERROR_INVALID_PARAM; - } - - DMGRSetData = reinterpret_cast(dlsym(handle, "DMGRSetData")); - if (!DMGRSetData) { - return DM_ERROR_DL; - } - - DMGRGetData = reinterpret_cast(dlsym(handle, "DMGRGetData")); - if (!DMGRGetData) { - return DM_ERROR_DL; - } - - DMGRSetDRMLocalMode = reinterpret_cast( - dlsym(handle, "DMGRSetDRMLocalMode")); - if (!DMGRSetDRMLocalMode) { - return DM_ERROR_DL; - } - - DMGRCreateDRMSession = reinterpret_cast( - dlsym(handle, "DMGRCreateDRMSession")); - if (!DMGRCreateDRMSession) { - return DM_ERROR_DL; - } - - DMGRSecurityInitCompleteCB = reinterpret_cast( - dlsym(handle, "DMGRSecurityInitCompleteCB")); - if (!DMGRSecurityInitCompleteCB) { - return DM_ERROR_DL; - } - - DMGRReleaseDRMSession = reinterpret_cast( - dlsym(handle, "DMGRReleaseDRMSession")); - if (!DMGRReleaseDRMSession) { - return DM_ERROR_DL; - } - - return DM_ERROR_NONE; -} - -void CloseDrmManagerProxy(void* handle) { - if (handle) { - dlclose(handle); - } -} diff --git a/packages/video_player_videohole/tizen/src/drm_manager_proxy.h b/packages/video_player_videohole/tizen/src/drm_manager_proxy.h deleted file mode 100644 index 02261d1b1..000000000 --- a/packages/video_player_videohole/tizen/src/drm_manager_proxy.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLUTTER_PLUGIN_DRM_MANAGER_PROXY_H_ -#define FLUTTER_PLUGIN_DRM_MANAGER_PROXY_H_ - -typedef enum { - DM_ERROR_NONE = 0, /**< Success */ - DM_ERROR_INVALID_PARAM, /**< Invalid parameter */ - DM_ERROR_INVALID_OPERATE, /**< Invalid operation */ - DM_ERROR_INVALID_HANDLE, /**< Invalid handle */ - DM_ERROR_INTERNAL_ERROR, /**< Internal error */ - DM_ERROR_TIMEOUT, /**< Timeout */ - DM_ERROR_MANIFEST_DOWNLOAD_ERROR, /**< Manifest download error */ - DM_ERROR_MANIFEST_PARSE_ERROR, /**< Manifest parse error */ - DM_ERROR_FIND_NOPSSHDATA, /**< No pssh data */ - - DM_ERROR_MALLOC = 10, /**< Malloc error */ - DM_ERROR_DL, /**< Load so error */ - - DM_ERROR_INVALID_URL = 20, /**< Invalid url */ - DM_ERROR_INVALID_SESSION, /**< Invalid session */ - DM_ERROR_UNSUPPORTED_URL_SUFFIX, /**< Unsupported url suffix */ - DM_ERROR_INITIALIZE_FAILED, /**< Failed to initialize DRM */ - - DM_ERROR_DASH_INIT = 30, /**< DASH init failed */ - DM_ERROR_DASH_CLOSE, /**< DASH close failed */ - DM_ERROR_DASH_OPEN, /**< DASH open failed */ - - DM_ERROR_DRM_WEB_SET = 40, /**< DRM web set failed */ - - DM_ERROR_PR_HANDLE_CREATE = 50, /**< Playready handle create failed */ - DM_ERROR_PR_OPEN, /**< Playready open failed */ - DM_ERROR_PR_DESTROY, /**< Playready destroy failed */ - DM_ERROR_PR_GENCHALLENGE, /**< Playready genchallenge failed */ - DM_ERROR_PR_INSTALL_LICENSE, /**< Playready install license failed */ - DM_ERROR_PR_GETRIGHTS, /**< Playready get rights failed */ - DM_ERROR_PR_STATUS, /**< Playready get status failed */ - - DM_ERROR_VMX_HANDLE_CREATE = 60, /**< Verimatrix handle create failed */ - DM_ERROR_VMX_FINALIZE, /**< Verimatrix finalize failed */ - DM_ERROR_VMX_GET_UNIQUE_ID, /**< Verimatrix get unique ID failed */ - - DM_ERROR_MARLIN_OPEN = 70, /**< Marlin open failed */ - DM_ERROR_MARLIN_CLOSE, /**< Marlin close failed */ - DM_ERROR_MARLIN_GET_RIGHTS, /**< Marlin get rights failed */ - DM_ERROR_MARLIN_GET_LICENSE, /**< Marlin get license failed */ - - DM_ERROR_WVCDM_HANDLE_CREATE = 80, /**< Widevinecdm handle create failed */ - DM_ERROR_WVCDM_DESTROY, /**< Widevinecdm destroy failed */ - DM_ERROR_WVCDM_OPEN_SESSION, /**< Widevinecdm open failed */ - DM_ERROR_WVCDM_CLOSE_SESSION, /**< Widevinecdm close failed */ - DM_ERROR_WVCDM_GET_PROVISION, /**< Widevinecdm get provision failed */ - DM_ERROR_WVCDM_GENERATE_KEYREQUEST, /**< Widevinecdm generate key request - failed */ - DM_ERROR_WVCDM_ADD_KEY, /**< Widevinecdm add key failed */ - DM_ERROR_WVCDM_REGISTER_EVENT, /**< Widevinecdm register event failed */ - - DM_ERROR_EME_SESSION_HANDLE_CREATE = 90, /**< EME handle create failed */ - DM_ERROR_EME_SESSION_CREATE, /**< EME session create failed */ - DM_ERROR_EME_SESSION_DESTROY, /**< EME session destroy failed */ - DM_ERROR_EME_SESSION_UPDATE, /**< EME session update failed */ - DM_ERROR_EME_SESSION_REQUEST, /**< EME session request failed */ - DM_ERROR_EME_WEB_OPERATION, /**< EME web operation failed */ - DM_ERROR_EME_TYPE_NOT_SUPPORTED, /**< EME type not supported */ - //... - DM_ERROR_UNKOWN, -} dm_error_e; - -typedef enum { - DM_TYPE_NONE = 0, /**< None */ - DM_TYPE_PLAYREADY = 1, /**< Playready */ - DM_TYPE_MARLINMS3 = 2, /**< Marlinms3 */ - DM_TYPE_VERIMATRIX = 3, /**< Verimatrix */ - DM_TYPE_WIDEVINE_CLASSIC = 4, /**< Widevine classic */ - DM_TYPE_SECUREMEDIA = 5, /**< Securemedia */ - DM_TYPE_SDRM = 6, /**< SDRM */ - DM_TYPE_VUDU = 7, /**< Vudu */ - DM_TYPE_WIDEVINE = 8, /**< Widevine cdm */ - DM_TYPE_LYNK = 9, /**< Lynk */ - DM_TYPE_CLEARKEY = 13, /**< Clearkey */ - DM_TYPE_EME = 14, /**< EME */ - //... - DM_TYPE_MAX, -} dm_type_e; - -typedef struct SetDataParam_s { - void* param1; /**< Parameter 1 */ - void* param2; /**< Parameter 2 */ - void* param3; /**< Parameter 3 */ - void* param4; /**< Parameter 4 */ -} SetDataParam_t; - -typedef void* DRMSessionHandle_t; - -typedef int (*FuncDMGRSetData)(DRMSessionHandle_t drm_session, - const char* data_type, void* input_data); -typedef int (*FuncDMGRGetData)(DRMSessionHandle_t drm_session, - const char* data_type, void* output_data); -typedef void (*FuncDMGRSetDRMLocalMode)(); -typedef DRMSessionHandle_t (*FuncDMGRCreateDRMSession)( - dm_type_e type, const char* drm_sub_type); -typedef bool (*FuncDMGRSecurityInitCompleteCB)(int* drm_handle, - unsigned int len, - unsigned char* pssh_data, - void* user_data); -typedef int (*FuncDMGRReleaseDRMSession)(DRMSessionHandle_t drm_session); - -void* OpenDrmManagerProxy(); -int InitDrmManagerProxy(void* handle); -void CloseDrmManagerProxy(void* handle); - -extern FuncDMGRSetData DMGRSetData; -extern FuncDMGRGetData DMGRGetData; -extern FuncDMGRSetDRMLocalMode DMGRSetDRMLocalMode; -extern FuncDMGRCreateDRMSession DMGRCreateDRMSession; -extern FuncDMGRSecurityInitCompleteCB DMGRSecurityInitCompleteCB; -extern FuncDMGRReleaseDRMSession DMGRReleaseDRMSession; - -#endif // FLUTTER_PLUGIN_DRM_MANAGER_PROXY_H_ diff --git a/packages/video_player_videohole/tizen/src/media_player.cc b/packages/video_player_videohole/tizen/src/media_player.cc index 4736afad4..a1d5c4cc2 100644 --- a/packages/video_player_videohole/tizen/src/media_player.cc +++ b/packages/video_player_videohole/tizen/src/media_player.cc @@ -4,7 +4,6 @@ #include "media_player.h" -#include #include #include @@ -42,10 +41,7 @@ static player_stream_type_e ConvertTrackType(std::string track_type) { MediaPlayer::MediaPlayer(flutter::BinaryMessenger *messenger, FlutterDesktopViewRef flutter_view) - : VideoPlayer(messenger, flutter_view) { - media_player_proxy_ = std::make_unique(); - device_proxy_ = std::make_unique(); -} + : VideoPlayer(messenger, flutter_view) {} MediaPlayer::~MediaPlayer() { Dispose(); } @@ -434,7 +430,7 @@ bool MediaPlayer::SetDisplay() { "[MediaPlayer] Window geometry: x[%d], y[%d], width[%d], height[%d].", x, y, width, height); - int ret = media_player_proxy_->player_set_ecore_wl_display( + int ret = ftpw_video_player_videohole_player_set_ecore_wl_display( player_, PLAYER_DISPLAY_TYPE_OVERLAY, native_window, x, y, width, height); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_set_ecore_wl_display failed: %s.", @@ -453,7 +449,7 @@ bool MediaPlayer::SetDisplay() { bool MediaPlayer::IsLive() { int is_live = 0; - int ret = media_player_proxy_->player_get_adaptive_streaming_info( + int ret = ftpw_video_player_videohole_player_get_adaptive_streaming_info( player_, &is_live, PLAYER_ADAPTIVE_INFO_IS_LIVE); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_get_adaptive_streaming_info failed: %s", @@ -478,7 +474,7 @@ std::pair MediaPlayer::GetLiveDuration() { char *live_duration_buff = static_cast(malloc(sizeof(char) * 64)); memset(live_duration_buff, 0, sizeof(char) * 64); - int ret = media_player_proxy_->player_get_adaptive_streaming_info( + int ret = ftpw_video_player_videohole_player_get_adaptive_streaming_info( player_, (void *)&live_duration_buff, PLAYER_ADAPTIVE_INFO_LIVE_DURATION); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_get_adaptive_streaming_info failed: %s", @@ -512,8 +508,8 @@ flutter::EncodableList MediaPlayer::GetTrackInfo(std::string track_type) { player_stream_type_e type = ConvertTrackType(track_type); int track_count = 0; - ret = media_player_proxy_->player_get_track_count_v2(player_, type, - &track_count); + ret = ftpw_video_player_videohole_player_get_track_count_v2(player_, type, + &track_count); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_get_track_count_v2 failed: %s", get_error_message(ret)); @@ -535,7 +531,7 @@ flutter::EncodableList MediaPlayer::GetTrackInfo(std::string track_type) { for (int video_index = 0; video_index < track_count; video_index++) { player_video_track_info_v2 *video_track_info = nullptr; - ret = media_player_proxy_->player_get_video_track_info_v2( + ret = ftpw_video_player_videohole_player_get_video_track_info_v2( player_, video_index, &video_track_info); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_get_video_track_info_v2 failed: %s", @@ -569,7 +565,7 @@ flutter::EncodableList MediaPlayer::GetTrackInfo(std::string track_type) { for (int audio_index = 0; audio_index < track_count; audio_index++) { player_audio_track_info_v2 *audio_track_info = nullptr; - ret = media_player_proxy_->player_get_audio_track_info_v2( + ret = ftpw_video_player_videohole_player_get_audio_track_info_v2( player_, audio_index, &audio_track_info); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_get_audio_track_info_v2 failed: %s", @@ -603,7 +599,7 @@ flutter::EncodableList MediaPlayer::GetTrackInfo(std::string track_type) { for (int sub_index = 0; sub_index < track_count; sub_index++) { player_subtitle_track_info_v2 *sub_track_info = nullptr; - ret = media_player_proxy_->player_get_subtitle_track_info_v2( + ret = ftpw_video_player_videohole_player_get_subtitle_track_info_v2( player_, sub_index, &sub_track_info); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_get_subtitle_track_info_v2 failed: %s", @@ -666,7 +662,7 @@ bool MediaPlayer::SetDrm(const std::string &uri, int drm_type, return false; } - int ret = media_player_proxy_->player_set_drm_handle( + int ret = ftpw_video_player_videohole_player_set_drm_handle( player_, PLAYER_DRM_TYPE_EME, drm_handle); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_set_drm_handle failed : %s.", @@ -674,7 +670,7 @@ bool MediaPlayer::SetDrm(const std::string &uri, int drm_type, return false; } - ret = media_player_proxy_->player_set_drm_init_complete_cb( + ret = ftpw_video_player_videohole_player_set_drm_init_complete_cb( player_, OnDrmSecurityInitComplete, this); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_set_drm_init_complete_cb failed : %s.", @@ -682,7 +678,7 @@ bool MediaPlayer::SetDrm(const std::string &uri, int drm_type, return false; } - ret = media_player_proxy_->player_set_drm_init_data_cb( + ret = ftpw_video_player_videohole_player_set_drm_init_data_cb( player_, OnDrmUpdatePsshData, this); if (ret != PLAYER_ERROR_NONE) { LOG_ERROR("[MediaPlayer] player_set_drm_init_data_cb failed : %s.", @@ -793,8 +789,7 @@ bool MediaPlayer::Suspend() { return true; } - res = device_proxy_->device_power_get_state(); - if (res == POWER_STATE_STANDBY) { + if (ftpw_video_player_videohole_device_power_is_standby()) { LOG_INFO("[MediaPlayer] Power state is standby."); if (!StopAndDestroy()) { LOG_ERROR("[MediaPlayer] Player StopAndDestroy fail."); @@ -803,7 +798,7 @@ bool MediaPlayer::Suspend() { LOG_INFO("[MediaPlayer] Standby state: close done successfully."); return true; } else { - LOG_INFO("[MediaPlayer] Player state is not standby: %d, do nothing.", res); + LOG_INFO("[MediaPlayer] Power state is not standby."); } if (player_state == PLAYER_STATE_IDLE || player_state == PLAYER_STATE_READY) { diff --git a/packages/video_player_videohole/tizen/src/media_player.h b/packages/video_player_videohole/tizen/src/media_player.h index 379592d0d..31dad0b1c 100644 --- a/packages/video_player_videohole/tizen/src/media_player.h +++ b/packages/video_player_videohole/tizen/src/media_player.h @@ -6,14 +6,14 @@ #define FLUTTER_PLUGIN_MEDIA_PLAYER_H_ #include +#include #include #include #include -#include "device_proxy.h" #include "drm_manager.h" -#include "media_player_proxy.h" +#include "ftpw_video_player_videohole.h" #include "video_player.h" namespace video_player_videohole_tizen { @@ -73,12 +73,10 @@ class MediaPlayer : public VideoPlayer { int data_length, void *user_data); player_h player_ = nullptr; - std::unique_ptr media_player_proxy_ = nullptr; std::unique_ptr drm_manager_; bool is_buffering_ = false; SeekCompletedCallback on_seek_completed_; bool is_seeking_ = false; - std::unique_ptr device_proxy_ = nullptr; std::string url_; CreateMessage create_message_; player_state_e pre_state_; diff --git a/packages/video_player_videohole/tizen/src/media_player_proxy.cc b/packages/video_player_videohole/tizen/src/media_player_proxy.cc deleted file mode 100644 index a6927b8c8..000000000 --- a/packages/video_player_videohole/tizen/src/media_player_proxy.cc +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2023 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "media_player_proxy.h" - -#include - -#include "log.h" - -typedef int (*FuncPlayerSetEcoreWlDisplay)(player_h player, - player_display_type_e type, - void* ecore_wl_window, int x, int y, - int width, int height); - -typedef int (*FuncPlayerSetDrmHandle)(player_h player, - player_drm_type_e drm_type, - int drm_handle); -typedef int (*FuncPlayerSetDrmInitCompleteCB)( - player_h player, security_init_complete_cb callback, void* user_data); -typedef int (*FuncPlayerSetDrmInitDataCB)(player_h player, - set_drm_init_data_cb callback, - void* user_data); - -typedef int (*FuncPlayerGetAdaptiveStreamingInfo)(player_h player, - void* adaptive_info, - int adaptive_type); - -typedef int (*FuncPlayerGetTrackCountV2)(player_h player, - player_stream_type_e type, - int* pcount); -typedef int (*FuncPlayerGetVideoTrackInfoV2)( - player_h player, int index, player_video_track_info_v2** track_info); -typedef int (*FuncPlayerGetAudioTrackInfoV2)( - player_h player, int index, player_audio_track_info_v2** track_info); -typedef int (*FuncPlayerGetSubtitleTrackInfoV2)( - player_h player, int index, player_subtitle_track_info_v2** track_info); - -MediaPlayerProxy::MediaPlayerProxy() { - media_player_handle_ = dlopen("libcapi-media-player.so.0", RTLD_LAZY); - if (media_player_handle_ == nullptr) { - LOG_ERROR("Failed to open media player."); - } -} - -MediaPlayerProxy::~MediaPlayerProxy() { - if (media_player_handle_) { - dlclose(media_player_handle_); - media_player_handle_ = nullptr; - } -} - -int MediaPlayerProxy::player_set_ecore_wl_display(player_h player, - player_display_type_e type, - void* ecore_wl_window, int x, - int y, int width, - int height) { - if (!media_player_handle_) { - LOG_ERROR("media_player_handle_ not valid"); - return PLAYER_ERROR_NOT_AVAILABLE; - } - FuncPlayerSetEcoreWlDisplay player_set_ecore_wl_display = - reinterpret_cast( - dlsym(media_player_handle_, "player_set_ecore_wl_display")); - if (!player_set_ecore_wl_display) { - LOG_ERROR("Fail to find player_set_ecore_wl_display."); - return PLAYER_ERROR_NOT_AVAILABLE; - } - return player_set_ecore_wl_display(player, type, ecore_wl_window, x, y, width, - height); -} - -int MediaPlayerProxy::player_set_drm_handle(player_h player, - player_drm_type_e drm_type, - int drm_handle) { - if (!media_player_handle_) { - LOG_ERROR("media_player_handle_ not valid"); - return PLAYER_ERROR_NOT_AVAILABLE; - } - FuncPlayerSetDrmHandle player_set_drm_handle = - reinterpret_cast( - dlsym(media_player_handle_, "player_set_drm_handle")); - if (!player_set_drm_handle) { - LOG_ERROR("Fail to find player_set_ecore_wl_display."); - return PLAYER_ERROR_NOT_AVAILABLE; - } - return player_set_drm_handle(player, drm_type, drm_handle); -} - -int MediaPlayerProxy::player_set_drm_init_complete_cb( - player_h player, security_init_complete_cb callback, void* user_data) { - if (!media_player_handle_) { - LOG_ERROR("media_player_handle_ not valid"); - return PLAYER_ERROR_NOT_AVAILABLE; - } - FuncPlayerSetDrmInitCompleteCB player_set_drm_init_complete_cb = - reinterpret_cast( - dlsym(media_player_handle_, "player_set_drm_init_complete_cb")); - if (!player_set_drm_init_complete_cb) { - LOG_ERROR("Fail to find player_set_drm_init_complete_cb."); - return PLAYER_ERROR_NOT_AVAILABLE; - } - return player_set_drm_init_complete_cb(player, callback, user_data); -} - -int MediaPlayerProxy::player_set_drm_init_data_cb(player_h player, - set_drm_init_data_cb callback, - void* user_data) { - if (!media_player_handle_) { - LOG_ERROR("media_player_handle_ not valid"); - return PLAYER_ERROR_NOT_AVAILABLE; - } - FuncPlayerSetDrmInitDataCB player_set_drm_init_data_cb = - reinterpret_cast( - dlsym(media_player_handle_, "player_set_drm_init_data_cb")); - if (!player_set_drm_init_data_cb) { - LOG_ERROR("Fail to find player_set_drm_init_data_cb."); - return PLAYER_ERROR_NOT_AVAILABLE; - } - return player_set_drm_init_data_cb(player, callback, user_data); -} - -int MediaPlayerProxy::player_get_adaptive_streaming_info(player_h player, - void* adaptive_info, - int adaptive_type) { - if (!media_player_handle_) { - LOG_ERROR("media_player_handle_ not valid"); - return PLAYER_ERROR_NOT_AVAILABLE; - } - FuncPlayerGetAdaptiveStreamingInfo player_get_adaptive_streaming_info = - reinterpret_cast( - dlsym(media_player_handle_, "player_get_adaptive_streaming_info")); - if (!player_get_adaptive_streaming_info) { - LOG_ERROR("Fail to find player_get_adaptive_streaming_info."); - return PLAYER_ERROR_NOT_AVAILABLE; - } - return player_get_adaptive_streaming_info(player, adaptive_info, - adaptive_type); -} - -int MediaPlayerProxy::player_get_track_count_v2(player_h player, - player_stream_type_e type, - int* pcount) { - if (!media_player_handle_) { - LOG_ERROR("media_player_handle_ not valid"); - return PLAYER_ERROR_NOT_AVAILABLE; - } - FuncPlayerGetTrackCountV2 player_get_track_count_v2 = - reinterpret_cast( - dlsym(media_player_handle_, "player_get_track_count_v2")); - if (!player_get_track_count_v2) { - LOG_ERROR("Fail to find player_get_track_count_v2."); - return PLAYER_ERROR_NOT_AVAILABLE; - } - return player_get_track_count_v2(player, type, pcount); -} - -int MediaPlayerProxy::player_get_video_track_info_v2( - player_h player, int index, player_video_track_info_v2** track_info) { - if (!media_player_handle_) { - LOG_ERROR("media_player_handle_ not valid"); - return PLAYER_ERROR_NOT_AVAILABLE; - } - FuncPlayerGetVideoTrackInfoV2 player_get_video_track_info_v2 = - reinterpret_cast( - dlsym(media_player_handle_, "player_get_video_track_info_v2")); - if (!player_get_video_track_info_v2) { - LOG_ERROR("Fail to find player_get_video_track_info_v2."); - return PLAYER_ERROR_NOT_AVAILABLE; - } - return player_get_video_track_info_v2(player, index, track_info); -} - -int MediaPlayerProxy::player_get_audio_track_info_v2( - player_h player, int index, player_audio_track_info_v2** track_info) { - if (!media_player_handle_) { - LOG_ERROR("media_player_handle_ not valid"); - return PLAYER_ERROR_NOT_AVAILABLE; - } - FuncPlayerGetAudioTrackInfoV2 player_get_audio_track_info_v2 = - reinterpret_cast( - dlsym(media_player_handle_, "player_get_audio_track_info_v2")); - if (!player_get_audio_track_info_v2) { - LOG_ERROR("Fail to find player_get_audio_track_info_v2."); - return PLAYER_ERROR_NOT_AVAILABLE; - } - return player_get_audio_track_info_v2(player, index, track_info); -} - -int MediaPlayerProxy::player_get_subtitle_track_info_v2( - player_h player, int index, player_subtitle_track_info_v2** track_info) { - if (!media_player_handle_) { - LOG_ERROR("media_player_handle_ not valid"); - return PLAYER_ERROR_NOT_AVAILABLE; - } - FuncPlayerGetSubtitleTrackInfoV2 player_get_subtitle_track_info_v2 = - reinterpret_cast( - dlsym(media_player_handle_, "player_get_subtitle_track_info_v2")); - if (!player_get_subtitle_track_info_v2) { - LOG_ERROR("Fail to find player_get_subtitle_track_info_v2."); - return PLAYER_ERROR_NOT_AVAILABLE; - } - return player_get_subtitle_track_info_v2(player, index, track_info); -} diff --git a/packages/video_player_videohole/tizen/src/media_player_proxy.h b/packages/video_player_videohole/tizen/src/media_player_proxy.h deleted file mode 100644 index 1229a42b4..000000000 --- a/packages/video_player_videohole/tizen/src/media_player_proxy.h +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2023 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLUTTER_PLUGIN_MEDIA_PLAYER_PROXY_H_ -#define FLUTTER_PLUGIN_MEDIA_PLAYER_PROXY_H_ - -#include - -#define MAX_STRING_NAME_LEN 255 -#define MMPLAYER_FOUR_CC_LEN 14 -#define PLAYER_LANG_NAME_SIZE 10 - -typedef struct { - char fourCC[MMPLAYER_FOUR_CC_LEN + 1]; /**< codec fourcc */ - char name[MAX_STRING_NAME_LEN]; /**< name: video/audio, it maybe not exit in - some track*/ - /*dynamic infos in hls,ss,dash streams*/ - int width; /**< resolution width */ - int height; /**< resolution height */ - int bit_rate; /**< bitrate in bps */ -} player_video_track_info_v2; - -typedef struct { - char fourCC[MMPLAYER_FOUR_CC_LEN + 1]; /**< codec fourcc */ - char language[PLAYER_LANG_NAME_SIZE]; /**< language info*/ - /*dynamic infos in hls,ss,dash streams*/ - int sample_rate; /**< sample rate in this track*/ - int channel; /**< channel in this track*/ - int bit_rate; /**< bitrate in this track*/ -} player_audio_track_info_v2; - -typedef struct { - char fourCC[MMPLAYER_FOUR_CC_LEN + 1]; /**< codec fourcc */ - char language[PLAYER_LANG_NAME_SIZE]; /**< language info*/ - int subtitle_type; /**< text subtitle = 0, picture subtitle = 1 */ -} player_subtitle_track_info_v2; - -typedef enum { - PLAYER_DRM_TYPE_NONE = 0, - PLAYER_DRM_TYPE_PLAYREADY, - PLAYER_DRM_TYPE_MARLIN, - PLAYER_DRM_TYPE_VERIMATRIX, - PLAYER_DRM_TYPE_WIDEVINE_CLASSIC, - PLAYER_DRM_TYPE_SECUREMEDIA, - PLAYER_DRM_TYPE_SDRM, - PLAYER_DRM_TYPE_VUDU, - PLAYER_DRM_TYPE_WIDEVINE_CDM, - PLAYER_DRM_TYPE_AES128, - PLAYER_DRM_TYPE_HDCP, - PLAYER_DRM_TYPE_DTCP, - PLAYER_DRM_TYPE_SCSA, - PLAYER_DRM_TYPE_CLEARKEY, - PLAYER_DRM_TYPE_EME, - PLAYER_DRM_TYPE_MAX_COUNT, -} player_drm_type_e; - -typedef enum { - PLAYER_ADAPTIVE_INFO_BITRATE_INIT, - PLAYER_ADAPTIVE_INFO_BITRATE_INIT_NUM, - PLAYER_ADAPTIVE_INFO_DURATION, - PLAYER_ADAPTIVE_INFO_LIVE_DURATION, - PLAYER_ADAPTIVE_INFO_AVAILABLE_BITRATES, - PLAYER_ADAPTIVE_INFO_RATE_RETURNED, - PLAYER_ADAPTIVE_INFO_CURRENT_BITRATE, - PLAYER_ADAPTIVE_INFO_GET_BUFFER_SIZE, - PLAYER_ADAPTIVE_INFO_FIXED_BITRATE, - PLAYER_ADAPTIVE_INFO_ADAPTIVE_BITRATE, - PLAYER_ADAPTIVE_INFO_MAX_BYTES, - PLAYER_ADAPTIVE_INFO_DRM_TYPE, - PLAYER_ADAPTIVE_INFO_RATE_REQUESTED, - PLAYER_ADAPTIVE_INFO_AUDIO_TRACK_REQUESTED, - PLAYER_ADAPTIVE_INFO_FORMAT, - PLAYER_ADAPTIVE_INFO_BLOCK, - PLAYER_ADAPTIVE_INFO_MIN_PERCENT, - PLAYER_ADAPTIVE_INFO_MIN_LATENCY, - PLAYER_ADAPTIVE_INFO_MAX_LATENCY, - PLAYER_ADAPTIVE_INFO_IS_LIVE, - PLAYER_ADAPTIVE_INFO_EMIT_SIGNAL, - PLAYER_ADAPTIVE_INFO_LOG_LEVEL, - PLAYER_ADAPTIVE_INFO_CURRENT_BANDWIDTH, - PLAYER_ADAPTIVE_INFO_URL_CUSTOM, - PLAYER_ADAPTIVE_INFO_GET_AUDIO_INFO, - PLAYER_ADAPTIVE_INFO_GET_VIDEO_INFO, - PLAYER_ADAPTIVE_INFO_GET_TEXT_INFO, - PLAYER_ADAPTIVE_INFO_RESUME_TIME, - PLAYER_ADAPTIVE_INFO_AUDIO_INDEX, - PLAYER_ADAPTIVE_INFO_PROXY_SETTING, - PLAYER_ADAPTIVE_INFO_ATSC3_L1_SERVER_TIME, - PLAYER_ADAPTIVE_INFO_VIDEO_FRAMES_DROPPED, - PLAYER_ADAPTIVE_INFO_STREAMING_IS_BUFFERING, - PLAYER_ADAPTIVE_INFO_PRESELECTION_ID, - PLAYER_ADAPTIVE_INFO_URI_TYPE -} player_adaptive_Info_e; - -typedef enum { - CENC = 0, - KEYIDS = 1, - WEBM = 2, -} drm_init_data_type; - -typedef bool (*security_init_complete_cb)(int* drmhandle, unsigned int length, - unsigned char* psshdata, - void* user_data); -typedef int (*set_drm_init_data_cb)(drm_init_data_type init_type, void* data, - int data_length, void* user_data); - -class MediaPlayerProxy { - public: - MediaPlayerProxy(); - ~MediaPlayerProxy(); - int player_set_ecore_wl_display(player_h player, player_display_type_e type, - void* ecore_wl_window, int x, int y, - int width, int height); - int player_set_drm_handle(player_h player, player_drm_type_e drm_type, - int drm_handle); - int player_set_drm_init_complete_cb(player_h player, - security_init_complete_cb callback, - void* user_data); - int player_set_drm_init_data_cb(player_h player, - set_drm_init_data_cb callback, - void* user_data); - int player_get_adaptive_streaming_info(player_h player, void* adaptive_info, - int adaptive_type); - int player_get_track_count_v2(player_h player, player_stream_type_e type, - int* pcount); - int player_get_video_track_info_v2(player_h player, int index, - player_video_track_info_v2** track_info); - int player_get_audio_track_info_v2(player_h player, int index, - player_audio_track_info_v2** track_info); - int player_get_subtitle_track_info_v2( - player_h player, int index, player_subtitle_track_info_v2** track_info); - - private: - void* media_player_handle_ = nullptr; -}; - -#endif // FLUTTER_PLUGIN_MEDIA_PLAYER_PROXY_H_