| 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 #ifndef MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_ | 5 #ifndef MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_ |
| 6 #define MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_ | 6 #define MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 virtual void Initialize(MessageLoop* message_loop, | 29 virtual void Initialize(MessageLoop* message_loop, |
| 30 VideoDecodeEngine::EventHandler* event_handler, | 30 VideoDecodeEngine::EventHandler* event_handler, |
| 31 VideoDecodeContext* context, | 31 VideoDecodeContext* context, |
| 32 const VideoCodecConfig& config); | 32 const VideoCodecConfig& config); |
| 33 virtual void ConsumeVideoSample(scoped_refptr<Buffer> buffer); | 33 virtual void ConsumeVideoSample(scoped_refptr<Buffer> buffer); |
| 34 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame); | 34 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame); |
| 35 virtual void Uninitialize(); | 35 virtual void Uninitialize(); |
| 36 virtual void Flush(); | 36 virtual void Flush(); |
| 37 virtual void Seek(); | 37 virtual void Seek(); |
| 38 | 38 |
| 39 virtual AVCodecContext* codec_context() const { return codec_context_; } | 39 virtual AVCodecContext* codec_context() const; |
| 40 | 40 |
| 41 virtual void SetCodecContextForTest(AVCodecContext* context) { | 41 virtual void SetCodecContextForTest(AVCodecContext* context); |
| 42 codec_context_ = context; | |
| 43 } | |
| 44 | 42 |
| 45 VideoFrame::Format GetSurfaceFormat() const; | 43 VideoFrame::Format GetSurfaceFormat() const; |
| 46 private: | 44 private: |
| 47 void DecodeFrame(scoped_refptr<Buffer> buffer); | 45 void DecodeFrame(scoped_refptr<Buffer> buffer); |
| 48 void ReadInput(); | 46 void ReadInput(); |
| 49 void TryToFinishPendingFlush(); | 47 void TryToFinishPendingFlush(); |
| 50 | 48 |
| 51 AVCodecContext* codec_context_; | 49 AVCodecContext* codec_context_; |
| 52 AVStream* av_stream_; | 50 AVStream* av_stream_; |
| 53 scoped_ptr_malloc<AVFrame, ScopedPtrAVFree> av_frame_; | 51 scoped_ptr_malloc<AVFrame, ScopedPtrAVFree> av_frame_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 77 | 75 |
| 78 // Whether flush operation is pending. | 76 // Whether flush operation is pending. |
| 79 bool flush_pending_; | 77 bool flush_pending_; |
| 80 | 78 |
| 81 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecodeEngine); | 79 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecodeEngine); |
| 82 }; | 80 }; |
| 83 | 81 |
| 84 } // namespace media | 82 } // namespace media |
| 85 | 83 |
| 86 #endif // MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_ | 84 #endif // MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_ |
| OLD | NEW |