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 #ifndef MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ |
6 #define MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "media/base/demuxer_stream.h" | 9 #include "media/base/demuxer_stream.h" |
10 #include "media/base/video_decoder.h" | 10 #include "media/base/video_decoder.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // decoder is faster than the libvpx VP8 decoder. | 27 // decoder is faster than the libvpx VP8 decoder. |
28 class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder { | 28 class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder { |
29 public: | 29 public: |
30 explicit VpxVideoDecoder( | 30 explicit VpxVideoDecoder( |
31 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 31 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
32 virtual ~VpxVideoDecoder(); | 32 virtual ~VpxVideoDecoder(); |
33 | 33 |
34 // VideoDecoder implementation. | 34 // VideoDecoder implementation. |
35 virtual void Initialize(const VideoDecoderConfig& config, | 35 virtual void Initialize(const VideoDecoderConfig& config, |
36 bool low_delay, | 36 bool low_delay, |
37 const PipelineStatusCB& status_cb) OVERRIDE; | 37 const PipelineStatusCB& status_cb, |
| 38 const OutputCB& output_cb) OVERRIDE; |
38 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 39 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
39 const DecodeCB& decode_cb) OVERRIDE; | 40 const DecodeCB& decode_cb) OVERRIDE; |
40 virtual void Reset(const base::Closure& closure) OVERRIDE; | 41 virtual void Reset(const base::Closure& closure) OVERRIDE; |
41 virtual void Stop() OVERRIDE; | 42 virtual void Stop() OVERRIDE; |
42 | 43 |
43 private: | 44 private: |
44 enum DecoderState { | 45 enum DecoderState { |
45 kUninitialized, | 46 kUninitialized, |
46 kNormal, | 47 kNormal, |
47 kFlushCodec, | 48 kFlushCodec, |
(...skipping 12 matching lines...) Expand all Loading... |
60 scoped_refptr<VideoFrame>* video_frame); | 61 scoped_refptr<VideoFrame>* video_frame); |
61 | 62 |
62 void CopyVpxImageTo(const vpx_image* vpx_image, | 63 void CopyVpxImageTo(const vpx_image* vpx_image, |
63 const struct vpx_image* vpx_image_alpha, | 64 const struct vpx_image* vpx_image_alpha, |
64 scoped_refptr<VideoFrame>* video_frame); | 65 scoped_refptr<VideoFrame>* video_frame); |
65 | 66 |
66 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 67 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
67 | 68 |
68 DecoderState state_; | 69 DecoderState state_; |
69 | 70 |
| 71 OutputCB output_cb_; |
| 72 |
70 // TODO(xhwang): Merge DecodeBuffer() into Decode() and remove this. | 73 // TODO(xhwang): Merge DecodeBuffer() into Decode() and remove this. |
71 DecodeCB decode_cb_; | 74 DecodeCB decode_cb_; |
72 | 75 |
73 VideoDecoderConfig config_; | 76 VideoDecoderConfig config_; |
74 | 77 |
75 vpx_codec_ctx* vpx_codec_; | 78 vpx_codec_ctx* vpx_codec_; |
76 vpx_codec_ctx* vpx_codec_alpha_; | 79 vpx_codec_ctx* vpx_codec_alpha_; |
77 | 80 |
78 // Memory pool used for VP9 decoding. | 81 // Memory pool used for VP9 decoding. |
79 class MemoryPool; | 82 class MemoryPool; |
80 scoped_refptr<MemoryPool> memory_pool_; | 83 scoped_refptr<MemoryPool> memory_pool_; |
81 | 84 |
82 VideoFramePool frame_pool_; | 85 VideoFramePool frame_pool_; |
83 | 86 |
84 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); | 87 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); |
85 }; | 88 }; |
86 | 89 |
87 } // namespace media | 90 } // namespace media |
88 | 91 |
89 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ | 92 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ |
OLD | NEW |