Commit 97256229 authored by Moja Hsu's avatar Moja Hsu Committed by Commit Bot

Add JDA Mojo interface to camera dispatcher

The interface is used from chrome os camera hal for jpeg decoding. For
the compatibility issue between the Mojo versions of chrome os and
chrome. Shared buffer handle serialization is not supported between
the old version and the new version. We create a new DecodeWithFD in
GpuJpegDecodeAccelerator Mojo interface.

BUG=chromium:780009
TEST=Run gpu_jpeg_decode_accelerator_unittest to check Mojo
interfaces.
Decode a real jpeg image from chrome os by the Mojo interfaces.
Run camera app.

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: I8e7df9543dd532dc2457f334245593b6722a71fb
Reviewed-on: https://chromium-review.googlesource.com/670541Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarChristian Fremerey <chfremer@chromium.org>
Commit-Queue: Hsu Wei-Cheng <mojahsu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532125}
parent ee32d835
......@@ -28,6 +28,7 @@
#include "build/build_config.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/renderer_host/media/audio_input_device_manager.h"
#include "content/browser/renderer_host/media/in_process_video_capture_provider.h"
#include "content/browser/renderer_host/media/media_capture_devices_impl.h"
......@@ -93,6 +94,24 @@ std::string RandomLabel() {
return label;
}
void CreateJpegDecodeAcceleratorOnIOThread(
media::mojom::JpegDecodeAcceleratorRequest request) {
auto* host =
GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false);
if (host) {
host->gpu_service()->CreateJpegDecodeAccelerator(std::move(request));
} else {
LOG(ERROR) << "No GpuProcessHost";
}
}
void CreateJpegDecodeAccelerator(
media::mojom::JpegDecodeAcceleratorRequest request) {
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::BindOnce(&CreateJpegDecodeAcceleratorOnIOThread,
base::Passed(std::move(request))));
}
void ParseStreamType(const StreamControls& controls,
MediaStreamType* audio_type,
MediaStreamType* video_type) {
......@@ -466,7 +485,8 @@ MediaStreamManager::MediaStreamManager(
std::make_unique<media::VideoCaptureSystemImpl>(
media::VideoCaptureDeviceFactory::CreateFactory(
BrowserThread::GetTaskRunnerForThread(BrowserThread::UI),
BrowserGpuMemoryBufferManager::current())),
BrowserGpuMemoryBufferManager::current(),
base::BindRepeating(&CreateJpegDecodeAccelerator))),
std::move(device_task_runner),
base::BindRepeating(&SendVideoCaptureLogMessage));
}
......
......@@ -83,6 +83,7 @@ source_set("capture_device_specific") {
"//gpu/command_buffer/client",
"//media",
"//media/capture/mojo:image_capture",
"//media/mojo/interfaces:interfaces",
"//ui/gfx",
]
}
......
......@@ -145,7 +145,8 @@ bool VideoCaptureDeviceFactoryAndroid::IsLegacyOrDeprecatedDevice(
VideoCaptureDeviceFactory*
VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory) {
return new VideoCaptureDeviceFactoryAndroid();
}
......
......@@ -113,10 +113,12 @@ bool CameraHalDispatcherImpl::StartThreads() {
return true;
}
bool CameraHalDispatcherImpl::Start() {
bool CameraHalDispatcherImpl::Start(
MojoJpegDecodeAcceleratorFactoryCB jda_factory) {
if (!StartThreads()) {
return false;
}
jda_factory_ = jda_factory;
base::WaitableEvent started(base::WaitableEvent::ResetPolicy::MANUAL,
base::WaitableEvent::InitialState::NOT_SIGNALED);
blocking_io_task_runner_->PostTask(
......@@ -192,6 +194,11 @@ void CameraHalDispatcherImpl::RegisterClient(
VLOG(1) << "Camera HAL client registered";
}
void CameraHalDispatcherImpl::GetJpegDecodeAccelerator(
media::mojom::JpegDecodeAcceleratorRequest jda_request) {
jda_factory_.Run(std::move(jda_request));
}
void CameraHalDispatcherImpl::CreateSocket(base::WaitableEvent* started) {
DCHECK(blocking_io_task_runner_->BelongsToCurrentThread());
......
......@@ -12,6 +12,7 @@
#include "base/threading/thread.h"
#include "media/capture/capture_export.h"
#include "media/capture/video/chromeos/mojo/arc_camera3_service.mojom.h"
#include "media/capture/video/video_capture_device_factory.h"
#include "mojo/edk/embedder/scoped_platform_handle.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/public/cpp/bindings/interface_ptr_set.h"
......@@ -46,7 +47,7 @@ class CAPTURE_EXPORT CameraHalDispatcherImpl final
public:
static CameraHalDispatcherImpl* GetInstance();
bool Start();
bool Start(MojoJpegDecodeAcceleratorFactoryCB jda_factory);
void AddClientObserver(std::unique_ptr<CameraClientObserver> observer);
......@@ -55,6 +56,8 @@ class CAPTURE_EXPORT CameraHalDispatcherImpl final
// CameraHalDispatcher implementations.
void RegisterServer(arc::mojom::CameraHalServerPtr server) final;
void RegisterClient(arc::mojom::CameraHalClientPtr client) final;
void GetJpegDecodeAccelerator(
media::mojom::JpegDecodeAcceleratorRequest jda_request) final;
private:
friend struct base::DefaultSingletonTraits<CameraHalDispatcherImpl>;
......@@ -103,6 +106,8 @@ class CAPTURE_EXPORT CameraHalDispatcherImpl final
std::set<std::unique_ptr<CameraClientObserver>> client_observers_;
MojoJpegDecodeAcceleratorFactoryCB jda_factory_;
DISALLOW_COPY_AND_ASSIGN(CameraHalDispatcherImpl);
};
......
......@@ -12,4 +12,8 @@ mojom("arc_camera3") {
"camera_metadata.mojom",
"camera_metadata_tags.mojom",
]
deps = [
"//media/mojo/interfaces",
]
}
......@@ -7,6 +7,7 @@
module arc.mojom;
import "media/capture/video/chromeos/mojo/camera_common.mojom";
import "media/mojo/interfaces/jpeg_decode_accelerator.mojom";
// The ARC++ camera HAL v3 Mojo dispatcher. The dispatcher acts as a proxy and
// waits for the server and the clients to register. There can only be one
......@@ -24,6 +25,10 @@ interface CameraHalDispatcher {
// A CameraHalClient calls RegisterClient to register itself with the
// dispatcher.
RegisterClient@1(CameraHalClient client);
// Get JpegDecodeAccelerator from dispatcher.
[MinVersion=1] GetJpegDecodeAccelerator@2(
media.mojom.JpegDecodeAccelerator& jda_request);
};
// The ARC++ camera HAL v3 Mojo server.
......
......@@ -19,10 +19,11 @@ gpu::GpuMemoryBufferManager* g_gpu_buffer_manager = nullptr;
VideoCaptureDeviceFactoryChromeOS::VideoCaptureDeviceFactoryChromeOS(
scoped_refptr<base::SingleThreadTaskRunner> task_runner_for_screen_observer,
gpu::GpuMemoryBufferManager* gpu_buffer_manager)
gpu::GpuMemoryBufferManager* gpu_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory)
: task_runner_for_screen_observer_(task_runner_for_screen_observer),
camera_hal_ipc_thread_("CameraHalIpcThread"),
initialized_(Init()) {
initialized_(Init(jda_factory)) {
g_gpu_buffer_manager = gpu_buffer_manager;
}
......@@ -84,14 +85,15 @@ void VideoCaptureDeviceFactoryChromeOS::SetBufferManagerForTesting(
g_gpu_buffer_manager = buffer_manager;
}
bool VideoCaptureDeviceFactoryChromeOS::Init() {
bool VideoCaptureDeviceFactoryChromeOS::Init(
MojoJpegDecodeAcceleratorFactoryCB jda_factory) {
if (!camera_hal_ipc_thread_.Start()) {
LOG(ERROR) << "Module thread failed to start";
return false;
}
if (!CameraHalDispatcherImpl::GetInstance()->IsStarted() &&
!CameraHalDispatcherImpl::GetInstance()->Start()) {
!CameraHalDispatcherImpl::GetInstance()->Start(jda_factory)) {
LOG(ERROR) << "Failed to start CameraHalDispatcherImpl";
return false;
}
......@@ -107,7 +109,8 @@ bool VideoCaptureDeviceFactoryChromeOS::Init() {
VideoCaptureDeviceFactory*
VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
scoped_refptr<base::SingleThreadTaskRunner> task_runner_for_screen_observer,
gpu::GpuMemoryBufferManager* gpu_buffer_manager) {
gpu::GpuMemoryBufferManager* gpu_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory) {
// On Chrome OS we have to support two use cases:
//
// 1. For devices that have the camera HAL v3 service running on Chrome OS,
......@@ -119,7 +122,7 @@ VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
// v3.
if (VideoCaptureDeviceFactoryChromeOS::ShouldEnable()) {
return new VideoCaptureDeviceFactoryChromeOS(
task_runner_for_screen_observer, gpu_buffer_manager);
task_runner_for_screen_observer, gpu_buffer_manager, jda_factory);
} else {
return new VideoCaptureDeviceFactoryLinux(task_runner_for_screen_observer);
}
......
......@@ -19,7 +19,8 @@ class CAPTURE_EXPORT VideoCaptureDeviceFactoryChromeOS final
explicit VideoCaptureDeviceFactoryChromeOS(
scoped_refptr<base::SingleThreadTaskRunner>
task_runner_for_screen_observer,
gpu::GpuMemoryBufferManager* gpu_buffer_manager);
gpu::GpuMemoryBufferManager* gpu_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory);
~VideoCaptureDeviceFactoryChromeOS() override;
......@@ -45,7 +46,7 @@ class CAPTURE_EXPORT VideoCaptureDeviceFactoryChromeOS final
private:
// Initializes the factory. The factory is functional only after this call
// succeeds.
bool Init();
bool Init(MojoJpegDecodeAcceleratorFactoryCB jda_factory);
const scoped_refptr<base::SingleThreadTaskRunner>
task_runner_for_screen_observer_;
......
......@@ -292,7 +292,8 @@ void VideoCaptureDeviceFactoryLinux::GetSupportedFormats(
VideoCaptureDeviceFactory*
VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory) {
return new VideoCaptureDeviceFactoryLinux(ui_task_runner);
}
#endif
......
......@@ -124,7 +124,8 @@ void VideoCaptureDeviceFactoryMac::GetSupportedFormats(
VideoCaptureDeviceFactory*
VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory) {
return new VideoCaptureDeviceFactoryMac();
}
......
......@@ -18,7 +18,8 @@ namespace media {
std::unique_ptr<VideoCaptureDeviceFactory>
VideoCaptureDeviceFactory::CreateFactory(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
gpu::GpuMemoryBufferManager* gpu_buffer_manager) {
gpu::GpuMemoryBufferManager* gpu_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory) {
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
// Use a Fake or File Video Device Factory if the command line flags are
......@@ -41,7 +42,8 @@ VideoCaptureDeviceFactory::CreateFactory(
// |ui_task_runner| is needed for the Linux ChromeOS factory to retrieve
// screen rotations.
return std::unique_ptr<VideoCaptureDeviceFactory>(
CreateVideoCaptureDeviceFactory(ui_task_runner, gpu_buffer_manager));
CreateVideoCaptureDeviceFactory(ui_task_runner, gpu_buffer_manager,
jda_factory));
}
}
......@@ -57,7 +59,8 @@ VideoCaptureDeviceFactory::~VideoCaptureDeviceFactory() = default;
VideoCaptureDeviceFactory*
VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
gpu::GpuMemoryBufferManager* gpu_buffer_manager) {
gpu::GpuMemoryBufferManager* gpu_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory) {
NOTIMPLEMENTED();
return NULL;
}
......
......@@ -10,9 +10,13 @@
#include "base/threading/thread_checker.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "media/capture/video/video_capture_device.h"
#include "media/mojo/interfaces/jpeg_decode_accelerator.mojom.h"
namespace media {
using MojoJpegDecodeAcceleratorFactoryCB =
base::RepeatingCallback<void(media::mojom::JpegDecodeAcceleratorRequest)>;
// VideoCaptureDeviceFactory is the base class for creation of video capture
// devices in the different platforms. VCDFs are created by MediaStreamManager
// on UI thread and plugged into VideoCaptureManager, who owns and operates them
......@@ -29,7 +33,8 @@ class CAPTURE_EXPORT VideoCaptureDeviceFactory {
public:
static std::unique_ptr<VideoCaptureDeviceFactory> CreateFactory(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
gpu::GpuMemoryBufferManager* gpu_buffer_manager);
gpu::GpuMemoryBufferManager* gpu_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jpeg_decoder_factory);
VideoCaptureDeviceFactory();
virtual ~VideoCaptureDeviceFactory();
......@@ -59,7 +64,8 @@ class CAPTURE_EXPORT VideoCaptureDeviceFactory {
private:
static VideoCaptureDeviceFactory* CreateVideoCaptureDeviceFactory(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
gpu::GpuMemoryBufferManager* gpu_buffer_manager);
gpu::GpuMemoryBufferManager* gpu_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory);
DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactory);
};
......
......@@ -293,11 +293,12 @@ class VideoCaptureDeviceTest
video_capture_device_factory_(VideoCaptureDeviceFactory::CreateFactory(
base::ThreadTaskRunnerHandle::Get(),
#if defined(OS_CHROMEOS)
local_gpu_memory_buffer_manager_.get()
local_gpu_memory_buffer_manager_.get(),
#else
nullptr
nullptr,
#endif
)) {
base::BindRepeating(
[](media::mojom::JpegDecodeAcceleratorRequest) {}))) {
}
void SetUp() override {
......
......@@ -398,7 +398,8 @@ void VideoCaptureDeviceFactoryWin::GetSupportedFormats(
VideoCaptureDeviceFactory*
VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
MojoJpegDecodeAcceleratorFactoryCB jda_factory) {
return new VideoCaptureDeviceFactoryWin();
}
......
......@@ -51,6 +51,21 @@ interface JpegDecodeAccelerator {
handle<shared_buffer> output_handle, uint32 output_buffer_size)
=> (int32 bitstream_buffer_id, DecodeError error);
// Decodes the given buffer that contains one JPEG image.
// |input_fd| and |output_fd| are file descriptors of shared memory.
// The image is decoded from memory of |input_fd|
// with size |input_buffer_size|. The input buffer is associated with
// |buffer_id| and the size of JPEG image is |coded_size|. Decoded I420
// frame data will be put onto memory associated with |output_fd|
// with allocated size |output_buffer_size|.
// Returns |buffer_id| and |error| in a callback to notify the
// decode status. |buffer_id| is the id of |input_buffer| and |error| is the
// error code.
DecodeWithFD(int32 buffer_id, handle input_fd, uint32 input_buffer_size,
int32 coded_size_width, int32 coded_size_height,
handle output_fd, uint32 output_buffer_size)
=> (int32 buffer_id, DecodeError error);
// TODO(c.padhi): This method might not be required, see
// http://crbug.com/699255.
Uninitialize();
......
......@@ -42,9 +42,11 @@ bool VerifyDecodeParams(const gfx::Size& coded_size,
return false;
}
if (output_buffer_size <
media::VideoFrame::AllocationSize(media::PIXEL_FORMAT_I420, coded_size)) {
LOG(ERROR) << "output_buffer_size is too small: " << output_buffer_size;
uint32_t allocation_size =
media::VideoFrame::AllocationSize(media::PIXEL_FORMAT_I420, coded_size);
if (output_buffer_size < allocation_size) {
DLOG(ERROR) << "output_buffer_size is too small: " << output_buffer_size
<< ". It needs: " << allocation_size;
return false;
}
......@@ -101,7 +103,7 @@ void MojoJpegDecodeAcceleratorService::Initialize(InitializeCallback callback) {
}
if (!accelerator) {
DLOG(ERROR) << "JPEG accelerator Initialize failed";
DLOG(ERROR) << "JPEG accelerator initialization failed";
std::move(callback).Run(false);
return;
}
......@@ -119,8 +121,8 @@ void MojoJpegDecodeAcceleratorService::Decode(
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
TRACE_EVENT0("jpeg", "MojoJpegDecodeAcceleratorService::Decode");
DCHECK(!decode_cb_);
decode_cb_ = std::move(callback);
DCHECK_EQ(decode_cb_map_.count(input_buffer.id()), 0u);
decode_cb_map_[input_buffer.id()] = std::move(callback);
if (!VerifyDecodeParams(coded_size, &output_handle, output_buffer_size)) {
NotifyDecodeStatus(input_buffer.id(),
......@@ -168,6 +170,57 @@ void MojoJpegDecodeAcceleratorService::Decode(
accelerator_->Decode(input_buffer, frame);
}
void MojoJpegDecodeAcceleratorService::DecodeWithFD(
int32_t buffer_id,
mojo::ScopedHandle input_handle,
uint32_t input_buffer_size,
int32_t coded_size_width,
int32_t coded_size_height,
mojo::ScopedHandle output_handle,
uint32_t output_buffer_size,
DecodeWithFDCallback callback) {
#if defined(OS_CHROMEOS)
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
base::PlatformFile input_fd;
base::PlatformFile output_fd;
MojoResult result;
result = mojo::UnwrapPlatformFile(std::move(input_handle), &input_fd);
if (result != MOJO_RESULT_OK) {
std::move(callback).Run(
buffer_id, ::media::JpegDecodeAccelerator::Error::PLATFORM_FAILURE);
return;
}
result = mojo::UnwrapPlatformFile(std::move(output_handle), &output_fd);
if (result != MOJO_RESULT_OK) {
std::move(callback).Run(
buffer_id, ::media::JpegDecodeAccelerator::Error::PLATFORM_FAILURE);
return;
}
base::UnguessableToken guid = base::UnguessableToken::Create();
base::SharedMemoryHandle input_shm_handle(
base::FileDescriptor(input_fd, true), 0u, guid);
base::SharedMemoryHandle output_shm_handle(
base::FileDescriptor(output_fd, true), 0u, guid);
media::BitstreamBuffer in_buffer(buffer_id, input_shm_handle,
input_buffer_size);
gfx::Size coded_size(coded_size_width, coded_size_height);
mojo::ScopedSharedBufferHandle output_scoped_handle =
mojo::WrapSharedMemoryHandle(
output_shm_handle, output_buffer_size,
mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite);
Decode(in_buffer, coded_size, std::move(output_scoped_handle),
output_buffer_size, std::move(callback));
#else
NOTREACHED();
#endif
}
void MojoJpegDecodeAcceleratorService::Uninitialize() {
// TODO(c.padhi): see http://crbug.com/699255.
NOTIMPLEMENTED();
......@@ -177,8 +230,12 @@ void MojoJpegDecodeAcceleratorService::NotifyDecodeStatus(
int32_t bitstream_buffer_id,
::media::JpegDecodeAccelerator::Error error) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(decode_cb_);
std::move(decode_cb_).Run(bitstream_buffer_id, error);
auto iter = decode_cb_map_.find(bitstream_buffer_id);
DCHECK(iter != decode_cb_map_.end());
DecodeCallback decode_cb = std::move(iter->second);
decode_cb_map_.erase(iter);
std::move(decode_cb).Run(bitstream_buffer_id, error);
}
} // namespace media
......@@ -35,6 +35,8 @@ class MEDIA_MOJO_EXPORT MojoJpegDecodeAcceleratorService
::media::JpegDecodeAccelerator::Error error) override;
private:
using DecodeCallbackMap = std::unordered_map<int32_t, DecodeCallback>;
// This constructor internally calls
// GpuJpegDecodeAcceleratorFactory::GetAcceleratorFactories() to
// fill |accelerator_factory_functions_|.
......@@ -47,6 +49,14 @@ class MEDIA_MOJO_EXPORT MojoJpegDecodeAcceleratorService
mojo::ScopedSharedBufferHandle output_handle,
uint32_t output_buffer_size,
DecodeCallback callback) override;
void DecodeWithFD(int32_t buffer_id,
mojo::ScopedHandle input_fd,
uint32_t input_buffer_size,
int32_t coded_size_width,
int32_t coded_size_height,
mojo::ScopedHandle output_fd,
uint32_t output_buffer_size,
DecodeWithFDCallback callback) override;
void Uninitialize() override;
void NotifyDecodeStatus(int32_t bitstream_buffer_id,
......@@ -55,7 +65,8 @@ class MEDIA_MOJO_EXPORT MojoJpegDecodeAcceleratorService
const std::vector<GpuJpegDecodeAcceleratorFactory::CreateAcceleratorCB>
accelerator_factory_functions_;
DecodeCallback decode_cb_;
// A map from bitstream_buffer_id to DecodeCallback.
DecodeCallbackMap decode_cb_map_;
std::unique_ptr<::media::JpegDecodeAccelerator> accelerator_;
......
......@@ -56,8 +56,11 @@ void DeviceFactoryProviderImpl::LazyInitializeDeviceFactory() {
base::ThreadTaskRunnerHandle::Get(),
// TODO(jcliang): Create a GpuMemoryBufferManager from GpuService
// here.
nullptr);
auto video_capture_system = std::make_unique<media::VideoCaptureSystemImpl>(
nullptr,
// TODO(mojahsu): Create a GpuJpegDecoderMojoFactoryCB here.
base::BindRepeating(
[](media::mojom::JpegDecodeAcceleratorRequest) {}));
auto video_capture_system = base::MakeUnique<media::VideoCaptureSystemImpl>(
std::move(media_device_factory));
device_factory_ = std::make_unique<VirtualDeviceEnabledDeviceFactory>(
......
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