summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-04-28 16:32:33 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-04-28 17:26:35 +0200
commit1736e5d91c76a824ffcb052c5e769444d3a0ed5e (patch)
treee7e89f3e6bc816bfe3e150e2e4d367ebb033fbfd /slideshow
parent0a1746e942224851b584f5902d7b1e0ca496fdab (diff)
Slideshow: display OpenGL window also during slideshow
Use vcl based player window initialization. Change-Id: If5c2198fa891e1d3ad218c8b7e1495161c0d6c25
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/Library_slideshow.mk9
-rw-r--r--slideshow/source/engine/shapes/viewmediashape.cxx37
-rw-r--r--slideshow/source/engine/shapes/viewmediashape.hxx5
3 files changed, 35 insertions, 16 deletions
diff --git a/slideshow/Library_slideshow.mk b/slideshow/Library_slideshow.mk
index ccd3e9964a9d..d5af9a160c2a 100644
--- a/slideshow/Library_slideshow.mk
+++ b/slideshow/Library_slideshow.mk
@@ -27,7 +27,11 @@ endif
$(eval $(call gb_Library_set_precompiled_header,slideshow,$(SRCDIR)/slideshow/inc/pch/precompiled_slideshow))
-$(eval $(call gb_Library_use_external,slideshow,boost_headers))
+$(eval $(call gb_Library_use_externals,slideshow,\
+ boost_headers \
+ glew \
+ mesa_headers \
+))
$(eval $(call gb_Library_use_sdk_api,slideshow))
@@ -44,7 +48,8 @@ $(eval $(call gb_Library_use_libraries,slideshow,\
tl \
utl \
vcl \
- $(gb_UWINAPI) \
+ vclopengl \
+ $(gb_UWINAPI) \
))
$(eval $(call gb_Library_set_componentfile,slideshow,slideshow/util/slideshow))
diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx
index 22fa24e4523b..bbf1703de43a 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -30,6 +30,7 @@
#include <vcl/canvastools.hxx>
#include <vcl/syschild.hxx>
+#include <vcl/sysdata.hxx>
#include <vcl/window.hxx>
#include <vcl/graph.hxx>
@@ -45,6 +46,9 @@
#include <cppcanvas/vclfactory.hxx>
#include <cppcanvas/basegfxfactory.hxx>
#include <avmedia/mediawindow.hxx>
+#include <avmedia/modeltools.hxx>
+
+#include <vcl/opengl/OpenGLContext.hxx>
#include <com/sun/star/media/XManager.hpp>
#include <com/sun/star/media/XPlayer.hpp>
@@ -302,25 +306,26 @@ namespace slideshow
if( xCanvas.is() )
{
uno::Reference< beans::XPropertySet > xPropSet;
- OUString aURL;
-
try
{
xPropSet.set( mxShape, uno::UNO_QUERY );
+ OUString sMimeType;
// create Player
if (xPropSet.is())
{
+ OUString aURL;
+ xPropSet->getPropertyValue("MediaMimeType") >>= sMimeType;
if ((xPropSet->getPropertyValue(
OUString( "PrivateTempFileURL")) >>= aURL)
&& !aURL.isEmpty())
{
- implInitializeMediaPlayer( aURL );
+ implInitializeMediaPlayer( aURL, sMimeType );
}
else if (xPropSet->getPropertyValue(
OUString( "MediaURL")) >>= aURL)
{
- implInitializeMediaPlayer( aURL );
+ implInitializeMediaPlayer( aURL, sMimeType );
}
}
@@ -334,9 +339,10 @@ namespace slideshow
aDeviceParams[ 0 ] >>= aImplName;
if( aImplName.endsWithIgnoreAsciiCase( "VCL" ) ||
- aImplName.endsWithIgnoreAsciiCase( "Cairo" ) )
+ aImplName.endsWithIgnoreAsciiCase( "Cairo" ) ||
+ avmedia::IsModel(sMimeType))
{
- implInitializeVCLBasedPlayerWindow( rBounds, aDeviceParams );
+ implInitializeVCLBasedPlayerWindow( rBounds, aDeviceParams, sMimeType );
}
else if( aImplName.endsWithIgnoreAsciiCase("DX") ||
aImplName.endsWithIgnoreAsciiCase("DX9") )
@@ -406,7 +412,7 @@ namespace slideshow
- void ViewMediaShape::implInitializeMediaPlayer( const OUString& rMediaURL )
+ void ViewMediaShape::implInitializeMediaPlayer( const OUString& rMediaURL, const OUString& rMimeType )
{
#if !HAVE_FEATURE_AVMEDIA
(void) rMediaURL;
@@ -417,7 +423,7 @@ namespace slideshow
{
if( !rMediaURL.isEmpty() )
{
- mxPlayer.set( avmedia::MediaWindow::createPlayer( rMediaURL, ""/*TODO!*/ ),
+ mxPlayer.set( avmedia::MediaWindow::createPlayer( rMediaURL, ""/*TODO!*/, &rMimeType ),
uno::UNO_QUERY );
}
}
@@ -438,7 +444,8 @@ namespace slideshow
bool ViewMediaShape::implInitializeVCLBasedPlayerWindow( const ::basegfx::B2DRectangle& rBounds,
- const uno::Sequence< uno::Any >& rVCLDeviceParams)
+ const uno::Sequence< uno::Any >& rVCLDeviceParams,
+ const OUString& rMimeType )
{
OSL_TRACE( "ViewMediaShape::implInitializeVCLBasedPlayerWindow" );
if( !mpMediaWindow.get() && !rBounds.isEmpty() )
@@ -467,9 +474,15 @@ namespace slideshow
rRangePix.getMinY(),
rRangePix.getMaxX() - rRangePix.getMinX(),
rRangePix.getMaxY() - rRangePix.getMinY() );
-
- mpMediaWindow.reset( new
- SystemChildWindow( pWindow, WB_CLIPCHILDREN ) );
+ if( avmedia::IsModel(rMimeType) )
+ {
+ SystemWindowData aWinData = OpenGLContext::generateWinData(pWindow);
+ mpMediaWindow.reset(new SystemChildWindow(pWindow, 0, &aWinData));
+ }
+ else
+ {
+ mpMediaWindow.reset( new SystemChildWindow( pWindow, WB_CLIPCHILDREN ) );
+ }
mpMediaWindow->SetBackground( Color( COL_BLACK ) );
mpMediaWindow->SetPosSizePixel( Point( aAWTRect.X, aAWTRect.Y ),
Size( aAWTRect.Width, aAWTRect.Height ) );
diff --git a/slideshow/source/engine/shapes/viewmediashape.hxx b/slideshow/source/engine/shapes/viewmediashape.hxx
index d149ec17aba3..4a373445aac9 100644
--- a/slideshow/source/engine/shapes/viewmediashape.hxx
+++ b/slideshow/source/engine/shapes/viewmediashape.hxx
@@ -140,9 +140,10 @@ namespace slideshow
bool implInitialize( const ::basegfx::B2DRectangle& rBounds );
void implSetMediaProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rxProps );
- void implInitializeMediaPlayer( const OUString& rMediaURL );
+ void implInitializeMediaPlayer( const OUString& rMediaURL, const OUString& rMimeType );
bool implInitializeVCLBasedPlayerWindow( const ::basegfx::B2DRectangle& rBounds,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rVCLDeviceParams );
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rVCLDeviceParams,
+ const OUString& rMimeType );
bool implInitializeDXBasedPlayerWindow( const ::basegfx::B2DRectangle& rBounds,
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rDXDeviceParams );