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

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: fixed unit test. 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
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(),
385 make_context_current_)); 386 make_context_current_,
387 scoped_ptr<AndroidVideoDecodeAccelerator::BackingStrategy>(
388 new AndroidCopyingBackingStrategy())));
386 #endif 389 #endif
387 return decoder.Pass(); 390 return decoder.Pass();
388 } 391 }
389 392
390 // static 393 // static
391 gpu::VideoDecodeAcceleratorSupportedProfiles 394 gpu::VideoDecodeAcceleratorSupportedProfiles
392 GpuVideoDecodeAccelerator::GetSupportedProfiles() { 395 GpuVideoDecodeAccelerator::GetSupportedProfiles() {
393 media::VideoDecodeAccelerator::SupportedProfiles profiles; 396 media::VideoDecodeAccelerator::SupportedProfiles profiles;
394 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); 397 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
395 if (cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) 398 if (cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 return stub_->channel()->Send(message); 613 return stub_->channel()->Send(message);
611 } 614 }
612 615
613 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 616 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
614 bool succeeded) { 617 bool succeeded) {
615 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 618 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
616 Send(message); 619 Send(message);
617 } 620 }
618 621
619 } // namespace content 622 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698