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

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

Issue 1438063002: media: Support SetCdm() on VideoDecodeAccelerator interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 const OutputBufferMap& buffer_map) = 0; 87 const OutputBufferMap& buffer_map) = 0;
88 }; 88 };
89 89
90 AndroidVideoDecodeAccelerator( 90 AndroidVideoDecodeAccelerator(
91 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, 91 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder,
92 const base::Callback<bool(void)>& make_context_current, 92 const base::Callback<bool(void)>& make_context_current,
93 scoped_ptr<BackingStrategy> strategy); 93 scoped_ptr<BackingStrategy> strategy);
94 94
95 ~AndroidVideoDecodeAccelerator() override; 95 ~AndroidVideoDecodeAccelerator() override;
96 96
97 // media::VideoDecodeAccelerator implementation:
98
97 // Does not take ownership of |client| which must outlive |*this|. 99 // Does not take ownership of |client| which must outlive |*this|.
98 bool Initialize(media::VideoCodecProfile profile, Client* client) override; 100 bool Initialize(media::VideoCodecProfile profile, Client* client) override;
99 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; 101 void Decode(const media::BitstreamBuffer& bitstream_buffer) override;
100 void AssignPictureBuffers( 102 void AssignPictureBuffers(
101 const std::vector<media::PictureBuffer>& buffers) override; 103 const std::vector<media::PictureBuffer>& buffers) override;
102 void ReusePictureBuffer(int32 picture_buffer_id) override; 104 void ReusePictureBuffer(int32 picture_buffer_id) override;
103 void Flush() override; 105 void Flush() override;
104 void Reset() override; 106 void Reset() override;
107 void SetCdm(int cdm_id) override;
105 void Destroy() override; 108 void Destroy() override;
106 bool CanDecodeOnIOThread() override; 109 bool CanDecodeOnIOThread() override;
107 110
108 // AndroidVideoDecodeStateProvider 111 // AVDAStateProvider implementation:
109 const gfx::Size& GetSize() const override; 112 const gfx::Size& GetSize() const override;
110 const base::ThreadChecker& ThreadChecker() const override; 113 const base::ThreadChecker& ThreadChecker() const override;
111 base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const override; 114 base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const override;
112 void PostError(const ::tracked_objects::Location& from_here, 115 void PostError(const ::tracked_objects::Location& from_here,
113 media::VideoDecodeAccelerator::Error error) override; 116 media::VideoDecodeAccelerator::Error error) override;
114 117
115 static media::VideoDecodeAccelerator::SupportedProfiles 118 static media::VideoDecodeAccelerator::SupportedProfiles
116 GetSupportedProfiles(); 119 GetSupportedProfiles();
117 120
118 private: 121 private:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Notifies the client that the input buffer identifed by input_buffer_id has 155 // Notifies the client that the input buffer identifed by input_buffer_id has
153 // been processed. 156 // been processed.
154 void NotifyEndOfBitstreamBuffer(int input_buffer_id); 157 void NotifyEndOfBitstreamBuffer(int input_buffer_id);
155 158
156 // Notifies the client that the decoder was flushed. 159 // Notifies the client that the decoder was flushed.
157 void NotifyFlushDone(); 160 void NotifyFlushDone();
158 161
159 // Notifies the client that the decoder was reset. 162 // Notifies the client that the decoder was reset.
160 void NotifyResetDone(); 163 void NotifyResetDone();
161 164
165 // Notifies the client of the CDM setting result.
166 void NotifyCdmSet(bool success);
167
162 // Notifies about decoding errors. 168 // Notifies about decoding errors.
163 void NotifyError(media::VideoDecodeAccelerator::Error error); 169 void NotifyError(media::VideoDecodeAccelerator::Error error);
164 170
165 // Used to DCHECK that we are called on the correct thread. 171 // Used to DCHECK that we are called on the correct thread.
166 base::ThreadChecker thread_checker_; 172 base::ThreadChecker thread_checker_;
167 173
168 // To expose client callbacks from VideoDecodeAccelerator. 174 // To expose client callbacks from VideoDecodeAccelerator.
169 Client* client_; 175 Client* client_;
170 176
171 // Callback to set the correct gl context. 177 // Callback to set the correct gl context.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 237
232 // WeakPtrFactory for posting tasks back to |this|. 238 // WeakPtrFactory for posting tasks back to |this|.
233 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; 239 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_;
234 240
235 friend class AndroidVideoDecodeAcceleratorTest; 241 friend class AndroidVideoDecodeAcceleratorTest;
236 }; 242 };
237 243
238 } // namespace content 244 } // namespace content
239 245
240 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 246 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698