mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-02-18 12:05:35 +00:00
Use SendValue instead of Value for all our GValue usage
We require types that can be sent between threads.
This commit is contained in:
parent
9734ec29cc
commit
0629a0283e
7 changed files with 101 additions and 96 deletions
|
@ -16,7 +16,7 @@ use CapsIntersectMode;
|
||||||
use glib;
|
use glib;
|
||||||
use ffi;
|
use ffi;
|
||||||
use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr};
|
use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr};
|
||||||
use glib::value::ToValue;
|
use glib::value::ToSendValue;
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct CapsRef(ffi::GstCaps);
|
pub struct CapsRef(ffi::GstCaps);
|
||||||
|
@ -43,7 +43,7 @@ impl GstRc<CapsRef> {
|
||||||
unsafe { from_glib_full(ffi::gst_caps_new_any()) }
|
unsafe { from_glib_full(ffi::gst_caps_new_any()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_simple(name: &str, values: &[(&str, &ToValue)]) -> Self {
|
pub fn new_simple(name: &str, values: &[(&str, &ToSendValue)]) -> Self {
|
||||||
assert_initialized_main_thread!();
|
assert_initialized_main_thread!();
|
||||||
let mut caps = Caps::new_empty();
|
let mut caps = Caps::new_empty();
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ impl str::FromStr for Caps {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CapsRef {
|
impl CapsRef {
|
||||||
pub fn set_simple(&mut self, values: &[(&str, &ToValue)]) {
|
pub fn set_simple(&mut self, values: &[(&str, &ToSendValue)]) {
|
||||||
for &(name, value) in values {
|
for &(name, value) in values {
|
||||||
let value = value.to_value();
|
let value = value.to_value();
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ impl Builder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn field<V: ToValue>(mut self, name: &str, value: V) -> Self {
|
pub fn field<V: ToSendValue>(mut self, name: &str, value: V) -> Self {
|
||||||
self.s.set(name, value);
|
self.s.set(name, value);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ use std::mem;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
|
|
||||||
use glib;
|
use glib;
|
||||||
use glib::value::ToValue;
|
use glib::value::ToSendValue;
|
||||||
use glib::translate::{from_glib, from_glib_full, from_glib_none, ToGlib, ToGlibPtr};
|
use glib::translate::{from_glib, from_glib_full, from_glib_none, ToGlib, ToGlibPtr};
|
||||||
|
|
||||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||||
|
@ -723,7 +723,7 @@ macro_rules! event_builder_generic_impl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn other_fields(self, other_fields: &[(&'a str, &'a ToValue)]) -> Self {
|
pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
|
||||||
Self {
|
Self {
|
||||||
other_fields: self.other_fields.iter().cloned()
|
other_fields: self.other_fields.iter().cloned()
|
||||||
.chain(other_fields.iter().cloned())
|
.chain(other_fields.iter().cloned())
|
||||||
|
@ -750,7 +750,7 @@ macro_rules! event_builder_generic_impl {
|
||||||
);
|
);
|
||||||
|
|
||||||
for (k, v) in self.other_fields {
|
for (k, v) in self.other_fields {
|
||||||
s.set_value(k, v.to_value());
|
s.set_value(k, v.to_send_value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -763,7 +763,7 @@ macro_rules! event_builder_generic_impl {
|
||||||
pub struct FlushStartBuilder<'a> {
|
pub struct FlushStartBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
}
|
}
|
||||||
impl<'a> FlushStartBuilder<'a> {
|
impl<'a> FlushStartBuilder<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
|
@ -781,7 +781,7 @@ impl<'a> FlushStartBuilder<'a> {
|
||||||
pub struct FlushStopBuilder<'a> {
|
pub struct FlushStopBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
reset_time: bool,
|
reset_time: bool,
|
||||||
}
|
}
|
||||||
impl<'a> FlushStopBuilder<'a> {
|
impl<'a> FlushStopBuilder<'a> {
|
||||||
|
@ -803,7 +803,7 @@ impl<'a> FlushStopBuilder<'a> {
|
||||||
pub struct StreamStartBuilder<'a> {
|
pub struct StreamStartBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
stream_id: &'a str,
|
stream_id: &'a str,
|
||||||
flags: Option<::StreamFlags>,
|
flags: Option<::StreamFlags>,
|
||||||
group_id: Option<u32>,
|
group_id: Option<u32>,
|
||||||
|
@ -850,7 +850,7 @@ impl<'a> StreamStartBuilder<'a> {
|
||||||
pub struct CapsBuilder<'a> {
|
pub struct CapsBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
caps: &'a ::Caps,
|
caps: &'a ::Caps,
|
||||||
}
|
}
|
||||||
impl<'a> CapsBuilder<'a> {
|
impl<'a> CapsBuilder<'a> {
|
||||||
|
@ -870,7 +870,7 @@ impl<'a> CapsBuilder<'a> {
|
||||||
pub struct SegmentBuilder<'a> {
|
pub struct SegmentBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
segment: &'a ::Segment,
|
segment: &'a ::Segment,
|
||||||
}
|
}
|
||||||
impl<'a> SegmentBuilder<'a> {
|
impl<'a> SegmentBuilder<'a> {
|
||||||
|
@ -893,7 +893,7 @@ impl<'a> SegmentBuilder<'a> {
|
||||||
pub struct StreamCollectionBuilder<'a> {
|
pub struct StreamCollectionBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
stream_collection: &'a ::StreamCollection,
|
stream_collection: &'a ::StreamCollection,
|
||||||
}
|
}
|
||||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||||
|
@ -916,7 +916,7 @@ impl<'a> StreamCollectionBuilder<'a> {
|
||||||
pub struct TagBuilder<'a> {
|
pub struct TagBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
tags: Option<::TagList>,
|
tags: Option<::TagList>,
|
||||||
}
|
}
|
||||||
impl<'a> TagBuilder<'a> {
|
impl<'a> TagBuilder<'a> {
|
||||||
|
@ -939,7 +939,7 @@ impl<'a> TagBuilder<'a> {
|
||||||
pub struct BufferSizeBuilder<'a> {
|
pub struct BufferSizeBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
minsize: ::FormatValue,
|
minsize: ::FormatValue,
|
||||||
maxsize: ::FormatValue,
|
maxsize: ::FormatValue,
|
||||||
async: bool,
|
async: bool,
|
||||||
|
@ -970,7 +970,7 @@ impl<'a> BufferSizeBuilder<'a> {
|
||||||
pub struct SinkMessageBuilder<'a> {
|
pub struct SinkMessageBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
name: &'a str,
|
name: &'a str,
|
||||||
msg: &'a ::Message,
|
msg: &'a ::Message,
|
||||||
}
|
}
|
||||||
|
@ -995,7 +995,7 @@ impl<'a> SinkMessageBuilder<'a> {
|
||||||
pub struct StreamGroupDoneBuilder<'a> {
|
pub struct StreamGroupDoneBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
uid: u32,
|
uid: u32,
|
||||||
}
|
}
|
||||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||||
|
@ -1016,7 +1016,7 @@ impl<'a> StreamGroupDoneBuilder<'a> {
|
||||||
pub struct EosBuilder<'a> {
|
pub struct EosBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
}
|
}
|
||||||
impl<'a> EosBuilder<'a> {
|
impl<'a> EosBuilder<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
|
@ -1034,7 +1034,7 @@ impl<'a> EosBuilder<'a> {
|
||||||
pub struct TocBuilder<'a> {
|
pub struct TocBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
toc: &'a ::Toc,
|
toc: &'a ::Toc,
|
||||||
updated: bool,
|
updated: bool,
|
||||||
}
|
}
|
||||||
|
@ -1058,7 +1058,7 @@ impl<'a> TocBuilder<'a> {
|
||||||
pub struct ProtectionBuilder<'a> {
|
pub struct ProtectionBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
system_id: &'a str,
|
system_id: &'a str,
|
||||||
data: &'a ::Buffer,
|
data: &'a ::Buffer,
|
||||||
origin: &'a str,
|
origin: &'a str,
|
||||||
|
@ -1088,7 +1088,7 @@ impl<'a> ProtectionBuilder<'a> {
|
||||||
pub struct SegmentDoneBuilder<'a> {
|
pub struct SegmentDoneBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
position: ::FormatValue,
|
position: ::FormatValue,
|
||||||
}
|
}
|
||||||
impl<'a> SegmentDoneBuilder<'a> {
|
impl<'a> SegmentDoneBuilder<'a> {
|
||||||
|
@ -1110,7 +1110,7 @@ impl<'a> SegmentDoneBuilder<'a> {
|
||||||
pub struct GapBuilder<'a> {
|
pub struct GapBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
timestamp: u64,
|
timestamp: u64,
|
||||||
duration: u64,
|
duration: u64,
|
||||||
}
|
}
|
||||||
|
@ -1132,7 +1132,7 @@ impl<'a> GapBuilder<'a> {
|
||||||
pub struct QosBuilder<'a> {
|
pub struct QosBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
type_: ::QOSType,
|
type_: ::QOSType,
|
||||||
proportion: f64,
|
proportion: f64,
|
||||||
diff: i64,
|
diff: i64,
|
||||||
|
@ -1160,7 +1160,7 @@ impl<'a> QosBuilder<'a> {
|
||||||
pub struct SeekBuilder<'a> {
|
pub struct SeekBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
rate: f64,
|
rate: f64,
|
||||||
flags: ::SeekFlags,
|
flags: ::SeekFlags,
|
||||||
start_type: ::SeekType,
|
start_type: ::SeekType,
|
||||||
|
@ -1207,7 +1207,7 @@ impl<'a> SeekBuilder<'a> {
|
||||||
pub struct NavigationBuilder<'a> {
|
pub struct NavigationBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
structure: Option<Structure>,
|
structure: Option<Structure>,
|
||||||
}
|
}
|
||||||
impl<'a> NavigationBuilder<'a> {
|
impl<'a> NavigationBuilder<'a> {
|
||||||
|
@ -1233,7 +1233,7 @@ impl<'a> NavigationBuilder<'a> {
|
||||||
pub struct LatencyBuilder<'a> {
|
pub struct LatencyBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
latency: u64,
|
latency: u64,
|
||||||
}
|
}
|
||||||
impl<'a> LatencyBuilder<'a> {
|
impl<'a> LatencyBuilder<'a> {
|
||||||
|
@ -1253,7 +1253,7 @@ impl<'a> LatencyBuilder<'a> {
|
||||||
pub struct StepBuilder<'a> {
|
pub struct StepBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
fmt: ::Format,
|
fmt: ::Format,
|
||||||
amount: u64,
|
amount: u64,
|
||||||
rate: f64,
|
rate: f64,
|
||||||
|
@ -1289,7 +1289,7 @@ impl<'a> StepBuilder<'a> {
|
||||||
pub struct ReconfigureBuilder<'a> {
|
pub struct ReconfigureBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
}
|
}
|
||||||
impl<'a> ReconfigureBuilder<'a> {
|
impl<'a> ReconfigureBuilder<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
|
@ -1307,7 +1307,7 @@ impl<'a> ReconfigureBuilder<'a> {
|
||||||
pub struct TocSelectBuilder<'a> {
|
pub struct TocSelectBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
uid: &'a str,
|
uid: &'a str,
|
||||||
}
|
}
|
||||||
impl<'a> TocSelectBuilder<'a> {
|
impl<'a> TocSelectBuilder<'a> {
|
||||||
|
@ -1330,7 +1330,7 @@ impl<'a> TocSelectBuilder<'a> {
|
||||||
pub struct SelectStreamsBuilder<'a> {
|
pub struct SelectStreamsBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
streams: &'a [&'a str],
|
streams: &'a [&'a str],
|
||||||
}
|
}
|
||||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||||
|
@ -1353,7 +1353,7 @@ impl<'a> SelectStreamsBuilder<'a> {
|
||||||
pub struct CustomUpstreamBuilder<'a> {
|
pub struct CustomUpstreamBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
structure: Option<Structure>,
|
structure: Option<Structure>,
|
||||||
}
|
}
|
||||||
impl<'a> CustomUpstreamBuilder<'a> {
|
impl<'a> CustomUpstreamBuilder<'a> {
|
||||||
|
@ -1380,7 +1380,7 @@ impl<'a> CustomUpstreamBuilder<'a> {
|
||||||
pub struct CustomDownstreamBuilder<'a> {
|
pub struct CustomDownstreamBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
structure: Option<Structure>,
|
structure: Option<Structure>,
|
||||||
}
|
}
|
||||||
impl<'a> CustomDownstreamBuilder<'a> {
|
impl<'a> CustomDownstreamBuilder<'a> {
|
||||||
|
@ -1407,7 +1407,7 @@ impl<'a> CustomDownstreamBuilder<'a> {
|
||||||
pub struct CustomDownstreamOobBuilder<'a> {
|
pub struct CustomDownstreamOobBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
structure: Option<Structure>,
|
structure: Option<Structure>,
|
||||||
}
|
}
|
||||||
impl<'a> CustomDownstreamOobBuilder<'a> {
|
impl<'a> CustomDownstreamOobBuilder<'a> {
|
||||||
|
@ -1436,7 +1436,7 @@ impl<'a> CustomDownstreamOobBuilder<'a> {
|
||||||
pub struct CustomDownstreamStickyBuilder<'a> {
|
pub struct CustomDownstreamStickyBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
structure: Option<Structure>,
|
structure: Option<Structure>,
|
||||||
}
|
}
|
||||||
impl<'a> CustomDownstreamStickyBuilder<'a> {
|
impl<'a> CustomDownstreamStickyBuilder<'a> {
|
||||||
|
@ -1465,7 +1465,7 @@ impl<'a> CustomDownstreamStickyBuilder<'a> {
|
||||||
pub struct CustomBothBuilder<'a> {
|
pub struct CustomBothBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
structure: Option<Structure>,
|
structure: Option<Structure>,
|
||||||
}
|
}
|
||||||
impl<'a> CustomBothBuilder<'a> {
|
impl<'a> CustomBothBuilder<'a> {
|
||||||
|
@ -1491,7 +1491,7 @@ impl<'a> CustomBothBuilder<'a> {
|
||||||
pub struct CustomBothOobBuilder<'a> {
|
pub struct CustomBothOobBuilder<'a> {
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
running_time_offset: Option<i64>,
|
running_time_offset: Option<i64>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
structure: Option<Structure>,
|
structure: Option<Structure>,
|
||||||
}
|
}
|
||||||
impl<'a> CustomBothOobBuilder<'a> {
|
impl<'a> CustomBothOobBuilder<'a> {
|
||||||
|
|
|
@ -19,7 +19,7 @@ use std::ffi::CStr;
|
||||||
use glib;
|
use glib;
|
||||||
use glib::Cast;
|
use glib::Cast;
|
||||||
use glib::IsA;
|
use glib::IsA;
|
||||||
use glib::value::ToValue;
|
use glib::value::ToSendValue;
|
||||||
use glib::translate::{from_glib, from_glib_full, from_glib_none, mut_override, ToGlib, ToGlibPtr};
|
use glib::translate::{from_glib, from_glib_full, from_glib_none, mut_override, ToGlib, ToGlibPtr};
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
@ -1131,7 +1131,7 @@ macro_rules! message_builder_generic_impl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn other_fields(self, other_fields: &[(&'a str, &'a ToValue)]) -> Self {
|
pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
|
||||||
Self {
|
Self {
|
||||||
other_fields: self.other_fields.iter().cloned()
|
other_fields: self.other_fields.iter().cloned()
|
||||||
.chain(other_fields.iter().cloned())
|
.chain(other_fields.iter().cloned())
|
||||||
|
@ -1155,7 +1155,7 @@ macro_rules! message_builder_generic_impl {
|
||||||
);
|
);
|
||||||
|
|
||||||
for (k, v) in self.other_fields {
|
for (k, v) in self.other_fields {
|
||||||
s.set_value(k, v.to_value());
|
s.set_value(k, v.to_send_value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1168,7 +1168,7 @@ macro_rules! message_builder_generic_impl {
|
||||||
pub struct EosBuilder<'a> {
|
pub struct EosBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
}
|
}
|
||||||
impl<'a> EosBuilder<'a> {
|
impl<'a> EosBuilder<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
|
@ -1193,7 +1193,7 @@ impl MessageErrorDomain for ::LibraryError {}
|
||||||
pub struct ErrorBuilder<'a, T> {
|
pub struct ErrorBuilder<'a, T> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
error: T,
|
error: T,
|
||||||
message: &'a str,
|
message: &'a str,
|
||||||
debug: Option<&'a str>,
|
debug: Option<&'a str>,
|
||||||
|
@ -1261,7 +1261,7 @@ impl<'a, T: MessageErrorDomain> ErrorBuilder<'a, T> {
|
||||||
pub struct WarningBuilder<'a, T> {
|
pub struct WarningBuilder<'a, T> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
error: T,
|
error: T,
|
||||||
message: &'a str,
|
message: &'a str,
|
||||||
debug: Option<&'a str>,
|
debug: Option<&'a str>,
|
||||||
|
@ -1329,7 +1329,7 @@ impl<'a, T: MessageErrorDomain> WarningBuilder<'a, T> {
|
||||||
pub struct InfoBuilder<'a, T> {
|
pub struct InfoBuilder<'a, T> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
error: T,
|
error: T,
|
||||||
message: &'a str,
|
message: &'a str,
|
||||||
debug: Option<&'a str>,
|
debug: Option<&'a str>,
|
||||||
|
@ -1397,7 +1397,7 @@ impl<'a, T: MessageErrorDomain> InfoBuilder<'a, T> {
|
||||||
pub struct TagBuilder<'a> {
|
pub struct TagBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
tags: &'a TagList,
|
tags: &'a TagList,
|
||||||
}
|
}
|
||||||
impl<'a> TagBuilder<'a> {
|
impl<'a> TagBuilder<'a> {
|
||||||
|
@ -1419,7 +1419,7 @@ impl<'a> TagBuilder<'a> {
|
||||||
pub struct BufferingBuilder<'a> {
|
pub struct BufferingBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
percent: i32,
|
percent: i32,
|
||||||
stats: Option<(::BufferingMode, i32, i32, i64)>,
|
stats: Option<(::BufferingMode, i32, i32, i64)>,
|
||||||
}
|
}
|
||||||
|
@ -1469,7 +1469,7 @@ impl<'a> BufferingBuilder<'a> {
|
||||||
pub struct StateChangedBuilder<'a> {
|
pub struct StateChangedBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
old: ::State,
|
old: ::State,
|
||||||
new: ::State,
|
new: ::State,
|
||||||
pending: ::State,
|
pending: ::State,
|
||||||
|
@ -1500,7 +1500,7 @@ impl<'a> StateChangedBuilder<'a> {
|
||||||
pub struct StateDirtyBuilder<'a> {
|
pub struct StateDirtyBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
}
|
}
|
||||||
impl<'a> StateDirtyBuilder<'a> {
|
impl<'a> StateDirtyBuilder<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
|
@ -1518,7 +1518,7 @@ impl<'a> StateDirtyBuilder<'a> {
|
||||||
pub struct StepDoneBuilder<'a> {
|
pub struct StepDoneBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
format: ::Format,
|
format: ::Format,
|
||||||
amount: u64,
|
amount: u64,
|
||||||
rate: f64,
|
rate: f64,
|
||||||
|
@ -1569,7 +1569,7 @@ impl<'a> StepDoneBuilder<'a> {
|
||||||
pub struct ClockProvideBuilder<'a> {
|
pub struct ClockProvideBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
clock: &'a ::Clock,
|
clock: &'a ::Clock,
|
||||||
ready: bool,
|
ready: bool,
|
||||||
}
|
}
|
||||||
|
@ -1593,7 +1593,7 @@ impl<'a> ClockProvideBuilder<'a> {
|
||||||
pub struct ClockLostBuilder<'a> {
|
pub struct ClockLostBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
clock: &'a ::Clock,
|
clock: &'a ::Clock,
|
||||||
}
|
}
|
||||||
impl<'a> ClockLostBuilder<'a> {
|
impl<'a> ClockLostBuilder<'a> {
|
||||||
|
@ -1615,7 +1615,7 @@ impl<'a> ClockLostBuilder<'a> {
|
||||||
pub struct NewClockBuilder<'a> {
|
pub struct NewClockBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
clock: &'a ::Clock,
|
clock: &'a ::Clock,
|
||||||
}
|
}
|
||||||
impl<'a> NewClockBuilder<'a> {
|
impl<'a> NewClockBuilder<'a> {
|
||||||
|
@ -1637,7 +1637,7 @@ impl<'a> NewClockBuilder<'a> {
|
||||||
pub struct StructureChangeBuilder<'a> {
|
pub struct StructureChangeBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
type_: ::StructureChangeType,
|
type_: ::StructureChangeType,
|
||||||
owner: &'a ::Element,
|
owner: &'a ::Element,
|
||||||
busy: bool,
|
busy: bool,
|
||||||
|
@ -1668,7 +1668,7 @@ impl<'a> StructureChangeBuilder<'a> {
|
||||||
pub struct StreamStatusBuilder<'a> {
|
pub struct StreamStatusBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
type_: ::StreamStatusType,
|
type_: ::StreamStatusType,
|
||||||
owner: &'a ::Element,
|
owner: &'a ::Element,
|
||||||
status_object: Option<&'a glib::Value>,
|
status_object: Option<&'a glib::Value>,
|
||||||
|
@ -1706,7 +1706,7 @@ impl<'a> StreamStatusBuilder<'a> {
|
||||||
pub struct ApplicationBuilder<'a> {
|
pub struct ApplicationBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
structure: Option<::Structure>,
|
structure: Option<::Structure>,
|
||||||
}
|
}
|
||||||
impl<'a> ApplicationBuilder<'a> {
|
impl<'a> ApplicationBuilder<'a> {
|
||||||
|
@ -1728,7 +1728,7 @@ impl<'a> ApplicationBuilder<'a> {
|
||||||
pub struct ElementBuilder<'a> {
|
pub struct ElementBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
structure: Option<::Structure>,
|
structure: Option<::Structure>,
|
||||||
}
|
}
|
||||||
impl<'a> ElementBuilder<'a> {
|
impl<'a> ElementBuilder<'a> {
|
||||||
|
@ -1750,7 +1750,7 @@ impl<'a> ElementBuilder<'a> {
|
||||||
pub struct SegmentStartBuilder<'a> {
|
pub struct SegmentStartBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
position: ::FormatValue,
|
position: ::FormatValue,
|
||||||
}
|
}
|
||||||
impl<'a> SegmentStartBuilder<'a> {
|
impl<'a> SegmentStartBuilder<'a> {
|
||||||
|
@ -1776,7 +1776,7 @@ impl<'a> SegmentStartBuilder<'a> {
|
||||||
pub struct SegmentDoneBuilder<'a> {
|
pub struct SegmentDoneBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
position: ::FormatValue,
|
position: ::FormatValue,
|
||||||
}
|
}
|
||||||
impl<'a> SegmentDoneBuilder<'a> {
|
impl<'a> SegmentDoneBuilder<'a> {
|
||||||
|
@ -1802,7 +1802,7 @@ impl<'a> SegmentDoneBuilder<'a> {
|
||||||
pub struct DurationChangedBuilder<'a> {
|
pub struct DurationChangedBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
}
|
}
|
||||||
impl<'a> DurationChangedBuilder<'a> {
|
impl<'a> DurationChangedBuilder<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
|
@ -1820,7 +1820,7 @@ impl<'a> DurationChangedBuilder<'a> {
|
||||||
pub struct LatencyBuilder<'a> {
|
pub struct LatencyBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
}
|
}
|
||||||
impl<'a> LatencyBuilder<'a> {
|
impl<'a> LatencyBuilder<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
|
@ -1838,7 +1838,7 @@ impl<'a> LatencyBuilder<'a> {
|
||||||
pub struct AsyncStartBuilder<'a> {
|
pub struct AsyncStartBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
}
|
}
|
||||||
impl<'a> AsyncStartBuilder<'a> {
|
impl<'a> AsyncStartBuilder<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
|
@ -1856,7 +1856,7 @@ impl<'a> AsyncStartBuilder<'a> {
|
||||||
pub struct AsyncDoneBuilder<'a> {
|
pub struct AsyncDoneBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
running_time: u64,
|
running_time: u64,
|
||||||
}
|
}
|
||||||
impl<'a> AsyncDoneBuilder<'a> {
|
impl<'a> AsyncDoneBuilder<'a> {
|
||||||
|
@ -1878,7 +1878,7 @@ impl<'a> AsyncDoneBuilder<'a> {
|
||||||
pub struct RequestStateBuilder<'a> {
|
pub struct RequestStateBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
state: ::State,
|
state: ::State,
|
||||||
}
|
}
|
||||||
impl<'a> RequestStateBuilder<'a> {
|
impl<'a> RequestStateBuilder<'a> {
|
||||||
|
@ -1900,7 +1900,7 @@ impl<'a> RequestStateBuilder<'a> {
|
||||||
pub struct StepStartBuilder<'a> {
|
pub struct StepStartBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
active: bool,
|
active: bool,
|
||||||
format: ::Format,
|
format: ::Format,
|
||||||
amount: u64,
|
amount: u64,
|
||||||
|
@ -1947,7 +1947,7 @@ impl<'a> StepStartBuilder<'a> {
|
||||||
pub struct QosBuilder<'a> {
|
pub struct QosBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
live: bool,
|
live: bool,
|
||||||
running_time: u64,
|
running_time: u64,
|
||||||
stream_time: u64,
|
stream_time: u64,
|
||||||
|
@ -2009,7 +2009,7 @@ impl<'a> QosBuilder<'a> {
|
||||||
pub struct ProgressBuilder<'a> {
|
pub struct ProgressBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
type_: ::ProgressType,
|
type_: ::ProgressType,
|
||||||
code: Option<&'a str>,
|
code: Option<&'a str>,
|
||||||
text: Option<&'a str>,
|
text: Option<&'a str>,
|
||||||
|
@ -2054,7 +2054,7 @@ impl<'a> ProgressBuilder<'a> {
|
||||||
pub struct TocBuilder<'a> {
|
pub struct TocBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
toc: &'a ::Toc,
|
toc: &'a ::Toc,
|
||||||
updated: bool,
|
updated: bool,
|
||||||
}
|
}
|
||||||
|
@ -2078,7 +2078,7 @@ impl<'a> TocBuilder<'a> {
|
||||||
pub struct ResetTimeBuilder<'a> {
|
pub struct ResetTimeBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
running_time: u64,
|
running_time: u64,
|
||||||
}
|
}
|
||||||
impl<'a> ResetTimeBuilder<'a> {
|
impl<'a> ResetTimeBuilder<'a> {
|
||||||
|
@ -2100,7 +2100,7 @@ impl<'a> ResetTimeBuilder<'a> {
|
||||||
pub struct StreamStartBuilder<'a> {
|
pub struct StreamStartBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
group_id: Option<u32>,
|
group_id: Option<u32>,
|
||||||
}
|
}
|
||||||
impl<'a> StreamStartBuilder<'a> {
|
impl<'a> StreamStartBuilder<'a> {
|
||||||
|
@ -2133,7 +2133,7 @@ impl<'a> StreamStartBuilder<'a> {
|
||||||
pub struct NeedContextBuilder<'a> {
|
pub struct NeedContextBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
context_type: &'a str,
|
context_type: &'a str,
|
||||||
}
|
}
|
||||||
impl<'a> NeedContextBuilder<'a> {
|
impl<'a> NeedContextBuilder<'a> {
|
||||||
|
@ -2155,7 +2155,7 @@ impl<'a> NeedContextBuilder<'a> {
|
||||||
pub struct HaveContextBuilder<'a> {
|
pub struct HaveContextBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
context: Option<::Context>,
|
context: Option<::Context>,
|
||||||
}
|
}
|
||||||
impl<'a> HaveContextBuilder<'a> {
|
impl<'a> HaveContextBuilder<'a> {
|
||||||
|
@ -2178,7 +2178,7 @@ impl<'a> HaveContextBuilder<'a> {
|
||||||
pub struct DeviceAddedBuilder<'a> {
|
pub struct DeviceAddedBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
device: &'a ::Device,
|
device: &'a ::Device,
|
||||||
}
|
}
|
||||||
impl<'a> DeviceAddedBuilder<'a> {
|
impl<'a> DeviceAddedBuilder<'a> {
|
||||||
|
@ -2200,7 +2200,7 @@ impl<'a> DeviceAddedBuilder<'a> {
|
||||||
pub struct DeviceRemovedBuilder<'a> {
|
pub struct DeviceRemovedBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
device: &'a ::Device,
|
device: &'a ::Device,
|
||||||
}
|
}
|
||||||
impl<'a> DeviceRemovedBuilder<'a> {
|
impl<'a> DeviceRemovedBuilder<'a> {
|
||||||
|
@ -2223,7 +2223,7 @@ impl<'a> DeviceRemovedBuilder<'a> {
|
||||||
pub struct PropertyNotifyBuilder<'a> {
|
pub struct PropertyNotifyBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
property_name: &'a str,
|
property_name: &'a str,
|
||||||
value: &'a glib::Value,
|
value: &'a glib::Value,
|
||||||
}
|
}
|
||||||
|
@ -2253,7 +2253,7 @@ impl<'a> PropertyNotifyBuilder<'a> {
|
||||||
pub struct StreamCollectionBuilder<'a> {
|
pub struct StreamCollectionBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
collection: &'a ::StreamCollection,
|
collection: &'a ::StreamCollection,
|
||||||
}
|
}
|
||||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||||
|
@ -2277,7 +2277,7 @@ impl<'a> StreamCollectionBuilder<'a> {
|
||||||
pub struct StreamsSelectedBuilder<'a> {
|
pub struct StreamsSelectedBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||||
collection: &'a ::StreamCollection,
|
collection: &'a ::StreamCollection,
|
||||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||||
|
@ -2318,7 +2318,7 @@ impl<'a> StreamsSelectedBuilder<'a> {
|
||||||
pub struct RedirectBuilder<'a> {
|
pub struct RedirectBuilder<'a> {
|
||||||
src: Option<Object>,
|
src: Option<Object>,
|
||||||
seqnum: Option<u32>,
|
seqnum: Option<u32>,
|
||||||
other_fields: Vec<(&'a str, &'a ToValue)>,
|
other_fields: Vec<(&'a str, &'a ToSendValue)>,
|
||||||
location: &'a str,
|
location: &'a str,
|
||||||
tag_list: Option<&'a TagList>,
|
tag_list: Option<&'a TagList>,
|
||||||
entry_struct: Option<Structure>,
|
entry_struct: Option<Structure>,
|
||||||
|
|
|
@ -20,12 +20,13 @@ use Fraction;
|
||||||
use glib;
|
use glib;
|
||||||
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrFull, FromGlibPtrNone,
|
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrFull, FromGlibPtrNone,
|
||||||
GlibPtrDefault, Stash, StashMut, ToGlib, ToGlibPtr, ToGlibPtrMut};
|
GlibPtrDefault, Stash, StashMut, ToGlib, ToGlibPtr, ToGlibPtrMut};
|
||||||
use glib::value::{FromValueOptional, ToValue, Value};
|
use glib::value::{FromValueOptional, ToSendValue, SendValue};
|
||||||
use ffi;
|
use ffi;
|
||||||
use glib_ffi::gpointer;
|
use glib_ffi::gpointer;
|
||||||
use gobject_ffi;
|
use gobject_ffi;
|
||||||
|
|
||||||
pub struct Structure(*mut StructureRef, PhantomData<StructureRef>);
|
pub struct Structure(*mut StructureRef, PhantomData<StructureRef>);
|
||||||
|
unsafe impl Send for Structure { }
|
||||||
|
|
||||||
impl Structure {
|
impl Structure {
|
||||||
pub fn builder(name: &str) -> Builder {
|
pub fn builder(name: &str) -> Builder {
|
||||||
|
@ -41,12 +42,12 @@ impl Structure {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(name: &str, values: &[(&str, &ToValue)]) -> Structure {
|
pub fn new(name: &str, values: &[(&str, &ToSendValue)]) -> Structure {
|
||||||
assert_initialized_main_thread!();
|
assert_initialized_main_thread!();
|
||||||
let mut structure = Structure::new_empty(name);
|
let mut structure = Structure::new_empty(name);
|
||||||
|
|
||||||
for &(f, v) in values {
|
for &(f, v) in values {
|
||||||
structure.set_value(f, v.to_value());
|
structure.set_value(f, v.to_send_value());
|
||||||
}
|
}
|
||||||
|
|
||||||
structure
|
structure
|
||||||
|
@ -288,11 +289,11 @@ impl StructureRef {
|
||||||
unsafe { from_glib_full(ffi::gst_structure_to_string(&self.0)) }
|
unsafe { from_glib_full(ffi::gst_structure_to_string(&self.0)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get<'a, T: FromValueOptional<'a>>(&'a self, name: &str) -> Option<T> {
|
pub fn get<'a, T: FromValueOptional<'a> + Send>(&'a self, name: &str) -> Option<T> {
|
||||||
self.get_value(name).and_then(|v| v.get())
|
self.get_value(name).and_then(|v| v.get())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_value<'a>(&'a self, name: &str) -> Option<&Value> {
|
pub fn get_value<'a>(&'a self, name: &str) -> Option<&SendValue> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let value = ffi::gst_structure_get_value(&self.0, name.to_glib_none().0);
|
let value = ffi::gst_structure_get_value(&self.0, name.to_glib_none().0);
|
||||||
|
|
||||||
|
@ -300,16 +301,16 @@ impl StructureRef {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(&*(value as *const Value))
|
Some(&*(value as *const SendValue))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set<T: ToValue>(&mut self, name: &str, value: T) {
|
pub fn set<T: ToSendValue>(&mut self, name: &str, value: T) {
|
||||||
let value = value.to_value();
|
let value = value.to_send_value();
|
||||||
self.set_value(name, value);
|
self.set_value(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_value(&mut self, name: &str, mut value: Value) {
|
pub fn set_value(&mut self, name: &str, mut value: SendValue) {
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::gst_structure_take_value(
|
ffi::gst_structure_take_value(
|
||||||
&mut self.0,
|
&mut self.0,
|
||||||
|
@ -567,9 +568,9 @@ impl<'a> Iter<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Iterator for Iter<'a> {
|
impl<'a> Iterator for Iter<'a> {
|
||||||
type Item = (&'a str, &'a Value);
|
type Item = (&'a str, &'a SendValue);
|
||||||
|
|
||||||
fn next(&mut self) -> Option<(&'a str, &'a Value)> {
|
fn next(&mut self) -> Option<(&'a str, &'a SendValue)> {
|
||||||
if let Some(f) = self.iter.next() {
|
if let Some(f) = self.iter.next() {
|
||||||
let v = self.iter.structure.get_value(f);
|
let v = self.iter.structure.get_value(f);
|
||||||
Some((f, v.unwrap()))
|
Some((f, v.unwrap()))
|
||||||
|
@ -607,7 +608,7 @@ impl Builder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn field<V: ToValue>(mut self, name: &str, value: V) -> Self {
|
pub fn field<V: ToSendValue>(mut self, name: &str, value: V) -> Self {
|
||||||
self.s.set(name, value);
|
self.s.set(name, value);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,22 +11,22 @@ use TagSetter;
|
||||||
use TagMergeMode;
|
use TagMergeMode;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
use glib::value::ToValue;
|
use glib::value::ToSendValue;
|
||||||
use tags::*;
|
use tags::*;
|
||||||
|
|
||||||
pub trait TagSetterExtManual {
|
pub trait TagSetterExtManual {
|
||||||
fn add<'a, T: Tag<'a>>(&mut self, value: T::TagType, mode: TagMergeMode)
|
fn add<'a, T: Tag<'a>>(&mut self, value: T::TagType, mode: TagMergeMode)
|
||||||
where
|
where
|
||||||
T::TagType: ToValue;
|
T::TagType: ToSendValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<O: IsA<TagSetter>> TagSetterExtManual for O {
|
impl<O: IsA<TagSetter>> TagSetterExtManual for O {
|
||||||
fn add<'a, T: Tag<'a>>(&mut self, value: T::TagType, mode: TagMergeMode)
|
fn add<'a, T: Tag<'a>>(&mut self, value: T::TagType, mode: TagMergeMode)
|
||||||
where
|
where
|
||||||
T::TagType: ToValue,
|
T::TagType: ToSendValue,
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
let v = value.to_value();
|
let v = value.to_send_value();
|
||||||
|
|
||||||
ffi::gst_tag_setter_add_tag_value(
|
ffi::gst_tag_setter_add_tag_value(
|
||||||
self.to_glib_none().0,
|
self.to_glib_none().0,
|
||||||
|
|
|
@ -14,7 +14,7 @@ use std::ffi::CStr;
|
||||||
use ffi;
|
use ffi;
|
||||||
use glib;
|
use glib;
|
||||||
use glib::StaticType;
|
use glib::StaticType;
|
||||||
use glib::value::{FromValueOptional, SetValue, ToValue, TypedValue, Value};
|
use glib::value::{FromValueOptional, SetValue, ToSendValue, TypedValue, Value};
|
||||||
use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr, ToGlibPtrMut};
|
use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr, ToGlibPtrMut};
|
||||||
|
|
||||||
use miniobject::*;
|
use miniobject::*;
|
||||||
|
@ -23,7 +23,7 @@ use TagMergeMode;
|
||||||
use Sample;
|
use Sample;
|
||||||
|
|
||||||
pub trait Tag<'a> {
|
pub trait Tag<'a> {
|
||||||
type TagType: FromValueOptional<'a> + SetValue;
|
type TagType: FromValueOptional<'a> + SetValue + Send;
|
||||||
fn tag_name<'b>() -> &'b str;
|
fn tag_name<'b>() -> &'b str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,10 +257,10 @@ impl Default for GstRc<TagListRef> {
|
||||||
impl TagListRef {
|
impl TagListRef {
|
||||||
pub fn add<'a, T: Tag<'a>>(&mut self, value: T::TagType, mode: TagMergeMode)
|
pub fn add<'a, T: Tag<'a>>(&mut self, value: T::TagType, mode: TagMergeMode)
|
||||||
where
|
where
|
||||||
T::TagType: ToValue,
|
T::TagType: ToSendValue,
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
let v = value.to_value();
|
let v = value.to_send_value();
|
||||||
|
|
||||||
ffi::gst_tag_list_add_value(
|
ffi::gst_tag_list_add_value(
|
||||||
self.as_mut_ptr(),
|
self.as_mut_ptr(),
|
||||||
|
|
|
@ -524,6 +524,8 @@ impl SetValue for Bitmask {
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Array<'a>(Cow<'a, [glib::Value]>);
|
pub struct Array<'a>(Cow<'a, [glib::Value]>);
|
||||||
|
|
||||||
|
unsafe impl<'a> Send for Array<'a> {}
|
||||||
|
|
||||||
impl<'a> Array<'a> {
|
impl<'a> Array<'a> {
|
||||||
pub fn new(values: &[&ToValue]) -> Self {
|
pub fn new(values: &[&ToValue]) -> Self {
|
||||||
assert_initialized_main_thread!();
|
assert_initialized_main_thread!();
|
||||||
|
@ -593,6 +595,8 @@ impl<'a> glib::types::StaticType for Array<'a> {
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct List<'a>(Cow<'a, [glib::Value]>);
|
pub struct List<'a>(Cow<'a, [glib::Value]>);
|
||||||
|
|
||||||
|
unsafe impl<'a> Send for List<'a> {}
|
||||||
|
|
||||||
impl<'a> List<'a> {
|
impl<'a> List<'a> {
|
||||||
pub fn new(values: &[&ToValue]) -> Self {
|
pub fn new(values: &[&ToValue]) -> Self {
|
||||||
assert_initialized_main_thread!();
|
assert_initialized_main_thread!();
|
||||||
|
|
Loading…
Reference in a new issue