[longomatch] Emit a par changed event for each one of the visible streams
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Emit a par changed event for each one of the visible streams
- Date: Tue, 31 Mar 2015 17:32:39 +0000 (UTC)
commit 36e425a9d0433b5549df57bc91b7864e05b25360
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Tue Mar 24 11:57:18 2015 +0100
Emit a par changed event for each one of the visible streams
LongoMatch.Core/Interfaces/IPlayerController.cs | 9 ++++++
LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs | 2 -
LongoMatch.Services/Services/PlayerController.cs | 30 ++++++++++++---------
3 files changed, 26 insertions(+), 15 deletions(-)
---
diff --git a/LongoMatch.Core/Interfaces/IPlayerController.cs b/LongoMatch.Core/Interfaces/IPlayerController.cs
index 2e43171..8ddfb66 100644
--- a/LongoMatch.Core/Interfaces/IPlayerController.cs
+++ b/LongoMatch.Core/Interfaces/IPlayerController.cs
@@ -81,6 +81,11 @@ namespace LongoMatch.Core.Interfaces
List<int> CamerasVisible { get; set; }
/// <summary>
+ /// List of window handles set by the view as view ports.
+ /// </summary>
+ List<IntPtr> WindowHandles { set; }
+
+ /// <summary>
/// Open the specified fileSet.
/// </summary>
void Open (MediaFileSet fileSet);
@@ -159,6 +164,10 @@ namespace LongoMatch.Core.Interfaces
/// </summary>
void Previous ();
+ /// <summary>
+ /// The view should call it when it's ready to start playback,
+ /// once it has set a valid window handle to start rendering.
+ /// </summary>
void Ready ();
}
}
\ No newline at end of file
diff --git a/LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs
b/LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs
index 45abab1..6d83102 100644
--- a/LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs
+++ b/LongoMatch.Core/Interfaces/Multimedia/IPlayer.cs
@@ -50,8 +50,6 @@ namespace LongoMatch.Core.Interfaces.Multimedia
double Rate { set; }
- List<IntPtr> WindowHandles { set; }
-
IntPtr WindowHandle { set; }
void Play ();
diff --git a/LongoMatch.Services/Services/PlayerController.cs
b/LongoMatch.Services/Services/PlayerController.cs
index 300a60a..a204e1f 100644
--- a/LongoMatch.Services/Services/PlayerController.cs
+++ b/LongoMatch.Services/Services/PlayerController.cs
@@ -51,12 +51,10 @@ namespace LongoMatch.Services
Time streamLenght, videoTS, imageLoadedTS;
bool readyToSeek, stillimageLoaded, ready, delayedOpen;
double rate;
- MediaFile activeFile;
Seeker seeker;
Segment loadedSegment;
object[] pendingSeek;
Timer timer;
- IntPtr windowHandle;
struct Segment
{
@@ -101,18 +99,17 @@ namespace LongoMatch.Services
}
public List<IntPtr> WindowHandles {
- set {
- throw new NotImplementedException ();
- }
+ set;
+ protected get;
}
public IntPtr WindowHandle {
set {
- windowHandle = value;
+ WindowHandles = new List<IntPtr> { value };
player.WindowHandle = value;
}
get {
- return windowHandle;
+ return WindowHandles [0];
}
}
@@ -607,14 +604,21 @@ namespace LongoMatch.Services
if (fileSet != this.FileSet || force) {
readyToSeek = false;
FileSet = fileSet;
- activeFile = fileSet.First ();
- if (activeFile.VideoHeight != 0) {
- EmitPARChanged (WindowHandle, (float)(activeFile.VideoWidth *
activeFile.Par / activeFile.VideoHeight));
- } else {
- EmitPARChanged (WindowHandle, 1);
+ foreach (int index in CamerasVisible) {
+ try {
+ MediaFile file = fileSet [index];
+ IntPtr windowHandle = WindowHandles [index];
+ if (file.VideoHeight != 0) {
+ EmitPARChanged (windowHandle, (float)(file.VideoWidth
* file.Par / file.VideoHeight));
+ } else {
+ EmitPARChanged (windowHandle, 1);
+ }
+ } catch (Exception ex) {
+ Log.Exception (ex);
+ }
}
try {
- Log.Debug ("Opening new file " + activeFile.FilePath);
+ Log.Debug ("Opening new file set " + fileSet);
player.Open (fileSet);
} catch (Exception ex) {
Log.Exception (ex);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]