[longomatch] Add multi-stream variants of Open and WindowHandle



commit 936ef1667878beb56bbb5efb9d02482025bb8bdf
Author: Jorge Zapata <jorgeluis zapata gmail com>
Date:   Fri Mar 20 12:20:35 2015 +0100

    Add multi-stream variants of Open and WindowHandle

 LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs |   17 ++++++++++++++---
 LongoMatch.Multimedia/Player/GstPlayer.cs        |   19 ++++++++++++++++---
 2 files changed, 30 insertions(+), 6 deletions(-)
---
diff --git a/LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs 
b/LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs
index 6aa80c5..a7cb7be 100644
--- a/LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs
+++ b/LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs
@@ -23,6 +23,15 @@ using LongoMatch.Core.Store;
 using LongoMatch.Core.Handlers;
 using Image = LongoMatch.Core.Common.Image;
 
+// FIXME In order to support multiple streams the current approach
+// is the simplest one. There is no stream selection, enabling, etc
+// just a modification on the functions that manage the player stream
+// to also receive a list for multiple streams:
+// Functions/Properties added/modified:
+// List<IntPtr> WindowHandles { set; }
+// bool Open (List<string> mrls);
+// Their simple cases are still there, we need to get rid of them later
+using System.Collections.Generic;
 
 namespace LongoMatch.Core.Interfaces.Multimedia
 {
@@ -39,11 +48,13 @@ namespace LongoMatch.Core.Interfaces.Multimedia
                double Volume {get;set;}
                bool Playing {get;}
                double Rate {set;}
-               IntPtr WindowHandle {set;}
 
+               List<IntPtr> WindowHandles { set; }
+               IntPtr WindowHandle { set; }
+
+               bool Open (List<string> mrls);
                bool Open (string mrl);
-               // EnableMediaFile(MediaFileSet files, List<IntPtr> windows);
-               // DisableMediaFile(MediaFileSet files);
+
                void Play();
                void Pause();
                void Stop();
diff --git a/LongoMatch.Multimedia/Player/GstPlayer.cs b/LongoMatch.Multimedia/Player/GstPlayer.cs
index a91a7e7..7550592 100644
--- a/LongoMatch.Multimedia/Player/GstPlayer.cs
+++ b/LongoMatch.Multimedia/Player/GstPlayer.cs
@@ -24,6 +24,7 @@ using LongoMatch.Video.Utils;
 using LongoMatch.Core.Store;
 using LongoMatch.Core.Common;
 using LongoMatch.Core.Handlers;
+using System.Collections.Generic;
 
 namespace LongoMatch.Video.Player
 {
@@ -392,6 +393,12 @@ namespace LongoMatch.Video.Player
                        }
                }
 
+               public List<IntPtr> WindowHandles {
+                       set {
+                               WindowHandle = value [0];
+                       }
+               }
+
                public Time CurrentTime {
                        get {
                                long ret = lgm_video_player_get_current_time (Handle);
@@ -467,9 +474,15 @@ namespace LongoMatch.Video.Player
                        lgm_video_player_close (Handle);
                }
 
-               public bool Open (string uri)
+               public bool Open (List<string> mrls)
                {
-                       IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
+                       return Open (mrls[0]);
+               }
+
+               public bool Open (string mrl)
+               {
+                       // FIXME this player only supports one stream
+                       IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (mrl);
                        IntPtr error = IntPtr.Zero;
                        bool ret = lgm_video_player_open (Handle, native_uri, out error);
                        GLib.Marshaller.Free (native_uri);
@@ -531,7 +544,7 @@ namespace LongoMatch.Video.Player
                public unsafe GstFramesCapturer () : base (PlayerUseType.Capture)
                {
                }
-               
+
                public Image GetFrame (Time pos, bool accurate, int outwidth=-1, int outheight=-1)
                {
                        Image img = null;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]