| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 if (!read_cb_.is_null()) | 139 if (!read_cb_.is_null()) |
| 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::SeekToEndOfStream() { |
| 149 num_configs_left_ = 0; |
| 150 num_buffers_left_in_current_config_ = 0; |
| 151 } |
| 152 |
| 148 void FakeDemuxerStream::UpdateVideoDecoderConfig() { | 153 void FakeDemuxerStream::UpdateVideoDecoderConfig() { |
| 149 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); | 154 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); |
| 150 video_decoder_config_.Initialize( | 155 video_decoder_config_.Initialize( |
| 151 kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, | 156 kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, |
| 152 COLOR_SPACE_UNSPECIFIED, next_coded_size_, kVisibleRect, next_coded_size_, | 157 COLOR_SPACE_UNSPECIFIED, next_coded_size_, kVisibleRect, next_coded_size_, |
| 153 EmptyExtraData(), | 158 EmptyExtraData(), |
| 154 is_encrypted_ ? AesCtrEncryptionScheme() : Unencrypted()); | 159 is_encrypted_ ? AesCtrEncryptionScheme() : Unencrypted()); |
| 155 next_coded_size_.Enlarge(kWidthDelta, kHeightDelta); | 160 next_coded_size_.Enlarge(kWidthDelta, kHeightDelta); |
| 156 } | 161 } |
| 157 | 162 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() { | 216 FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() { |
| 212 } | 217 } |
| 213 | 218 |
| 214 DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) { | 219 DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) { |
| 215 if (type == DemuxerStream::Type::AUDIO) | 220 if (type == DemuxerStream::Type::AUDIO) |
| 216 return nullptr; | 221 return nullptr; |
| 217 return &fake_video_stream_; | 222 return &fake_video_stream_; |
| 218 }; | 223 }; |
| 219 | 224 |
| 220 } // namespace media | 225 } // namespace media |
| OLD | NEW |