video_decoder_vpx.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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
  3. // found in the LICENSE file.
  4. #ifndef REMOTING_CODEC_VIDEO_DECODER_VPX_H_
  5. #define REMOTING_CODEC_VIDEO_DECODER_VPX_H_
  6. #include <memory>
  7. #include "base/compiler_specific.h"
  8. #include "remoting/codec/scoped_vpx_codec.h"
  9. #include "remoting/codec/video_decoder.h"
  10. typedef const struct vpx_codec_iface vpx_codec_iface_t;
  11. typedef struct vpx_image vpx_image_t;
  12. namespace remoting {
  13. class VideoDecoderVpx : public VideoDecoder {
  14. public:
  15. // Create decoders for the specified protocol.
  16. static std::unique_ptr<VideoDecoderVpx> CreateForVP8();
  17. static std::unique_ptr<VideoDecoderVpx> CreateForVP9();
  18. VideoDecoderVpx(const VideoDecoderVpx&) = delete;
  19. VideoDecoderVpx& operator=(const VideoDecoderVpx&) = delete;
  20. ~VideoDecoderVpx() override;
  21. // VideoDecoder interface.
  22. void SetPixelFormat(PixelFormat pixel_format) override;
  23. bool DecodePacket(const VideoPacket& packet,
  24. webrtc::DesktopFrame* frame) override;
  25. private:
  26. explicit VideoDecoderVpx(vpx_codec_iface_t* codec);
  27. ScopedVpxCodec codec_;
  28. PixelFormat pixel_format_ = PixelFormat::BGRA;
  29. };
  30. } // namespace remoting
  31. #endif // REMOTING_CODEC_VIDEO_DECODER_VPX_H_