Revert 168224 - Update V8 to version 3.15.4.
[chromium-blink-merge.git] / remoting / codec / video_decoder_vp8.h
blob53a720ba9b6711448e78cb52fa72b324012e7c3d
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
3 // found in the LICENSE file.
5 #ifndef REMOTING_CODEC_VIDEO_DECODER_VP8_H_
6 #define REMOTING_CODEC_VIDEO_DECODER_VP8_H_
8 #include "base/compiler_specific.h"
9 #include "remoting/codec/video_decoder.h"
11 typedef struct vpx_codec_ctx vpx_codec_ctx_t;
12 typedef struct vpx_image vpx_image_t;
14 namespace remoting {
16 class VideoDecoderVp8 : public VideoDecoder {
17 public:
18 VideoDecoderVp8();
19 virtual ~VideoDecoderVp8();
21 // VideoDecoder implementations.
22 virtual void Initialize(const SkISize& screen_size) OVERRIDE;
23 virtual DecodeResult DecodePacket(const VideoPacket* packet) OVERRIDE;
24 virtual bool IsReadyForData() OVERRIDE;
25 virtual VideoPacketFormat::Encoding Encoding() OVERRIDE;
26 virtual void Invalidate(const SkISize& view_size,
27 const SkRegion& region) OVERRIDE;
28 virtual void RenderFrame(const SkISize& view_size,
29 const SkIRect& clip_area,
30 uint8* image_buffer,
31 int image_stride,
32 SkRegion* output_region) OVERRIDE;
34 private:
35 enum State {
36 kUninitialized,
37 kReady,
38 kError,
41 // The internal state of the decoder.
42 State state_;
44 vpx_codec_ctx_t* codec_;
46 // Pointer to the last decoded image.
47 vpx_image_t* last_image_;
49 // The region updated that hasn't been copied to the screen yet.
50 SkRegion updated_region_;
52 // Output dimensions.
53 SkISize screen_size_;
55 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVp8);
58 } // namespace remoting
60 #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_