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