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_cluster_parser.h" | 5 #include "media/formats/webm/webm_cluster_parser.h" |
6 | 6 |
| 7 #include <utility> |
7 #include <vector> | 8 #include <vector> |
8 | 9 |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/sys_byteorder.h" | 12 #include "base/sys_byteorder.h" |
12 #include "media/base/decrypt_config.h" | 13 #include "media/base/decrypt_config.h" |
13 #include "media/base/timestamp_constants.h" | 14 #include "media/base/timestamp_constants.h" |
14 #include "media/filters/webvtt_util.h" | 15 #include "media/filters/webvtt_util.h" |
15 #include "media/formats/webm/webm_constants.h" | 16 #include "media/formats/webm/webm_constants.h" |
16 #include "media/formats/webm/webm_crypto_helpers.h" | 17 #include "media/formats/webm/webm_crypto_helpers.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 498 |
498 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 499 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
499 // type with remapped bytestream track numbers and allow multiple tracks as | 500 // type with remapped bytestream track numbers and allow multiple tracks as |
500 // applicable. See https://crbug.com/341581. | 501 // applicable. See https://crbug.com/341581. |
501 buffer = StreamParserBuffer::CopyFrom( | 502 buffer = StreamParserBuffer::CopyFrom( |
502 data + data_offset, size - data_offset, | 503 data + data_offset, size - data_offset, |
503 additional, additional_size, | 504 additional, additional_size, |
504 is_keyframe, buffer_type, track_num); | 505 is_keyframe, buffer_type, track_num); |
505 | 506 |
506 if (decrypt_config) | 507 if (decrypt_config) |
507 buffer->set_decrypt_config(decrypt_config.Pass()); | 508 buffer->set_decrypt_config(std::move(decrypt_config)); |
508 } else { | 509 } else { |
509 std::string id, settings, content; | 510 std::string id, settings, content; |
510 WebMWebVTTParser::Parse(data, size, &id, &settings, &content); | 511 WebMWebVTTParser::Parse(data, size, &id, &settings, &content); |
511 | 512 |
512 std::vector<uint8_t> side_data; | 513 std::vector<uint8_t> side_data; |
513 MakeSideData(id.begin(), id.end(), | 514 MakeSideData(id.begin(), id.end(), |
514 settings.begin(), settings.end(), | 515 settings.begin(), settings.end(), |
515 &side_data); | 516 &side_data); |
516 | 517 |
517 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 518 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 WebMClusterParser::FindTextTrack(int track_num) { | 875 WebMClusterParser::FindTextTrack(int track_num) { |
875 const TextTrackMap::iterator it = text_track_map_.find(track_num); | 876 const TextTrackMap::iterator it = text_track_map_.find(track_num); |
876 | 877 |
877 if (it == text_track_map_.end()) | 878 if (it == text_track_map_.end()) |
878 return NULL; | 879 return NULL; |
879 | 880 |
880 return &it->second; | 881 return &it->second; |
881 } | 882 } |
882 | 883 |
883 } // namespace media | 884 } // namespace media |
OLD | NEW |