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

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

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 | « no previous file | media/gpu/android_video_decode_accelerator.cc » ('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) 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 #ifndef MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 28 matching lines...) Expand all
39 // output buffers to PictureBuffers to AVDAPictureBufferManager. 39 // output buffers to PictureBuffers to AVDAPictureBufferManager.
40 class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator 40 class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
41 : public VideoDecodeAccelerator, 41 : public VideoDecodeAccelerator,
42 public AVDAStateProvider, 42 public AVDAStateProvider,
43 public AVDACodecAllocatorClient { 43 public AVDACodecAllocatorClient {
44 public: 44 public:
45 static VideoDecodeAccelerator::Capabilities GetCapabilities( 45 static VideoDecodeAccelerator::Capabilities GetCapabilities(
46 const gpu::GpuPreferences& gpu_preferences); 46 const gpu::GpuPreferences& gpu_preferences);
47 47
48 AndroidVideoDecodeAccelerator( 48 AndroidVideoDecodeAccelerator(
49 AVDACodecAllocator* codec_allocator,
49 const MakeGLContextCurrentCallback& make_context_current_cb, 50 const MakeGLContextCurrentCallback& make_context_current_cb,
50 const GetGLES2DecoderCallback& get_gles2_decoder_cb); 51 const GetGLES2DecoderCallback& get_gles2_decoder_cb);
51 52
52 ~AndroidVideoDecodeAccelerator() override; 53 ~AndroidVideoDecodeAccelerator() override;
53 54
54 // VideoDecodeAccelerator implementation: 55 // VideoDecodeAccelerator implementation:
55 bool Initialize(const Config& config, Client* client) override; 56 bool Initialize(const Config& config, Client* client) override;
56 void Decode(const BitstreamBuffer& bitstream_buffer) override; 57 void Decode(const BitstreamBuffer& bitstream_buffer) override;
57 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override; 58 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override;
58 void ReusePictureBuffer(int32_t picture_buffer_id) override; 59 void ReusePictureBuffer(int32_t picture_buffer_id) override;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Release |media_codec_| if it's not null, and notify 232 // Release |media_codec_| if it's not null, and notify
232 // |picture_buffer_manager_|. 233 // |picture_buffer_manager_|.
233 void ReleaseCodec(); 234 void ReleaseCodec();
234 235
235 // Used to DCHECK that we are called on the correct thread. 236 // Used to DCHECK that we are called on the correct thread.
236 base::ThreadChecker thread_checker_; 237 base::ThreadChecker thread_checker_;
237 238
238 // To expose client callbacks from VideoDecodeAccelerator. 239 // To expose client callbacks from VideoDecodeAccelerator.
239 Client* client_; 240 Client* client_;
240 241
242 AVDACodecAllocator* codec_allocator_;
243
241 // Callback to set the correct gl context. 244 // Callback to set the correct gl context.
242 MakeGLContextCurrentCallback make_context_current_cb_; 245 MakeGLContextCurrentCallback make_context_current_cb_;
243 246
244 // Callback to get the GLES2Decoder instance. 247 // Callback to get the GLES2Decoder instance.
245 GetGLES2DecoderCallback get_gles2_decoder_cb_; 248 GetGLES2DecoderCallback get_gles2_decoder_cb_;
246 249
247 // The current state of this class. For now, this is used only for setting 250 // The current state of this class. For now, this is used only for setting
248 // error state. 251 // error state.
249 State state_; 252 State state_;
250 253
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 355
353 // WeakPtrFactory for posting tasks back to |this|. 356 // WeakPtrFactory for posting tasks back to |this|.
354 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; 357 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_;
355 358
356 friend class AndroidVideoDecodeAcceleratorTest; 359 friend class AndroidVideoDecodeAcceleratorTest;
357 }; 360 };
358 361
359 } // namespace media 362 } // namespace media
360 363
361 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 364 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | media/gpu/android_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698