Update for GStreamer API changes

This commit is contained in:
Sebastian Dröge 2022-10-18 19:26:29 +03:00
parent 03b03fe2dd
commit 24b7cfc841
11 changed files with 15 additions and 23 deletions

View file

@ -405,15 +405,7 @@ impl LewtonDec {
let outbuf = if let Some(ref reorder_map) = state.reorder_map { let outbuf = if let Some(ref reorder_map) = state.reorder_map {
let mut outbuf = self let mut outbuf = self
.instance() .instance()
.allocate_output_buffer(sample_count as usize * audio_info.bpf() as usize) .allocate_output_buffer(sample_count as usize * audio_info.bpf() as usize);
.map_err(|_| {
gst::element_imp_error!(
self,
gst::StreamError::Decode,
["Failed to allocate output buffer"]
);
gst::FlowError::Error
})?;
{ {
// And copy the decoded data into our output buffer while reordering the channels to the // And copy the decoded data into our output buffer while reordering the channels to the
// GStreamer channel order // GStreamer channel order

View file

@ -1813,9 +1813,9 @@ impl AggregatorImpl for FMP4Mux {
if let Some(filter_caps) = q.filter() { if let Some(filter_caps) = q.filter() {
let res = filter_caps let res = filter_caps
.intersect_with_mode(&allowed_caps, gst::CapsIntersectMode::First); .intersect_with_mode(&allowed_caps, gst::CapsIntersectMode::First);
q.set_result(&res); q.set_result(Some(&res));
} else { } else {
q.set_result(&allowed_caps); q.set_result(Some(&allowed_caps));
} }
true true

View file

@ -128,7 +128,7 @@ impl PadSrcHandler for AppSrcPadHandler {
.unwrap_or_else(gst::Caps::new_any) .unwrap_or_else(gst::Caps::new_any)
}; };
q.set_result(&caps); q.set_result(Some(&caps));
true true
} }

View file

@ -743,7 +743,7 @@ impl PadSrcHandler for ProxySrcPadHandler {
.unwrap_or_else(gst::Caps::new_any) .unwrap_or_else(gst::Caps::new_any)
}; };
q.set_result(&caps); q.set_result(Some(&caps));
true true
} }

View file

@ -142,7 +142,7 @@ impl PadSrcHandler for TcpClientSrcPadHandler {
.unwrap_or_else(gst::Caps::new_any) .unwrap_or_else(gst::Caps::new_any)
}; };
q.set_result(&caps); q.set_result(Some(&caps));
true true
} }

View file

@ -159,7 +159,7 @@ impl PadSrcHandler for UdpSrcPadHandler {
.unwrap_or_else(gst::Caps::new_any) .unwrap_or_else(gst::Caps::new_any)
}; };
q.set_result(&caps); q.set_result(Some(&caps));
true true
} }

View file

@ -395,11 +395,11 @@ impl AggregatorImpl for OnvifMetadataCombiner {
let templ_caps = templ.caps(); let templ_caps = templ.caps();
if let Some(filter) = filter { if let Some(filter) = filter {
q.set_result( q.set_result(Some(
&filter.intersect_with_mode(templ_caps, gst::CapsIntersectMode::First), &filter.intersect_with_mode(templ_caps, gst::CapsIntersectMode::First),
); ));
} else { } else {
q.set_result(templ_caps); q.set_result(Some(templ_caps));
} }
true true

View file

@ -1044,7 +1044,7 @@ impl OnvifMetadataParse {
caps caps
}; };
q.set_result(&res); q.set_result(Some(&res));
true true
} }
@ -1112,7 +1112,7 @@ impl OnvifMetadataParse {
caps caps
}; };
q.set_result(&res); q.set_result(Some(&res));
true true
} }

View file

@ -141,7 +141,7 @@ impl RTPBasePayloadImpl for OnvifMetadataPay {
} }
let mtu = self.instance().mtu(); let mtu = self.instance().mtu();
let payload_size = gst_rtp::RTPBuffer::<()>::calc_payload_len(mtu, 0, 0) as usize; let payload_size = gst_rtp::calc_payload_len(mtu, 0, 0) as usize;
let mut chunks = utf8.as_bytes().chunks(payload_size).peekable(); let mut chunks = utf8.as_bytes().chunks(payload_size).peekable();
let mut buflist = gst::BufferList::new_sized((utf8.len() / payload_size) + 1); let mut buflist = gst::BufferList::new_sized((utf8.len() / payload_size) + 1);

View file

@ -210,7 +210,7 @@ impl RTPAv1Pay {
let mut data = state.temp_packet_data.take().unwrap_or_else(|| { let mut data = state.temp_packet_data.take().unwrap_or_else(|| {
TempPacketData { TempPacketData {
payload_limit: gst_rtp::RTPBuffer::calc_payload_len(self.instance().mtu(), 0, 0), payload_limit: gst_rtp::calc_payload_len(self.instance().mtu(), 0, 0),
packet: PacketOBUData { packet: PacketOBUData {
payload_size: 1, // 1 byte is used for the aggregation header payload_size: 1, // 1 byte is used for the aggregation header
omit_last_size_field: true, omit_last_size_field: true,

View file

@ -181,7 +181,7 @@ fn test_payloader() {
let pay = h.element().unwrap(); let pay = h.element().unwrap();
pay.set_property( pay.set_property(
"mtu", "mtu",
RTPBuffer::calc_packet_len(25, 0, 0) gst_rtp::calc_packet_len(25, 0, 0)
); );
} }
h.play(); h.play();