2017-07-30 14:06:44 +00:00
|
|
|
// Copyright (C) 2017 Sebastian Dröge <sebastian@centricular.com>
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
use ffi;
|
|
|
|
use miniobject::*;
|
|
|
|
use structure::*;
|
|
|
|
|
|
|
|
use std::ptr;
|
|
|
|
use std::mem;
|
2017-11-29 16:55:56 +00:00
|
|
|
use std::cmp;
|
2017-12-01 09:21:20 +00:00
|
|
|
use std::fmt;
|
2017-07-30 14:06:44 +00:00
|
|
|
use std::ffi::CStr;
|
|
|
|
|
|
|
|
use glib;
|
2017-11-15 17:18:58 +00:00
|
|
|
use glib::value::ToSendValue;
|
2017-08-02 17:09:00 +00:00
|
|
|
use glib::translate::{from_glib, from_glib_full, from_glib_none, ToGlib, ToGlibPtr};
|
|
|
|
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-08-02 17:09:00 +00:00
|
|
|
use glib::translate::FromGlibPtrContainer;
|
2017-07-30 14:06:44 +00:00
|
|
|
|
2017-11-29 16:55:56 +00:00
|
|
|
use EventType;
|
|
|
|
|
2017-07-30 14:06:44 +00:00
|
|
|
#[repr(C)]
|
|
|
|
pub struct EventRef(ffi::GstEvent);
|
|
|
|
|
|
|
|
pub type Event = GstRc<EventRef>;
|
|
|
|
|
2017-09-14 12:52:40 +00:00
|
|
|
unsafe impl Sync for EventRef {}
|
|
|
|
unsafe impl Send for EventRef {}
|
|
|
|
|
2017-07-30 14:06:44 +00:00
|
|
|
unsafe impl MiniObject for EventRef {
|
|
|
|
type GstType = ffi::GstEvent;
|
|
|
|
}
|
|
|
|
|
2017-11-29 16:55:56 +00:00
|
|
|
impl EventType {
|
|
|
|
pub fn is_upstream(&self) -> bool {
|
|
|
|
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_UPSTREAM.bits()) != 0
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_downstream(&self) -> bool {
|
|
|
|
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_DOWNSTREAM.bits()) != 0
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_serialized(&self) -> bool {
|
|
|
|
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_SERIALIZED.bits()) != 0
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_sticky(&self) -> bool {
|
|
|
|
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_STICKY.bits()) != 0
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_sticky_multi(&self) -> bool {
|
|
|
|
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_STICKY_MULTI.bits()) != 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl PartialOrd for EventType {
|
|
|
|
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
|
|
|
|
if !self.is_serialized() || !other.is_serialized() {
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
|
|
|
|
let v1 = self.to_glib() as u32;
|
|
|
|
let v2 = other.to_glib() as u32;
|
|
|
|
|
|
|
|
let stream_start = ffi::GST_EVENT_STREAM_START as u32;
|
|
|
|
let segment = ffi::GST_EVENT_SEGMENT as u32;
|
|
|
|
let eos = ffi::GST_EVENT_EOS as u32;
|
|
|
|
|
|
|
|
// Strictly ordered range between stream_start and segment,
|
|
|
|
// and EOS is bigger than everything else
|
|
|
|
if v1 >= stream_start && v1 <= segment || v2 >= stream_start && v2 <= segment {
|
|
|
|
Some(v1.cmp(&v2))
|
|
|
|
// If one is EOS, the other is definitely less or equal
|
|
|
|
} else if v1 == eos || v2 == eos {
|
|
|
|
if v1 == v2 {
|
|
|
|
Some(cmp::Ordering::Equal)
|
|
|
|
} else if v1 == eos {
|
|
|
|
Some(cmp::Ordering::Greater)
|
|
|
|
} else {
|
|
|
|
Some(cmp::Ordering::Less)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-30 14:06:44 +00:00
|
|
|
impl EventRef {
|
|
|
|
pub fn get_seqnum(&self) -> u32 {
|
|
|
|
unsafe { ffi::gst_event_get_seqnum(self.as_mut_ptr()) }
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_running_time_offset(&self) -> i64 {
|
|
|
|
unsafe { ffi::gst_event_get_running_time_offset(self.as_mut_ptr()) }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-12-01 09:21:20 +00:00
|
|
|
pub fn get_structure(&self) -> Option<&StructureRef> {
|
2017-07-30 14:06:44 +00:00
|
|
|
unsafe {
|
|
|
|
let structure = ffi::gst_event_get_structure(self.as_mut_ptr());
|
2017-12-01 09:21:20 +00:00
|
|
|
if structure.is_null() {
|
|
|
|
None
|
|
|
|
} else {
|
|
|
|
Some(StructureRef::from_glib_borrow(structure))
|
|
|
|
}
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_upstream(&self) -> bool {
|
2017-11-29 16:55:56 +00:00
|
|
|
self.get_type().is_upstream()
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_downstream(&self) -> bool {
|
2017-11-29 16:55:56 +00:00
|
|
|
self.get_type().is_downstream()
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_serialized(&self) -> bool {
|
2017-11-29 16:55:56 +00:00
|
|
|
self.get_type().is_serialized()
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_sticky(&self) -> bool {
|
2017-11-29 16:55:56 +00:00
|
|
|
self.get_type().is_sticky()
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_sticky_multi(&self) -> bool {
|
2017-11-29 16:55:56 +00:00
|
|
|
self.get_type().is_sticky_multi()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_type(&self) -> EventType {
|
|
|
|
unsafe { from_glib((*self.as_ptr()).type_) }
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn view(&self) -> EventView {
|
|
|
|
let type_ = unsafe { (*self.as_ptr()).type_ };
|
|
|
|
|
2017-09-10 11:54:43 +00:00
|
|
|
match type_ {
|
|
|
|
ffi::GST_EVENT_FLUSH_START => EventView::FlushStart(FlushStart(self)),
|
|
|
|
ffi::GST_EVENT_FLUSH_STOP => EventView::FlushStop(FlushStop(self)),
|
|
|
|
ffi::GST_EVENT_STREAM_START => EventView::StreamStart(StreamStart(self)),
|
|
|
|
ffi::GST_EVENT_CAPS => EventView::Caps(Caps(self)),
|
|
|
|
ffi::GST_EVENT_SEGMENT => EventView::Segment(Segment(self)),
|
|
|
|
ffi::GST_EVENT_STREAM_COLLECTION => EventView::StreamCollection(StreamCollection(self)),
|
|
|
|
ffi::GST_EVENT_TAG => EventView::Tag(Tag(self)),
|
|
|
|
ffi::GST_EVENT_BUFFERSIZE => EventView::BufferSize(BufferSize(self)),
|
|
|
|
ffi::GST_EVENT_SINK_MESSAGE => EventView::SinkMessage(SinkMessage(self)),
|
|
|
|
ffi::GST_EVENT_STREAM_GROUP_DONE => EventView::StreamGroupDone(StreamGroupDone(self)),
|
|
|
|
ffi::GST_EVENT_EOS => EventView::Eos(Eos(self)),
|
|
|
|
ffi::GST_EVENT_TOC => EventView::Toc(Toc(self)),
|
|
|
|
ffi::GST_EVENT_PROTECTION => EventView::Protection(Protection(self)),
|
|
|
|
ffi::GST_EVENT_SEGMENT_DONE => EventView::SegmentDone(SegmentDone(self)),
|
|
|
|
ffi::GST_EVENT_GAP => EventView::Gap(Gap(self)),
|
|
|
|
ffi::GST_EVENT_QOS => EventView::Qos(Qos(self)),
|
|
|
|
ffi::GST_EVENT_SEEK => EventView::Seek(Seek(self)),
|
|
|
|
ffi::GST_EVENT_NAVIGATION => EventView::Navigation(Navigation(self)),
|
|
|
|
ffi::GST_EVENT_LATENCY => EventView::Latency(Latency(self)),
|
|
|
|
ffi::GST_EVENT_STEP => EventView::Step(Step(self)),
|
|
|
|
ffi::GST_EVENT_RECONFIGURE => EventView::Reconfigure(Reconfigure(self)),
|
|
|
|
ffi::GST_EVENT_TOC_SELECT => EventView::TocSelect(TocSelect(self)),
|
|
|
|
ffi::GST_EVENT_SELECT_STREAMS => EventView::SelectStreams(SelectStreams(self)),
|
|
|
|
ffi::GST_EVENT_CUSTOM_UPSTREAM => EventView::CustomUpstream(CustomUpstream(self)),
|
|
|
|
ffi::GST_EVENT_CUSTOM_DOWNSTREAM => EventView::CustomDownstream(CustomDownstream(self)),
|
|
|
|
ffi::GST_EVENT_CUSTOM_DOWNSTREAM_OOB => {
|
|
|
|
EventView::CustomDownstreamOob(CustomDownstreamOob(self))
|
|
|
|
}
|
|
|
|
ffi::GST_EVENT_CUSTOM_DOWNSTREAM_STICKY => {
|
|
|
|
EventView::CustomDownstreamSticky(CustomDownstreamSticky(self))
|
|
|
|
}
|
|
|
|
ffi::GST_EVENT_CUSTOM_BOTH => EventView::CustomBoth(CustomBoth(self)),
|
|
|
|
ffi::GST_EVENT_CUSTOM_BOTH_OOB => EventView::CustomBothOob(CustomBothOob(self)),
|
|
|
|
_ => EventView::Other,
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-30 14:49:25 +00:00
|
|
|
}
|
2017-07-30 14:06:44 +00:00
|
|
|
|
2017-08-30 12:12:11 +00:00
|
|
|
impl GstRc<EventRef> {
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_flush_start<'a>() -> FlushStartBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
FlushStartBuilder::new()
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_flush_stop<'a>(reset_time: bool) -> FlushStopBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
FlushStopBuilder::new(reset_time)
|
|
|
|
}
|
|
|
|
|
2017-09-13 20:54:22 +00:00
|
|
|
pub fn new_stream_start(stream_id: &str) -> StreamStartBuilder {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
StreamStartBuilder::new(stream_id)
|
|
|
|
}
|
|
|
|
|
2017-09-13 20:54:22 +00:00
|
|
|
pub fn new_caps(caps: &::Caps) -> CapsBuilder {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
CapsBuilder::new(caps)
|
|
|
|
}
|
|
|
|
|
2017-09-13 20:54:22 +00:00
|
|
|
pub fn new_segment(segment: &::Segment) -> SegmentBuilder {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
SegmentBuilder::new(segment)
|
|
|
|
}
|
|
|
|
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-11-27 10:55:47 +00:00
|
|
|
pub fn new_stream_collection(
|
|
|
|
stream_collection: &::StreamCollection,
|
|
|
|
) -> StreamCollectionBuilder {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
StreamCollectionBuilder::new(stream_collection)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_tag<'a>(tags: ::TagList) -> TagBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
TagBuilder::new(tags)
|
|
|
|
}
|
|
|
|
|
2017-11-11 10:21:55 +00:00
|
|
|
pub fn new_buffer_size<'a, V: Into<::FormatValue>>(
|
|
|
|
minsize: V,
|
|
|
|
maxsize: V,
|
2017-07-31 11:16:42 +00:00
|
|
|
async: bool,
|
2017-09-13 19:38:19 +00:00
|
|
|
) -> BufferSizeBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-11-11 10:21:55 +00:00
|
|
|
let minsize = minsize.into();
|
|
|
|
let maxsize = maxsize.into();
|
|
|
|
assert_eq!(minsize.to_format(), maxsize.to_format());
|
|
|
|
|
|
|
|
BufferSizeBuilder::new(minsize, maxsize, async)
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn new_sink_message<'a>(name: &'a str, msg: &'a ::Message) -> SinkMessageBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
SinkMessageBuilder::new(name, msg)
|
|
|
|
}
|
|
|
|
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_stream_group_done<'a>(group_id: u32) -> StreamGroupDoneBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
StreamGroupDoneBuilder::new(group_id)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_eos<'a>() -> EosBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
EosBuilder::new()
|
|
|
|
}
|
|
|
|
|
2017-09-13 20:54:22 +00:00
|
|
|
pub fn new_toc(toc: &::Toc, updated: bool) -> TocBuilder {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
TocBuilder::new(toc, updated)
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
pub fn new_protection<'a>(
|
|
|
|
system_id: &'a str,
|
|
|
|
data: &'a ::Buffer,
|
|
|
|
origin: &'a str,
|
|
|
|
) -> ProtectionBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
ProtectionBuilder::new(system_id, data, origin)
|
|
|
|
}
|
|
|
|
|
2017-11-11 10:21:55 +00:00
|
|
|
pub fn new_segment_done<'a, V: Into<::FormatValue>>(position: V) -> SegmentDoneBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-11-11 10:21:55 +00:00
|
|
|
let position = position.into();
|
|
|
|
SegmentDoneBuilder::new(position)
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_gap<'a>(timestamp: u64, duration: u64) -> GapBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
GapBuilder::new(timestamp, duration)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_qos<'a>(
|
|
|
|
type_: ::QOSType,
|
|
|
|
proportion: f64,
|
|
|
|
diff: i64,
|
|
|
|
timestamp: u64,
|
|
|
|
) -> QosBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
QosBuilder::new(type_, proportion, diff, timestamp)
|
|
|
|
}
|
|
|
|
|
2017-11-11 10:21:55 +00:00
|
|
|
pub fn new_seek<'a, V: Into<::FormatValue>>(
|
2017-07-31 11:16:42 +00:00
|
|
|
rate: f64,
|
|
|
|
flags: ::SeekFlags,
|
|
|
|
start_type: ::SeekType,
|
2017-11-11 10:21:55 +00:00
|
|
|
start: V,
|
2017-07-31 11:16:42 +00:00
|
|
|
stop_type: ::SeekType,
|
2017-11-11 10:21:55 +00:00
|
|
|
stop: V,
|
2017-09-13 19:38:19 +00:00
|
|
|
) -> SeekBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-11-11 10:21:55 +00:00
|
|
|
let start = start.into();
|
|
|
|
let stop = stop.into();
|
|
|
|
assert_eq!(start.to_format(), stop.to_format());
|
|
|
|
|
|
|
|
SeekBuilder::new(rate, flags, start_type, start, stop_type, stop)
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_navigation<'a>(structure: ::Structure) -> NavigationBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
NavigationBuilder::new(structure)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_latency<'a>(latency: u64) -> LatencyBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
LatencyBuilder::new(latency)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_step<'a>(
|
2017-07-31 11:16:42 +00:00
|
|
|
format: ::Format,
|
|
|
|
amount: u64,
|
|
|
|
rate: f64,
|
|
|
|
flush: bool,
|
|
|
|
intermediate: bool,
|
2017-09-13 19:38:19 +00:00
|
|
|
) -> StepBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
StepBuilder::new(format, amount, rate, flush, intermediate)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_reconfigure<'a>() -> ReconfigureBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
ReconfigureBuilder::new()
|
|
|
|
}
|
|
|
|
|
2017-09-13 20:54:22 +00:00
|
|
|
pub fn new_toc_select(uid: &str) -> TocSelectBuilder {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
TocSelectBuilder::new(uid)
|
|
|
|
}
|
|
|
|
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-07-30 14:15:34 +00:00
|
|
|
pub fn new_select_streams<'a>(streams: &'a [&'a str]) -> SelectStreamsBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
SelectStreamsBuilder::new(streams)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_custom_upstream<'a>(structure: ::Structure) -> CustomUpstreamBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
CustomUpstreamBuilder::new(structure)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_custom_downstream<'a>(structure: ::Structure) -> CustomDownstreamBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
CustomDownstreamBuilder::new(structure)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_custom_downstream_oob<'a>(structure: ::Structure) -> CustomDownstreamOobBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
CustomDownstreamOobBuilder::new(structure)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_custom_downstream_sticky<'a>(
|
|
|
|
structure: ::Structure,
|
|
|
|
) -> CustomDownstreamStickyBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
CustomDownstreamStickyBuilder::new(structure)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_custom_both<'a>(structure: ::Structure) -> CustomBothBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
CustomBothBuilder::new(structure)
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub fn new_custom_both_oob<'a>(structure: ::Structure) -> CustomBothOobBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-30 14:06:44 +00:00
|
|
|
CustomBothOobBuilder::new(structure)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-18 13:21:49 +00:00
|
|
|
impl glib::types::StaticType for EventRef {
|
2017-07-30 14:06:44 +00:00
|
|
|
fn static_type() -> glib::types::Type {
|
|
|
|
unsafe { from_glib(ffi::gst_event_get_type()) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-01 09:21:20 +00:00
|
|
|
impl fmt::Debug for EventRef {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
f.debug_struct("Event")
|
|
|
|
.field("type", & unsafe {
|
|
|
|
let type_ = ffi::gst_event_type_get_name((*self.as_ptr()).type_);
|
|
|
|
CStr::from_ptr(type_).to_str().unwrap()
|
|
|
|
})
|
|
|
|
.field("seqnum", &self.get_seqnum())
|
|
|
|
.field("structure", &self.get_structure())
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-01 09:32:04 +00:00
|
|
|
impl ToOwned for EventRef {
|
|
|
|
type Owned = GstRc<EventRef>;
|
|
|
|
|
|
|
|
fn to_owned(&self) -> GstRc<EventRef> {
|
|
|
|
unsafe {
|
|
|
|
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
|
|
|
|
as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-30 14:06:44 +00:00
|
|
|
pub enum EventView<'a> {
|
|
|
|
FlushStart(FlushStart<'a>),
|
|
|
|
FlushStop(FlushStop<'a>),
|
|
|
|
StreamStart(StreamStart<'a>),
|
|
|
|
Caps(Caps<'a>),
|
|
|
|
Segment(Segment<'a>),
|
|
|
|
StreamCollection(StreamCollection<'a>),
|
|
|
|
Tag(Tag<'a>),
|
|
|
|
BufferSize(BufferSize<'a>),
|
|
|
|
SinkMessage(SinkMessage<'a>),
|
|
|
|
StreamGroupDone(StreamGroupDone<'a>),
|
|
|
|
Eos(Eos<'a>),
|
|
|
|
Toc(Toc<'a>),
|
|
|
|
Protection(Protection<'a>),
|
|
|
|
SegmentDone(SegmentDone<'a>),
|
|
|
|
Gap(Gap<'a>),
|
|
|
|
Qos(Qos<'a>),
|
|
|
|
Seek(Seek<'a>),
|
|
|
|
Navigation(Navigation<'a>),
|
|
|
|
Latency(Latency<'a>),
|
|
|
|
Step(Step<'a>),
|
|
|
|
Reconfigure(Reconfigure<'a>),
|
|
|
|
TocSelect(TocSelect<'a>),
|
|
|
|
SelectStreams(SelectStreams<'a>),
|
|
|
|
CustomUpstream(CustomUpstream<'a>),
|
|
|
|
CustomDownstream(CustomDownstream<'a>),
|
|
|
|
CustomDownstreamOob(CustomDownstreamOob<'a>),
|
|
|
|
CustomDownstreamSticky(CustomDownstreamSticky<'a>),
|
|
|
|
CustomBoth(CustomBoth<'a>),
|
|
|
|
CustomBothOob(CustomBothOob<'a>),
|
|
|
|
Other,
|
|
|
|
__NonExhaustive,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct FlushStart<'a>(&'a EventRef);
|
|
|
|
|
|
|
|
pub struct FlushStop<'a>(&'a EventRef);
|
|
|
|
impl<'a> FlushStop<'a> {
|
|
|
|
pub fn get_reset_time(&self) -> bool {
|
|
|
|
unsafe {
|
|
|
|
let mut reset_time = mem::uninitialized();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_flush_stop(self.0.as_mut_ptr(), &mut reset_time);
|
|
|
|
|
|
|
|
from_glib(reset_time)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct StreamStart<'a>(&'a EventRef);
|
|
|
|
impl<'a> StreamStart<'a> {
|
|
|
|
pub fn get_stream_id(&self) -> Option<&'a str> {
|
|
|
|
unsafe {
|
|
|
|
let mut stream_id = ptr::null();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_stream_start(self.0.as_mut_ptr(), &mut stream_id);
|
|
|
|
if stream_id.is_null() {
|
|
|
|
None
|
|
|
|
} else {
|
2017-08-02 16:40:31 +00:00
|
|
|
Some(CStr::from_ptr(stream_id).to_str().unwrap())
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_stream_flags(&self) -> ::StreamFlags {
|
|
|
|
unsafe {
|
|
|
|
let mut stream_flags = mem::uninitialized();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_stream_flags(self.0.as_mut_ptr(), &mut stream_flags);
|
|
|
|
|
|
|
|
from_glib(stream_flags)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_group_id(&self) -> u32 {
|
|
|
|
unsafe {
|
|
|
|
let mut group_id = mem::uninitialized();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_group_id(self.0.as_mut_ptr(), &mut group_id);
|
|
|
|
|
|
|
|
group_id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Caps<'a>(&'a EventRef);
|
|
|
|
impl<'a> Caps<'a> {
|
|
|
|
pub fn get_caps(&self) -> &'a ::CapsRef {
|
|
|
|
unsafe {
|
|
|
|
let mut caps = ptr::null_mut();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_caps(self.0.as_mut_ptr(), &mut caps);
|
|
|
|
::CapsRef::from_ptr(caps)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Segment<'a>(&'a EventRef);
|
|
|
|
impl<'a> Segment<'a> {
|
|
|
|
pub fn get_segment(&self) -> ::Segment {
|
|
|
|
unsafe {
|
|
|
|
let mut segment = ptr::null();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_segment(self.0.as_mut_ptr(), &mut segment);
|
|
|
|
from_glib_none(segment as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct StreamCollection<'a>(&'a EventRef);
|
|
|
|
impl<'a> StreamCollection<'a> {
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-07-30 14:06:44 +00:00
|
|
|
pub fn get_stream_collection(&self) -> ::StreamCollection {
|
|
|
|
unsafe {
|
|
|
|
let mut stream_collection = ptr::null_mut();
|
|
|
|
|
2017-07-30 14:15:34 +00:00
|
|
|
ffi::gst_event_parse_stream_collection(self.0.as_mut_ptr(), &mut stream_collection);
|
2017-07-30 14:06:44 +00:00
|
|
|
from_glib_full(stream_collection)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Tag<'a>(&'a EventRef);
|
|
|
|
impl<'a> Tag<'a> {
|
|
|
|
pub fn get_tag(&self) -> &'a ::TagListRef {
|
|
|
|
unsafe {
|
|
|
|
let mut tags = ptr::null_mut();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_tag(self.0.as_mut_ptr(), &mut tags);
|
|
|
|
::TagListRef::from_ptr(tags)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct BufferSize<'a>(&'a EventRef);
|
|
|
|
impl<'a> BufferSize<'a> {
|
2017-11-11 10:21:55 +00:00
|
|
|
pub fn get(&self) -> (::FormatValue, ::FormatValue, bool) {
|
2017-07-30 14:06:44 +00:00
|
|
|
unsafe {
|
|
|
|
let mut fmt = mem::uninitialized();
|
|
|
|
let mut minsize = mem::uninitialized();
|
|
|
|
let mut maxsize = mem::uninitialized();
|
|
|
|
let mut async = mem::uninitialized();
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
ffi::gst_event_parse_buffer_size(
|
|
|
|
self.0.as_mut_ptr(),
|
|
|
|
&mut fmt,
|
|
|
|
&mut minsize,
|
|
|
|
&mut maxsize,
|
|
|
|
&mut async,
|
|
|
|
);
|
2017-11-11 10:21:55 +00:00
|
|
|
(
|
|
|
|
::FormatValue::new(from_glib(fmt), minsize),
|
|
|
|
::FormatValue::new(from_glib(fmt), maxsize),
|
|
|
|
from_glib(async),
|
|
|
|
)
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct SinkMessage<'a>(&'a EventRef);
|
|
|
|
impl<'a> SinkMessage<'a> {
|
|
|
|
pub fn get_message(&self) -> ::Message {
|
|
|
|
unsafe {
|
|
|
|
let mut msg = ptr::null_mut();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_sink_message(self.0.as_mut_ptr(), &mut msg);
|
|
|
|
from_glib_full(msg)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct StreamGroupDone<'a>(&'a EventRef);
|
|
|
|
impl<'a> StreamGroupDone<'a> {
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-07-30 14:06:44 +00:00
|
|
|
pub fn get_group_id(&self) -> u32 {
|
|
|
|
unsafe {
|
|
|
|
let mut group_id = mem::uninitialized();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_stream_group_done(self.0.as_mut_ptr(), &mut group_id);
|
|
|
|
|
|
|
|
group_id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Eos<'a>(&'a EventRef);
|
|
|
|
|
|
|
|
pub struct Toc<'a>(&'a EventRef);
|
2017-08-08 20:37:48 +00:00
|
|
|
impl<'a> Toc<'a> {
|
|
|
|
pub fn get_toc(&self) -> (&'a ::TocRef, bool) {
|
|
|
|
unsafe {
|
|
|
|
let mut toc = ptr::null_mut();
|
|
|
|
let mut updated = mem::uninitialized();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_toc(self.0.as_mut_ptr(), &mut toc, &mut updated);
|
|
|
|
(::TocRef::from_ptr(toc), from_glib(updated))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-07-30 14:06:44 +00:00
|
|
|
|
|
|
|
pub struct Protection<'a>(&'a EventRef);
|
|
|
|
impl<'a> Protection<'a> {
|
|
|
|
pub fn get(&self) -> (&'a str, &'a ::BufferRef, &'a str) {
|
|
|
|
unsafe {
|
|
|
|
let mut system_id = ptr::null();
|
|
|
|
let mut buffer = ptr::null_mut();
|
|
|
|
let mut origin = ptr::null();
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
ffi::gst_event_parse_protection(
|
|
|
|
self.0.as_mut_ptr(),
|
|
|
|
&mut system_id,
|
|
|
|
&mut buffer,
|
|
|
|
&mut origin,
|
|
|
|
);
|
|
|
|
|
|
|
|
(
|
|
|
|
CStr::from_ptr(system_id).to_str().unwrap(),
|
|
|
|
::BufferRef::from_ptr(buffer),
|
|
|
|
CStr::from_ptr(origin).to_str().unwrap(),
|
|
|
|
)
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct SegmentDone<'a>(&'a EventRef);
|
|
|
|
impl<'a> SegmentDone<'a> {
|
2017-11-11 10:21:55 +00:00
|
|
|
pub fn get(&self) -> ::FormatValue {
|
2017-07-30 14:06:44 +00:00
|
|
|
unsafe {
|
|
|
|
let mut fmt = mem::uninitialized();
|
|
|
|
let mut position = mem::uninitialized();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_segment_done(self.0.as_mut_ptr(), &mut fmt, &mut position);
|
|
|
|
|
2017-11-11 10:21:55 +00:00
|
|
|
::FormatValue::new(from_glib(fmt), position)
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Gap<'a>(&'a EventRef);
|
|
|
|
impl<'a> Gap<'a> {
|
|
|
|
pub fn get(&self) -> (u64, u64) {
|
|
|
|
unsafe {
|
|
|
|
let mut timestamp = mem::uninitialized();
|
|
|
|
let mut duration = mem::uninitialized();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_gap(self.0.as_mut_ptr(), &mut timestamp, &mut duration);
|
|
|
|
|
|
|
|
(timestamp, duration)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Qos<'a>(&'a EventRef);
|
|
|
|
impl<'a> Qos<'a> {
|
|
|
|
pub fn get(&self) -> (::QOSType, f64, i64, u64) {
|
|
|
|
unsafe {
|
|
|
|
let mut type_ = mem::uninitialized();
|
|
|
|
let mut proportion = mem::uninitialized();
|
|
|
|
let mut diff = mem::uninitialized();
|
|
|
|
let mut timestamp = mem::uninitialized();
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
ffi::gst_event_parse_qos(
|
|
|
|
self.0.as_mut_ptr(),
|
|
|
|
&mut type_,
|
|
|
|
&mut proportion,
|
|
|
|
&mut diff,
|
|
|
|
&mut timestamp,
|
|
|
|
);
|
2017-07-30 14:06:44 +00:00
|
|
|
|
|
|
|
(from_glib(type_), proportion, diff, timestamp)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub struct Seek<'a>(&'a EventRef);
|
|
|
|
impl<'a> Seek<'a> {
|
2017-11-11 10:21:55 +00:00
|
|
|
pub fn get(
|
|
|
|
&self,
|
|
|
|
) -> (
|
|
|
|
f64,
|
|
|
|
::SeekFlags,
|
|
|
|
::SeekType,
|
|
|
|
::FormatValue,
|
|
|
|
::SeekType,
|
|
|
|
::FormatValue,
|
|
|
|
) {
|
2017-07-30 14:06:44 +00:00
|
|
|
unsafe {
|
|
|
|
let mut rate = mem::uninitialized();
|
|
|
|
let mut fmt = mem::uninitialized();
|
|
|
|
let mut flags = mem::uninitialized();
|
|
|
|
let mut start_type = mem::uninitialized();
|
|
|
|
let mut start = mem::uninitialized();
|
|
|
|
let mut stop_type = mem::uninitialized();
|
|
|
|
let mut stop = mem::uninitialized();
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
ffi::gst_event_parse_seek(
|
|
|
|
self.0.as_mut_ptr(),
|
|
|
|
&mut rate,
|
|
|
|
&mut fmt,
|
|
|
|
&mut flags,
|
|
|
|
&mut start_type,
|
|
|
|
&mut start,
|
|
|
|
&mut stop_type,
|
|
|
|
&mut stop,
|
|
|
|
);
|
|
|
|
|
|
|
|
(
|
|
|
|
rate,
|
|
|
|
from_glib(flags),
|
|
|
|
from_glib(start_type),
|
2017-11-11 10:21:55 +00:00
|
|
|
::FormatValue::new(from_glib(fmt), start),
|
2017-07-31 11:16:42 +00:00
|
|
|
from_glib(stop_type),
|
2017-11-11 10:21:55 +00:00
|
|
|
::FormatValue::new(from_glib(fmt), stop),
|
2017-07-31 11:16:42 +00:00
|
|
|
)
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Navigation<'a>(&'a EventRef);
|
|
|
|
|
|
|
|
pub struct Latency<'a>(&'a EventRef);
|
|
|
|
impl<'a> Latency<'a> {
|
|
|
|
pub fn get_latency(&self) -> u64 {
|
|
|
|
unsafe {
|
|
|
|
let mut latency = mem::uninitialized();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_latency(self.0.as_mut_ptr(), &mut latency);
|
|
|
|
|
|
|
|
latency
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Step<'a>(&'a EventRef);
|
|
|
|
impl<'a> Step<'a> {
|
|
|
|
pub fn get(&self) -> (::Format, u64, f64, bool, bool) {
|
|
|
|
unsafe {
|
|
|
|
let mut fmt = mem::uninitialized();
|
|
|
|
let mut amount = mem::uninitialized();
|
|
|
|
let mut rate = mem::uninitialized();
|
|
|
|
let mut flush = mem::uninitialized();
|
|
|
|
let mut intermediate = mem::uninitialized();
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
ffi::gst_event_parse_step(
|
|
|
|
self.0.as_mut_ptr(),
|
|
|
|
&mut fmt,
|
|
|
|
&mut amount,
|
|
|
|
&mut rate,
|
|
|
|
&mut flush,
|
|
|
|
&mut intermediate,
|
|
|
|
);
|
|
|
|
|
|
|
|
(
|
|
|
|
from_glib(fmt),
|
|
|
|
amount,
|
|
|
|
rate,
|
|
|
|
from_glib(flush),
|
|
|
|
from_glib(intermediate),
|
|
|
|
)
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Reconfigure<'a>(&'a EventRef);
|
|
|
|
|
|
|
|
pub struct TocSelect<'a>(&'a EventRef);
|
|
|
|
impl<'a> TocSelect<'a> {
|
|
|
|
pub fn get_uid(&self) -> &'a str {
|
|
|
|
unsafe {
|
|
|
|
let mut uid = ptr::null_mut();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_toc_select(self.0.as_mut_ptr(), &mut uid);
|
|
|
|
|
|
|
|
CStr::from_ptr(uid).to_str().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct SelectStreams<'a>(&'a EventRef);
|
|
|
|
impl<'a> SelectStreams<'a> {
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-07-30 14:06:44 +00:00
|
|
|
pub fn get_streams(&self) -> Vec<String> {
|
|
|
|
unsafe {
|
|
|
|
let mut streams = ptr::null_mut();
|
|
|
|
|
|
|
|
ffi::gst_event_parse_select_streams(self.0.as_mut_ptr(), &mut streams);
|
|
|
|
|
2017-07-30 14:15:34 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(streams)
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct CustomUpstream<'a>(&'a EventRef);
|
|
|
|
pub struct CustomDownstream<'a>(&'a EventRef);
|
|
|
|
pub struct CustomDownstreamOob<'a>(&'a EventRef);
|
|
|
|
pub struct CustomDownstreamSticky<'a>(&'a EventRef);
|
|
|
|
pub struct CustomBoth<'a>(&'a EventRef);
|
|
|
|
pub struct CustomBothOob<'a>(&'a EventRef);
|
|
|
|
|
|
|
|
macro_rules! event_builder_generic_impl {
|
|
|
|
($new_fn:expr) => {
|
|
|
|
pub fn seqnum(self, seqnum: u32) -> Self {
|
|
|
|
Self {
|
|
|
|
seqnum: Some(seqnum),
|
|
|
|
.. self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn running_time_offset(self, running_time_offset: i64) -> Self {
|
|
|
|
Self {
|
|
|
|
running_time_offset: Some(running_time_offset),
|
|
|
|
.. self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-15 17:18:58 +00:00
|
|
|
pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
|
2017-09-13 19:38:19 +00:00
|
|
|
Self {
|
|
|
|
other_fields: self.other_fields.iter().cloned()
|
|
|
|
.chain(other_fields.iter().cloned())
|
|
|
|
.collect(),
|
|
|
|
.. self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-30 14:06:44 +00:00
|
|
|
pub fn build(mut self) -> Event {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
|
|
|
let event = $new_fn(&mut self);
|
|
|
|
if let Some(seqnum) = self.seqnum {
|
|
|
|
ffi::gst_event_set_seqnum(event, seqnum);
|
|
|
|
}
|
|
|
|
|
|
|
|
if let Some(running_time_offset) = self.running_time_offset {
|
|
|
|
ffi::gst_event_set_running_time_offset(event, running_time_offset);
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
{
|
|
|
|
let s = StructureRef::from_glib_borrow_mut(
|
|
|
|
ffi::gst_event_writable_structure(event)
|
|
|
|
);
|
|
|
|
|
|
|
|
for (k, v) in self.other_fields {
|
2017-11-15 17:18:58 +00:00
|
|
|
s.set_value(k, v.to_send_value());
|
2017-09-13 19:38:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-30 14:06:44 +00:00
|
|
|
from_glib_full(event)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct FlushStartBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> FlushStartBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new() -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|_| ffi::gst_event_new_flush_start());
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct FlushStopBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-31 11:16:42 +00:00
|
|
|
reset_time: bool,
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> FlushStopBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(reset_time: bool) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
reset_time: reset_time,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_flush_stop(s.reset_time.to_glib())
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub struct StreamStartBuilder<'a> {
|
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
stream_id: &'a str,
|
|
|
|
flags: Option<::StreamFlags>,
|
|
|
|
group_id: Option<u32>,
|
|
|
|
}
|
|
|
|
impl<'a> StreamStartBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(stream_id: &'a str) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
stream_id: stream_id,
|
|
|
|
flags: None,
|
|
|
|
group_id: None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn flags(self, flags: ::StreamFlags) -> Self {
|
|
|
|
Self {
|
|
|
|
flags: Some(flags),
|
2017-07-31 11:16:42 +00:00
|
|
|
..self
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn group_id(self, group_id: u32) -> Self {
|
|
|
|
Self {
|
|
|
|
group_id: Some(group_id),
|
2017-07-31 11:16:42 +00:00
|
|
|
..self
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
let ev = ffi::gst_event_new_stream_start(s.stream_id.to_glib_none().0);
|
|
|
|
if let Some(flags) = s.flags {
|
|
|
|
ffi::gst_event_set_stream_flags(ev, flags.to_glib());
|
|
|
|
}
|
|
|
|
if let Some(group_id) = s.group_id {
|
|
|
|
ffi::gst_event_set_group_id(ev, group_id);
|
|
|
|
}
|
|
|
|
ev
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct CapsBuilder<'a> {
|
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
caps: &'a ::Caps,
|
|
|
|
}
|
|
|
|
impl<'a> CapsBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(caps: &'a ::Caps) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
caps: caps,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &Self| ffi::gst_event_new_caps(s.caps.as_mut_ptr()));
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct SegmentBuilder<'a> {
|
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
segment: &'a ::Segment,
|
|
|
|
}
|
|
|
|
impl<'a> SegmentBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(segment: &'a ::Segment) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
segment: segment,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_segment(s.segment.to_glib_none().0)
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-07-30 14:06:44 +00:00
|
|
|
pub struct StreamCollectionBuilder<'a> {
|
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:15:34 +00:00
|
|
|
stream_collection: &'a ::StreamCollection,
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-07-30 14:06:44 +00:00
|
|
|
impl<'a> StreamCollectionBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(stream_collection: &'a ::StreamCollection) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
stream_collection: stream_collection,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_stream_collection(s.stream_collection.to_glib_none().0)
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct TagBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
tags: Option<::TagList>,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> TagBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(tags: ::TagList) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
tags: Some(tags),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &mut Self| {
|
|
|
|
let tags = s.tags.take().unwrap();
|
|
|
|
ffi::gst_event_new_tag(tags.into_ptr())
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct BufferSizeBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-11-11 10:21:55 +00:00
|
|
|
minsize: ::FormatValue,
|
|
|
|
maxsize: ::FormatValue,
|
2017-07-30 14:06:44 +00:00
|
|
|
async: bool,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> BufferSizeBuilder<'a> {
|
2017-11-11 10:21:55 +00:00
|
|
|
fn new(minsize: ::FormatValue, maxsize: ::FormatValue, async: bool) -> Self {
|
2017-08-30 11:39:09 +00:00
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
minsize: minsize,
|
|
|
|
maxsize: maxsize,
|
|
|
|
async: async,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
2017-11-11 10:21:55 +00:00
|
|
|
ffi::gst_event_new_buffer_size(
|
|
|
|
s.minsize.to_format().to_glib(),
|
|
|
|
s.minsize.to_value(),
|
|
|
|
s.maxsize.to_value(),
|
|
|
|
s.async.to_glib(),
|
|
|
|
)
|
2017-07-31 11:16:42 +00:00
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub struct SinkMessageBuilder<'a> {
|
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
name: &'a str,
|
|
|
|
msg: &'a ::Message,
|
|
|
|
}
|
|
|
|
impl<'a> SinkMessageBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(name: &'a str, msg: &'a ::Message) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
name: name,
|
|
|
|
msg: msg,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_sink_message(s.name.to_glib_none().0, s.msg.as_mut_ptr())
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct StreamGroupDoneBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
uid: u32,
|
|
|
|
}
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> StreamGroupDoneBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(uid: u32) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
uid: uid,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-30 14:15:34 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| ffi::gst_event_new_stream_group_done(s.uid));
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct EosBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> EosBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new() -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|_| ffi::gst_event_new_eos());
|
|
|
|
}
|
|
|
|
|
2017-08-08 20:37:48 +00:00
|
|
|
pub struct TocBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-08-08 20:37:48 +00:00
|
|
|
toc: &'a ::Toc,
|
2017-07-30 14:06:44 +00:00
|
|
|
updated: bool,
|
|
|
|
}
|
2017-08-08 20:37:48 +00:00
|
|
|
impl<'a> TocBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(toc: &'a ::Toc, updated: bool) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
toc: toc,
|
|
|
|
updated: updated,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
2017-08-08 20:37:48 +00:00
|
|
|
ffi::gst_event_new_toc(s.toc.to_glib_none().0, s.updated.to_glib())
|
2017-07-31 11:16:42 +00:00
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ProtectionBuilder<'a> {
|
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
system_id: &'a str,
|
|
|
|
data: &'a ::Buffer,
|
|
|
|
origin: &'a str,
|
|
|
|
}
|
|
|
|
impl<'a> ProtectionBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(system_id: &'a str, data: &'a ::Buffer, origin: &'a str) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
system_id: system_id,
|
|
|
|
data: data,
|
|
|
|
origin: origin,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_protection(
|
|
|
|
s.system_id.to_glib_none().0,
|
|
|
|
s.data.as_mut_ptr(),
|
|
|
|
s.origin.to_glib_none().0,
|
|
|
|
)
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct SegmentDoneBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-11-11 10:21:55 +00:00
|
|
|
position: ::FormatValue,
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> SegmentDoneBuilder<'a> {
|
2017-11-11 10:21:55 +00:00
|
|
|
fn new(position: ::FormatValue) -> Self {
|
2017-08-30 11:39:09 +00:00
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
position: position,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
2017-11-11 10:21:55 +00:00
|
|
|
ffi::gst_event_new_segment_done(s.position.to_format().to_glib(), s.position.to_value())
|
2017-07-31 11:16:42 +00:00
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct GapBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
timestamp: u64,
|
|
|
|
duration: u64,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> GapBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(timestamp: u64, duration: u64) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
timestamp: timestamp,
|
|
|
|
duration: duration,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &Self| ffi::gst_event_new_gap(s.timestamp, s.duration));
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct QosBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
type_: ::QOSType,
|
|
|
|
proportion: f64,
|
|
|
|
diff: i64,
|
|
|
|
timestamp: u64,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> QosBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(type_: ::QOSType, proportion: f64, diff: i64, timestamp: u64) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
type_: type_,
|
|
|
|
proportion: proportion,
|
|
|
|
diff: diff,
|
|
|
|
timestamp: timestamp,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_qos(s.type_.to_glib(), s.proportion, s.diff, s.timestamp)
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct SeekBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
rate: f64,
|
|
|
|
flags: ::SeekFlags,
|
|
|
|
start_type: ::SeekType,
|
2017-11-11 10:21:55 +00:00
|
|
|
start: ::FormatValue,
|
2017-07-30 14:06:44 +00:00
|
|
|
stop_type: ::SeekType,
|
2017-11-11 10:21:55 +00:00
|
|
|
stop: ::FormatValue,
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> SeekBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(
|
2017-07-31 11:16:42 +00:00
|
|
|
rate: f64,
|
|
|
|
flags: ::SeekFlags,
|
|
|
|
start_type: ::SeekType,
|
2017-11-11 10:21:55 +00:00
|
|
|
start: ::FormatValue,
|
2017-07-31 11:16:42 +00:00
|
|
|
stop_type: ::SeekType,
|
2017-11-11 10:21:55 +00:00
|
|
|
stop: ::FormatValue,
|
2017-07-31 11:16:42 +00:00
|
|
|
) -> Self {
|
2017-08-30 11:39:09 +00:00
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
rate: rate,
|
|
|
|
flags: flags,
|
|
|
|
start_type,
|
|
|
|
start,
|
|
|
|
stop_type,
|
|
|
|
stop,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_seek(
|
|
|
|
s.rate,
|
2017-11-11 10:21:55 +00:00
|
|
|
s.start.to_format().to_glib(),
|
2017-07-31 11:16:42 +00:00
|
|
|
s.flags.to_glib(),
|
|
|
|
s.start_type.to_glib(),
|
2017-11-11 10:21:55 +00:00
|
|
|
s.start.to_value(),
|
2017-07-31 11:16:42 +00:00
|
|
|
s.stop_type.to_glib(),
|
2017-11-11 10:21:55 +00:00
|
|
|
s.stop.to_value(),
|
2017-07-31 11:16:42 +00:00
|
|
|
)
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct NavigationBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Option<Structure>,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> NavigationBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(structure: Structure) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Some(structure),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &mut Self| {
|
|
|
|
let structure = s.structure.take();
|
|
|
|
let ev = ffi::gst_event_new_navigation(structure.to_glib_none().0);
|
|
|
|
mem::forget(structure);
|
|
|
|
|
|
|
|
ev
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct LatencyBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
latency: u64,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> LatencyBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(latency: u64) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
latency: latency,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &Self| ffi::gst_event_new_latency(s.latency));
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct StepBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
fmt: ::Format,
|
|
|
|
amount: u64,
|
|
|
|
rate: f64,
|
|
|
|
flush: bool,
|
|
|
|
intermediate: bool,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> StepBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(fmt: ::Format, amount: u64, rate: f64, flush: bool, intermediate: bool) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
fmt: fmt,
|
|
|
|
amount: amount,
|
|
|
|
rate: rate,
|
|
|
|
flush: flush,
|
|
|
|
intermediate: intermediate,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_step(
|
|
|
|
s.fmt.to_glib(),
|
|
|
|
s.amount,
|
|
|
|
s.rate,
|
|
|
|
s.flush.to_glib(),
|
|
|
|
s.intermediate.to_glib(),
|
|
|
|
)
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct ReconfigureBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> ReconfigureBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new() -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|_| ffi::gst_event_new_reconfigure());
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct TocSelectBuilder<'a> {
|
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
uid: &'a str,
|
|
|
|
}
|
|
|
|
impl<'a> TocSelectBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(uid: &'a str) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
uid: uid,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_toc_select(s.uid.to_glib_none().0)
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-07-30 14:06:44 +00:00
|
|
|
pub struct SelectStreamsBuilder<'a> {
|
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
streams: &'a [&'a str],
|
|
|
|
}
|
2017-11-12 12:33:02 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2017-07-30 14:06:44 +00:00
|
|
|
impl<'a> SelectStreamsBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(streams: &'a [&'a str]) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
streams: streams,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 11:16:42 +00:00
|
|
|
event_builder_generic_impl!(|s: &Self| {
|
|
|
|
ffi::gst_event_new_select_streams(s.streams.to_glib_full())
|
|
|
|
});
|
2017-07-30 14:06:44 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct CustomUpstreamBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Option<Structure>,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> CustomUpstreamBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(structure: Structure) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Some(structure),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &mut Self| {
|
|
|
|
let structure = s.structure.take();
|
2017-07-31 11:16:42 +00:00
|
|
|
let ev =
|
|
|
|
ffi::gst_event_new_custom(ffi::GST_EVENT_CUSTOM_UPSTREAM, structure.to_glib_none().0);
|
2017-07-30 14:06:44 +00:00
|
|
|
mem::forget(structure);
|
|
|
|
|
|
|
|
ev
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct CustomDownstreamBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Option<Structure>,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> CustomDownstreamBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(structure: Structure) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Some(structure),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &mut Self| {
|
|
|
|
let structure = s.structure.take();
|
2017-07-31 11:16:42 +00:00
|
|
|
let ev =
|
|
|
|
ffi::gst_event_new_custom(ffi::GST_EVENT_CUSTOM_DOWNSTREAM, structure.to_glib_none().0);
|
2017-07-30 14:06:44 +00:00
|
|
|
mem::forget(structure);
|
|
|
|
|
|
|
|
ev
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct CustomDownstreamOobBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Option<Structure>,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> CustomDownstreamOobBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(structure: Structure) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Some(structure),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &mut Self| {
|
|
|
|
let structure = s.structure.take();
|
2017-07-31 11:16:42 +00:00
|
|
|
let ev = ffi::gst_event_new_custom(
|
|
|
|
ffi::GST_EVENT_CUSTOM_DOWNSTREAM_OOB,
|
|
|
|
structure.to_glib_none().0,
|
|
|
|
);
|
2017-07-30 14:06:44 +00:00
|
|
|
mem::forget(structure);
|
|
|
|
|
|
|
|
ev
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct CustomDownstreamStickyBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Option<Structure>,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> CustomDownstreamStickyBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(structure: Structure) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Some(structure),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &mut Self| {
|
|
|
|
let structure = s.structure.take();
|
2017-07-31 11:16:42 +00:00
|
|
|
let ev = ffi::gst_event_new_custom(
|
|
|
|
ffi::GST_EVENT_CUSTOM_DOWNSTREAM_STICKY,
|
|
|
|
structure.to_glib_none().0,
|
|
|
|
);
|
2017-07-30 14:06:44 +00:00
|
|
|
mem::forget(structure);
|
|
|
|
|
|
|
|
ev
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct CustomBothBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Option<Structure>,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> CustomBothBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(structure: Structure) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Some(structure),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &mut Self| {
|
|
|
|
let structure = s.structure.take();
|
|
|
|
let ev = ffi::gst_event_new_custom(ffi::GST_EVENT_CUSTOM_BOTH, structure.to_glib_none().0);
|
|
|
|
mem::forget(structure);
|
|
|
|
|
|
|
|
ev
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-13 19:38:19 +00:00
|
|
|
pub struct CustomBothOobBuilder<'a> {
|
2017-07-30 14:06:44 +00:00
|
|
|
seqnum: Option<u32>,
|
|
|
|
running_time_offset: Option<i64>,
|
2017-11-15 17:18:58 +00:00
|
|
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Option<Structure>,
|
|
|
|
}
|
2017-09-13 19:38:19 +00:00
|
|
|
impl<'a> CustomBothOobBuilder<'a> {
|
2017-08-30 11:39:09 +00:00
|
|
|
fn new(structure: Structure) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2017-07-30 14:06:44 +00:00
|
|
|
Self {
|
|
|
|
seqnum: None,
|
|
|
|
running_time_offset: None,
|
2017-09-13 19:38:19 +00:00
|
|
|
other_fields: Vec::new(),
|
2017-07-30 14:06:44 +00:00
|
|
|
structure: Some(structure),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
event_builder_generic_impl!(|s: &mut Self| {
|
|
|
|
let structure = s.structure.take();
|
2017-07-31 11:16:42 +00:00
|
|
|
let ev =
|
|
|
|
ffi::gst_event_new_custom(ffi::GST_EVENT_CUSTOM_BOTH_OOB, structure.to_glib_none().0);
|
2017-07-30 14:06:44 +00:00
|
|
|
mem::forget(structure);
|
|
|
|
|
|
|
|
ev
|
|
|
|
});
|
|
|
|
}
|