| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 REMOTING_BASE_DECODER_VP8_H_ | 5 #ifndef REMOTING_BASE_DECODER_VP8_H_ |
| 6 #define REMOTING_BASE_DECODER_VP8_H_ | 6 #define REMOTING_BASE_DECODER_VP8_H_ |
| 7 | 7 |
| 8 #include "remoting/base/decoder.h" | 8 #include "remoting/base/decoder.h" |
| 9 | 9 |
| 10 typedef struct vpx_codec_ctx vpx_codec_ctx_t; | 10 typedef struct vpx_codec_ctx vpx_codec_ctx_t; |
| 11 | 11 |
| 12 namespace remoting { | 12 namespace remoting { |
| 13 | 13 |
| 14 class DecoderVp8 : public Decoder { | 14 class DecoderVp8 : public Decoder { |
| 15 public: | 15 public: |
| 16 DecoderVp8(); | 16 DecoderVp8(); |
| 17 virtual ~DecoderVp8(); | 17 virtual ~DecoderVp8(); |
| 18 | 18 |
| 19 // Decoder implementations. | 19 // Decoder implementations. |
| 20 virtual void Initialize(scoped_refptr<media::VideoFrame> frame, | 20 virtual void Initialize(scoped_refptr<media::VideoFrame> frame); |
| 21 const gfx::Rect& clip, int bytes_per_src_pixel); | 21 virtual DecodeResult DecodePacket(const VideoPacket* packet); |
| 22 | 22 virtual void GetUpdatedRects(UpdatedRects* rects); |
| 23 virtual bool IsReadyForData(); |
| 23 virtual void Reset(); | 24 virtual void Reset(); |
| 24 | |
| 25 // Feeds more data into the decoder. | |
| 26 virtual void DecodeBytes(const std::string& encoded_bytes); | |
| 27 | |
| 28 // Returns true if decoder is ready to accept data via ProcessRectangleData. | |
| 29 virtual bool IsReadyForData(); | |
| 30 | |
| 31 virtual VideoPacketFormat::Encoding Encoding(); | 25 virtual VideoPacketFormat::Encoding Encoding(); |
| 32 | 26 |
| 33 private: | 27 private: |
| 34 enum State { | 28 enum State { |
| 35 kUninitialized, | 29 kUninitialized, |
| 36 kReady, | 30 kReady, |
| 37 kError, | 31 kError, |
| 38 }; | 32 }; |
| 39 | 33 |
| 40 // The internal state of the decoder. | 34 // The internal state of the decoder. |
| 41 State state_; | 35 State state_; |
| 42 | 36 |
| 43 // The video frame to write to. | 37 // The video frame to write to. |
| 44 scoped_refptr<media::VideoFrame> frame_; | 38 scoped_refptr<media::VideoFrame> frame_; |
| 45 | 39 |
| 46 vpx_codec_ctx_t* codec_; | 40 vpx_codec_ctx_t* codec_; |
| 47 | 41 |
| 48 DISALLOW_COPY_AND_ASSIGN(DecoderVp8); | 42 DISALLOW_COPY_AND_ASSIGN(DecoderVp8); |
| 49 }; | 43 }; |
| 50 | 44 |
| 51 } // namespace remoting | 45 } // namespace remoting |
| 52 | 46 |
| 53 #endif // REMOTING_BASE_DECODER_VP8_H_ | 47 #endif // REMOTING_BASE_DECODER_VP8_H_ |
| OLD | NEW |