win32ipcvideosink: dangling named pipe
Describe your issue
win32ipcvideosink doesn't close a named pipe until I close an app using win32ipcvideosink.
Not very related broad context
I use GStreamer in Unreal Engine via this UE plug-in. I have two pipelines: one with win32ipcvideosink inside UE and another one with win32ipcvideosrc outside UE. When I start the UE's pipeline for the 1st time, the other pipeline works fine. After I restart the UE's pipeline, the other pipeline becomes unstable and I have to restart it many times to get it working. Restarting UE helps me.In order to localize the issue, I've modified basic tutorial 1 and confirmed that \\.\\pipe\\gst.win32.ipc.video
stays alive until this program closes.
Expected Behavior
win32ipcvideosink closes a named pipe when GST_STATE_PLAYING ⇒ GST_STATE_NULL.
Observed Behavior
win32ipcvideosink doesn't close a named pipe when GST_STATE_PLAYING ⇒ GST_STATE_NULL so it becomes dangling.
Setup
- Operating System: Windows 10
- GStreamer Version: 1.22.2
-
Command line:
videotestsrc ! videoconvert ! video/x-raw,format=(string)BGRx,width=1920,height=1080,framerate=60/1 ! win32ipcvideosink
inside an app
Steps to reproduce the bug
- Compile and run the following code.
#include <gst/gst.h>
#include <chrono>
#include <thread>
#include <iostream>
void sleep(int x)
{
std::this_thread::sleep_for(std::chrono::seconds(x));
}
int
main (int argc, char *argv[])
{
GstElement *pipeline;
/* Initialize GStreamer */
gst_init (&argc, &argv);
/* Build the pipeline */
pipeline =
gst_parse_launch
("videotestsrc ! videoconvert ! video/x-raw,format=(string)BGRx,width=1920,height=1080,framerate=60/1 ! win32ipcvideosink",
NULL);
/* Start playing */
gst_element_set_state (pipeline, GST_STATE_PLAYING);
sleep(5);
std::cout << "before gst_element_set_state" << std::endl;
gst_element_set_state (pipeline, GST_STATE_NULL);
sleep(3);
std::cout << "before gst_object_unref" << std::endl;
gst_object_unref (pipeline);
sleep(3);
std::cout << "before return" << std::endl;
sleep(3);
return 0;
}
- Check
[System.IO.Directory]::GetFiles("\\.\\pipe\\") | findstr -I -N gst
in PowerShell after each print-out.
How reproducible is the bug?
Always