Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: media/filters/fake_video_decoder.cc

Issue 339653003: No EOS frame in {Audio|Video}Decoder::OutputCB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_video_decoder.h" 5 #include "media/filters/fake_video_decoder.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/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 output_cb_.Run(decoded_frames_.front()); 218 output_cb_.Run(decoded_frames_.front());
219 decoded_frames_.pop_front(); 219 decoded_frames_.pop_front();
220 } else if (state_ == STATE_END_OF_STREAM) { 220 } else if (state_ == STATE_END_OF_STREAM) {
221 // Drain the queue if this was the last request in the stream, otherwise 221 // Drain the queue if this was the last request in the stream, otherwise
222 // just pop the last frame from the queue. 222 // just pop the last frame from the queue.
223 if (held_decode_callbacks_.empty()) { 223 if (held_decode_callbacks_.empty()) {
224 while (!decoded_frames_.empty()) { 224 while (!decoded_frames_.empty()) {
225 output_cb_.Run(decoded_frames_.front()); 225 output_cb_.Run(decoded_frames_.front());
226 decoded_frames_.pop_front(); 226 decoded_frames_.pop_front();
227 } 227 }
228 output_cb_.Run(VideoFrame::CreateEOSFrame());
229 } else if (!decoded_frames_.empty()) { 228 } else if (!decoded_frames_.empty()) {
230 output_cb_.Run(decoded_frames_.front()); 229 output_cb_.Run(decoded_frames_.front());
231 decoded_frames_.pop_front(); 230 decoded_frames_.pop_front();
232 } 231 }
233 } 232 }
234 233
235 decode_cb.Run(kOk); 234 decode_cb.Run(kOk);
236 } 235 }
237 236
238 void FakeVideoDecoder::DoReset() { 237 void FakeVideoDecoder::DoReset() {
239 DCHECK(thread_checker_.CalledOnValidThread()); 238 DCHECK(thread_checker_.CalledOnValidThread());
240 DCHECK(held_decode_callbacks_.empty()); 239 DCHECK(held_decode_callbacks_.empty());
241 DCHECK(!reset_cb_.IsNull()); 240 DCHECK(!reset_cb_.IsNull());
242 241
243 reset_cb_.RunOrHold(); 242 reset_cb_.RunOrHold();
244 } 243 }
245 244
246 } // namespace media 245 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/fake_demuxer_stream_unittest.cc ('k') | media/filters/fake_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698