8#ifndef SKYWAY_MEDIA_PASSTHROUGH_VIDEO_ENCODER_HPP_
9#define SKYWAY_MEDIA_PASSTHROUGH_VIDEO_ENCODER_HPP_
11#include <api/video_codecs/video_encoder.h>
12#include <api/video_codecs/video_encoder_factory.h>
13#include <modules/rtp_rtcp/source/rtcp_sender.h>
17#include "skyway/global/interface/worker.hpp"
18#include "skyway/media/rtp/interface/rtp_capturer_video_source_repository.hpp"
24class PassthroughVideoEncoder :
public webrtc::VideoEncoder {
26 PassthroughVideoEncoder(
27 std::shared_ptr<interface::RtpCapturerVideoSourceRepository> source_repo);
28 ~PassthroughVideoEncoder();
29 int InitEncode(
const webrtc::VideoCodec* codec_settings,
const Settings& settings)
override;
30 int32_t Encode(
const webrtc::VideoFrame& frame,
31 const std::vector<webrtc::VideoFrameType>* frame_types)
override;
33 void SetRates(
const webrtc::VideoEncoder::RateControlParameters& parameters)
override;
35 int32_t RegisterEncodeCompleteCallback(webrtc::EncodedImageCallback* callback)
override;
37 int32_t Release()
override;
39 webrtc::VideoEncoder::EncoderInfo GetEncoderInfo()
const override;
42 std::unique_ptr<global::interface::Worker> worker_;
43 std::shared_ptr<interface::RtpCapturerVideoSource> video_source_ =
nullptr;
44 webrtc::EncodedImageCallback* callback_ =
nullptr;
45 std::weak_ptr<interface::RtpCapturerVideoSourceRepository> source_repo_;
48 friend class PassthroughVideoEncoderTest;