OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |