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 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); | 140 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); |
141 } | 141 } |
142 | 142 |
143 void FakeDemuxerStream::SeekToStart() { | 143 void FakeDemuxerStream::SeekToStart() { |
144 Reset(); | 144 Reset(); |
145 Initialize(); | 145 Initialize(); |
146 } | 146 } |
147 | 147 |
148 void FakeDemuxerStream::UpdateVideoDecoderConfig() { | 148 void FakeDemuxerStream::UpdateVideoDecoderConfig() { |
149 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); | 149 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); |
150 video_decoder_config_.Initialize( | 150 video_decoder_config_.Initialize(kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, |
151 kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, | 151 PIXEL_FORMAT_YV12, COLOR_SPACE_UNSPECIFIED, |
152 COLOR_SPACE_UNSPECIFIED, next_coded_size_, kVisibleRect, next_coded_size_, | 152 next_coded_size_, kVisibleRect, |
153 EmptyExtraData(), | 153 next_coded_size_, EmptyExtraData(), |
154 is_encrypted_ ? AesCtrEncryptionScheme() : Unencrypted()); | 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 |