[EMSS] Deprecate explicit decoding mode selection and force `hardware-with-fallback... 09/315909/3
authorPiotr Bałut <p.balut@samsung.com>
Wed, 4 Dec 2024 12:39:04 +0000 (13:39 +0100)
committerBot Blink <blinkbot@samsung.com>
Fri, 6 Dec 2024 07:51:35 +0000 (07:51 +0000)
[PROBLEM]
Decoder resource management shouldn't be responsibility or concern of
an application. Instead, WebEngine should be able to manage resources.
Migration of WASM Player to TTvd and upstream architecture facilitates
moving of resource management responsibility to WebEngine.

Letting app influence decoder selection imposes some limitations on
optimal decoder selection and enforces potentially suboptimal choices.
For example using audio decoders in SW mode might be preferred in some
cases or HW support may not be available at all where it doesn't make
sense (e.g. pcm which deosn't need decoding).

[SOLUTION]
* Decoding mode option in WebAPI is considered deprecated from now on.
  It's still available for backward compatibility, however it's treated
  as a hint from now on.
* `hardware`, used as a default in old toolchain releases due to legacy
  platform behaviour, will be interpreted as `hardware-with-fallback`.
  This allows upstream arch to assign HW and SW decoders in an optimal
  way.
* `software` option will currently still be honored if used.

Bug: https://jira-eu.sec.samsung.net/browse/VDWASM-1996
Signed-off-by: Piotr Bałut <p.balut@samsung.com>
Change-Id: I299ea02ced413deaece28112b40ef3cd1833f87f

third_party/blink/renderer/modules/elementary_media_stream_source/elementary_media_stream_track_config.idl
tizen_src/chromium_impl/third_party/blink/renderer/modules/elementary_media_stream_source/elementary_media_track.cc

index e007ceca19d8f670786399037724d02e27a50288..e3b8a61d7f2a867a63c3b99c72652cacc2e9d221 100644 (file)
@@ -2,12 +2,16 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+// Deprecated; see ElementaryMediaStreamTrackConfig::decodingMode.
 enum DecodingMode {
-  "hardware",                // Allow only hardware decoder to be used
-  // TODO(m.jurkiewicz): Provide implementation for this option (VDWASM-419)
-  // Current implementation always fallback to software decoder
-  "hardware-with-fallback",  // Fallback to software decoder
-  "software"                 // Use only software decoder
+  // Deprecated. `hardware` is treated as `hardware-with-fallback`.
+  "hardware",
+
+  // Hint HW decoder should be prioritized when selecting decoder.
+  "hardware-with-fallback",
+
+  // Hint SW decoder should be prioritized when selecting decoder.
+  "software"
 };
 
 dictionary ElementaryMediaStreamTrackConfig {
@@ -15,6 +19,11 @@ dictionary ElementaryMediaStreamTrackConfig {
   DOMString mimeType;
   BufferSource extradata;
   // Since ElementaryMediaStreamSource version 3.0
+  // Deprecated. Decoder resource management should be handled by WebEngine:
+  // * This option should be left empty to enable optimal automatic decoder
+  //   selection.
+  // * If set, will be treated as a decoder hint and may not be respected by the
+  //   implementation.
   DecodingMode? decodingMode;
   EncryptionMode? encryptionMode;
 };
index ee90e560ed6637c6287280ea232e18ffe4c2ca26..264a1f79c1a868df4324b2e2ede78ad538e5057f 100644 (file)
@@ -151,7 +151,10 @@ media::DecoderSelectionPolicy V8DecodingModeToDecoderSelectionPolicy(
     V8DecodingMode::Enum v8_decoding_mode) {
   switch (v8_decoding_mode) {
     case V8DecodingMode::Enum::kHardware:
-      return media::DecoderSelectionPolicy::kHardware;
+      EMSS_LOG_NO_INSTANCE(INFO)
+          << "Deprecated `hardware` decoding mode option was specified. "
+             "`hardware-with-fallback` will be used instead.";
+      [[fallthrough]];
     case V8DecodingMode::Enum::kHardwareWithFallback:
       return media::DecoderSelectionPolicy::kHardwareWithFallback;
     case V8DecodingMode::Enum::kSoftware: