There is an issue with the function 'gstc_pipeline_bus_wait', after 32768 iterations on this function the GstD client seems to be blocked.
This issue also happens on i.MX6 but the issue happens at the iteration 251.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "libgstc.h"
int
main ()
{
GstClient *client;
GstcStatus ret;
const char *address = "127.0.0.1";
const unsigned int port = 5000;
const long wait_time = -1;
const int keep_open = 1;
ret = gstc_client_new (address, port, wait_time, keep_open, &client);
if (GSTC_OK != ret) {
fprintf (stderr, "There was a problem creating a GstClient: %d\n", ret);
goto out;
}
ret = gstc_client_ping (client);
if (GSTC_OK == ret) {
printf ("GStreamer daemon is alive!\n");
} else {
fprintf (stderr, "Unable to contact server: %d\n", ret);
goto free_client;
}
ret = gstc_pipeline_create (client, "pipe", "videotestsrc is-live=true ! fakesink");
if (GSTC_OK == ret) {
printf ("Pipeline created successfully!\n");
} else {
fprintf (stderr, "Error creating pipeline: %d\n", ret);
goto free_client;
}
ret = gstc_pipeline_play (client, "pipe");
if (GSTC_OK == ret) {
printf ("Pipeline set to playing!\n");
} else {
fprintf (stderr, "Unable to play pipeline: %d\n", ret);
goto free_client;
}
int iteration = 0;
while (1) {
printf("ITERATION #%d \n", iteration);
char *eos;
ret = gstc_pipeline_bus_wait (client, "pipe", "eos", 100000, &eos);
//printf("RETURN value: %d \n", ret);
iteration = iteration + 1;
}
ret = gstc_pipeline_stop (client, "pipe");
if (GSTC_OK == ret) {
printf ("Pipeline set to null!\n");
} else {
fprintf (stderr, "Unable to stop pipeline: %d\n", ret);
goto free_client;
}
ret = gstc_pipeline_delete (client, "pipe");
if (GSTC_OK == ret) {
printf ("Pipeline deleted!\n");
} else {
fprintf (stderr, "Unable to delete pieline: %d\n", ret);
goto free_client;
}
free_client:
gstc_client_free (client);
out:
return ret;
}
Regards.