Resolves: rhbz#858641 backport gstreamer 1.0 support to F-18

f41
David Tardon 12 years ago
parent 4f2c746b92
commit e4c4141662

@ -0,0 +1,193 @@
From 90b9271771927a72dc27e71957376dd67c8f6d43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim.muller@collabora.co.uk>
Date: Sun, 29 Jul 2012 19:14:05 +0200
Subject: [PATCH 1/7] tentative initial attempt at re-work for new playbin
Change-Id: I257bdda8469be624d0cbeab21cff2c2e1c94cc6f
Signed-off-by: David Tardon <dtardon@redhat.com>
---
avmedia/source/gstreamer/gstplayer.cxx | 94 ++++++++++++++++++++++++++--------
1 file changed, 74 insertions(+), 20 deletions(-)
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index 863d1e8..d95342a 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -38,7 +38,9 @@
#include "gstframegrabber.hxx"
#include "gstwindow.hxx"
-#include <gst/interfaces/xoverlay.h>
+#ifndef AVMEDIA_GST_0_10
+# include <gst/video/videooverlay.h>
+#endif
#define AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_GStreamer"
#define AVMEDIA_GST_PLAYER_SERVICENAME "com.sun.star.media.Player_GStreamer"
@@ -96,7 +98,7 @@ Player::~Player()
if( mpPlaybin )
{
gst_element_set_state( mpPlaybin, GST_STATE_NULL );
- gst_object_unref( GST_OBJECT( mpPlaybin ) );
+ g_object_unref( G_OBJECT( mpPlaybin ) );
mpPlaybin = NULL;
}
@@ -110,7 +112,7 @@ Player::~Player()
// ------------------------------------------------------------------------------
-static gboolean gst_pipeline_bus_callback( GstBus *, GstMessage *message, gpointer data )
+static gboolean pipeline_bus_callback( GstBus *, GstMessage *message, gpointer data )
{
Player* pPlayer = static_cast<Player*>(data);
@@ -119,7 +121,7 @@ static gboolean gst_pipeline_bus_callback( GstBus *, GstMessage *message, gpoint
return TRUE;
}
-static GstBusSyncReply gst_pipeline_bus_sync_handler( GstBus *, GstMessage * message, gpointer data )
+static GstBusSyncReply pipeline_bus_sync_handler( GstBus *, GstMessage * message, gpointer data )
{
Player* pPlayer = static_cast<Player*>(data);
@@ -144,7 +146,7 @@ void Player::processMessage( GstMessage *message )
if( newstate == GST_STATE_PAUSED &&
pendingstate == GST_STATE_VOID_PENDING &&
mpXOverlay )
- gst_x_overlay_expose( mpXOverlay );
+ gst_video_overlay_expose( mpXOverlay );
if (mbPlayPending)
mbPlayPending = ((newstate == GST_STATE_READY) || (newstate == GST_STATE_PAUSED));
@@ -154,6 +156,26 @@ void Player::processMessage( GstMessage *message )
}
}
+static gboolean wrap_element_query_position (GstElement *element, GstFormat format, gint64 *cur)
+{
+#ifdef AVMEDIA_GST_0_10
+ GstFormat my_format = format;
+ return gst_element_query_position( mpPlaybin, &my_format, cur) && my_format == format && *cur > 0L;
+#else
+ return gst_element_query_position( element, format, cur );
+#endif
+}
+
+static gboolean wrap_element_query_duration (GstElement *element, GstFormat format, gint64 *duration)
+{
+#ifdef AVMEDIA_GST_0_10
+ GstFormat my_format = format;
+ return gst_element_query_duration( mpPlaybin, &my_format, duration) && my_format == format && *duration > 0L;
+#else
+ return gst_element_query_duration( element, format, duration );
+#endif
+}
+
GstBusSyncReply Player::processSyncMessage( GstMessage *message )
{
DBG( "%p processSyncMessage: %s", this, GST_MESSAGE_TYPE_NAME( message ) );
@@ -169,17 +191,17 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
}
#endif
- if (message->structure) {
- if( !strcmp( gst_structure_get_name( message->structure ), "prepare-xwindow-id" ) && mnWindowID != 0 ) {
- if( mpXOverlay )
- g_object_unref( G_OBJECT ( mpXOverlay ) );
- mpXOverlay = GST_X_OVERLAY( GST_MESSAGE_SRC( message ) );
- g_object_ref( G_OBJECT ( mpXOverlay ) );
- gst_x_overlay_set_xwindow_id( mpXOverlay, mnWindowID );
- return GST_BUS_DROP;
- }
+ if (gst_message_has_name (message, "prepare-xwindow-id") && mnWindowID != 0 )
+ {
+ if( mpXOverlay )
+ g_object_unref( G_OBJECT ( mpXOverlay ) );
+ mpXOverlay = GST_VIDEO_OVERLAY( GST_MESSAGE_SRC( message ) );
+ g_object_ref( G_OBJECT ( mpXOverlay ) );
+ gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID );
+ return GST_BUS_DROP;
}
+#ifdef AVMEDIA_GST_0_10
if( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_STATE_CHANGED ) {
if( message->src == GST_OBJECT( mpPlaybin ) ) {
GstState newstate, pendingstate;
@@ -193,10 +215,8 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
DBG( "%p change to paused received", this );
if( mnDuration == 0) {
- GstFormat format = GST_FORMAT_TIME;
gint64 gst_duration = 0L;
-
- if( gst_element_query_duration( mpPlaybin, &format, &gst_duration) && format == GST_FORMAT_TIME && gst_duration > 0L )
+ if( wrap_element_query_duration( mpPlaybin, GST_FORMAT_TIME, &gst_duration) )
mnDuration = gst_duration;
}
@@ -234,6 +254,40 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
}
}
}
+#else
+ // We get to use the exciting new playbin2 ! (now known as playbin)
+ if( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_ASYNC_DONE ) {
+ if( mnDuration == 0) {
+ gint64 gst_duration = 0L;
+ if( wrap_element_query_duration( mpPlaybin, GST_FORMAT_TIME, &gst_duration) )
+ mnDuration = gst_duration;
+ }
+ if( mnWidth == 0 ) {
+ GstPad *pad = NULL;
+ GstCaps *caps;
+
+ g_signal_emit_by_name( mpPlaybin, "get-video-pad", 0, &pad );
+
+ if( pad ) {
+ int w = 0, h = 0;
+
+ caps = gst_pad_get_current_caps( pad );
+
+ if( gst_structure_get( gst_caps_get_structure (caps, 0),
+ "width", G_TYPE_INT, &w,
+ "height", G_TYPE_INT, &h,
+ NULL ) ) {
+ mnWidth = w;
+ mnHeight = h;
+
+ DBG( "queried size: %d x %d", mnWidth, mnHeight );
+
+ maSizeCondition.set();
+ }
+ gst_caps_unref( caps );
+ }
+ }
+#endif
} else if( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_ERROR ) {
if( mnWidth == 0 ) {
// an error occurred, set condition so that OOo thread doesn't wait for us
@@ -265,9 +319,9 @@ void Player::preparePlaybin( const ::rtl::OUString& rURL, bool bFakeVideo )
g_object_set( G_OBJECT( mpPlaybin ), "uri", ascURL.getStr() , NULL );
pBus = gst_element_get_bus( mpPlaybin );
- gst_bus_add_watch( pBus, gst_pipeline_bus_callback, this );
+ gst_bus_add_watch( pBus, pipeline_bus_callback, this );
DBG( "%p set sync handler", this );
- gst_bus_set_sync_handler( pBus, gst_pipeline_bus_sync_handler, this );
+ gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this );
g_object_unref( pBus );
}
@@ -387,7 +441,7 @@ double SAL_CALL Player::getMediaTime( )
// get current position in the stream
GstFormat format = GST_FORMAT_TIME;
gint64 gst_position;
- if( gst_element_query_position( mpPlaybin, &format, &gst_position ) && format == GST_FORMAT_TIME && gst_position > 0L )
+ if( wrap_element_query_position( mpPlaybin, GST_FORMAT_TIME, &gst_position ) )
position = gst_position / 1E9;
}
--
1.7.11.4

