OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <deque> | 5 #include <deque> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "media/base/filters.h" | 10 #include "media/base/filters.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 reader->Read(video); | 231 reader->Read(video); |
232 message_loop_.RunAllPending(); | 232 message_loop_.RunAllPending(); |
233 EXPECT_TRUE(reader->called()); | 233 EXPECT_TRUE(reader->called()); |
234 ValidateBuffer(FROM_HERE, reader->buffer(), 1057, 33000); | 234 ValidateBuffer(FROM_HERE, reader->buffer(), 1057, 33000); |
235 } | 235 } |
236 | 236 |
237 TEST_F(FFmpegDemuxerTest, Read_VideoNonZeroStart) { | 237 TEST_F(FFmpegDemuxerTest, Read_VideoNonZeroStart) { |
238 // Test the start time is the first timestamp of the video and audio stream. | 238 // Test the start time is the first timestamp of the video and audio stream. |
239 InitializeDemuxer(CreateDataSource("nonzero-start-time.webm")); | 239 InitializeDemuxer(CreateDataSource("nonzero-start-time.webm")); |
240 | 240 |
241 const base::TimeDelta kExpectedTimestamp = | |
242 base::TimeDelta::FromMicroseconds(396000); | |
243 | |
244 // Attempt a read from the video stream and run the message loop until done. | 241 // Attempt a read from the video stream and run the message loop until done. |
245 scoped_refptr<DemuxerStream> video = | 242 scoped_refptr<DemuxerStream> video = |
246 demuxer_->GetStream(DemuxerStream::VIDEO); | 243 demuxer_->GetStream(DemuxerStream::VIDEO); |
247 scoped_refptr<DemuxerStream> audio = | 244 scoped_refptr<DemuxerStream> audio = |
248 demuxer_->GetStream(DemuxerStream::AUDIO); | 245 demuxer_->GetStream(DemuxerStream::AUDIO); |
249 scoped_refptr<DemuxerStreamReader> reader(new DemuxerStreamReader()); | 246 scoped_refptr<DemuxerStreamReader> reader(new DemuxerStreamReader()); |
250 | 247 |
251 // Check first buffer in video stream. | 248 // Check first buffer in video stream. |
252 reader->Read(video); | 249 reader->Read(video); |
253 message_loop_.RunAllPending(); | 250 message_loop_.RunAllPending(); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 | 572 |
576 TEST_F(FFmpegDemuxerTest, ProtocolIsStreaming) { | 573 TEST_F(FFmpegDemuxerTest, ProtocolIsStreaming) { |
577 scoped_refptr<DataSource> data_source = CreateDataSource("bear-320x240.webm"); | 574 scoped_refptr<DataSource> data_source = CreateDataSource("bear-320x240.webm"); |
578 InitializeDemuxer(data_source); | 575 InitializeDemuxer(data_source); |
579 | 576 |
580 EXPECT_FALSE(data_source->IsStreaming()); | 577 EXPECT_FALSE(data_source->IsStreaming()); |
581 EXPECT_FALSE(demuxer_->IsStreaming()); | 578 EXPECT_FALSE(demuxer_->IsStreaming()); |
582 } | 579 } |
583 | 580 |
584 } // namespace media | 581 } // namespace media |
OLD | NEW |