| OLD | NEW |
| 1 // Copyright (c) 2009 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_FILTERS_VIDEO_DECODER_IMPL_H_ | 5 #ifndef MEDIA_FILTERS_VIDEO_DECODER_IMPL_H_ |
| 6 #define MEDIA_FILTERS_VIDEO_DECODER_IMPL_H_ | 6 #define MEDIA_FILTERS_VIDEO_DECODER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "media/base/pts_heap.h" | 9 #include "media/base/pts_heap.h" |
| 10 #include "media/base/video_frame.h" |
| 10 #include "media/filters/decoder_base.h" | 11 #include "media/filters/decoder_base.h" |
| 11 #include "testing/gtest/include/gtest/gtest_prod.h" | 12 #include "testing/gtest/include/gtest/gtest_prod.h" |
| 12 | 13 |
| 13 // FFmpeg types. | 14 // FFmpeg types. |
| 14 struct AVFrame; | 15 struct AVFrame; |
| 15 struct AVRational; | 16 struct AVRational; |
| 16 | 17 |
| 17 namespace media { | 18 namespace media { |
| 18 | 19 |
| 19 class VideoDecodeEngine; | 20 class VideoDecodeEngine; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 kFlushCodec, | 54 kFlushCodec, |
| 54 kDecodeFinished, | 55 kDecodeFinished, |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 // Implement DecoderBase template methods. | 58 // Implement DecoderBase template methods. |
| 58 virtual void DoInitialize(DemuxerStream* demuxer_stream, bool* success, | 59 virtual void DoInitialize(DemuxerStream* demuxer_stream, bool* success, |
| 59 Task* done_cb); | 60 Task* done_cb); |
| 60 virtual void DoSeek(base::TimeDelta time, Task* done_cb); | 61 virtual void DoSeek(base::TimeDelta time, Task* done_cb); |
| 61 virtual void DoDecode(Buffer* buffer, Task* done_cb); | 62 virtual void DoDecode(Buffer* buffer, Task* done_cb); |
| 62 | 63 |
| 63 virtual bool EnqueueVideoFrame(VideoSurface::Format surface_format, | 64 virtual bool EnqueueVideoFrame(VideoFrame::Format surface_format, |
| 64 const TimeTuple& time, | 65 const TimeTuple& time, |
| 65 const AVFrame* frame); | 66 const AVFrame* frame); |
| 66 | 67 |
| 67 // Create an empty video frame and queue it. | 68 // Create an empty video frame and queue it. |
| 68 virtual void EnqueueEmptyFrame(); | 69 virtual void EnqueueEmptyFrame(); |
| 69 | 70 |
| 70 virtual void CopyPlane(size_t plane, const VideoSurface& surface, | 71 virtual void CopyPlane(size_t plane, const VideoFrame& video_frame, |
| 71 const AVFrame* frame); | 72 const AVFrame* frame); |
| 72 | 73 |
| 73 // Methods that pickup after the decode engine has finished its action. | 74 // Methods that pickup after the decode engine has finished its action. |
| 74 virtual void OnInitializeComplete(bool* success /* Not owned */, | 75 virtual void OnInitializeComplete(bool* success /* Not owned */, |
| 75 Task* done_cb); | 76 Task* done_cb); |
| 76 virtual void OnDecodeComplete(AVFrame* yuv_frame, bool* got_frame, | 77 virtual void OnDecodeComplete(AVFrame* yuv_frame, bool* got_frame, |
| 77 Task* done_cb); | 78 Task* done_cb); |
| 78 | 79 |
| 79 // Attempt to get the PTS and Duration for this frame by examining the time | 80 // Attempt to get the PTS and Duration for this frame by examining the time |
| 80 // info provided via packet stream (stored in |pts_heap|), or the info | 81 // info provided via packet stream (stored in |pts_heap|), or the info |
| (...skipping 24 matching lines...) Expand all Loading... |
| 105 scoped_ptr<AVRational> time_base_; // Pointer to avoid needing full type. | 106 scoped_ptr<AVRational> time_base_; // Pointer to avoid needing full type. |
| 106 DecoderState state_; | 107 DecoderState state_; |
| 107 scoped_ptr<VideoDecodeEngine> decode_engine_; | 108 scoped_ptr<VideoDecodeEngine> decode_engine_; |
| 108 | 109 |
| 109 DISALLOW_COPY_AND_ASSIGN(VideoDecoderImpl); | 110 DISALLOW_COPY_AND_ASSIGN(VideoDecoderImpl); |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 } // namespace media | 113 } // namespace media |
| 113 | 114 |
| 114 #endif // MEDIA_FILTERS_VIDEO_DECODER_IMPL_H_ | 115 #endif // MEDIA_FILTERS_VIDEO_DECODER_IMPL_H_ |
| OLD | NEW |