mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 05:21:00 +00:00
rtpav1depay: Implement srcpad set_caps
Without this auto-pluggers such as decodebin or parsebin will be unable to process AV1 RTP payloads. Tested with: `videotestsrc num-buffers=50 ! videoconvert ! av1enc ! av1parse ! rtpav1pay ! queue ! decodebin3 ! videoconvert ! queue ! autovideosink` Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1034>
This commit is contained in:
parent
af9d9c0a5c
commit
0fd63ece7d
1 changed files with 10 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use gst::{glib, subclass::prelude::*};
|
||||
use gst_rtp::prelude::*;
|
||||
use gst_rtp::subclass::prelude::*;
|
||||
use std::{
|
||||
cmp::Ordering,
|
||||
|
@ -142,6 +143,15 @@ impl ElementImpl for RTPAv1Depay {
|
|||
}
|
||||
|
||||
impl RTPBaseDepayloadImpl for RTPAv1Depay {
|
||||
fn set_caps(&self, _caps: &gst::Caps) -> Result<(), gst::LoggableError> {
|
||||
let element = self.obj();
|
||||
let src_pad = element.src_pad();
|
||||
let src_caps = src_pad.pad_template_caps();
|
||||
src_pad.push_event(gst::event::Caps::builder(&src_caps).build());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_event(&self, event: gst::Event) -> bool {
|
||||
match event.view() {
|
||||
gst::EventView::Eos(_) | gst::EventView::FlushStop(_) => {
|
||||
|
@ -445,7 +455,6 @@ impl RTPAv1Depay {
|
|||
#[rustfmt::skip]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use gst_rtp::prelude::*;
|
||||
use std::io::Cursor;
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue