Move sink_render() to a more logical place

This commit is contained in:
Sebastian Dröge 2016-09-02 01:03:31 +03:00
parent eee2653b76
commit fa855ec2b2

View file

@ -143,28 +143,6 @@ pub unsafe extern "C" fn sink_get_uri(ptr: *const SinkWrapper) -> *mut c_char {
}
}
#[no_mangle]
pub unsafe extern "C" fn sink_render(ptr: *mut SinkWrapper,
data_ptr: *const u8,
data_len: usize)
-> GstFlowReturn {
let wrap: &mut SinkWrapper = &mut *ptr;
let sink = &mut wrap.sink.lock().unwrap();
let data = slice::from_raw_parts(data_ptr, data_len);
match sink.render(data) {
Ok(..) => GstFlowReturn::Ok,
Err(flow_error) => {
match flow_error {
FlowError::NotNegotiated(ref msg) |
FlowError::Error(ref msg) => msg.post(wrap.sink_raw),
_ => (),
}
flow_error.to_native()
}
}
}
#[no_mangle]
pub unsafe extern "C" fn sink_start(ptr: *mut SinkWrapper) -> GBoolean {
let wrap: &mut SinkWrapper = &mut *ptr;
@ -209,3 +187,25 @@ pub unsafe extern "C" fn sink_stop(ptr: *mut SinkWrapper) -> GBoolean {
}
}
}
#[no_mangle]
pub unsafe extern "C" fn sink_render(ptr: *mut SinkWrapper,
data_ptr: *const u8,
data_len: usize)
-> GstFlowReturn {
let wrap: &mut SinkWrapper = &mut *ptr;
let sink = &mut wrap.sink.lock().unwrap();
let data = slice::from_raw_parts(data_ptr, data_len);
match sink.render(data) {
Ok(..) => GstFlowReturn::Ok,
Err(flow_error) => {
match flow_error {
FlowError::NotNegotiated(ref msg) |
FlowError::Error(ref msg) => msg.post(wrap.sink_raw),
_ => (),
}
flow_error.to_native()
}
}
}