[longomatch] Fix drawings with hardarware decoders



commit f31f72d575d28d2bc2de4769e03c660a25b09c2e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Sep 10 06:39:59 2014 +0200

    Fix drawings with hardarware decoders

 LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs       |    2 ++
 LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs         |   17 +++++++++++++----
 LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs |   10 ++++++++++
 LongoMatch.Services/Services/EventsManager.cs      |    1 +
 4 files changed, 26 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs b/LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs
index c89486e..0205389 100644
--- a/LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs
+++ b/LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs
@@ -20,6 +20,7 @@ using LongoMatch.Core.Common;
 using LongoMatch.Core.Handlers;
 using LongoMatch.Core.Store;
 using LongoMatch.Core.Store.Playlists;
+using LongoMatch.Core.Interfaces.Multimedia;
 
 namespace LongoMatch.Core.Interfaces.GUI
 {
@@ -34,6 +35,7 @@ namespace LongoMatch.Core.Interfaces.GUI
                bool Opened {get;}
                bool SeekingEnabled {set;}
                bool Sensitive {set; get;}
+               IFramesCapturer FramesCapturer {get;set;}
 
                void Open (MediaFile file);
                void Close();
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
index 144b195..55b44c4 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
@@ -141,6 +141,11 @@ namespace LongoMatch.Gui
                        }
                }
 
+               public IFramesCapturer FramesCapturer {
+                       get;
+                       set;
+               }
+               
                public Image CurrentMiniatureFrame {
                        get {
                                return player.GetCurrentFrame (THUMBNAIL_MAX_WIDTH, THUMBNAIL_MAX_WIDTH);
@@ -452,10 +457,14 @@ namespace LongoMatch.Gui
                void LoadPlayDrawing (FrameDrawing drawing)
                {
                        Pause ();
-                       ignoreTick = true;
-                       player.Seek (drawing.Render, true);
-                       ignoreTick = false;
-                       LoadImage (player.GetCurrentFrame (), drawing);
+                       if (FramesCapturer != null) {
+                               LoadImage (FramesCapturer.GetFrame (drawing.Render, true), drawing);
+                       } else {
+                               ignoreTick = true;
+                               player.Seek (drawing.Render, true);
+                               ignoreTick = false;
+                               LoadImage (player.GetCurrentFrame (), drawing);
+                       }
                }
 
                void SetScaleValue (int value)
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs 
b/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
index 48e525b..d0113da 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
@@ -24,6 +24,7 @@ using LongoMatch.Core.Store;
 using System.Collections.Generic;
 using LongoMatch.Core.Interfaces;
 using LongoMatch.Core.Store.Playlists;
+using LongoMatch.Core.Interfaces.Multimedia;
 
 namespace LongoMatch.Gui
 {
@@ -160,6 +161,15 @@ namespace LongoMatch.Gui
                
 #region Player
 
+               public IFramesCapturer FramesCapturer {
+                       set {
+                               playerbin.FramesCapturer = value;
+                       }
+                       get {
+                               return playerbin.FramesCapturer;
+                       }
+               }
+               
                public bool SeekingEnabled {
                        set {
                                playerbin.SeekingEnabled = value;
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index d364a27..ac8c03c 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -73,6 +73,7 @@ namespace LongoMatch.Services
                        }
                        this.analysisWindow = analysisWindow;
                        player = analysisWindow.Player;
+                       player.FramesCapturer = framesCapturer;
                        capturer = analysisWindow.Capturer;
                }
 


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