SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
rtp_capturer_video_source_repository.hpp
1#ifndef SKYWAY_MEDIA_RTP_RTP_CAPTURER_VIDEO_SOURCE_REPOSITORY_HPP_
2#define SKYWAY_MEDIA_RTP_RTP_CAPTURER_VIDEO_SOURCE_REPOSITORY_HPP_
3
4#include <mutex>
5#include <unordered_set>
6
7#include "skyway/media/rtp/interface/rtp_capturer_video_source_repository.hpp"
8
9namespace skyway {
10namespace media {
11namespace rtp {
12
14class RtpCapturerVideoSourceRepository : public interface::RtpCapturerVideoSourceRepository {
15public:
16 ~RtpCapturerVideoSourceRepository();
17
18 static std::shared_ptr<interface::RtpCapturerVideoSourceRepository> GetInstance();
19 std::optional<uint16_t> Register(
20 std::shared_ptr<interface::RtpCapturerVideoSource> video_source) override;
21 bool Unregister(std::shared_ptr<interface::RtpCapturerVideoSource> video_source) override;
22 std::shared_ptr<interface::RtpCapturerVideoSource> Find(const int& frame_id) override;
23 static void Release();
24
25private:
26 RtpCapturerVideoSourceRepository();
27
28 mutable std::mutex video_sources_mtx_;
29 std::unordered_set<std::shared_ptr<interface::RtpCapturerVideoSource>> video_sources_;
30 inline static std::mutex instance_mtx_;
31 inline static std::shared_ptr<interface::RtpCapturerVideoSourceRepository> instance_ = nullptr;
32 uint16_t current_frame_id_;
33
34public:
35 friend class RtpCapturerVideoSourceRepositoryTest;
36};
38
39} // namespace rtp
40} // namespace media
41} // namespace skyway
42
43#endif /* SKYWAY_MEDIA_RTP_RTP_CAPTURER_VIDEO_SOURCE_REPOSITORY_HPP_ */