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" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 if (!read_cb_.is_null()) | 117 if (!read_cb_.is_null()) |
118 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); | 118 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); |
119 } | 119 } |
120 | 120 |
121 void FakeDemuxerStream::UpdateVideoDecoderConfig() { | 121 void FakeDemuxerStream::UpdateVideoDecoderConfig() { |
122 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); | 122 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); |
123 video_decoder_config_.Initialize( | 123 video_decoder_config_.Initialize( |
124 kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, VideoFrame::YV12, | 124 kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, VideoFrame::YV12, |
125 next_coded_size_, kVisibleRect, next_coded_size_, | 125 next_coded_size_, kVisibleRect, next_coded_size_, |
126 NULL, 0, is_encrypted_, false); | 126 NULL, 0, is_encrypted_, false, false); |
127 next_coded_size_.Enlarge(kWidthDelta, kHeightDelta); | 127 next_coded_size_.Enlarge(kWidthDelta, kHeightDelta); |
128 } | 128 } |
129 | 129 |
130 void FakeDemuxerStream::DoRead() { | 130 void FakeDemuxerStream::DoRead() { |
131 DCHECK(task_runner_->BelongsToCurrentThread()); | 131 DCHECK(task_runner_->BelongsToCurrentThread()); |
132 DCHECK(!read_cb_.is_null()); | 132 DCHECK(!read_cb_.is_null()); |
133 | 133 |
134 next_read_num_++; | 134 next_read_num_++; |
135 | 135 |
136 if (num_buffers_left_in_current_config_ == 0) { | 136 if (num_buffers_left_in_current_config_ == 0) { |
(...skipping 27 matching lines...) Expand all Loading... |
164 | 164 |
165 num_buffers_left_in_current_config_--; | 165 num_buffers_left_in_current_config_--; |
166 if (num_buffers_left_in_current_config_ == 0) | 166 if (num_buffers_left_in_current_config_ == 0) |
167 num_configs_left_--; | 167 num_configs_left_--; |
168 | 168 |
169 num_buffers_returned_++; | 169 num_buffers_returned_++; |
170 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); | 170 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); |
171 } | 171 } |
172 | 172 |
173 } // namespace media | 173 } // namespace media |
OLD | NEW |