gstreamer-rs/gstreamer/src/auto/stream.rs
2017-08-17 14:50:25 +03:00

111 lines
3 KiB
Rust

// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
#[cfg(feature = "v1_10")]
use Caps;
use Object;
#[cfg(feature = "v1_10")]
use StreamFlags;
#[cfg(feature = "v1_10")]
use StreamType;
#[cfg(feature = "v1_10")]
use TagList;
use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;
glib_wrapper! {
pub struct Stream(Object<ffi::GstStream>): Object;
match fn {
get_type => || ffi::gst_stream_get_type(),
}
}
impl Stream {
#[cfg(feature = "v1_10")]
pub fn new<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b Caps>>>(stream_id: P, caps: Q, type_: StreamType, flags: StreamFlags) -> Stream {
assert_initialized_main_thread!();
let stream_id = stream_id.into();
let stream_id = stream_id.to_glib_none();
let caps = caps.into();
let caps = caps.to_glib_none();
unsafe {
from_glib_full(ffi::gst_stream_new(stream_id.0, caps.0, type_.to_glib(), flags.to_glib()))
}
}
#[cfg(feature = "v1_10")]
pub fn get_caps(&self) -> Option<Caps> {
unsafe {
from_glib_full(ffi::gst_stream_get_caps(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_10")]
pub fn get_stream_flags(&self) -> StreamFlags {
unsafe {
from_glib(ffi::gst_stream_get_stream_flags(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_10")]
pub fn get_stream_id(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_stream_get_stream_id(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_10")]
pub fn get_stream_type(&self) -> StreamType {
unsafe {
from_glib(ffi::gst_stream_get_stream_type(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_10")]
pub fn get_tags(&self) -> Option<TagList> {
unsafe {
from_glib_full(ffi::gst_stream_get_tags(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_10")]
pub fn set_caps<'a, P: Into<Option<&'a Caps>>>(&self, caps: P) {
let caps = caps.into();
let caps = caps.to_glib_none();
unsafe {
ffi::gst_stream_set_caps(self.to_glib_none().0, caps.0);
}
}
#[cfg(feature = "v1_10")]
pub fn set_stream_flags(&self, flags: StreamFlags) {
unsafe {
ffi::gst_stream_set_stream_flags(self.to_glib_none().0, flags.to_glib());
}
}
#[cfg(feature = "v1_10")]
pub fn set_stream_type(&self, stream_type: StreamType) {
unsafe {
ffi::gst_stream_set_stream_type(self.to_glib_none().0, stream_type.to_glib());
}
}
#[cfg(feature = "v1_10")]
pub fn set_tags<'a, P: Into<Option<&'a TagList>>>(&self, tags: P) {
let tags = tags.into();
let tags = tags.to_glib_none();
unsafe {
ffi::gst_stream_set_tags(self.to_glib_none().0, tags.0);
}
}
}
unsafe impl Send for Stream {}
unsafe impl Sync for Stream {}