video_decoder.h 1000 B

1234567891011121314151617181920212223242526272829303132333435
  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
  3. // found in the LICENSE file.
  4. #ifndef REMOTING_CODEC_VIDEO_DECODER_H_
  5. #define REMOTING_CODEC_VIDEO_DECODER_H_
  6. namespace webrtc {
  7. class DesktopFrame;
  8. } // namespace webrtc
  9. namespace remoting {
  10. class VideoPacket;
  11. // Interface for a decoder that decodes video packets.
  12. class VideoDecoder {
  13. public:
  14. // List of supported pixel formats needed by various platforms.
  15. enum class PixelFormat { BGRA, RGBA };
  16. VideoDecoder() {}
  17. virtual ~VideoDecoder() {}
  18. virtual void SetPixelFormat(PixelFormat pixel_format) = 0;
  19. // Decodes a video frame. Returns false in case of a failure. The caller must
  20. // pre-allocate a |frame| with the size specified in the |packet|.
  21. virtual bool DecodePacket(const VideoPacket& packet,
  22. webrtc::DesktopFrame* frame) = 0;
  23. };
  24. } // namespace remoting
  25. #endif // REMOTING_CODEC_VIDEO_DECODER_H_