Skip to content

Commit

Permalink
[android] Fix software video decoder fallback
Browse files Browse the repository at this point in the history
This is the same PR as youtube#4111.

Original commit message:

[PR 3103](youtube#3103) fixed MIME attribute "framerate" that enforces a low resolution and low fps playback to use software video decoder.

However, If software video decoder is not available, Cobalt should fallback to hardware video decoder.

b/328537630
  • Loading branch information
borongc committed Oct 7, 2024
1 parent c25707a commit bd80db1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions starboard/android/shared/media_codec_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,16 @@ std::unique_ptr<MediaCodecBridge> MediaCodecBridge::CreateVideoMediaCodecBridge(
/* bitrate = */ 0,
/* fps = */ 0);
}
if (decoder_name.empty() && require_software_codec) {
// On third pass, forget software codec required.
decoder_name = MediaCapabilitiesCache::GetInstance()->FindVideoDecoder(
mime, must_support_secure, /* must_support_hdr = */ false,
/* require_software_codec = */ false, must_support_tunnel_mode,
/* frame_width = */ 0,
/* frame_height = */ 0,
/* bitrate = */ 0,
/* fps = */ 0);
}

if (decoder_name.empty()) {
*error_message =
Expand Down

0 comments on commit bd80db1

Please sign in to comment.