2 * Copyright (C) 2008 Rov Juvano <rovjuvano@users.sourceforge.net>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "demo-player.h"
26 main (int argc
, char *argv
[])
29 gchar
*filter_name
= "identity";
31 const GOptionEntry entries
[] = {
32 { "filter", '\0', 0, G_OPTION_ARG_STRING
, &filter_name
,
34 { G_OPTION_REMAINING
, 0, 0, G_OPTION_ARG_FILENAME_ARRAY
, &uris
,
35 "Special option that collects any remaining arguments for us" },
39 if (!g_thread_supported())
42 GOptionContext
*ctx
= g_option_context_new ("[ --filter=<plugin> ] uri ...");
43 g_option_context_add_group (ctx
, gst_init_get_option_group ());
44 g_option_context_add_main_entries (ctx
, entries
, NULL
);
46 if (!g_option_context_parse (ctx
, &argc
, &argv
, &err
)) {
47 g_print ("Error initializing: %s\n", GST_STR_NULL (err
->message
));
51 g_option_context_free (ctx
);
53 if (uris
== NULL
|| *uris
== NULL
) {
54 g_print ("Please specify a URI to play\n\n");
58 DemoPlayer
*player
= g_object_new (DEMO_TYPE_PLAYER
, "filter", filter_name
, NULL
);
59 g_print ("Hello World!\nFilter = %s\n", player
->filter
);
61 gint i
, num
= g_strv_length (uris
);
62 for (i
= 0; i
< num
; i
++) {
63 demo_player_play_uri(player
, uris
[i
]);