mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
onvifmetadatapay: Set output caps earlier
As soon as input caps arrive, we can set output caps. This means upstream can send gap events earlier, before there is any actual metadata to send Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1779>
This commit is contained in:
parent
6a23ae168f
commit
7905626a5f
1 changed files with 11 additions and 2 deletions
|
@ -4,6 +4,14 @@ use gst_rtp::prelude::*;
|
|||
use gst_rtp::subclass::prelude::*;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"rtponvifmetadatapay",
|
||||
gst::DebugColorFlags::empty(),
|
||||
Some("RTP ONVIF metadata payloader"),
|
||||
)
|
||||
});
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct OnvifMetadataPay {}
|
||||
|
||||
|
@ -186,7 +194,8 @@ impl RTPBasePayloadImpl for OnvifMetadataPay {
|
|||
fn set_caps(&self, _caps: &gst::Caps) -> Result<(), gst::LoggableError> {
|
||||
self.obj()
|
||||
.set_options("application", true, "VND.ONVIF.METADATA", 90000);
|
||||
|
||||
Ok(())
|
||||
self.obj()
|
||||
.set_outcaps(None)
|
||||
.map_err(|_| gst::loggable_error!(CAT, "Failed to set output caps"))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue