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

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

Issue 10822026: Implement "Key Presence" step in "Encrypted Block Encounted" algorithm in EME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/ffmpeg_video_decoder.h" 5 #include "media/filters/ffmpeg_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 DCHECK_NE(state_, kUninitialized); 353 DCHECK_NE(state_, kUninitialized);
354 DCHECK_NE(state_, kDecodeFinished); 354 DCHECK_NE(state_, kDecodeFinished);
355 DCHECK(!read_cb_.is_null()); 355 DCHECK(!read_cb_.is_null());
356 356
357 if (!reset_cb_.is_null()) { 357 if (!reset_cb_.is_null()) {
358 base::ResetAndReturn(&read_cb_).Run(kOk, NULL); 358 base::ResetAndReturn(&read_cb_).Run(kOk, NULL);
359 DoReset(); 359 DoReset();
360 return; 360 return;
361 } 361 }
362 362
363 if (decrypt_status == Decryptor::kError) { 363 if (decrypt_status == Decryptor::kNoKey ||
364 decrypt_status == Decryptor::kError) {
364 state_ = kDecodeFinished; 365 state_ = kDecodeFinished;
365 base::ResetAndReturn(&read_cb_).Run(kDecryptError, NULL); 366 base::ResetAndReturn(&read_cb_).Run(kDecryptError, NULL);
366 return; 367 return;
367 } 368 }
368 369
369 DCHECK_EQ(Decryptor::kSuccess, decrypt_status); 370 DCHECK_EQ(Decryptor::kSuccess, decrypt_status);
370 DCHECK(buffer); 371 DCHECK(buffer);
371 DCHECK(buffer->GetDataSize()); 372 DCHECK(buffer->GetDataSize());
372 DCHECK(!buffer->GetDecryptConfig()); 373 DCHECK(!buffer->GetDecryptConfig());
373 DecodeBuffer(buffer); 374 DecodeBuffer(buffer);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 av_free(codec_context_); 542 av_free(codec_context_);
542 codec_context_ = NULL; 543 codec_context_ = NULL;
543 } 544 }
544 if (av_frame_) { 545 if (av_frame_) {
545 av_free(av_frame_); 546 av_free(av_frame_);
546 av_frame_ = NULL; 547 av_frame_ = NULL;
547 } 548 }
548 } 549 }
549 550
550 } // namespace media 551 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698