diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 10:22:43 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 12:36:28 +0000 |
commit | 271a6c3487a14599023a9106329505597638d793 (patch) | |
tree | e040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/components/arc/common | |
parent | 7b2ffa587235a47d4094787d72f38102089f402a (diff) | |
download | qtwebengine-chromium-271a6c3487a14599023a9106329505597638d793.tar.gz |
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/components/arc/common')
21 files changed, 691 insertions, 98 deletions
diff --git a/chromium/components/arc/common/BUILD.gn b/chromium/components/arc/common/BUILD.gn index 9ae776a05af..c8064bb814c 100644 --- a/chromium/components/arc/common/BUILD.gn +++ b/chromium/components/arc/common/BUILD.gn @@ -33,6 +33,7 @@ if (is_chromeos) { "input_method_manager.mojom", "intent_common.mojom", "intent_helper.mojom", + "keymaster.mojom", "kiosk.mojom", "lock_screen.mojom", "media_session.mojom", @@ -67,6 +68,7 @@ if (is_chromeos) { public_deps = [ ":media", ":notifications", + "//media/capture/video/chromeos/mojo:cros_camera", "//mojo/public/mojom/base", "//services/device/public/mojom:usb", "//services/media_session/public/mojom", @@ -88,9 +90,9 @@ if (is_chromeos) { ] } - # Media related mojo interfaces. There are used by //services/ws/public/mojom. - # We have this separate mojom target to avoid pulling in unnecessary - # interfaces. + # Media related mojo interfaces. These are used by + # //services/viz/public/interfaces. We have this separate mojom target to + # avoid pulling in unnecessary interfaces. mojom("media") { sources = [ "gfx.mojom", @@ -117,4 +119,18 @@ if (is_chromeos) { "//ui/base/ime:text_input_types", ] } + + source_set("unit_tests") { + testonly = true + sources = [ + "video_accelerator_struct_traits_unittest.cc", + ] + + deps = [ + ":common", + "//media", + "//mojo/public/cpp/test_support:test_utils", + "//testing/gtest", + ] + } } diff --git a/chromium/components/arc/common/app.mojom b/chromium/components/arc/common/app.mojom index 3fca7a07a73..8513efbc592 100644 --- a/chromium/components/arc/common/app.mojom +++ b/chromium/components/arc/common/app.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// Next MinVersion: 43 +// Next MinVersion: 44 module arc.mojom; @@ -56,7 +56,11 @@ struct ArcPackageInfo { // If non-null, signifies this package represents a web app that should be // installed on the browser side. [MinVersion=38] WebAppInfo? web_app_info; + + // Deprecated in favour of |permission_states| [MinVersion=41] map<AppPermission, bool>? permissions; + + [MinVersion=43] map<AppPermission, PermissionState>? permission_states; }; // Describes ARC app shortcut. diff --git a/chromium/components/arc/common/app_permissions.mojom b/chromium/components/arc/common/app_permissions.mojom index 6c63abdd588..0454b7411a1 100644 --- a/chromium/components/arc/common/app_permissions.mojom +++ b/chromium/components/arc/common/app_permissions.mojom @@ -11,9 +11,16 @@ module arc.mojom; [Extensible] enum AppPermission { CAMERA = 0, // android.manifest.CAMERA - LOCATION = 1, // android.manifest.ACCESS_FINE_LOCATION + LOCATION = 1, // android.manifest.ACCESS_FINE_LOCATION or android.manifest.ACCESS_COARSE_LOCATION MICROPHONE = 2, // android.manifest.RECORD_AUDIO NOTIFICATIONS = 3, // Not a manifest permission + CONTACTS = 4, // android.manifest.READ_CONTACTS and android.manifest.WRITE_CONTACTS + STORAGE = 5, // android.manifest.WRITE_EXTERNAL_STORAGE and android.manifest.READ_EXTERNAL_STORAGE +}; + +struct PermissionState { + bool granted; // If the permission has been granted + bool managed; // If the permission is managed by an enterprise policy }; // An interface for Chrome to manipulate app permissions in ARC. diff --git a/chromium/components/arc/common/arc_bridge.mojom b/chromium/components/arc/common/arc_bridge.mojom index 137f32078d4..491cdc2da05 100644 --- a/chromium/components/arc/common/arc_bridge.mojom +++ b/chromium/components/arc/common/arc_bridge.mojom @@ -24,6 +24,7 @@ import "components/arc/common/file_system.mojom"; import "components/arc/common/ime.mojom"; import "components/arc/common/input_method_manager.mojom"; import "components/arc/common/intent_helper.mojom"; +import "components/arc/common/keymaster.mojom"; import "components/arc/common/kiosk.mojom"; import "components/arc/common/lock_screen.mojom"; import "components/arc/common/media_session.mojom"; @@ -54,9 +55,9 @@ import "components/arc/common/volume_mounter.mojom"; import "components/arc/common/wake_lock.mojom"; import "components/arc/common/wallpaper.mojom"; -// Next MinVersion: 47 +// Next MinVersion: 48 // Deprecated method IDs: 101, 105 -// Next method ID: 152 +// Next method ID: 153 interface ArcBridgeHost { // Keep the entries alphabetical. In order to do so without breaking // compatibility with the ARC instance, explicitly assign each interface a @@ -131,6 +132,9 @@ interface ArcBridgeHost { [MinVersion=4] OnIntentHelperInstanceReady@111( IntentHelperInstance instance_ptr); + // Notifies Chrome that the KeymasterInstance interface is ready. + [MinVersion=47] OnKeymasterInstanceReady@152(KeymasterInstance instance_ptr); + // Notifies Chrome that the KioskInstance interface is ready. [MinVersion=20] OnKioskInstanceReady@126(KioskInstance instance_ptr); diff --git a/chromium/components/arc/common/bluetooth.typemap b/chromium/components/arc/common/bluetooth.typemap index b59c8707820..d620cccabe9 100644 --- a/chromium/components/arc/common/bluetooth.typemap +++ b/chromium/components/arc/common/bluetooth.typemap @@ -2,7 +2,7 @@ mojom = "//components/arc/common/bluetooth.mojom" public_headers = [ "//device/bluetooth/bluetooth_advertisement.h", "//device/bluetooth/bluetooth_common.h", - "//device/bluetooth/bluetooth_uuid.h", + "//device/bluetooth/public/cpp/bluetooth_uuid.h", "//device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h", ] traits_headers = [ "//components/arc/bluetooth/bluetooth_struct_traits.h" ] @@ -11,6 +11,7 @@ sources = [ ] deps = [ "//device/bluetooth", + "//device/bluetooth/public/cpp", ] type_mappings = [ "arc.mojom.BluetoothDeviceType=device::BluetoothTransport", diff --git a/chromium/components/arc/common/camera.mojom b/chromium/components/arc/common/camera.mojom index 67bb55c2cfb..424bf5b659d 100644 --- a/chromium/components/arc/common/camera.mojom +++ b/chromium/components/arc/common/camera.mojom @@ -2,8 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Next MinVersion: 3 + module arc.mojom; +import "media/capture/video/chromeos/mojo/cros_camera_service.mojom"; + struct CameraDeviceInfo { string device_path@0; string usb_vid@1; @@ -88,11 +92,14 @@ interface CameraService { GetCameraDeviceInfos@7() => (array<CameraDeviceInfo> device_infos); }; -// Next method ID: 1 +// Next method ID: 2 interface CameraHost { // Notifies Chrome that CameraService is requested and returns an interface - // pointer bound to a newly created service. + // pointer bound to a newly created service. Used by camera HAL v1. StartCameraService@0() => (CameraService service); + + // Registers the camera HAL client. Used by camera HAL v3. + [MinVersion=2] RegisterCameraHalClient@1(cros.mojom.CameraHalClient client); }; // Next method ID: 1 diff --git a/chromium/components/arc/common/file_system.mojom b/chromium/components/arc/common/file_system.mojom index 50d7fd4cc61..8b237704b72 100644 --- a/chromium/components/arc/common/file_system.mojom +++ b/chromium/components/arc/common/file_system.mojom @@ -164,6 +164,9 @@ struct SelectFilesRequest { // Filled only when DocumentsContract.EXTRA_INITIAL_URI points to a document // served by a DocumentsProvider. DocumentPath? initial_document_path; + + // Android task ID of the request sender. + int32 task_id; }; // Represents a path to a document served by a DocumentsProvider. @@ -195,6 +198,10 @@ struct FileSelectorEvent { // Specifies the target directory/file for CLICK_DIRECTORY/CLICK_FILE. FileSelectorElement click_target; + + // Android task ID of the activity that created the file selector by sending + // a SelectFilesRequest. + int32 creator_task_id; }; // Types of UI events for FileSelectorEvent. @@ -206,6 +213,13 @@ enum FileSelectorEventType { CLICK_CANCEL, // Clicks Cancel button. }; +// Request for GetFileSelectorElements. +struct GetFileSelectorElementsRequest { + // Android task ID of the activity that created the file selector by sending + // a SelectFilesRequest. + int32 creator_task_id; +}; + // Represents a clickable UI element shown on ChromeOS file selector. struct FileSelectorElement { // User-visible label of the element (e.g. button text). @@ -259,7 +273,8 @@ interface FileSystemHost { // Returns UI elements shown on the ChromeOS file selector previously opened // by SelectFiles@5. This exists for running Android UI tests (CTS) on // ChromeOS file selector, and thus it is only allowed under test conditions. - [MinVersion=11] GetFileSelectorElements@8() => + [MinVersion=11] GetFileSelectorElements@8( + GetFileSelectorElementsRequest request) => (FileSelectorElements elements); }; diff --git a/chromium/components/arc/common/input_method_manager.mojom b/chromium/components/arc/common/input_method_manager.mojom index 1a25f4c9e0d..c5c0b930d2b 100644 --- a/chromium/components/arc/common/input_method_manager.mojom +++ b/chromium/components/arc/common/input_method_manager.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Next MinVersion: 8 +// Next MinVersion: 9 module arc.mojom; @@ -77,7 +77,7 @@ struct KeyEventData { // It is generated for each focused text field and passed to Android. // This interface will be closed when the focus moves to another text field. // -// Next method ID: 7 +// Next method ID: 8 [MinVersion=2] interface InputConnection { // Commits text to the focused text field and set the new cursor position. @@ -106,6 +106,9 @@ interface InputConnection { // Sends a key event. [MinVersion=7] SendKeyEvent@6(KeyEventData key_event_data); + + // Starts composition over a given range. + [MinVersion=8] SetCompositionRange@7(Range new_range); }; // This interface is called by container when Android's InputMethodManager state diff --git a/chromium/components/arc/common/intent_helper.mojom b/chromium/components/arc/common/intent_helper.mojom index a5d9401240f..ab63854fe9f 100644 --- a/chromium/components/arc/common/intent_helper.mojom +++ b/chromium/components/arc/common/intent_helper.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// Next MinVersion: 27 +// Next MinVersion: 29 module arc.mojom; @@ -171,9 +171,14 @@ interface CustomTabSession { [MinVersion=26] OnOpenInChromeClicked@0(); }; +enum CameraIntentMode { + PHOTO, + VIDEO, +}; + // Handles intents from ARC in Chrome. // Deprecated method ID: 4 -// Next method ID: 11 +// Next method ID: 13 interface IntentHelperHost { // Called when icons associated with the package are no longer up to date. [MinVersion=3] OnIconInvalidated@1(string package_name); @@ -220,6 +225,25 @@ interface IntentHelperHost { // Records Sharing files feature's metrics via Chrome. [MinVersion=24] RecordShareFilesMetrics@9(ShareFiles flag); + + // Does a reset of ARC; this wipes /data, and then re-calls on OOBE for + // account binding to happen again, as if the user just went through OOBE. + [MinVersion=27] FactoryResetArc@11(); + + // Launches camera app from the camera intent. + // |mode| indicates which mode should camera app land on. If + // |should_handle_result| is true, the intent expects the captured result + // will be returned after capturing. If |should_down_scale| is true, the + // intent expects the captured image would be down-scaled to a small enough + // size. If |is_secure| is true, the intent is fired when the device is + // secured, which means the camera app should not show any user-sensitive + // data. |is_success| indicates that the capture is done successfully. If it + // succeed, the result should be filled in |captured_data| as a byte array. + [MinVersion=28] LaunchCameraApp@12(CameraIntentMode mode, + bool should_handle_result, + bool should_down_scale, + bool is_secure) + => (bool is_success, array<uint8> captured_data); }; // Sends intents to ARC on behalf of Chrome. diff --git a/chromium/components/arc/common/keymaster.mojom b/chromium/components/arc/common/keymaster.mojom new file mode 100644 index 00000000000..24475b72636 --- /dev/null +++ b/chromium/components/arc/common/keymaster.mojom @@ -0,0 +1,212 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Next MinVersion: 1 + +// This file defines the mojo interface between Android and Chrome OS for the +// keymaster implementation used in ARC. + +module arc.mojom; + +// Host is implemented in Chrome. Listens until server and instance come online +// and forwards a server handle to the instance. +interface KeymasterHost { + GetServer@0() => (KeymasterServer server_ptr); +}; + +// Instance is implemented in ARC. Retrieves a server pointer from the host and +// uses it to fulfill Android Keymaster operations. +interface KeymasterInstance { + Init@0(KeymasterHost host_ptr) => (); +}; + +// Server is implemented in arc-keymasterd in Chrome OS. This interface is the +// mojo equivalent of the Keymaster 3.0 HIDL interface. Please refer to +// Android's IKeymasterDevice.hal for a more detailed description on how the +// methods and structs below should function. +interface KeymasterServer { + + // Sets the Android version information used. + SetSystemVersion@0(uint32 os_version, uint32 os_patchlevel); + + AddRngEntropy@1(array<uint8> data) => (int32 error); + + // Returns the characteristics of the specified key if it is valid. + GetKeyCharacteristics@2(GetKeyCharacteristicsRequest request) => + (GetKeyCharacteristicsResult response); + + GenerateKey@3(array<KeyParameter> key_params) => (GenerateKeyResult response); + + ImportKey@4(ImportKeyRequest request) => (ImportKeyResult response); + + // Exports a public key, returning the key in the specified format. + ExportKey@5(ExportKeyRequest request) => (ExportKeyResult response); + + // Generates a signed X.509 certificate chain attesting to the presence of + // keyToAttest in Keymaster. + AttestKey@6(AttestKeyRequest request) => (AttestKeyResult result); + + // Upgrades a key generated by an older version of the Keymaster. + UpgradeKey@7(UpgradeKeyRequest request) => (UpgradeKeyResult response); + + DeleteKey@8(array<uint8> key_blob) => (int32 error); + + DeleteAllKeys@9() => (int32 error); + + // Begins a cryptographic operation using the specified key. + Begin@10(BeginRequest request) => (BeginResult result); + + // Provides data and possibly receives output from an ongoing operation. + Update@11(UpdateRequest request) => (UpdateResult response); + + // Finalizes a cryptographic operation and invalidates operation handle. + Finish@12(FinishRequest request) => (FinishResult response); + + // Aborts an operation and invalidates the operation handle. + Abort@13(uint64 op_handle) => (int32 error); +}; + +//////////////////////////////////////////////////////////////////////////////// +// KeymasterServer helper enums and structs + +[Extensible] +enum KeyPurpose { + ENCRYPT = 0, // Usable with RSA, EC and AES keys. + DECRYPT = 1, // Usable with RSA, EC and AES keys. + SIGN = 2, // Usable with RSA, EC and HMAC keys. + VERIFY = 3, // Usable with RSA, EC and HMAC keys. + DERIVE_KEY = 4, // Usable with EC keys. + WRAP_KEY = 5, // Usable with wrapping keys. +}; + +[Extensible] +enum KeyFormat { + X509 = 0, // for public key export + PKCS8 = 1, // for asymmetric key pair import + RAW = 3, // for symmetric key import and export +}; + +// Helper union for key parameter values. +union IntegerKeyParam { + bool boolean_value; // KM_BOOL + uint32 integer; // KM_ENUM, KM_ENUM_REP, KM_INT and KM_INT_REP + uint64 long_integer; // KM_LONG + uint64 date_time; // KM_DATE + array<uint8> blob; // KM_BIGNUM and KM_BYTES +}; + +struct KeyParameter { + // Discriminates the IntegerKeyParam union field used. + uint32 tag; + IntegerKeyParam param; +}; + +// Defines the attributes of a key, including cryptographic parameters, and +// usage restrictions. +struct KeyCharacteristics { + array<KeyParameter> software_enforced; + array<KeyParameter> tee_enforced; +}; + +//////////////////////////////////////////////////////////////////////////////// +// KeymasterServer request and response structs + +struct GetKeyCharacteristicsRequest { + array<uint8> key_blob; + array<uint8> client_id; + array<uint8> app_data; +}; + +struct GetKeyCharacteristicsResult { + KeyCharacteristics key_characteristics; + int32 error; +}; + +struct GenerateKeyResult { + array<uint8> key_blob; + KeyCharacteristics key_characteristics; + int32 error; +}; + +struct ImportKeyRequest { + array<KeyParameter> key_description; + KeyFormat key_format; + array<uint8> key_data; +}; + +struct ImportKeyResult { + array<uint8> key_blob; + KeyCharacteristics key_characteristics; + int32 error; +}; + +struct ExportKeyRequest { + KeyFormat key_format; + array<uint8> key_blob; + array<uint8> client_id; + array<uint8> app_data; +}; + +struct ExportKeyResult { + array<uint8> key_material; + int32 error; +}; + +struct AttestKeyRequest { + array<uint8> key_to_attest; + array<KeyParameter> attest_params; +}; + +struct AttestKeyResult { + array<array<uint8>> cert_chain; + int32 error; +}; + +struct UpgradeKeyRequest { + array<uint8> key_blob_to_upgrade; + array<KeyParameter> upgrade_params; +}; + +struct UpgradeKeyResult { + array<uint8> upgraded_key_blob; + int32 error; +}; + +struct BeginRequest { + KeyPurpose purpose; + array<uint8> key; + array<KeyParameter> in_params; +}; + +struct BeginResult { + array<KeyParameter> out_params; + uint64 op_handle; + int32 error; +}; + +struct UpdateRequest { + uint64 op_handle; + array<KeyParameter> in_params; + array<uint8> input; +}; + +struct UpdateResult { + uint32 input_consumed; + array<KeyParameter> out_params; + array<uint8> output; + int32 error; +}; + +struct FinishRequest { + uint64 op_handle; + array<KeyParameter> in_params; + array<uint8> input; + array<uint8> signature; +}; + +struct FinishResult { + array<KeyParameter> out_params; + array<uint8> output; + int32 error; +}; diff --git a/chromium/components/arc/common/policy.mojom b/chromium/components/arc/common/policy.mojom index 35396e8c8d8..71489020452 100644 --- a/chromium/components/arc/common/policy.mojom +++ b/chromium/components/arc/common/policy.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// Next MinVersion: 5 +// Next MinVersion: 6 module arc.mojom; @@ -59,7 +59,7 @@ enum CommandResultType { SUCCESS = 2, // The command was successfully executed. }; -// Next Method ID: 2 +// Next Method ID: 7 interface PolicyHost { // Get policies from Chrome OS, as JSON-encoded dictionary with the policies' // names as keys and their values as values. The list of possible policies can @@ -73,16 +73,26 @@ interface PolicyHost { [MinVersion=1] ReportCompliance@1(string request) => (string response); // Reports that request was sent to CloudDPS for set of packages. - [MinVersion=3] ReportCloudDpsRequested(mojo_base.mojom.Time time, + [MinVersion=3] ReportCloudDpsRequested@2(mojo_base.mojom.Time time, array<string> package_names); // Reports that successful response was received from CloudDPS for set of // packages. - [MinVersion=3] ReportCloudDpsSucceeded(mojo_base.mojom.Time time, + [MinVersion=3] ReportCloudDpsSucceeded@3(mojo_base.mojom.Time time, array<string> package_names); // Reports that CloudDPS reports an error for packages. - [MinVersion=3] ReportCloudDpsFailed(mojo_base.mojom.Time time, + [MinVersion=3] ReportCloudDpsFailed@4(mojo_base.mojom.Time time, string package_name, InstallErrorReason reason); + + // Reports that packages were scheduled for force installing + // via Play Store directly. + [MinVersion=5] ReportDirectInstall@5(mojo_base.mojom.Time time, + array<string> package_names); + + // Reports that CloudDPC is giving up after several retries to + // force install the packages. + [MinVersion=5] ReportForceInstallMainLoopFailed@6(mojo_base.mojom.Time time, + array<string> package_names); }; // Next Method ID: 4 diff --git a/chromium/components/arc/common/video_accelerator_struct_traits.cc b/chromium/components/arc/common/video_accelerator_struct_traits.cc index dfb8d49f05f..4116b28ca39 100644 --- a/chromium/components/arc/common/video_accelerator_struct_traits.cc +++ b/chromium/components/arc/common/video_accelerator_struct_traits.cc @@ -42,12 +42,12 @@ CHECK_PROFILE_ENUM(HEVCPROFILE_MAIN); CHECK_PROFILE_ENUM(HEVCPROFILE_MAIN10); CHECK_PROFILE_ENUM(HEVCPROFILE_MAIN_STILL_PICTURE); CHECK_PROFILE_ENUM(HEVCPROFILE_MAX); -CHECK_PROFILE_ENUM(DOLBYVISION_MIN); CHECK_PROFILE_ENUM(DOLBYVISION_PROFILE0); CHECK_PROFILE_ENUM(DOLBYVISION_PROFILE4); CHECK_PROFILE_ENUM(DOLBYVISION_PROFILE5); CHECK_PROFILE_ENUM(DOLBYVISION_PROFILE7); -CHECK_PROFILE_ENUM(DOLBYVISION_MAX); +CHECK_PROFILE_ENUM(DOLBYVISION_PROFILE8); +CHECK_PROFILE_ENUM(DOLBYVISION_PROFILE9); CHECK_PROFILE_ENUM(THEORAPROFILE_MIN); CHECK_PROFILE_ENUM(THEORAPROFILE_ANY); CHECK_PROFILE_ENUM(THEORAPROFILE_MAX); @@ -96,6 +96,8 @@ bool EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile>:: case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE4: case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE5: case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE7: + case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE8: + case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE9: case arc::mojom::VideoCodecProfile::THEORAPROFILE_ANY: case arc::mojom::VideoCodecProfile::AV1PROFILE_PROFILE_MAIN: case arc::mojom::VideoCodecProfile::AV1PROFILE_PROFILE_HIGH: @@ -109,6 +111,107 @@ bool EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile>:: return false; } +// Make sure values in arc::mojom::VideoPixelFormat match to the values in +// media::VideoPixelFormat. The former is a subset of the later. +#define CHECK_PIXEL_FORMAT_ENUM(value) \ + static_assert( \ + static_cast<int>(arc::mojom::VideoPixelFormat::value) == media::value, \ + "enum ##value mismatch") + +CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_UNKNOWN); +CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_I420); +CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_YV12); +CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_NV12); +CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_NV21); +CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_ARGB); +CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_ABGR); +CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_XBGR); + +#undef CHECK_PXIEL_FORMAT_ENUM + +// static +arc::mojom::VideoPixelFormat +EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat>::ToMojom( + media::VideoPixelFormat input) { + switch (input) { + case media::PIXEL_FORMAT_UNKNOWN: + case media::PIXEL_FORMAT_I420: + case media::PIXEL_FORMAT_YV12: + case media::PIXEL_FORMAT_NV12: + case media::PIXEL_FORMAT_NV21: + case media::PIXEL_FORMAT_ARGB: + case media::PIXEL_FORMAT_ABGR: + case media::PIXEL_FORMAT_XBGR: + return static_cast<arc::mojom::VideoPixelFormat>(input); + + default: + NOTIMPLEMENTED(); + return arc::mojom::VideoPixelFormat::PIXEL_FORMAT_UNKNOWN; + } +} + +// static +bool EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat>:: + FromMojom(arc::mojom::VideoPixelFormat input, + media::VideoPixelFormat* output) { + switch (input) { + case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_UNKNOWN: + case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_I420: + case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_YV12: + case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_NV12: + case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_NV21: + case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_ARGB: + case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_ABGR: + case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_XBGR: + *output = static_cast<media::VideoPixelFormat>(input); + return true; + } + NOTREACHED(); + return false; +} + +// Make sure values in arc::mojom::DecodeStatus match to the values in +// media::DecodeStatus. +#define CHECK_DECODE_STATUS_ENUM(value) \ + static_assert(static_cast<int>(arc::mojom::DecodeStatus::value) == \ + static_cast<int>(media::DecodeStatus::value), \ + "enum ##value mismatch") + +CHECK_DECODE_STATUS_ENUM(OK); +CHECK_DECODE_STATUS_ENUM(ABORTED); +CHECK_DECODE_STATUS_ENUM(DECODE_ERROR); + +#undef CHECK_DECODE_STATUS_ENUM + +// static +arc::mojom::DecodeStatus +EnumTraits<arc::mojom::DecodeStatus, media::DecodeStatus>::ToMojom( + media::DecodeStatus input) { + switch (input) { + case media::DecodeStatus::OK: + case media::DecodeStatus::ABORTED: + case media::DecodeStatus::DECODE_ERROR: + return static_cast<arc::mojom::DecodeStatus>(input); + } + NOTREACHED() << "unknown status: " << static_cast<int>(input); + return arc::mojom::DecodeStatus::DECODE_ERROR; +} + +// static +bool EnumTraits<arc::mojom::DecodeStatus, media::DecodeStatus>::FromMojom( + arc::mojom::DecodeStatus input, + media::DecodeStatus* output) { + switch (input) { + case arc::mojom::DecodeStatus::OK: + case arc::mojom::DecodeStatus::ABORTED: + case arc::mojom::DecodeStatus::DECODE_ERROR: + *output = static_cast<media::DecodeStatus>(input); + return true; + } + NOTREACHED() << "unknown status: " << static_cast<int>(input); + return false; +} + // static bool StructTraits<arc::mojom::VideoFramePlaneDataView, arc::VideoFramePlane>:: Read(arc::mojom::VideoFramePlaneDataView data, arc::VideoFramePlane* out) { @@ -130,4 +233,40 @@ bool StructTraits<arc::mojom::SizeDataView, gfx::Size>::Read( out->SetSize(data.width(), data.height()); return true; } + +// static +bool StructTraits<arc::mojom::MediaVideoFramePlaneDataView, + media::VideoFrameLayout::Plane>:: + Read(arc::mojom::MediaVideoFramePlaneDataView data, + media::VideoFrameLayout::Plane* out) { + out->offset = data.offset(); + out->stride = data.stride(); + out->size = data.size(); + return true; +} + +// static +bool StructTraits<arc::mojom::VideoFrameLayoutDataView, + std::unique_ptr<media::VideoFrameLayout>>:: + Read(arc::mojom::VideoFrameLayoutDataView data, + std::unique_ptr<media::VideoFrameLayout>* out) { + media::VideoPixelFormat format; + gfx::Size coded_size; + std::vector<media::VideoFrameLayout::Plane> planes; + if (!data.ReadFormat(&format) || !data.ReadCodedSize(&coded_size) || + !data.ReadPlanes(&planes)) { + return false; + } + + base::Optional<media::VideoFrameLayout> layout = + media::VideoFrameLayout::CreateWithPlanes( + format, coded_size, std::move(planes), data.buffer_addr_align(), + data.modifier()); + if (!layout) + return false; + + *out = std::make_unique<media::VideoFrameLayout>(*layout); + return true; +} + } // namespace mojo diff --git a/chromium/components/arc/common/video_accelerator_struct_traits.h b/chromium/components/arc/common/video_accelerator_struct_traits.h index c1f4e28fa92..f9c959f8863 100644 --- a/chromium/components/arc/common/video_accelerator_struct_traits.h +++ b/chromium/components/arc/common/video_accelerator_struct_traits.h @@ -5,9 +5,14 @@ #ifndef COMPONENTS_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ #define COMPONENTS_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ +#include <memory> + #include "components/arc/common/video_common.mojom.h" #include "components/arc/video_accelerator/video_frame_plane.h" +#include "media/base/decode_status.h" #include "media/base/video_codecs.h" +#include "media/base/video_frame_layout.h" +#include "media/base/video_types.h" #include "ui/gfx/geometry/size.h" namespace mojo { @@ -50,6 +55,96 @@ struct StructTraits<arc::mojom::SizeDataView, gfx::Size> { static bool Read(arc::mojom::SizeDataView data, gfx::Size* out); }; + +template <> +struct EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat> { + static arc::mojom::VideoPixelFormat ToMojom(media::VideoPixelFormat input); + + static bool FromMojom(arc::mojom::VideoPixelFormat input, + media::VideoPixelFormat* output); +}; + +template <> +struct StructTraits<arc::mojom::MediaVideoFramePlaneDataView, + media::VideoFrameLayout::Plane> { + static int32_t stride(const media::VideoFrameLayout::Plane& r) { + return r.stride; + } + + static uint32_t offset(const media::VideoFrameLayout::Plane& r) { + return r.offset; + } + + static uint32_t size(const media::VideoFrameLayout::Plane& r) { + return r.size; + } + + static bool Read(arc::mojom::MediaVideoFramePlaneDataView data, + media::VideoFrameLayout::Plane* out); +}; + +// Because `media::VideoFrameLayout` doesn't have default constructor, we cannot +// convert from mojo struct directly. Instead, we map to the type +// `std::unique_ptr<media::VideoFrameLayout>`. +template <> +struct StructTraits<arc::mojom::VideoFrameLayoutDataView, + std::unique_ptr<media::VideoFrameLayout>> { + static bool IsNull(const std::unique_ptr<media::VideoFrameLayout>& input) { + return input.get() == nullptr; + } + + static void SetToNull(std::unique_ptr<media::VideoFrameLayout>* output) { + output->reset(); + } + + static media::VideoPixelFormat format( + const std::unique_ptr<media::VideoFrameLayout>& input) { + DCHECK(input); + return input->format(); + } + + static const gfx::Size& coded_size( + const std::unique_ptr<media::VideoFrameLayout>& input) { + DCHECK(input); + return input->coded_size(); + } + + static const std::vector<media::VideoFrameLayout::Plane>& planes( + const std::unique_ptr<media::VideoFrameLayout>& input) { + DCHECK(input); + return input->planes(); + } + + static bool is_multi_planar( + const std::unique_ptr<media::VideoFrameLayout>& input) { + DCHECK(input); + return input->is_multi_planar(); + } + + static uint32_t buffer_addr_align( + const std::unique_ptr<media::VideoFrameLayout>& input) { + DCHECK(input); + return input->buffer_addr_align(); + } + + static uint64_t modifier( + const std::unique_ptr<media::VideoFrameLayout>& input) { + DCHECK(input); + return input->modifier(); + } + + static bool Read(arc::mojom::VideoFrameLayoutDataView data, + std::unique_ptr<media::VideoFrameLayout>* out); +}; + +template <> +struct EnumTraits<arc::mojom::DecodeStatus, media::DecodeStatus> { + static arc::mojom::DecodeStatus ToMojom(media::DecodeStatus input); + + static bool FromMojom(arc::mojom::DecodeStatus input, + media::DecodeStatus* output); +}; + } // namespace mojo #endif // COMPONENTS_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ diff --git a/chromium/components/arc/common/video_accelerator_struct_traits_unittest.cc b/chromium/components/arc/common/video_accelerator_struct_traits_unittest.cc new file mode 100644 index 00000000000..6d2e655bbda --- /dev/null +++ b/chromium/components/arc/common/video_accelerator_struct_traits_unittest.cc @@ -0,0 +1,61 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/arc/common/video_accelerator_struct_traits.h" + +#include <vector> + +#include "components/arc/common/video_common.mojom.h" +#include "media/base/video_frame_layout.h" +#include "media/base/video_types.h" +#include "mojo/public/cpp/test_support/test_utils.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace mojo { + +namespace { +constexpr int kWidth = 640; +constexpr int kHeight = 480; +constexpr media::VideoPixelFormat kFormat = media::PIXEL_FORMAT_I420; +constexpr gfx::Size kCodedSize(kWidth, kHeight); +} // namespace + +TEST(VideoAcceleratorStructTraitsTest, ConvertVideoFrameLayout) { + std::vector<media::VideoFrameLayout::Plane> planes; + planes.emplace_back(kWidth, 0, kWidth * kHeight); + planes.emplace_back(kWidth / 2, kWidth * kHeight, kWidth * kHeight / 4); + planes.emplace_back(kWidth / 2, kWidth * kHeight + kWidth * kHeight / 4, + kWidth * kHeight / 4); + // Choose a non-default value. + constexpr size_t buffer_addr_align = 128; + constexpr uint64_t modifier = 0x1234; + + base::Optional<media::VideoFrameLayout> layout = + media::VideoFrameLayout::CreateWithPlanes(kFormat, kCodedSize, planes, + buffer_addr_align, modifier); + EXPECT_TRUE(layout); + + std::unique_ptr<media::VideoFrameLayout> input = + std::make_unique<media::VideoFrameLayout>(*layout); + std::unique_ptr<media::VideoFrameLayout> output; + mojo::test::SerializeAndDeserialize<arc::mojom::VideoFrameLayout>(&input, + &output); + + EXPECT_EQ(output->format(), kFormat); + EXPECT_EQ(output->coded_size(), kCodedSize); + EXPECT_EQ(output->planes(), planes); + EXPECT_EQ(output->buffer_addr_align(), buffer_addr_align); + EXPECT_EQ(output->modifier(), modifier); +} + +TEST(VideoAcceleratorStructTraitsTest, ConvertNullVideoFrameLayout) { + std::unique_ptr<media::VideoFrameLayout> input; + std::unique_ptr<media::VideoFrameLayout> output; + mojo::test::SerializeAndDeserialize<arc::mojom::VideoFrameLayout>(&input, + &output); + + EXPECT_FALSE(output); +} + +} // namespace mojo diff --git a/chromium/components/arc/common/video_common.mojom b/chromium/components/arc/common/video_common.mojom index 188a3509cfd..3ead5042db6 100644 --- a/chromium/components/arc/common/video_common.mojom +++ b/chromium/components/arc/common/video_common.mojom @@ -41,12 +41,10 @@ enum VideoCodecProfile { HEVCPROFILE_MAIN10 = 17, HEVCPROFILE_MAIN_STILL_PICTURE = 18, HEVCPROFILE_MAX = HEVCPROFILE_MAIN_STILL_PICTURE, - DOLBYVISION_MIN = 19, - DOLBYVISION_PROFILE0 = DOLBYVISION_MIN, + DOLBYVISION_PROFILE0 = 19, DOLBYVISION_PROFILE4 = 20, DOLBYVISION_PROFILE5 = 21, DOLBYVISION_PROFILE7 = 22, - DOLBYVISION_MAX = DOLBYVISION_PROFILE7, THEORAPROFILE_MIN = 23, THEORAPROFILE_ANY = THEORAPROFILE_MIN, THEORAPROFILE_MAX = THEORAPROFILE_ANY, @@ -55,7 +53,9 @@ enum VideoCodecProfile { AV1PROFILE_PROFILE_HIGH = 25, AV1PROFILE_PROFILE_PRO = 26, AV1PROFILE_MAX = AV1PROFILE_PROFILE_PRO, - VIDEO_CODEC_PROFILE_MAX = AV1PROFILE_PROFILE_PRO, + DOLBYVISION_PROFILE8 = 27, + DOLBYVISION_PROFILE9 = 28, + VIDEO_CODEC_PROFILE_MAX = DOLBYVISION_PROFILE9, }; [Extensible] @@ -68,6 +68,27 @@ enum HalPixelFormat { HAL_PIXEL_FORMAT_NV12 = 0x3231564e, }; +[Extensible] +enum VideoPixelFormat { + // The values must match to the values in media::VideoPixelFormat + PIXEL_FORMAT_UNKNOWN = 0, + PIXEL_FORMAT_I420 = 1, + [MinVersion=2] PIXEL_FORMAT_YV12 = 2, + [MinVersion=2] PIXEL_FORMAT_NV12 = 6, + [MinVersion=2] PIXEL_FORMAT_NV21 = 7, + [MinVersion=2] PIXEL_FORMAT_ARGB = 10, + [MinVersion=2] PIXEL_FORMAT_ABGR = 27, + [MinVersion=2] PIXEL_FORMAT_XBGR = 28, +}; + +[Extensible] +enum DecodeStatus { + // The values must match to the values in media::DecodeStatus + OK = 0, + ABORTED = 1, + DECODE_ERROR = 2, +}; + // The offset and stride of a video frame plane. Both offset and stride must // be non negative. struct VideoFramePlane { @@ -80,3 +101,22 @@ struct Size { int32 width; int32 height; }; + +// The information of a plane of a video frame that describes how physical +// buffers are allocated. +struct MediaVideoFramePlane { + int32 stride; + uint32 offset; + uint32 size; +}; + +// The layout that describes how physical buffers are allocated for a video +// frame. +struct VideoFrameLayout { + VideoPixelFormat format; + Size coded_size; + array<MediaVideoFramePlane> planes; + bool is_multi_planar; + uint32 buffer_addr_align; + uint64 modifier; +}; diff --git a/chromium/components/arc/common/video_common.typemap b/chromium/components/arc/common/video_common.typemap index 69e686682e1..9eb47ee6195 100644 --- a/chromium/components/arc/common/video_common.typemap +++ b/chromium/components/arc/common/video_common.typemap @@ -4,22 +4,38 @@ mojom = "//components/arc/common/video_common.mojom" public_headers = [ - "//media/base/video_codecs.h", "//components/arc/video_accelerator/video_frame_plane.h", + "//media/base/decode_status.h", + "//media/base/video_codecs.h", + "//media/base/video_frame_layout.h", + "//media/base/video_types.h", "//ui/gfx/geometry/size.h", ] + public_deps = [ "//media", ] + traits_headers = [ "//components/arc/common/video_accelerator_struct_traits.h" ] + sources = [ "//components/arc/common/video_accelerator_struct_traits.cc", + "//components/arc/common/video_accelerator_struct_traits.h", ] + deps = [ "//ui/gfx/geometry", ] + type_mappings = [ + "arc.mojom.DecodeStatus=media::DecodeStatus", + "arc.mojom.MediaVideoFramePlane=media::VideoFrameLayout::Plane", + "arc.mojom.Size=gfx::Size", "arc.mojom.VideoCodecProfile=media::VideoCodecProfile", + + # media::VideoFrameLayout doesn't have default constructor, so we cannot + # convert directly. + "arc.mojom.VideoFrameLayout=std::unique_ptr<media::VideoFrameLayout>[move_only,nullable_is_same_type]", "arc.mojom.VideoFramePlane=arc::VideoFramePlane[move_only]", - "arc.mojom.Size=gfx::Size", + "arc.mojom.VideoPixelFormat=media::VideoPixelFormat", ] diff --git a/chromium/components/arc/common/video_decode_accelerator.mojom b/chromium/components/arc/common/video_decode_accelerator.mojom index b9c748f44ed..625b62a0d19 100644 --- a/chromium/components/arc/common/video_decode_accelerator.mojom +++ b/chromium/components/arc/common/video_decode_accelerator.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Next MinVersion: 4 +// Next MinVersion: 5 // This file defines the mojo interface between Android and Chromium for video // decoding. Any Mojo callee that returns a value does so by callback. @@ -78,7 +78,7 @@ struct VideoDecodeAcceleratorConfig { // the dummy buffer. // // Deprecated method IDs: 3, 7, 8 -// Next method ID: 10 +// Next method ID: 11 interface VideoDecodeAccelerator { [Extensible] enum Result { @@ -104,7 +104,13 @@ interface VideoDecodeAccelerator { // Sets the number of output picture buffers. // This releases any buffers in use/imported previously. - AssignPictureBuffers@2(uint32 count); + AssignPictureBuffersDeprecated@2(uint32 count); + + // Sets the number of output picture buffers. |size| is the frame size + // adjusted by Android. + // This releases any buffers in use/imported previously. + [MinVersion=4] + AssignPictureBuffers@10(uint32 count, Size size); // Imports a buffer to be used by the accelerator with specified // |picture_buffer_id|. diff --git a/chromium/components/arc/common/video_encode_accelerator.mojom b/chromium/components/arc/common/video_encode_accelerator.mojom index 29c06901fd0..b4c9f417340 100644 --- a/chromium/components/arc/common/video_encode_accelerator.mojom +++ b/chromium/components/arc/common/video_encode_accelerator.mojom @@ -11,19 +11,6 @@ import "components/arc/common/video_common.mojom"; // Next MinVersion: 4 -[Extensible] -enum VideoPixelFormat { - // The values must match to the values in media::VideoPixelFormat - PIXEL_FORMAT_UNKNOWN = 0, - PIXEL_FORMAT_I420 = 1, - [MinVersion=2] PIXEL_FORMAT_YV12 = 2, - [MinVersion=2] PIXEL_FORMAT_NV12 = 6, - [MinVersion=2] PIXEL_FORMAT_NV21 = 7, - [MinVersion=2] PIXEL_FORMAT_ARGB = 10, - [MinVersion=2] PIXEL_FORMAT_ABGR = 27, - [MinVersion=2] PIXEL_FORMAT_XBGR = 28, -}; - // Specification of an encoding profile supported by an encoder. struct VideoEncodeProfile { VideoCodecProfile profile; diff --git a/chromium/components/arc/common/video_encode_accelerator.typemap b/chromium/components/arc/common/video_encode_accelerator.typemap index eb875515e53..5210cc6379d 100644 --- a/chromium/components/arc/common/video_encode_accelerator.typemap +++ b/chromium/components/arc/common/video_encode_accelerator.typemap @@ -19,7 +19,6 @@ deps = [ type_mappings = [ "arc.mojom.VideoFrameStorageType=media::VideoEncodeAccelerator::Config::StorageType", "arc.mojom.VideoEncodeAccelerator.Error=media::VideoEncodeAccelerator::Error", - "arc.mojom.VideoPixelFormat=media::VideoPixelFormat", "arc.mojom.VideoEncodeProfile=media::VideoEncodeAccelerator::SupportedProfile", "arc.mojom.VideoEncodeAcceleratorConfig=media::VideoEncodeAccelerator::Config", ] diff --git a/chromium/components/arc/common/video_encode_accelerator_struct_traits.cc b/chromium/components/arc/common/video_encode_accelerator_struct_traits.cc index 17c4a792a5f..72bcd884f3d 100644 --- a/chromium/components/arc/common/video_encode_accelerator_struct_traits.cc +++ b/chromium/components/arc/common/video_encode_accelerator_struct_traits.cc @@ -65,51 +65,6 @@ bool EnumTraits<arc::mojom::VideoEncodeAccelerator::Error, return false; } -// Make sure values in arc::mojom::VideoPixelFormat match to the values in -// media::VideoPixelFormat. The former is a subset of the later. -#define CHECK_PIXEL_FORMAT_ENUM(value) \ - static_assert( \ - static_cast<int>(arc::mojom::VideoPixelFormat::value) == media::value, \ - "enum ##value mismatch") - -CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_I420); -CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_YV12); -CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_NV12); -CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_NV21); -CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_ARGB); -CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_ABGR); -CHECK_PIXEL_FORMAT_ENUM(PIXEL_FORMAT_XBGR); - -#undef CHECK_PXIEL_FORMAT_ENUM - -// static -arc::mojom::VideoPixelFormat -EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat>::ToMojom( - media::VideoPixelFormat input) { - NOTIMPLEMENTED(); - return arc::mojom::VideoPixelFormat::PIXEL_FORMAT_I420; -} - -// static -bool EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat>:: - FromMojom(arc::mojom::VideoPixelFormat input, - media::VideoPixelFormat* output) { - switch (input) { - case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_UNKNOWN: - case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_I420: - case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_YV12: - case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_NV12: - case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_NV21: - case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_ARGB: - case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_ABGR: - case arc::mojom::VideoPixelFormat::PIXEL_FORMAT_XBGR: - *output = static_cast<media::VideoPixelFormat>(input); - return true; - } - NOTREACHED(); - return false; -} - // static bool StructTraits<arc::mojom::VideoEncodeAcceleratorConfigDataView, media::VideoEncodeAccelerator::Config>:: diff --git a/chromium/components/arc/common/video_encode_accelerator_struct_traits.h b/chromium/components/arc/common/video_encode_accelerator_struct_traits.h index 9f0dee55f0b..aa3078c0a7b 100644 --- a/chromium/components/arc/common/video_encode_accelerator_struct_traits.h +++ b/chromium/components/arc/common/video_encode_accelerator_struct_traits.h @@ -31,14 +31,6 @@ struct EnumTraits<arc::mojom::VideoEncodeAccelerator::Error, }; template <> -struct EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat> { - static arc::mojom::VideoPixelFormat ToMojom(media::VideoPixelFormat input); - - static bool FromMojom(arc::mojom::VideoPixelFormat input, - media::VideoPixelFormat* output); -}; - -template <> struct StructTraits<arc::mojom::VideoEncodeProfileDataView, media::VideoEncodeAccelerator::SupportedProfile> { static media::VideoCodecProfile profile( |