From a38394ef671a45042d5d1ff06711995f8c57aff2 Mon Sep 17 00:00:00 2001 From: xiaowei guan Date: Thu, 28 Dec 2023 10:27:41 +0800 Subject: [PATCH] Code style check --- .../tizen/src/drm/drm_license_request.h | 11 +++++++---- .../tizen/src/drm/drm_license_request_channel.cc | 10 ++++++---- .../tizen/src/drm/drm_license_request_channel.h | 9 ++++++--- .../tizen/src/drm/drm_license_request_native.cc | 2 +- .../tizen/src/drm/drm_license_request_native.h | 4 +++- .../tizen/src/drm/drm_manager.cc | 8 ++++---- .../tizen/src/drm/drm_manager.h | 2 +- .../video_player_videohole/tizen/src/video_player.h | 4 ++-- 8 files changed, 30 insertions(+), 20 deletions(-) diff --git a/packages/video_player_videohole/tizen/src/drm/drm_license_request.h b/packages/video_player_videohole/tizen/src/drm/drm_license_request.h index 01b39fce6..429e88e26 100644 --- a/packages/video_player_videohole/tizen/src/drm/drm_license_request.h +++ b/packages/video_player_videohole/tizen/src/drm/drm_license_request.h @@ -6,20 +6,23 @@ #define FLUTTER_PLUGIN_DRM_LICENSE_REQUEST_H_ #include +#include #include +#include using OnLicenseRequestDone = std::function& response_data)>; + const std::string& session_id, const std::vector& response_data)>; class DrmLicenseRequest : public std::enable_shared_from_this { public: - DrmLicenseRequest(OnLicenseRequestDone on_license_request_done_callback) + explicit DrmLicenseRequest( + OnLicenseRequestDone on_license_request_done_callback) : on_license_request_done_callback_(on_license_request_done_callback) {} - virtual ~DrmLicenseRequest(){}; + virtual ~DrmLicenseRequest() {} virtual void RequestLicense(void* session_id, int message_type, void* message, int message_length) = 0; virtual void OnLicenseResponse(const std::string& session_id, - std::vector& response_data) = 0; + const std::vector& response_data) = 0; protected: std::shared_ptr getShared() { return shared_from_this(); } diff --git a/packages/video_player_videohole/tizen/src/drm/drm_license_request_channel.cc b/packages/video_player_videohole/tizen/src/drm/drm_license_request_channel.cc index 5af3b1171..b4ad1a540 100644 --- a/packages/video_player_videohole/tizen/src/drm/drm_license_request_channel.cc +++ b/packages/video_player_videohole/tizen/src/drm/drm_license_request_channel.cc @@ -7,6 +7,8 @@ #include #include +#include + #include "log.h" DrmLicenseRequestChannel::DrmLicenseRequestChannel( @@ -42,14 +44,14 @@ void DrmLicenseRequestChannel::ExecuteRequest() { } void DrmLicenseRequestChannel::PushLicenseRequestData( - DataForLicenseProcess &data) { + const DataForLicenseProcess &data) { std::lock_guard lock(queue_mutex_); license_request_queue_.push(data); ecore_pipe_write(license_request_pipe_, nullptr, 0); } -void DrmLicenseRequestChannel::RequestLicense(std::string &session_id, - std::string &message) { +void DrmLicenseRequestChannel::RequestLicense(const std::string &session_id, + const std::string &message) { LOG_INFO("[DrmLicenseRequestChannel] Start request license."); if (request_license_channel_ == nullptr) { @@ -86,7 +88,7 @@ void DrmLicenseRequestChannel::RequestLicense(std::string &session_id, } void DrmLicenseRequestChannel::OnLicenseResponse( - const std::string &session_id, std::vector &response_data) { + const std::string &session_id, const std::vector &response_data) { if (on_license_request_done_callback_) { on_license_request_done_callback_(session_id, response_data); } diff --git a/packages/video_player_videohole/tizen/src/drm/drm_license_request_channel.h b/packages/video_player_videohole/tizen/src/drm/drm_license_request_channel.h index b20d92a9d..62ff3e859 100644 --- a/packages/video_player_videohole/tizen/src/drm/drm_license_request_channel.h +++ b/packages/video_player_videohole/tizen/src/drm/drm_license_request_channel.h @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include "drm_license_request.h" @@ -31,12 +33,13 @@ class DrmLicenseRequestChannel : public DrmLicenseRequest { int message_length) override; ~DrmLicenseRequestChannel(); void OnLicenseResponse(const std::string &session_id, - std::vector &response_data) override; + const std::vector &response_data) override; private: void ExecuteRequest(); - void PushLicenseRequestData(DataForLicenseProcess &data); - void RequestLicense(std::string &session_id, std::string &message); + void PushLicenseRequestData(const DataForLicenseProcess &data); + void RequestLicense(const std::string &session_id, + const std::string &message); std::unique_ptr> request_license_channel_; std::mutex queue_mutex_; diff --git a/packages/video_player_videohole/tizen/src/drm/drm_license_request_native.cc b/packages/video_player_videohole/tizen/src/drm/drm_license_request_native.cc index 76c46a74c..4df112a4c 100644 --- a/packages/video_player_videohole/tizen/src/drm/drm_license_request_native.cc +++ b/packages/video_player_videohole/tizen/src/drm/drm_license_request_native.cc @@ -144,7 +144,7 @@ void DrmLicenseRequestNative::ExecuteResponse() { } void DrmLicenseRequestNative::OnLicenseResponse( - const std::string& session_id, std::vector& response_data) { + const std::string& session_id, const std::vector& response_data) { std::lock_guard lock(queue_mutex_); license_response_queue_.push(std::make_pair(session_id, response_data)); ecore_pipe_write(license_response_pipe_, nullptr, 0); diff --git a/packages/video_player_videohole/tizen/src/drm/drm_license_request_native.h b/packages/video_player_videohole/tizen/src/drm/drm_license_request_native.h index 656a6e0cb..04a6026e1 100644 --- a/packages/video_player_videohole/tizen/src/drm/drm_license_request_native.h +++ b/packages/video_player_videohole/tizen/src/drm/drm_license_request_native.h @@ -9,7 +9,9 @@ #include #include #include +#include #include +#include #include "drm_license_request.h" @@ -24,7 +26,7 @@ class DrmLicenseRequestNative : public DrmLicenseRequest { protected: void OnLicenseResponse(const std::string& session_id, - std::vector& response_data) override; + const std::vector& response_data) override; private: void StopMessageQueue(); diff --git a/packages/video_player_videohole/tizen/src/drm/drm_manager.cc b/packages/video_player_videohole/tizen/src/drm/drm_manager.cc index cc7d2b7ff..ee5e62381 100644 --- a/packages/video_player_videohole/tizen/src/drm/drm_manager.cc +++ b/packages/video_player_videohole/tizen/src/drm/drm_manager.cc @@ -86,7 +86,7 @@ bool DrmManager::SetChallenge(const std::string &media_url, flutter::BinaryMessenger *binary_messenger) { drm_license_request_ = std::make_shared( binary_messenger, [this](const std::string &session_id, - std::vector &response_data) { + const std::vector &response_data) { InstallKey(session_id, response_data); }); return DM_ERROR_NONE == SetChallenge(media_url); @@ -98,7 +98,7 @@ bool DrmManager::SetChallenge(const std::string &media_url, drm_license_request_ = std::make_shared( drm_type_, license_server_url, [this](const std::string &session_id, - std::vector &response_data) { + const std::vector &response_data) { InstallKey(session_id, response_data); }); return DM_ERROR_NONE == SetChallenge(media_url); @@ -243,13 +243,13 @@ void DrmManager::OnDrmManagerError(long error_code, char *error_message, } void DrmManager::InstallKey(const std::string &session_id, - std::vector &response) { + const std::vector &response) { LOG_INFO("[DrmManager] Start install license."); SetDataParam_t license_param = {}; license_param.param1 = reinterpret_cast(const_cast(session_id.c_str())); - license_param.param2 = response.data(); + license_param.param2 = const_cast(response.data()); license_param.param3 = reinterpret_cast(response.size()); int ret = DMGRSetData(drm_session_, "install_eme_key", &license_param); if (ret != DM_ERROR_NONE) { diff --git a/packages/video_player_videohole/tizen/src/drm/drm_manager.h b/packages/video_player_videohole/tizen/src/drm/drm_manager.h index ef7759929..2230ed0e4 100644 --- a/packages/video_player_videohole/tizen/src/drm/drm_manager.h +++ b/packages/video_player_videohole/tizen/src/drm/drm_manager.h @@ -38,7 +38,7 @@ class DrmManager { private: void InstallKey(const std::string &session_id, - std::vector &response); + const std::vector &response); int SetChallenge(const std::string &media_url); static int OnChallengeData(void *session_id, int message_type, void *message, diff --git a/packages/video_player_videohole/tizen/src/video_player.h b/packages/video_player_videohole/tizen/src/video_player.h index 53c1ebd92..fc5c86b44 100644 --- a/packages/video_player_videohole/tizen/src/video_player.h +++ b/packages/video_player_videohole/tizen/src/video_player.h @@ -37,8 +37,8 @@ class VideoPlayer { virtual void SetDisplayRoi(int32_t x, int32_t y, int32_t width, int32_t height) = 0; virtual bool Play() = 0; - virtual bool Deactivate() { return false; }; - virtual bool Activate() { return false; }; + virtual bool Deactivate() { return false; } + virtual bool Activate() { return false; } virtual bool Pause() = 0; virtual bool SetLooping(bool is_looping) = 0; virtual bool SetVolume(double volume) = 0;