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

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

Issue 332253002: Fix the flushing process of DecryptingAudioDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Returns EOS frame after decoder flushed. 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/decrypting_video_decoder.h" 5 #include "media/filters/decrypting_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/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 DecodePendingBuffer(); 270 DecodePendingBuffer();
271 return; 271 return;
272 } 272 }
273 273
274 state_ = kWaitingForKey; 274 state_ = kWaitingForKey;
275 return; 275 return;
276 } 276 }
277 277
278 if (status == Decryptor::kNeedMoreData) { 278 if (status == Decryptor::kNeedMoreData) {
279 DVLOG(2) << "DeliverFrame() - kNeedMoreData"; 279 DVLOG(2) << "DeliverFrame() - kNeedMoreData";
280 state_ = scoped_pending_buffer_to_decode->end_of_stream() ? kDecodeFinished 280 if (scoped_pending_buffer_to_decode->end_of_stream()) {
281 : kIdle; 281 state_ = kDecodeFinished;
282 output_cb_.Run(media::VideoFrame::CreateEOSFrame());
283 } else {
284 state_ = kIdle;
285 }
282 base::ResetAndReturn(&decode_cb_).Run(kOk); 286 base::ResetAndReturn(&decode_cb_).Run(kOk);
283 return; 287 return;
284 } 288 }
285 289
286 DCHECK_EQ(status, Decryptor::kSuccess); 290 DCHECK_EQ(status, Decryptor::kSuccess);
287 // No frame returned with kSuccess should be end-of-stream frame. 291 // No frame returned with kSuccess should be end-of-stream frame.
288 DCHECK(!frame->end_of_stream()); 292 DCHECK(!frame->end_of_stream());
289 output_cb_.Run(frame); 293 output_cb_.Run(frame);
290 294
291 if (scoped_pending_buffer_to_decode->end_of_stream()) { 295 if (scoped_pending_buffer_to_decode->end_of_stream()) {
(...skipping 24 matching lines...) Expand all
316 } 320 }
317 321
318 void DecryptingVideoDecoder::DoReset() { 322 void DecryptingVideoDecoder::DoReset() {
319 DCHECK(init_cb_.is_null()); 323 DCHECK(init_cb_.is_null());
320 DCHECK(decode_cb_.is_null()); 324 DCHECK(decode_cb_.is_null());
321 state_ = kIdle; 325 state_ = kIdle;
322 base::ResetAndReturn(&reset_cb_).Run(); 326 base::ResetAndReturn(&reset_cb_).Run();
323 } 327 }
324 328
325 } // namespace media 329 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decrypting_audio_decoder_unittest.cc ('k') | media/filters/decrypting_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698