Skip to content

Commit

Permalink
Minor codes cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hyue7 committed Oct 25, 2023
1 parent a581e71 commit ca3e1a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/video_player/tizen/src/video_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ VideoPlayer::VideoPlayer(flutter::PluginRegistrar *plugin_registrar,
sink_event_pipe_ = ecore_pipe_add(
[](void *data, void *buffer, unsigned int nbyte) -> void {
auto *self = static_cast<VideoPlayer *>(data);
self->ExecuteSinkEvents();
self->SendPendingEvents();
},
this);

Expand Down Expand Up @@ -212,7 +212,7 @@ VideoPlayer::~VideoPlayer() {
}
}

void VideoPlayer::ExecuteSinkEvents() {
void VideoPlayer::SendPendingEvents() {
std::lock_guard<std::mutex> lock(queue_mutex_);
while (!encodable_event_queue_.empty()) {
if (event_sink_) {
Expand All @@ -230,8 +230,8 @@ void VideoPlayer::ExecuteSinkEvents() {
}
}

void VideoPlayer::PushEvent(flutter::EncodableValue encodable_value) {
if (event_sink_ == nullptr) {
void VideoPlayer::PushEvent(const flutter::EncodableValue &encodable_value) {
if (!event_sink_) {
LOG_ERROR("[VideoPlayer] event sink is nullptr.");
return;
}
Expand All @@ -242,7 +242,7 @@ void VideoPlayer::PushEvent(flutter::EncodableValue encodable_value) {

void VideoPlayer::SendError(const std::string &error_code,
const std::string &error_message) {
if (event_sink_ == nullptr) {
if (!event_sink_) {
LOG_ERROR("[VideoPlayer] event sink is nullptr.");
return;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/video_player/tizen/src/video_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class VideoPlayer {
int64_t GetTextureId() { return texture_id_; }

private:
void ExecuteSinkEvents();
void PushEvent(flutter::EncodableValue encodable_value);
void SendPendingEvents();
void PushEvent(const flutter::EncodableValue &encodable_value);
void SendError(const std::string &error_code,
const std::string &error_message);
FlutterDesktopGpuSurfaceDescriptor *ObtainGpuSurface(size_t width,
Expand Down

0 comments on commit ca3e1a3

Please sign in to comment.