Commit 410c6df8 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

Deprecate IPC and GpuArcVDA

Deprecate current ArcVideoDecodeAccelerator IPC and GpuArcVDA

This CL is the first phase of the migration to a new IPC for ARC
VideoDecodeAccelerator.

To maintain backwards-compatibility during the transition period,
the existing VideoDecodeAccelerator mojo interface is renamed to
VideoDecodeAcceleratorDeprecated,
and its implementation, GpuArcVideoDecodeAccelerator,
to GpuArcVideoDecodeAcceleratorDeprecated.

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

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I591626d651d1b7bed0a03f55fdc64dae93d196c9
Reviewed-on: https://chromium-review.googlesource.com/609564
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarPawel Osciak <posciak@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Reviewed-by: default avatarJorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: default avatarOwen Lin <owenlin@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523308}
parent 5cbb45ec
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
"provides": { "provides": {
"browser": [ "browser": [
"arc::mojom::ProtectedBufferManager", "arc::mojom::ProtectedBufferManager",
"arc::mojom::VideoDecodeAccelerator", "arc::mojom::VideoDecodeAcceleratorDeprecated",
"arc::mojom::VideoDecodeClient", "arc::mojom::VideoDecodeClientDeprecated",
"arc::mojom::VideoEncodeAccelerator", "arc::mojom::VideoEncodeAccelerator",
"arc::mojom::VideoEncodeClient", "arc::mojom::VideoEncodeClient",
"chrome::mojom::ResourceUsageReporter", "chrome::mojom::ResourceUsageReporter",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "chrome/browser/chromeos/ash_config.h" #include "chrome/browser/chromeos/ash_config.h"
#include "components/arc/arc_bridge_service.h" #include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_browser_context_keyed_service_factory_base.h" #include "components/arc/arc_browser_context_keyed_service_factory_base.h"
#include "components/arc/common/video_decode_accelerator_deprecated.mojom.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/gpu_service_registry.h" #include "content/public/browser/gpu_service_registry.h"
#include "content/public/common/service_manager_connection.h" #include "content/public/common/service_manager_connection.h"
...@@ -54,13 +55,13 @@ class VideoAcceleratorFactoryService : public mojom::VideoAcceleratorFactory { ...@@ -54,13 +55,13 @@ class VideoAcceleratorFactoryService : public mojom::VideoAcceleratorFactory {
~VideoAcceleratorFactoryService() override = default; ~VideoAcceleratorFactoryService() override = default;
void CreateDecodeAccelerator( void CreateDecodeAcceleratorDeprecated(
mojom::VideoDecodeAcceleratorRequest request) override { mojom::VideoDecodeAcceleratorDeprecatedRequest request) override {
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE, content::BrowserThread::IO, FROM_HERE,
base::BindOnce( base::BindOnce(&content::BindInterfaceInGpuProcess<
&content::BindInterfaceInGpuProcess<mojom::VideoDecodeAccelerator>, mojom::VideoDecodeAcceleratorDeprecated>,
std::move(request))); std::move(request)));
} }
void CreateEncodeAccelerator( void CreateEncodeAccelerator(
...@@ -91,10 +92,10 @@ class VideoAcceleratorFactoryServiceMus ...@@ -91,10 +92,10 @@ class VideoAcceleratorFactoryServiceMus
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
} }
void CreateDecodeAccelerator( void CreateDecodeAcceleratorDeprecated(
mojom::VideoDecodeAcceleratorRequest request) override { mojom::VideoDecodeAcceleratorDeprecatedRequest request) override {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
arc_->CreateVideoDecodeAccelerator(std::move(request)); arc_->CreateVideoDecodeAcceleratorDeprecated(std::move(request));
} }
void CreateEncodeAccelerator( void CreateEncodeAccelerator(
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/connector.h"
#if defined(OS_CHROMEOS) #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/gpu_arc_video_encode_accelerator.h"
#include "components/arc/video_accelerator/protected_buffer_manager.h" #include "components/arc/video_accelerator/protected_buffer_manager.h"
#include "components/arc/video_accelerator/protected_buffer_manager_proxy.h" #include "components/arc/video_accelerator/protected_buffer_manager_proxy.h"
...@@ -61,8 +61,9 @@ void ChromeContentGpuClient::InitializeRegistry( ...@@ -61,8 +61,9 @@ void ChromeContentGpuClient::InitializeRegistry(
service_manager::BinderRegistry* registry) { service_manager::BinderRegistry* registry) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
registry->AddInterface( registry->AddInterface(
base::Bind(&ChromeContentGpuClient::CreateArcVideoDecodeAccelerator, base::Bind(
base::Unretained(this)), &ChromeContentGpuClient::CreateArcVideoDecodeAcceleratorDeprecated,
base::Unretained(this)),
base::ThreadTaskRunnerHandle::Get()); base::ThreadTaskRunnerHandle::Get());
registry->AddInterface( registry->AddInterface(
base::Bind(&ChromeContentGpuClient::CreateArcVideoEncodeAccelerator, base::Bind(&ChromeContentGpuClient::CreateArcVideoEncodeAccelerator,
...@@ -94,10 +95,10 @@ void ChromeContentGpuClient::GpuServiceInitialized( ...@@ -94,10 +95,10 @@ void ChromeContentGpuClient::GpuServiceInitialized(
} }
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
void ChromeContentGpuClient::CreateArcVideoDecodeAccelerator( void ChromeContentGpuClient::CreateArcVideoDecodeAcceleratorDeprecated(
::arc::mojom::VideoDecodeAcceleratorRequest request) { ::arc::mojom::VideoDecodeAcceleratorDeprecatedRequest request) {
mojo::MakeStrongBinding( mojo::MakeStrongBinding(
std::make_unique<arc::GpuArcVideoDecodeAccelerator>( std::make_unique<arc::GpuArcVideoDecodeAcceleratorDeprecated>(
gpu_preferences_, protected_buffer_manager_.get()), gpu_preferences_, protected_buffer_manager_.get()),
std::move(request)); std::move(request));
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "components/arc/common/protected_buffer_manager.mojom.h" #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 "components/arc/common/video_encode_accelerator.mojom.h"
#include "gpu/command_buffer/service/gpu_preferences.h" #include "gpu/command_buffer/service/gpu_preferences.h"
...@@ -34,8 +34,8 @@ class ChromeContentGpuClient : public content::ContentGpuClient { ...@@ -34,8 +34,8 @@ class ChromeContentGpuClient : public content::ContentGpuClient {
private: private:
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
void CreateArcVideoDecodeAccelerator( void CreateArcVideoDecodeAcceleratorDeprecated(
::arc::mojom::VideoDecodeAcceleratorRequest request); ::arc::mojom::VideoDecodeAcceleratorDeprecatedRequest request);
void CreateArcVideoEncodeAccelerator( void CreateArcVideoEncodeAccelerator(
::arc::mojom::VideoEncodeAcceleratorRequest request); ::arc::mojom::VideoEncodeAcceleratorRequest request);
......
...@@ -65,7 +65,7 @@ mojom("media") { ...@@ -65,7 +65,7 @@ mojom("media") {
"protected_buffer_manager.mojom", "protected_buffer_manager.mojom",
"video.mojom", "video.mojom",
"video_common.mojom", "video_common.mojom",
"video_decode_accelerator.mojom", "video_decode_accelerator_deprecated.mojom",
"video_encode_accelerator.mojom", "video_encode_accelerator.mojom",
] ]
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
module arc.mojom; module arc.mojom;
import "video_decode_accelerator.mojom"; import "video_decode_accelerator_deprecated.mojom";
import "video_encode_accelerator.mojom"; import "video_encode_accelerator.mojom";
// Deprecated method IDs: 0 // Deprecated method IDs: 0
...@@ -31,7 +31,7 @@ interface VideoInstance { ...@@ -31,7 +31,7 @@ interface VideoInstance {
// Next method ID: 2 // Next method ID: 2
interface VideoAcceleratorFactory { interface VideoAcceleratorFactory {
CreateDecodeAccelerator@0(VideoDecodeAccelerator& decoder); CreateDecodeAcceleratorDeprecated@0(VideoDecodeAcceleratorDeprecated& video_decoder);
[MinVersion=1] [MinVersion=1]
CreateEncodeAccelerator@1(VideoEncodeAccelerator& encoder); CreateEncodeAccelerator@1(VideoEncodeAccelerator& encoder);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef COMPONENTS_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ #ifndef COMPONENTS_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_
#define COMPONENTS_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ #define COMPONENTS_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_
#include "components/arc/common/video_decode_accelerator.mojom.h" #include "components/arc/common/video_decode_accelerator_deprecated.mojom.h"
#include "components/arc/video_accelerator/video_frame_plane.h" #include "components/arc/video_accelerator/video_frame_plane.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
// This file defined the mojo interface between Android and Chromium for video // This file defined the mojo interface between Android and Chromium for video
// decoding. See comments of VideoDecodeAccelerator for more info. // decoding. See comments of VideoDecodeAcceleratorDeprecated for more info.
module arc.mojom; module arc.mojom;
...@@ -41,7 +41,7 @@ struct VideoFormat { ...@@ -41,7 +41,7 @@ struct VideoFormat {
}; };
// Next MinVersion: 2 // Next MinVersion: 2
struct VideoDecodeAcceleratorConfig { struct VideoDecodeAcceleratorConfigDeprecated {
// Deprecated. This config struct is used for decoder only. // Deprecated. This config struct is used for decoder only.
enum DeviceTypeDeprecated { enum DeviceTypeDeprecated {
DEVICE_ENCODER = 0, DEVICE_ENCODER = 0,
...@@ -58,7 +58,7 @@ struct VideoDecodeAcceleratorConfig { ...@@ -58,7 +58,7 @@ struct VideoDecodeAcceleratorConfig {
// Next MinVersion: 5 // Next MinVersion: 5
// Deprecated method IDs: 2, 7 // Deprecated method IDs: 2, 7
// Next method ID: 11 // Next method ID: 11
interface VideoDecodeAccelerator { interface VideoDecodeAcceleratorDeprecated {
enum Result { enum Result {
SUCCESS = 0, SUCCESS = 0,
ILLEGAL_STATE = 1, ILLEGAL_STATE = 1,
...@@ -69,8 +69,8 @@ interface VideoDecodeAccelerator { ...@@ -69,8 +69,8 @@ interface VideoDecodeAccelerator {
}; };
[MinVersion=2] [MinVersion=2]
Initialize@8(VideoDecodeAcceleratorConfig config, Initialize@8(VideoDecodeAcceleratorConfigDeprecated config,
VideoDecodeClient client) => (Result result); VideoDecodeClientDeprecated client) => (Result result);
[MinVersion=4] [MinVersion=4]
AllocateProtectedBuffer@10(PortType port, uint32 index, handle handle_fd, AllocateProtectedBuffer@10(PortType port, uint32 index, handle handle_fd,
...@@ -94,8 +94,8 @@ interface VideoDecodeAccelerator { ...@@ -94,8 +94,8 @@ interface VideoDecodeAccelerator {
// Deprecated method IDs: 0 // Deprecated method IDs: 0
// Next method ID: 6 // Next method ID: 6
interface VideoDecodeClient { interface VideoDecodeClientDeprecated {
OnError@1(VideoDecodeAccelerator.Result error); OnError@1(VideoDecodeAcceleratorDeprecated.Result error);
OnBufferDone@2(PortType port, uint32 index, BufferMetadata metadata); OnBufferDone@2(PortType port, uint32 index, BufferMetadata metadata);
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
static_library("video_accelerator") { static_library("video_accelerator") {
sources = [ sources = [
"arc_video_decode_accelerator.h", "arc_video_decode_accelerator_deprecated.h",
"chrome_arc_video_decode_accelerator.cc", "chrome_arc_video_decode_accelerator_deprecated.cc",
"chrome_arc_video_decode_accelerator.h", "chrome_arc_video_decode_accelerator_deprecated.h",
"gpu_arc_video_decode_accelerator.cc", "gpu_arc_video_decode_accelerator_deprecated.cc",
"gpu_arc_video_decode_accelerator.h", "gpu_arc_video_decode_accelerator_deprecated.h",
"gpu_arc_video_encode_accelerator.cc", "gpu_arc_video_encode_accelerator.cc",
"gpu_arc_video_encode_accelerator.h", "gpu_arc_video_encode_accelerator.h",
"protected_buffer_manager.cc", "protected_buffer_manager.cc",
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_ARC_VIDEO_ACCELERATOR_ARC_VIDEO_DECODE_ACCELERATOR_H_ #ifndef COMPONENTS_ARC_VIDEO_ACCELERATOR_ARC_VIDEO_DECODE_ACCELERATOR_DEPRECATED_H_
#define COMPONENTS_ARC_VIDEO_ACCELERATOR_ARC_VIDEO_DECODE_ACCELERATOR_H_ #define COMPONENTS_ARC_VIDEO_ACCELERATOR_ARC_VIDEO_DECODE_ACCELERATOR_DEPRECATED_H_
#include <vector> #include <vector>
...@@ -53,7 +53,7 @@ struct VideoFormat { ...@@ -53,7 +53,7 @@ struct VideoFormat {
// The IPC interface between Android and Chromium for video decoding. Input // The IPC interface between Android and Chromium for video decoding. Input
// buffers are sent from Android side and get processed in Chromium and the // buffers are sent from Android side and get processed in Chromium and the
// output buffers are returned back to Android side. // output buffers are returned back to Android side.
class ArcVideoDecodeAccelerator { class ArcVideoDecodeAcceleratorDeprecated {
public: public:
enum Result { enum Result {
// Note: this enum is used for UMA reporting. The existing values should not // Note: this enum is used for UMA reporting. The existing values should not
...@@ -77,8 +77,8 @@ class ArcVideoDecodeAccelerator { ...@@ -77,8 +77,8 @@ class ArcVideoDecodeAccelerator {
// format of each VDA on Chromium is supported. // format of each VDA on Chromium is supported.
}; };
// The callbacks of the ArcVideoDecodeAccelerator. The user of this class // The callbacks of the ArcVideoDecodeAcceleratorDeprecated.
// should implement this interface. // The user of this class should implement this interface.
class Client { class Client {
public: public:
virtual ~Client() {} virtual ~Client() {}
...@@ -107,9 +107,10 @@ class ArcVideoDecodeAccelerator { ...@@ -107,9 +107,10 @@ class ArcVideoDecodeAccelerator {
virtual void OnFlushDone() = 0; virtual void OnFlushDone() = 0;
}; };
// Initializes the ArcVideoDecodeAccelerator with specific configuration. This // Initializes the ArcVideoDecodeAcceleratorDeprecated with
// must be called before any other methods. This call is synchronous and // specific configuration. This must be called before any other methods.
// returns SUCCESS iff initialization is successful. // This call is synchronous and returns SUCCESS
// iff initialization is successful.
virtual Result Initialize(const Config& config, Client* client) = 0; virtual Result Initialize(const Config& config, Client* client) = 0;
// Allocates a new protected buffer on accelerator side for the given |port| // Allocates a new protected buffer on accelerator side for the given |port|
...@@ -174,9 +175,9 @@ class ArcVideoDecodeAccelerator { ...@@ -174,9 +175,9 @@ class ArcVideoDecodeAccelerator {
// called. // called.
virtual void Flush() = 0; virtual void Flush() = 0;
virtual ~ArcVideoDecodeAccelerator() {} virtual ~ArcVideoDecodeAcceleratorDeprecated() {}
}; };
} // namespace arc } // namespace arc
#endif // COMPONENTS_ARC_VIDEO_ACCELERATOR_ARC_VIDEO_DECODE_ACCELERATOR_H_ #endif // COMPONENTS_ARC_VIDEO_ACCELERATOR_ARC_VIDEO_DECODE_ACCELERATOR_DEPRECATED_H_
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_ARC_VIDEO_ACCELERATOR_CHROME_ARC_VIDEO_DECODE_ACCELERATOR_H_ #ifndef COMPONENTS_ARC_VIDEO_ACCELERATOR_CHROME_ARC_VIDEO_DECODE_ACCELERATOR_DEPRECATED_H_
#define COMPONENTS_ARC_VIDEO_ACCELERATOR_CHROME_ARC_VIDEO_DECODE_ACCELERATOR_H_ #define COMPONENTS_ARC_VIDEO_ACCELERATOR_CHROME_ARC_VIDEO_DECODE_ACCELERATOR_DEPRECATED_H_
#include <list> #include <list>
#include <memory> #include <memory>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
#include "components/arc/video_accelerator/arc_video_decode_accelerator.h" #include "components/arc/video_accelerator/arc_video_decode_accelerator_deprecated.h"
#include "gpu/command_buffer/service/gpu_preferences.h" #include "gpu/command_buffer/service/gpu_preferences.h"
#include "media/video/video_decode_accelerator.h" #include "media/video/video_decode_accelerator.h"
...@@ -23,22 +23,22 @@ class ProtectedBufferHandle; ...@@ -23,22 +23,22 @@ class ProtectedBufferHandle;
// This class is executed in the GPU process. It takes decoding requests from // This class is executed in the GPU process. It takes decoding requests from
// ARC via IPC channels and translates and sends those requests to an // ARC via IPC channels and translates and sends those requests to an
// implementation of media::VideoDecodeAccelerator. It also returns the decoded // implementation of media::VideoDecodeAcceleratorDeprecated.
// frames back to the ARC side. // It also returns the decoded frames back to the ARC side.
class ChromeArcVideoDecodeAccelerator class ChromeArcVideoDecodeAcceleratorDeprecated
: public ArcVideoDecodeAccelerator, : public ArcVideoDecodeAcceleratorDeprecated,
public media::VideoDecodeAccelerator::Client, public media::VideoDecodeAccelerator::Client,
public base::SupportsWeakPtr<ChromeArcVideoDecodeAccelerator> { public base::SupportsWeakPtr<ChromeArcVideoDecodeAcceleratorDeprecated> {
public: public:
ChromeArcVideoDecodeAccelerator( ChromeArcVideoDecodeAcceleratorDeprecated(
const gpu::GpuPreferences& gpu_preferences, const gpu::GpuPreferences& gpu_preferences,
ProtectedBufferManager* protected_buffer_manager); ProtectedBufferManager* protected_buffer_manager);
~ChromeArcVideoDecodeAccelerator() override; ~ChromeArcVideoDecodeAcceleratorDeprecated() override;
// Implementation of the ArcVideoDecodeAccelerator interface. // Implementation of the ArcVideoDecodeAcceleratorDeprecated interface.
ArcVideoDecodeAccelerator::Result Initialize( ArcVideoDecodeAcceleratorDeprecated::Result Initialize(
const Config& config, const Config& config,
ArcVideoDecodeAccelerator::Client* client) override; ArcVideoDecodeAcceleratorDeprecated::Client* client) override;
void SetNumberOfOutputBuffers(size_t number) override; void SetNumberOfOutputBuffers(size_t number) override;
bool AllocateProtectedBuffer(PortType port, bool AllocateProtectedBuffer(PortType port,
uint32_t index, uint32_t index,
...@@ -119,9 +119,9 @@ class ChromeArcVideoDecodeAccelerator ...@@ -119,9 +119,9 @@ class ChromeArcVideoDecodeAccelerator
}; };
// The helper method to simplify reporting of the status returned to UMA. // The helper method to simplify reporting of the status returned to UMA.
ArcVideoDecodeAccelerator::Result InitializeTask( ArcVideoDecodeAcceleratorDeprecated::Result InitializeTask(
const Config& config, const Config& config,
ArcVideoDecodeAccelerator::Client* client); ArcVideoDecodeAcceleratorDeprecated::Client* client);
// Helper function to validate |port| and |index|. // Helper function to validate |port| and |index|.
bool ValidatePortAndIndex(PortType port, uint32_t index) const; bool ValidatePortAndIndex(PortType port, uint32_t index) const;
...@@ -153,8 +153,8 @@ class ChromeArcVideoDecodeAccelerator ...@@ -153,8 +153,8 @@ class ChromeArcVideoDecodeAccelerator
std::unique_ptr<media::VideoDecodeAccelerator> vda_; std::unique_ptr<media::VideoDecodeAccelerator> vda_;
// It's safe to use the pointer here, the life cycle of the |arc_client_| // It's safe to use the pointer here, the life cycle of the |arc_client_|
// is longer than this ChromeArcVideoDecodeAccelerator. // is longer than this ChromeArcVideoDecodeAcceleratorDeprecated.
ArcVideoDecodeAccelerator::Client* arc_client_; ArcVideoDecodeAcceleratorDeprecated::Client* arc_client_;
// The next ID for the bitstream buffer, started from 0. // The next ID for the bitstream buffer, started from 0.
int32_t next_bitstream_buffer_id_; int32_t next_bitstream_buffer_id_;
...@@ -186,9 +186,9 @@ class ChromeArcVideoDecodeAccelerator ...@@ -186,9 +186,9 @@ class ChromeArcVideoDecodeAccelerator
gpu::GpuPreferences gpu_preferences_; gpu::GpuPreferences gpu_preferences_;
ProtectedBufferManager* protected_buffer_manager_; ProtectedBufferManager* protected_buffer_manager_;
DISALLOW_COPY_AND_ASSIGN(ChromeArcVideoDecodeAccelerator); DISALLOW_COPY_AND_ASSIGN(ChromeArcVideoDecodeAcceleratorDeprecated);
}; };
} // namespace arc } // namespace arc
#endif // COMPONENTS_ARC_VIDEO_ACCELERATOR_CHROME_ARC_VIDEO_DECODE_ACCELERATOR_H_ #endif // COMPONENTS_ARC_VIDEO_ACCELERATOR_CHROME_ARC_VIDEO_DECODE_ACCELERATOR_DEPRECATED_H_
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_ARC_VIDEO_ACCELERATOR_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_ #ifndef COMPONENTS_ARC_VIDEO_ACCELERATOR_GPU_ARC_VIDEO_DECODE_ACCELERATOR_DEPRECATED_H_
#define COMPONENTS_ARC_VIDEO_ACCELERATOR_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_ #define COMPONENTS_ARC_VIDEO_ACCELERATOR_GPU_ARC_VIDEO_DECODE_ACCELERATOR_DEPRECATED_H_
#include <memory> #include <memory>
#include <vector> #include <vector>
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
#include "components/arc/common/video_decode_accelerator.mojom.h" #include "components/arc/common/video_decode_accelerator_deprecated.mojom.h"
#include "components/arc/video_accelerator/arc_video_decode_accelerator.h" #include "components/arc/video_accelerator/arc_video_decode_accelerator_deprecated.h"
#include "components/arc/video_accelerator/video_frame_plane.h" #include "components/arc/video_accelerator/video_frame_plane.h"
#include "gpu/command_buffer/service/gpu_preferences.h" #include "gpu/command_buffer/service/gpu_preferences.h"
...@@ -20,23 +20,23 @@ namespace arc { ...@@ -20,23 +20,23 @@ namespace arc {
class ProtectedBufferManager; class ProtectedBufferManager;
// GpuArcVideoDecodeAccelerator manages life-cycle and IPC message translation // GpuArcVideoDecodeAcceleratorDeprecated manages life-cycle
// for ArcVideoDecodeAccelerator. // and IPC message translation for ArcVideoDecodeAcceleratorDeprecated.
// //
// For each creation request from GpuArcVideoDecodeAcceleratorHost, // For each creation request from GpuArcVideoDecodeAcceleratorHost,
// GpuArcVideoDecodeAccelerator will create a new IPC channel. // GpuArcVideoDecodeAcceleratorDeprecated will create a new IPC channel.
class GpuArcVideoDecodeAccelerator class GpuArcVideoDecodeAcceleratorDeprecated
: public ::arc::mojom::VideoDecodeAccelerator, : public ::arc::mojom::VideoDecodeAcceleratorDeprecated,
public ArcVideoDecodeAccelerator::Client { public ArcVideoDecodeAcceleratorDeprecated::Client {
public: public:
GpuArcVideoDecodeAccelerator( GpuArcVideoDecodeAcceleratorDeprecated(
const gpu::GpuPreferences& gpu_preferences, const gpu::GpuPreferences& gpu_preferences,
ProtectedBufferManager* protected_buffer_manager); ProtectedBufferManager* protected_buffer_manager);
~GpuArcVideoDecodeAccelerator() override; ~GpuArcVideoDecodeAcceleratorDeprecated() override;
private: private:
// ArcVideoDecodeAccelerator::Client implementation. // ArcVideoDecodeAcceleratorDeprecated::Client implementation.
void OnError(ArcVideoDecodeAccelerator::Result error) override; void OnError(ArcVideoDecodeAcceleratorDeprecated::Result error) override;
void OnBufferDone(PortType port, void OnBufferDone(PortType port,
uint32_t index, uint32_t index,
const BufferMetadata& metadata) override; const BufferMetadata& metadata) override;
...@@ -44,18 +44,17 @@ class GpuArcVideoDecodeAccelerator ...@@ -44,18 +44,17 @@ class GpuArcVideoDecodeAccelerator
void OnResetDone() override; void OnResetDone() override;
void OnOutputFormatChanged(const VideoFormat& format) override; void OnOutputFormatChanged(const VideoFormat& format) override;
// ::arc::mojom::VideoDecodeAccelerator implementation. // ::arc::mojom::VideoDecodeAcceleratorDeprecated implementation.
void Initialize(::arc::mojom::VideoDecodeAcceleratorConfigPtr config, void Initialize(
::arc::mojom::VideoDecodeClientPtr client, ::arc::mojom::VideoDecodeAcceleratorConfigDeprecatedPtr config,
InitializeCallback callback) override; ::arc::mojom::VideoDecodeClientDeprecatedPtr client,
InitializeCallback callback) override;
void AllocateProtectedBuffer( void AllocateProtectedBuffer(
::arc::mojom::PortType port, ::arc::mojom::PortType port,
uint32_t index, uint32_t index,
mojo::ScopedHandle handle, mojo::ScopedHandle handle,
uint64_t size, uint64_t size,
AllocateProtectedBufferCallback callback) override; AllocateProtectedBufferCallback callback) override;
void BindSharedMemory(::arc::mojom::PortType port, void BindSharedMemory(::arc::mojom::PortType port,
uint32_t index, uint32_t index,
mojo::ScopedHandle ashmem_handle, mojo::ScopedHandle ashmem_handle,
...@@ -77,12 +76,13 @@ class GpuArcVideoDecodeAccelerator ...@@ -77,12 +76,13 @@ class GpuArcVideoDecodeAccelerator
THREAD_CHECKER(thread_checker_); THREAD_CHECKER(thread_checker_);
gpu::GpuPreferences gpu_preferences_; gpu::GpuPreferences gpu_preferences_;
std::unique_ptr<ArcVideoDecodeAccelerator> accelerator_;
::arc::mojom::VideoDecodeClientPtr client_;
DISALLOW_COPY_AND_ASSIGN(GpuArcVideoDecodeAccelerator); std::unique_ptr<ArcVideoDecodeAcceleratorDeprecated> accelerator_;
::arc::mojom::VideoDecodeClientDeprecatedPtr client_;
DISALLOW_COPY_AND_ASSIGN(GpuArcVideoDecodeAcceleratorDeprecated);
}; };
} // namespace arc } // namespace arc
#endif // COMPONENTS_ARC_VIDEO_ACCELERATOR_GPU_ARC_VIDEO_DECODE_ACCELERATOR_H_ #endif // COMPONENTS_ARC_VIDEO_ACCELERATOR_GPU_ARC_VIDEO_DECODE_ACCELERATOR_DEPRECATED_H_
...@@ -59,8 +59,9 @@ class TestGpuService : public mojom::GpuService { ...@@ -59,8 +59,9 @@ class TestGpuService : public mojom::GpuService {
void CloseChannel(int32_t client_id) override {} void CloseChannel(int32_t client_id) override {}
void CreateArcVideoDecodeAccelerator( void CreateArcVideoDecodeAcceleratorDeprecated(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) override {} arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request)
override {}
void CreateArcVideoEncodeAccelerator( void CreateArcVideoEncodeAccelerator(
arc::mojom::VideoEncodeAcceleratorRequest vea_request) override {} arc::mojom::VideoEncodeAcceleratorRequest vea_request) override {}
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#endif #endif
#if defined(OS_CHROMEOS) #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/gpu_arc_video_encode_accelerator.h"
#include "components/arc/video_accelerator/protected_buffer_manager.h" #include "components/arc/video_accelerator/protected_buffer_manager.h"
#include "components/arc/video_accelerator/protected_buffer_manager_proxy.h" #include "components/arc/video_accelerator/protected_buffer_manager_proxy.h"
...@@ -240,15 +240,15 @@ void GpuServiceImpl::RecordLogMessage(int severity, ...@@ -240,15 +240,15 @@ void GpuServiceImpl::RecordLogMessage(int severity,
(*gpu_host_)->RecordLogMessage(severity, header, message); (*gpu_host_)->RecordLogMessage(severity, header, message);
} }
void GpuServiceImpl::CreateArcVideoDecodeAccelerator( void GpuServiceImpl::CreateArcVideoDecodeAcceleratorDeprecated(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) { arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
DCHECK(io_runner_->BelongsToCurrentThread()); DCHECK(io_runner_->BelongsToCurrentThread());
main_runner_->PostTask( main_runner_->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(&GpuServiceImpl::
&GpuServiceImpl::CreateArcVideoDecodeAcceleratorOnMainThread, CreateArcVideoDecodeAcceleratorDeprecatedOnMainThread,
weak_ptr_, std::move(vda_request))); weak_ptr_, std::move(vda_request)));
#else #else
NOTREACHED(); NOTREACHED();
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
...@@ -283,11 +283,11 @@ void GpuServiceImpl::CreateArcProtectedBufferManager( ...@@ -283,11 +283,11 @@ void GpuServiceImpl::CreateArcProtectedBufferManager(
} }
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
void GpuServiceImpl::CreateArcVideoDecodeAcceleratorOnMainThread( void GpuServiceImpl::CreateArcVideoDecodeAcceleratorDeprecatedOnMainThread(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) { arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request) {
DCHECK(main_runner_->BelongsToCurrentThread()); DCHECK(main_runner_->BelongsToCurrentThread());
mojo::MakeStrongBinding( mojo::MakeStrongBinding(
std::make_unique<arc::GpuArcVideoDecodeAccelerator>( std::make_unique<arc::GpuArcVideoDecodeAcceleratorDeprecated>(
gpu_preferences_, protected_buffer_manager_.get()), gpu_preferences_, protected_buffer_manager_.get()),
std::move(vda_request)); std::move(vda_request));
} }
......
...@@ -140,8 +140,8 @@ class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate, ...@@ -140,8 +140,8 @@ class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate,
bool is_gpu_host, bool is_gpu_host,
EstablishGpuChannelCallback callback) override; EstablishGpuChannelCallback callback) override;
void CloseChannel(int32_t client_id) override; void CloseChannel(int32_t client_id) override;
void CreateArcVideoDecodeAccelerator( void CreateArcVideoDecodeAcceleratorDeprecated(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) override; arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request) override;
void CreateArcVideoEncodeAccelerator( void CreateArcVideoEncodeAccelerator(
arc::mojom::VideoEncodeAcceleratorRequest vea_request) override; arc::mojom::VideoEncodeAcceleratorRequest vea_request) override;
void CreateArcProtectedBufferManager( void CreateArcProtectedBufferManager(
...@@ -177,8 +177,8 @@ class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate, ...@@ -177,8 +177,8 @@ class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate,
void Stop(StopCallback callback) override; void Stop(StopCallback callback) override;
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
void CreateArcVideoDecodeAcceleratorOnMainThread( void CreateArcVideoDecodeAcceleratorDeprecatedOnMainThread(
arc::mojom::VideoDecodeAcceleratorRequest vda_request); arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request);
void CreateArcVideoEncodeAcceleratorOnMainThread( void CreateArcVideoEncodeAcceleratorOnMainThread(
arc::mojom::VideoEncodeAcceleratorRequest vea_request); arc::mojom::VideoEncodeAcceleratorRequest vea_request);
void CreateArcProtectedBufferManagerOnMainThread( void CreateArcProtectedBufferManagerOnMainThread(
......
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
module ui.mojom; module ui.mojom;
import "components/arc/common/protected_buffer_manager.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 "components/arc/common/video_encode_accelerator.mojom";
interface Arc { interface Arc {
// Create a new VideoDecodeAccelerator and binds it to |vda|. // Create a new VideoDecodeAcceleratorDepreacted and binds it to |vda|.
CreateVideoDecodeAccelerator(arc.mojom.VideoDecodeAccelerator& vda); CreateVideoDecodeAcceleratorDeprecated(
arc.mojom.VideoDecodeAcceleratorDeprecated& vda);
// Create a new VideoEncodeAccelerator and binds it to |vea|. // Create a new VideoEncodeAccelerator and binds it to |vea|.
CreateVideoEncodeAccelerator(arc.mojom.VideoEncodeAccelerator& vea); CreateVideoEncodeAccelerator(arc.mojom.VideoEncodeAccelerator& vea);
......
...@@ -15,9 +15,10 @@ ArcClient::ArcClient(viz::mojom::GpuService* gpu_service) ...@@ -15,9 +15,10 @@ ArcClient::ArcClient(viz::mojom::GpuService* gpu_service)
ArcClient::~ArcClient() {} ArcClient::~ArcClient() {}
// mojom::Arc overrides: // mojom::Arc overrides:
void ArcClient::CreateVideoDecodeAccelerator( void ArcClient::CreateVideoDecodeAcceleratorDeprecated(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) { arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request) {
gpu_service_->CreateArcVideoDecodeAccelerator(std::move(vda_request)); gpu_service_->CreateArcVideoDecodeAcceleratorDeprecated(
std::move(vda_request));
} }
void ArcClient::CreateVideoEncodeAccelerator( void ArcClient::CreateVideoEncodeAccelerator(
......
...@@ -25,8 +25,8 @@ class ArcClient : public mojom::Arc { ...@@ -25,8 +25,8 @@ class ArcClient : public mojom::Arc {
private: private:
// mojom::Arc overrides: // mojom::Arc overrides:
void CreateVideoDecodeAccelerator( void CreateVideoDecodeAcceleratorDeprecated(
arc::mojom::VideoDecodeAcceleratorRequest vda_request) override; arc::mojom::VideoDecodeAcceleratorDeprecatedRequest vda_request) override;
void CreateVideoEncodeAccelerator( void CreateVideoEncodeAccelerator(
arc::mojom::VideoEncodeAcceleratorRequest vea_request) override; arc::mojom::VideoEncodeAcceleratorRequest vea_request) override;
void CreateProtectedBufferManager( void CreateProtectedBufferManager(
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
module viz.mojom; module viz.mojom;
import "components/arc/common/protected_buffer_manager.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 "components/arc/common/video_encode_accelerator.mojom";
import "gpu/ipc/common/gpu_info.mojom"; import "gpu/ipc/common/gpu_info.mojom";
import "gpu/ipc/common/memory_stats.mojom"; import "gpu/ipc/common/memory_stats.mojom";
...@@ -28,8 +28,9 @@ interface GpuService { ...@@ -28,8 +28,9 @@ interface GpuService {
// If no channel can be identified, do nothing. // If no channel can be identified, do nothing.
CloseChannel(int32 client_id); CloseChannel(int32 client_id);
// Create a new ARC VideoDecodeAccelerator and binds it to |vda|. // Create a new ARC VideoDecodeAcceleratorDeprecated and binds it to |vda|.
CreateArcVideoDecodeAccelerator(arc.mojom.VideoDecodeAccelerator& vda); CreateArcVideoDecodeAcceleratorDeprecated(
arc.mojom.VideoDecodeAcceleratorDeprecated& vda);
// Create a new ARC VideoEncodeAccelerator and binds it to |vea|. // Create a new ARC VideoEncodeAccelerator and binds it to |vea|.
CreateArcVideoEncodeAccelerator(arc.mojom.VideoEncodeAccelerator& vea); CreateArcVideoEncodeAccelerator(arc.mojom.VideoEncodeAccelerator& vea);
......
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