Skip to content

Commit

Permalink
[android] Fix software video decoder fallback
Browse files Browse the repository at this point in the history
If software video decoder is not available, Cobalt should fallback to hardware video decoder.

b/328537630
  • Loading branch information
borongc committed Sep 16, 2024
1 parent 73272fe commit 190a83e
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 190a83e

Please sign in to comment.