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

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 808973004: GVDA, vdatest: Enable V4L2SliceVideoDecodeAccelerator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vp8_slice_based
Patch Set: Created 5 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/common/gpu/media/gpu_video_decode_accelerator.h" 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 12 matching lines...) Expand all
23 #include "media/base/limits.h" 23 #include "media/base/limits.h"
24 #include "ui/gl/gl_context.h" 24 #include "ui/gl/gl_context.h"
25 #include "ui/gl/gl_surface_egl.h" 25 #include "ui/gl/gl_surface_egl.h"
26 26
27 #if defined(OS_WIN) 27 #if defined(OS_WIN)
28 #include "base/win/windows_version.h" 28 #include "base/win/windows_version.h"
29 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" 29 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
30 #elif defined(OS_MACOSX) 30 #elif defined(OS_MACOSX)
31 #include "content/common/gpu/media/vt_video_decode_accelerator.h" 31 #include "content/common/gpu/media/vt_video_decode_accelerator.h"
32 #elif defined(OS_CHROMEOS) 32 #elif defined(OS_CHROMEOS)
33 #if defined(ARCH_CPU_ARMEL)
34 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h"
35 #endif // defined(ARCH_CPU_ARMEL)
33 #if defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC)) 36 #if defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC))
34 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" 37 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
35 #include "content/common/gpu/media/v4l2_video_device.h" 38 #include "content/common/gpu/media/v4l2_video_device.h"
36 // defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC)) 39 // defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC))
37 #endif 40 #endif
38 #if defined(ARCH_CPU_X86_FAMILY) 41 #if defined(ARCH_CPU_X86_FAMILY)
39 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" 42 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
40 #include "ui/gl/gl_implementation.h" 43 #include "ui/gl/gl_implementation.h"
41 #endif // defined(ARCH_CPU_X86_FAMILY) 44 #endif // defined(ARCH_CPU_X86_FAMILY)
42 #elif defined(USE_OZONE) 45 #elif defined(USE_OZONE)
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 video_decode_accelerator_.reset(); 271 video_decode_accelerator_.reset();
269 NOTIMPLEMENTED() << "HW video decode acceleration not available."; 272 NOTIMPLEMENTED() << "HW video decode acceleration not available.";
270 SendCreateDecoderReply(init_done_msg, false); 273 SendCreateDecoderReply(init_done_msg, false);
271 } 274 }
272 275
273 std::vector<GpuVideoDecodeAccelerator::CreateVDAFp> 276 std::vector<GpuVideoDecodeAccelerator::CreateVDAFp>
274 GpuVideoDecodeAccelerator::CreateVDAFps() { 277 GpuVideoDecodeAccelerator::CreateVDAFps() {
275 std::vector<GpuVideoDecodeAccelerator::CreateVDAFp> create_vda_fps; 278 std::vector<GpuVideoDecodeAccelerator::CreateVDAFp> create_vda_fps;
276 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateDXVAVDA); 279 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateDXVAVDA);
277 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateV4L2VDA); 280 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateV4L2VDA);
281 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateV4L2SliceVDA);
278 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateVaapiVDA); 282 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateVaapiVDA);
279 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateVTVDA); 283 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateVTVDA);
280 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateOzoneVDA); 284 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateOzoneVDA);
281 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateAndroidVDA); 285 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateAndroidVDA);
282 return create_vda_fps; 286 return create_vda_fps;
283 } 287 }
284 288
285 scoped_ptr<media::VideoDecodeAccelerator> 289 scoped_ptr<media::VideoDecodeAccelerator>
286 GpuVideoDecodeAccelerator::CreateDXVAVDA() { 290 GpuVideoDecodeAccelerator::CreateDXVAVDA() {
287 scoped_ptr<media::VideoDecodeAccelerator> decoder; 291 scoped_ptr<media::VideoDecodeAccelerator> decoder;
(...skipping 21 matching lines...) Expand all
309 weak_factory_for_io_.GetWeakPtr(), 313 weak_factory_for_io_.GetWeakPtr(),
310 make_context_current_, 314 make_context_current_,
311 device, 315 device,
312 io_message_loop_)); 316 io_message_loop_));
313 } 317 }
314 #endif 318 #endif
315 return decoder.Pass(); 319 return decoder.Pass();
316 } 320 }
317 321
318 scoped_ptr<media::VideoDecodeAccelerator> 322 scoped_ptr<media::VideoDecodeAccelerator>
323 GpuVideoDecodeAccelerator::CreateV4L2SliceVDA() {
324 scoped_ptr<media::VideoDecodeAccelerator> decoder;
325 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
326 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
327 if (device.get()) {
328 decoder.reset(new V4L2SliceVideoDecodeAccelerator(
329 device,
330 gfx::GLSurfaceEGL::GetHardwareDisplay(),
331 stub_->decoder()->GetGLContext()->GetHandle(),
332 weak_factory_for_io_.GetWeakPtr(),
333 make_context_current_,
334 io_message_loop_));
335 }
336 #endif
337 return decoder.Pass();
338 }
339
340 scoped_ptr<media::VideoDecodeAccelerator>
319 GpuVideoDecodeAccelerator::CreateVaapiVDA() { 341 GpuVideoDecodeAccelerator::CreateVaapiVDA() {
320 scoped_ptr<media::VideoDecodeAccelerator> decoder; 342 scoped_ptr<media::VideoDecodeAccelerator> decoder;
321 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 343 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
322 decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_)); 344 decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_));
323 #endif 345 #endif
324 return decoder.Pass(); 346 return decoder.Pass();
325 } 347 }
326 348
327 scoped_ptr<media::VideoDecodeAccelerator> 349 scoped_ptr<media::VideoDecodeAccelerator>
328 GpuVideoDecodeAccelerator::CreateVTVDA() { 350 GpuVideoDecodeAccelerator::CreateVTVDA() {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 return stub_->channel()->Send(message); 578 return stub_->channel()->Send(message);
557 } 579 }
558 580
559 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 581 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
560 bool succeeded) { 582 bool succeeded) {
561 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 583 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
562 Send(message); 584 Send(message);
563 } 585 }
564 586
565 } // namespace content 587 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698