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

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

Issue 1313913003: Begin refactor of AVDA to support zero-copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl feedback + rebased. Created 5 years, 3 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
« no previous file with comments | « content/common/gpu/media/avda_return_on_failure.h ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 28 matching lines...) Expand all
39 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" 39 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h"
40 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" 40 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
41 #endif 41 #endif
42 #if defined(ARCH_CPU_X86_FAMILY) 42 #if defined(ARCH_CPU_X86_FAMILY)
43 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" 43 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
44 #include "ui/gl/gl_implementation.h" 44 #include "ui/gl/gl_implementation.h"
45 #endif 45 #endif
46 #elif defined(USE_OZONE) 46 #elif defined(USE_OZONE)
47 #include "media/ozone/media_ozone_platform.h" 47 #include "media/ozone/media_ozone_platform.h"
48 #elif defined(OS_ANDROID) 48 #elif defined(OS_ANDROID)
49 #include "content/common/gpu/media/android_copying_backing_strategy.h"
49 #include "content/common/gpu/media/android_video_decode_accelerator.h" 50 #include "content/common/gpu/media/android_video_decode_accelerator.h"
50 #endif 51 #endif
51 52
52 #include "ui/gfx/geometry/size.h" 53 #include "ui/gfx/geometry/size.h"
53 54
54 namespace content { 55 namespace content {
55 56
56 static bool MakeDecoderContextCurrent( 57 static bool MakeDecoderContextCurrent(
57 const base::WeakPtr<GpuCommandBufferStub> stub) { 58 const base::WeakPtr<GpuCommandBufferStub> stub) {
58 if (!stub) { 59 if (!stub) {
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 decoder.reset(platform->CreateVideoDecodeAccelerator(make_context_current_)); 375 decoder.reset(platform->CreateVideoDecodeAccelerator(make_context_current_));
375 #endif 376 #endif
376 return decoder.Pass(); 377 return decoder.Pass();
377 } 378 }
378 379
379 scoped_ptr<media::VideoDecodeAccelerator> 380 scoped_ptr<media::VideoDecodeAccelerator>
380 GpuVideoDecodeAccelerator::CreateAndroidVDA() { 381 GpuVideoDecodeAccelerator::CreateAndroidVDA() {
381 scoped_ptr<media::VideoDecodeAccelerator> decoder; 382 scoped_ptr<media::VideoDecodeAccelerator> decoder;
382 #if defined(OS_ANDROID) 383 #if defined(OS_ANDROID)
383 decoder.reset(new AndroidVideoDecodeAccelerator( 384 decoder.reset(new AndroidVideoDecodeAccelerator(
384 stub_->decoder()->AsWeakPtr(), 385 stub_->decoder()->AsWeakPtr(), make_context_current_,
385 make_context_current_)); 386 make_scoped_ptr(new AndroidCopyingBackingStrategy())));
386 #endif 387 #endif
387 return decoder.Pass(); 388 return decoder.Pass();
388 } 389 }
389 390
390 // static 391 // static
391 gpu::VideoDecodeAcceleratorSupportedProfiles 392 gpu::VideoDecodeAcceleratorSupportedProfiles
392 GpuVideoDecodeAccelerator::GetSupportedProfiles() { 393 GpuVideoDecodeAccelerator::GetSupportedProfiles() {
393 media::VideoDecodeAccelerator::SupportedProfiles profiles; 394 media::VideoDecodeAccelerator::SupportedProfiles profiles;
394 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); 395 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
395 if (cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) 396 if (cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 return stub_->channel()->Send(message); 611 return stub_->channel()->Send(message);
611 } 612 }
612 613
613 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 614 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
614 bool succeeded) { 615 bool succeeded) {
615 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 616 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
616 Send(message); 617 Send(message);
617 } 618 }
618 619
619 } // namespace content 620 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/avda_return_on_failure.h ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698