[WebRTC] Add new APIs for statistics (#4508)
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Remoting / Interop / Interop.WebRTC.cs
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18 using System.Runtime.InteropServices;
19 using Tizen;
20 using Tizen.Applications;
21 using Tizen.Internals;
22 using Tizen.Multimedia;
23 using Tizen.Multimedia.Remoting;
24
25 internal static partial class Interop
26 {
27     internal static partial class NativeWebRTC
28     {
29         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
30         internal delegate void ErrorOccurredCallback(IntPtr handle, WebRTCErrorCode error, WebRTCState state, IntPtr userData);
31
32         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
33         internal delegate void StateChangedCallback(IntPtr handle, WebRTCState previous, WebRTCState current, IntPtr userData);
34
35         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
36         internal delegate void IceGatheringStateChangedCallback(IntPtr handle, WebRTCIceGatheringState state, IntPtr userData);
37
38         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
39         internal delegate void SignalingStateChangedCallback(IntPtr handle, WebRTCSignalingState state, IntPtr userData);
40
41         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
42         internal delegate void PeerConnectionStateChangedCallback(IntPtr handle, WebRTCPeerConnectionState state, IntPtr userData);
43
44         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
45         internal delegate void IceConnectionStateChangedCallback(IntPtr handle, WebRTCIceConnectionState state, IntPtr userData);
46
47         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
48         internal delegate void MediaPacketBufferStatusCallback(uint sourceId, MediaPacketBufferStatus status, IntPtr userData);
49
50         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
51         internal delegate void NegotiationNeededCallback(IntPtr handle, IntPtr userData);
52
53         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
54         internal delegate void IceCandidateCallback(IntPtr handle, string candidate, IntPtr userData);
55
56         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
57         internal delegate void TrackAddedCallback(IntPtr handle, MediaType type, uint id, IntPtr userData);
58
59         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
60         internal delegate void FrameEncodedCallback(IntPtr handle, MediaType type, uint trackId, IntPtr packetHandle, IntPtr userData);
61
62         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
63         internal delegate bool SupportedMediaFormatCallback(int format, IntPtr userData);
64
65         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
66         internal delegate bool RetrieveTurnServerCallback(string server, IntPtr userData);
67
68         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
69         internal delegate bool RetrieveTransceiverCodecCallback(TransceiverCodec codec, IntPtr userData);
70
71         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
72         internal delegate void SdpCreatedCallback(IntPtr handle, string sdp, IntPtr userData);
73
74         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
75         internal delegate bool RetrieveStatsCallback(WebRTCStatisticsCategory category, IntPtr prop, IntPtr userData);
76
77
78         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_create")]
79         internal static extern WebRTCErrorCode Create(out WebRTCHandle handle);
80
81         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_destroy")]
82         internal static extern WebRTCErrorCode Destroy(IntPtr handle);
83
84         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_start")]
85         internal static extern WebRTCErrorCode Start(IntPtr handle);
86
87         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_stop")]
88         internal static extern WebRTCErrorCode Stop(IntPtr handle);
89
90         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_state")]
91         internal static extern WebRTCErrorCode GetState(IntPtr handle, out WebRTCState state);
92
93         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_ice_gathering_state")]
94         internal static extern WebRTCErrorCode GetIceGatheringState(IntPtr handle, out WebRTCIceGatheringState state);
95
96         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_signaling_state")]
97         internal static extern WebRTCErrorCode GetSignalingState(IntPtr handle, out WebRTCSignalingState state);
98
99         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_peer_connection_state")]
100         internal static extern WebRTCErrorCode GetPeerConnectionState(IntPtr handle, out WebRTCPeerConnectionState state);
101
102         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_ice_connection_state")]
103         internal static extern WebRTCErrorCode GetIceConnectionState(IntPtr handle, out WebRTCIceConnectionState state);
104
105         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_add_media_source")]
106         internal static extern WebRTCErrorCode AddMediaSource(IntPtr handle, MediaSourceType type, out uint sourceId);
107
108         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_add_media_source_internal")]
109         internal static extern WebRTCErrorCode AddCustomMediaSource(IntPtr handle, CustomMediaSourceType type, out uint sourceId);
110
111         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_remove_media_source")]
112         internal static extern WebRTCErrorCode RemoveMediaSource(IntPtr handle, uint sourceId);
113
114         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_packet_source_set_format")]
115         internal static extern WebRTCErrorCode SetMediaPacketSourceInfo(IntPtr handle, uint sourceId, IntPtr packet);
116
117         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_packet_source_push_packet")]
118         internal static extern WebRTCErrorCode PushMediaPacket(IntPtr handle, uint sourceId, IntPtr packet);
119
120         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_file_source_set_path")]
121         internal static extern WebRTCErrorCode SetFileSourcePath(IntPtr handle, uint sourceId, string path);
122
123         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_file_source_set_looping")]
124         internal static extern WebRTCErrorCode SetFileSourceLooping(IntPtr handle, uint sourceId, bool looping);
125
126         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_file_source_get_looping")]
127         internal static extern WebRTCErrorCode GetFileSourceLooping(IntPtr handle, uint sourceId, out bool looping);
128
129         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_transceiver_direction")]
130         internal static extern WebRTCErrorCode GetTransceiverDirection(IntPtr handle, uint sourceId, MediaType type, out TransceiverDirection mode);
131
132         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_transceiver_direction")]
133         internal static extern WebRTCErrorCode SetTransceiverDirection(IntPtr handle, uint sourceId, MediaType type, TransceiverDirection mode);
134
135         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_foreach_supported_transceiver_codec")]
136         internal static extern WebRTCErrorCode ForeachSupportedTransceiverCodec(IntPtr handle, MediaSourceType sourceType, MediaType mediaType,
137             RetrieveTransceiverCodecCallback callback, IntPtr userData = default);
138
139         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_transceiver_codec")]
140         internal static extern WebRTCErrorCode SetTransceiverCodec(IntPtr handle, uint sourceId, MediaType type, TransceiverCodec codec);
141
142         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_transceiver_codec")]
143         internal static extern WebRTCErrorCode GetTransceiverCodec(IntPtr handle, uint sourceId, MediaType type, out TransceiverCodec codec);
144
145         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_pause")]
146         internal static extern WebRTCErrorCode SetPause(IntPtr handle, uint sourceId, MediaType type, bool pause);
147
148         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_pause")]
149         internal static extern WebRTCErrorCode GetPause(IntPtr handle, uint sourceId, MediaType type, out bool isPaused);
150
151         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_mute")]
152         internal static extern WebRTCErrorCode SetMute(IntPtr handle, uint sourceId, MediaType type, bool mute);
153
154         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_mute")]
155         internal static extern WebRTCErrorCode GetMute(IntPtr handle, uint sourceId, MediaType type, out bool mute);
156
157         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_video_resolution")]
158         internal static extern WebRTCErrorCode SetVideoResolution(IntPtr handle, uint sourceId, int width, int height);
159
160         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_video_resolution")]
161         internal static extern WebRTCErrorCode GetVideoResolution(IntPtr handle, uint sourceId, out int width, out int height);
162
163         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_video_framerate")]
164         internal static extern WebRTCErrorCode SetVideoFrameRate(IntPtr handle, uint sourceId, int frameRate);
165
166         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_video_framerate")]
167         internal static extern WebRTCErrorCode GetVideoFrameRate(IntPtr handle, uint sourceId, out int frameRate);
168
169         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_audio_loopback")]
170         internal static extern WebRTCErrorCode SetAudioLoopback(IntPtr handle, uint sourceId, AudioStreamPolicyHandle streamInfo, out uint trackId);
171
172         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_video_loopback")]
173         internal static extern WebRTCErrorCode SetVideoLoopback(IntPtr handle, uint sourceId, WebRTCDisplayType type, IntPtr display, out uint trackId);
174
175         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_video_loopback_to_ecore_wl")]
176         internal static extern WebRTCErrorCode SetEcoreVideoLoopback(IntPtr handle, uint sourceId, IntPtr display, out uint trackId);
177
178         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_bundle_policy")]
179         internal static extern WebRTCErrorCode SetBundlePolicy(IntPtr handle, WebRTCBundlePolicy bundlePolicy);
180
181         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_bundle_policy")]
182         internal static extern WebRTCErrorCode GetBundlePolicy(IntPtr handle, out WebRTCBundlePolicy bundlePolicy);
183
184         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_mic_source_set_sound_stream_info")]
185         internal static extern WebRTCErrorCode SetAudioStreamPolicyToMicrophoneSource(IntPtr handle, uint sourceId, AudioStreamPolicyHandle streamInfo);
186
187         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_sound_stream_info")]
188         internal static extern WebRTCErrorCode SetAudioStreamPolicy(IntPtr handle, uint trackId, AudioStreamPolicyHandle streamInfo);
189
190         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_display")]
191         internal static extern WebRTCErrorCode SetDisplay(IntPtr handle, uint trackId, WebRTCDisplayType type, IntPtr display);
192
193         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_ecore_wl_display")]
194         internal static extern WebRTCErrorCode SetEcoreDisplay(IntPtr handle, uint trackId, IntPtr display);
195
196         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_display_mode")]
197         internal static extern WebRTCErrorCode SetDisplayMode(IntPtr handle, uint trackId, WebRTCDisplayMode mode);
198
199         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_display_mode")]
200         internal static extern WebRTCErrorCode GetDisplayMode(IntPtr handle, uint trackId, out WebRTCDisplayMode mode);
201
202         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_display_visible")]
203         internal static extern WebRTCErrorCode SetDisplayVisible(IntPtr handle, uint trackId, bool isVisible);
204
205         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_display_visible")]
206         internal static extern WebRTCErrorCode GetDisplayVisible(IntPtr handle, uint trackId, out bool isVisible);
207
208         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_stun_server")]
209         internal static extern WebRTCErrorCode GetStunServer(IntPtr handle, out string server);
210
211         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_stun_server")]
212         internal static extern WebRTCErrorCode SetStunServer(IntPtr handle, string server);
213
214         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_add_turn_server")]
215         internal static extern WebRTCErrorCode AddTurnServer(IntPtr handle, string server);
216
217         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_foreach_turn_server")]
218         internal static extern WebRTCErrorCode ForeachTurnServer(IntPtr handle, RetrieveTurnServerCallback callback, IntPtr userData = default);
219
220         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_ice_transport_policy")]
221         internal static extern WebRTCErrorCode SetIceTransportPolicy(IntPtr handle, IceTransportPolicy policy);
222
223         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_ice_transport_policy")]
224         internal static extern WebRTCErrorCode GetIceTransportPolicy(IntPtr handle, out IceTransportPolicy policy);
225
226         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_create_offer")]
227         internal static extern WebRTCErrorCode CreateSDPOffer(IntPtr handle, SafeBundleHandle bundle, out string offer);
228
229         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_create_offer_async")]
230         internal static extern WebRTCErrorCode CreateSDPOfferAsync(IntPtr handle, SafeBundleHandle bundle, SdpCreatedCallback callback, IntPtr userData);
231
232         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_create_answer")]
233         internal static extern WebRTCErrorCode CreateSDPAnswer(IntPtr handle, SafeBundleHandle bundle, out string offer);
234
235         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_create_answer_async")]
236         internal static extern WebRTCErrorCode CreateSDPAnswerAsync(IntPtr handle, SafeBundleHandle bundle, SdpCreatedCallback callback, IntPtr userData);
237
238         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_local_description")]
239         internal static extern WebRTCErrorCode SetLocalDescription(IntPtr handle, string description);
240
241         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_remote_description")]
242         internal static extern WebRTCErrorCode SetRemoteDescription(IntPtr handle, string description);
243
244         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_add_ice_candidate")]
245         internal static extern WebRTCErrorCode AddIceCandidate(IntPtr handle, string candidate);
246
247         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_foreach_media_source_supported_format")]
248         internal static extern WebRTCErrorCode SupportedMediaSourceFormat(IntPtr handle, SupportedMediaFormatCallback callback, IntPtr userData);
249
250         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_foreach_stats")]
251         internal static extern WebRTCErrorCode ForeachStats(IntPtr handle, int typeMask, RetrieveStatsCallback callback, IntPtr userData = default);
252
253
254         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_error_cb")]
255         internal static extern WebRTCErrorCode SetErrorOccurredCb(IntPtr handle, ErrorOccurredCallback callback, IntPtr userData = default);
256
257         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_error_cb")]
258         internal static extern WebRTCErrorCode UnsetErrorOccurredCb(IntPtr handle);
259
260         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_state_changed_cb")]
261         internal static extern WebRTCErrorCode SetStateChangedCb(IntPtr handle, StateChangedCallback callback, IntPtr userData = default);
262
263         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_state_changed_cb")]
264         internal static extern WebRTCErrorCode UnsetStateChangedCb(IntPtr handle);
265
266         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_ice_gathering_state_change_cb")]
267         internal static extern WebRTCErrorCode SetIceGatheringStateChangedCb(IntPtr handle, IceGatheringStateChangedCallback callback, IntPtr userData = default);
268
269         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_ice_gathering_state_change_cb")]
270         internal static extern WebRTCErrorCode UnsetIceGatheringStateChangedCb(IntPtr handle);
271
272         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_signaling_state_change_cb")]
273         internal static extern WebRTCErrorCode SetSignalingStateChangedCb(IntPtr handle, SignalingStateChangedCallback callback, IntPtr userData = default);
274
275         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_signaling_state_change_cb")]
276         internal static extern WebRTCErrorCode UnsetSignalingStateChangedCb(IntPtr handle);
277
278         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_peer_connection_state_change_cb")]
279         internal static extern WebRTCErrorCode SetPeerConnectionStateChangedCb(IntPtr handle, PeerConnectionStateChangedCallback callback, IntPtr userData = default);
280
281         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_peer_connection_state_change_cb")]
282         internal static extern WebRTCErrorCode UnsetPeerConnectionStateChangedCb(IntPtr handle);
283
284         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_ice_connection_state_change_cb")]
285         internal static extern WebRTCErrorCode SetIceConnectionStateChangedCb(IntPtr handle, IceConnectionStateChangedCallback callback, IntPtr userData = default);
286
287         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_ice_connection_state_change_cb")]
288         internal static extern WebRTCErrorCode UnsetIceConnectionStateChangedCb(IntPtr handle);
289
290         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_packet_source_set_buffer_state_changed_cb")]
291         internal static extern WebRTCErrorCode SetBufferStateChangedCb(IntPtr handle, uint sourceId, MediaPacketBufferStatusCallback callback, IntPtr userData = default);
292
293         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_packet_source_unset_buffer_state_changed_cb")]
294         internal static extern WebRTCErrorCode UnsetBufferStateChangedCb(IntPtr handle, uint sourceId);
295
296         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_negotiation_needed_cb")]
297         internal static extern WebRTCErrorCode SetNegotiationNeededCb(IntPtr handle, NegotiationNeededCallback callback, IntPtr userData = default);
298
299         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_negotiation_needed_cb")]
300         internal static extern WebRTCErrorCode UnsetNegotiationNeededCb(IntPtr handle);
301
302         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_ice_candidate_cb")]
303         internal static extern WebRTCErrorCode SetIceCandidateCb(IntPtr handle, IceCandidateCallback callback, IntPtr userData = default);
304
305         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_ice_candidate_cb")]
306         internal static extern WebRTCErrorCode UnsetIceCandidateCb(IntPtr handle);
307
308         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_track_added_cb")]
309         internal static extern WebRTCErrorCode SetTrackAddedCb(IntPtr handle, TrackAddedCallback callback, IntPtr userData = default);
310
311         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_track_added_cb")]
312         internal static extern WebRTCErrorCode UnsetTrackAddedCb(IntPtr handle);
313
314         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_encoded_audio_frame_cb")]
315         internal static extern WebRTCErrorCode SetAudioFrameEncodedCb(IntPtr handle, FrameEncodedCallback callback, IntPtr userData = default);
316
317         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_encoded_audio_frame_cb")]
318         internal static extern WebRTCErrorCode UnsetAudioFrameEncodedCb(IntPtr handle);
319
320         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_encoded_video_frame_cb")]
321         internal static extern WebRTCErrorCode SetVideoFrameEncodedCb(IntPtr handle, FrameEncodedCallback callback, IntPtr userData = default);
322
323         [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_unset_encoded_video_frame_cb")]
324         internal static extern WebRTCErrorCode UnsetVideoFrameEncodedCb(IntPtr handle);
325
326         [StructLayout(LayoutKind.Explicit)]
327         internal struct StatsPropertyValueStruct
328         {
329             [FieldOffsetAttribute(0)]
330             internal bool @bool;
331             [FieldOffsetAttribute(0)]
332             internal int @int;
333             [FieldOffsetAttribute(0)]
334             internal uint @uint;
335             [FieldOffsetAttribute(0)]
336             internal long @long;
337             [FieldOffsetAttribute(0)]
338             internal ulong @ulong;
339             [FieldOffsetAttribute(0)]
340             internal float @float;
341             [FieldOffsetAttribute(0)]
342             internal double @double;
343             [FieldOffsetAttribute(0)]
344             internal IntPtr @string;
345         }
346
347         [NativeStruct("webrtc_stats_prop_info_s", Include="webrtc.h", PkgConfig="capi-media-webrtc")]
348         [StructLayout(LayoutKind.Sequential)]
349         internal struct StatsPropertyStruct
350         {
351             internal string name;
352             internal WebRTCStatisticsProperty property;
353             internal WebRTCStatsPropertyType propertyType;
354             internal StatsPropertyValueStruct value;
355         }
356     }
357
358     internal class WebRTCHandle : SafeHandle
359     {
360         protected WebRTCHandle() : base(IntPtr.Zero, true)
361         {
362         }
363
364         public override bool IsInvalid => handle == IntPtr.Zero;
365
366         protected override bool ReleaseHandle()
367         {
368             var ret = NativeWebRTC.Destroy(handle);
369             if (ret != WebRTCErrorCode.None)
370             {
371                 Log.Debug(GetType().FullName, $"Failed to release native {GetType().Name}");
372                 return false;
373             }
374
375             return true;
376         }
377     }
378 }