| 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 | 13 |
| 13 struct vpx_codec_ctx; | 14 struct vpx_codec_ctx; |
| 14 struct vpx_image; | 15 struct vpx_image; |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class MessageLoopProxy; | 18 class MessageLoopProxy; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace media { | 21 namespace media { |
| 21 | 22 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 const scoped_refptr<DecoderBuffer>& buffer); | 55 const scoped_refptr<DecoderBuffer>& buffer); |
| 55 | 56 |
| 56 void DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer); | 57 void DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer); |
| 57 bool Decode(const scoped_refptr<DecoderBuffer>& buffer, | 58 bool Decode(const scoped_refptr<DecoderBuffer>& buffer, |
| 58 scoped_refptr<VideoFrame>* video_frame); | 59 scoped_refptr<VideoFrame>* video_frame); |
| 59 | 60 |
| 60 // Reset decoder and call |reset_cb_|. | 61 // Reset decoder and call |reset_cb_|. |
| 61 void DoReset(); | 62 void DoReset(); |
| 62 | 63 |
| 63 void CopyVpxImageTo(const vpx_image* vpx_image, | 64 void CopyVpxImageTo(const vpx_image* vpx_image, |
| 65 const struct vpx_image* vpx_image_alpha, |
| 64 scoped_refptr<VideoFrame>* video_frame); | 66 scoped_refptr<VideoFrame>* video_frame); |
| 65 | 67 |
| 66 scoped_refptr<base::MessageLoopProxy> message_loop_; | 68 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 67 base::WeakPtrFactory<VpxVideoDecoder> weak_factory_; | 69 base::WeakPtrFactory<VpxVideoDecoder> weak_factory_; |
| 68 base::WeakPtr<VpxVideoDecoder> weak_this_; | 70 base::WeakPtr<VpxVideoDecoder> weak_this_; |
| 69 | 71 |
| 70 DecoderState state_; | 72 DecoderState state_; |
| 71 | 73 |
| 72 StatisticsCB statistics_cb_; | 74 StatisticsCB statistics_cb_; |
| 73 ReadCB read_cb_; | 75 ReadCB read_cb_; |
| 74 base::Closure reset_cb_; | 76 base::Closure reset_cb_; |
| 75 | 77 |
| 76 // Pointer to the demuxer stream that will feed us compressed buffers. | 78 // Pointer to the demuxer stream that will feed us compressed buffers. |
| 77 scoped_refptr<DemuxerStream> demuxer_stream_; | 79 scoped_refptr<DemuxerStream> demuxer_stream_; |
| 78 | 80 |
| 79 vpx_codec_ctx* vpx_codec_; | 81 vpx_codec_ctx* vpx_codec_; |
| 82 vpx_codec_ctx* vpx_codec_alpha_; |
| 80 | 83 |
| 81 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); | 84 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 } // namespace media | 87 } // namespace media |
| 85 | 88 |
| 86 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ | 89 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ |
| OLD | NEW |