hlssink2 get-fragment-stream callback does not work if I call with after flag set to true
Gstreamer version: 1.20.5
I have a rust pipeline that needs to know when a ts segment is written so that we can do some additional processing. I setup a signal callback for the "get-fragment-stream" and set the after value boolean to true so that I get notified after the default callback is called.
But if I set the after to true, I dont get notified at all after the file segments are written. It works if I set the flag to false that is before calling the default implementation.
The following is a code snippet of how it is implemented. I tried both the "connect" and "connect_closure" and it is the same result.
vod_sink.connect_closure(
"get-fragment-stream",
true, // after
glib::closure!(
move |_elem: &Element, filename: &str| -> FileOutputStream {
//TODO: use the file name to probe the file
let file = File::for_path(filename);
log::info!("vod-sink connect_closure callback filename={}", filename);
match fs::metadata(&filename) {
Ok(info) => log::info!("found the file in the path created={:?}", info.created()),
Err(e) => log::error!("The file is not yet created={}", filename),
}
file.replace(None, false, FileCreateFlags::NONE, Cancellable::NONE).unwrap()
}),
);