mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-27 09:28:14 +00:00
30 lines
838 B
Rust
30 lines
838 B
Rust
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
use crate::RTSPStreamTransport;
|
|
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 {
|
|
from_glib(ffi::gst_rtsp_stream_transport_recv_data(
|
|
self.as_ref().to_glib_none().0,
|
|
channel,
|
|
buffer.to_glib_full(),
|
|
))
|
|
};
|
|
ret.into_result()
|
|
}
|
|
}
|