summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-06-06 18:16:36 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-06-07 11:07:42 +0200
commit6b911ae9eb9484bebbdc1323210020486f5ef33f (patch)
treee5d339616e7a9ca8a7f50245fc189a91e0d5aaca /avmedia
parenta46a257794f1f53b294735fc876c394be23a3811 (diff)
Drop support for gstreamer-0.10
Drop all GStreamer 0.10 support according to ESC decision of 2019-06-06. GStreamer 0.10 is obsolete and no longer needed, superseded by GStreamer 1.0 which is available in baseline (RHEL 7 or CentOS 7) and all relevant distros. Change-Id: Ic317eba04d2c17e141acc983f37fbfa4301c9f3f Reviewed-on: https://gerrit.libreoffice.org/73619 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/Library_avmediagst_0_10.mk46
-rw-r--r--avmedia/Module_avmedia.mk6
-rw-r--r--avmedia/source/gstreamer/avmediagstreamer_0_10.component15
-rw-r--r--avmedia/source/gstreamer/gst_0_10.cxx27
-rw-r--r--avmedia/source/gstreamer/gstframegrabber.cxx33
-rw-r--r--avmedia/source/gstreamer/gstplayer.cxx101
-rw-r--r--avmedia/source/gstreamer/gstuno.cxx9
-rw-r--r--avmedia/source/inc/mediamisc.hxx1
-rw-r--r--avmedia/source/viewer/mediawindow_impl.cxx5
9 files changed, 8 insertions, 235 deletions
diff --git a/avmedia/Library_avmediagst_0_10.mk b/avmedia/Library_avmediagst_0_10.mk
deleted file mode 100644
index 16f2d5db1440..000000000000
--- a/avmedia/Library_avmediagst_0_10.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(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_use_externals,avmediagst_0_10,\
- boost_headers \
- libxml2 \
-))
-
-$(eval $(call gb_Library_use_sdk_api,avmediagst_0_10))
-
-$(eval $(call gb_Library_use_libraries,avmediagst_0_10,\
- comphelper \
- cppu \
- cppuhelper \
- sal \
- salhelper \
- tl \
- vcl \
-))
-
-$(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 \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/avmedia/Module_avmedia.mk b/avmedia/Module_avmedia.mk
index a3a3895f3ec7..9d8895a8eee8 100644
--- a/avmedia/Module_avmedia.mk
+++ b/avmedia/Module_avmedia.mk
@@ -24,12 +24,6 @@ $(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 ($(ENABLE_VLC),TRUE)
$(eval $(call gb_Module_add_targets,avmedia,\
Library_avmediavlc \
diff --git a/avmedia/source/gstreamer/avmediagstreamer_0_10.component b/avmedia/source/gstreamer/avmediagstreamer_0_10.component
deleted file mode 100644
index 849173cea28c..000000000000
--- a/avmedia/source/gstreamer/avmediagstreamer_0_10.component
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
--->
-<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="avmediagst" 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
deleted file mode 100644
index a29c40155622..000000000000
--- a/avmedia/source/gstreamer/gst_0_10.cxx
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#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"
-#include "gstframegrabber.cxx"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx
index def1018baeed..e41386882d20 100644
--- a/avmedia/source/gstreamer/gstframegrabber.cxx
+++ b/avmedia/source/gstreamer/gstframegrabber.cxx
@@ -31,13 +31,8 @@
#include <string>
-#ifdef AVMEDIA_GST_0_10
-# define AVMEDIA_GST_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_GStreamer_0_10"
-# define AVMEDIA_GST_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_GStreamer_0_10"
-#else
-# define AVMEDIA_GST_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_GStreamer"
-# define AVMEDIA_GST_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_GStreamer"
-#endif
+#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;
@@ -58,15 +53,8 @@ FrameGrabber::FrameGrabber( const OUString &rURL ) :
{
gchar *pPipelineStr;
pPipelineStr = g_strdup_printf(
-#ifdef AVMEDIA_GST_0_10
- "uridecodebin uri=%s ! ffmpegcolorspace ! videoscale ! appsink "
- "name=sink caps=\"video/x-raw-rgb,format=RGB,pixel-aspect-ratio=1/1,"
- "bpp=(int)24,depth=(int)24,endianness=(int)4321,"
- "red_mask=(int)0xff0000, green_mask=(int)0x00ff00, blue_mask=(int)0x0000ff\"",
-#else
"uridecodebin uri=%s ! videoconvert ! videoscale ! appsink "
"name=sink caps=\"video/x-raw,format=RGB,pixel-aspect-ratio=1/1\"",
-#endif
OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ).getStr() );
GError *pError = nullptr;
@@ -125,11 +113,6 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe
GstCaps *pCaps = nullptr;
// synchronously fetch the frame
-#ifdef AVMEDIA_GST_0_10
- g_signal_emit_by_name( pSink, "pull-preroll", &pBuf, nullptr );
- if( pBuf )
- pCaps = GST_BUFFER_CAPS( pBuf );
-#else
GstSample *pSample = nullptr;
g_signal_emit_by_name( pSink, "pull-preroll", &pSample, nullptr );
@@ -138,7 +121,6 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe
pBuf = gst_sample_get_buffer( pSample );
pCaps = gst_sample_get_caps( pSample );
}
-#endif
// get geometry
int nWidth = 0, nHeight = 0;
@@ -156,29 +138,18 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe
if( pBuf && nWidth > 0 && nHeight > 0 &&
// sanity check the size
-#ifdef AVMEDIA_GST_0_10
- GST_BUFFER_SIZE( pBuf ) >= static_cast<unsigned>( nWidth * nHeight * 3 )
-#else
gst_buffer_get_size( pBuf ) >= static_cast<unsigned>( nWidth * nHeight * 3 )
-#endif
)
{
sal_uInt8 *pData = nullptr;
-#ifdef AVMEDIA_GST_0_10
- pData = GST_BUFFER_DATA( pBuf );
-#else
GstMapInfo aMapInfo;
gst_buffer_map( pBuf, &aMapInfo, GST_MAP_READ );
pData = aMapInfo.data;
-#endif
int nStride = GST_ROUND_UP_4( nWidth * 3 );
BitmapEx aBmp = vcl::bitmap::CreateFromData(pData, nWidth, nHeight, nStride, 24 );
-#ifndef AVMEDIA_GST_0_10
gst_buffer_unmap( pBuf, &aMapInfo );
-#endif
-
xRet = Graphic( aBmp ).GetXGraphic();
}
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index e12259ad0bec..07b58898e070 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -42,23 +42,14 @@
#include "gstframegrabber.hxx"
#include "gstwindow.hxx"
-#ifdef AVMEDIA_GST_0_10
-# define AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_GStreamer_0_10"
-# define AVMEDIA_GST_PLAYER_SERVICENAME "com.sun.star.media.Player_GStreamer_0_10"
-#else
-# include <gst/video/videooverlay.h>
-# define AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_GStreamer"
-# define AVMEDIA_GST_PLAYER_SERVICENAME "com.sun.star.media.Player_GStreamer"
-#endif
+#include <gst/video/videooverlay.h>
+#define AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_GStreamer"
+#define AVMEDIA_GST_PLAYER_SERVICENAME "com.sun.star.media.Player_GStreamer"
#include <gst/pbutils/missing-plugins.h>
#include <gst/pbutils/pbutils.h>
-#ifdef AVMEDIA_GST_0_10
-# define AVVERSION "gst 0.10: "
-#else
-# define AVVERSION "gst 1.0: "
-#endif
+#define AVVERSION "gst 1.0: "
using namespace ::com::sun::star;
@@ -435,27 +426,15 @@ 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( element, &my_format, cur) && my_format == format && *cur > 0;
-#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( element, &my_format, duration) && my_format == format && *duration > 0;
-#else
return gst_element_query_duration( element, format, duration );
-#endif
}
-#ifndef AVMEDIA_GST_0_10
-
#define LCL_WAYLAND_DISPLAY_HANDLE_CONTEXT_TYPE "GstWaylandDisplayHandleContextType"
static gboolean lcl_is_wayland_display_handle_need_context_message(GstMessage* msg)
@@ -478,8 +457,6 @@ static GstContext* lcl_wayland_display_handle_context_new(void* display)
return context;
}
-#endif
-
GstBusSyncReply Player::processSyncMessage( GstMessage *message )
{
#if OSL_DEBUG_LEVEL > 0
@@ -498,12 +475,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
if (!mbUseGtkSink)
{
-#ifdef AVMEDIA_GST_0_10
- if (message->structure &&
- !strcmp( gst_structure_get_name( message->structure ), "prepare-xwindow-id" ) )
-#else
if (gst_is_video_overlay_prepare_window_handle_message (message) )
-#endif
{
SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " processSyncMessage prepare window id: " <<
GST_MESSAGE_TYPE_NAME( message ) << " " << static_cast<int>(mnWindowID) );
@@ -515,16 +487,13 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
if ( mnWindowID != 0 )
{
gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID );
-#ifndef AVMEDIA_GST_0_10
gst_video_overlay_handle_events(mpXOverlay, 0); // Let the parent window handle events.
if (maArea.Width > 0 && maArea.Height > 0)
gst_video_overlay_set_render_rectangle(mpXOverlay, maArea.X, maArea.Y, maArea.Width, maArea.Height);
-#endif
}
return GST_BUS_DROP;
}
-#ifndef AVMEDIA_GST_0_10
else if (lcl_is_wayland_display_handle_need_context_message(message))
{
GstContext *context = lcl_wayland_display_handle_context_new(mpDisplay);
@@ -532,65 +501,8 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
return GST_BUS_DROP;
}
-#endif
}
-#ifdef AVMEDIA_GST_0_10
- if( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_STATE_CHANGED ) {
- if( message->src == GST_OBJECT( mpPlaybin ) ) {
- GstState newstate, pendingstate;
-
- gst_message_parse_state_changed (message, nullptr, &newstate, &pendingstate);
-
- SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " state change received, new state " << static_cast<int>(newstate) << " pending " << static_cast<int>(pendingstate) );
- if( newstate == GST_STATE_PAUSED &&
- pendingstate == GST_STATE_VOID_PENDING ) {
-
- SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " change to paused received" );
-
- if( mnDuration == 0) {
- gint64 gst_duration = 0;
- if( wrap_element_query_duration( mpPlaybin, GST_FORMAT_TIME, &gst_duration) )
- mnDuration = gst_duration;
- }
-
- if( mnWidth == 0 ) {
- GList *pStreamInfo = nullptr;
-
- g_object_get( G_OBJECT( mpPlaybin ), "stream-info", &pStreamInfo, nullptr );
-
- for ( ; pStreamInfo != nullptr; pStreamInfo = pStreamInfo->next) {
- GObject *pInfo = G_OBJECT( pStreamInfo->data );
-
- if( !pInfo )
- continue;
-
- int nType;
- g_object_get( pInfo, "type", &nType, nullptr );
- GEnumValue *pValue = g_enum_get_value( G_PARAM_SPEC_ENUM( g_object_class_find_property( G_OBJECT_GET_CLASS( pInfo ), "type" ) )->enum_class,
- nType );
-
- if( !g_ascii_strcasecmp( pValue->value_nick, "video" ) ) {
- GstStructure *pStructure;
- GstPad *pPad;
-
- g_object_get( pInfo, "object", &pPad, nullptr );
- pStructure = gst_caps_get_structure( GST_PAD_CAPS( pPad ), 0 );
- if( pStructure ) {
- gst_structure_get_int( pStructure, "width", &mnWidth );
- gst_structure_get_int( pStructure, "height", &mnHeight );
- SAL_INFO( "avmedia.gstreamer", AVVERSION "queried size: " << mnWidth << "x" << mnHeight );
- }
- g_object_unref (pPad);
- }
- }
-
- maSizeCondition.set();
- }
- }
- }
-#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 = 0;
@@ -623,7 +535,6 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
maSizeCondition.set();
}
-#endif // AVMEDIA_GST_0_10
} else if (gst_is_missing_plugin_message(message)) {
TheMissingPluginInstaller::get().report(this, message);
if( mnWidth == 0 ) {
@@ -692,11 +603,7 @@ void Player::preparePlaybin( const OUString& rURL, GstElement *pSink )
mnWatchID = gst_bus_add_watch( pBus, pipeline_bus_callback, this );
mbWatchID = true;
SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " set sync handler" );
-#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, nullptr );
-#endif
g_object_unref( pBus );
}
diff --git a/avmedia/source/gstreamer/gstuno.cxx b/avmedia/source/gstreamer/gstuno.cxx
index 655f076e2cc5..cefdf619a455 100644
--- a/avmedia/source/gstreamer/gstuno.cxx
+++ b/avmedia/source/gstreamer/gstuno.cxx
@@ -27,13 +27,8 @@ 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
+#define IMPL_NAME "com.sun.star.comp.media.Manager_GStreamer"
+#define SERVICE_NAME AVMEDIA_MANAGER_SERVICE_NAME // "com.sun.star.comp.avmedia.Manager_GStreamer"
static uno::Reference< uno::XInterface > create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& )
{
diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx
index 8289aa09d53b..99c230badbb9 100644
--- a/avmedia/source/inc/mediamisc.hxx
+++ b/avmedia/source/inc/mediamisc.hxx
@@ -30,7 +30,6 @@
#ifdef MACOSX
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_MacAVF"
#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
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx
index d76923bf09f8..dfadbd1a2eb0 100644
--- a/avmedia/source/viewer/mediawindow_impl.cxx
+++ b/avmedia/source/viewer/mediawindow_impl.cxx
@@ -195,11 +195,6 @@ uno::Reference<media::XPlayer> MediaWindowImpl::createPlayer(const OUString& rUR
{
AVMEDIA_MANAGER_SERVICE_PREFERRED,
AVMEDIA_MANAGER_SERVICE_NAME,
-// a fallback path just for gstreamer which has
-// two significant versions deployed at once ...
-#ifdef AVMEDIA_MANAGER_SERVICE_NAME_OLD
- AVMEDIA_MANAGER_SERVICE_NAME_OLD
-#endif
};
for (sal_uInt32 i = 0; !xPlayer.is() && i < SAL_N_ELEMENTS( aServiceManagers ); ++i)