Kaydet (Commit) 78e3c945 authored tarafından Radek Doulik's avatar Radek Doulik

patches/gstreamer/gstreamer-avmedia.diff: gstreamer integration, avmedia part

üst 3f95b622
...@@ -8,4 +8,5 @@ av avmedia\source\win nmake - all av_win NULL ...@@ -8,4 +8,5 @@ av avmedia\source\win nmake - all av_win NULL
av avmedia\source\java nmake - all av_java NULL av avmedia\source\java nmake - all av_java NULL
av avmedia\source\xine nmake - all av_xine NULL av avmedia\source\xine nmake - all av_xine NULL
av avmedia\source\quicktime nmake - all av_quicktime NULL av avmedia\source\quicktime nmake - all av_quicktime NULL
av avmedia\util nmake - all av_util av_viewer av_framework av_win av_java av_quicktime av_xine NULL av avmedia\source\gstreamer nmake - all av_gstreamer NULL
av avmedia\util nmake - all av_util av_viewer av_framework av_win av_java av_quicktime av_xine av_gstreamer NULL
...@@ -29,6 +29,9 @@ class ResMgr; ...@@ -29,6 +29,9 @@ class ResMgr;
#define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() ) #define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() )
#ifdef GSTREAMER
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_GStreamer"
#else
#ifdef WNT #ifdef WNT
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_DirectX" #define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_DirectX"
#else #else
...@@ -38,6 +41,7 @@ class ResMgr; ...@@ -38,6 +41,7 @@ class ResMgr;
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_Java" #define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_Java"
#endif #endif
#endif #endif
#endif
namespace avmedia namespace avmedia
{ {
......
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <tools/time.hxx> #include <tools/time.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#ifdef UNX
#ifndef _SV_SYSDATA_HXX
#include <vcl/sysdata.hxx>
#endif
#endif
#ifndef _COM_SUN_STAR_AWT_SYSTEMPOINTER_HDL_ #ifndef _COM_SUN_STAR_AWT_SYSTEMPOINTER_HDL_
#include <com/sun/star/awt/SystemPointer.hdl> #include <com/sun/star/awt/SystemPointer.hdl>
...@@ -94,7 +99,11 @@ void MediaWindowControl::execute( const MediaItem& rItem ) ...@@ -94,7 +99,11 @@ void MediaWindowControl::execute( const MediaItem& rItem )
// -------------------- // --------------------
MediaChildWindow::MediaChildWindow( Window* pParent ) : MediaChildWindow::MediaChildWindow( Window* pParent ) :
#ifdef GSTREAMER
SystemChildWindow( pParent, WB_CLIPCHILDREN )
#else
JavaChildWindow( pParent, WB_CLIPCHILDREN ) JavaChildWindow( pParent, WB_CLIPCHILDREN )
#endif
{ {
} }
...@@ -111,7 +120,11 @@ void MediaChildWindow::MouseMove( const MouseEvent& rMEvt ) ...@@ -111,7 +120,11 @@ void MediaChildWindow::MouseMove( const MouseEvent& rMEvt )
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
#ifdef GSTREAMER
SystemChildWindow::MouseMove( rMEvt );
#else
JavaChildWindow::MouseMove( rMEvt ); JavaChildWindow::MouseMove( rMEvt );
#endif
GetParent()->MouseMove( aTransformedEvent ); GetParent()->MouseMove( aTransformedEvent );
} }
...@@ -122,7 +135,11 @@ void MediaChildWindow::MouseButtonDown( const MouseEvent& rMEvt ) ...@@ -122,7 +135,11 @@ void MediaChildWindow::MouseButtonDown( const MouseEvent& rMEvt )
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
#ifdef GSTREAMER
SystemChildWindow::MouseButtonDown( rMEvt );
#else
JavaChildWindow::MouseButtonDown( rMEvt ); JavaChildWindow::MouseButtonDown( rMEvt );
#endif
GetParent()->MouseButtonDown( aTransformedEvent ); GetParent()->MouseButtonDown( aTransformedEvent );
} }
...@@ -133,7 +150,11 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt ) ...@@ -133,7 +150,11 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt )
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
#ifdef GSTREAMER
SystemChildWindow::MouseButtonUp( rMEvt );
#else
JavaChildWindow::MouseButtonUp( rMEvt ); JavaChildWindow::MouseButtonUp( rMEvt );
#endif
GetParent()->MouseButtonUp( aTransformedEvent ); GetParent()->MouseButtonUp( aTransformedEvent );
} }
...@@ -141,7 +162,11 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt ) ...@@ -141,7 +162,11 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt )
void MediaChildWindow::KeyInput( const KeyEvent& rKEvt ) void MediaChildWindow::KeyInput( const KeyEvent& rKEvt )
{ {
#ifdef GSTREAMER
SystemChildWindow::KeyInput( rKEvt );
#else
JavaChildWindow::KeyInput( rKEvt ); JavaChildWindow::KeyInput( rKEvt );
#endif
GetParent()->KeyInput( rKEvt ); GetParent()->KeyInput( rKEvt );
} }
...@@ -149,7 +174,11 @@ void MediaChildWindow::KeyInput( const KeyEvent& rKEvt ) ...@@ -149,7 +174,11 @@ void MediaChildWindow::KeyInput( const KeyEvent& rKEvt )
void MediaChildWindow::KeyUp( const KeyEvent& rKEvt ) void MediaChildWindow::KeyUp( const KeyEvent& rKEvt )
{ {
#ifdef GSTREAMER
SystemChildWindow::KeyUp( rKEvt );
#else
JavaChildWindow::KeyUp( rKEvt ); JavaChildWindow::KeyUp( rKEvt );
#endif
GetParent()->KeyUp( rKEvt ); GetParent()->KeyUp( rKEvt );
} }
...@@ -160,7 +189,11 @@ void MediaChildWindow::Command( const CommandEvent& rCEvt ) ...@@ -160,7 +189,11 @@ void MediaChildWindow::Command( const CommandEvent& rCEvt )
const CommandEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ), const CommandEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ),
rCEvt.GetCommand(), rCEvt.IsMouseEvent(), rCEvt.GetData() ); rCEvt.GetCommand(), rCEvt.IsMouseEvent(), rCEvt.GetData() );
#ifdef GSTREAMER
SystemChildWindow::Command( rCEvt );
#else
JavaChildWindow::Command( rCEvt ); JavaChildWindow::Command( rCEvt );
#endif
GetParent()->Command( aTransformedEvent ); GetParent()->Command( aTransformedEvent );
} }
...@@ -229,18 +262,31 @@ void MediaWindowImpl::onURLChanged() ...@@ -229,18 +262,31 @@ void MediaWindowImpl::onURLChanged()
{ {
if( getPlayer().is() ) if( getPlayer().is() )
{ {
uno::Sequence< uno::Any > aArgs( 2 ); uno::Sequence< uno::Any > aArgs( 3 );
uno::Reference< media::XPlayerWindow > xPlayerWindow; uno::Reference< media::XPlayerWindow > xPlayerWindow;
const Point aPoint; const Point aPoint;
const Size aSize( maChildWindow.GetSizePixel() ); const Size aSize( maChildWindow.GetSizePixel() );
#ifndef GSTREAMER
const sal_IntPtr nWndHandle = static_cast< sal_IntPtr >( maChildWindow.getParentWindowHandleForJava() ); const sal_IntPtr nWndHandle = static_cast< sal_IntPtr >( maChildWindow.getParentWindowHandleForJava() );
#else
const sal_Int32 nWndHandle = 0;
#endif
aArgs[ 0 ] = uno::makeAny( nWndHandle ); aArgs[ 0 ] = uno::makeAny( nWndHandle );
aArgs[ 1 ] = uno::makeAny( awt::Rectangle( aPoint.X(), aPoint.Y(), aSize.Width(), aSize.Height() ) ); aArgs[ 1 ] = uno::makeAny( awt::Rectangle( aPoint.X(), aPoint.Y(), aSize.Width(), aSize.Height() ) );
#ifdef GSTREAMER
const SystemEnvData *pSystemData = maChildWindow.GetSystemData();
OSL_TRACE( "MediaWindowImpl::onURLChanged xwindow id: %ld", pSystemData->aWindow );
aArgs[ 2 ] = uno::makeAny( pSystemData->aWindow );
#endif
try try
{ {
#ifdef GSTREAMER
if( pSystemData->aWindow != 0 )
#else
if( nWndHandle != 0 ) if( nWndHandle != 0 )
#endif
xPlayerWindow = getPlayer()->createPlayerWindow( aArgs ); xPlayerWindow = getPlayer()->createPlayerWindow( aArgs );
} }
catch( uno::RuntimeException ) catch( uno::RuntimeException )
......
...@@ -29,7 +29,11 @@ ...@@ -29,7 +29,11 @@
#define _AVMEDIA_MEDIAWINDOW_IMPL_HXX #define _AVMEDIA_MEDIAWINDOW_IMPL_HXX
#include <svtools/transfer.hxx> #include <svtools/transfer.hxx>
#ifdef GSTREAMER
#include <vcl/syschild.hxx>
#else
#include <vcl/javachild.hxx> #include <vcl/javachild.hxx>
#endif
#include "mediawindowbase_impl.hxx" #include "mediawindowbase_impl.hxx"
#include "mediacontrol.hxx" #include "mediacontrol.hxx"
...@@ -61,7 +65,11 @@ namespace avmedia ...@@ -61,7 +65,11 @@ namespace avmedia
// - MediaChildWindow - // - MediaChildWindow -
// -------------------- // --------------------
#ifdef GSTREAMER
class MediaChildWindow : public SystemChildWindow
#else
class MediaChildWindow : public JavaChildWindow class MediaChildWindow : public JavaChildWindow
#endif
{ {
public: public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment