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 "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "media/base/demuxer_stream.h" | 10 #include "media/base/demuxer_stream.h" |
(...skipping 17 matching lines...) Expand all Loading... |
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::MessageLoopProxy>& message_loop); | 31 const scoped_refptr<base::MessageLoopProxy>& message_loop); |
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 const PipelineStatusCB& status_cb) OVERRIDE; | 36 const PipelineStatusCB& status_cb) OVERRIDE; |
37 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 37 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
38 const ReadCB& read_cb) OVERRIDE; | 38 const DecodeCB& decode_cb) OVERRIDE; |
39 virtual void Reset(const base::Closure& closure) OVERRIDE; | 39 virtual void Reset(const base::Closure& closure) OVERRIDE; |
40 virtual void Stop(const base::Closure& closure) OVERRIDE; | 40 virtual void Stop(const base::Closure& closure) OVERRIDE; |
41 virtual bool HasAlpha() const OVERRIDE; | 41 virtual bool HasAlpha() const OVERRIDE; |
42 | 42 |
43 private: | 43 private: |
44 enum DecoderState { | 44 enum DecoderState { |
45 kUninitialized, | 45 kUninitialized, |
46 kNormal, | 46 kNormal, |
47 kFlushCodec, | 47 kFlushCodec, |
48 kDecodeFinished, | 48 kDecodeFinished, |
(...skipping 16 matching lines...) Expand all Loading... |
65 void CopyVpxImageTo(const vpx_image* vpx_image, | 65 void CopyVpxImageTo(const vpx_image* vpx_image, |
66 const struct vpx_image* vpx_image_alpha, | 66 const struct vpx_image* vpx_image_alpha, |
67 scoped_refptr<VideoFrame>* video_frame); | 67 scoped_refptr<VideoFrame>* video_frame); |
68 | 68 |
69 scoped_refptr<base::MessageLoopProxy> message_loop_; | 69 scoped_refptr<base::MessageLoopProxy> message_loop_; |
70 base::WeakPtrFactory<VpxVideoDecoder> weak_factory_; | 70 base::WeakPtrFactory<VpxVideoDecoder> weak_factory_; |
71 base::WeakPtr<VpxVideoDecoder> weak_this_; | 71 base::WeakPtr<VpxVideoDecoder> weak_this_; |
72 | 72 |
73 DecoderState state_; | 73 DecoderState state_; |
74 | 74 |
75 ReadCB read_cb_; | 75 DecodeCB decode_cb_; |
76 base::Closure reset_cb_; | 76 base::Closure reset_cb_; |
77 | 77 |
78 VideoDecoderConfig config_; | 78 VideoDecoderConfig config_; |
79 | 79 |
80 vpx_codec_ctx* vpx_codec_; | 80 vpx_codec_ctx* vpx_codec_; |
81 vpx_codec_ctx* vpx_codec_alpha_; | 81 vpx_codec_ctx* vpx_codec_alpha_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); | 83 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace media | 86 } // namespace media |
87 | 87 |
88 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ | 88 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ |
OLD | NEW |