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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 Demuxer::MediaTracksUpdatedCB tracks_updated_cb = base::Bind( | 100 Demuxer::MediaTracksUpdatedCB tracks_updated_cb = base::Bind( |
101 &FFmpegDemuxerTest::OnMediaTracksUpdated, base::Unretained(this)); | 101 &FFmpegDemuxerTest::OnMediaTracksUpdated, base::Unretained(this)); |
102 | 102 |
103 demuxer_.reset(new FFmpegDemuxer( | 103 demuxer_.reset(new FFmpegDemuxer( |
104 message_loop_.task_runner(), data_source_.get(), | 104 message_loop_.task_runner(), data_source_.get(), |
105 encrypted_media_init_data_cb, tracks_updated_cb, new MediaLog())); | 105 encrypted_media_init_data_cb, tracks_updated_cb, new MediaLog())); |
106 } | 106 } |
107 | 107 |
108 DemuxerStream* GetStream(DemuxerStream::Type type) { | 108 DemuxerStream* GetStream(DemuxerStream::Type type) { |
109 std::vector<DemuxerStream*> streams = demuxer_->GetAllStreams(); | 109 std::vector<DemuxerStream*> streams = demuxer_->GetAllStreams(); |
110 for (auto* stream : streams) { | 110 for (const auto& stream : streams) { |
111 if (stream->type() == type) | 111 if (stream->type() == type) |
112 return stream; | 112 return stream; |
113 } | 113 } |
114 return nullptr; | 114 return nullptr; |
115 } | 115 } |
116 | 116 |
117 MOCK_METHOD1(CheckPoint, void(int v)); | 117 MOCK_METHOD1(CheckPoint, void(int v)); |
118 | 118 |
119 void InitializeDemuxerInternal(bool enable_text, | 119 void InitializeDemuxerInternal(bool enable_text, |
120 media::PipelineStatus expected_pipeline_status, | 120 media::PipelineStatus expected_pipeline_status, |
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1515 EXPECT_EQ(astream, preferred_seeking_stream(base::TimeDelta())); | 1515 EXPECT_EQ(astream, preferred_seeking_stream(base::TimeDelta())); |
1516 | 1516 |
1517 // Now pretend that audio stream got disabled. | 1517 // Now pretend that audio stream got disabled. |
1518 astream->set_enabled(false, base::TimeDelta()); | 1518 astream->set_enabled(false, base::TimeDelta()); |
1519 // Since there's no other enabled streams, the preferred seeking stream should | 1519 // Since there's no other enabled streams, the preferred seeking stream should |
1520 // still be the audio stream. | 1520 // still be the audio stream. |
1521 EXPECT_EQ(astream, preferred_seeking_stream(base::TimeDelta())); | 1521 EXPECT_EQ(astream, preferred_seeking_stream(base::TimeDelta())); |
1522 } | 1522 } |
1523 | 1523 |
1524 } // namespace media | 1524 } // namespace media |
OLD | NEW |