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