Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: media/gpu/ipc/service/gpu_video_encode_accelerator.cc

Issue 2398883002: Add support for multiple V4L2 video devices of the same type. (Closed)
Patch Set: comments addressed Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/gpu/ipc/service/gpu_video_encode_accelerator.h" 5 #include "media/gpu/ipc/service/gpu_video_encode_accelerator.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 if (!stub->decoder()->MakeCurrent()) { 55 if (!stub->decoder()->MakeCurrent()) {
56 DLOG(ERROR) << "Failed to MakeCurrent()"; 56 DLOG(ERROR) << "Failed to MakeCurrent()";
57 return false; 57 return false;
58 } 58 }
59 59
60 return true; 60 return true;
61 } 61 }
62 62
63 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) 63 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
64 std::unique_ptr<VideoEncodeAccelerator> CreateV4L2VEA() { 64 std::unique_ptr<VideoEncodeAccelerator> CreateV4L2VEA() {
65 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kEncoder); 65 scoped_refptr<V4L2Device> device = V4L2Device::Create();
66 if (!device) 66 if (!device)
67 return nullptr; 67 return nullptr;
68 return base::WrapUnique<VideoEncodeAccelerator>( 68 return base::WrapUnique<VideoEncodeAccelerator>(
69 new V4L2VideoEncodeAccelerator(device)); 69 new V4L2VideoEncodeAccelerator(device));
70 } 70 }
71 #endif 71 #endif
72 72
73 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 73 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
74 std::unique_ptr<VideoEncodeAccelerator> CreateVaapiVEA() { 74 std::unique_ptr<VideoEncodeAccelerator> CreateVaapiVEA() {
75 return base::WrapUnique<VideoEncodeAccelerator>( 75 return base::WrapUnique<VideoEncodeAccelerator>(
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 Send(new AcceleratedVideoEncoderHostMsg_NotifyInputDone(host_route_id_, 366 Send(new AcceleratedVideoEncoderHostMsg_NotifyInputDone(host_route_id_,
367 frame_id)); 367 frame_id));
368 // Just let |shm| fall out of scope. 368 // Just let |shm| fall out of scope.
369 } 369 }
370 370
371 void GpuVideoEncodeAccelerator::Send(IPC::Message* message) { 371 void GpuVideoEncodeAccelerator::Send(IPC::Message* message) {
372 stub_->channel()->Send(message); 372 stub_->channel()->Send(message);
373 } 373 }
374 374
375 } // namespace media 375 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698