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

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

Issue 1207043002: Introduce a client minimum picture pool size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 #ifndef CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 19 matching lines...) Expand all
30 // class. http://developer.android.com/reference/android/media/MediaCodec.html 30 // class. http://developer.android.com/reference/android/media/MediaCodec.html
31 class CONTENT_EXPORT AndroidVideoDecodeAccelerator 31 class CONTENT_EXPORT AndroidVideoDecodeAccelerator
32 : public media::VideoDecodeAccelerator { 32 : public media::VideoDecodeAccelerator {
33 public: 33 public:
34 // Does not take ownership of |client| which must outlive |*this|. 34 // Does not take ownership of |client| which must outlive |*this|.
35 AndroidVideoDecodeAccelerator( 35 AndroidVideoDecodeAccelerator(
36 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, 36 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder,
37 const base::Callback<bool(void)>& make_context_current); 37 const base::Callback<bool(void)>& make_context_current);
38 38
39 // media::VideoDecodeAccelerator implementation. 39 // media::VideoDecodeAccelerator implementation.
40 bool Initialize(media::VideoCodecProfile profile, Client* client) override; 40 bool Initialize(
41 media::VideoCodecProfile profile,
42 uint32 min_picture_count,
43 Client* client) override;
41 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; 44 void Decode(const media::BitstreamBuffer& bitstream_buffer) override;
42 void AssignPictureBuffers( 45 void AssignPictureBuffers(
43 const std::vector<media::PictureBuffer>& buffers) override; 46 const std::vector<media::PictureBuffer>& buffers) override;
44 void ReusePictureBuffer(int32 picture_buffer_id) override; 47 void ReusePictureBuffer(int32 picture_buffer_id) override;
45 void Flush() override; 48 void Flush() override;
46 void Reset() override; 49 void Reset() override;
47 void Destroy() override; 50 void Destroy() override;
48 bool CanDecodeOnIOThread() override; 51 bool CanDecodeOnIOThread() override;
49 52
50 static media::VideoDecodeAccelerator::SupportedProfiles 53 static media::VideoDecodeAccelerator::SupportedProfiles
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 100
98 // Notifies about decoding errors. 101 // Notifies about decoding errors.
99 void NotifyError(media::VideoDecodeAccelerator::Error error); 102 void NotifyError(media::VideoDecodeAccelerator::Error error);
100 103
101 // Used to DCHECK that we are called on the correct thread. 104 // Used to DCHECK that we are called on the correct thread.
102 base::ThreadChecker thread_checker_; 105 base::ThreadChecker thread_checker_;
103 106
104 // To expose client callbacks from VideoDecodeAccelerator. 107 // To expose client callbacks from VideoDecodeAccelerator.
105 Client* client_; 108 Client* client_;
106 109
110 // The number of picture buffers to allocate.
111 uint32 num_picture_buffers_;
112
107 // Callback to set the correct gl context. 113 // Callback to set the correct gl context.
108 base::Callback<bool(void)> make_context_current_; 114 base::Callback<bool(void)> make_context_current_;
109 115
110 // Codec type. Used when we configure media codec. 116 // Codec type. Used when we configure media codec.
111 media::VideoCodec codec_; 117 media::VideoCodec codec_;
112 118
113 // The current state of this class. For now, this is used only for setting 119 // The current state of this class. For now, this is used only for setting
114 // error state. 120 // error state.
115 State state_; 121 State state_;
116 122
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 171
166 // WeakPtrFactory for posting tasks back to |this|. 172 // WeakPtrFactory for posting tasks back to |this|.
167 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; 173 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_;
168 174
169 friend class AndroidVideoDecodeAcceleratorTest; 175 friend class AndroidVideoDecodeAcceleratorTest;
170 }; 176 };
171 177
172 } // namespace content 178 } // namespace content
173 179
174 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 180 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698