glvideomixer: Starting and stopping the pipeline cause memory leak (macOS)
OS: macOS 10.15.2
Platform: iMac (21.5-inch, Late 2012)
GStreamer version: 1.16.2
When I stop and run the pipeline multiple times, each time the memory keeps increasing. The code is shown as below.
#include <stdio.h>
#include <unistd.h>
#include <gst/gst.h>
GstElement *pPipeline;
gboolean replay(gpointer user_data)
{
gst_element_set_state(pPipeline, GST_STATE_NULL);
gst_object_unref(pPipeline);
pPipeline = gst_parse_launch("videotestsrc is-live=true ! video/x-raw,width=720,height=480,framerate=30/1 ! glvideomixer ! fakesink", NULL);
gst_element_set_state(pPipeline, GST_STATE_PLAYING);
return TRUE;
}
int main()
{
gst_init(NULL, NULL);
GMainLoop *gloop = g_main_loop_new(0, FALSE);
pPipeline = gst_parse_launch("videotestsrc is-live=true ! video/x-raw,width=720,height=480,framerate=30/1 ! glvideomixer ! fakesink", NULL);
gst_element_set_state(pPipeline, GST_STATE_PLAYING);
g_timeout_add(3000, replay, NULL);
g_main_loop_run(gloop);
return 0;
}
If I replace glvideomixer by compositor, The memory usage is fine.
Linux platform does not have this problem.