gstreamer/
parse_context.rs
1use crate::ffi;
4use glib::translate::*;
5
6glib::wrapper! {
7 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 #[doc(alias = "GstParseContext")]
10 pub struct ParseContext(Boxed<ffi::GstParseContext>);
11
12 match fn {
13 copy => |ptr| ffi::gst_parse_context_copy(ptr),
14 free => |ptr| ffi::gst_parse_context_free(ptr),
15 type_ => || ffi::gst_parse_context_get_type(),
16 }
17}
18
19unsafe impl Send for ParseContext {}
20unsafe impl Sync for ParseContext {}
21
22impl ParseContext {
23 #[doc(alias = "gst_parse_context_new")]
33 pub fn new() -> Self {
34 unsafe { from_glib_full(ffi::gst_parse_context_new()) }
35 }
36
37 #[doc(alias = "get_missing_elements")]
47 #[doc(alias = "gst_parse_context_get_missing_elements")]
48 pub fn missing_elements(&self) -> Vec<String> {
49 unsafe {
50 FromGlibPtrContainer::from_glib_full(ffi::gst_parse_context_get_missing_elements(
51 mut_override(self.to_glib_none().0),
52 ))
53 }
54 }
55}
56
57impl Default for ParseContext {
58 fn default() -> Self {
59 Self::new()
60 }
61}