Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1011)

Side by Side Diff: media/filters/ffmpeg_demuxer.cc

Issue 1861963008: Use StreamParser::TrackId instead of string for MediaTrack::byteStreamTrackId (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include <algorithm> into stream_parser_buffer.cc Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/websourcebuffer_impl.cc ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/blink/websourcebuffer_impl.cc ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698