[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - slideshow/source

Zolnai Tamás tamas.zolnai at collabora.com
Wed Apr 16 05:22:47 PDT 2014


 slideshow/source/engine/shapes/viewmediashape.cxx |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 5dfb92d506e1aed643dcc84a219882edeac1a9a7
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Fri Apr 11 16:33:55 2014 +0200

    fdo#72400: slideshow: display a snapshot of movie until its not started
    
    Change-Id: Ibd81f2aada458dd7437053b59882d3200f78747e
    (cherry picked from commit 539017f1d96b0ca2c062ed7ffd2f48166f831493)
    Reviewed-on: https://gerrit.libreoffice.org/8949
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx
index 004dce8..8f66d95 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -31,6 +31,7 @@
 #include <vcl/canvastools.hxx>
 #include <vcl/syschild.hxx>
 #include <vcl/window.hxx>
+#include <vcl/graph.hxx>
 
 #include <basegfx/tools/canvastools.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -186,14 +187,16 @@ namespace slideshow
 
             if( !mpMediaWindow.get() && !mxPlayerWindow.is() )
             {
-                // draw placeholder for no-video (no window) case
-                // no window and player == audio icon
-                // no window and no player == broken icon
-                BitmapEx aAudioLogo(mxPlayer.is() ?
-                    avmedia::MediaWindow::getAudioLogo() : avmedia::MediaWindow::getEmptyLogo() );
+                OUString sURL;
+                uno::Reference< beans::XPropertySet > xPropSet( mxShape, uno::UNO_QUERY );
+                if (xPropSet.is())
+                    xPropSet->getPropertyValue("PrivateTempFileURL") >>= sURL;
+
+                const Graphic aGraphic(avmedia::MediaWindow::grabFrame(sURL,"", true));
+                const BitmapEx aBmp = aGraphic.GetBitmapEx();
 
                 uno::Reference< rendering::XBitmap > xBitmap(vcl::unotools::xBitmapFromBitmapEx(
-                    pCanvas->getUNOCanvas()->getDevice(), aAudioLogo));
+                    pCanvas->getUNOCanvas()->getDevice(), aBmp));
 
                 rendering::ViewState aViewState;
                 aViewState.AffineTransform = pCanvas->getViewState().AffineTransform;
@@ -201,7 +204,7 @@ namespace slideshow
                 rendering::RenderState aRenderState;
                 ::canvas::tools::initRenderState( aRenderState );
 
-                const ::Size aBmpSize( aAudioLogo.GetSizePixel() );
+                const ::Size aBmpSize( aBmp.GetSizePixel() );
 
                 const ::basegfx::B2DVector aScale( rBounds.getWidth() / aBmpSize.Width(),
                                                    rBounds.getHeight() / aBmpSize.Height() );


More information about the Libreoffice-commits mailing list