mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
Add initialization for context and params (gchar *)
Insert define (DEFAULT_*) into help to have to modify only the constants
This commit is contained in:
parent
7b5dbb0561
commit
c1ca88cd34
1 changed files with 11 additions and 7 deletions
|
@ -634,24 +634,27 @@ int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
GOptionContext *optctx;
|
GOptionContext *optctx;
|
||||||
Context ctx;
|
Context ctx = { 0, };
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
gint ret = 1;
|
gint ret = 1;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
const gchar *range;
|
const gchar *range = NULL;
|
||||||
const gchar *frames;
|
const gchar *frames = NULL;
|
||||||
const gchar *rate_control;
|
const gchar *rate_control = NULL;
|
||||||
|
gchar *default_speed =
|
||||||
|
g_strdup_printf ("Speed to request (default: %.1f)", DEFAULT_SPEED);
|
||||||
SeekParameters seek_params =
|
SeekParameters seek_params =
|
||||||
{ NULL, DEFAULT_SPEED, NULL, NULL, DEFAULT_REVERSE };
|
{ NULL, DEFAULT_SPEED, NULL, NULL, DEFAULT_REVERSE };
|
||||||
GOptionEntry entries[] = {
|
GOptionEntry entries[] = {
|
||||||
{"range", 0, 0, G_OPTION_ARG_STRING, &range,
|
{"range", 0, 0, G_OPTION_ARG_STRING, &range,
|
||||||
"Range to seek (default: " DEFAULT_RANGE ")", "RANGE"},
|
"Range to seek (default: " DEFAULT_RANGE ")", "RANGE"},
|
||||||
{"speed", 0, 0, G_OPTION_ARG_DOUBLE, &seek_params.speed,
|
{"speed", 0, 0, G_OPTION_ARG_DOUBLE, &seek_params.speed,
|
||||||
"Speed to request (default: 1.0)", "SPEED"},
|
default_speed, "SPEED"},
|
||||||
{"frames", 0, 0, G_OPTION_ARG_STRING, &frames,
|
{"frames", 0, 0, G_OPTION_ARG_STRING, &frames,
|
||||||
"Frames to request (default: none)", "FRAMES"},
|
"Frames to request (default: " DEFAULT_FRAMES ")", "FRAMES"},
|
||||||
{"rate-control", 0, 0, G_OPTION_ARG_STRING, &rate_control,
|
{"rate-control", 0, 0, G_OPTION_ARG_STRING, &rate_control,
|
||||||
"Apply rate control on the client side (default: yes)", "RATE_CONTROL"},
|
"Apply rate control on the client side (default: "
|
||||||
|
DEFAULT_RATE_CONTROL ")", "RATE_CONTROL"},
|
||||||
{"reverse", 0, 0, G_OPTION_ARG_NONE, &seek_params.reverse,
|
{"reverse", 0, 0, G_OPTION_ARG_NONE, &seek_params.reverse,
|
||||||
"Playback direction", ""},
|
"Playback direction", ""},
|
||||||
{NULL}
|
{NULL}
|
||||||
|
@ -721,5 +724,6 @@ done:
|
||||||
g_free (seek_params.range);
|
g_free (seek_params.range);
|
||||||
g_free (seek_params.frames);
|
g_free (seek_params.frames);
|
||||||
g_free (seek_params.rate_control);
|
g_free (seek_params.rate_control);
|
||||||
|
g_free (default_speed);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue