OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/filters/fake_demuxer_stream.h" | 5 #include "media/filters/fake_demuxer_stream.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "media/base/bind_to_loop.h" | 12 #include "media/base/bind_to_loop.h" |
13 #include "media/base/decoder_buffer.h" | 13 #include "media/base/decoder_buffer.h" |
14 #include "media/base/test_helpers.h" | 14 #include "media/base/test_helpers.h" |
| 15 #include "media/base/text_track.h" |
15 #include "media/base/video_frame.h" | 16 #include "media/base/video_frame.h" |
16 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
17 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 static const int kStartTimestampMs = 0; | 22 static const int kStartTimestampMs = 0; |
22 static const int kDurationMs = 30; | 23 static const int kDurationMs = 30; |
23 static const int kStartWidth = 320; | 24 static const int kStartWidth = 320; |
24 static const int kStartHeight = 240; | 25 static const int kStartHeight = 240; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 DCHECK(message_loop_->BelongsToCurrentThread()); | 64 DCHECK(message_loop_->BelongsToCurrentThread()); |
64 NOTREACHED(); | 65 NOTREACHED(); |
65 return AudioDecoderConfig(); | 66 return AudioDecoderConfig(); |
66 } | 67 } |
67 | 68 |
68 VideoDecoderConfig FakeDemuxerStream::video_decoder_config() { | 69 VideoDecoderConfig FakeDemuxerStream::video_decoder_config() { |
69 DCHECK(message_loop_->BelongsToCurrentThread()); | 70 DCHECK(message_loop_->BelongsToCurrentThread()); |
70 return video_decoder_config_; | 71 return video_decoder_config_; |
71 } | 72 } |
72 | 73 |
| 74 TextTrackConfig FakeDemuxerStream::text_track_config() { |
| 75 DCHECK(message_loop_->BelongsToCurrentThread()); |
| 76 return TextTrackConfig(); |
| 77 } |
| 78 |
73 // TODO(xhwang): Support audio if needed. | 79 // TODO(xhwang): Support audio if needed. |
74 DemuxerStream::Type FakeDemuxerStream::type() { | 80 DemuxerStream::Type FakeDemuxerStream::type() { |
75 DCHECK(message_loop_->BelongsToCurrentThread()); | 81 DCHECK(message_loop_->BelongsToCurrentThread()); |
76 return VIDEO; | 82 return VIDEO; |
77 } | 83 } |
78 | 84 |
79 void FakeDemuxerStream::EnableBitstreamConverter() { | 85 void FakeDemuxerStream::EnableBitstreamConverter() { |
80 DCHECK(message_loop_->BelongsToCurrentThread()); | 86 DCHECK(message_loop_->BelongsToCurrentThread()); |
81 } | 87 } |
82 | 88 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 154 |
149 num_buffers_left_in_current_config_--; | 155 num_buffers_left_in_current_config_--; |
150 if (num_buffers_left_in_current_config_ == 0) | 156 if (num_buffers_left_in_current_config_ == 0) |
151 num_configs_left_--; | 157 num_configs_left_--; |
152 | 158 |
153 num_buffers_returned_++; | 159 num_buffers_returned_++; |
154 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); | 160 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); |
155 } | 161 } |
156 | 162 |
157 } // namespace media | 163 } // namespace media |
OLD | NEW |