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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 int64_t timecode_scale, | 38 int64_t timecode_scale, |
39 int audio_track_num, | 39 int audio_track_num, |
40 base::TimeDelta audio_default_duration, | 40 base::TimeDelta audio_default_duration, |
41 int video_track_num, | 41 int video_track_num, |
42 base::TimeDelta video_default_duration, | 42 base::TimeDelta video_default_duration, |
43 const WebMTracksParser::TextTracks& text_tracks, | 43 const WebMTracksParser::TextTracks& text_tracks, |
44 const std::set<int64_t>& ignored_tracks, | 44 const std::set<int64_t>& ignored_tracks, |
45 const std::string& audio_encryption_key_id, | 45 const std::string& audio_encryption_key_id, |
46 const std::string& video_encryption_key_id, | 46 const std::string& video_encryption_key_id, |
47 const AudioCodec audio_codec, | 47 const AudioCodec audio_codec, |
48 const scoped_refptr<MediaLog>& media_log) | 48 MediaLog* media_log) |
49 : timecode_multiplier_(timecode_scale / 1000.0), | 49 : timecode_multiplier_(timecode_scale / 1000.0), |
50 ignored_tracks_(ignored_tracks), | 50 ignored_tracks_(ignored_tracks), |
51 audio_encryption_key_id_(audio_encryption_key_id), | 51 audio_encryption_key_id_(audio_encryption_key_id), |
52 video_encryption_key_id_(video_encryption_key_id), | 52 video_encryption_key_id_(video_encryption_key_id), |
53 audio_codec_(audio_codec), | 53 audio_codec_(audio_codec), |
54 parser_(kWebMIdCluster, this), | 54 parser_(kWebMIdCluster, this), |
55 cluster_start_time_(kNoTimestamp), | 55 cluster_start_time_(kNoTimestamp), |
56 audio_(audio_track_num, false, audio_default_duration, media_log), | 56 audio_(audio_track_num, false, audio_default_duration, media_log), |
57 video_(video_track_num, true, video_default_duration, media_log), | 57 video_(video_track_num, true, video_default_duration, media_log), |
58 ready_buffer_upper_bound_(kNoDecodeTimestamp()), | 58 ready_buffer_upper_bound_(kNoDecodeTimestamp()), |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 base::TimeDelta(), | 597 base::TimeDelta(), |
598 base::TimeDelta::FromMicroseconds(discard_padding / 1000))); | 598 base::TimeDelta::FromMicroseconds(discard_padding / 1000))); |
599 } | 599 } |
600 | 600 |
601 return track->AddBuffer(buffer); | 601 return track->AddBuffer(buffer); |
602 } | 602 } |
603 | 603 |
604 WebMClusterParser::Track::Track(int track_num, | 604 WebMClusterParser::Track::Track(int track_num, |
605 bool is_video, | 605 bool is_video, |
606 base::TimeDelta default_duration, | 606 base::TimeDelta default_duration, |
607 const scoped_refptr<MediaLog>& media_log) | 607 MediaLog* media_log) |
608 : track_num_(track_num), | 608 : track_num_(track_num), |
609 is_video_(is_video), | 609 is_video_(is_video), |
610 default_duration_(default_duration), | 610 default_duration_(default_duration), |
611 estimated_next_frame_duration_(kNoTimestamp), | 611 estimated_next_frame_duration_(kNoTimestamp), |
612 media_log_(media_log) { | 612 media_log_(media_log) { |
613 DCHECK(default_duration_ == kNoTimestamp || | 613 DCHECK(default_duration_ == kNoTimestamp || |
614 default_duration_ > base::TimeDelta()); | 614 default_duration_ > base::TimeDelta()); |
615 } | 615 } |
616 | 616 |
617 WebMClusterParser::Track::Track(const Track& other) = default; | 617 WebMClusterParser::Track::Track(const Track& other) = default; |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 WebMClusterParser::FindTextTrack(int track_num) { | 870 WebMClusterParser::FindTextTrack(int track_num) { |
871 const TextTrackMap::iterator it = text_track_map_.find(track_num); | 871 const TextTrackMap::iterator it = text_track_map_.find(track_num); |
872 | 872 |
873 if (it == text_track_map_.end()) | 873 if (it == text_track_map_.end()) |
874 return NULL; | 874 return NULL; |
875 | 875 |
876 return &it->second; | 876 return &it->second; |
877 } | 877 } |
878 | 878 |
879 } // namespace media | 879 } // namespace media |
OLD | NEW |