-
Notifications
You must be signed in to change notification settings - Fork 23
Webrtcsink encoder setup #35
Conversation
+ Update README
5d77ad2
to
442f9fd
Compare
String::static_type().into(), | ||
gst::Element::static_type().into(), | ||
], | ||
bool::static_type().into(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to
- Use an accumulator function that causes the next handler to not be called anymore if
false
(ortrue
, your decision) is returned - Have a default class handler that does the default setup (i.e. the
configure_encoder()
function)
That way applications can connect signal handlers before or after the class handler, and can decide if they just want to extend the behaviour or don't want the class handler to be called. Just like many such signals work in GTK for example.
false, | ||
)?; | ||
|
||
let encoder_was_configured: bool = element.emit_by_name( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
element.emit_by_name::<bool>(...)
is what is generally used
|
||
info!("Encoder: {}", encoder.factory().unwrap().name()); | ||
|
||
let configured = match encoder.factory().unwrap().name().as_str() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You maybe want to get the factory (name) only once here, and also not panic if the element has no factory
.by_name("ws") | ||
.unwrap(); | ||
|
||
ws.connect("encoder-setup", false, |values| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This false
here makes it connect before the class handler btw, a true
would be after.
No description provided.