@ -0,0 +1,832 @@
From a3f96fb4ddcc657f4448089eff07531735f23979 Mon Sep 17 00:00:00 2001
From: Michael Meeks <michael.meeks@suse.com>
Date: Mon, 30 Jul 2012 15:15:58 +0200
Subject: [PATCH 2/7] gstreamer: make gstreamer 1.0 and 0.10 dual compile
Add fallback activation of an _OLD media component to the core.
Compile both a 0.10 and 1.0 version of the gstreamer component
Conflicts:
distro-configs/LibreOfficeAndroidX86.conf
distro-configs/LibreOfficeLinux.conf
Change-Id: I91f65d05391cb2d7e02f9cff18f96178a128705O1
---
Repository.mk | 1 +
avmedia/Library_avmediagst.mk | 8 +--
avmedia/Module_avmedia.mk | 6 ++
.../gstreamer/avmediagstreamer_0_10.component | 6 ++
avmedia/source/gstreamer/gst_0_10.cxx | 15 +++++
avmedia/source/gstreamer/gstplayer.cxx | 69 ++++++++++++++--------
avmedia/source/gstreamer/gstplayer.hxx | 4 +-
avmedia/source/gstreamer/gstuno.cxx | 17 ++++--
avmedia/source/inc/mediamisc.hxx | 11 +---
avmedia/source/viewer/mediawindowbase_impl.cxx | 21 ++++++-
config_host.mk.in | 3 +
configure.in | 41 +++++++++++--
distro-configs/LibreOfficeAndroid.conf | 1 +
distro-configs/LibreOfficeLinux.conf | 2 +-
distro-configs/LibreOfficeOpenBSD.conf | 2 +-
distro-configs/LibreOfficeiOS.conf | 1 +
distro-configs/OxygenOfficeLinux.conf | 2 +-
postprocess/packcomponents/makefile.mk | 4 ++
scp2/InstallModule_ooo.mk | 3 +
scp2/source/ooo/file_library_ooo.scp | 6 +-
scp2/source/ooo/module_hidden_ooo.scp | 19 +++---
svx/source/sdr/contact/viewcontact.cxx | 2 +-
22 files changed, 174 insertions(+), 70 deletions(-)
create mode 100644 avmedia/source/gstreamer/avmediagstreamer_0_10.component
create mode 100644 avmedia/source/gstreamer/gst_0_10.cxx
diff --git a/Repository.mk b/Repository.mk
index 67ba527..881029e 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -417,6 +417,7 @@ endif
$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
avmediagst \
+ avmediagst_0_10 \
avmediawin \
cached1 \
collator_data \
diff --git a/avmedia/Library_avmediagst.mk b/avmedia/Library_avmediagst.mk
index b6323bb..b7eeacd 100644
--- a/avmedia/Library_avmediagst.mk
+++ b/avmedia/Library_avmediagst.mk
@@ -33,8 +33,9 @@ $(eval $(call gb_Library_set_componentfile,avmediagst,avmedia/source/gstreamer/a
$(eval $(call gb_Library_set_include,avmediagst,\
$$(INCLUDE) \
-I$(SRCDIR)/avmedia/source/inc \
- $(shell pkg-config --cflags gstreamer-0.10, gstreamer-plugins-base-0.10) \
+ $(GSTREAMER_CFLAGS) \
))
+$(eval $(call gb_Library_add_libs,avmediagst,$(GSTREAMER_LIBS)))
$(eval $(call gb_Library_use_api,avmediagst,\
udkapi \
@@ -57,11 +58,6 @@ $(eval $(call gb_Library_use_libraries,avmediagst,\
$(gb_STDLIBS) \
))
-$(eval $(call gb_Library_add_libs,avmediagst,\
- $(shell pkg-config --libs gstreamer-0.10, gstreamer-plugins-base-0.10) \
- -lgstinterfaces-0.10 \
-))
-
$(eval $(call gb_Library_add_exception_objects,avmediagst,\
avmedia/source/gstreamer/gstmanager \
avmedia/source/gstreamer/gstplayer \
diff --git a/avmedia/Module_avmedia.mk b/avmedia/Module_avmedia.mk
index 729c24f..ef50457 100644
--- a/avmedia/Module_avmedia.mk
+++ b/avmedia/Module_avmedia.mk
@@ -40,6 +40,12 @@ $(eval $(call gb_Module_add_targets,avmedia,\
))
endif
+ifeq ($(ENABLE_GSTREAMER_0_10),TRUE)
+$(eval $(call gb_Module_add_targets,avmedia,\
+ Library_avmediagst_0_10 \
+))
+endif
+
ifeq ($(GUIBASE),aqua)
$(eval $(call gb_Module_add_targets,avmedia,\
Library_avmediaQuickTime \
diff --git a/avmedia/source/gstreamer/avmediagstreamer_0_10.component b/avmedia/source/gstreamer/avmediagstreamer_0_10.component
new file mode 100644
index 0000000..3fc61d7
--- /dev/null
+++ b/avmedia/source/gstreamer/avmediagstreamer_0_10.component
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component loader="com.sun.star.loader.SharedLibrary" xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.media.Manager_GStreamer_0_10">
+ <service name="com.sun.star.comp.avmedia.Manager_GStreamer_0_10"/>
+ </implementation>
+</component>
diff --git a/avmedia/source/gstreamer/gst_0_10.cxx b/avmedia/source/gstreamer/gst_0_10.cxx
new file mode 100644
index 0000000..a0624c4
--- /dev/null
+++ b/avmedia/source/gstreamer/gst_0_10.cxx
@@ -0,0 +1,15 @@
+#define AVMEDIA_GST_0_10
+
+// forward compatibility goodness
+#include <gst/interfaces/xoverlay.h>
+#define gst_video_overlay_expose(a) gst_x_overlay_expose(GST_X_OVERLAY (a))
+#define gst_video_overlay_set_window_handle(a,b) gst_x_overlay_set_xwindow_id( \
+ reinterpret_cast<GstXOverlay *>(a), (b) )
+#define GST_VIDEO_OVERLAY(a) reinterpret_cast<GstVideoOverlay *>(a)
+
+// #define GstVideoOverlay GstXOverlay
+
+#include "gstmanager.cxx"
+#include "gstplayer.cxx"
+#include "gstuno.cxx"
+#include "gstwindow.cxx"
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index d95342a..28e5d34 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -33,7 +33,6 @@
#include <vcl/syschild.hxx>
#include <vcl/sysdata.hxx>
-
#include "gstplayer.hxx"
#include "gstframegrabber.hxx"
#include "gstwindow.hxx"
@@ -45,8 +44,14 @@
#define AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_GStreamer"
#define AVMEDIA_GST_PLAYER_SERVICENAME "com.sun.star.media.Player_GStreamer"
-#if OSL_DEBUG_LEVEL > 2
-#define DBG OSL_TRACE
+#ifdef AVMEDIA_GST_0_10
+# define AVVERSION "gst 0.10: "
+#else
+# define AVVERSION "gst 1.0: "
+#endif
+
+#if 1 //OSL_DEBUG_LEVEL > 2
+#define DBG(...) do { fprintf (stderr, "%s", AVVERSION); fprintf (stderr, __VA_ARGS__); fprintf (stderr, "\n"); } while (0);
#else
#define DBG(...)
#endif
@@ -83,15 +88,22 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
mbInitialized = gst_init_check( &argc, &argv, &pError );
+ DBG( "%p Player::Player", this );
+
if (pError != NULL)
+ {
// TODO: thow an exception?
+ DBG( "%p Player::Player error '%s'", this, pError->message );
g_error_free (pError);
+ }
}
// ------------------------------------------------------------------------------
Player::~Player()
{
+ DBG( "%p Player::~Player", this );
+
// Release the elements and pipeline
if( mbInitialized )
{
@@ -160,7 +172,7 @@ static gboolean wrap_element_query_position (GstElement *element, GstFormat form
{
#ifdef AVMEDIA_GST_0_10
GstFormat my_format = format;
- return gst_element_query_position( mpPlaybin, &my_format, cur) && my_format == format && *cur > 0L;
+ return gst_element_query_position( element, &my_format, cur) && my_format == format && *cur > 0L;
#else
return gst_element_query_position( element, format, cur );
#endif
@@ -170,7 +182,7 @@ static gboolean wrap_element_query_duration (GstElement *element, GstFormat form
{
#ifdef AVMEDIA_GST_0_10
GstFormat my_format = format;
- return gst_element_query_duration( mpPlaybin, &my_format, duration) && my_format == format && *duration > 0L;
+ return gst_element_query_duration( element, &my_format, duration) && my_format == format && *duration > 0L;
#else
return gst_element_query_duration( element, format, duration );
#endif
@@ -178,21 +190,27 @@ static gboolean wrap_element_query_duration (GstElement *element, GstFormat form
GstBusSyncReply Player::processSyncMessage( GstMessage *message )
{
- DBG( "%p processSyncMessage: %s", this, GST_MESSAGE_TYPE_NAME( message ) );
+// DBG( "%p processSyncMessage has handle: %s", this, GST_MESSAGE_TYPE_NAME( message ) );
-#if OSL_DEBUG_LEVEL > 0
+#if 1 // OSL_DEBUG_LEVEL > 0
if ( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_ERROR )
{
GError* error;
gchar* error_debug;
gst_message_parse_error( message, &error, &error_debug );
- OSL_TRACE("gstreamer error: '%s' debug: '%s'", error->message, error_debug);
+ fprintf(stderr, "gstreamer error: '%s' debug: '%s'", error->message, error_debug);
}
#endif
- if (gst_message_has_name (message, "prepare-xwindow-id") && mnWindowID != 0 )
+#ifdef AVMEDIA_GST_0_10
+ if (message->structure &&
+ !strcmp( gst_structure_get_name( message->structure ), "prepare-xwindow-id" ) && mnWindowID != 0 )
+#else
+ if (gst_message_has_name (message, "prepare-window-handle") && mnWindowID != 0 )
+#endif
{
+ DBG( "%p processSyncMessage has handle: %s", this, GST_MESSAGE_TYPE_NAME( message ) );
if( mpXOverlay )
g_object_unref( G_OBJECT ( mpXOverlay ) );
mpXOverlay = GST_VIDEO_OVERLAY( GST_MESSAGE_SRC( message ) );
@@ -208,7 +226,8 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
gst_message_parse_state_changed (message, NULL, &newstate, &pendingstate);
- DBG( "%p state change received, new state %d", this, newstate );
+ DBG( "%p state change received, new state %d pending %d", this,
+ (int)newstate, (int)pendingstate );
if( newstate == GST_STATE_PAUSED &&
pendingstate == GST_STATE_VOID_PENDING ) {
@@ -280,7 +299,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
mnWidth = w;
mnHeight = h;
- DBG( "queried size: %d x %d", mnWidth, mnHeight );
+ fprintf (stderr, "queried size: %d x %d", mnWidth, mnHeight );
maSizeCondition.set();
}
@@ -289,6 +308,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
}
#endif
} else if( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_ERROR ) {
+ fprintf (stderr, "Error !\n");
if( mnWidth == 0 ) {
// an error occurred, set condition so that OOo thread doesn't wait for us
maSizeCondition.set();
@@ -353,7 +373,7 @@ bool Player::create( const ::rtl::OUString& rURL )
// ------------------------------------------------------------------------------
-void SAL_CALL Player::start( )
+void SAL_CALL Player::start()
throw (uno::RuntimeException)
{
// set the pipeline state to READY and run the loop
@@ -366,7 +386,7 @@ void SAL_CALL Player::start( )
// ------------------------------------------------------------------------------
-void SAL_CALL Player::stop( )
+void SAL_CALL Player::stop()
throw (uno::RuntimeException)
{
// set the pipeline in PAUSED STATE
@@ -397,7 +417,7 @@ sal_Bool SAL_CALL Player::isPlaying()
// ------------------------------------------------------------------------------
-double SAL_CALL Player::getDuration( )
+double SAL_CALL Player::getDuration()
throw (uno::RuntimeException)
{
// slideshow checks for non-zero duration, so cheat here
@@ -432,14 +452,13 @@ void SAL_CALL Player::setMediaTime( double fTime )
// ------------------------------------------------------------------------------
-double SAL_CALL Player::getMediaTime( )
+double SAL_CALL Player::getMediaTime()
throw (uno::RuntimeException)
{
double position = 0.0;
if( mpPlaybin ) {
// get current position in the stream
- GstFormat format = GST_FORMAT_TIME;
gint64 gst_position;
if( wrap_element_query_position( mpPlaybin, GST_FORMAT_TIME, &gst_position ) )
position = gst_position / 1E9;
@@ -450,7 +469,7 @@ double SAL_CALL Player::getMediaTime( )
// ------------------------------------------------------------------------------
-double SAL_CALL Player::getRate( )
+double SAL_CALL Player::getRate()
throw (uno::RuntimeException)
{
double rate = 0.0;
@@ -475,7 +494,7 @@ void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet )
// ------------------------------------------------------------------------------
-sal_Bool SAL_CALL Player::isPlaybackLoop( )
+sal_Bool SAL_CALL Player::isPlaybackLoop()
throw (uno::RuntimeException)
{
// TODO check how to do with GST
@@ -506,7 +525,7 @@ void SAL_CALL Player::setMute( sal_Bool bSet )
// ------------------------------------------------------------------------------
-sal_Bool SAL_CALL Player::isMute( )
+sal_Bool SAL_CALL Player::isMute()
throw (uno::RuntimeException)
{
return mbMuted;
@@ -530,7 +549,7 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB )
// ------------------------------------------------------------------------------
-sal_Int16 SAL_CALL Player::getVolumeDB( )
+sal_Int16 SAL_CALL Player::getVolumeDB()
throw (uno::RuntimeException)
{
sal_Int16 nVolumeDB(0);
@@ -548,7 +567,7 @@ sal_Int16 SAL_CALL Player::getVolumeDB( )
// ------------------------------------------------------------------------------
-awt::Size SAL_CALL Player::getPreferredPlayerWindowSize( )
+awt::Size SAL_CALL Player::getPreferredPlayerWindowSize()
throw (uno::RuntimeException)
{
awt::Size aSize( 0, 0 );
@@ -556,7 +575,7 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize( )
DBG( "%p Player::getPreferredPlayerWindowSize, member %d x %d", this, mnWidth, mnHeight );
TimeValue aTimeout = { 10, 0 };
-#if OSL_DEBUG_LEVEL > 2
+#if 1 // OSL_DEBUG_LEVEL > 2
osl::Condition::Result aResult =
#endif
maSizeCondition.wait( &aTimeout );
@@ -612,7 +631,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
// ------------------------------------------------------------------------------
-uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( )
+uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber()
throw (uno::RuntimeException)
{
uno::Reference< media::XFrameGrabber > xRet;
@@ -622,7 +641,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( )
// ------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL Player::getImplementationName( )
+::rtl::OUString SAL_CALL Player::getImplementationName()
throw (uno::RuntimeException)
{
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME ) );
@@ -638,7 +657,7 @@ sal_Bool SAL_CALL Player::supportsService( const ::rtl::OUString& ServiceName )
// ------------------------------------------------------------------------------
-uno::Sequence< ::rtl::OUString > SAL_CALL Player::getSupportedServiceNames( )
+uno::Sequence< ::rtl::OUString > SAL_CALL Player::getSupportedServiceNames()
throw (uno::RuntimeException)
{
uno::Sequence< ::rtl::OUString > aRet(1);
diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx
index b5d7d83..65c3e46 100644
--- a/avmedia/source/gstreamer/gstplayer.hxx
+++ b/avmedia/source/gstreamer/gstplayer.hxx
@@ -34,7 +34,7 @@
#include "com/sun/star/media/XPlayer.hdl"
-typedef struct _GstXOverlay GstXOverlay;
+typedef struct _GstVideoOverlay GstVideoOverlay;
namespace avmedia { namespace gstreamer {
@@ -95,7 +95,7 @@ private:
sal_Bool mbInitialized;
long mnWindowID;
- GstXOverlay* mpXOverlay;
+ GstVideoOverlay* mpXOverlay;
gint64 mnDuration;
int mnWidth;
int mnHeight;
diff --git a/avmedia/source/gstreamer/gstuno.cxx b/avmedia/source/gstreamer/gstuno.cxx
index 8095353..affb8eb2 100644
--- a/avmedia/source/gstreamer/gstuno.cxx
+++ b/avmedia/source/gstreamer/gstuno.cxx
@@ -26,6 +26,7 @@
*
************************************************************************/
+#include "mediamisc.hxx"
#include "gstmanager.hxx"
using namespace ::com::sun::star;
@@ -34,6 +35,14 @@ using namespace ::com::sun::star;
// - factory methods -
// -------------------
+#ifdef AVMEDIA_GST_0_10
+# define IMPL_NAME "com.sun.star.comp.media.Manager_GStreamer_0_10"
+# define SERVICE_NAME AVMEDIA_MANAGER_SERVICE_NAME_OLD // "com.sun.star.comp.avmedia.Manager_GStreamer_0_10"
+#else
+# define IMPL_NAME "com.sun.star.comp.media.Manager_GStreamer"
+# define SERVICE_NAME AVMEDIA_MANAGER_SERVICE_NAME // "com.sun.star.comp.avmedia.Manager_GStreamer"
+#endif
+
static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& rxFact )
{
return uno::Reference< uno::XInterface >( *new ::avmedia::gstreamer::Manager( rxFact ) );
@@ -44,14 +53,12 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_C
uno::Reference< lang::XSingleServiceFactory > xFactory;
void* pRet = 0;
- if( rtl_str_compare( pImplName, "com.sun.star.comp.media.Manager_GStreamer" ) == 0 )
+ if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 )
{
- const ::rtl::OUString aServiceName( ::rtl::OUString("com.sun.star.media.Manager_GStreamer" ) );
-
+ const ::rtl::OUString aServiceName( SERVICE_NAME );
xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
- ::rtl::OUString("com.sun.star.comp.media.Manager_GStreamer" ),
- create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) );
+ IMPL_NAME, create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) );
}
if( xFactory.is() )
diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx
index 8f129bb..f042629 100644
--- a/avmedia/source/inc/mediamisc.hxx
+++ b/avmedia/source/inc/mediamisc.hxx
@@ -30,23 +30,14 @@ class ResMgr;
#define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() )
-#ifdef GSTREAMER
-#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_GStreamer"
-#else
#ifdef WNT
-
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_DirectX"
-
#else
#ifdef QUARTZ
-
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_QuickTime"
-
#else
-
+#define AVMEDIA_MANAGER_SERVICE_NAME_OLD "com.sun.star.comp.avmedia.Manager_GStreamer_0_10"
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_GStreamer"
-
-#endif
#endif
#endif
diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx
index 79e0bdf..fd2ffba 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.cxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.cxx
@@ -72,10 +72,25 @@ uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl:
{
try
{
+ uno::Reference< ::com::sun::star::media::XManager > xManager;
- uno::Reference< ::com::sun::star::media::XManager > xManager(
- xFactory->createInstance( ::rtl::OUString( AVMEDIA_MANAGER_SERVICE_NAME ) ),
- uno::UNO_QUERY );
+ try {
+ xManager = uno::Reference< ::com::sun::star::media::XManager >(
+ xFactory->createInstance( AVMEDIA_MANAGER_SERVICE_NAME ),
+ uno::UNO_QUERY );
+ } catch ( const uno::Exception &e ) {
+ }
+
+// a fallback path just for gstreamer which has
+// two significant versions deployed at once ...
+#ifdef AVMEDIA_MANAGER_SERVICE_NAME_OLD
+ if( !xManager.is() )
+ {
+ xManager = uno::Reference< ::com::sun::star::media::XManager >(
+ xFactory->createInstance( AVMEDIA_MANAGER_SERVICE_NAME_OLD ),
+ uno::UNO_QUERY );
+ }
+#endif
if( xManager.is() )
{
diff --git a/config_host.mk.in b/config_host.mk.in
index 4fb80d1..42355cc 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -112,6 +112,7 @@ export ENABLE_GIO=@ENABLE_GIO@
export ENABLE_GNOMEVFS=@ENABLE_GNOMEVFS@
export ENABLE_GRAPHITE=@ENABLE_GRAPHITE@
export ENABLE_GSTREAMER=@ENABLE_GSTREAMER@
+export ENABLE_GSTREAMER_0_10=@ENABLE_GSTREAMER_0_10@
export ENABLE_GTK3=@ENABLE_GTK3@
export ENABLE_GTK=@ENABLE_GTK@
export ENABLE_GTK_PRINT=@ENABLE_GTK_PRINT@
@@ -182,6 +183,8 @@ export GRAPHITE_LIBS=@GRAPHITE_LIBS@
@x_Cygwin@ export GREP=@WIN_GREP@
export GSTREAMER_CFLAGS=@GSTREAMER_CFLAGS@
export GSTREAMER_LIBS=@GSTREAMER_LIBS@
+export GSTREAMER_0_10_CFLAGS=@GSTREAMER_0_10_CFLAGS@
+export GSTREAMER_0_10_LIBS=@GSTREAMER_0_10_LIBS@
export GTHREAD_CFLAGS=@GTHREAD_CFLAGS@
export GTHREAD_LIBS=@GTHREAD_LIBS@
export GTK3_CFLAGS=@GTK3_CFLAGS@
diff --git a/configure.in b/configure.in
index 651963a..46b9892 100644
--- a/configure.in
+++ b/configure.in
@@ -171,6 +171,7 @@ case "$host_os" in
solaris*)
test_gtk=yes
build_gstreamer=yes
+ build_gstreamer_0_10=yes
test_tde=yes
test_kde=yes
test_freetype=yes
@@ -200,6 +201,7 @@ solaris*)
linux-gnu*|k*bsd*-gnu*)
test_gtk=yes
build_gstreamer=yes
+ build_gstreamer_0_10=yes
test_tde=yes
test_kde=yes
test_kde4=yes
@@ -287,6 +289,7 @@ darwin*) # Mac OS X or iOS
freebsd*)
test_gtk=yes
build_gstreamer=yes
+ build_gstreamer_0_10=yes
test_tde=yes
test_kde=yes
test_kde4=yes
@@ -316,6 +319,7 @@ freebsd*)
*netbsd*)
test_gtk=yes
build_gstreamer=yes
+ build_gstreamer_0_10=yes
test_tde=no
test_kde=no
test_kde4=yes
@@ -344,6 +348,7 @@ openbsd*)
dragonfly*)
test_gtk=yes
build_gstreamer=yes
+ build_gstreamer_0_10=yes
test_tde=yes
test_kde=yes
test_kde4=yes
@@ -354,6 +359,7 @@ dragonfly*)
linux-androideabi*)
build_gstreamer=no
+ build_gstreamer_0_10=no
test_cups=no
test_fontconfig=no
test_freetype=no
@@ -855,9 +861,14 @@ AC_ARG_ENABLE(randr-link,
,enable_randr_link=yes)
AC_ARG_ENABLE(gstreamer,
- AS_HELP_STRING([--disable-gstreamer],
+ AS_HELP_STRING([--enable-gstreamer],
+ [Enable building with the new gstreamer 1.0 avmedia backend.]),
+,enable_gstreamer=no)
+
+AC_ARG_ENABLE(gstreamer-0-10,
+ AS_HELP_STRING([--disable-gstreamer-0-10],
[Disable building the gstreamer avmedia backend.]),
-,enable_gstreamer=yes)
+,enable_gstreamer_0_10=yes)
AC_ARG_ENABLE(neon,
AS_HELP_STRING([--disable-neon],
@@ -3703,6 +3714,7 @@ if test "$enable_headless" = "yes"; then
test_fontconfig=yes
test_gtk=no
build_gstreamer=no
+ build_gstreamer_0_10=no
test_tde=no
test_kde=no
test_kde4=no
@@ -8936,20 +8948,39 @@ dnl ===================================================================
ENABLE_GSTREAMER=""
-if test "$build_gstreamer" = "yes"; then
+if test "$build_gstreamer" = "yes"; then
AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
if test "x$enable_gstreamer" != "xno"; then
ENABLE_GSTREAMER="TRUE"
AC_MSG_RESULT([yes])
- PKG_CHECK_MODULES( GSTREAMER, gstreamer-0.10 gstreamer-plugins-base-0.10 )
+ PKG_CHECK_MODULES( GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 )
else
AC_MSG_RESULT([no])
fi
fi
-
+AC_SUBST(GSTREAMER_CFLAGS)
+AC_SUBST(GSTREAMER_LIBS)
AC_SUBST(ENABLE_GSTREAMER)
+
+ENABLE_GSTREAMER_0_10=""
+if test "$build_gstreamer_0_10" = "yes"; then
+
+ AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
+ if test "x$enable_gstreamer_0_10" != "xno"; then
+ ENABLE_GSTREAMER_0_10="TRUE"
+ AC_MSG_RESULT([yes])
+ PKG_CHECK_MODULES( GSTREAMER_0_10, gstreamer-0.10 gstreamer-plugins-base-0.10 )
+ else
+ AC_MSG_RESULT([no])
+ fi
+fi
+
+AC_SUBST(GSTREAMER_0_10_CFLAGS)
+AC_SUBST(GSTREAMER_0_10_LIBS)
+AC_SUBST(ENABLE_GSTREAMER_0_10)
+
dnl ===================================================================
dnl Check whether the OpenGL libraries are available
dnl ===================================================================
diff --git a/distro-configs/LibreOfficeAndroid.conf b/distro-configs/LibreOfficeAndroid.conf
index d789052..8acf153 100644
--- a/distro-configs/LibreOfficeAndroid.conf
+++ b/distro-configs/LibreOfficeAndroid.conf
@@ -6,6 +6,7 @@
--disable-ext-report-builder
--disable-gconf
--disable-gnome-vfs
+--disable-gstreamer-0-10
--disable-gstreamer
--disable-lockdown
--disable-mozilla
diff --git a/distro-configs/LibreOfficeLinux.conf b/distro-configs/LibreOfficeLinux.conf
index 21342e4..8e0ff3e 100644
--- a/distro-configs/LibreOfficeLinux.conf
+++ b/distro-configs/LibreOfficeLinux.conf
@@ -26,7 +26,7 @@
--enable-odk
--enable-lockdown
--enable-kde
---enable-gstreamer
+--enable-gstreamer-0-10
--enable-evolution2
--enable-gnome-vfs
--enable-ext-wiki-publisher
diff --git a/distro-configs/LibreOfficeOpenBSD.conf b/distro-configs/LibreOfficeOpenBSD.conf
index f55550a..b03a03f 100644
--- a/distro-configs/LibreOfficeOpenBSD.conf
+++ b/distro-configs/LibreOfficeOpenBSD.conf
@@ -11,7 +11,7 @@
--disable-randr-link
--disable-unix-qstart-libpng
--enable-binfilter
---enable-gstreamer
+--enable-gstreamer-0-10
--enable-lockdown
--enable-ext-presenter-minimizer
--enable-ext-pdfimport
diff --git a/distro-configs/LibreOfficeiOS.conf b/distro-configs/LibreOfficeiOS.conf
index 705cb63..67afb67 100644
--- a/distro-configs/LibreOfficeiOS.conf
+++ b/distro-configs/LibreOfficeiOS.conf
@@ -7,6 +7,7 @@
--disable-extension-integration
--disable-gconf
--disable-gnome-vfs
+--disable-gstreamer-0-10
--disable-gstreamer
--disable-librsvg
--disable-lockdown
diff --git a/distro-configs/OxygenOfficeLinux.conf b/distro-configs/OxygenOfficeLinux.conf
index a9203f2..62cd1d6 100644
--- a/distro-configs/OxygenOfficeLinux.conf
+++ b/distro-configs/OxygenOfficeLinux.conf
@@ -73,7 +73,7 @@
--without-junit
--with-helppack-integration
--enable-odk
---enable-gstreamer
+--enable-gstreamer-0-10
--enable-graphite
--enable-dependency-tracking
--enable-python=internal
diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk
index 09e296b..572d9c2 100644
--- a/postprocess/packcomponents/makefile.mk
+++ b/postprocess/packcomponents/makefile.mk
@@ -403,6 +403,10 @@ my_components += component/connectivity/source/drivers/evoab2/evoab
my_components += component/avmedia/source/gstreamer/avmediagstreamer
.END
+.IF "$(OS)" != "WNT" && "$(ENABLE_GSTREAMER_0_10)" != ""
+my_components += component/avmedia/source/gstreamer/avmediagstreamer_0_10
+.END
+
.INCLUDE: target.mk
ALLTAR : $(MISC)/services.rdb
diff --git a/scp2/InstallModule_ooo.mk b/scp2/InstallModule_ooo.mk
index 0c49414..b6b2a0e 100644
--- a/scp2/InstallModule_ooo.mk
+++ b/scp2/InstallModule_ooo.mk
@@ -152,6 +152,9 @@ $(eval $(call gb_InstallModule_add_defs,scp2/ooo,\
$(if $(filter TRUE,$(ENABLE_GSTREAMER)),\
-DGSTREAMER \
) \
+ $(if $(filter TRUE,$(ENABLE_GSTREAMER_0_10)),\
+ -DGSTREAMER_0_10 \
+ ) \
$(if $(WINDOWS_SDK_HOME),\
-DHAVE_WINDOWS_SDK \
) \
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index 66c50e2..40466b3 100644
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -1415,7 +1415,11 @@ STD_LIB_FILE( gid_File_Lib_AVMedia, avmedia )
#ifdef GSTREAMER
SPECIAL_LIB_FILE_PATCH( gid_File_Lib_AVMediaGStreamer, avmediagst )
-#elif defined WNT
+#endif
+#ifdef GSTREAMER_0_10
+SPECIAL_LIB_FILE_PATCH( gid_File_Lib_AVMediaGStreamer_0_10, avmediagst_0_10 )
+#endif
+#if defined WNT
#ifdef ENABLE_DIRECTX
SPECIAL_LIB_FILE( gid_File_Lib_AVMediaWin, avmediawin )
#endif
diff --git a/scp2/source/ooo/module_hidden_ooo.scp b/scp2/source/ooo/module_hidden_ooo.scp
index 76e062b..ef4c59b 100644
--- a/scp2/source/ooo/module_hidden_ooo.scp
+++ b/scp2/source/ooo/module_hidden_ooo.scp
@@ -203,15 +203,15 @@ Module gid_Module_Root_Files_4
gid_File_Lib_Charttools,
gid_File_Lib_Ctl,
gid_File_Lib_Cui,
- gid_File_Lib_Sdbt,
- gid_File_Lib_Dbmm,
+ gid_File_Lib_Sdbt,
+ gid_File_Lib_Dbmm,
gid_File_Lib_Dba,
gid_File_Lib_Dbase2,
gid_File_Lib_Dbaxml,
gid_File_Lib_Dbt,
gid_File_Lib_Dbfile,
gid_File_Lib_Drawinglayer,
- gid_File_Lib_Editeng,
+ gid_File_Lib_Editeng,
gid_File_Lib_Flat,
gid_File_Lib_For,
gid_File_Lib_Forui,
@@ -250,15 +250,16 @@ Module gid_Module_Root_Files_4
gid_File_Lib_Svx,
gid_File_Lib_AVMedia,
gid_File_Lib_AVMediaWin,
- gid_File_Lib_AVMediaGStreamer,
+ gid_File_Lib_AVMediaGStreamer,
+ gid_File_Lib_AVMediaGStreamer_0_10,
gid_File_Lib_BaseGfx,
- gid_File_Lib_Merged,
+ gid_File_Lib_Merged,
gid_File_Lib_Sysdtrans,
gid_File_Lib_Sw,
gid_File_Lib_TextConversionDlgs,
gid_File_Lib_Tk,
- gid_File_Lib_Acc,
- gid_File_Lib_BaseBmp,
+ gid_File_Lib_Acc,
+ gid_File_Lib_BaseBmp,
gid_File_Lib_Tools,
gid_File_Lib_Utl,
gid_File_Lib_Uui,
@@ -284,8 +285,8 @@ Module gid_Module_Root_Files_4
gid_File_Lib_Fwm,
gid_File_Lib_Lprx2,
gid_File_Lib_Lprxw,
- gid_File_Lib_Libtextcat,
- gid_File_Lib_Guesslang,
+ gid_File_Lib_Libtextcat,
+ gid_File_Lib_Guesslang,
gid_File_Lib_Tfu);
End
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index 3f1f986..b4dec00 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -269,7 +269,7 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContact::createViewIndependentPrimitive2DSequence() const
{
- // This is the default impelemtation and should never be called (see header). If this is called,
+ // This is the default implementation and should never be called (see header). If this is called,
// someone implemented a ViewContact (VC) visualisation object without defining the visualisation by
// providing a seqence of primitives -> which cannot be correct.
// Since we have no access to any known model data here, the default implementation creates a yellow placeholder
--
1.7.11.4

@ -0,0 +1,157 @@
From 03bd2fd7b97f8f8164039203027f89e82c1c4212 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Fri, 10 Aug 2012 08:11:46 +0200
Subject: [PATCH 3/7] make avmedia build with gstreamer-0.10
Change-Id: I6124904cecdb8ea66477f40b6771a103a8058c10
Signed-off-by: David Tardon <dtardon@redhat.com>
---
avmedia/Library_avmediagst_0_10.mk | 65 +++++++++++++++++++++++++++++++++
avmedia/source/gstreamer/gstmanager.cxx | 2 +
avmedia/source/gstreamer/gstplayer.cxx | 8 ++--
configure.in | 2 +-
4 files changed, 73 insertions(+), 4 deletions(-)
create mode 100644 avmedia/Library_avmediagst_0_10.mk
diff --git a/avmedia/Library_avmediagst_0_10.mk b/avmedia/Library_avmediagst_0_10.mk
new file mode 100644
index 0000000..9347c2b
--- /dev/null
+++ b/avmedia/Library_avmediagst_0_10.mk
@@ -0,0 +1,65 @@
+# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# Matúš Kukan <matus.kukan@gmail.com>
+# Portions created by the Initial Developer are Copyright (C) 2011 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+$(eval $(call gb_Library_Library,avmediagst_0_10))
+
+$(eval $(call gb_Library_set_componentfile,avmediagst_0_10,avmedia/source/gstreamer/avmediagstreamer_0_10))
+
+$(eval $(call gb_Library_set_include,avmediagst_0_10,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/avmedia/source/inc \
+ $(GSTREAMER_0_10_CFLAGS) \
+))
+$(eval $(call gb_Library_add_libs,avmediagst_0_10,$(GSTREAMER_0_10_LIBS)))
+
+$(eval $(call gb_Library_use_api,avmediagst_0_10,\
+ offapi \
+ udkapi \
+))
+
+ifeq ($(GUI),WNT)
+$(eval $(call gb_Library_add_defs,avmediagst_0_10,\
+ -DWINNT
+))
+endif
+
+$(eval $(call gb_Library_use_libraries,avmediagst_0_10,\
+ comphelper \
+ cppu \
+ cppuhelper \
+ sal \
+ tl \
+ vcl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,avmediagst_0_10,\
+ avmedia/source/gstreamer/gst_0_10 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/avmedia/source/gstreamer/gstmanager.cxx b/avmedia/source/gstreamer/gstmanager.cxx
index 6b3ffff..f04e5cc 100644
--- a/avmedia/source/gstreamer/gstmanager.cxx
+++ b/avmedia/source/gstreamer/gstmanager.cxx
@@ -34,11 +34,13 @@
#define AVMEDIA_GST_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_GStreamer"
#define AVMEDIA_GST_MANAGER_SERVICENAME "com.sun.star.media.Manager"
+#if !defined DBG
#if OSL_DEBUG_LEVEL > 2
#define DBG OSL_TRACE
#else
#define DBG(...)
#endif
+#endif
using namespace ::com::sun::star;
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index 28e5d34..3654410 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -50,11 +50,13 @@
# define AVVERSION "gst 1.0: "
#endif
-#if 1 //OSL_DEBUG_LEVEL > 2
+#if !defined DBG
+#if OSL_DEBUG_LEVEL > 2
#define DBG(...) do { fprintf (stderr, "%s", AVVERSION); fprintf (stderr, __VA_ARGS__); fprintf (stderr, "\n"); } while (0);
#else
#define DBG(...)
#endif
+#endif
using namespace ::com::sun::star;
@@ -192,7 +194,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
{
// DBG( "%p processSyncMessage has handle: %s", this, GST_MESSAGE_TYPE_NAME( message ) );
-#if 1 // OSL_DEBUG_LEVEL > 0
+#if OSL_DEBUG_LEVEL > 0
if ( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_ERROR )
{
GError* error;
@@ -575,7 +577,7 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize()
DBG( "%p Player::getPreferredPlayerWindowSize, member %d x %d", this, mnWidth, mnHeight );
TimeValue aTimeout = { 10, 0 };
-#if 1 // OSL_DEBUG_LEVEL > 2
+#if OSL_DEBUG_LEVEL > 2
osl::Condition::Result aResult =
#endif
maSizeCondition.wait( &aTimeout );
diff --git a/configure.in b/configure.in
index 46b9892..0b60c3f 100644
--- a/configure.in
+++ b/configure.in
@@ -8971,7 +8971,7 @@ if test "$build_gstreamer_0_10" = "yes"; then
if test "x$enable_gstreamer_0_10" != "xno"; then
ENABLE_GSTREAMER_0_10="TRUE"
AC_MSG_RESULT([yes])
- PKG_CHECK_MODULES( GSTREAMER_0_10, gstreamer-0.10 gstreamer-plugins-base-0.10 )
+ PKG_CHECK_MODULES( GSTREAMER_0_10, gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10 )
else
AC_MSG_RESULT([no])
fi
--
1.7.11.4

@ -0,0 +1,38 @@
From 300a14c4904a97cc217e56231cbcc7134ff036f3 Mon Sep 17 00:00:00 2001
From: Michael Meeks <michael.meeks@suse.com>
Date: Mon, 13 Aug 2012 15:58:26 +0100
Subject: [PATCH 4/7] tweak old-school gstreamer link line
Change-Id: If3f42a53ccfb4829009171c9b8325b2cb06277c2
Signed-off-by: David Tardon <dtardon@redhat.com>
---
avmedia/Library_avmediagst_0_10.mk | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/avmedia/Library_avmediagst_0_10.mk b/avmedia/Library_avmediagst_0_10.mk
index 9347c2b..5e4df70 100644
--- a/avmedia/Library_avmediagst_0_10.mk
+++ b/avmedia/Library_avmediagst_0_10.mk
@@ -35,7 +35,6 @@ $(eval $(call gb_Library_set_include,avmediagst_0_10,\
-I$(SRCDIR)/avmedia/source/inc \
$(GSTREAMER_0_10_CFLAGS) \
))
-$(eval $(call gb_Library_add_libs,avmediagst_0_10,$(GSTREAMER_0_10_LIBS)))
$(eval $(call gb_Library_use_api,avmediagst_0_10,\
offapi \
@@ -58,6 +57,11 @@ $(eval $(call gb_Library_use_libraries,avmediagst_0_10,\
$(gb_STDLIBS) \
))
+$(eval $(call gb_Library_add_libs,avmediagst_0_10,\
+ $(GSTREAMER_0_10_LIBS) \
+ -lgstinterfaces-0.10 \
+))
+
$(eval $(call gb_Library_add_exception_objects,avmediagst_0_10,\
avmedia/source/gstreamer/gst_0_10 \
))
--
1.7.11.4

@ -0,0 +1,30 @@
From 9aa662f549625ae4dd4d9fe2f54a1943923b9774 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
Date: Fri, 31 Aug 2012 16:00:01 +0200
Subject: [PATCH 5/7] Don't fail configure with older
gstreamer-plugins-base-0.10
Change-Id: Ia00293747d6041b86975f0e6539246310abfb957
Signed-off-by: David Tardon <dtardon@redhat.com>
---
configure.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure.in b/configure.in
index 0b60c3f..0351551 100644
--- a/configure.in
+++ b/configure.in
@@ -8971,7 +8971,9 @@ if test "$build_gstreamer_0_10" = "yes"; then
if test "x$enable_gstreamer_0_10" != "xno"; then
ENABLE_GSTREAMER_0_10="TRUE"
AC_MSG_RESULT([yes])
- PKG_CHECK_MODULES( GSTREAMER_0_10, gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10 )
+ PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10],, [
+ PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10] )
+ ])
else
AC_MSG_RESULT([no])
fi
--
1.7.11.4

@ -0,0 +1,137 @@
From d6297345b26d09d9f6caa25109a165c739e1f92b Mon Sep 17 00:00:00 2001
From: Michael Meeks <michael.meeks@suse.com>
Date: Tue, 18 Sep 2012 17:48:10 +0100
Subject: [PATCH 6/7] gstreamer: various fixes for 1.0 and cleanups
always re-create the playbin after the fakeVideo pre-roll to avoid 1.0 issues.
handle the GstVideoOverlay object being created before we get our XID.
set force-aspect-ratio to allow user scaling un-conditionally
Conflicts:
avmedia/source/gstreamer/gstplayer.cxx
Change-Id: I8892b8f7a125c0daa7101e28f274bff3de57ee08
---
avmedia/source/gstreamer/gstplayer.cxx | 46 ++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index 3654410..4bcca8e 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -51,11 +51,11 @@
#endif
#if !defined DBG
-#if OSL_DEBUG_LEVEL > 2
+# if OSL_DEBUG_LEVEL > 2
#define DBG(...) do { fprintf (stderr, "%s", AVVERSION); fprintf (stderr, __VA_ARGS__); fprintf (stderr, "\n"); } while (0);
-#else
+# else
#define DBG(...)
-#endif
+# endif
#endif
using namespace ::com::sun::star;
@@ -207,17 +207,20 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
#ifdef AVMEDIA_GST_0_10
if (message->structure &&
- !strcmp( gst_structure_get_name( message->structure ), "prepare-xwindow-id" ) && mnWindowID != 0 )
+ !strcmp( gst_structure_get_name( message->structure ), "prepare-xwindow-id" ) )
#else
- if (gst_message_has_name (message, "prepare-window-handle") && mnWindowID != 0 )
+ if (gst_is_video_overlay_prepare_window_handle_message (message) )
#endif
{
- DBG( "%p processSyncMessage has handle: %s", this, GST_MESSAGE_TYPE_NAME( message ) );
+ DBG( "%p processSyncMessage prepare window id: %s %d", this,
+ GST_MESSAGE_TYPE_NAME( message ), (int)mnWindowId );
if( mpXOverlay )
g_object_unref( G_OBJECT ( mpXOverlay ) );
+ g_object_set( GST_MESSAGE_SRC( message ), "force-aspect-ratio", FALSE, NULL );
mpXOverlay = GST_VIDEO_OVERLAY( GST_MESSAGE_SRC( message ) );
g_object_ref( G_OBJECT ( mpXOverlay ) );
- gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID );
+ if ( mnWindowID != 0 )
+ gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID );
return GST_BUS_DROP;
}
@@ -301,7 +304,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
mnWidth = w;
mnHeight = h;
- fprintf (stderr, "queried size: %d x %d", mnWidth, mnHeight );
+ DBG( "queried size: %d x %d", mnWidth, mnHeight );
maSizeCondition.set();
}
@@ -310,7 +313,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
}
#endif
} else if( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_ERROR ) {
- fprintf (stderr, "Error !\n");
+ DBG( "Error !\n" );
if( mnWidth == 0 ) {
// an error occurred, set condition so that OOo thread doesn't wait for us
maSizeCondition.set();
@@ -331,9 +334,9 @@ void Player::preparePlaybin( const ::rtl::OUString& rURL, bool bFakeVideo )
}
mpPlaybin = gst_element_factory_make( "playbin", NULL );
-
- if( bFakeVideo )
- g_object_set( G_OBJECT( mpPlaybin ), "video-sink", gst_element_factory_make( "fakesink", NULL ), NULL );
+ if( bFakeVideo ) // used for getting prefered size etc.
+ g_object_set( G_OBJECT( mpPlaybin ), "video-sink",
+ gst_element_factory_make( "fakesink", NULL ), NULL );
mbFakeVideo = bFakeVideo;
@@ -343,7 +346,11 @@ void Player::preparePlaybin( const ::rtl::OUString& rURL, bool bFakeVideo )
pBus = gst_element_get_bus( mpPlaybin );
gst_bus_add_watch( pBus, pipeline_bus_callback, this );
DBG( "%p set sync handler", this );
+#ifdef AVMEDIA_GST_0_10
gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this );
+#else
+ gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this, NULL );
+#endif
g_object_unref( pBus );
}
@@ -582,13 +589,8 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize()
#endif
maSizeCondition.wait( &aTimeout );
- if( mbFakeVideo ) {
- mbFakeVideo = sal_False;
-
- g_object_set( G_OBJECT( mpPlaybin ), "video-sink", NULL, NULL );
- gst_element_set_state( mpPlaybin, GST_STATE_READY );
- gst_element_set_state( mpPlaybin, GST_STATE_PAUSED );
- }
+ if( mbFakeVideo ) // ready ourselves for the real thing
+ preparePlaybin( maURL, false );
DBG( "%p Player::getPreferredPlayerWindowSize after waitCondition %d, member %d x %d", this, aResult, mnWidth, mnHeight );
@@ -624,7 +626,13 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
const SystemEnvData* pEnvData = pParentWindow ? pParentWindow->GetSystemData() : NULL;
OSL_ASSERT(pEnvData);
if (pEnvData)
+ {
mnWindowID = pEnvData->aWindow;
+ DBG( "set window id to %d XOverlay %p\n", (int)mnWindowID, mpXOverlay);
+ gst_element_set_state( mpPlaybin, GST_STATE_PAUSED );
+ if ( mpXOverlay != NULL )
+ gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID );
+ }
}
}
--
1.7.11.4

@ -0,0 +1,45 @@
From 9a54dc0d4db8eab09c9eee01be09815276da3088 Mon Sep 17 00:00:00 2001
From: Michael Meeks <michael.meeks@suse.com>
Date: Tue, 18 Sep 2012 17:29:31 +0100
Subject: [PATCH 7/7] gstreamer: fix leaking pads.
Conflicts:
avmedia/source/gstreamer/gstplayer.cxx
Change-Id: Ie0ffb62c4f75f8af9c2268c07dfabf14ba036115
---
avmedia/source/gstreamer/gstplayer.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index 4bcca8e..448ea2d 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -271,6 +271,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
gst_structure_get_int( pStructure, "height", &mnHeight );
DBG( "queried size: %d x %d", mnWidth, mnHeight );
}
+ g_object_unref (pPad);
}
}
@@ -297,7 +298,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
caps = gst_pad_get_current_caps( pad );
- if( gst_structure_get( gst_caps_get_structure (caps, 0),
+ if( gst_structure_get( gst_caps_get_structure( caps, 0 ),
"width", G_TYPE_INT, &w,
"height", G_TYPE_INT, &h,
NULL ) ) {
@@ -309,6 +310,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
maSizeCondition.set();
}
gst_caps_unref( caps );
+ g_object_unref( pad );
}
}
#endif
--
1.7.11.4

@ -34,7 +34,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.1
Release: 1%{?libo_prerelease}%{?dist}
Release: 2%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic
Group: Applications/Productivity
URL: http://www.documentfoundation.org/develop
@ -88,8 +88,8 @@ BuildRequires: fontpackages-devel
BuildRequires: freetype-devel
BuildRequires: gecko-devel
BuildRequires: graphite2-devel
BuildRequires: gstreamer-devel
BuildRequires: gstreamer-plugins-base-devel
BuildRequires: gstreamer1-devel
BuildRequires: gstreamer1-plugins-base-devel
BuildRequires: gtk2-devel
BuildRequires: hunspell-devel
BuildRequires: hyphen-devel
@ -171,6 +171,13 @@ Patch10: 0001-Resolves-rhbz-836937-insanely-slow-with-Zemberek-ins.patch
Patch11: 0001-Resolves-rhbz-846775-Clipboard-must-be-disposed-befo.patch
Patch13: 0001-Resolves-rhbz-842292-crash-in-calling-callback-whose.patch
Patch14: 0001-Resolves-rhbz-855541-XIOError-handler-multithread-wo.patch
Patch15: 0001-tentative-initial-attempt-at-re-work-for-new-playbin.patch
Patch16: 0002-gstreamer-make-gstreamer-1.0-and-0.10-dual-compile.patch
Patch17: 0003-make-avmedia-build-with-gstreamer-0.10.patch
Patch18: 0004-tweak-old-school-gstreamer-link-line.patch
Patch19: 0005-Don-t-fail-configure-with-older-gstreamer-plugins-ba.patch
Patch20: 0006-gstreamer-various-fixes-for-1.0-and-cleanups.patch
Patch21: 0007-gstreamer-fix-leaking-pads.patch
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%define instdir %{_libdir}
@ -781,6 +788,13 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch11 -p1 -b .rhbz-846775-Clipboard-must-be-disposed-befo.patch
%patch13 -p1 -b .rhbz-842292-crash-in-calling-callback-whose.patch
%patch14 -p1 -b .rhbz-855541-XIOError-handler-multithread-wo.patch
%patch15 -p1 -b .tentative-initial-attempt-at-re-work-for-new-playbin.patch
%patch16 -p1 -b .gstreamer-make-gstreamer-1.0-and-0.10-dual-compile.patch
%patch17 -p1 -b .make-avmedia-build-with-gstreamer-0.10.patch
%patch18 -p1 -b .tweak-old-school-gstreamer-link-line.patch
%patch19 -p1 -b .Don-t-fail-configure-with-older-gstreamer-plugins-ba.patch
%patch20 -p1 -b .gstreamer-various-fixes-for-1.0-and-cleanups.patch
%patch21 -p1 -b .gstreamer-fix-leaking-pads.patch
# TODO: check this
# these are horribly incomplete--empty translations and copied english
@ -841,6 +855,7 @@ touch autogen.lastrun
%{?with_lang} --with-poor-help-localizations="$POORHELPS" \
--with-external-tar=`pwd`/ext_sources --with-java-target-version=1.5 \
--without-system-hsqldb --enable-kde4 \
--disable-gstreamer-0-10 --enable-gstreamer \
%{?with_binfilter:--enable-binfilter} \
--disable-fetch-external
@ -2011,6 +2026,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif
%changelog
* Thu Oct 11 2012 David Tardon <dtardon@redhat.com> - 1:3.6.3.1-2
- Resolves: rhbz#858641 backport gstreamer 1.0 support to F-18
* Thu Oct 11 2012 Caolán McNamara <caolanm@redhat.com> - 1:3.6.3.1-1
- 3.6.3 rc1
- drop integrated 0001-Resolves-rhbz-855972-crash-on-switching-to-outline-v.patch

Loading…
Cancel
Save