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

Side by Side Diff: media/base/media_tracks.cc

Issue 1833053005: Remove MediaTracks::getFirstAudio/VideoConfig (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control
Patch Set: Avoid crashes in tests 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/base/media_tracks.h ('k') | media/formats/common/stream_parser_test_base.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/base/media_tracks.h" 5 #include "media/base/media_tracks.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "media/base/audio_decoder_config.h" 9 #include "media/base/audio_decoder_config.h"
10 #include "media/base/video_decoder_config.h" 10 #include "media/base/video_decoder_config.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 const VideoDecoderConfig& MediaTracks::getVideoConfig( 59 const VideoDecoderConfig& MediaTracks::getVideoConfig(
60 StreamParser::TrackId bytestream_track_id) const { 60 StreamParser::TrackId bytestream_track_id) const {
61 auto it = video_configs_.find(bytestream_track_id); 61 auto it = video_configs_.find(bytestream_track_id);
62 if (it != video_configs_.end()) 62 if (it != video_configs_.end())
63 return it->second; 63 return it->second;
64 static VideoDecoderConfig invalidConfig; 64 static VideoDecoderConfig invalidConfig;
65 return invalidConfig; 65 return invalidConfig;
66 } 66 }
67 67
68 const AudioDecoderConfig& MediaTracks::getFirstAudioConfig() const {
69 for (const auto& track : tracks()) {
70 if (track->type() == MediaTrack::Audio) {
71 return getAudioConfig(track->bytestream_track_id());
72 }
73 }
74 static AudioDecoderConfig invalidConfig;
75 return invalidConfig;
76 }
77
78 const VideoDecoderConfig& MediaTracks::getFirstVideoConfig() const {
79 for (const auto& track : tracks()) {
80 if (track->type() == MediaTrack::Video) {
81 return getVideoConfig(track->bytestream_track_id());
82 }
83 }
84 static VideoDecoderConfig invalidConfig;
85 return invalidConfig;
86 }
87
88 } // namespace media 68 } // namespace media
OLDNEW
« no previous file with comments | « media/base/media_tracks.h ('k') | media/formats/common/stream_parser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698