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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 return base::Bind(&FFmpegDemuxerTest::OnReadDone, | 201 return base::Bind(&FFmpegDemuxerTest::OnReadDone, |
202 base::Unretained(this), | 202 base::Unretained(this), |
203 location, | 203 location, |
204 read_expectation); | 204 read_expectation); |
205 } | 205 } |
206 | 206 |
207 MOCK_METHOD2(OnEncryptedMediaInitData, | 207 MOCK_METHOD2(OnEncryptedMediaInitData, |
208 void(EmeInitDataType init_data_type, | 208 void(EmeInitDataType init_data_type, |
209 const std::vector<uint8_t>& init_data)); | 209 const std::vector<uint8_t>& init_data)); |
210 | 210 |
211 void OnMediaTracksUpdated(scoped_ptr<MediaTracks> tracks) { | 211 void OnMediaTracksUpdated(std::unique_ptr<MediaTracks> tracks) { |
212 CHECK(tracks.get()); | 212 CHECK(tracks.get()); |
213 media_tracks_ = std::move(tracks); | 213 media_tracks_ = std::move(tracks); |
214 } | 214 } |
215 | 215 |
216 // Accessor to demuxer internals. | 216 // Accessor to demuxer internals. |
217 void set_duration_known(bool duration_known) { | 217 void set_duration_known(bool duration_known) { |
218 demuxer_->duration_known_ = duration_known; | 218 demuxer_->duration_known_ = duration_known; |
219 } | 219 } |
220 | 220 |
221 bool IsStreamStopped(DemuxerStream::Type type) { | 221 bool IsStreamStopped(DemuxerStream::Type type) { |
222 DemuxerStream* stream = demuxer_->GetStream(type); | 222 DemuxerStream* stream = demuxer_->GetStream(type); |
223 CHECK(stream); | 223 CHECK(stream); |
224 return !static_cast<FFmpegDemuxerStream*>(stream)->demuxer_; | 224 return !static_cast<FFmpegDemuxerStream*>(stream)->demuxer_; |
225 } | 225 } |
226 | 226 |
227 // Fixture members. | 227 // Fixture members. |
228 scoped_ptr<FileDataSource> data_source_; | 228 std::unique_ptr<FileDataSource> data_source_; |
229 scoped_ptr<FFmpegDemuxer> demuxer_; | 229 std::unique_ptr<FFmpegDemuxer> demuxer_; |
230 StrictMock<MockDemuxerHost> host_; | 230 StrictMock<MockDemuxerHost> host_; |
231 scoped_ptr<MediaTracks> media_tracks_; | 231 std::unique_ptr<MediaTracks> media_tracks_; |
232 base::MessageLoop message_loop_; | 232 base::MessageLoop message_loop_; |
233 | 233 |
234 AVFormatContext* format_context() { | 234 AVFormatContext* format_context() { |
235 return demuxer_->glue_->format_context(); | 235 return demuxer_->glue_->format_context(); |
236 } | 236 } |
237 | 237 |
238 int preferred_seeking_stream_index() const { | 238 int preferred_seeking_stream_index() const { |
239 return demuxer_->preferred_stream_for_seeking_.first; | 239 return demuxer_->preferred_stream_for_seeking_.first; |
240 } | 240 } |
241 | 241 |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 | 1232 |
1233 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]); | 1233 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]); |
1234 EXPECT_EQ(audio_track.type(), MediaTrack::Audio); | 1234 EXPECT_EQ(audio_track.type(), MediaTrack::Audio); |
1235 EXPECT_EQ(audio_track.id(), "2"); | 1235 EXPECT_EQ(audio_track.id(), "2"); |
1236 EXPECT_EQ(audio_track.kind(), "main"); | 1236 EXPECT_EQ(audio_track.kind(), "main"); |
1237 EXPECT_EQ(audio_track.label(), ""); | 1237 EXPECT_EQ(audio_track.label(), ""); |
1238 EXPECT_EQ(audio_track.language(), ""); | 1238 EXPECT_EQ(audio_track.language(), ""); |
1239 } | 1239 } |
1240 | 1240 |
1241 } // namespace media | 1241 } // namespace media |
OLD | NEW |