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 #include "media/filters/ffmpeg_demuxer.h" | 5 #include "media/filters/ffmpeg_demuxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 | 968 |
969 // TODO: Implement "id" metadata in FFMPEG. | 969 // TODO: Implement "id" metadata in FFMPEG. |
970 // See: http://crbug.com/323183 | 970 // See: http://crbug.com/323183 |
971 host_->AddTextStream(stream, TextTrackConfig(kind, title, language, | 971 host_->AddTextStream(stream, TextTrackConfig(kind, title, language, |
972 std::string())); | 972 std::string())); |
973 } | 973 } |
974 } | 974 } |
975 | 975 |
976 int64_t FFmpegDemuxer::GetMemoryUsage() const { | 976 int64_t FFmpegDemuxer::GetMemoryUsage() const { |
977 int64_t allocation_size = 0; | 977 int64_t allocation_size = 0; |
978 for (const auto& stream : streams_) { | 978 for (auto* stream : streams_) { |
979 if (stream) | 979 if (stream) |
980 allocation_size += stream->MemoryUsage(); | 980 allocation_size += stream->MemoryUsage(); |
981 } | 981 } |
982 return allocation_size; | 982 return allocation_size; |
983 } | 983 } |
984 | 984 |
985 void FFmpegDemuxer::OnEncryptedMediaInitData( | 985 void FFmpegDemuxer::OnEncryptedMediaInitData( |
986 EmeInitDataType init_data_type, | 986 EmeInitDataType init_data_type, |
987 const std::string& encryption_key_id) { | 987 const std::string& encryption_key_id) { |
988 std::vector<uint8_t> key_id_local(encryption_key_id.begin(), | 988 std::vector<uint8_t> key_id_local(encryption_key_id.begin(), |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 } | 1604 } |
1605 } | 1605 } |
1606 | 1606 |
1607 void FFmpegDemuxer::OnDataSourceError() { | 1607 void FFmpegDemuxer::OnDataSourceError() { |
1608 MEDIA_LOG(ERROR, media_log_) << GetDisplayName() << ": data source error"; | 1608 MEDIA_LOG(ERROR, media_log_) << GetDisplayName() << ": data source error"; |
1609 host_->OnDemuxerError(PIPELINE_ERROR_READ); | 1609 host_->OnDemuxerError(PIPELINE_ERROR_READ); |
1610 } | 1610 } |
1611 | 1611 |
1612 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 1612 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { |
1613 DCHECK(task_runner_->BelongsToCurrentThread()); | 1613 DCHECK(task_runner_->BelongsToCurrentThread()); |
1614 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. | 1614 for (auto* stream : streams_) { |
1615 if (stream) | 1615 if (stream) |
1616 stream->SetLiveness(liveness); | 1616 stream->SetLiveness(liveness); |
1617 } | 1617 } |
1618 } | 1618 } |
1619 | 1619 |
1620 } // namespace media | 1620 } // namespace media |
OLD | NEW |