| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_CODEC_VIDEO_DECODER_VPX_H_ | 5 #ifndef REMOTING_CODEC_VIDEO_DECODER_VPX_H_ |
| 6 #define REMOTING_CODEC_VIDEO_DECODER_VPX_H_ | 6 #define REMOTING_CODEC_VIDEO_DECODER_VPX_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "remoting/codec/scoped_vpx_codec.h" | 11 #include "remoting/codec/scoped_vpx_codec.h" |
| 12 #include "remoting/codec/video_decoder.h" | 12 #include "remoting/codec/video_decoder.h" |
| 13 | 13 |
| 14 typedef const struct vpx_codec_iface vpx_codec_iface_t; | 14 typedef const struct vpx_codec_iface vpx_codec_iface_t; |
| 15 typedef struct vpx_image vpx_image_t; | 15 typedef struct vpx_image vpx_image_t; |
| 16 | 16 |
| 17 namespace webrtc { | |
| 18 class DesktopRect; | |
| 19 class DesktopRegion; | |
| 20 } // namespace webrtc | |
| 21 | |
| 22 namespace remoting { | 17 namespace remoting { |
| 23 | 18 |
| 24 class VideoDecoderVpx : public VideoDecoder { | 19 class VideoDecoderVpx : public VideoDecoder { |
| 25 public: | 20 public: |
| 26 // Create decoders for the specified protocol. | 21 // Create decoders for the specified protocol. |
| 27 static scoped_ptr<VideoDecoderVpx> CreateForVP8(); | 22 static scoped_ptr<VideoDecoderVpx> CreateForVP8(); |
| 28 static scoped_ptr<VideoDecoderVpx> CreateForVP9(); | 23 static scoped_ptr<VideoDecoderVpx> CreateForVP9(); |
| 29 | 24 |
| 30 ~VideoDecoderVpx() override; | 25 ~VideoDecoderVpx() override; |
| 31 | 26 |
| 32 // VideoDecoder interface. | 27 // VideoDecoder interface. |
| 33 bool DecodePacket(const VideoPacket& packet, | 28 bool DecodePacket(const VideoPacket& packet, |
| 34 webrtc::DesktopFrame* frame) override; | 29 webrtc::DesktopFrame* frame) override; |
| 35 | 30 |
| 36 private: | 31 private: |
| 37 explicit VideoDecoderVpx(vpx_codec_iface_t* codec); | 32 explicit VideoDecoderVpx(vpx_codec_iface_t* codec); |
| 38 | 33 |
| 39 ScopedVpxCodec codec_; | 34 ScopedVpxCodec codec_; |
| 40 | 35 |
| 41 // The shape of the most-recent frame, if any. | |
| 42 scoped_ptr<webrtc::DesktopRegion> desktop_shape_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVpx); | 36 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVpx); |
| 45 }; | 37 }; |
| 46 | 38 |
| 47 } // namespace remoting | 39 } // namespace remoting |
| 48 | 40 |
| 49 #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_ | 41 #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_ |
| OLD | NEW |