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

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

Issue 2864603002: Provide callback to create mojo AndroidOverlays to AVDA. (Closed)
Patch Set: rebased Created 3 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/android_video_decode_accelerator.h" 5 #include "media/gpu/android_video_decode_accelerator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 BitstreamRecord&& other) 235 BitstreamRecord&& other)
236 : buffer(std::move(other.buffer)), memory(std::move(other.memory)) {} 236 : buffer(std::move(other.buffer)), memory(std::move(other.memory)) {}
237 237
238 AndroidVideoDecodeAccelerator::BitstreamRecord::~BitstreamRecord() {} 238 AndroidVideoDecodeAccelerator::BitstreamRecord::~BitstreamRecord() {}
239 239
240 AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator( 240 AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator(
241 AVDACodecAllocator* codec_allocator, 241 AVDACodecAllocator* codec_allocator,
242 std::unique_ptr<AndroidVideoSurfaceChooser> surface_chooser, 242 std::unique_ptr<AndroidVideoSurfaceChooser> surface_chooser,
243 const MakeGLContextCurrentCallback& make_context_current_cb, 243 const MakeGLContextCurrentCallback& make_context_current_cb,
244 const GetGLES2DecoderCallback& get_gles2_decoder_cb, 244 const GetGLES2DecoderCallback& get_gles2_decoder_cb,
245 const AndroidOverlayMojoFactoryCB& overlay_factory_cb,
245 const PlatformConfig& platform_config) 246 const PlatformConfig& platform_config)
246 : client_(nullptr), 247 : client_(nullptr),
247 codec_allocator_(codec_allocator), 248 codec_allocator_(codec_allocator),
248 make_context_current_cb_(make_context_current_cb), 249 make_context_current_cb_(make_context_current_cb),
249 get_gles2_decoder_cb_(get_gles2_decoder_cb), 250 get_gles2_decoder_cb_(get_gles2_decoder_cb),
250 state_(BEFORE_OVERLAY_INIT), 251 state_(BEFORE_OVERLAY_INIT),
251 picturebuffers_requested_(false), 252 picturebuffers_requested_(false),
252 picture_buffer_manager_(this), 253 picture_buffer_manager_(this),
253 media_drm_bridge_cdm_context_(nullptr), 254 media_drm_bridge_cdm_context_(nullptr),
254 cdm_registration_id_(0), 255 cdm_registration_id_(0),
255 pending_input_buf_index_(-1), 256 pending_input_buf_index_(-1),
256 during_initialize_(false), 257 during_initialize_(false),
257 deferred_initialization_pending_(false), 258 deferred_initialization_pending_(false),
258 codec_needs_reset_(false), 259 codec_needs_reset_(false),
259 defer_surface_creation_(false), 260 defer_surface_creation_(false),
260 surface_chooser_(std::move(surface_chooser)), 261 surface_chooser_(std::move(surface_chooser)),
261 platform_config_(platform_config), 262 platform_config_(platform_config),
263 overlay_factory_cb_(overlay_factory_cb),
262 weak_this_factory_(this) {} 264 weak_this_factory_(this) {}
263 265
264 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() { 266 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() {
265 DCHECK(thread_checker_.CalledOnValidThread()); 267 DCHECK(thread_checker_.CalledOnValidThread());
266 GetManager()->StopTimer(this); 268 GetManager()->StopTimer(this);
267 codec_allocator_->StopThread(this); 269 codec_allocator_->StopThread(this);
268 270
269 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 271 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
270 if (!media_drm_bridge_cdm_context_) 272 if (!media_drm_bridge_cdm_context_)
271 return; 273 return;
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1678 codec_allocator_->ReleaseMediaCodec(std::move(media_codec_), 1680 codec_allocator_->ReleaseMediaCodec(std::move(media_codec_),
1679 codec_config_->surface_bundle); 1681 codec_config_->surface_bundle);
1680 } 1682 }
1681 1683
1682 void AndroidVideoDecodeAccelerator::ReleaseCodecAndBundle() { 1684 void AndroidVideoDecodeAccelerator::ReleaseCodecAndBundle() {
1683 ReleaseCodec(); 1685 ReleaseCodec();
1684 codec_config_->surface_bundle = nullptr; 1686 codec_config_->surface_bundle = nullptr;
1685 } 1687 }
1686 1688
1687 } // namespace media 1689 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/android_video_decode_accelerator.h ('k') | media/gpu/android_video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698