[clutter-gst] player: Provide an option to start the player fullscreen
- From: Damien Lespiau <dlespiau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gst] player: Provide an option to start the player fullscreen
- Date: Wed, 31 Aug 2011 23:14:25 +0000 (UTC)
commit 93429994b2fafbf0142ef41d34148503e5774907
Author: Damien Lespiau <damien lespiau intel com>
Date: Thu Sep 1 00:14:08 2011 +0100
player: Provide an option to start the player fullscreen
examples/video-player.c | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/examples/video-player.c b/examples/video-player.c
index dd4d93f..de8108b 100644
--- a/examples/video-player.c
+++ b/examples/video-player.c
@@ -52,6 +52,20 @@ typedef struct _VideoApp
static void show_controls (VideoApp *app, gboolean vis);
+static gboolean opt_fullscreen = FALSE;
+
+static GOptionEntry options[] =
+{
+ { "fullscreen",
+ 'f', 0,
+ G_OPTION_ARG_NONE,
+ &opt_fullscreen,
+ "Start the player in fullscreen",
+ NULL },
+
+ { NULL }
+};
+
static gboolean
controls_timeout_cb (gpointer data)
{
@@ -305,8 +319,21 @@ main (int argc, char *argv[])
ClutterColor stage_color = { 0x00, 0x00, 0x00, 0x00 };
ClutterColor control_color1 = { 73, 74, 77, 0xee };
ClutterColor control_color2 = { 0xcc, 0xcc, 0xcc, 0xff };
+ GError *error = NULL;
- clutter_gst_init (&argc, &argv);
+ clutter_gst_init_with_args (&argc,
+ &argv,
+ " - A simple video player",
+ options,
+ NULL,
+ &error);
+
+ if (error)
+ {
+ g_print ("%s\n", error->message);
+ g_error_free (error);
+ return EXIT_FAILURE;
+ }
if (argc < 2)
{
@@ -318,6 +345,8 @@ main (int argc, char *argv[])
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
clutter_actor_set_size (stage, 768, 576);
clutter_stage_set_minimum_size (CLUTTER_STAGE (stage), 640, 480);
+ if (opt_fullscreen)
+ clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), TRUE);
app = g_new0(VideoApp, 1);
app->stage = stage;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]