OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FILTERS_CHUNK_DEMUXER_H_ | 5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Demuxer implementation that allows chunks of media data to be passed | 27 // Demuxer implementation that allows chunks of media data to be passed |
28 // from JavaScript to the media stack. | 28 // from JavaScript to the media stack. |
29 class MEDIA_EXPORT ChunkDemuxer : public Demuxer { | 29 class MEDIA_EXPORT ChunkDemuxer : public Demuxer { |
30 public: | 30 public: |
31 enum Status { | 31 enum Status { |
32 kOk, // ID added w/o error. | 32 kOk, // ID added w/o error. |
33 kNotSupported, // Type specified is not supported. | 33 kNotSupported, // Type specified is not supported. |
34 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. | 34 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. |
35 }; | 35 }; |
36 | 36 |
37 typedef base::Callback<void(const std::string& type, | |
38 scoped_ptr<uint8[]> init_data, | |
39 int init_data_size)> NeedKeyCB; | |
40 | |
41 // |open_cb| Run when Initialize() is called to signal that the demuxer | 37 // |open_cb| Run when Initialize() is called to signal that the demuxer |
42 // is ready to receive media data via AppenData(). | 38 // is ready to receive media data via AppenData(). |
43 // |need_key_cb| Run when the demuxer determines that an encryption key is | 39 // |need_key_cb| Run when the demuxer determines that an encryption key is |
44 // needed to decrypt the content. | 40 // needed to decrypt the content. |
45 // |add_text_track_cb| Run when demuxer detects the presence of an inband | 41 // |add_text_track_cb| Run when demuxer detects the presence of an inband |
46 // text track. | 42 // text track. |
47 // |log_cb| Run when parsing error messages need to be logged to the error | 43 // |log_cb| Run when parsing error messages need to be logged to the error |
48 // console. | 44 // console. |
49 ChunkDemuxer(const base::Closure& open_cb, | 45 ChunkDemuxer(const base::Closure& open_cb, |
50 const NeedKeyCB& need_key_cb, | 46 const NeedKeyCB& need_key_cb, |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // removed with RemoveID() but can not be re-added (yet). | 255 // removed with RemoveID() but can not be re-added (yet). |
260 std::string source_id_audio_; | 256 std::string source_id_audio_; |
261 std::string source_id_video_; | 257 std::string source_id_video_; |
262 | 258 |
263 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 259 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
264 }; | 260 }; |
265 | 261 |
266 } // namespace media | 262 } // namespace media |
267 | 263 |
268 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 264 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |