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/base/media_resource.h" | 5 #include "media/base/media_resource.h" |
6 | 6 |
7 namespace media { | 7 namespace media { |
8 | 8 |
9 MediaResource::MediaResource() {} | 9 MediaResource::MediaResource() {} |
10 | 10 |
11 MediaResource::~MediaResource() {} | 11 MediaResource::~MediaResource() {} |
12 | 12 |
13 MediaUrlParams MediaResource::GetMediaUrlParams() const { | 13 MediaUrlParams MediaResource::GetMediaUrlParams() const { |
14 NOTREACHED(); | 14 NOTREACHED(); |
15 return MediaUrlParams{GURL(), GURL()}; | 15 return MediaUrlParams{GURL(), GURL()}; |
16 } | 16 } |
17 | 17 |
18 MediaResource::Type MediaResource::GetType() const { | 18 MediaResource::Type MediaResource::GetType() const { |
19 return STREAM; | 19 return STREAM; |
20 } | 20 } |
21 | 21 |
22 DemuxerStream* MediaResource::GetFirstStream(DemuxerStream::Type type) { | 22 DemuxerStream* MediaResource::GetFirstStream(DemuxerStream::Type type) { |
23 const auto& streams = GetAllStreams(); | 23 const auto& streams = GetAllStreams(); |
24 for (auto* stream : streams) { | 24 for (const auto& stream : streams) { |
25 if (stream->type() == type) | 25 if (stream->type() == type) |
26 return stream; | 26 return stream; |
27 } | 27 } |
28 return nullptr; | 28 return nullptr; |
29 } | 29 } |
30 | 30 |
31 } // namespace media | 31 } // namespace media |
OLD | NEW |