-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreaming_shorter_diagram.puml
153 lines (130 loc) · 5.71 KB
/
streaming_shorter_diagram.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
@startuml
class WebRtcScProcessedFrame {
- buf_: std::unique_ptr<CvdVideoFrameBuffer>
+ Clone(): std::unique_ptr<WebRtcScProcessedFrame>
}
class DisplayHandler {
- display_sinks_: std::map<uint32_t, std::shared_ptr<webrtc_streaming::VideoSink>>
- streamer_: webrtc_streaming::Streamer&
- screen_connector_: ScreenConnector<WebRtcScProcessedFrame>&
- last_buffer_: std::shared_ptr<webrtc_streaming::VideoFrameBuffer>
- last_buffer_display_: std::uint32_t
- last_buffer_mutex_: std::mutex
- next_frame_mutex_: std::mutex
+ DisplayHandler(<color:LightSlateGray>webrtc_streaming::Streamer&, ScreenConnector<WebRtcScProcessedFrame>&</color>)
+ Loop(): void
+ SendLastFrame(): void
- GetScreenConnectorCallback(): GenerateProcessedFrameCallback
}
struct ScreenConnectorFrameInfo {
+ display_number_: std::uint32_t
+ is_success_: bool
}
' class OperatorObserver {
' +OnRegistered(): void
' +OnClose(): void
' +OnError(): void
' }
' struct StreamerConfig {
' - device_id: std::string
' - group_id: std::string
' - client_files_port: int
' - operator_server: ServerConfig
' - udp_port_range: std::pair<uint16_t, uint16_t>
' - tcp_port_range: std::pair<uint16_t, uint16_t>
' - openwrt_device_id: std::string
' - openwrt_addr: std::string
' - control_env_proxy_server_path: std::string
' }
class Streamer {
+Create(<color:LightSlateGray>StreamerConfig, LocalRecorder*, std::shared_ptr<ConnectionObserverFactory></color>): std::unique_ptr<Streamer>
+AddDisplay(<color:LightSlateGray>std::string, int, int, int, bool</color>): std::shared_ptr<VideoSink>
+RemoveDisplay(<color:LightSlateGray>std::string</color>): bool
+SetHardwareSpec(<color:LightSlateGray>std::string, std::string</color>): void
+SetHardwareSpec<V>(<color:LightSlateGray>std::string, V</color>): void
+AddAudioStream(<color:LightSlateGray>std::string</color>): std::shared_ptr<AudioSink>
+GetAudioSource(): std::shared_ptr<AudioSource>
+AddCamera(<color:LightSlateGray>unsigned int, unsigned int</color>): CameraController*
+AddCustomControlPanelButton(<color:LightSlateGray>std::string, std::string, std::string</color>): void
+AddCustomControlPanelButtonWithShellCommand(<color:LightSlateGray>std::string, std::string, std::string, std::string</color>): void
+AddCustomControlPanelButtonWithDeviceStates(<color:LightSlateGray>std::string, std::string, std::string, std::vector<DeviceState></color>): void
+Register(<color:LightSlateGray>std::weak_ptr<OperatorObserver></color>): void
+Unregister(): void
-impl: Streamer::Impl <color:Green><b>// All configs, important logic and periphery is managed here</b></color>
}
' class Streamer::Impl {
' +CreateClientHandler(<color:LightSlateGray>int</color>): std::shared_ptr<ClientHandler>
' +Register(<color:LightSlateGray>std::weak_ptr<OperatorObserver></color>): void
' +SendMessageToClient(<color:LightSlateGray>int, const Json::Value&</color>): void
' +DestroyClientHandler(<color:LightSlateGray>int</color>): void
' +SetupCameraForClient(<color:LightSlateGray>int</color>): void
' +OnOpen(): void
' +OnClose(): void
' +OnError(<color:LightSlateGray>const std::string&</color>): void
' +OnReceive(<color:LightSlateGray>const uint8_t*, size_t, bool</color>): void
' +HandleConfigMessage(<color:LightSlateGray>const Json::Value&</color>): void
' +HandleClientMessage(<color:LightSlateGray>const Json::Value&</color>): void
' +Build(<color:LightSlateGray>webrtc::PeerConnectionObserver&, const std::vector<webrtc::PeerConnectionInterface::IceServer>&</color>): Result<rtc::scoped_refptr<webrtc::PeerConnectionInterface>>
' - config_: StreamerConfig
' - operator_config_: OperatorServerConfig
' - server_connection_: std::unique_ptr<ServerConnection>
' - connection_observer_factory_: std::shared_ptr<ConnectionObserverFactory>
' - peer_connection_factory_: rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
' - network_thread_: std::unique_ptr<rtc::Thread>
' - worker_thread_: std::unique_ptr<rtc::Thread>
' - signal_thread_: std::unique_ptr<rtc::Thread>
' - displays_: std::map<std::string, DisplayDescriptor>
' - audio_sources_: std::map<std::string, rtc::scoped_refptr<AudioTrackSourceImpl>>
' - clients_: std::map<int, std::shared_ptr<ClientHandler>>
' - operator_observer_: std::weak_ptr<OperatorObserver>
' - hardware_: std::map<std::string, std::string>
' - custom_control_panel_buttons_: std::vector<ControlPanelButtonDescriptor>
' - audio_device_module_: std::shared_ptr<AudioDeviceModuleWrapper>
' - camera_streamer_: std::unique_ptr<CameraStreamer>
' - registration_retries_left_: int
' - retry_interval_ms_: int
' - recorder_: LocalRecorder*
' }
class CvdVideoFrameBuffer {
' +CvdVideoFrameBuffer(<color:LightSlateGray>width: int, height: int</color>)
' +~CvdVideoFrameBuffer()
' +width(): int
' +height(): int
' +StrideY(): int
' +StrideU(): int
' +StrideV(): int
' +DataY(): const uint8_t*
' +DataU(): const uint8_t*
' +DataV(): const uint8_t*
' +DataY(): uint8_t*
' +DataU(): uint8_t*
' +DataV(): uint8_t*
' - width_: const int
' - height_: const int
' - y_: std::vector<std::uint8_t>
' - u_: std::vector<std::uint8_t>
' - v_: std::vector<std::uint8_t>
}
' struct ServerConfig {
' +addr: std::string
' +port: int
' +path: std::string
' +security: Security
' }
' enum Security {
' +kInsecure
' +kAllowSelfSigned
' +kStrict
' }
' ServerConfig o-- Security
' ServerConfig +-- Security
' Relationships
' Streamer::Impl o-- StreamerConfig
' StreamerConfig -- ServerConfig
' Streamer::Impl -- OperatorObserver
' Streamer *-- Streamer::Impl
WebRtcScProcessedFrame <.. ScreenConnectorFrameInfo
WebRtcScProcessedFrame -- CvdVideoFrameBuffer
DisplayHandler -- Streamer
DisplayHandler -- WebRtcScProcessedFrame
@enduml