-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[media] Report errors via MediaError to WebApp #4453
base: main
Are you sure you want to change the base?
Conversation
cc9b66d
to
24b8edd
Compare
Note that part of implementation of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looking good.
@@ -68501,6 +68501,8 @@ Called by update_use_counter_css.py.--> | |||
<int value="9" label="kCastStreaming"/> | |||
<int value="10" label="kContentEmbedderDefined"/> | |||
<int value="11" label="kTest"/> | |||
<!-- Cobalt: Renderer for Starboard (SbPlayer) --> | |||
<int value="12" label="kStarboard"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\o/
media/starboard/BUILD.gn
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated but I'd change l.15
assert(is_cobalt, "This file builds for cobalt builds, not Chromium builds")
with
assert(is_starboard_media)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding with a previous chat with Borong is this file may compile when use_starboard_media = false
in the future : we want to compare cobalt with starboard media, cobalt without starboard media on android. I'll leave it to Borong to add the assert if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BUILD.gn file is built when is_cobalt=true
. StarboardRenderer
is a subcomponent for //media
(
cobalt/media/media_options.gni
Line 354 in 8125775
media_subcomponent_deps += [ "//media/starboard" ] |
use_starboard_media
, it is right here.
client_->OnError(PIPELINE_ERROR_DECODE); | ||
break; | ||
case kSbPlayerErrorMax: | ||
NOTREACHED(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this kSbPlayerErrorMax
ever appear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.
LOG(ERROR) << "StarboardRenderer::OnPlayerError() called with code " << error | ||
<< " and message \"" << message << "\""; | ||
NOTIMPLEMENTED(); | ||
switch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a fallback for other cases not specified now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For SbPlayer, we only have kSbPlayerErrorDecode
and kSbPlayerErrorCapabilityChanged
for errors. It should be fine here for not specifying a default case.
@@ -2838,6 +2823,14 @@ std::unique_ptr<media::Renderer> WebMediaPlayerImpl::CreateRenderer( | |||
media_metrics_provider_->SetRendererType(renderer_type_); | |||
media_log_->SetProperty<MediaLogProperty::kRendererName>(renderer_type_); | |||
|
|||
#if BUILDFLAG(USE_STARBOARD_MEDIA) | |||
LOG(INFO) << "Renderer Type is " << GetRendererName(renderer_type_) << "."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already logged in Media DevTools in l.2824, is this extra LOG() needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not always use DevTools for media. This can ensure we can have this in adb bugreport.
@niranjanyardi @andrewsavage1 for the questions on GN files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the open comments lgtm from a build perspective.
This PR adds `StarboardRendererFactory`, which contains `media_log_` to `StarboardRenderer`. Chromium uses both `RendererClient::OnError` and `media_log_` to report error code and message to MediaError. As a result, Cobalt adapts it from C25 to report error messages to WebApp. b/375271948 b/375278384
24b8edd
to
153dc3c
Compare
This PR adds
StarboardRendererFactory
, which containsmedia_log_
toStarboardRenderer
, and is necessary for error reporting.Chromium uses both
RendererClient::OnError
andmedia_log_
to report error code and message toMediaError
. As a result, Cobalt adapts it from C25 to report error messages to WebApp.b/375271948
b/375278384