2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
use crate::RTSPStreamTransport;
|
2019-01-08 16:13:37 +00:00
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::translate::*;
|
|
|
|
|
|
|
|
pub trait RTSPStreamTransportExtManual: 'static {
|
|
|
|
fn recv_data(
|
|
|
|
&self,
|
|
|
|
channel: u32,
|
|
|
|
buffer: &gst::Buffer,
|
|
|
|
) -> Result<gst::FlowSuccess, gst::FlowError>;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExtManual for O {
|
|
|
|
fn recv_data(
|
|
|
|
&self,
|
|
|
|
channel: u32,
|
|
|
|
buffer: &gst::Buffer,
|
|
|
|
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
|
|
|
let ret: gst::FlowReturn = unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
from_glib(ffi::gst_rtsp_stream_transport_recv_data(
|
2019-01-16 11:32:58 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2019-01-08 16:13:37 +00:00
|
|
|
channel,
|
|
|
|
buffer.to_glib_full(),
|
|
|
|
))
|
|
|
|
};
|
|
|
|
ret.into_result()
|
|
|
|
}
|
|
|
|
}
|