[email protected] | a43cfae | 2013-10-19 22:14:54 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | a43cfae | 2013-10-19 22:14:54 | [diff] [blame] | 5 | #ifndef REMOTING_CODEC_VIDEO_DECODER_VPX_H_ |
6 | #define REMOTING_CODEC_VIDEO_DECODER_VPX_H_ | ||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 7 | |
[email protected] | 71f40a7 | 2012-05-16 07:26:59 | [diff] [blame] | 8 | #include "base/compiler_specific.h" |
[email protected] | a43cfae | 2013-10-19 22:14:54 | [diff] [blame] | 9 | #include "base/memory/scoped_ptr.h" |
10 | #include "remoting/codec/scoped_vpx_codec.h" | ||||
[email protected] | 3860983 | 2012-08-23 01:36:10 | [diff] [blame] | 11 | #include "remoting/codec/video_decoder.h" |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 12 | |
wez | 070889b | 2015-07-17 03:19:15 | [diff] [blame] | 13 | typedef const struct vpx_codec_iface vpx_codec_iface_t; |
[email protected] | 47379e9 | 2011-07-26 15:33:15 | [diff] [blame] | 14 | typedef struct vpx_image vpx_image_t; |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 15 | |
sergeyu | ef92de20 | 2015-08-20 22:47:37 | [diff] [blame] | 16 | namespace webrtc { |
17 | class DesktopRect; | ||||
18 | class DesktopRegion; | ||||
19 | } // namespace webrtc | ||||
20 | |||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 21 | namespace remoting { |
22 | |||||
[email protected] | a43cfae | 2013-10-19 22:14:54 | [diff] [blame] | 23 | class VideoDecoderVpx : public VideoDecoder { |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 24 | public: |
[email protected] | 87196ce | 2013-10-22 01:53:39 | [diff] [blame] | 25 | // Create decoders for the specified protocol. |
[email protected] | a43cfae | 2013-10-19 22:14:54 | [diff] [blame] | 26 | static scoped_ptr<VideoDecoderVpx> CreateForVP8(); |
[email protected] | 87196ce | 2013-10-22 01:53:39 | [diff] [blame] | 27 | static scoped_ptr<VideoDecoderVpx> CreateForVP9(); |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 28 | |
dcheng | 562aba5 | 2014-10-21 12:30:14 | [diff] [blame] | 29 | ~VideoDecoderVpx() override; |
[email protected] | a43cfae | 2013-10-19 22:14:54 | [diff] [blame] | 30 | |
31 | // VideoDecoder interface. | ||||
sergeyu | ef92de20 | 2015-08-20 22:47:37 | [diff] [blame] | 32 | bool DecodePacket(const VideoPacket& packet, |
33 | webrtc::DesktopFrame* frame) override; | ||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 34 | |
35 | private: | ||||
wez | 070889b | 2015-07-17 03:19:15 | [diff] [blame] | 36 | explicit VideoDecoderVpx(vpx_codec_iface_t* codec); |
[email protected] | da4daa7f | 2013-06-21 10:16:41 | [diff] [blame] | 37 | |
[email protected] | a43cfae | 2013-10-19 22:14:54 | [diff] [blame] | 38 | ScopedVpxCodec codec_; |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 39 | |
wez | 070889b | 2015-07-17 03:19:15 | [diff] [blame] | 40 | // The shape of the most-recent frame, if any. |
41 | scoped_ptr<webrtc::DesktopRegion> desktop_shape_; | ||||
[email protected] | da4daa7f | 2013-06-21 10:16:41 | [diff] [blame] | 42 | |
[email protected] | a43cfae | 2013-10-19 22:14:54 | [diff] [blame] | 43 | DISALLOW_COPY_AND_ASSIGN(VideoDecoderVpx); |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 44 | }; |
45 | |||||
46 | } // namespace remoting | ||||
47 | |||||
[email protected] | 3860983 | 2012-08-23 01:36:10 | [diff] [blame] | 48 | #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_ |