[clutter-gst] Handle both uris and local files
- From: Sjoerd Simons <sjoerds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gst] Handle both uris and local files
- Date: Thu, 25 Jul 2013 11:13:38 +0000 (UTC)
commit 2a52c4789077512ce8ad5b7213a3771c92b44411
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date: Thu Jul 25 12:50:58 2013 +0200
Handle both uris and local files
Currently it's impossible to play a file from the internet with the
video-player example. Solve this by recognizing whether a filepath or a
uri was given and use the appropriate api depending on that.
https://bugzilla.gnome.org/show_bug.cgi?id=704854
examples/video-player.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/examples/video-player.c b/examples/video-player.c
index b3e1317..5b6e49e 100644
--- a/examples/video-player.c
+++ b/examples/video-player.c
@@ -424,6 +424,7 @@ int
main (int argc, char *argv[])
{
const gchar *uri;
+ gchar *scheme;
VideoApp *app = NULL;
GstElement *pipe;
GstElement *playsink;
@@ -521,7 +522,13 @@ main (int argc, char *argv[])
NULL);
/* Load up out video actor */
- clutter_gst_playback_set_filename (app->player, uri);
+ scheme = g_uri_parse_scheme (uri);
+ if (scheme != NULL)
+ clutter_gst_playback_set_uri (app->player, uri);
+ else
+ clutter_gst_playback_set_filename (app->player, uri);
+
+ g_free (scheme);
if (clutter_gst_playback_is_live_media (app->player))
g_print ("Playing live media\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]