OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef REMOTING_CODEC_VIDEO_DECODER_H_ |
6 #define REMOTING_CODEC_VIDEO_DECODER_H_ | 6 #define REMOTING_CODEC_VIDEO_DECODER_H_ |
7 | 7 |
8 | |
9 namespace webrtc { | 8 namespace webrtc { |
10 class DesktopFrame; | 9 class DesktopFrame; |
11 } // namespace webrtc | 10 } // namespace webrtc |
12 | 11 |
13 namespace remoting { | 12 namespace remoting { |
14 | 13 |
15 class VideoPacket; | 14 class VideoPacket; |
16 | 15 |
17 // Interface for a decoder that decodes video packets. | 16 // Interface for a decoder that decodes video packets. |
18 class VideoDecoder { | 17 class VideoDecoder { |
19 public: | 18 public: |
19 // List of supported pixel formats needed by various platforms. | |
20 enum class PixelFormat { BGRA, RGBA }; | |
Lambros
2016/06/24 01:13:58
Seems a bit weird having this enumeration in two p
Sergey Ulanov
2016/06/24 02:01:09
I agree. The proper place for this enum would be w
| |
21 | |
20 VideoDecoder() {} | 22 VideoDecoder() {} |
21 virtual ~VideoDecoder() {} | 23 virtual ~VideoDecoder() {} |
22 | 24 |
25 virtual void SetPixelFormat(PixelFormat pixel_format) = 0; | |
26 | |
23 // Decodes a video frame. Returns false in case of a failure. The caller must | 27 // Decodes a video frame. Returns false in case of a failure. The caller must |
24 // pre-allocate a |frame| with the size specified in the |packet|. | 28 // pre-allocate a |frame| with the size specified in the |packet|. |
25 virtual bool DecodePacket(const VideoPacket& packet, | 29 virtual bool DecodePacket(const VideoPacket& packet, |
26 webrtc::DesktopFrame* frame) = 0; | 30 webrtc::DesktopFrame* frame) = 0; |
27 }; | 31 }; |
28 | 32 |
29 } // namespace remoting | 33 } // namespace remoting |
30 | 34 |
31 #endif // REMOTING_CODEC_VIDEO_DECODER_H_ | 35 #endif // REMOTING_CODEC_VIDEO_DECODER_H_ |
OLD | NEW |