media_perception: Update VCS mojom files for M77.

BUG=chromium:994234
TEST=Verified that the VCS integration works on M77.

Change-Id: I9cbf430c2a6b1614fa4864077c096045b8a6a4c2
Reviewed-on: https://chromium-review.googlesource.com/1756087
Tested-by: Luke Sorenson <lasoren@chromium.org>
Commit-Ready: Toni Baržić <tbarzic@chromium.org>
Commit-Ready: Luke Sorenson <lasoren@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Toni Baržić <tbarzic@chromium.org>
(cherry picked from commit 8e58bd1ddca19277343a5cf93079456d4b58c416)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/1815841
Reviewed-by: Luke Sorenson <lasoren@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
diff --git a/media_perception/BUILD.gn b/media_perception/BUILD.gn
index 0c8d869..f927065 100644
--- a/media_perception/BUILD.gn
+++ b/media_perception/BUILD.gn
@@ -38,6 +38,7 @@
 
 generate_mojom_bindings("media_perception_mojo_bindings") {
   sources = [
+    "mojom/buffer_types.mojom",
     "mojom/color_space.mojom",
     "mojom/common.mojom",
     "mojom/constants.mojom",
@@ -62,6 +63,7 @@
     "mojom/shared_memory.mojom",
     "mojom/sync_token.mojom",
     "mojom/time.mojom",
+    "mojom/unguessable_token.mojom",
     "mojom/values.mojom",
     "mojom/video_capture_types.mojom",
     "mojom/video_source.mojom",
diff --git a/media_perception/mojom/buffer_types.mojom b/media_perception/mojom/buffer_types.mojom
new file mode 100644
index 0000000..d6229fc
--- /dev/null
+++ b/media_perception/mojom/buffer_types.mojom
@@ -0,0 +1,110 @@
+// Copyright 2016 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.
+
+module gfx.mojom;
+
+import "mojom/shared_memory.mojom";
+import "mojom/unguessable_token.mojom";
+
+// gfx::BufferFormat
+enum BufferFormat {
+  R_8,
+  R_16,
+  RG_88,
+  BGR_565,
+  RGBA_4444,
+  RGBX_8888,
+  RGBA_8888,
+  BGRX_8888,
+  BGRX_1010102,
+  RGBX_1010102,
+  BGRA_8888,
+  RGBA_F16,
+  YVU_420,
+  YUV_420_BIPLANAR,
+  UYVY_422,
+  P010,
+};
+
+// gfx::BufferUsage
+enum BufferUsage {
+  GPU_READ,
+  SCANOUT,
+  SCANOUT_CAMERA_READ_WRITE,
+  CAMERA_AND_CPU_READ_WRITE,
+  SCANOUT_CPU_READ_WRITE,
+  SCANOUT_VDA_WRITE,
+  GPU_READ_CPU_READ_WRITE,
+};
+
+struct BufferUsageAndFormat {
+  BufferUsage usage;
+  BufferFormat format;
+};
+
+// gfx::GpuMemoryBufferId
+struct GpuMemoryBufferId {
+  int32 id;
+};
+
+// gfx::NativePixmapPlane
+[EnableIf=supports_native_pixmap]
+struct NativePixmapPlane {
+  uint32 stride;
+  uint64 offset;
+  uint64 size;
+
+  // A platform-specific handle the underlying memory object.
+  handle buffer_handle;
+};
+
+// gfx::NativePixmapHandle
+[EnableIf=supports_native_pixmap]
+struct NativePixmapHandle {
+  array<NativePixmapPlane> planes;
+  uint64 modifier;
+
+  [EnableIf=is_fuchsia]
+  mojo_base.mojom.UnguessableToken? buffer_collection_id;
+  [EnableIf=is_fuchsia]
+  uint32 buffer_index;
+};
+
+[EnableIf=is_android]
+struct AHardwareBufferHandle {
+  // The actual file descriptor used to wrap the AHardwareBuffer object for
+  // serialization.
+  handle buffer_handle;
+
+  // A message pipe handle which tracks the lifetime of this
+  // AHardwareBufferHandle. The sender may use this to observe the lifetime
+  // remotely by watching the other end of this pipe. Useful for retaining a
+  // sender-side AHB ref until the receiver deserializes the AHB and acquires its
+  // own ref.
+  handle<message_pipe> tracking_pipe;
+};
+
+union GpuMemoryBufferPlatformHandle {
+  mojo_base.mojom.UnsafeSharedMemoryRegion shared_memory_handle;
+
+  [EnableIf=supports_native_pixmap]
+  NativePixmapHandle native_pixmap_handle;
+
+  [EnableIf=is_mac]
+  handle mach_port;
+
+  [EnableIf=is_win]
+  handle dxgi_handle;
+
+  [EnableIf=is_android]
+  AHardwareBufferHandle android_hardware_buffer_handle;
+};
+
+// gfx::GpuMemoryBufferHandle
+struct GpuMemoryBufferHandle {
+  GpuMemoryBufferId id;
+  uint32 offset;
+  uint32 stride;
+  GpuMemoryBufferPlatformHandle? platform_handle;
+};
diff --git a/media_perception/mojom/constants.mojom b/media_perception/mojom/constants.mojom
index ee5cd3e..d13930e 100644
--- a/media_perception/mojom/constants.mojom
+++ b/media_perception/mojom/constants.mojom
@@ -4,5 +4,4 @@
 
 module video_capture.mojom;
 
-const string kServiceName = "video_capture";
 const int32 kInvalidBufferId = -1;
diff --git a/media_perception/mojom/geometry.mojom b/media_perception/mojom/geometry.mojom
index 4eec21d..78d28f0 100644
--- a/media_perception/mojom/geometry.mojom
+++ b/media_perception/mojom/geometry.mojom
@@ -85,3 +85,10 @@
   float x;
   float y;
 };
+
+struct Quaternion {
+  double x;
+  double y;
+  double z;
+  double w;
+};
diff --git a/media_perception/mojom/unguessable_token.mojom b/media_perception/mojom/unguessable_token.mojom
new file mode 100644
index 0000000..42aa7e2
--- /dev/null
+++ b/media_perception/mojom/unguessable_token.mojom
@@ -0,0 +1,11 @@
+// Copyright 2016 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.
+
+module mojo_base.mojom;
+
+// Corresponds to |base::UnguessableToken| in base/unguessable_token.h
+struct UnguessableToken {
+  uint64 high;
+  uint64 low;
+};
diff --git a/media_perception/mojom/video_capture_types.mojom b/media_perception/mojom/video_capture_types.mojom
index 78b0d4f..c8651e5 100644
--- a/media_perception/mojom/video_capture_types.mojom
+++ b/media_perception/mojom/video_capture_types.mojom
@@ -9,6 +9,7 @@
 import "mojom/time.mojom";
 import "mojom/values.mojom";
 import "mojom/geometry.mojom";
+import "mojom/buffer_types.mojom";
 import "mojom/color_space.mojom";
 
 enum VideoCapturePixelFormat {
@@ -25,7 +26,6 @@
   ARGB,
   XRGB,
   RGB24,
-  RGB32,
   MJPEG,
   MT21,
   YUV420P9,
@@ -91,7 +91,9 @@
   // TODO(chfremer): Remove this when https://crbug.com/857537 is resolved.
   kSharedMemoryViaRawFileDescriptor,
 
-  kMailboxHolder
+  kMailboxHolder,
+
+  kGpuMemoryBuffer
 };
 
 enum VideoCaptureError {
@@ -310,4 +312,5 @@
   mojo_base.mojom.ReadOnlySharedMemoryRegion read_only_shmem_region;
   SharedMemoryViaRawFileDescriptor shared_memory_via_raw_file_descriptor;
   MailboxBufferHandleSet mailbox_handles;
+  gfx.mojom.GpuMemoryBufferHandle gpu_memory_buffer_handle;
 };