Commit 12eaf9c9 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

Refactor GPUArcVDA based on new VDA-like IPC design

Implement GPUArcVDA working with new VDA-like IPC. GpuArcVDA currently
translates mojo IPC to VDA API, and therefore ChromeArcVDA is deleted.
ChromeArcVDA and GpuArcVDA based on old IPC still exist as deprecated classes
for compatibility, so that the old IPC can be used.

TEST=CTS MediaTest on veyron_minnie and eve
TEST=CTS MediaTest with --mus=viz on veyron_minnie and eve
TEST=Secure Playback test using ExoPlayer
BUG=chromium:745457
CQ-DEPEND=CL:609564

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I9d90a6945c81e20572616c04c1d4f496e2bb3f87
Reviewed-on: https://chromium-review.googlesource.com/648538
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: default avatarPawel Osciak <posciak@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523311}
parent a92d5af6
......@@ -7,6 +7,8 @@
"arc::mojom::ProtectedBufferManager",
"arc::mojom::VideoDecodeAcceleratorDeprecated",
"arc::mojom::VideoDecodeClientDeprecated",
"arc::mojom::VideoDecodeAccelerator",
"arc::mojom::VideoDecodeClient",
"arc::mojom::VideoEncodeAccelerator",
"arc::mojom::VideoEncodeClient",
"chrome::mojom::ResourceUsageReporter",
......
......@@ -14,6 +14,7 @@
#include "chrome/browser/chromeos/ash_config.h"
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_browser_context_keyed_service_factory_base.h"
#include "components/arc/common/video_decode_accelerator.mojom.h"
#include "components/arc/common/video_decode_accelerator_deprecated.mojom.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/gpu_service_registry.h"
......@@ -64,6 +65,15 @@ class VideoAcceleratorFactoryService : public mojom::VideoAcceleratorFactory {
std::move(request)));
}
void CreateDecodeAccelerator(
mojom::VideoDecodeAcceleratorRequest request) override {
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::BindOnce(
&content::BindInterfaceInGpuProcess<mojom::VideoDecodeAccelerator>,
std::move(request)));
}
void CreateEncodeAccelerator(
mojom::VideoEncodeAcceleratorRequest request) override {
content::BrowserThread::PostTask(
......@@ -98,6 +108,12 @@ class VideoAcceleratorFactoryServiceMus
arc_->CreateVideoDecodeAcceleratorDeprecated(std::move(request));
}
void CreateDecodeAccelerator(
mojom::VideoDecodeAcceleratorRequest request) override {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
arc_->CreateVideoDecodeAccelerator(std::move(request));
}
void CreateEncodeAccelerator(
mojom::VideoEncodeAcceleratorRequest request) override {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
......
......@@ -19,6 +19,7 @@
#include "services/service_manager/public/cpp/connector.h"
#if defined(OS_CHROMEOS)
#include "components/arc/video_accelerator/gpu_arc_video_decode_accelerator.h"
#include "components/arc/video_accelerator/gpu_arc_video_decode_accelerator_deprecated.h"
#include "components/arc/video_accelerator/gpu_arc_video_encode_accelerator.h"
#include "components/arc/video_accelerator/protected_buffer_manager.h"
......@@ -65,6 +66,10 @@ void ChromeContentGpuClient::InitializeRegistry(
&ChromeContentGpuClient::CreateArcVideoDecodeAcceleratorDeprecated,
base::Unretained(this)),
base::ThreadTaskRunnerHandle::Get());
registry->AddInterface(
base::Bind(&ChromeContentGpuClient::CreateArcVideoDecodeAccelerator,
base::Unretained(this)),
base::ThreadTaskRunnerHandle::Get());
registry->AddInterface(
base::Bind(&ChromeContentGpuClient::CreateArcVideoEncodeAccelerator,
base::Unretained(this)),
......@@ -103,6 +108,14 @@ void ChromeContentGpuClient::CreateArcVideoDecodeAcceleratorDeprecated(
std::move(request));
}
void ChromeContentGpuClient::CreateArcVideoDecodeAccelerator(
::arc::mojom::VideoDecodeAcceleratorRequest request) {
mojo::MakeStrongBinding(
base::MakeUnique<arc::GpuArcVideoDecodeAccelerator>(
gpu_preferences_, protected_buffer_manager_.get()),
std::move(request));
}
void ChromeContentGpuClient::CreateArcVideoEncodeAccelerator(
::arc::mojom::VideoEncodeAcceleratorRequest request) {
mojo::MakeStrongBinding(
......
......@@ -13,6 +13,7 @@
#if defined(OS_CHROMEOS)
#include "components/arc/common/protected_buffer_manager.mojom.h"
#include "components/arc/common/video_decode_accelerator.mojom.h"
#include "components/arc/common/video_decode_accelerator_deprecated.mojom.h"
#include "components/arc/common/video_encode_accelerator.mojom.h"
#include "gpu/command_buffer/service/gpu_preferences.h"
......@@ -37,6 +38,9 @@ class ChromeContentGpuClient : public content::ContentGpuClient {
void CreateArcVideoDecodeAcceleratorDeprecated(
::arc::mojom::VideoDecodeAcceleratorDeprecatedRequest request);
void CreateArcVideoDecodeAccelerator(
::arc::mojom::VideoDecodeAcceleratorRequest request);
void CreateArcVideoEncodeAccelerator(
::arc::mojom::VideoEncodeAcceleratorRequest request);
......
......@@ -10,6 +10,8 @@ include_rules = [
"+components/session_manager/core",
"+components/signin/core/account_id",
"+components/user_manager",
"+media/base/video_codecs.h",
"+media/video/video_encode_accelerator.h",
"+mojo",
"+storage/browser/fileapi",
"+third_party/re2",
......@@ -27,5 +29,5 @@ specific_include_rules = {
],
".*_unittest.cc": [
"+content/public/test/test_browser_thread_bundle.h"
]
],
}
......@@ -4,6 +4,10 @@
import("//mojo/public/tools/bindings/mojom.gni")
# This needs to be conditionally-compiled since the typemaps are
# unconditionally-included from //mojo/public/tools/bindings/mojom.gni. The
# inclusion is done through read_file(), which does not respect the global
# defines for GN, so it itself cannot use the "is_chromeos" variable.
if (is_chromeos) {
mojom("common") {
sources = [
......@@ -22,7 +26,6 @@ if (is_chromeos) {
"crash_collector.mojom",
"enterprise_reporting.mojom",
"file_system.mojom",
"gfx.mojom",
"ime.mojom",
"intent_helper.mojom",
"kiosk.mojom",
......@@ -62,9 +65,11 @@ if (is_chromeos) {
# pulling in unnecessary interfaces,
mojom("media") {
sources = [
"gfx.mojom",
"protected_buffer_manager.mojom",
"video.mojom",
"video_common.mojom",
"video_decode_accelerator.mojom",
"video_decode_accelerator_deprecated.mojom",
"video_encode_accelerator.mojom",
]
......
include_rules = [
"+media/video/video_encode_accelerator.h",
]
......@@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Next MinVersion: 6
// Next MinVersion: 7
module arc.mojom;
import "video_decode_accelerator.mojom";
import "video_decode_accelerator_deprecated.mojom";
import "video_encode_accelerator.mojom";
......@@ -29,10 +30,13 @@ interface VideoInstance {
[MinVersion=5] Init@1(VideoHost host_ptr) => ();
};
// Next method ID: 2
// Next method ID: 3
interface VideoAcceleratorFactory {
CreateDecodeAcceleratorDeprecated@0(VideoDecodeAcceleratorDeprecated& video_decoder);
[MinVersion=1]
CreateEncodeAccelerator@1(VideoEncodeAccelerator& encoder);
CreateEncodeAccelerator@1(VideoEncodeAccelerator& video_encoder);
[MinVersion=6]
CreateDecodeAccelerator@2(VideoDecodeAccelerator& video_decoder);
};
......@@ -6,6 +6,105 @@
namespace mojo {
// Make sure values in arc::mojom::VideoCodecProfile match to the values in
// media::VideoCodecProfile.
#define CHECK_PROFILE_ENUM(value) \
static_assert( \
static_cast<int>(arc::mojom::VideoCodecProfile::value) == media::value, \
"enum ##value mismatch")
CHECK_PROFILE_ENUM(VIDEO_CODEC_PROFILE_UNKNOWN);
CHECK_PROFILE_ENUM(VIDEO_CODEC_PROFILE_MIN);
CHECK_PROFILE_ENUM(H264PROFILE_MIN);
CHECK_PROFILE_ENUM(H264PROFILE_BASELINE);
CHECK_PROFILE_ENUM(H264PROFILE_MAIN);
CHECK_PROFILE_ENUM(H264PROFILE_EXTENDED);
CHECK_PROFILE_ENUM(H264PROFILE_HIGH);
CHECK_PROFILE_ENUM(H264PROFILE_HIGH10PROFILE);
CHECK_PROFILE_ENUM(H264PROFILE_HIGH422PROFILE);
CHECK_PROFILE_ENUM(H264PROFILE_HIGH444PREDICTIVEPROFILE);
CHECK_PROFILE_ENUM(H264PROFILE_SCALABLEBASELINE);
CHECK_PROFILE_ENUM(H264PROFILE_SCALABLEHIGH);
CHECK_PROFILE_ENUM(H264PROFILE_STEREOHIGH);
CHECK_PROFILE_ENUM(H264PROFILE_MULTIVIEWHIGH);
CHECK_PROFILE_ENUM(H264PROFILE_MAX);
CHECK_PROFILE_ENUM(VP8PROFILE_MIN);
CHECK_PROFILE_ENUM(VP8PROFILE_ANY);
CHECK_PROFILE_ENUM(VP8PROFILE_MAX);
CHECK_PROFILE_ENUM(VP9PROFILE_MIN);
CHECK_PROFILE_ENUM(VP9PROFILE_PROFILE0);
CHECK_PROFILE_ENUM(VP9PROFILE_PROFILE1);
CHECK_PROFILE_ENUM(VP9PROFILE_PROFILE2);
CHECK_PROFILE_ENUM(VP9PROFILE_PROFILE3);
CHECK_PROFILE_ENUM(VP9PROFILE_MAX);
CHECK_PROFILE_ENUM(HEVCPROFILE_MIN);
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(THEORAPROFILE_MIN);
CHECK_PROFILE_ENUM(THEORAPROFILE_ANY);
CHECK_PROFILE_ENUM(THEORAPROFILE_MAX);
CHECK_PROFILE_ENUM(AV1PROFILE_MIN);
CHECK_PROFILE_ENUM(AV1PROFILE_PROFILE0);
CHECK_PROFILE_ENUM(AV1PROFILE_MAX);
CHECK_PROFILE_ENUM(VIDEO_CODEC_PROFILE_MAX);
#undef CHECK_PROFILE_ENUM
// static
arc::mojom::VideoCodecProfile
EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile>::ToMojom(
media::VideoCodecProfile input) {
return static_cast<arc::mojom::VideoCodecProfile>(input);
}
// static
bool EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile>::
FromMojom(arc::mojom::VideoCodecProfile input,
media::VideoCodecProfile* output) {
switch (input) {
case arc::mojom::VideoCodecProfile::VIDEO_CODEC_PROFILE_UNKNOWN:
case arc::mojom::VideoCodecProfile::H264PROFILE_BASELINE:
case arc::mojom::VideoCodecProfile::H264PROFILE_MAIN:
case arc::mojom::VideoCodecProfile::H264PROFILE_EXTENDED:
case arc::mojom::VideoCodecProfile::H264PROFILE_HIGH:
case arc::mojom::VideoCodecProfile::H264PROFILE_HIGH10PROFILE:
case arc::mojom::VideoCodecProfile::H264PROFILE_HIGH422PROFILE:
case arc::mojom::VideoCodecProfile::H264PROFILE_HIGH444PREDICTIVEPROFILE:
case arc::mojom::VideoCodecProfile::H264PROFILE_SCALABLEBASELINE:
case arc::mojom::VideoCodecProfile::H264PROFILE_SCALABLEHIGH:
case arc::mojom::VideoCodecProfile::H264PROFILE_STEREOHIGH:
case arc::mojom::VideoCodecProfile::H264PROFILE_MULTIVIEWHIGH:
case arc::mojom::VideoCodecProfile::VP8PROFILE_ANY:
case arc::mojom::VideoCodecProfile::VP9PROFILE_PROFILE0:
case arc::mojom::VideoCodecProfile::VP9PROFILE_PROFILE1:
case arc::mojom::VideoCodecProfile::VP9PROFILE_PROFILE2:
case arc::mojom::VideoCodecProfile::VP9PROFILE_PROFILE3:
case arc::mojom::VideoCodecProfile::HEVCPROFILE_MAIN:
case arc::mojom::VideoCodecProfile::HEVCPROFILE_MAIN10:
case arc::mojom::VideoCodecProfile::HEVCPROFILE_MAIN_STILL_PICTURE:
case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE0:
case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE4:
case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE5:
case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE7:
case arc::mojom::VideoCodecProfile::THEORAPROFILE_ANY:
case arc::mojom::VideoCodecProfile::AV1PROFILE_PROFILE0:
*output = static_cast<media::VideoCodecProfile>(input);
return true;
}
VLOG(1) << "unknown profile: "
<< media::GetProfileName(
static_cast<media::VideoCodecProfile>(input));
return false;
}
// static
bool StructTraits<arc::mojom::VideoFramePlaneDataView, arc::VideoFramePlane>::
Read(arc::mojom::VideoFramePlaneDataView data, arc::VideoFramePlane* out) {
......
......@@ -7,10 +7,19 @@
#include "components/arc/common/video_decode_accelerator_deprecated.mojom.h"
#include "components/arc/video_accelerator/video_frame_plane.h"
#include "media/base/video_codecs.h"
#include "ui/gfx/geometry/size.h"
namespace mojo {
template <>
struct EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile> {
static arc::mojom::VideoCodecProfile ToMojom(media::VideoCodecProfile input);
static bool FromMojom(arc::mojom::VideoCodecProfile input,
media::VideoCodecProfile* output);
};
template <>
struct StructTraits<arc::mojom::VideoFramePlaneDataView, arc::VideoFramePlane> {
static int32_t offset(const arc::VideoFramePlane& r) {
......
......@@ -7,6 +7,65 @@
module arc.mojom;
[Extensible]
enum VideoCodecProfile {
// The values must match to the values in media::VideoCodecProfile.
VIDEO_CODEC_PROFILE_UNKNOWN = -1,
VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
H264PROFILE_MIN = 0,
// Including profile Constrained Baseline (CBP).
H264PROFILE_BASELINE = H264PROFILE_MIN,
H264PROFILE_MAIN = 1,
H264PROFILE_EXTENDED = 2,
H264PROFILE_HIGH = 3,
H264PROFILE_HIGH10PROFILE = 4,
H264PROFILE_HIGH422PROFILE = 5,
H264PROFILE_HIGH444PREDICTIVEPROFILE = 6,
H264PROFILE_SCALABLEBASELINE = 7,
H264PROFILE_SCALABLEHIGH = 8,
H264PROFILE_STEREOHIGH = 9,
H264PROFILE_MULTIVIEWHIGH = 10,
H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH,
VP8PROFILE_MIN = 11,
VP8PROFILE_ANY = VP8PROFILE_MIN,
VP8PROFILE_MAX = VP8PROFILE_ANY,
VP9PROFILE_MIN = 12,
VP9PROFILE_PROFILE0 = VP9PROFILE_MIN,
VP9PROFILE_PROFILE1 = 13,
VP9PROFILE_PROFILE2 = 14,
VP9PROFILE_PROFILE3 = 15,
VP9PROFILE_MAX = VP9PROFILE_PROFILE3,
HEVCPROFILE_MIN = 16,
HEVCPROFILE_MAIN = HEVCPROFILE_MIN,
HEVCPROFILE_MAIN10 = 17,
HEVCPROFILE_MAIN_STILL_PICTURE = 18,
HEVCPROFILE_MAX = HEVCPROFILE_MAIN_STILL_PICTURE,
DOLBYVISION_MIN = 19,
DOLBYVISION_PROFILE0 = DOLBYVISION_MIN,
DOLBYVISION_PROFILE4 = 20,
DOLBYVISION_PROFILE5 = 21,
DOLBYVISION_PROFILE7 = 22,
DOLBYVISION_MAX = DOLBYVISION_PROFILE7,
THEORAPROFILE_MIN = 23,
THEORAPROFILE_ANY = THEORAPROFILE_MIN,
THEORAPROFILE_MAX = THEORAPROFILE_ANY,
// TODO(dalecurtis): AV1 profiles are not finalized, this needs updating
// before enabling for release. http://crbug.com/784993
AV1PROFILE_MIN = 24,
AV1PROFILE_PROFILE0 = AV1PROFILE_MIN,
AV1PROFILE_MAX = AV1PROFILE_PROFILE0,
VIDEO_CODEC_PROFILE_MAX = AV1PROFILE_PROFILE0,
};
[Extensible]
enum HalPixelFormat {
// The pixel formats defined in Android but are used here. They are defined
// in "system/core/include/system/graphics.h"
HAL_PIXEL_FORMAT_BGRA_8888 = 5,
HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23,
};
// The offset and stride of a video frame plane. Both offset and stride must
// be non negative.
struct VideoFramePlane {
......
......@@ -4,9 +4,13 @@
mojom = "//components/arc/common/video_common.mojom"
public_headers = [
"//media/base/video_codecs.h",
"//components/arc/video_accelerator/video_frame_plane.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",
......@@ -15,6 +19,7 @@ deps = [
"//ui/gfx/geometry",
]
type_mappings = [
"arc.mojom.VideoCodecProfile=media::VideoCodecProfile",
"arc.mojom.VideoFramePlane=arc::VideoFramePlane[move_only]",
"arc.mojom.Size=gfx::Size",
]
// Copyright 2017 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.
// This file defines the mojo interface between Android and Chromium for video
// decoding. Any Mojo callee that returns a value does so by callback.
// However, the caller may receive it by out-param (for sync calls) or
// via callback (for async calls).
// However, we only use callbacks to Reset, Flush and Initialize
// in the present design and don't use for other functions.
// This is mainly because other VDAClient functions and VDA functions are not
// correlated.
// Please don't use this design as a good reference, it is strongly recommended
// in mojom that all the function results are reported by passed callbacks.
module arc.mojom;
import "gfx.mojom";
import "video_common.mojom";
// Information of the bitstream buffer.
struct BitstreamBuffer {
int32 bitstream_id;
// This handle is passed and used in Decode().
// The handle fd is ashmem.
handle handle_fd;
uint32 offset;
uint32 bytes_used;
};
struct Picture {
int32 picture_buffer_id;
int32 bitstream_id;
// the crop rectangle with the picture buffer to be displayed.
Rect crop_rect;
};
// Format specification of the picture buffer request.
struct PictureBufferFormat {
HalPixelFormat pixel_format;
uint32 buffer_size;
// minimal number of buffers required to process the video.
uint32 min_num_buffers;
uint32 coded_width;
uint32 coded_height;
};
struct VideoDecodeAcceleratorConfig {
VideoCodecProfile profile;
bool secure_mode;
};
// Next MinVersion: 1
// Next method ID: 8
interface VideoDecodeAccelerator {
[Extensible]
enum Result {
SUCCESS = 0,
ILLEGAL_STATE = 1,
INVALID_ARGUMENT = 2,
UNREADABLE_INPUT = 3,
PLATFORM_FAILURE = 4,
INSUFFICIENT_RESOURCES = 5,
CANCELLED = 6,
RESULT_MAX = 7,
};
// Initializes video decoder accelerator with specific video codec profile.
// The caller needs to wait for the initialization result (returned by
// callback) before calling any other methods.
Initialize@0(VideoDecodeAcceleratorConfig config,
VideoDecodeClient client) => (Result result);
// Allocate protected input buffer with |handle_fd| and aligned |size|.
// This function can be called only in secure mode.
// If this is succeeded, this returns true. Otherwise, returns false.
AllocateProtectedBuffer@7(handle handle_fd,
uint64 size) => (bool success);
// Decodes the content in the shared memory of the bitstream buffer. The
// callee needs to map the the shared memory to read the content and is
// responsible to release the shared memory by closing the file descriptor.
Decode@1(BitstreamBuffer bitstream_buffer);
// Sets the number of output picture buffers.
AssignPictureBuffers@2(uint32 count);
// Assigns a buffer to be used by the accelerator with specified
// |picture_buffer_id|.
// In secure mode, if a new protected output buffer is allocated for the given
// |picture_buffer_id|. Any previously-allocated buffer with the same
// |picture_buffer_id| will be released.
// Call VDA::ImportBufferForPicture with gfx::GpuMemoryBufferHandle
// created from |handle_fd| and |planes|.
// This should be preceded by a call to AssignPictureBuffers().
ImportBufferForPicture@3(int32 picture_buffer_id, handle handle_fd,
array<VideoFramePlane> planes);
// Returns picture buffer with specified |picture_buffer_id| to be reused by
// the accelerator.
ReusePictureBuffer@4(int32 picture_buffer_id);
// Resets the accelerator, without decoding any pending buffers.
// When it is done, the callback will be invoked.
Reset@5() => (Result result);
// Flushes the accelerator. After all the output buffers pending decode have
// been returned to client, the callback will be invoked.
// Flush() can be cancelled by a succeeding Reset(). In that case, the
// callback is called with Result::CANCELLED.
Flush@6() => (Result result);
};
// Next MinVersion: 1
// Next method ID: 4
interface VideoDecodeClient {
// Callback to tell client how many and what size of buffers to provide.
ProvidePictureBuffers@0(PictureBufferFormat format);
// Called to notify the client that |picture| is ready to be displayed.
// The calls to PictureReady() are in display order and Picture should
// be displayed in that order.
PictureReady@1(Picture picture);
// Called to notify that decoder has decoded the end of the BitstreamBuffer
// with specified |bitstream_id|.
NotifyEndOfBitstreamBuffer@2(int32 bitstream_id);
// Called when an asynchronous error happens, for example, illegal state,
// error while decoding the stream, or a platform/system error.
// The errors in Initialize(), Reset() and Flush(), will not be reported here,
// but will be returned in its callback function.
NotifyError@3(VideoDecodeAccelerator.Result error);
};
......@@ -16,55 +16,6 @@ enum VideoPixelFormat {
PIXEL_FORMAT_I420 = 1,
};
[Extensible]
enum VideoCodecProfile {
// The values must match to the values in media::VideoCodecProfile.
VIDEO_CODEC_PROFILE_UNKNOWN = -1,
VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
H264PROFILE_MIN = 0,
// Including profile Constrained Baseline (CBP).
H264PROFILE_BASELINE = H264PROFILE_MIN,
H264PROFILE_MAIN = 1,
H264PROFILE_EXTENDED = 2,
H264PROFILE_HIGH = 3,
H264PROFILE_HIGH10PROFILE = 4,
H264PROFILE_HIGH422PROFILE = 5,
H264PROFILE_HIGH444PREDICTIVEPROFILE = 6,
H264PROFILE_SCALABLEBASELINE = 7,
H264PROFILE_SCALABLEHIGH = 8,
H264PROFILE_STEREOHIGH = 9,
H264PROFILE_MULTIVIEWHIGH = 10,
H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH,
VP8PROFILE_MIN = 11,
VP8PROFILE_ANY = VP8PROFILE_MIN,
VP8PROFILE_MAX = VP8PROFILE_ANY,
VP9PROFILE_MIN = 12,
VP9PROFILE_PROFILE0 = VP9PROFILE_MIN,
VP9PROFILE_PROFILE1 = 13,
VP9PROFILE_PROFILE2 = 14,
VP9PROFILE_PROFILE3 = 15,
VP9PROFILE_MAX = VP9PROFILE_PROFILE3,
HEVCPROFILE_MIN = 16,
HEVCPROFILE_MAIN = HEVCPROFILE_MIN,
HEVCPROFILE_MAIN10 = 17,
HEVCPROFILE_MAIN_STILL_PICTURE = 18,
HEVCPROFILE_MAX = HEVCPROFILE_MAIN_STILL_PICTURE,
DOLBYVISION_MIN = 19,
DOLBYVISION_PROFILE0 = DOLBYVISION_MIN,
DOLBYVISION_PROFILE4 = 20,
DOLBYVISION_PROFILE5 = 21,
DOLBYVISION_PROFILE7 = 22,
DOLBYVISION_MAX = DOLBYVISION_PROFILE7,
THEORAPROFILE_MIN = 23,
THEORAPROFILE_ANY = THEORAPROFILE_MIN,
THEORAPROFILE_MAX = THEORAPROFILE_ANY,
AV1PROFILE_MIN = 24,
AV1PROFILE_PROFILE0 = AV1PROFILE_MIN,
AV1PROFILE_MAX = AV1PROFILE_PROFILE0,
VIDEO_CODEC_PROFILE_MAX = AV1PROFILE_PROFILE0,
};
// Specification of an encoding profile supported by an encoder.
struct VideoEncodeProfile {
VideoCodecProfile profile;
......
......@@ -15,6 +15,5 @@ sources = [
type_mappings = [
"arc.mojom.VideoEncodeAccelerator.Error=media::VideoEncodeAccelerator::Error",
"arc.mojom.VideoPixelFormat=media::VideoPixelFormat",
"arc.mojom.VideoCodecProfile=media::VideoCodecProfile",
"arc.mojom.VideoEncodeProfile=media::VideoEncodeAccelerator::SupportedProfile",
]
......@@ -71,99 +71,4 @@ bool EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat>::
}
}
// Make sure values in arc::mojom::VideoCodecProfile match to the values in
// media::VideoCodecProfile.
#define CHECK_PROFILE_ENUM(value) \
static_assert( \
static_cast<int>(arc::mojom::VideoCodecProfile::value) == media::value, \
"enum ##value mismatch")
CHECK_PROFILE_ENUM(VIDEO_CODEC_PROFILE_UNKNOWN);
CHECK_PROFILE_ENUM(VIDEO_CODEC_PROFILE_MIN);
CHECK_PROFILE_ENUM(H264PROFILE_MIN);
CHECK_PROFILE_ENUM(H264PROFILE_BASELINE);
CHECK_PROFILE_ENUM(H264PROFILE_MAIN);
CHECK_PROFILE_ENUM(H264PROFILE_EXTENDED);
CHECK_PROFILE_ENUM(H264PROFILE_HIGH);
CHECK_PROFILE_ENUM(H264PROFILE_HIGH10PROFILE);
CHECK_PROFILE_ENUM(H264PROFILE_HIGH422PROFILE);
CHECK_PROFILE_ENUM(H264PROFILE_HIGH444PREDICTIVEPROFILE);
CHECK_PROFILE_ENUM(H264PROFILE_SCALABLEBASELINE);
CHECK_PROFILE_ENUM(H264PROFILE_SCALABLEHIGH);
CHECK_PROFILE_ENUM(H264PROFILE_STEREOHIGH);
CHECK_PROFILE_ENUM(H264PROFILE_MULTIVIEWHIGH);
CHECK_PROFILE_ENUM(H264PROFILE_MAX);
CHECK_PROFILE_ENUM(VP8PROFILE_MIN);
CHECK_PROFILE_ENUM(VP8PROFILE_ANY);
CHECK_PROFILE_ENUM(VP8PROFILE_MAX);
CHECK_PROFILE_ENUM(VP9PROFILE_MIN);
CHECK_PROFILE_ENUM(VP9PROFILE_PROFILE0);
CHECK_PROFILE_ENUM(VP9PROFILE_PROFILE1);
CHECK_PROFILE_ENUM(VP9PROFILE_PROFILE2);
CHECK_PROFILE_ENUM(VP9PROFILE_PROFILE3);
CHECK_PROFILE_ENUM(VP9PROFILE_MAX);
CHECK_PROFILE_ENUM(HEVCPROFILE_MIN);
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(THEORAPROFILE_MIN);
CHECK_PROFILE_ENUM(THEORAPROFILE_ANY);
CHECK_PROFILE_ENUM(THEORAPROFILE_MAX);
CHECK_PROFILE_ENUM(AV1PROFILE_PROFILE0);
CHECK_PROFILE_ENUM(VIDEO_CODEC_PROFILE_MAX);
#undef CHECK_PROFILE_ENUM
// static
arc::mojom::VideoCodecProfile
EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile>::ToMojom(
media::VideoCodecProfile input) {
return static_cast<arc::mojom::VideoCodecProfile>(input);
}
// static
bool EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile>::
FromMojom(arc::mojom::VideoCodecProfile input,
media::VideoCodecProfile* output) {
switch (input) {
case arc::mojom::VideoCodecProfile::VIDEO_CODEC_PROFILE_UNKNOWN:
case arc::mojom::VideoCodecProfile::H264PROFILE_BASELINE:
case arc::mojom::VideoCodecProfile::H264PROFILE_MAIN:
case arc::mojom::VideoCodecProfile::H264PROFILE_EXTENDED:
case arc::mojom::VideoCodecProfile::H264PROFILE_HIGH:
case arc::mojom::VideoCodecProfile::H264PROFILE_HIGH10PROFILE:
case arc::mojom::VideoCodecProfile::H264PROFILE_HIGH422PROFILE:
case arc::mojom::VideoCodecProfile::H264PROFILE_HIGH444PREDICTIVEPROFILE:
case arc::mojom::VideoCodecProfile::H264PROFILE_SCALABLEBASELINE:
case arc::mojom::VideoCodecProfile::H264PROFILE_SCALABLEHIGH:
case arc::mojom::VideoCodecProfile::H264PROFILE_STEREOHIGH:
case arc::mojom::VideoCodecProfile::H264PROFILE_MULTIVIEWHIGH:
case arc::mojom::VideoCodecProfile::VP8PROFILE_ANY:
case arc::mojom::VideoCodecProfile::VP9PROFILE_PROFILE0:
case arc::mojom::VideoCodecProfile::VP9PROFILE_PROFILE1:
case arc::mojom::VideoCodecProfile::VP9PROFILE_PROFILE2:
case arc::mojom::VideoCodecProfile::VP9PROFILE_PROFILE3:
case arc::mojom::VideoCodecProfile::HEVCPROFILE_MAIN:
case arc::mojom::VideoCodecProfile::HEVCPROFILE_MAIN10:
case arc::mojom::VideoCodecProfile::HEVCPROFILE_MAIN_STILL_PICTURE:
case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE0:
case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE4:
case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE5:
case arc::mojom::VideoCodecProfile::DOLBYVISION_PROFILE7:
case arc::mojom::VideoCodecProfile::THEORAPROFILE_ANY:
case arc::mojom::VideoCodecProfile::AV1PROFILE_PROFILE0:
*output = static_cast<media::VideoCodecProfile>(input);
return true;
}
DLOG(ERROR) << "unknown profile: " << input;
return false;
}
} // namespace mojo
......@@ -28,14 +28,6 @@ struct EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat> {
media::VideoPixelFormat* output);
};
template <>
struct EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile> {
static arc::mojom::VideoCodecProfile ToMojom(media::VideoCodecProfile input);
static bool FromMojom(arc::mojom::VideoCodecProfile input,
media::VideoCodecProfile* output);
};
template <>
struct StructTraits<arc::mojom::VideoEncodeProfileDataView,
media::VideoEncodeAccelerator::SupportedProfile> {
......
......@@ -7,6 +7,8 @@ static_library("video_accelerator") {
"arc_video_decode_accelerator_deprecated.h",
"chrome_arc_video_decode_accelerator_deprecated.cc",
"chrome_arc_video_decode_accelerator_deprecated.h",
"gpu_arc_video_decode_accelerator.cc",
"gpu_arc_video_decode_accelerator.h",
"gpu_arc_video_decode_accelerator_deprecated.cc",
"gpu_arc_video_decode_accelerator_deprecated.h",
"gpu_arc_video_encode_accelerator.cc",
......@@ -19,7 +21,7 @@ static_library("video_accelerator") {
deps = [
"//components/arc/common:media",
"//media/gpu",
"//media",
"//ui/ozone",
]
}
// Copyright 2017 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.
#ifndef COMPONENTS_ARC_VIDEO_ACCELERATOR_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_
#define COMPONENTS_ARC_VIDEO_ACCELERATOR_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_
#include <memory>
#include <queue>
#include <utility>
#include <vector>
#include "base/callback_forward.h"
#include "base/threading/thread_checker.h"
#include "components/arc/common/video_decode_accelerator.mojom.h"
#include "gpu/command_buffer/service/gpu_preferences.h"
#include "media/video/video_decode_accelerator.h"
namespace arc {
class ProtectedBufferManager;
class ProtectedBufferHandle;
// GpuArcVideoDecodeAccelerator is executed in the GPU process.
// It takes decoding requests from ARC via IPC channels and translates and
// sends those requests to an implementation of media::VideoDecodeAccelerator.
// It also calls ARC client functions in media::VideoDecodeAccelerator
// callbacks, e.g., PictureReady, which returns the decoded frames back to the
// ARC side. This class manages Reset and Flush requests and life-cycle of
// passed callback for them. They would be processed in FIFO order.
// For each creation request from GpuArcVideoDecodeAcceleratorHost,
// GpuArcVideoDecodeAccelerator will create a new IPC channel.
class GpuArcVideoDecodeAccelerator
: public mojom::VideoDecodeAccelerator,
public media::VideoDecodeAccelerator::Client {
public:
GpuArcVideoDecodeAccelerator(
const gpu::GpuPreferences& gpu_preferences,
ProtectedBufferManager* protected_buffer_manager);
~GpuArcVideoDecodeAccelerator() override;
// Implementation of media::VideoDecodeAccelerator::Client interface.
void ProvidePictureBuffers(uint32_t requested_num_of_buffers,
media::VideoPixelFormat format,
uint32_t textures_per_buffer,
const gfx::Size& dimensions,
uint32_t texture_target) override;
void PictureReady(const media::Picture& picture) override;
void DismissPictureBuffer(int32_t picture_buffer_id) override;
void NotifyEndOfBitstreamBuffer(int32_t bitstream_buffer_id) override;
void NotifyFlushDone() override;
void NotifyResetDone() override;
void NotifyError(media::VideoDecodeAccelerator::Error error) override;
// mojom::VideoDecodeAccelerator implementation.
void Initialize(mojom::VideoDecodeAcceleratorConfigPtr config,
mojom::VideoDecodeClientPtr client,
InitializeCallback callback) override;
void AllocateProtectedBuffer(
mojo::ScopedHandle handle,
uint64_t size,
AllocateProtectedBufferCallback callback) override;
void Decode(mojom::BitstreamBufferPtr bitstream_buffer) override;
void AssignPictureBuffers(uint32_t count) override;
void ImportBufferForPicture(int32_t picture_buffer_id,
mojo::ScopedHandle handle,
std::vector<VideoFramePlane> planes) override;
void ReusePictureBuffer(int32_t picture_buffer_id) override;
void Flush(FlushCallback callback) override;
void Reset(ResetCallback callback) override;
private:
using PendingCallback =
base::OnceCallback<void(mojom::VideoDecodeAccelerator::Result)>;
static_assert(std::is_same<ResetCallback, PendingCallback>::value,
"The type of PendingCallback must match ResetCallback");
static_assert(std::is_same<FlushCallback, PendingCallback>::value,
"The type of PendingCallback must match FlushCallback");
using PendingRequest =
base::OnceCallback<void(PendingCallback, media::VideoDecodeAccelerator*)>;
class ScopedBitstreamBuffer;
// Return true if |planes| is valid for |dmabuf_fd|.
bool VerifyDmabuf(int dmabuf_fd,
const std::vector<VideoFramePlane>& planes) const;
// Initialize GpuArcVDA and create VDA. It returns SUCCESS if they are
// successful. Otherwise, returns an error status.
mojom::VideoDecodeAccelerator::Result InitializeTask(
mojom::VideoDecodeAcceleratorConfigPtr config);
// Execute all pending requests until a VDA::Reset() request is encountered.
// When that happens, we need to explicitly wait for NotifyResetDone().
// before we continue executing subsequent requests.
void RunPendingRequests();
// When |pending_reset_callback_| isn't null, GAVDA is awaiting a preceding
// Reset() to be finished, and |request| is pended by queueing
// in |pending_requests_|. Otherwise, the requested VDA operation is executed.
// In the case of Flush request, the callback is queued to
// |pending_flush_callbacks_|. In the case of Reset request,
// the callback is set |pending_reset_callback_|.
void ExecuteRequest(std::pair<PendingRequest, PendingCallback> request);
// Requested VDA methods are executed in these functions.
void FlushRequest(PendingCallback cb, media::VideoDecodeAccelerator* vda);
void ResetRequest(PendingCallback cb, media::VideoDecodeAccelerator* vda);
void DecodeRequest(ScopedBitstreamBuffer bitstream_buffer,
PendingCallback cb,
media::VideoDecodeAccelerator* vda);
// Global counter that keeps track of the number of active clients (i.e., how
// many VDAs in use by this class).
// Since this class only works on the same thread, it's safe to access
// |client_count_| without lock.
static size_t client_count_;
// |error_state_| is true, if GAVDA gets an error from VDA.
// All the pending functions are cancelled and the callbacks are
// executed with an error state.
bool error_state_ = false;
// The variables for managing callbacks.
// VDA::Decode(), VDA::Flush() and VDA::Reset() should not be posted to VDA
// while the previous Reset() hasn't been finished yet (i.e. before
// NotifyResetDone() is invoked).
// Those requests will be queued in |pending_requests_| in a FIFO manner,
// and will be executed once all the preceding Reset() have been finished.
// |pending_flush_callbacks_| stores all the callbacks corresponding to
// currently executing Flush()es in VDA. |pending_reset_callback_| is a
// callback of the currently executing Reset() in VDA.
// If |pending_flush_callbacks_| is not empty in NotifyResetDone(),
// as Flush()es may be cancelled by Reset() in VDA, they are called with
// CANCELLED.
// In |pending_requests_|, PendingRequest is Reset/Flush/DecodeRequest().
// PendingCallback is null in the case of Decode().
// Otherwise, it isn't nullptr and will have to be called eventually.
std::queue<std::pair<PendingRequest, PendingCallback>> pending_requests_;
std::queue<FlushCallback> pending_flush_callbacks_;
ResetCallback pending_reset_callback_;
gpu::GpuPreferences gpu_preferences_;
std::unique_ptr<media::VideoDecodeAccelerator> vda_;
mojom::VideoDecodeClientPtr client_;
gfx::Size coded_size_;
media::VideoPixelFormat output_pixel_format_ = media::PIXEL_FORMAT_UNKNOWN;
// Owned by caller.
ProtectedBufferManager* const protected_buffer_manager_;
bool secure_mode_ = false;
size_t output_buffer_count_ = 0;
// Although the stored data are not used for anything in GAVDA,
// storing them in GAVDA is needed to keep the protected buffers and
// their mappings valid on behalf of the GAVDA client.
// For both of them, it is prohibited to allocate more than the predetermined
// number of protected buffers.
// The predetermined number is a constant value (kMaxProtectedInputBuffers)
// for protected input buffers, and it is |output_buffer_count_| set in
// AssignPictureBuffers() for protected output buffers.
// |protected_output_handles_| is indexed by |picture_buffer_id| in
// ImportBufferForPicture().
std::vector<std::unique_ptr<ProtectedBufferHandle>> protected_input_handles_;
std::vector<std::unique_ptr<ProtectedBufferHandle>> protected_output_handles_;
THREAD_CHECKER(thread_checker_);
DISALLOW_COPY_AND_ASSIGN(GpuArcVideoDecodeAccelerator);
};
} // namespace arc
#endif // COMPONENTS_ARC_VIDEO_ACCELERATOR_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_
......@@ -63,6 +63,9 @@ class TestGpuService : public mojom::GpuService {
arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request)
override {}
void CreateArcVideoDecodeAccelerator(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) override {}
void CreateArcVideoEncodeAccelerator(
arc::mojom::VideoEncodeAcceleratorRequest vea_request) override {}
......
......@@ -52,6 +52,7 @@
#endif
#if defined(OS_CHROMEOS)
#include "components/arc/video_accelerator/gpu_arc_video_decode_accelerator.h"
#include "components/arc/video_accelerator/gpu_arc_video_decode_accelerator_deprecated.h"
#include "components/arc/video_accelerator/gpu_arc_video_encode_accelerator.h"
#include "components/arc/video_accelerator/protected_buffer_manager.h"
......@@ -254,6 +255,20 @@ void GpuServiceImpl::CreateArcVideoDecodeAcceleratorDeprecated(
#endif // defined(OS_CHROMEOS)
}
void GpuServiceImpl::CreateArcVideoDecodeAccelerator(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) {
#if defined(OS_CHROMEOS)
DCHECK(io_runner_->BelongsToCurrentThread());
main_runner_->PostTask(
FROM_HERE,
base::BindOnce(
&GpuServiceImpl::CreateArcVideoDecodeAcceleratorOnMainThread,
weak_ptr_, std::move(vda_request)));
#else
NOTREACHED();
#endif // defined(OS_CHROMEOS)
}
void GpuServiceImpl::CreateArcVideoEncodeAccelerator(
arc::mojom::VideoEncodeAcceleratorRequest vea_request) {
#if defined(OS_CHROMEOS)
......@@ -292,6 +307,15 @@ void GpuServiceImpl::CreateArcVideoDecodeAcceleratorDeprecatedOnMainThread(
std::move(vda_request));
}
void GpuServiceImpl::CreateArcVideoDecodeAcceleratorOnMainThread(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) {
DCHECK(main_runner_->BelongsToCurrentThread());
mojo::MakeStrongBinding(
std::make_unique<arc::GpuArcVideoDecodeAccelerator>(
gpu_preferences_, protected_buffer_manager_.get()),
std::move(vda_request));
}
void GpuServiceImpl::CreateArcVideoEncodeAcceleratorOnMainThread(
arc::mojom::VideoEncodeAcceleratorRequest vea_request) {
DCHECK(main_runner_->BelongsToCurrentThread());
......
......@@ -142,6 +142,8 @@ class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate,
void CloseChannel(int32_t client_id) override;
void CreateArcVideoDecodeAcceleratorDeprecated(
arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request) override;
void CreateArcVideoDecodeAccelerator(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) override;
void CreateArcVideoEncodeAccelerator(
arc::mojom::VideoEncodeAcceleratorRequest vea_request) override;
void CreateArcProtectedBufferManager(
......@@ -179,6 +181,8 @@ class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate,
#if defined(OS_CHROMEOS)
void CreateArcVideoDecodeAcceleratorDeprecatedOnMainThread(
arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request);
void CreateArcVideoDecodeAcceleratorOnMainThread(
arc::mojom::VideoDecodeAcceleratorRequest vda_request);
void CreateArcVideoEncodeAcceleratorOnMainThread(
arc::mojom::VideoEncodeAcceleratorRequest vea_request);
void CreateArcProtectedBufferManagerOnMainThread(
......
......@@ -5,6 +5,7 @@
module ui.mojom;
import "components/arc/common/protected_buffer_manager.mojom";
import "components/arc/common/video_decode_accelerator.mojom";
import "components/arc/common/video_decode_accelerator_deprecated.mojom";
import "components/arc/common/video_encode_accelerator.mojom";
......@@ -13,6 +14,9 @@ interface Arc {
CreateVideoDecodeAcceleratorDeprecated(
arc.mojom.VideoDecodeAcceleratorDeprecated& vda);
// Create a new VideoDecodeAccelerator and binds it to |vda|.
CreateVideoDecodeAccelerator(arc.mojom.VideoDecodeAccelerator& vda);
// Create a new VideoEncodeAccelerator and binds it to |vea|.
CreateVideoEncodeAccelerator(arc.mojom.VideoEncodeAccelerator& vea);
......
......@@ -21,6 +21,11 @@ void ArcClient::CreateVideoDecodeAcceleratorDeprecated(
std::move(vda_request));
}
void ArcClient::CreateVideoDecodeAccelerator(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) {
gpu_service_->CreateArcVideoDecodeAccelerator(std::move(vda_request));
}
void ArcClient::CreateVideoEncodeAccelerator(
arc::mojom::VideoEncodeAcceleratorRequest vea_request) {
gpu_service_->CreateArcVideoEncodeAccelerator(std::move(vea_request));
......
......@@ -27,6 +27,10 @@ class ArcClient : public mojom::Arc {
// mojom::Arc overrides:
void CreateVideoDecodeAcceleratorDeprecated(
arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request) override;
void CreateVideoDecodeAccelerator(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) override;
void CreateVideoEncodeAccelerator(
arc::mojom::VideoEncodeAcceleratorRequest vea_request) override;
void CreateProtectedBufferManager(
......
......@@ -5,6 +5,7 @@
module viz.mojom;
import "components/arc/common/protected_buffer_manager.mojom";
import "components/arc/common/video_decode_accelerator.mojom";
import "components/arc/common/video_decode_accelerator_deprecated.mojom";
import "components/arc/common/video_encode_accelerator.mojom";
import "gpu/ipc/common/gpu_info.mojom";
......@@ -32,6 +33,9 @@ interface GpuService {
CreateArcVideoDecodeAcceleratorDeprecated(
arc.mojom.VideoDecodeAcceleratorDeprecated& vda);
// Create a new ARC VideoDecodeAccelerator and binds it to |vda|.
CreateArcVideoDecodeAccelerator(arc.mojom.VideoDecodeAccelerator& vda);
// Create a new ARC VideoEncodeAccelerator and binds it to |vea|.
CreateArcVideoEncodeAccelerator(arc.mojom.VideoEncodeAccelerator& vea);
......
......@@ -34133,6 +34133,15 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
<histogram name="Media.GpuArcVideoDecodeAccelerator.InitializeResult"
enum="ArcVideoDecodeAcceleratorResult">
<owner>hiroh@chromium.org</owner>
<summary>
Counts of status values returned from calls to
GpuArcVideoDecodeAccelerator::Initialize().
</summary>
</histogram>
<histogram name="Media.GpuVideoDecoderError" enum="VideoDecodeAcceleratorError">
<owner>sandersd@chromium.org</owner>
<summary>Counts of video decode errors reported to GpuVideoDecoder.</summary>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment