mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 03:21:03 +00:00
MessageBuilder: comment out other_fields related methods until GStreamer v1.14 is released
These methods are commented out in order to maintain consistency between messages with and without arguments. It will be restored and conditioned to feature "v1_14" when GStreamer v1.14 is released.
This commit is contained in:
parent
3c65a50076
commit
86812c1a53
1 changed files with 7 additions and 11 deletions
|
@ -1165,16 +1165,15 @@ macro_rules! message_builder_generic_impl {
|
|||
}
|
||||
}
|
||||
|
||||
// Warning: other_fields are ignored with argument-less messages
|
||||
// until GStreamer 1.14 is released
|
||||
pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
|
||||
// TODO: restore other_fields method and condition it to the "v1_14" feature
|
||||
/*pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
|
||||
Self {
|
||||
other_fields: self.other_fields.iter().cloned()
|
||||
.chain(other_fields.iter().cloned())
|
||||
.collect(),
|
||||
.. self
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
pub fn build(mut self) -> Message {
|
||||
assert_initialized_main_thread!();
|
||||
|
@ -2468,19 +2467,16 @@ mod tests {
|
|||
_ => panic!("eos_msg.view() is not a MessageView::Eos(_)"),
|
||||
}
|
||||
|
||||
// Note: can't define other_fields for argument-less messages before GStreamer 1.14
|
||||
|
||||
// Message with arguments
|
||||
let buffering_msg = Message::new_buffering(42)
|
||||
.other_fields(&[("extra-field", &true)])
|
||||
.build();
|
||||
let buffering_msg = Message::new_buffering(42).build();
|
||||
match buffering_msg.view() {
|
||||
MessageView::Buffering(buffering_msg) => {
|
||||
assert_eq!(buffering_msg.get_percent(), 42);
|
||||
assert!(buffering_msg.0.get_structure().is_some());
|
||||
assert!(buffering_msg.0.get_structure().unwrap().has_field("extra-field"));
|
||||
}
|
||||
_ => panic!("buffering_msg.view() is not a MessageView::Buffering(_)"),
|
||||
}
|
||||
|
||||
// TODO: add a tests for messages with and without arguments with an extra-field
|
||||
// and condition it to the "v1_14" feature
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue