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/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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 reset_cb_.Reset(); | 221 reset_cb_.Reset(); |
222 } | 222 } |
223 | 223 |
224 void FFmpegVideoDecoder::Stop(const base::Closure& closure) { | 224 void FFmpegVideoDecoder::Stop(const base::Closure& closure) { |
225 if (MessageLoop::current() != message_loop_) { | 225 if (MessageLoop::current() != message_loop_) { |
226 message_loop_->PostTask(FROM_HERE, base::Bind( | 226 message_loop_->PostTask(FROM_HERE, base::Bind( |
227 &FFmpegVideoDecoder::Stop, this, closure)); | 227 &FFmpegVideoDecoder::Stop, this, closure)); |
228 return; | 228 return; |
229 } | 229 } |
230 | 230 |
231 // Tell the ProxyDecryptor to abort any pending decryptions. | |
scherkus (not reviewing)
2012/08/02 18:05:32
we don't know this is a ProxyDecyptor
I also don'
xhwang
2012/08/03 20:08:10
Done.
| |
232 if (decryptor_) | |
233 decryptor_->Stop(); | |
234 | |
231 stop_cb_ = closure; | 235 stop_cb_ = closure; |
232 | 236 |
233 // Defer stopping if a read is pending. | 237 // Defer stopping if a read is pending. |
234 if (!read_cb_.is_null()) | 238 if (!read_cb_.is_null()) |
235 return; | 239 return; |
236 | 240 |
237 DoStop(); | 241 DoStop(); |
238 } | 242 } |
239 | 243 |
240 void FFmpegVideoDecoder::DoStop() { | 244 void FFmpegVideoDecoder::DoStop() { |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
514 av_free(codec_context_); | 518 av_free(codec_context_); |
515 codec_context_ = NULL; | 519 codec_context_ = NULL; |
516 } | 520 } |
517 if (av_frame_) { | 521 if (av_frame_) { |
518 av_free(av_frame_); | 522 av_free(av_frame_); |
519 av_frame_ = NULL; | 523 av_frame_ = NULL; |
520 } | 524 } |
521 } | 525 } |
522 | 526 |
523 } // namespace media | 527 } // namespace media |
OLD | NEW |