/odk/

imo-6-1 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/avmedia/source
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2010-09-16 15:55:47 +0200
committerRadek Doulik <rodo@novell.com>2010-09-16 15:55:47 +0200
commit2eea82e0b3bc518c3bbb79dbd45c87eb171a8542 (patch)
tree5e6cf0907356bb9039711439c2cdb9b27230c560 /avmedia/source
parent6305b54dcc57e64fc37082c7d571435f3ce0b7a4 (diff)
avmedia-source-gstreamer-*.diff: gstreamer - implementation
Diffstat (limited to 'avmedia/source')
-rw-r--r--avmedia/source/gstreamer/ChangeLog112
-rw-r--r--avmedia/source/gstreamer/exports.dxp3
-rw-r--r--avmedia/source/gstreamer/gstcommon.hxx75
-rw-r--r--avmedia/source/gstreamer/gstframegrabber.cxx236
-rw-r--r--avmedia/source/gstreamer/gstframegrabber.hxx70
-rw-r--r--avmedia/source/gstreamer/gstmanager.cxx106
-rw-r--r--avmedia/source/gstreamer/gstmanager.hxx66
-rw-r--r--avmedia/source/gstreamer/gstplayer.cxx620
-rw-r--r--avmedia/source/gstreamer/gstplayer.hxx112
-rw-r--r--avmedia/source/gstreamer/gstuno.cxx103
-rw-r--r--avmedia/source/gstreamer/gstwindow.cxx357
-rw-r--r--avmedia/source/gstreamer/gstwindow.hxx111
-rw-r--r--avmedia/source/gstreamer/makefile.mk77
13 files changed, 2048 insertions, 0 deletions
diff --git a/avmedia/source/gstreamer/ChangeLog b/avmedia/source/gstreamer/ChangeLog
new file mode 100644
index 000000000000..8671b11a9720
--- /dev/null
+++ b/avmedia/source/gstreamer/ChangeLog
@@ -0,0 +1,112 @@
+2006-09-22 Radek Doulik <rodo@novell.com>
+
+ * gstplayer.cxx (processSyncMessage): remember GstXOverlay
+ (processMessage): explicit expose when we reach paused state -
+ this mean that now once stream is loaded/video inserted, the 1st
+ frame is rendered
+ (setMediaTime): if not playing set PAUSED state again, seems like
+ seek is changing state to PLAYING. this fixes problem when stop
+ seeked to begin and started playing again
+
+2006-09-21 Radek Doulik <rodo@novell.com>
+
+ * gstplayer.cxx (processSyncMessage): when error occurs, set the
+ condition so that OOo does'n waste time waiting for us to finish
+ reaching PAUSED state
+
+2006-09-19 Radek Doulik <rodo@novell.com>
+
+ * gstplayer.cxx (processSyncMessage): set condition even if we
+ weren't able to get video size - might be audio only stream
+ (getPreferredPlayerWindowSize): init size to 0, 0 - in case we
+ don't have video size, it will fallback to system media window
+ content (some icon)
+
+2006-08-31 Radek Doulik <rodo@novell.com>
+
+ * gstplayer.cxx (processSyncMessage): when we get to paused state,
+ get stream-info from playbin and look for video size. set
+ condition when done
+ (Player): added width, height, size condition
+ (preparePlaybin): new helper method, extracted from create
+ method. use fake video sink in the beggining so that we don't get
+ xwindow-id message too early
+ (getPreferredPlayerWindowSize): wait for size condition to be sure
+ we know video size (if possible). reset video sink to default one
+ (NULL) and set state to READY and immediatelly to PAUSE so that
+ the default sink is relinked
+
+2006-08-16 Radek Doulik <rodo@novell.com>
+
+ * gstplayer.cxx (create): set state to PAUSED so that we can query
+ duration ASAP
+ (processMessage): watch for state changed and query duration when
+ going to PAUSED state
+
+2006-08-15 Radek Doulik <rodo@novell.com>
+
+ * makefile.mk: require gstreamer-plugins-base-0.10 and link with
+ gst interfaces library
+
+ * gstwindow.cxx: make it build
+
+ * gstplayer.cxx: removed WINNT ifdefs (relict from time when I
+ thought Cedric develops on win architecture)
+ (gst_pipeline_bus_callback): added sync handler for setting
+ xwindow id to to video sink
+ (processSyncMessage): new metrhod, process message from sync
+ handler
+ (create): set playbin state to READY so that playback start is
+ faster
+ (createPlayerWindow): implemented, we pass xwindow id in 3rd
+ argument
+
+2006-08-04 Radek Doulik <rodo@novell.com>
+
+ * gstplayer.cxx (create): add bus watch, watch for EOS in
+ processMessage method (called from watch callback)
+
+2006-08-02 Radek Doulik <rodo@novell.com>
+
+ * gstplayer.cxx: test for mpPlaybin != NULL before using it,
+ initialize it in constructor to NULL and also reset it to NULL
+ after unrefing
+ (getDuration): check for sucessful query and the right format
+ (getMediaTime): ditto,
+ (setMediaTime): implemented
+
+2006-08-01 Radek Doulik <rodo@novell.com>
+
+ * gstwindow.hxx: removed mpWndClass for now, so that the rest
+ compiles
+
+ * gstuno.cxx (component_getFactory): s/DirectX/GStreamer so that
+ component is loaded
+
+ * gstplayer.cxx (Player::Player): do not create gerror object, it
+ is noit needed, free the error object only if created during
+ initialization of gstremer
+ (Player::create, start, stop): use g_main_loop only on windows
+ (create): fixed ascURL declaration, added rtl namespace prefix
+ (setMute): set mbMuted
+ (setVolumeDB): convert avmedia volume to gstreamer volume, added
+ missing NULL to the end of g_object_set call
+ (getVolumeDB): convert gstreamer volume back to avmedia volume
+
+ * gstplayer.hxx: keep g_main_loop only on win platform. make
+ mnUnmutedVolume double, moved mbInitialized to the end to quiet
+ compiler warning
+
+ * gstcommon.hxx: removed wrong #include <rtl/ustring>
+
+ * renamed source files, prefixed the names with gst so that obj
+ file names do not clash with xine object files
+
+ * makefile.mk: changed PRJNAME and TARGET to reflect
+ gstreamer. enabled build on unix as well. removed win library
+ references. removed source files which are not yet ported from
+ SLOFILES list.
+
+2006-08-31 Radek Doulik <rodo@novell.com>
+
+ * imported initial sources from Cedric Bosdonnat \ No newline at end of file
diff --git a/avmedia/source/gstreamer/exports.dxp b/avmedia/source/gstreamer/exports.dxp
new file mode 100644
index 000000000000..9630d7e06768
--- /dev/null
+++ b/avmedia/source/gstreamer/exports.dxp
@@ -0,0 +1,3 @@
+component_getImplementationEnvironment
+component_writeInfo
+component_getFactory
diff --git a/avmedia/source/gstreamer/gstcommon.hxx b/avmedia/source/gstreamer/gstcommon.hxx
new file mode 100644
index 000000000000..d3e1f2419b53
--- /dev/null
+++ b/avmedia/source/gstreamer/gstcommon.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _GSTCOMMON_HXX
+#define _GSTCOMMON_HXX
+
+#include <gst/gst.h>
+
+#ifndef _OSL_MUTEX_HXX_
+#include <osl/mutex.hxx>
+#endif
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+#ifndef _URLOBJ_HXX
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+#ifndef _CPPUHELPER_WEAK_HXX_
+#include <cppuhelper/weak.hxx>
+#endif
+#ifndef _CPPUHELPER_FACTORY_HXX_
+#include <cppuhelper/factory.hxx>
+#endif
+
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/awt/KeyModifier.hpp>
+#include <com/sun/star/awt/MouseButton.hpp>
+#include <com/sun/star/media/XManager.hpp>
+
+#define WM_GRAPHNOTIFY (WM_USER + 567)
+
+#endif // _GSTCOMMOM_HXX
diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx
new file mode 100644
index 000000000000..513a2c2a2d18
--- /dev/null
+++ b/avmedia/source/gstreamer/gstframegrabber.cxx
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <tools/prewin.h>
+#include <windows.h>
+#include <objbase.h>
+#include <strmif.h>
+#include <Amvideo.h>
+#include <Qedit.h>
+#include <uuids.h>
+#include <tools/postwin.h>
+
+#include "framegrabber.hxx"
+#include "player.hxx"
+
+#include <tools/stream.hxx>
+#include <vcl/graph.hxx>
+#include <unotools/localfilehelper.hxx>
+
+#define AVMEDIA_GST_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_GStreamer"
+#define AVMEDIA_GST_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_GStreamer"
+
+using namespace ::com::sun::star;
+
+namespace avmedia { namespace gstreamer {
+
+// ----------------
+// - FrameGrabber -
+// ----------------
+
+FrameGrabber::FrameGrabber( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
+ mxMgr( rxMgr )
+{
+ ::CoInitialize( NULL );
+}
+
+// ------------------------------------------------------------------------------
+
+FrameGrabber::~FrameGrabber()
+{
+ ::CoUninitialize();
+}
+
+// ------------------------------------------------------------------------------
+
+IMediaDet* FrameGrabber::implCreateMediaDet( const ::rtl::OUString& rURL ) const
+{
+ IMediaDet* pDet = NULL;
+
+ if( SUCCEEDED( CoCreateInstance( CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER, IID_IMediaDet, (void**) &pDet ) ) )
+ {
+ String aLocalStr;
+
+ if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( rURL, aLocalStr ) && aLocalStr.Len() )
+ {
+ if( !SUCCEEDED( pDet->put_Filename( ::SysAllocString( aLocalStr.GetBuffer() ) ) ) )
+ {
+ pDet->Release();
+ pDet = NULL;
+ }
+ }
+ }
+
+ return pDet;
+}
+
+// ------------------------------------------------------------------------------
+
+bool FrameGrabber::create( const ::rtl::OUString& rURL )
+{
+ // just check if a MediaDet interface can be created with the given URL
+ IMediaDet* pDet = implCreateMediaDet( rURL );
+
+ if( pDet )
+ {
+ maURL = rURL;
+ pDet->Release();
+ pDet = NULL;
+ }
+ else
+ maURL = ::rtl::OUString();
+
+ return( maURL.getLength() > 0 );
+}
+
+// ------------------------------------------------------------------------------
+
+uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMediaTime )
+ throw (uno::RuntimeException)
+{
+ uno::Reference< graphic::XGraphic > xRet;
+ IMediaDet* pDet = implCreateMediaDet( maURL );
+
+ if( pDet )
+ {
+ double fLength;
+ long nStreamCount;
+ bool bFound = false;
+
+ if( SUCCEEDED( pDet->get_OutputStreams( &nStreamCount ) ) )
+ {
+ for( long n = 0; ( n < nStreamCount ) && !bFound; ++n )
+ {
+ GUID aMajorType;
+
+ if( SUCCEEDED( pDet->put_CurrentStream( n ) ) &&
+ SUCCEEDED( pDet->get_StreamType( &aMajorType ) ) &&
+ ( aMajorType == MEDIATYPE_Video ) )
+ {