test: fix for new-sample signature
The new-sample signal expects a GstFlowReturn as a result. Add support for external subtitles as well.
This commit is contained in:
parent
6973a66813
commit
65b06e18ac
@ -83,7 +83,7 @@ bus_message (GstBus * bus, GstMessage * message, App * app)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static GstFlowReturn
|
||||||
have_subtitle (GstElement * appsink, App * app)
|
have_subtitle (GstElement * appsink, App * app)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
@ -117,6 +117,7 @@ have_subtitle (GstElement * appsink, App * app)
|
|||||||
gst_buffer_unmap (buffer, &map);
|
gst_buffer_unmap (buffer, &map);
|
||||||
gst_sample_unref (sample);
|
gst_sample_unref (sample);
|
||||||
}
|
}
|
||||||
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -129,7 +130,7 @@ main (int argc, char *argv[])
|
|||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
g_print ("usage: %s <filename>\n", argv[0]);
|
g_print ("usage: %s <uri> [<suburi>]\n", argv[0]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,6 +160,9 @@ main (int argc, char *argv[])
|
|||||||
/* set to read from appsrc */
|
/* set to read from appsrc */
|
||||||
g_object_set (app->playbin, "uri", argv[1], NULL);
|
g_object_set (app->playbin, "uri", argv[1], NULL);
|
||||||
|
|
||||||
|
if (argc > 2)
|
||||||
|
g_object_set (app->playbin, "suburi", argv[2], NULL);
|
||||||
|
|
||||||
/* go to playing and wait in a mainloop. */
|
/* go to playing and wait in a mainloop. */
|
||||||
gst_element_set_state (app->playbin, GST_STATE_PLAYING);
|
gst_element_set_state (app->playbin, GST_STATE_PLAYING);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user