| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/threading/thread.h" | 5 #include "base/threading/thread.h" |
| 6 #include "chromecast/media/cma/test/demuxer_stream_for_test.h" | 6 #include "chromecast/media/cma/test/demuxer_stream_for_test.h" |
| 7 | 7 |
| 8 namespace chromecast { | 8 namespace chromecast { |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool DemuxerStreamForTest::SupportsConfigChanges() { | 65 bool DemuxerStreamForTest::SupportsConfigChanges() { |
| 66 return true; | 66 return true; |
| 67 } | 67 } |
| 68 | 68 |
| 69 ::media::VideoRotation DemuxerStreamForTest::video_rotation() { | 69 ::media::VideoRotation DemuxerStreamForTest::video_rotation() { |
| 70 return ::media::VIDEO_ROTATION_0; | 70 return ::media::VIDEO_ROTATION_0; |
| 71 } | 71 } |
| 72 | 72 |
| 73 size_t DemuxerStreamForTest::GetMemoryLimit() const { |
| 74 NOTIMPLEMENTED(); |
| 75 return 0; |
| 76 } |
| 77 |
| 78 void DemuxerStreamForTest::SetMemoryLimit(size_t memory_limit) { |
| 79 NOTIMPLEMENTED(); |
| 80 } |
| 81 |
| 73 void DemuxerStreamForTest::DoRead(const ReadCB& read_cb) { | 82 void DemuxerStreamForTest::DoRead(const ReadCB& read_cb) { |
| 74 has_pending_read_ = false; | 83 has_pending_read_ = false; |
| 75 | 84 |
| 76 if (total_frame_count_ != -1 && frame_count_ >= total_frame_count_) { | 85 if (total_frame_count_ != -1 && frame_count_ >= total_frame_count_) { |
| 77 // End of stream | 86 // End of stream |
| 78 read_cb.Run(kOk, ::media::DecoderBuffer::CreateEOSBuffer()); | 87 read_cb.Run(kOk, ::media::DecoderBuffer::CreateEOSBuffer()); |
| 79 return; | 88 return; |
| 80 } | 89 } |
| 81 | 90 |
| 82 scoped_refptr<::media::DecoderBuffer> buffer(new ::media::DecoderBuffer(16)); | 91 scoped_refptr<::media::DecoderBuffer> buffer(new ::media::DecoderBuffer(16)); |
| 83 buffer->set_timestamp(frame_count_ * base::TimeDelta::FromMilliseconds( | 92 buffer->set_timestamp(frame_count_ * base::TimeDelta::FromMilliseconds( |
| 84 kDemuxerStreamForTestFrameDuration)); | 93 kDemuxerStreamForTestFrameDuration)); |
| 85 frame_count_++; | 94 frame_count_++; |
| 86 read_cb.Run(kOk, buffer); | 95 read_cb.Run(kOk, buffer); |
| 87 } | 96 } |
| 88 | 97 |
| 89 } // namespace media | 98 } // namespace media |
| 90 } // namespace chromecast | 99 } // namespace chromecast |
| OLD | NEW |