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
av avmedia\source\java nmake - all av_java NULL
av avmedia\source\xine nmake - all av_xine 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;
#define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() )
#ifdef GSTREAMER
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_GStreamer"
#else
#ifdef WNT
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_DirectX"
#else
......@@ -38,6 +41,7 @@ class ResMgr;
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_Java"
#endif
#endif
#endif
namespace avmedia
{
......
......@@ -36,6 +36,11 @@
#include <osl/mutex.hxx>
#include <tools/time.hxx>
#include <vcl/svapp.hxx>
#ifdef UNX
#ifndef _SV_SYSDATA_HXX
#include <vcl/sysdata.hxx>
#endif
#endif
#ifndef _COM_SUN_STAR_AWT_SYSTEMPOINTER_HDL_
#include <com/sun/star/awt/SystemPointer.hdl>
......@@ -94,7 +99,11 @@ void MediaWindowControl::execute( const MediaItem& rItem )
// --------------------
MediaChildWindow::MediaChildWindow( Window* pParent ) :
#ifdef GSTREAMER
SystemChildWindow( pParent, WB_CLIPCHILDREN )
#else
JavaChildWindow( pParent, WB_CLIPCHILDREN )
#endif
{
}
......@@ -111,7 +120,11 @@ void MediaChildWindow::MouseMove( const MouseEvent& rMEvt )
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
#ifdef GSTREAMER
SystemChildWindow::MouseMove( rMEvt );
#else
JavaChildWindow::MouseMove( rMEvt );
#endif
GetParent()->MouseMove( aTransformedEvent );
}
......@@ -122,7 +135,11 @@ void MediaChildWindow::MouseButtonDown( const MouseEvent& rMEvt )
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
#ifdef GSTREAMER
SystemChildWindow::MouseButtonDown( rMEvt );
#else
JavaChildWindow::MouseButtonDown( rMEvt );
#endif
GetParent()->MouseButtonDown( aTransformedEvent );
}
......@@ -133,7 +150,11 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt )
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
#ifdef GSTREAMER
SystemChildWindow::MouseButtonUp( rMEvt );
#else
JavaChildWindow::MouseButtonUp( rMEvt );
#endif
GetParent()->MouseButtonUp( aTransformedEvent );
}
......@@ -141,7 +162,11 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt )
void MediaChildWindow::KeyInput( const KeyEvent& rKEvt )
{
#ifdef GSTREAMER
SystemChildWindow::KeyInput( rKEvt );
#else
JavaChildWindow::KeyInput( rKEvt );
#endif
GetParent()->KeyInput( rKEvt );
}
......@@ -149,7 +174,11 @@ void MediaChildWindow::KeyInput( const KeyEvent& rKEvt )
void MediaChildWindow::KeyUp( const KeyEvent& rKEvt )
{
#ifdef GSTREAMER
SystemChildWindow::KeyUp( rKEvt );
#else
JavaChildWindow::KeyUp( rKEvt );
#endif
GetParent()->KeyUp( rKEvt );
}
......@@ -160,7 +189,11 @@ void MediaChildWindow::Command( const CommandEvent& rCEvt )
const CommandEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ),
rCEvt.GetCommand(), rCEvt.IsMouseEvent(), rCEvt.GetData() );
#ifdef GSTREAMER
SystemChildWindow::Command( rCEvt );
#else
JavaChildWindow::Command( rCEvt );
#endif
GetParent()->Command( aTransformedEvent );
}
......@@ -229,18 +262,31 @@ void MediaWindowImpl::onURLChanged()
{
if( getPlayer().is() )
{
uno::Sequence< uno::Any > aArgs( 2 );
uno::Sequence< uno::Any > aArgs( 3 );
uno::Reference< media::XPlayerWindow > xPlayerWindow;
const Point aPoint;
const Size aSize( maChildWindow.GetSizePixel() );
#ifndef GSTREAMER
const sal_IntPtr nWndHandle = static_cast< sal_IntPtr >( maChildWindow.getParentWindowHandleForJava() );
#else
const sal_Int32 nWndHandle = 0;
#endif
aArgs[ 0 ] = uno::makeAny( nWndHandle );
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
{
#ifdef GSTREAMER
if( pSystemData->aWindow != 0 )
#else
if( nWndHandle != 0 )
#endif
xPlayerWindow = getPlayer()->createPlayerWindow( aArgs );
}
catch( uno::RuntimeException )
......
......@@ -29,7 +29,11 @@
#define _AVMEDIA_MEDIAWINDOW_IMPL_HXX
#include <svtools/transfer.hxx>
#ifdef GSTREAMER
#include <vcl/syschild.hxx>
#else
#include <vcl/javachild.hxx>
#endif
#include "mediawindowbase_impl.hxx"
#include "mediacontrol.hxx"
......@@ -61,7 +65,11 @@ namespace avmedia
// - MediaChildWindow -
// --------------------
#ifdef GSTREAMER
class MediaChildWindow : public SystemChildWindow
#else
class MediaChildWindow : public JavaChildWindow
#endif
{
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