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 <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "remoting/codec/scoped_vpx_codec.h" | 12 #include "remoting/codec/scoped_vpx_codec.h" |
12 #include "remoting/codec/video_decoder.h" | 13 #include "remoting/codec/video_decoder.h" |
13 | 14 |
14 typedef const struct vpx_codec_iface vpx_codec_iface_t; | 15 typedef const struct vpx_codec_iface vpx_codec_iface_t; |
15 typedef struct vpx_image vpx_image_t; | 16 typedef struct vpx_image vpx_image_t; |
16 | 17 |
17 namespace remoting { | 18 namespace remoting { |
18 | 19 |
19 class VideoDecoderVpx : public VideoDecoder { | 20 class VideoDecoderVpx : public VideoDecoder { |
20 public: | 21 public: |
21 // Create decoders for the specified protocol. | 22 // Create decoders for the specified protocol. |
22 static scoped_ptr<VideoDecoderVpx> CreateForVP8(); | 23 static std::unique_ptr<VideoDecoderVpx> CreateForVP8(); |
23 static scoped_ptr<VideoDecoderVpx> CreateForVP9(); | 24 static std::unique_ptr<VideoDecoderVpx> CreateForVP9(); |
24 | 25 |
25 ~VideoDecoderVpx() override; | 26 ~VideoDecoderVpx() override; |
26 | 27 |
27 // VideoDecoder interface. | 28 // VideoDecoder interface. |
28 bool DecodePacket(const VideoPacket& packet, | 29 bool DecodePacket(const VideoPacket& packet, |
29 webrtc::DesktopFrame* frame) override; | 30 webrtc::DesktopFrame* frame) override; |
30 | 31 |
31 private: | 32 private: |
32 explicit VideoDecoderVpx(vpx_codec_iface_t* codec); | 33 explicit VideoDecoderVpx(vpx_codec_iface_t* codec); |
33 | 34 |
34 ScopedVpxCodec codec_; | 35 ScopedVpxCodec codec_; |
35 | 36 |
36 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVpx); | 37 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVpx); |
37 }; | 38 }; |
38 | 39 |
39 } // namespace remoting | 40 } // namespace remoting |
40 | 41 |
41 #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_ | 42 #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_ |
OLD | NEW |