2017-08-13 22:40:43 +00:00
|
|
|
// This file was generated by gir (cf27827) from gir-files (???)
|
2017-07-04 22:47:33 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2017-07-10 21:26:27 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
2017-07-10 21:02:08 +00:00
|
|
|
use Caps;
|
2017-07-04 22:47:33 +00:00
|
|
|
use Object;
|
2017-07-25 12:28:09 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
2017-07-04 22:47:33 +00:00
|
|
|
use StreamFlags;
|
2017-07-25 12:28:09 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
2017-07-04 22:47:33 +00:00
|
|
|
use StreamType;
|
2017-07-25 12:21:03 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
use TagList;
|
2017-07-04 22:47:33 +00:00
|
|
|
use ffi;
|
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::translate::*;
|
2017-07-19 18:41:25 +00:00
|
|
|
use glib_ffi;
|
2017-07-04 22:47:33 +00:00
|
|
|
use gobject_ffi;
|
2017-07-19 18:41:25 +00:00
|
|
|
use std::mem;
|
|
|
|
use std::ptr;
|
2017-07-04 22:47:33 +00:00
|
|
|
|
|
|
|
glib_wrapper! {
|
|
|
|
pub struct Stream(Object<ffi::GstStream>): Object;
|
|
|
|
|
|
|
|
match fn {
|
|
|
|
get_type => || ffi::gst_stream_get_type(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Stream {
|
2017-07-10 21:02:08 +00:00
|
|
|
#[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()))
|
|
|
|
}
|
|
|
|
}
|
2017-07-04 22:47:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for Stream {}
|
|
|
|
unsafe impl Sync for Stream {}
|
|
|
|
|
|
|
|
pub trait StreamExt {
|
2017-07-10 21:02:08 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn get_caps(&self) -> Option<Caps>;
|
2017-07-04 22:47:33 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn get_stream_flags(&self) -> StreamFlags;
|
|
|
|
|
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn get_stream_id(&self) -> Option<String>;
|
|
|
|
|
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn get_stream_type(&self) -> StreamType;
|
|
|
|
|
2017-07-25 12:21:03 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn get_tags(&self) -> Option<TagList>;
|
2017-07-04 22:47:33 +00:00
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn set_caps<'a, P: Into<Option<&'a Caps>>>(&self, caps: P);
|
2017-07-04 22:47:33 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn set_stream_flags(&self, flags: StreamFlags);
|
|
|
|
|
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn set_stream_type(&self, stream_type: StreamType);
|
|
|
|
|
2017-07-25 12:21:03 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn set_tags<'a, P: Into<Option<&'a TagList>>>(&self, tags: P);
|
2017-07-04 22:47:33 +00:00
|
|
|
}
|
|
|
|
|
2017-07-25 12:28:09 +00:00
|
|
|
impl<O: IsA<Stream>> StreamExt for O {
|
2017-07-10 21:02:08 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn get_caps(&self) -> Option<Caps> {
|
|
|
|
unsafe {
|
|
|
|
from_glib_full(ffi::gst_stream_get_caps(self.to_glib_none().0))
|
|
|
|
}
|
|
|
|
}
|
2017-07-04 22:47:33 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn get_stream_flags(&self) -> StreamFlags {
|
|
|
|
unsafe {
|
|
|
|
from_glib(ffi::gst_stream_get_stream_flags(self.to_glib_none().0))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
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")]
|
|
|
|
fn get_stream_type(&self) -> StreamType {
|
|
|
|
unsafe {
|
|
|
|
from_glib(ffi::gst_stream_get_stream_type(self.to_glib_none().0))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-25 12:21:03 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
fn get_tags(&self) -> Option<TagList> {
|
|
|
|
unsafe {
|
|
|
|
from_glib_full(ffi::gst_stream_get_tags(self.to_glib_none().0))
|
|
|
|
}
|
|
|
|
}
|
2017-07-04 22:47:33 +00:00
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2017-07-04 22:47:33 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
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")]
|
|
|
|
fn set_stream_type(&self, stream_type: StreamType) {
|
|
|
|
unsafe {
|
|
|
|
ffi::gst_stream_set_stream_type(self.to_glib_none().0, stream_type.to_glib());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-25 12:21:03 +00:00
|
|
|
#[cfg(feature = "v1_10")]
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2017-07-04 22:47:33 +00:00
|
|
|
}
|