SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
rtp_capturer_video_source_repository.hpp
1//
2// © NTT DOCOMO BUSINESS, Inc. All Rights Reserved.
3//
4
5#ifndef SKYWAY_MEDIA_RTP_RTP_CAPTURER_VIDEO_SOURCE_REPOSITORY_HPP_
6#define SKYWAY_MEDIA_RTP_RTP_CAPTURER_VIDEO_SOURCE_REPOSITORY_HPP_
7
8#include <mutex>
9#include <unordered_set>
10
11#include "skyway/media/rtp/interface/rtp_capturer_video_source_repository.hpp"
12
13namespace skyway {
14namespace media {
15namespace rtp {
16
18class RtpCapturerVideoSourceRepository : public interface::RtpCapturerVideoSourceRepository {
19public:
20 ~RtpCapturerVideoSourceRepository();
21
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();
28
29private:
30 RtpCapturerVideoSourceRepository();
31 bool IsValidSource(
32 const std::shared_ptr<interface::RtpCapturerVideoSource>& video_source) const;
33
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_;
39
40public:
41 friend class RtpCapturerVideoSourceRepositoryTest;
42};
44
45} // namespace rtp
46} // namespace media
47} // namespace skyway
48
49#endif /* SKYWAY_MEDIA_RTP_RTP_CAPTURER_VIDEO_SOURCE_REPOSITORY_HPP_ */