gstreamer_rtsp/auto/
flags.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::{bitflags::bitflags, prelude::*, translate::*};
8
9bitflags! {
10    /// The possible events for the connection.
11    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
12    #[doc(alias = "GstRTSPEvent")]
13    pub struct RTSPEvent: u32 {
14        /// connection is readable
15        #[doc(alias = "GST_RTSP_EV_READ")]
16        const READ = ffi::GST_RTSP_EV_READ as _;
17        /// connection is writable
18        #[doc(alias = "GST_RTSP_EV_WRITE")]
19        const WRITE = ffi::GST_RTSP_EV_WRITE as _;
20    }
21}
22
23#[doc(hidden)]
24impl IntoGlib for RTSPEvent {
25    type GlibType = ffi::GstRTSPEvent;
26
27    #[inline]
28    fn into_glib(self) -> ffi::GstRTSPEvent {
29        self.bits()
30    }
31}
32
33#[doc(hidden)]
34impl FromGlib<ffi::GstRTSPEvent> for RTSPEvent {
35    #[inline]
36    unsafe fn from_glib(value: ffi::GstRTSPEvent) -> Self {
37        skip_assert_initialized!();
38        Self::from_bits_truncate(value)
39    }
40}
41
42impl StaticType for RTSPEvent {
43    #[inline]
44    #[doc(alias = "gst_rtsp_event_get_type")]
45    fn static_type() -> glib::Type {
46        unsafe { from_glib(ffi::gst_rtsp_event_get_type()) }
47    }
48}
49
50impl glib::HasParamSpec for RTSPEvent {
51    type ParamSpec = glib::ParamSpecFlags;
52    type SetValue = Self;
53    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
54
55    fn param_spec_builder() -> Self::BuilderFn {
56        Self::ParamSpec::builder
57    }
58}
59
60impl glib::value::ValueType for RTSPEvent {
61    type Type = Self;
62}
63
64unsafe impl<'a> glib::value::FromValue<'a> for RTSPEvent {
65    type Checker = glib::value::GenericValueTypeChecker<Self>;
66
67    #[inline]
68    unsafe fn from_value(value: &'a glib::Value) -> Self {
69        skip_assert_initialized!();
70        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
71    }
72}
73
74impl ToValue for RTSPEvent {
75    #[inline]
76    fn to_value(&self) -> glib::Value {
77        let mut value = glib::Value::for_value_type::<Self>();
78        unsafe {
79            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
80        }
81        value
82    }
83
84    #[inline]
85    fn value_type(&self) -> glib::Type {
86        Self::static_type()
87    }
88}
89
90impl From<RTSPEvent> for glib::Value {
91    #[inline]
92    fn from(v: RTSPEvent) -> Self {
93        skip_assert_initialized!();
94        ToValue::to_value(&v)
95    }
96}
97
98bitflags! {
99    /// The different transport methods.
100    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
101    #[doc(alias = "GstRTSPLowerTrans")]
102    pub struct RTSPLowerTrans: u32 {
103        /// stream data over UDP
104        #[doc(alias = "GST_RTSP_LOWER_TRANS_UDP")]
105        const UDP = ffi::GST_RTSP_LOWER_TRANS_UDP as _;
106        /// stream data over UDP multicast
107        #[doc(alias = "GST_RTSP_LOWER_TRANS_UDP_MCAST")]
108        const UDP_MCAST = ffi::GST_RTSP_LOWER_TRANS_UDP_MCAST as _;
109        /// stream data over TCP
110        #[doc(alias = "GST_RTSP_LOWER_TRANS_TCP")]
111        const TCP = ffi::GST_RTSP_LOWER_TRANS_TCP as _;
112        /// stream data tunneled over HTTP.
113        #[doc(alias = "GST_RTSP_LOWER_TRANS_HTTP")]
114        const HTTP = ffi::GST_RTSP_LOWER_TRANS_HTTP as _;
115        /// encrypt TCP and HTTP with TLS
116        #[doc(alias = "GST_RTSP_LOWER_TRANS_TLS")]
117        const TLS = ffi::GST_RTSP_LOWER_TRANS_TLS as _;
118    }
119}
120
121#[doc(hidden)]
122impl IntoGlib for RTSPLowerTrans {
123    type GlibType = ffi::GstRTSPLowerTrans;
124
125    #[inline]
126    fn into_glib(self) -> ffi::GstRTSPLowerTrans {
127        self.bits()
128    }
129}
130
131#[doc(hidden)]
132impl FromGlib<ffi::GstRTSPLowerTrans> for RTSPLowerTrans {
133    #[inline]
134    unsafe fn from_glib(value: ffi::GstRTSPLowerTrans) -> Self {
135        skip_assert_initialized!();
136        Self::from_bits_truncate(value)
137    }
138}
139
140impl StaticType for RTSPLowerTrans {
141    #[inline]
142    #[doc(alias = "gst_rtsp_lower_trans_get_type")]
143    fn static_type() -> glib::Type {
144        unsafe { from_glib(ffi::gst_rtsp_lower_trans_get_type()) }
145    }
146}
147
148impl glib::HasParamSpec for RTSPLowerTrans {
149    type ParamSpec = glib::ParamSpecFlags;
150    type SetValue = Self;
151    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
152
153    fn param_spec_builder() -> Self::BuilderFn {
154        Self::ParamSpec::builder
155    }
156}
157
158impl glib::value::ValueType for RTSPLowerTrans {
159    type Type = Self;
160}
161
162unsafe impl<'a> glib::value::FromValue<'a> for RTSPLowerTrans {
163    type Checker = glib::value::GenericValueTypeChecker<Self>;
164
165    #[inline]
166    unsafe fn from_value(value: &'a glib::Value) -> Self {
167        skip_assert_initialized!();
168        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
169    }
170}
171
172impl ToValue for RTSPLowerTrans {
173    #[inline]
174    fn to_value(&self) -> glib::Value {
175        let mut value = glib::Value::for_value_type::<Self>();
176        unsafe {
177            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
178        }
179        value
180    }
181
182    #[inline]
183    fn value_type(&self) -> glib::Type {
184        Self::static_type()
185    }
186}
187
188impl From<RTSPLowerTrans> for glib::Value {
189    #[inline]
190    fn from(v: RTSPLowerTrans) -> Self {
191        skip_assert_initialized!();
192        ToValue::to_value(&v)
193    }
194}
195
196bitflags! {
197    /// The different supported RTSP methods.
198    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
199    #[doc(alias = "GstRTSPMethod")]
200    pub struct RTSPMethod: u32 {
201        /// the DESCRIBE method
202        #[doc(alias = "GST_RTSP_DESCRIBE")]
203        const DESCRIBE = ffi::GST_RTSP_DESCRIBE as _;
204        /// the ANNOUNCE method
205        #[doc(alias = "GST_RTSP_ANNOUNCE")]
206        const ANNOUNCE = ffi::GST_RTSP_ANNOUNCE as _;
207        /// the GET_PARAMETER method
208        #[doc(alias = "GST_RTSP_GET_PARAMETER")]
209        const GET_PARAMETER = ffi::GST_RTSP_GET_PARAMETER as _;
210        /// the OPTIONS method
211        #[doc(alias = "GST_RTSP_OPTIONS")]
212        const OPTIONS = ffi::GST_RTSP_OPTIONS as _;
213        /// the PAUSE method
214        #[doc(alias = "GST_RTSP_PAUSE")]
215        const PAUSE = ffi::GST_RTSP_PAUSE as _;
216        /// the PLAY method
217        #[doc(alias = "GST_RTSP_PLAY")]
218        const PLAY = ffi::GST_RTSP_PLAY as _;
219        /// the RECORD method
220        #[doc(alias = "GST_RTSP_RECORD")]
221        const RECORD = ffi::GST_RTSP_RECORD as _;
222        /// the REDIRECT method
223        #[doc(alias = "GST_RTSP_REDIRECT")]
224        const REDIRECT = ffi::GST_RTSP_REDIRECT as _;
225        /// the SETUP method
226        #[doc(alias = "GST_RTSP_SETUP")]
227        const SETUP = ffi::GST_RTSP_SETUP as _;
228        /// the SET_PARAMETER method
229        #[doc(alias = "GST_RTSP_SET_PARAMETER")]
230        const SET_PARAMETER = ffi::GST_RTSP_SET_PARAMETER as _;
231        /// the TEARDOWN method
232        #[doc(alias = "GST_RTSP_TEARDOWN")]
233        const TEARDOWN = ffi::GST_RTSP_TEARDOWN as _;
234        /// the GET method (HTTP).
235        #[doc(alias = "GST_RTSP_GET")]
236        const GET = ffi::GST_RTSP_GET as _;
237        /// the POST method (HTTP).
238        #[doc(alias = "GST_RTSP_POST")]
239        const POST = ffi::GST_RTSP_POST as _;
240    }
241}
242
243impl RTSPMethod {
244    #[doc(alias = "gst_rtsp_method_as_text")]
245    pub fn as_text(self) -> Option<glib::GString> {
246        assert_initialized_main_thread!();
247        unsafe { from_glib_none(ffi::gst_rtsp_method_as_text(self.into_glib())) }
248    }
249}
250
251#[doc(hidden)]
252impl IntoGlib for RTSPMethod {
253    type GlibType = ffi::GstRTSPMethod;
254
255    #[inline]
256    fn into_glib(self) -> ffi::GstRTSPMethod {
257        self.bits()
258    }
259}
260
261#[doc(hidden)]
262impl FromGlib<ffi::GstRTSPMethod> for RTSPMethod {
263    #[inline]
264    unsafe fn from_glib(value: ffi::GstRTSPMethod) -> Self {
265        skip_assert_initialized!();
266        Self::from_bits_truncate(value)
267    }
268}
269
270impl StaticType for RTSPMethod {
271    #[inline]
272    #[doc(alias = "gst_rtsp_method_get_type")]
273    fn static_type() -> glib::Type {
274        unsafe { from_glib(ffi::gst_rtsp_method_get_type()) }
275    }
276}
277
278impl glib::HasParamSpec for RTSPMethod {
279    type ParamSpec = glib::ParamSpecFlags;
280    type SetValue = Self;
281    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
282
283    fn param_spec_builder() -> Self::BuilderFn {
284        Self::ParamSpec::builder
285    }
286}
287
288impl glib::value::ValueType for RTSPMethod {
289    type Type = Self;
290}
291
292unsafe impl<'a> glib::value::FromValue<'a> for RTSPMethod {
293    type Checker = glib::value::GenericValueTypeChecker<Self>;
294
295    #[inline]
296    unsafe fn from_value(value: &'a glib::Value) -> Self {
297        skip_assert_initialized!();
298        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
299    }
300}
301
302impl ToValue for RTSPMethod {
303    #[inline]
304    fn to_value(&self) -> glib::Value {
305        let mut value = glib::Value::for_value_type::<Self>();
306        unsafe {
307            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
308        }
309        value
310    }
311
312    #[inline]
313    fn value_type(&self) -> glib::Type {
314        Self::static_type()
315    }
316}
317
318impl From<RTSPMethod> for glib::Value {
319    #[inline]
320    fn from(v: RTSPMethod) -> Self {
321        skip_assert_initialized!();
322        ToValue::to_value(&v)
323    }
324}
325
326bitflags! {
327    /// The transfer profile to use.
328    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
329    #[doc(alias = "GstRTSPProfile")]
330    pub struct RTSPProfile: u32 {
331        /// the Audio/Visual profile (RFC 3551)
332        #[doc(alias = "GST_RTSP_PROFILE_AVP")]
333        const AVP = ffi::GST_RTSP_PROFILE_AVP as _;
334        /// the secure Audio/Visual profile (RFC 3711)
335        #[doc(alias = "GST_RTSP_PROFILE_SAVP")]
336        const SAVP = ffi::GST_RTSP_PROFILE_SAVP as _;
337        /// the Audio/Visual profile with feedback (RFC 4585)
338        #[doc(alias = "GST_RTSP_PROFILE_AVPF")]
339        const AVPF = ffi::GST_RTSP_PROFILE_AVPF as _;
340        /// the secure Audio/Visual profile with feedback (RFC 5124)
341        #[doc(alias = "GST_RTSP_PROFILE_SAVPF")]
342        const SAVPF = ffi::GST_RTSP_PROFILE_SAVPF as _;
343    }
344}
345
346#[doc(hidden)]
347impl IntoGlib for RTSPProfile {
348    type GlibType = ffi::GstRTSPProfile;
349
350    #[inline]
351    fn into_glib(self) -> ffi::GstRTSPProfile {
352        self.bits()
353    }
354}
355
356#[doc(hidden)]
357impl FromGlib<ffi::GstRTSPProfile> for RTSPProfile {
358    #[inline]
359    unsafe fn from_glib(value: ffi::GstRTSPProfile) -> Self {
360        skip_assert_initialized!();
361        Self::from_bits_truncate(value)
362    }
363}
364
365impl StaticType for RTSPProfile {
366    #[inline]
367    #[doc(alias = "gst_rtsp_profile_get_type")]
368    fn static_type() -> glib::Type {
369        unsafe { from_glib(ffi::gst_rtsp_profile_get_type()) }
370    }
371}
372
373impl glib::HasParamSpec for RTSPProfile {
374    type ParamSpec = glib::ParamSpecFlags;
375    type SetValue = Self;
376    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
377
378    fn param_spec_builder() -> Self::BuilderFn {
379        Self::ParamSpec::builder
380    }
381}
382
383impl glib::value::ValueType for RTSPProfile {
384    type Type = Self;
385}
386
387unsafe impl<'a> glib::value::FromValue<'a> for RTSPProfile {
388    type Checker = glib::value::GenericValueTypeChecker<Self>;
389
390    #[inline]
391    unsafe fn from_value(value: &'a glib::Value) -> Self {
392        skip_assert_initialized!();
393        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
394    }
395}
396
397impl ToValue for RTSPProfile {
398    #[inline]
399    fn to_value(&self) -> glib::Value {
400        let mut value = glib::Value::for_value_type::<Self>();
401        unsafe {
402            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
403        }
404        value
405    }
406
407    #[inline]
408    fn value_type(&self) -> glib::Type {
409        Self::static_type()
410    }
411}
412
413impl From<RTSPProfile> for glib::Value {
414    #[inline]
415    fn from(v: RTSPProfile) -> Self {
416        skip_assert_initialized!();
417        ToValue::to_value(&v)
418    }
419}
420
421bitflags! {
422    /// The transfer mode to use.
423    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
424    #[doc(alias = "GstRTSPTransMode")]
425    pub struct RTSPTransMode: u32 {
426        /// transfer RTP data
427        #[doc(alias = "GST_RTSP_TRANS_RTP")]
428        const RTP = ffi::GST_RTSP_TRANS_RTP as _;
429        /// transfer RDT (RealMedia) data
430        #[doc(alias = "GST_RTSP_TRANS_RDT")]
431        const RDT = ffi::GST_RTSP_TRANS_RDT as _;
432    }
433}
434
435#[doc(hidden)]
436impl IntoGlib for RTSPTransMode {
437    type GlibType = ffi::GstRTSPTransMode;
438
439    #[inline]
440    fn into_glib(self) -> ffi::GstRTSPTransMode {
441        self.bits()
442    }
443}
444
445#[doc(hidden)]
446impl FromGlib<ffi::GstRTSPTransMode> for RTSPTransMode {
447    #[inline]
448    unsafe fn from_glib(value: ffi::GstRTSPTransMode) -> Self {
449        skip_assert_initialized!();
450        Self::from_bits_truncate(value)
451    }
452}
453
454impl StaticType for RTSPTransMode {
455    #[inline]
456    #[doc(alias = "gst_rtsp_trans_mode_get_type")]
457    fn static_type() -> glib::Type {
458        unsafe { from_glib(ffi::gst_rtsp_trans_mode_get_type()) }
459    }
460}
461
462impl glib::HasParamSpec for RTSPTransMode {
463    type ParamSpec = glib::ParamSpecFlags;
464    type SetValue = Self;
465    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
466
467    fn param_spec_builder() -> Self::BuilderFn {
468        Self::ParamSpec::builder
469    }
470}
471
472impl glib::value::ValueType for RTSPTransMode {
473    type Type = Self;
474}
475
476unsafe impl<'a> glib::value::FromValue<'a> for RTSPTransMode {
477    type Checker = glib::value::GenericValueTypeChecker<Self>;
478
479    #[inline]
480    unsafe fn from_value(value: &'a glib::Value) -> Self {
481        skip_assert_initialized!();
482        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
483    }
484}
485
486impl ToValue for RTSPTransMode {
487    #[inline]
488    fn to_value(&self) -> glib::Value {
489        let mut value = glib::Value::for_value_type::<Self>();
490        unsafe {
491            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
492        }
493        value
494    }
495
496    #[inline]
497    fn value_type(&self) -> glib::Type {
498        Self::static_type()
499    }
500}
501
502impl From<RTSPTransMode> for glib::Value {
503    #[inline]
504    fn from(v: RTSPTransMode) -> Self {
505        skip_assert_initialized!();
506        ToValue::to_value(&v)
507    }
508}