| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <deque> | 7 #include <deque> |
| 8 | 8 |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "media/base/callback.h" | 10 #include "media/base/callback.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 decode_engine_(engine) { | 29 decode_engine_(engine) { |
| 30 memset(&info_, 0, sizeof(info_)); | 30 memset(&info_, 0, sizeof(info_)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 FFmpegVideoDecoder::~FFmpegVideoDecoder() { | 33 FFmpegVideoDecoder::~FFmpegVideoDecoder() { |
| 34 } | 34 } |
| 35 | 35 |
| 36 void FFmpegVideoDecoder::Initialize(DemuxerStream* demuxer_stream, | 36 void FFmpegVideoDecoder::Initialize(DemuxerStream* demuxer_stream, |
| 37 FilterCallback* callback) { | 37 FilterCallback* callback) { |
| 38 if (MessageLoop::current() != message_loop()) { | 38 if (MessageLoop::current() != message_loop()) { |
| 39 message_loop()->PostTask( | 39 message_loop()->PostTask(FROM_HERE, |
| 40 FROM_HERE, | 40 NewRunnableMethod(this, |
| 41 NewRunnableMethod(this, | 41 &FFmpegVideoDecoder::Initialize, |
| 42 &FFmpegVideoDecoder::Initialize, | 42 demuxer_stream, |
| 43 make_scoped_refptr(demuxer_stream), | 43 callback)); |
| 44 callback)); | |
| 45 return; | 44 return; |
| 46 } | 45 } |
| 47 | 46 |
| 48 DCHECK_EQ(MessageLoop::current(), message_loop()); | 47 DCHECK_EQ(MessageLoop::current(), message_loop()); |
| 49 DCHECK(!demuxer_stream_); | 48 DCHECK(!demuxer_stream_); |
| 50 DCHECK(!initialize_callback_.get()); | 49 DCHECK(!initialize_callback_.get()); |
| 51 | 50 |
| 52 demuxer_stream_ = demuxer_stream; | 51 demuxer_stream_ = demuxer_stream; |
| 53 initialize_callback_.reset(callback); | 52 initialize_callback_.reset(callback); |
| 54 | 53 |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 } | 441 } |
| 443 | 442 |
| 444 // static | 443 // static |
| 445 bool FFmpegVideoDecoder::IsMediaFormatSupported(const MediaFormat& format) { | 444 bool FFmpegVideoDecoder::IsMediaFormatSupported(const MediaFormat& format) { |
| 446 std::string mime_type; | 445 std::string mime_type; |
| 447 return format.GetAsString(MediaFormat::kMimeType, &mime_type) && | 446 return format.GetAsString(MediaFormat::kMimeType, &mime_type) && |
| 448 mime_type::kFFmpegVideo == mime_type; | 447 mime_type::kFFmpegVideo == mime_type; |
| 449 } | 448 } |
| 450 | 449 |
| 451 } // namespace media | 450 } // namespace media |
| OLD | NEW |