OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "media/formats/webm/webm_stream_parser.h" | 5 #include "media/formats/webm/webm_stream_parser.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 | 32 |
33 void WebMStreamParser::Init( | 33 void WebMStreamParser::Init( |
34 const InitCB& init_cb, | 34 const InitCB& init_cb, |
35 const NewConfigCB& config_cb, | 35 const NewConfigCB& config_cb, |
36 const NewBuffersCB& new_buffers_cb, | 36 const NewBuffersCB& new_buffers_cb, |
37 bool ignore_text_tracks, | 37 bool ignore_text_tracks, |
38 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, | 38 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, |
39 const NewMediaSegmentCB& new_segment_cb, | 39 const NewMediaSegmentCB& new_segment_cb, |
40 const EndMediaSegmentCB& end_of_segment_cb, | 40 const EndMediaSegmentCB& end_of_segment_cb, |
41 const scoped_refptr<MediaLog>& media_log) { | 41 MediaLog* media_log) { |
42 DCHECK_EQ(state_, kWaitingForInit); | 42 DCHECK_EQ(state_, kWaitingForInit); |
43 DCHECK(init_cb_.is_null()); | 43 DCHECK(init_cb_.is_null()); |
44 DCHECK(!init_cb.is_null()); | 44 DCHECK(!init_cb.is_null()); |
45 DCHECK(!config_cb.is_null()); | 45 DCHECK(!config_cb.is_null()); |
46 DCHECK(!new_buffers_cb.is_null()); | 46 DCHECK(!new_buffers_cb.is_null()); |
47 DCHECK(!encrypted_media_init_data_cb.is_null()); | 47 DCHECK(!encrypted_media_init_data_cb.is_null()); |
48 DCHECK(!new_segment_cb.is_null()); | 48 DCHECK(!new_segment_cb.is_null()); |
49 DCHECK(!end_of_segment_cb.is_null()); | 49 DCHECK(!end_of_segment_cb.is_null()); |
50 | 50 |
51 ChangeState(kParsingHeaders); | 51 ChangeState(kParsingHeaders); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 return bytes_parsed; | 281 return bytes_parsed; |
282 } | 282 } |
283 | 283 |
284 void WebMStreamParser::OnEncryptedMediaInitData(const std::string& key_id) { | 284 void WebMStreamParser::OnEncryptedMediaInitData(const std::string& key_id) { |
285 std::vector<uint8_t> key_id_vector(key_id.begin(), key_id.end()); | 285 std::vector<uint8_t> key_id_vector(key_id.begin(), key_id.end()); |
286 encrypted_media_init_data_cb_.Run(EmeInitDataType::WEBM, key_id_vector); | 286 encrypted_media_init_data_cb_.Run(EmeInitDataType::WEBM, key_id_vector); |
287 } | 287 } |
288 | 288 |
289 } // namespace media | 289 } // namespace media |
OLD | NEW |