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

Side by Side Diff: media/gpu/gpu_video_decode_accelerator_factory.cc

Issue 2662173002: media: Don't create a new MediaCodec during AVDA teardown (Closed)
Patch Set: rebase Created 3 years, 10 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 | « media/gpu/avda_codec_allocator.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/gpu_video_decode_accelerator_factory.h" 5 #include "media/gpu/gpu_video_decode_accelerator_factory.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "gpu/command_buffer/service/gpu_preferences.h" 8 #include "gpu/command_buffer/service/gpu_preferences.h"
9 #include "media/base/media_switches.h" 9 #include "media/base/media_switches.h"
10 #include "media/gpu/gpu_video_accelerator_util.h" 10 #include "media/gpu/gpu_video_accelerator_util.h"
(...skipping 11 matching lines...) Expand all
22 #include "media/gpu/v4l2_slice_video_decode_accelerator.h" 22 #include "media/gpu/v4l2_slice_video_decode_accelerator.h"
23 #include "media/gpu/v4l2_video_decode_accelerator.h" 23 #include "media/gpu/v4l2_video_decode_accelerator.h"
24 #include "ui/gl/gl_surface_egl.h" 24 #include "ui/gl/gl_surface_egl.h"
25 #endif 25 #endif
26 #if defined(ARCH_CPU_X86_FAMILY) 26 #if defined(ARCH_CPU_X86_FAMILY)
27 #include "media/gpu/vaapi_video_decode_accelerator.h" 27 #include "media/gpu/vaapi_video_decode_accelerator.h"
28 #include "ui/gl/gl_implementation.h" 28 #include "ui/gl/gl_implementation.h"
29 #endif 29 #endif
30 #elif defined(OS_ANDROID) 30 #elif defined(OS_ANDROID)
31 #include "media/gpu/android_video_decode_accelerator.h" 31 #include "media/gpu/android_video_decode_accelerator.h"
32 #include "media/gpu/avda_codec_allocator.h"
32 #endif 33 #endif
33 34
34 namespace media { 35 namespace media {
35 36
36 // static 37 // static
37 MEDIA_GPU_EXPORT std::unique_ptr<GpuVideoDecodeAcceleratorFactory> 38 MEDIA_GPU_EXPORT std::unique_ptr<GpuVideoDecodeAcceleratorFactory>
38 GpuVideoDecodeAcceleratorFactory::Create( 39 GpuVideoDecodeAcceleratorFactory::Create(
39 const GetGLContextCallback& get_gl_context_cb, 40 const GetGLContextCallback& get_gl_context_cb,
40 const MakeGLContextCurrentCallback& make_context_current_cb, 41 const MakeGLContextCurrentCallback& make_context_current_cb,
41 const BindGLImageCallback& bind_image_cb) { 42 const BindGLImageCallback& bind_image_cb) {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 return decoder; 241 return decoder;
241 } 242 }
242 #endif 243 #endif
243 244
244 #if defined(OS_ANDROID) 245 #if defined(OS_ANDROID)
245 std::unique_ptr<VideoDecodeAccelerator> 246 std::unique_ptr<VideoDecodeAccelerator>
246 GpuVideoDecodeAcceleratorFactory::CreateAndroidVDA( 247 GpuVideoDecodeAcceleratorFactory::CreateAndroidVDA(
247 const gpu::GpuDriverBugWorkarounds& workarounds, 248 const gpu::GpuDriverBugWorkarounds& workarounds,
248 const gpu::GpuPreferences& gpu_preferences) const { 249 const gpu::GpuPreferences& gpu_preferences) const {
249 std::unique_ptr<VideoDecodeAccelerator> decoder; 250 std::unique_ptr<VideoDecodeAccelerator> decoder;
250 decoder.reset(new AndroidVideoDecodeAccelerator(make_context_current_cb_, 251 decoder.reset(new AndroidVideoDecodeAccelerator(
251 get_gles2_decoder_cb_)); 252 AVDACodecAllocator::Instance(), make_context_current_cb_,
253 get_gles2_decoder_cb_));
252 return decoder; 254 return decoder;
253 } 255 }
254 #endif 256 #endif
255 257
256 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( 258 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory(
257 const GetGLContextCallback& get_gl_context_cb, 259 const GetGLContextCallback& get_gl_context_cb,
258 const MakeGLContextCurrentCallback& make_context_current_cb, 260 const MakeGLContextCurrentCallback& make_context_current_cb,
259 const BindGLImageCallback& bind_image_cb, 261 const BindGLImageCallback& bind_image_cb,
260 const GetGLES2DecoderCallback& get_gles2_decoder_cb) 262 const GetGLES2DecoderCallback& get_gles2_decoder_cb)
261 : get_gl_context_cb_(get_gl_context_cb), 263 : get_gl_context_cb_(get_gl_context_cb),
262 make_context_current_cb_(make_context_current_cb), 264 make_context_current_cb_(make_context_current_cb),
263 bind_image_cb_(bind_image_cb), 265 bind_image_cb_(bind_image_cb),
264 get_gles2_decoder_cb_(get_gles2_decoder_cb) {} 266 get_gles2_decoder_cb_(get_gles2_decoder_cb) {}
265 267
266 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} 268 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {}
267 269
268 } // namespace media 270 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/avda_codec_allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698