| 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" |
| 11 #include "media/base/video_decoder.h" | 11 #include "media/base/video_decoder.h" |
| 12 #include "media/base/video_frame.h" | 12 #include "media/base/video_frame.h" |
| 13 | 13 |
| 14 struct vpx_codec_ctx; | 14 struct vpx_codec_ctx; |
| 15 struct vpx_image; | 15 struct vpx_image; |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class MessageLoopProxy; | 18 class MessageLoopProxy; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace media { | 21 namespace media { |
| 22 | 22 |
| 23 class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder { | 23 class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder { |
| 24 public: | 24 public: |
| 25 explicit VpxVideoDecoder( | 25 explicit VpxVideoDecoder( |
| 26 const scoped_refptr<base::MessageLoopProxy>& message_loop); | 26 const scoped_refptr<base::MessageLoopProxy>& message_loop); |
| 27 virtual ~VpxVideoDecoder(); | 27 virtual ~VpxVideoDecoder(); |
| 28 | 28 |
| 29 // VideoDecoder implementation. | 29 // VideoDecoder implementation. |
| 30 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 30 virtual void Initialize(DemuxerStream* stream, |
| 31 const PipelineStatusCB& status_cb, | 31 const PipelineStatusCB& status_cb, |
| 32 const StatisticsCB& statistics_cb) OVERRIDE; | 32 const StatisticsCB& statistics_cb) OVERRIDE; |
| 33 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 33 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
| 34 virtual void Reset(const base::Closure& closure) OVERRIDE; | 34 virtual void Reset(const base::Closure& closure) OVERRIDE; |
| 35 virtual void Stop(const base::Closure& closure) OVERRIDE; | 35 virtual void Stop(const base::Closure& closure) OVERRIDE; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 enum DecoderState { | 38 enum DecoderState { |
| 39 kUninitialized, | 39 kUninitialized, |
| 40 kNormal, | 40 kNormal, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 69 base::WeakPtrFactory<VpxVideoDecoder> weak_factory_; | 69 base::WeakPtrFactory<VpxVideoDecoder> weak_factory_; |
| 70 base::WeakPtr<VpxVideoDecoder> weak_this_; | 70 base::WeakPtr<VpxVideoDecoder> weak_this_; |
| 71 | 71 |
| 72 DecoderState state_; | 72 DecoderState state_; |
| 73 | 73 |
| 74 StatisticsCB statistics_cb_; | 74 StatisticsCB statistics_cb_; |
| 75 ReadCB read_cb_; | 75 ReadCB read_cb_; |
| 76 base::Closure reset_cb_; | 76 base::Closure reset_cb_; |
| 77 | 77 |
| 78 // Pointer to the demuxer stream that will feed us compressed buffers. | 78 // Pointer to the demuxer stream that will feed us compressed buffers. |
| 79 scoped_refptr<DemuxerStream> demuxer_stream_; | 79 DemuxerStream* demuxer_stream_; |
| 80 | 80 |
| 81 vpx_codec_ctx* vpx_codec_; | 81 vpx_codec_ctx* vpx_codec_; |
| 82 vpx_codec_ctx* vpx_codec_alpha_; | 82 vpx_codec_ctx* vpx_codec_alpha_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); | 84 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace media | 87 } // namespace media |
| 88 | 88 |
| 89 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ | 89 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ |
| OLD | NEW |