From cecfec7092d27f20c19b3f1ce1d497e42f87f2ff Mon Sep 17 00:00:00 2001 From: Austin Osagie Date: Thu, 9 Jan 2025 16:01:40 -0800 Subject: [PATCH 1/3] [media] Move calls to GetPlayerStateName() b/376316272 --- media/starboard/starboard_renderer.cc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/media/starboard/starboard_renderer.cc b/media/starboard/starboard_renderer.cc index 5c5a555b36c4..af40feeb08b1 100644 --- a/media/starboard/starboard_renderer.cc +++ b/media/starboard/starboard_renderer.cc @@ -767,15 +767,16 @@ void StarboardRenderer::OnPlayerStatus(SbPlayerState state) { // In case if state is changed when creation of the `player_bridge_` fails. // We may also need this for suspend/resume support. if (!player_bridge_) { - LOG(INFO) << "StarboardRenderer::OnPlayerStatus() called with " - << GetPlayerStateName(state); + LOG(WARNING) << "StarboardRenderer::OnPlayerStatus() called with " + << GetPlayerStateName(state); return; } + LOG(INFO) << "StarboardRenderer::OnPlayerStatus() called with " + << GetPlayerStateName(state); + switch (state) { case kSbPlayerStateInitialized: - LOG(INFO) << "StarboardRenderer::OnPlayerStatus() called with " - << GetPlayerStateName(state); DCHECK(!player_bridge_initialized_); player_bridge_initialized_ = true; @@ -784,8 +785,6 @@ void StarboardRenderer::OnPlayerStatus(SbPlayerState state) { } break; case kSbPlayerStatePrerolling: - LOG(INFO) << "StarboardRenderer::OnPlayerStatus() called with " - << GetPlayerStateName(state); DCHECK(player_bridge_initialized_); break; case kSbPlayerStatePresenting: @@ -795,19 +794,14 @@ void StarboardRenderer::OnPlayerStatus(SbPlayerState state) { HasRemoteAudioOutputs(player_bridge_->GetAudioConfigurations()) ? audio_write_duration_remote_ : audio_write_duration_local_; - LOG(INFO) << "SbPlayerBridge reaches " << GetPlayerStateName(state) - << ", with audio write duration at " << audio_write_duration_; + LOG(INFO) << "Audio write duration is " << audio_write_duration_; DCHECK(player_bridge_initialized_); break; case kSbPlayerStateEndOfStream: - LOG(INFO) << "StarboardRenderer::OnPlayerStatus() called with " - << GetPlayerStateName(state); DCHECK(player_bridge_initialized_); client_->OnEnded(); break; case kSbPlayerStateDestroyed: - LOG(INFO) << "StarboardRenderer::OnPlayerStatus() called with " - << GetPlayerStateName(state); break; } } From c63c41fbfcef6149ad5fffa823cc4a2ad71fede6 Mon Sep 17 00:00:00 2001 From: Austin Osagie Date: Mon, 13 Jan 2025 11:21:10 -0800 Subject: [PATCH 2/3] Move log --- media/starboard/starboard_renderer.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/media/starboard/starboard_renderer.cc b/media/starboard/starboard_renderer.cc index af40feeb08b1..110c9ebdeee2 100644 --- a/media/starboard/starboard_renderer.cc +++ b/media/starboard/starboard_renderer.cc @@ -764,17 +764,17 @@ void StarboardRenderer::OnNeedData(DemuxerStream::Type type, void StarboardRenderer::OnPlayerStatus(SbPlayerState state) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); + LOG(INFO) << "StarboardRenderer::OnPlayerStatus() called with " + << GetPlayerStateName(state); + // In case if state is changed when creation of the `player_bridge_` fails. // We may also need this for suspend/resume support. if (!player_bridge_) { - LOG(WARNING) << "StarboardRenderer::OnPlayerStatus() called with " - << GetPlayerStateName(state); + LOG(WARNING) << "StarboardRenderer::OnPlayerStatus() called with invalid " + "|player_bridge_|"; return; } - LOG(INFO) << "StarboardRenderer::OnPlayerStatus() called with " - << GetPlayerStateName(state); - switch (state) { case kSbPlayerStateInitialized: DCHECK(!player_bridge_initialized_); From d8e7e934bef7454ec17b7b78c111f209c11cf036 Mon Sep 17 00:00:00 2001 From: Austin Osagie Date: Mon, 13 Jan 2025 11:23:43 -0800 Subject: [PATCH 3/3] Clarify log --- media/starboard/starboard_renderer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/starboard/starboard_renderer.cc b/media/starboard/starboard_renderer.cc index 110c9ebdeee2..4b5648917d57 100644 --- a/media/starboard/starboard_renderer.cc +++ b/media/starboard/starboard_renderer.cc @@ -771,7 +771,7 @@ void StarboardRenderer::OnPlayerStatus(SbPlayerState state) { // We may also need this for suspend/resume support. if (!player_bridge_) { LOG(WARNING) << "StarboardRenderer::OnPlayerStatus() called with invalid " - "|player_bridge_|"; + "SbPlayerBridge"; return; }