| 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, | 37 const PipelineStatusCB& status_cb) OVERRIDE; |
| 38 const OutputCB& output_cb) OVERRIDE; | |
| 39 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 38 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
| 40 const DecodeCB& decode_cb) OVERRIDE; | 39 const DecodeCB& decode_cb) OVERRIDE; |
| 41 virtual void Reset(const base::Closure& closure) OVERRIDE; | 40 virtual void Reset(const base::Closure& closure) OVERRIDE; |
| 42 virtual void Stop() OVERRIDE; | 41 virtual void Stop() OVERRIDE; |
| 43 | 42 |
| 44 private: | 43 private: |
| 45 enum DecoderState { | 44 enum DecoderState { |
| 46 kUninitialized, | 45 kUninitialized, |
| 47 kNormal, | 46 kNormal, |
| 48 kFlushCodec, | 47 kFlushCodec, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 61 scoped_refptr<VideoFrame>* video_frame); | 60 scoped_refptr<VideoFrame>* video_frame); |
| 62 | 61 |
| 63 void CopyVpxImageTo(const vpx_image* vpx_image, | 62 void CopyVpxImageTo(const vpx_image* vpx_image, |
| 64 const struct vpx_image* vpx_image_alpha, | 63 const struct vpx_image* vpx_image_alpha, |
| 65 scoped_refptr<VideoFrame>* video_frame); | 64 scoped_refptr<VideoFrame>* video_frame); |
| 66 | 65 |
| 67 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 66 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 68 | 67 |
| 69 DecoderState state_; | 68 DecoderState state_; |
| 70 | 69 |
| 71 OutputCB output_cb_; | |
| 72 | |
| 73 // TODO(xhwang): Merge DecodeBuffer() into Decode() and remove this. | 70 // TODO(xhwang): Merge DecodeBuffer() into Decode() and remove this. |
| 74 DecodeCB decode_cb_; | 71 DecodeCB decode_cb_; |
| 75 | 72 |
| 76 VideoDecoderConfig config_; | 73 VideoDecoderConfig config_; |
| 77 | 74 |
| 78 vpx_codec_ctx* vpx_codec_; | 75 vpx_codec_ctx* vpx_codec_; |
| 79 vpx_codec_ctx* vpx_codec_alpha_; | 76 vpx_codec_ctx* vpx_codec_alpha_; |
| 80 | 77 |
| 81 // Memory pool used for VP9 decoding. | 78 // Memory pool used for VP9 decoding. |
| 82 class MemoryPool; | 79 class MemoryPool; |
| 83 scoped_refptr<MemoryPool> memory_pool_; | 80 scoped_refptr<MemoryPool> memory_pool_; |
| 84 | 81 |
| 85 VideoFramePool frame_pool_; | 82 VideoFramePool frame_pool_; |
| 86 | 83 |
| 87 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); | 84 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); |
| 88 }; | 85 }; |
| 89 | 86 |
| 90 } // namespace media | 87 } // namespace media |
| 91 | 88 |
| 92 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ | 89 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ |
| OLD | NEW |