SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
passthrough_video_encoder.hpp
1//
2// passthrough_video_encoder.hpp
3// skyway
4//
5// Created by sandabu on 2025/5/21.
6// Copyright © 2025 NTT DOCOMO BUSINESS, Inc. All rights reserved.
7//
8#ifndef SKYWAY_MEDIA_PASSTHROUGH_VIDEO_ENCODER_HPP_
9#define SKYWAY_MEDIA_PASSTHROUGH_VIDEO_ENCODER_HPP_
10
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>
14#include <functional>
15#include <memory>
16
17#include "skyway/global/interface/worker.hpp"
18#include "skyway/media/rtp/interface/rtp_capturer_video_source_repository.hpp"
19
20namespace skyway {
21namespace media {
22namespace rtp {
24class PassthroughVideoEncoder : public webrtc::VideoEncoder {
25public:
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;
32
33 void SetRates(const webrtc::VideoEncoder::RateControlParameters& parameters) override;
34
35 int32_t RegisterEncodeCompleteCallback(webrtc::EncodedImageCallback* callback) override;
36
37 int32_t Release() override;
38
39 webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override;
40
41private:
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_;
46
47public:
48 friend class PassthroughVideoEncoderTest;
49};
51
52#endif // SKYWAY_MEDIA_PASSTHROUGH_VIDEO_ENCODER_HPP_
53
54} // namespace rtp
55} // namespace media
56} // namespace skyway