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

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

Issue 2864603002: Provide callback to create mojo AndroidOverlays to AVDA. (Closed)
Patch Set: fixed tests 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 BitstreamRecord&& other) 232 BitstreamRecord&& other)
233 : buffer(std::move(other.buffer)), memory(std::move(other.memory)) {} 233 : buffer(std::move(other.buffer)), memory(std::move(other.memory)) {}
234 234
235 AndroidVideoDecodeAccelerator::BitstreamRecord::~BitstreamRecord() {} 235 AndroidVideoDecodeAccelerator::BitstreamRecord::~BitstreamRecord() {}
236 236
237 AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator( 237 AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator(
238 AVDACodecAllocator* codec_allocator, 238 AVDACodecAllocator* codec_allocator,
239 std::unique_ptr<AndroidVideoSurfaceChooser> surface_chooser, 239 std::unique_ptr<AndroidVideoSurfaceChooser> surface_chooser,
240 const MakeGLContextCurrentCallback& make_context_current_cb, 240 const MakeGLContextCurrentCallback& make_context_current_cb,
241 const GetGLES2DecoderCallback& get_gles2_decoder_cb, 241 const GetGLES2DecoderCallback& get_gles2_decoder_cb,
242 const AndroidOverlayMojoFactoryCB& overlay_factory_cb,
242 const PlatformConfig& platform_config) 243 const PlatformConfig& platform_config)
243 : client_(nullptr), 244 : client_(nullptr),
244 codec_allocator_(codec_allocator), 245 codec_allocator_(codec_allocator),
245 make_context_current_cb_(make_context_current_cb), 246 make_context_current_cb_(make_context_current_cb),
246 get_gles2_decoder_cb_(get_gles2_decoder_cb), 247 get_gles2_decoder_cb_(get_gles2_decoder_cb),
247 state_(BEFORE_OVERLAY_INIT), 248 state_(BEFORE_OVERLAY_INIT),
248 picturebuffers_requested_(false), 249 picturebuffers_requested_(false),
249 picture_buffer_manager_(this), 250 picture_buffer_manager_(this),
250 media_drm_bridge_cdm_context_(nullptr), 251 media_drm_bridge_cdm_context_(nullptr),
251 cdm_registration_id_(0), 252 cdm_registration_id_(0),
252 pending_input_buf_index_(-1), 253 pending_input_buf_index_(-1),
253 during_initialize_(false), 254 during_initialize_(false),
254 deferred_initialization_pending_(false), 255 deferred_initialization_pending_(false),
255 codec_needs_reset_(false), 256 codec_needs_reset_(false),
256 defer_surface_creation_(false), 257 defer_surface_creation_(false),
257 surface_chooser_(std::move(surface_chooser)), 258 surface_chooser_(std::move(surface_chooser)),
258 platform_config_(platform_config), 259 platform_config_(platform_config),
260 overlay_factory_cb_(overlay_factory_cb),
259 weak_this_factory_(this) {} 261 weak_this_factory_(this) {}
260 262
261 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() { 263 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() {
262 DCHECK(thread_checker_.CalledOnValidThread()); 264 DCHECK(thread_checker_.CalledOnValidThread());
263 GetManager()->StopTimer(this); 265 GetManager()->StopTimer(this);
264 codec_allocator_->StopThread(this); 266 codec_allocator_->StopThread(this);
265 267
266 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 268 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
267 if (!media_drm_bridge_cdm_context_) 269 if (!media_drm_bridge_cdm_context_)
268 return; 270 return;
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 codec_allocator_->ReleaseMediaCodec(std::move(media_codec_), 1677 codec_allocator_->ReleaseMediaCodec(std::move(media_codec_),
1676 codec_config_->surface_bundle); 1678 codec_config_->surface_bundle);
1677 } 1679 }
1678 1680
1679 void AndroidVideoDecodeAccelerator::ReleaseCodecAndBundle() { 1681 void AndroidVideoDecodeAccelerator::ReleaseCodecAndBundle() {
1680 ReleaseCodec(); 1682 ReleaseCodec();
1681 codec_config_->surface_bundle = nullptr; 1683 codec_config_->surface_bundle = nullptr;
1682 } 1684 }
1683 1685
1684 } // namespace media 1686 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698