gstreamer_pbutils/auto/functions.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::{EncodingTarget, ffi};
7use glib::translate::*;
8
9/// Returns the channels of the given AAC stream.
10/// ## `audio_config`
11/// a pointer to the AudioSpecificConfig
12/// as specified in the Elementary Stream Descriptor (esds)
13/// in ISO/IEC 14496-1.
14///
15/// # Returns
16///
17/// The channels or 0 if the channel could not be determined.
18#[doc(alias = "gst_codec_utils_aac_get_channels")]
19pub fn codec_utils_aac_get_channels(audio_config: &[u8]) -> u32 {
20 assert_initialized_main_thread!();
21 let len = audio_config.len() as _;
22 unsafe { ffi::gst_codec_utils_aac_get_channels(audio_config.to_glib_none().0, len) }
23}
24
25/// Translates the sample rate to the index corresponding to it in AAC spec.
26/// ## `rate`
27/// Sample rate
28///
29/// # Returns
30///
31/// The AAC index for this sample rate, -1 if the rate is not a
32/// valid AAC sample rate.
33#[doc(alias = "gst_codec_utils_aac_get_index_from_sample_rate")]
34pub fn codec_utils_aac_get_index_from_sample_rate(rate: u32) -> i32 {
35 assert_initialized_main_thread!();
36 unsafe { ffi::gst_codec_utils_aac_get_index_from_sample_rate(rate) }
37}
38
39/// Determines the level of a stream as defined in ISO/IEC 14496-3. For AAC LC
40/// streams, the constraints from the AAC audio profile are applied. For AAC
41/// Main, LTP, SSR and others, the Main profile is used.
42///
43/// The `audio_config` parameter follows the following format, starting from the
44/// most significant bit of the first byte:
45///
46/// * Bit 0:4 contains the AudioObjectType (if this is 0x5, then the
47/// real AudioObjectType is carried after the rate and channel data)
48/// * Bit 5:8 contains the sample frequency index (if this is 0xf, then the
49/// next 24 bits define the actual sample frequency, and subsequent
50/// fields are appropriately shifted).
51/// * Bit 9:12 contains the channel configuration
52/// ## `audio_config`
53/// a pointer to the AudioSpecificConfig
54/// as specified in the Elementary Stream Descriptor (esds)
55/// in ISO/IEC 14496-1.
56///
57/// # Returns
58///
59/// The level as a const string and [`None`] if the level could not be
60/// determined.
61#[doc(alias = "gst_codec_utils_aac_get_level")]
62pub fn codec_utils_aac_get_level(audio_config: &[u8]) -> Result<glib::GString, glib::BoolError> {
63 assert_initialized_main_thread!();
64 let len = audio_config.len() as _;
65 unsafe {
66 Option::<_>::from_glib_none(ffi::gst_codec_utils_aac_get_level(
67 audio_config.to_glib_none().0,
68 len,
69 ))
70 .ok_or_else(|| glib::bool_error!("Failed to get AAC level"))
71 }
72}
73
74/// Returns the profile of the given AAC stream as a string. The profile is
75/// normally determined using the AudioObjectType field which is in the first
76/// 5 bits of `audio_config`
77/// ## `audio_config`
78/// a pointer to the AudioSpecificConfig
79/// as specified in the Elementary Stream Descriptor (esds)
80/// in ISO/IEC 14496-1.
81///
82/// # Returns
83///
84/// The profile as a const string and [`None`] if the profile could not be
85/// determined.
86#[doc(alias = "gst_codec_utils_aac_get_profile")]
87pub fn codec_utils_aac_get_profile(audio_config: &[u8]) -> Result<glib::GString, glib::BoolError> {
88 assert_initialized_main_thread!();
89 let len = audio_config.len() as _;
90 unsafe {
91 Option::<_>::from_glib_none(ffi::gst_codec_utils_aac_get_profile(
92 audio_config.to_glib_none().0,
93 len,
94 ))
95 .ok_or_else(|| glib::bool_error!("Failed to get AAC profile"))
96 }
97}
98
99/// Translates the sample rate index found in AAC headers to the actual sample
100/// rate.
101/// ## `audio_config`
102/// a pointer to the AudioSpecificConfig
103/// as specified in the Elementary Stream Descriptor (esds)
104/// in ISO/IEC 14496-1.
105///
106/// # Returns
107///
108/// The sample rate if sr_idx is valid, 0 otherwise.
109#[doc(alias = "gst_codec_utils_aac_get_sample_rate")]
110pub fn codec_utils_aac_get_sample_rate(audio_config: &[u8]) -> u32 {
111 assert_initialized_main_thread!();
112 let len = audio_config.len() as _;
113 unsafe { ffi::gst_codec_utils_aac_get_sample_rate(audio_config.to_glib_none().0, len) }
114}
115
116/// Translates the sample rate index found in AAC headers to the actual sample
117/// rate.
118/// ## `sr_idx`
119/// Sample rate index as from the AudioSpecificConfig (MPEG-4
120/// container) or ADTS frame header
121///
122/// # Returns
123///
124/// The sample rate if `sr_idx` is valid, 0 otherwise.
125#[doc(alias = "gst_codec_utils_aac_get_sample_rate_from_index")]
126pub fn codec_utils_aac_get_sample_rate_from_index(sr_idx: u32) -> u32 {
127 assert_initialized_main_thread!();
128 unsafe { ffi::gst_codec_utils_aac_get_sample_rate_from_index(sr_idx) }
129}
130
131/// Transform a seq_level_idx into the level string
132/// ## `seq_level_idx`
133/// A seq_level_idx
134///
135/// # Returns
136///
137/// the level string or [`None`] if the seq_level_idx is unknown
138#[cfg(feature = "v1_26")]
139#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
140#[doc(alias = "gst_codec_utils_av1_get_level")]
141pub fn codec_utils_av1_get_level(seq_level_idx: u8) -> Result<glib::GString, glib::BoolError> {
142 assert_initialized_main_thread!();
143 unsafe {
144 Option::<_>::from_glib_none(ffi::gst_codec_utils_av1_get_level(seq_level_idx))
145 .ok_or_else(|| glib::bool_error!("Failed to get AV1 level"))
146 }
147}
148
149/// Transform a level string from the caps into the seq_level_idx
150/// ## `level`
151/// A level string from caps
152///
153/// # Returns
154///
155/// the seq_level_idx or 31 (max-level) if the level is unknown
156#[cfg(feature = "v1_26")]
157#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
158#[doc(alias = "gst_codec_utils_av1_get_seq_level_idx")]
159pub fn codec_utils_av1_get_seq_level_idx(level: &str) -> u8 {
160 assert_initialized_main_thread!();
161 unsafe { ffi::gst_codec_utils_av1_get_seq_level_idx(level.to_glib_none().0) }
162}
163
164/// Converts a RFC 6381 compatible codec string to [`gst::Caps`][crate::gst::Caps]. More than one codec
165/// string can be present (separated by `,`).
166///
167/// Registered codecs can be found at http://mp4ra.org/#/codecs
168/// ## `codecs_field`
169/// A mime codec string field
170///
171/// # Returns
172///
173/// The corresponding [`gst::Caps`][crate::gst::Caps] or [`None`]
174#[cfg(feature = "v1_22")]
175#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
176#[doc(alias = "gst_codec_utils_caps_from_mime_codec")]
177pub fn codec_utils_caps_from_mime_codec(codecs_field: &str) -> Option<gst::Caps> {
178 assert_initialized_main_thread!();
179 unsafe {
180 from_glib_full(ffi::gst_codec_utils_caps_from_mime_codec(
181 codecs_field.to_glib_none().0,
182 ))
183 }
184}
185
186/// Converts the level indication (level_idc) in the stream's
187/// sequence parameter set into a string. The SPS is expected to have the
188/// same format as for [`codec_utils_h264_get_profile()`][crate::codec_utils_h264_get_profile()].
189/// ## `sps`
190/// Pointer to the sequence parameter set for the stream.
191///
192/// # Returns
193///
194/// The level as a const string, or [`None`] if there is an error.
195#[doc(alias = "gst_codec_utils_h264_get_level")]
196pub fn codec_utils_h264_get_level(sps: &[u8]) -> Result<glib::GString, glib::BoolError> {
197 assert_initialized_main_thread!();
198 let len = sps.len() as _;
199 unsafe {
200 Option::<_>::from_glib_none(ffi::gst_codec_utils_h264_get_level(
201 sps.to_glib_none().0,
202 len,
203 ))
204 .ok_or_else(|| glib::bool_error!("Failed to get H264 level"))
205 }
206}
207
208/// Transform a level string from the caps into the level_idc
209/// ## `level`
210/// A level string from caps
211///
212/// # Returns
213///
214/// the level_idc or 0 if the level is unknown
215#[doc(alias = "gst_codec_utils_h264_get_level_idc")]
216pub fn codec_utils_h264_get_level_idc(level: &str) -> u8 {
217 assert_initialized_main_thread!();
218 unsafe { ffi::gst_codec_utils_h264_get_level_idc(level.to_glib_none().0) }
219}
220
221/// Converts the profile indication (profile_idc) in the stream's
222/// sequence parameter set into a string. The SPS is expected to have the
223/// following format, as defined in the H.264 specification. The SPS is viewed
224/// as a bitstream here, with bit 0 being the most significant bit of the first
225/// byte.
226///
227/// * Bit 0:7 - Profile indication
228/// * Bit 8 - constraint_set0_flag
229/// * Bit 9 - constraint_set1_flag
230/// * Bit 10 - constraint_set2_flag
231/// * Bit 11 - constraint_set3_flag
232/// * Bit 12 - constraint_set3_flag
233/// * Bit 13:15 - Reserved
234/// * Bit 16:24 - Level indication
235/// ## `sps`
236/// Pointer to the sequence parameter set for the stream.
237///
238/// # Returns
239///
240/// The profile as a const string, or [`None`] if there is an error.
241#[doc(alias = "gst_codec_utils_h264_get_profile")]
242pub fn codec_utils_h264_get_profile(sps: &[u8]) -> Result<glib::GString, glib::BoolError> {
243 assert_initialized_main_thread!();
244 let len = sps.len() as _;
245 unsafe {
246 Option::<_>::from_glib_none(ffi::gst_codec_utils_h264_get_profile(
247 sps.to_glib_none().0,
248 len,
249 ))
250 .ok_or_else(|| glib::bool_error!("Failed to get H264 profile"))
251 }
252}
253
254/// Converts the level indication (general_level_idc) in the stream's
255/// profile_tier_level structure into a string. The profiel_tier_level is
256/// expected to have the same format as for [`codec_utils_h264_get_profile()`][crate::codec_utils_h264_get_profile()].
257/// ## `profile_tier_level`
258/// Pointer to the profile_tier_level
259/// for the stream
260///
261/// # Returns
262///
263/// The level as a const string, or [`None`] if there is an error.
264#[doc(alias = "gst_codec_utils_h265_get_level")]
265pub fn codec_utils_h265_get_level(
266 profile_tier_level: &[u8],
267) -> Result<glib::GString, glib::BoolError> {
268 assert_initialized_main_thread!();
269 let len = profile_tier_level.len() as _;
270 unsafe {
271 Option::<_>::from_glib_none(ffi::gst_codec_utils_h265_get_level(
272 profile_tier_level.to_glib_none().0,
273 len,
274 ))
275 .ok_or_else(|| glib::bool_error!("Failed to get H265 level"))
276 }
277}
278
279/// Transform a level string from the caps into the level_idc
280/// ## `level`
281/// A level string from caps
282///
283/// # Returns
284///
285/// the level_idc or 0 if the level is unknown
286#[doc(alias = "gst_codec_utils_h265_get_level_idc")]
287pub fn codec_utils_h265_get_level_idc(level: &str) -> u8 {
288 assert_initialized_main_thread!();
289 unsafe { ffi::gst_codec_utils_h265_get_level_idc(level.to_glib_none().0) }
290}
291
292/// Converts the profile indication (general_profile_idc) in the stream's
293/// profile_level_tier structure into a string. The profile_tier_level is
294/// expected to have the following format, as defined in the H.265
295/// specification. The profile_tier_level is viewed as a bitstream here,
296/// with bit 0 being the most significant bit of the first byte.
297///
298/// * Bit 0:1 - general_profile_space
299/// * Bit 2 - general_tier_flag
300/// * Bit 3:7 - general_profile_idc
301/// * Bit 8:39 - gernal_profile_compatibility_flags
302/// * Bit 40 - general_progressive_source_flag
303/// * Bit 41 - general_interlaced_source_flag
304/// * Bit 42 - general_non_packed_constraint_flag
305/// * Bit 43 - general_frame_only_constraint_flag
306/// * Bit 44:87 - See below
307/// * Bit 88:95 - general_level_idc
308/// ## `profile_tier_level`
309/// Pointer to the profile_tier_level
310/// structure for the stream.
311///
312/// # Returns
313///
314/// The profile as a const string, or [`None`] if there is an error.
315#[doc(alias = "gst_codec_utils_h265_get_profile")]
316pub fn codec_utils_h265_get_profile(
317 profile_tier_level: &[u8],
318) -> Result<glib::GString, glib::BoolError> {
319 assert_initialized_main_thread!();
320 let len = profile_tier_level.len() as _;
321 unsafe {
322 Option::<_>::from_glib_none(ffi::gst_codec_utils_h265_get_profile(
323 profile_tier_level.to_glib_none().0,
324 len,
325 ))
326 .ok_or_else(|| glib::bool_error!("Failed to get H265 profile"))
327 }
328}
329
330/// Converts the tier indication (general_tier_flag) in the stream's
331/// profile_tier_level structure into a string. The profile_tier_level
332/// is expected to have the same format as for [`codec_utils_h264_get_profile()`][crate::codec_utils_h264_get_profile()].
333/// ## `profile_tier_level`
334/// Pointer to the profile_tier_level
335/// for the stream.
336///
337/// # Returns
338///
339/// The tier as a const string, or [`None`] if there is an error.
340#[doc(alias = "gst_codec_utils_h265_get_tier")]
341pub fn codec_utils_h265_get_tier(
342 profile_tier_level: &[u8],
343) -> Result<glib::GString, glib::BoolError> {
344 assert_initialized_main_thread!();
345 let len = profile_tier_level.len() as _;
346 unsafe {
347 Option::<_>::from_glib_none(ffi::gst_codec_utils_h265_get_tier(
348 profile_tier_level.to_glib_none().0,
349 len,
350 ))
351 .ok_or_else(|| glib::bool_error!("Failed to get H265 tier"))
352 }
353}
354
355/// Converts the level indication (general_level_idc) in the stream's
356/// ptl_record structure into a string.
357/// ## `ptl_record`
358/// Pointer to the VvcPTLRecord structure as defined in ISO/IEC 14496-15.
359///
360/// # Returns
361///
362/// The level as a const string, or [`None`] if there is an error.
363#[cfg(feature = "v1_26")]
364#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
365#[doc(alias = "gst_codec_utils_h266_get_level")]
366pub fn codec_utils_h266_get_level(ptl_record: &[u8]) -> Result<glib::GString, glib::BoolError> {
367 assert_initialized_main_thread!();
368 let len = ptl_record.len() as _;
369 unsafe {
370 Option::<_>::from_glib_none(ffi::gst_codec_utils_h266_get_level(
371 ptl_record.to_glib_none().0,
372 len,
373 ))
374 .ok_or_else(|| glib::bool_error!("Failed to get H266 level"))
375 }
376}
377
378/// Transform a level string from the caps into the level_idc
379/// ## `level`
380/// A level string from caps
381///
382/// # Returns
383///
384/// the level_idc or 0 if the level is unknown
385#[cfg(feature = "v1_26")]
386#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
387#[doc(alias = "gst_codec_utils_h266_get_level_idc")]
388pub fn codec_utils_h266_get_level_idc(level: &str) -> u8 {
389 assert_initialized_main_thread!();
390 unsafe { ffi::gst_codec_utils_h266_get_level_idc(level.to_glib_none().0) }
391}
392
393/// Converts the profile indication (general_profile_idc) in the stream's
394/// ptl_record structure into a string.
395/// ## `ptl_record`
396/// Pointer to the VvcPTLRecord structure as defined in ISO/IEC 14496-15.
397///
398/// # Returns
399///
400/// The profile as a const string, or [`None`] if there is an error.
401#[cfg(feature = "v1_26")]
402#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
403#[doc(alias = "gst_codec_utils_h266_get_profile")]
404pub fn codec_utils_h266_get_profile(ptl_record: &[u8]) -> Result<glib::GString, glib::BoolError> {
405 assert_initialized_main_thread!();
406 let len = ptl_record.len() as _;
407 unsafe {
408 Option::<_>::from_glib_none(ffi::gst_codec_utils_h266_get_profile(
409 ptl_record.to_glib_none().0,
410 len,
411 ))
412 .ok_or_else(|| glib::bool_error!("Failed to get H266 profile"))
413 }
414}
415
416/// Converts the tier indication (general_tier_flag) in the stream's
417/// ptl_record structure into a string.
418/// ## `ptl_record`
419/// Pointer to the VvcPTLRecord structure as defined in ISO/IEC 14496-15.
420///
421/// # Returns
422///
423/// The tier as a const string, or [`None`] if there is an error.
424#[cfg(feature = "v1_26")]
425#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
426#[doc(alias = "gst_codec_utils_h266_get_tier")]
427pub fn codec_utils_h266_get_tier(ptl_record: &[u8]) -> Result<glib::GString, glib::BoolError> {
428 assert_initialized_main_thread!();
429 let len = ptl_record.len() as _;
430 unsafe {
431 Option::<_>::from_glib_none(ffi::gst_codec_utils_h266_get_tier(
432 ptl_record.to_glib_none().0,
433 len,
434 ))
435 .ok_or_else(|| glib::bool_error!("Failed to get H266 tier"))
436 }
437}
438
439/// Converts the level indication in the stream's visual object sequence into
440/// a string. `vis_obj_seq` is expected to be the data following the visual
441/// object sequence start code. Only the first byte
442/// (profile_and_level_indication) is used.
443/// ## `vis_obj_seq`
444/// Pointer to the visual object
445/// sequence for the stream.
446///
447/// # Returns
448///
449/// The level as a const string, or NULL if there is an error.
450#[doc(alias = "gst_codec_utils_mpeg4video_get_level")]
451pub fn codec_utils_mpeg4video_get_level(
452 vis_obj_seq: &[u8],
453) -> Result<glib::GString, glib::BoolError> {
454 assert_initialized_main_thread!();
455 let len = vis_obj_seq.len() as _;
456 unsafe {
457 Option::<_>::from_glib_none(ffi::gst_codec_utils_mpeg4video_get_level(
458 vis_obj_seq.to_glib_none().0,
459 len,
460 ))
461 .ok_or_else(|| glib::bool_error!("Failed to get MPEG4 video level"))
462 }
463}
464
465/// Converts the profile indication in the stream's visual object sequence into
466/// a string. `vis_obj_seq` is expected to be the data following the visual
467/// object sequence start code. Only the first byte
468/// (profile_and_level_indication) is used.
469/// ## `vis_obj_seq`
470/// Pointer to the visual object
471/// sequence for the stream.
472///
473/// # Returns
474///
475/// The profile as a const string, or NULL if there is an error.
476#[doc(alias = "gst_codec_utils_mpeg4video_get_profile")]
477pub fn codec_utils_mpeg4video_get_profile(
478 vis_obj_seq: &[u8],
479) -> Result<glib::GString, glib::BoolError> {
480 assert_initialized_main_thread!();
481 let len = vis_obj_seq.len() as _;
482 unsafe {
483 Option::<_>::from_glib_none(ffi::gst_codec_utils_mpeg4video_get_profile(
484 vis_obj_seq.to_glib_none().0,
485 len,
486 ))
487 .ok_or_else(|| glib::bool_error!("Failed to get MPEG4 video profile"))
488 }
489}
490
491/// Converts the level indication in the vpcC record into a string.
492/// ## `level_idc`
493/// vp9 level value from the vpcC record
494///
495/// # Returns
496///
497/// The level as a const string and [`None`] if the level could not be
498/// determined.
499#[cfg(feature = "v1_30")]
500#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
501#[doc(alias = "gst_codec_utils_vp9_get_level")]
502pub fn codec_utils_vp9_get_level(level_idc: u8) -> Option<glib::GString> {
503 assert_initialized_main_thread!();
504 unsafe { from_glib_none(ffi::gst_codec_utils_vp9_get_level(level_idc)) }
505}
506
507/// Transform a level string from the caps into the level_idc
508/// ## `level`
509/// A vp9 level string from caps
510///
511/// # Returns
512///
513/// The level indication or 0 if the level is unknown.
514#[cfg(feature = "v1_30")]
515#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
516#[doc(alias = "gst_codec_utils_vp9_get_level_idc")]
517pub fn codec_utils_vp9_get_level_idc(level: &str) -> u8 {
518 assert_initialized_main_thread!();
519 unsafe { ffi::gst_codec_utils_vp9_get_level_idc(level.to_glib_none().0) }
520}
521
522/// List all available [`EncodingTarget`][crate::EncodingTarget] for the specified category, or all categories
523/// if `categoryname` is [`None`].
524/// ## `categoryname`
525/// The category, for ex: `GST_ENCODING_CATEGORY_DEVICE`.
526/// Can be [`None`].
527///
528/// # Returns
529///
530/// The list of [`EncodingTarget`][crate::EncodingTarget]
531#[doc(alias = "gst_encoding_list_all_targets")]
532pub fn encoding_list_all_targets(categoryname: Option<&str>) -> Vec<EncodingTarget> {
533 assert_initialized_main_thread!();
534 unsafe {
535 FromGlibPtrContainer::from_glib_full(ffi::gst_encoding_list_all_targets(
536 categoryname.to_glib_none().0,
537 ))
538 }
539}
540
541/// Lists all [`EncodingTarget`][crate::EncodingTarget] categories present on disk.
542///
543/// # Returns
544///
545/// A list
546/// of [`EncodingTarget`][crate::EncodingTarget] categories.
547#[doc(alias = "gst_encoding_list_available_categories")]
548pub fn encoding_list_available_categories() -> Vec<glib::GString> {
549 assert_initialized_main_thread!();
550 unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_encoding_list_available_categories()) }
551}
552
553/// Returns a localised string describing the given element, for use in
554/// error dialogs or other messages to be seen by the user.
555///
556/// This function is mainly for internal use, applications would typically
557/// use `gst_missing_plugin_message_get_description()` to get a description of
558/// a missing feature from a missing-plugin message.
559/// ## `factory_name`
560/// the name of the element, e.g. "giosrc"
561///
562/// # Returns
563///
564/// a newly-allocated description string. Free
565/// string with `g_free()` when not needed any longer.
566#[doc(alias = "gst_pb_utils_get_element_description")]
567pub fn pb_utils_get_element_description(factory_name: &str) -> glib::GString {
568 assert_initialized_main_thread!();
569 unsafe {
570 from_glib_full(ffi::gst_pb_utils_get_element_description(
571 factory_name.to_glib_none().0,
572 ))
573 }
574}
575
576/// Returns a localised string describing a sink element handling the protocol
577/// specified in `protocol`, for use in error dialogs or other messages to be
578/// seen by the user.
579///
580/// This function is mainly for internal use, applications would typically
581/// use `gst_missing_plugin_message_get_description()` to get a description of
582/// a missing feature from a missing-plugin message.
583/// ## `protocol`
584/// the protocol the sink element needs to handle, e.g. "http"
585///
586/// # Returns
587///
588/// a newly-allocated description string. Free
589/// string with `g_free()` when not needed any longer.
590#[doc(alias = "gst_pb_utils_get_sink_description")]
591pub fn pb_utils_get_sink_description(protocol: &str) -> glib::GString {
592 assert_initialized_main_thread!();
593 unsafe {
594 from_glib_full(ffi::gst_pb_utils_get_sink_description(
595 protocol.to_glib_none().0,
596 ))
597 }
598}
599
600/// Returns a localised string describing a source element handling the protocol
601/// specified in `protocol`, for use in error dialogs or other messages to be
602/// seen by the user.
603///
604/// This function is mainly for internal use, applications would typically
605/// use `gst_missing_plugin_message_get_description()` to get a description of
606/// a missing feature from a missing-plugin message.
607/// ## `protocol`
608/// the protocol the source element needs to handle, e.g. "http"
609///
610/// # Returns
611///
612/// a newly-allocated description string. Free
613/// string with `g_free()` when not needed any longer.
614#[doc(alias = "gst_pb_utils_get_source_description")]
615pub fn pb_utils_get_source_description(protocol: &str) -> glib::GString {
616 assert_initialized_main_thread!();
617 unsafe {
618 from_glib_full(ffi::gst_pb_utils_get_source_description(
619 protocol.to_glib_none().0,
620 ))
621 }
622}
623
624/// Gets the version number of the GStreamer Plugins Base libraries.
625///
626/// # Returns
627///
628///
629/// ## `major`
630/// pointer to a guint to store the major version number, or [`None`]
631///
632/// ## `minor`
633/// pointer to a guint to store the minor version number, or [`None`]
634///
635/// ## `micro`
636/// pointer to a guint to store the micro version number, or [`None`]
637///
638/// ## `nano`
639/// pointer to a guint to store the nano version number, or [`None`]
640#[doc(alias = "gst_plugins_base_version")]
641pub fn plugins_base_version() -> (u32, u32, u32, u32) {
642 skip_assert_initialized!();
643 unsafe {
644 let mut major = std::mem::MaybeUninit::uninit();
645 let mut minor = std::mem::MaybeUninit::uninit();
646 let mut micro = std::mem::MaybeUninit::uninit();
647 let mut nano = std::mem::MaybeUninit::uninit();
648 ffi::gst_plugins_base_version(
649 major.as_mut_ptr(),
650 minor.as_mut_ptr(),
651 micro.as_mut_ptr(),
652 nano.as_mut_ptr(),
653 );
654 (
655 major.assume_init(),
656 minor.assume_init(),
657 micro.assume_init(),
658 nano.assume_init(),
659 )
660 }
661}
662
663/// This function returns a string that is useful for describing this version
664/// of GStreamer's gst-plugins-base libraries to the outside world: user agent
665/// strings, logging, about dialogs ...
666///
667/// # Returns
668///
669/// a newly allocated string describing this version of gst-plugins-base
670#[doc(alias = "gst_plugins_base_version_string")]
671pub fn plugins_base_version_string() -> glib::GString {
672 skip_assert_initialized!();
673 unsafe { from_glib_full(ffi::gst_plugins_base_version_string()) }
674}