5#ifndef SKYWAY_MEDIA_RTP_RTP_CAPTURER_VIDEO_SOURCE_REPOSITORY_HPP_
6#define SKYWAY_MEDIA_RTP_RTP_CAPTURER_VIDEO_SOURCE_REPOSITORY_HPP_
9#include <unordered_set>
11#include "skyway/media/rtp/interface/rtp_capturer_video_source_repository.hpp"
18class RtpCapturerVideoSourceRepository :
public interface::RtpCapturerVideoSourceRepository {
20 ~RtpCapturerVideoSourceRepository();
22 static std::shared_ptr<interface::RtpCapturerVideoSourceRepository> GetInstance();
23 std::optional<uint16_t> Register(
24 std::shared_ptr<interface::RtpCapturerVideoSource> video_source)
override;
25 bool Unregister(std::shared_ptr<interface::RtpCapturerVideoSource> video_source)
override;
26 std::shared_ptr<interface::RtpCapturerVideoSource> Find(
const int& frame_id)
override;
27 static void Release();
30 RtpCapturerVideoSourceRepository();
32 const std::shared_ptr<interface::RtpCapturerVideoSource>& video_source)
const;
34 mutable std::mutex video_sources_mtx_;
35 std::unordered_set<std::shared_ptr<interface::RtpCapturerVideoSource>> video_sources_;
36 inline static std::mutex instance_mtx_;
37 inline static std::shared_ptr<interface::RtpCapturerVideoSourceRepository> instance_ =
nullptr;
38 uint16_t current_frame_id_;
41 friend class RtpCapturerVideoSourceRepositoryTest;