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/base/fake_demuxer_stream.h" | 5 #include "media/base/fake_demuxer_stream.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
18 #include "media/base/bind_to_current_loop.h" | 18 #include "media/base/bind_to_current_loop.h" |
19 #include "media/base/decoder_buffer.h" | 19 #include "media/base/decoder_buffer.h" |
20 #include "media/base/encryption_scheme.h" | |
20 #include "media/base/media_util.h" | 21 #include "media/base/media_util.h" |
21 #include "media/base/test_helpers.h" | 22 #include "media/base/test_helpers.h" |
22 #include "media/base/timestamp_constants.h" | 23 #include "media/base/timestamp_constants.h" |
23 #include "media/base/video_frame.h" | 24 #include "media/base/video_frame.h" |
24 #include "ui/gfx/geometry/rect.h" | 25 #include "ui/gfx/geometry/rect.h" |
25 #include "ui/gfx/geometry/size.h" | 26 #include "ui/gfx/geometry/size.h" |
26 | 27 |
27 namespace media { | 28 namespace media { |
28 | 29 |
29 const int kStartTimestampMs = 0; | 30 const int kStartTimestampMs = 0; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); | 141 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); |
141 } | 142 } |
142 | 143 |
143 void FakeDemuxerStream::SeekToStart() { | 144 void FakeDemuxerStream::SeekToStart() { |
144 Reset(); | 145 Reset(); |
145 Initialize(); | 146 Initialize(); |
146 } | 147 } |
147 | 148 |
148 void FakeDemuxerStream::UpdateVideoDecoderConfig() { | 149 void FakeDemuxerStream::UpdateVideoDecoderConfig() { |
149 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); | 150 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); |
150 video_decoder_config_.Initialize(kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, | 151 video_decoder_config_.Initialize( |
151 PIXEL_FORMAT_YV12, COLOR_SPACE_UNSPECIFIED, | 152 kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, |
152 next_coded_size_, kVisibleRect, | 153 COLOR_SPACE_UNSPECIFIED, next_coded_size_, kVisibleRect, next_coded_size_, |
153 next_coded_size_, EmptyExtraData(), | 154 EmptyExtraData(), EncryptionScheme(is_encrypted_)); |
ddorwin
2016/03/01 02:17:41
For example, in this case, I'd rather store the en
dougsteed
2016/03/02 18:07:53
Done.
| |
154 is_encrypted_); | |
155 next_coded_size_.Enlarge(kWidthDelta, kHeightDelta); | 155 next_coded_size_.Enlarge(kWidthDelta, kHeightDelta); |
156 } | 156 } |
157 | 157 |
158 void FakeDemuxerStream::DoRead() { | 158 void FakeDemuxerStream::DoRead() { |
159 DCHECK(task_runner_->BelongsToCurrentThread()); | 159 DCHECK(task_runner_->BelongsToCurrentThread()); |
160 DCHECK(!read_cb_.is_null()); | 160 DCHECK(!read_cb_.is_null()); |
161 | 161 |
162 next_read_num_++; | 162 next_read_num_++; |
163 | 163 |
164 if (num_buffers_left_in_current_config_ == 0) { | 164 if (num_buffers_left_in_current_config_ == 0) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() { | 211 FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() { |
212 } | 212 } |
213 | 213 |
214 DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) { | 214 DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) { |
215 if (type == DemuxerStream::Type::AUDIO) | 215 if (type == DemuxerStream::Type::AUDIO) |
216 return nullptr; | 216 return nullptr; |
217 return &fake_video_stream_; | 217 return &fake_video_stream_; |
218 }; | 218 }; |
219 | 219 |
220 } // namespace media | 220 } // namespace media |
OLD | NEW |