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 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 } else if (codec_type == AVMEDIA_TYPE_VIDEO) { | 1200 } else if (codec_type == AVMEDIA_TYPE_VIDEO) { |
1201 MEDIA_LOG(INFO, media_log_) | 1201 MEDIA_LOG(INFO, media_log_) |
1202 << GetDisplayName() | 1202 << GetDisplayName() |
1203 << ": skipping invalid or unsupported video track"; | 1203 << ": skipping invalid or unsupported video track"; |
1204 } | 1204 } |
1205 | 1205 |
1206 // This AVStream does not successfully convert. | 1206 // This AVStream does not successfully convert. |
1207 continue; | 1207 continue; |
1208 } | 1208 } |
1209 | 1209 |
1210 std::string track_id = base::IntToString(stream->id); | 1210 StreamParser::TrackId track_id = stream->id; |
1211 std::string track_label = streams_[i]->GetMetadata("handler_name"); | 1211 std::string track_label = streams_[i]->GetMetadata("handler_name"); |
1212 std::string track_language = streams_[i]->GetMetadata("language"); | 1212 std::string track_language = streams_[i]->GetMetadata("language"); |
1213 | 1213 |
1214 // Some metadata is named differently in FFmpeg for webm files. | 1214 // Some metadata is named differently in FFmpeg for webm files. |
1215 if (strstr(format_context->iformat->name, "webm") || | 1215 if (strstr(format_context->iformat->name, "webm") || |
1216 strstr(format_context->iformat->name, "matroska")) { | 1216 strstr(format_context->iformat->name, "matroska")) { |
1217 // TODO(servolk): FFmpeg doesn't set stream->id correctly for webm files. | 1217 // TODO(servolk): FFmpeg doesn't set stream->id correctly for webm files. |
1218 // Need to fix that and use it as track id. crbug.com/323183 | 1218 // Need to fix that and use it as track id. crbug.com/323183 |
1219 track_id = base::UintToString(media_tracks->tracks().size() + 1); | 1219 track_id = |
| 1220 static_cast<StreamParser::TrackId>(media_tracks->tracks().size() + 1); |
1220 track_label = streams_[i]->GetMetadata("title"); | 1221 track_label = streams_[i]->GetMetadata("title"); |
1221 } | 1222 } |
1222 | 1223 |
1223 // Note when we find our audio/video stream (we only want one of each) and | 1224 // Note when we find our audio/video stream (we only want one of each) and |
1224 // record src= playback UMA stats for the stream's decoder config. | 1225 // record src= playback UMA stats for the stream's decoder config. |
1225 if (codec_type == AVMEDIA_TYPE_AUDIO) { | 1226 if (codec_type == AVMEDIA_TYPE_AUDIO) { |
1226 CHECK(!audio_stream); | 1227 CHECK(!audio_stream); |
1227 audio_stream = stream; | 1228 audio_stream = stream; |
1228 audio_config = streams_[i]->audio_decoder_config(); | 1229 audio_config = streams_[i]->audio_decoder_config(); |
1229 RecordAudioCodecStats(audio_config); | 1230 RecordAudioCodecStats(audio_config); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 | 1591 |
1591 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 1592 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { |
1592 DCHECK(task_runner_->BelongsToCurrentThread()); | 1593 DCHECK(task_runner_->BelongsToCurrentThread()); |
1593 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. | 1594 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. |
1594 if (stream) | 1595 if (stream) |
1595 stream->SetLiveness(liveness); | 1596 stream->SetLiveness(liveness); |
1596 } | 1597 } |
1597 } | 1598 } |
1598 | 1599 |
1599 } // namespace media | 1600 } // namespace media |
OLD | NEW |