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

Side by Side Diff: content/renderer/media/android/media_source_delegate.h

Issue 784493002: Encrypted Media: Rename NeedKey to EncryptedMediaInitData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_
6 #define CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ 6 #define CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 RendererDemuxerAndroid* demuxer_client, 51 RendererDemuxerAndroid* demuxer_client,
52 int demuxer_client_id, 52 int demuxer_client_id,
53 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 53 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
54 const scoped_refptr<media::MediaLog> media_log); 54 const scoped_refptr<media::MediaLog> media_log);
55 virtual ~MediaSourceDelegate(); 55 virtual ~MediaSourceDelegate();
56 56
57 // Initialize the MediaSourceDelegate. |media_source| will be owned by 57 // Initialize the MediaSourceDelegate. |media_source| will be owned by
58 // this object after this call. 58 // this object after this call.
59 void InitializeMediaSource( 59 void InitializeMediaSource(
60 const MediaSourceOpenedCB& media_source_opened_cb, 60 const MediaSourceOpenedCB& media_source_opened_cb,
61 const media::Demuxer::NeedKeyCB& need_key_cb, 61 const media::Demuxer::EncryptedMediaInitDataCB&
62 encrypted_media_init_data_cb,
62 const media::SetDecryptorReadyCB& set_decryptor_ready_cb, 63 const media::SetDecryptorReadyCB& set_decryptor_ready_cb,
63 const UpdateNetworkStateCB& update_network_state_cb, 64 const UpdateNetworkStateCB& update_network_state_cb,
64 const DurationChangeCB& duration_change_cb); 65 const DurationChangeCB& duration_change_cb);
65 66
66 blink::WebTimeRanges Buffered() const; 67 blink::WebTimeRanges Buffered() const;
67 size_t DecodedFrameCount() const; 68 size_t DecodedFrameCount() const;
68 size_t DroppedFrameCount() const; 69 size_t DroppedFrameCount() const;
69 size_t AudioDecodedByteCount() const; 70 size_t AudioDecodedByteCount() const;
70 size_t VideoDecodedByteCount() const; 71 size_t VideoDecodedByteCount() const;
71 72
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Callback for ChunkDemuxer::Seek() and callback chain for resetting 130 // Callback for ChunkDemuxer::Seek() and callback chain for resetting
130 // decrypted audio/video streams if present. 131 // decrypted audio/video streams if present.
131 // 132 //
132 // Runs on the media thread. 133 // Runs on the media thread.
133 void OnDemuxerSeekDone(media::PipelineStatus status); 134 void OnDemuxerSeekDone(media::PipelineStatus status);
134 void ResetAudioDecryptingDemuxerStream(); 135 void ResetAudioDecryptingDemuxerStream();
135 void ResetVideoDecryptingDemuxerStream(); 136 void ResetVideoDecryptingDemuxerStream();
136 void FinishResettingDecryptingDemuxerStreams(); 137 void FinishResettingDecryptingDemuxerStreams();
137 138
138 void OnDemuxerOpened(); 139 void OnDemuxerOpened();
139 void OnNeedKey(const std::string& init_data_type, 140 void OnEncryptedMediaInitData(const std::string& init_data_type,
140 const std::vector<uint8>& init_data); 141 const std::vector<uint8>& init_data);
141 void NotifyDemuxerReady(); 142 void NotifyDemuxerReady();
142 143
143 // Stops and clears objects on the media thread. 144 // Stops and clears objects on the media thread.
144 void StopDemuxer(const base::Closure& stop_cb); 145 void StopDemuxer(const base::Closure& stop_cb);
145 146
146 void InitializeDemuxer(); 147 void InitializeDemuxer();
147 void SeekInternal(const base::TimeDelta& seek_time); 148 void SeekInternal(const base::TimeDelta& seek_time);
148 // Reads an access unit from the demuxer stream |stream| and stores it in 149 // Reads an access unit from the demuxer stream |stream| and stores it in
149 // the |index|th access unit in |params|. 150 // the |index|th access unit in |params|.
150 void ReadFromDemuxerStream(media::DemuxerStream::Type type, 151 void ReadFromDemuxerStream(media::DemuxerStream::Type type,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 scoped_ptr<media::DecryptingDemuxerStream> audio_decrypting_demuxer_stream_; 190 scoped_ptr<media::DecryptingDemuxerStream> audio_decrypting_demuxer_stream_;
190 scoped_ptr<media::DecryptingDemuxerStream> video_decrypting_demuxer_stream_; 191 scoped_ptr<media::DecryptingDemuxerStream> video_decrypting_demuxer_stream_;
191 192
192 media::DemuxerStream* audio_stream_; 193 media::DemuxerStream* audio_stream_;
193 media::DemuxerStream* video_stream_; 194 media::DemuxerStream* video_stream_;
194 195
195 media::PipelineStatistics statistics_; 196 media::PipelineStatistics statistics_;
196 media::Ranges<base::TimeDelta> buffered_time_ranges_; 197 media::Ranges<base::TimeDelta> buffered_time_ranges_;
197 198
198 MediaSourceOpenedCB media_source_opened_cb_; 199 MediaSourceOpenedCB media_source_opened_cb_;
199 media::Demuxer::NeedKeyCB need_key_cb_; 200 media::Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_;
200 201
201 // Temporary for EME v0.1. In the future the init data type should be passed 202 // Temporary for EME v0.1. In the future the init data type should be passed
202 // through GenerateKeyRequest() directly from WebKit. 203 // through GenerateKeyRequest() directly from WebKit.
203 std::string init_data_type_; 204 std::string init_data_type_;
204 205
205 // Lock used to serialize access for |seeking_|. 206 // Lock used to serialize access for |seeking_|.
206 mutable base::Lock seeking_lock_; 207 mutable base::Lock seeking_lock_;
207 bool seeking_; 208 bool seeking_;
208 209
209 // Lock used to serialize access for |is_video_encrypted_|. 210 // Lock used to serialize access for |is_video_encrypted_|.
(...skipping 19 matching lines...) Expand all
229 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_; 230 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_;
230 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_; 231 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_;
231 base::WeakPtr<MediaSourceDelegate> main_weak_this_; 232 base::WeakPtr<MediaSourceDelegate> main_weak_this_;
232 233
233 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); 234 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate);
234 }; 235 };
235 236
236 } // namespace content 237 } // namespace content
237 238
238 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ 239 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_
OLDNEW
« no previous file with comments | « chromecast/media/cma/test/frame_segmenter_for_test.cc ('k') | content/renderer/media/android/media_source_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698