1 // Copyright 2013 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_VPX_H_
6 #define REMOTING_CODEC_VIDEO_DECODER_VPX_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "remoting/codec/scoped_vpx_codec.h"
11 #include "remoting/codec/video_decoder.h"
13 typedef const struct vpx_codec_iface vpx_codec_iface_t
;
14 typedef struct vpx_image vpx_image_t
;
23 class VideoDecoderVpx
: public VideoDecoder
{
25 // Create decoders for the specified protocol.
26 static scoped_ptr
<VideoDecoderVpx
> CreateForVP8();
27 static scoped_ptr
<VideoDecoderVpx
> CreateForVP9();
29 ~VideoDecoderVpx() override
;
31 // VideoDecoder interface.
32 bool DecodePacket(const VideoPacket
& packet
,
33 webrtc::DesktopFrame
* frame
) override
;
36 explicit VideoDecoderVpx(vpx_codec_iface_t
* codec
);
38 ScopedVpxCodec codec_
;
40 // The shape of the most-recent frame, if any.
41 scoped_ptr
<webrtc::DesktopRegion
> desktop_shape_
;
43 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVpx
);
46 } // namespace remoting
48 #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_