From 87b2840b53b749a89e8e96cafbb2bba5814be21c Mon Sep 17 00:00:00 2001 From: maroy Date: Thu, 30 Jun 2005 13:53:54 +0000 Subject: [PATCH] added gstreamer support for playlistExecutor, scheduler and gLiveSupport --- livesupport/etc/Makefile.in | 35 +- .../modules/playlistExecutor/etc/Makefile.in | 41 ++- .../modules/playlistExecutor/etc/configure.ac | 10 +- .../src/AudioPlayerFactory.cxx | 8 +- .../playlistExecutor/src/GstreamerPlayer.cxx | 313 ++---------------- .../playlistExecutor/src/GstreamerPlayer.h | 113 +------ .../src/GstreamerPlayerTest.cxx | 47 ++- .../src/GstreamerPlayerTest.h | 13 +- .../playlistExecutor/var/simpleSmil.smil | 8 +- .../products/gLiveSupport/etc/Makefile.in | 25 +- .../products/gLiveSupport/etc/configure.ac | 10 +- .../products/scheduler/etc/Makefile.in | 25 +- .../products/scheduler/etc/configure.ac | 10 +- 13 files changed, 206 insertions(+), 452 deletions(-) diff --git a/livesupport/etc/Makefile.in b/livesupport/etc/Makefile.in index b5bd53929..a2736f790 100644 --- a/livesupport/etc/Makefile.in +++ b/livesupport/etc/Makefile.in @@ -20,8 +20,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # -# Author : $Author: tomas $ -# Version : $Revision: 1.8 $ +# Author : $Author: maroy $ +# Version : $Revision: 1.9 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/etc/Makefile.in,v $ #------------------------------------------------------------------------------- @@ -94,17 +94,18 @@ TAGLIB_DIR = ${TOOLS_DIR}/taglib TAGLIB_VERSION = taglib-1.3.1 PEAR_DIR = ${TOOLS_DIR}/pear -MODULES_DIR = ${BASE_DIR}/modules -CORE_DIR = ${MODULES_DIR}/core -AUTHENTICATION_DIR = ${MODULES_DIR}/authentication -DB_DIR = ${MODULES_DIR}/db -STORAGE_DIR = ${MODULES_DIR}/storage -PLAYLIST_EXECUTOR_DIR = ${MODULES_DIR}/playlistExecutor -EVENT_SCHEDULER_DIR = ${MODULES_DIR}/eventScheduler -SCHEDULER_CLIENT_DIR = ${MODULES_DIR}/schedulerClient -WIDGETS_DIR = ${MODULES_DIR}/widgets -ARCHIVE_SERVER_DIR = ${MODULES_DIR}/archiveServer -STORAGE_SERVER_DIR = ${MODULES_DIR}/storageServer +MODULES_DIR = ${BASE_DIR}/modules +CORE_DIR = ${MODULES_DIR}/core +AUTHENTICATION_DIR = ${MODULES_DIR}/authentication +DB_DIR = ${MODULES_DIR}/db +STORAGE_DIR = ${MODULES_DIR}/storage +GSTREAMER_ELEMENTS_DIR = ${MODULES_DIR}/gstreamerElements +PLAYLIST_EXECUTOR_DIR = ${MODULES_DIR}/playlistExecutor +EVENT_SCHEDULER_DIR = ${MODULES_DIR}/eventScheduler +SCHEDULER_CLIENT_DIR = ${MODULES_DIR}/schedulerClient +WIDGETS_DIR = ${MODULES_DIR}/widgets +ARCHIVE_SERVER_DIR = ${MODULES_DIR}/archiveServer +STORAGE_SERVER_DIR = ${MODULES_DIR}/storageServer PRODUCTS_DIR = ${BASE_DIR}/products SCHEDULER_DIR = ${PRODUCTS_DIR}/scheduler @@ -150,6 +151,8 @@ flawfinder: ${AUTHENTICATION_DIR}/include ${AUTHENTICATION_DIR}/src \ ${DB_DIR}/include ${DB_DIR}/src \ ${STORAGE_DIR}/include ${STORAGE_DIR}/src \ + ${GSTREAMER_ELEMENTS_DIR}/include \ + ${GSTREAMER_ELEMENTS_DIR}/src \ ${PLAYLIST_EXECUTOR_DIR}/include \ ${PLAYLIST_EXECUTOR_DIR}/src \ ${EVENT_SCHEDULER_DIR}/include ${EVENT_SCHEDULER_DIR}/src \ @@ -179,6 +182,7 @@ ${TMP_DIR}/tools_setup.stamp: ${HELIX_DIR}/${HELIX_VERSION}/bin/install.sh ${GTK_DIR}/${GTK_VERSION}/bin/install.sh ${GTKMM_DIR}/${GTKMM_VERSION}/bin/install.sh + ${GSTREAMER_DIR}/${GSTREAMER_VERSION}/bin/install.sh ${LIBXMLXX_DIR}/${LIBXMLXX_VERSION}/bin/install.sh ${ICU_DIR}/${ICU_VERSION}/bin/install.sh ${CURL_DIR}/${CURL_VERSION}/bin/install.sh @@ -197,6 +201,7 @@ ${TMP_DIR}/modules_setup.stamp: ${AUTHENTICATION_DIR}/bin/autogen.sh ${DB_DIR}/bin/autogen.sh ${STORAGE_DIR}/bin/autogen.sh + ${GSTREAMER_ELEMENTS_DIR}/bin/autogen.sh ${PLAYLIST_EXECUTOR_DIR}/bin/autogen.sh ${EVENT_SCHEDULER_DIR}/bin/autogen.sh ${SCHEDULER_CLIENT_DIR}/bin/autogen.sh @@ -216,6 +221,7 @@ distclean: ${MAKE} -C ${AUTHENTICATION_DIR} distclean ${MAKE} -C ${DB_DIR} distclean ${MAKE} -C ${STORAGE_DIR} distclean + ${MAKE} -C ${GSTREAMER_ELEMENTS_DIR} distclean ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} distclean ${MAKE} -C ${EVENT_SCHEDULER_DIR} distclean ${MAKE} -C ${SCHEDULER_CLIENT_DIR} distclean @@ -231,6 +237,7 @@ depclean: ${MAKE} -C ${AUTHENTICATION_DIR} depclean ${MAKE} -C ${DB_DIR} depclean ${MAKE} -C ${STORAGE_DIR} depclean + ${MAKE} -C ${GSTREAMER_ELEMENTS_DIR} depclean ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} depclean ${MAKE} -C ${EVENT_SCHEDULER_DIR} depclean ${MAKE} -C ${SCHEDULER_CLIENT_DIR} depclean @@ -246,6 +253,7 @@ ${TMP_DIR}/compile.stamp: ${MAKE} -C ${AUTHENTICATION_DIR} all ${MAKE} -C ${DB_DIR} all ${MAKE} -C ${STORAGE_DIR} all + ${MAKE} -C ${GSTREAMER_ELEMENTS_DIR} all ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} all ${MAKE} -C ${EVENT_SCHEDULER_DIR} all ${MAKE} -C ${SCHEDULER_CLIENT_DIR} all @@ -259,6 +267,7 @@ check: -${MAKE} -C ${AUTHENTICATION_DIR} check -${MAKE} -C ${DB_DIR} check -${MAKE} -C ${STORAGE_DIR} check + -${MAKE} -C ${GSTREAMER_ELEMENTS_DIR} check -${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} check -${MAKE} -C ${EVENT_SCHEDULER_DIR} check -${MAKE} -C ${SCHEDULER_CLIENT_DIR} check diff --git a/livesupport/modules/playlistExecutor/etc/Makefile.in b/livesupport/modules/playlistExecutor/etc/Makefile.in index dd1e5510c..1edcad63e 100644 --- a/livesupport/modules/playlistExecutor/etc/Makefile.in +++ b/livesupport/modules/playlistExecutor/etc/Makefile.in @@ -20,8 +20,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # -# Author : $Author: fgerlits $ -# Version : $Revision: 1.14 $ +# Author : $Author: maroy $ +# Version : $Revision: 1.15 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/etc/Makefile.in,v $ # # @configure_input@ @@ -49,6 +49,9 @@ LIB_DIR = ${BASE_DIR}/lib SRC_DIR = ${BASE_DIR}/src TMP_DIR = ${BASE_DIR}/tmp +REAL_BASE_DIR=$(shell cd ${BASE_DIR}; pwd) + + USR_DIR = ${BASE_DIR}/../../usr USR_INCLUDE_DIR = ${USR_DIR}/include USR_LIB_DIR = ${USR_DIR}/lib @@ -72,6 +75,13 @@ CORE_LIB_DIR = ${CORE_DIR}/lib CORE_LIB = livesupport_core CORE_LIB_FILE = ${CORE_LIB_DIR}/lib${CORE_LIB}.a +GSTREAMER_ELEMENTS_DIR = ${MODULES_DIR}/gstreamerElements +GSTREAMER_ELEMENTS_INCLUDE_DIR = ${GSTREAMER_ELEMENTS_DIR}/include +GSTREAMER_ELEMENTS_LIB_DIR = ${GSTREAMER_ELEMENTS_DIR}/lib +GSTREAMER_ELEMENTS_LIB = livesupport_gstreamerelements +GSTREAMER_ELEMENTS_LIB_FILE = ${GSTREAMER_ELEMENTS_LIB_DIR}/lib${GSTREAMER_ELEMENTS_LIB}.a +GST_REAL_LIB_DIR=${REAL_BASE_DIR}/modules/gstreamerElements/lib + VPATH = ${SRC_DIR} LIBXMLPP_CFLAGS=@LIBXMLPP_CFLAGS@ @@ -80,8 +90,8 @@ LIBXMLPP_LIBS=@LIBXMLPP_LIBS@ # TODO: move ICU flag determination to configure script ICU_LIBS=`${USR_DIR}/bin/icu-config --ldflags --ldflags-toolutil --ldflags-icuio` -#GSTREAMER_CFLAGS=@GSTREAMER_CFLAGS@ -#GSTREAMER_LIBS=@GSTREAMER_LIBS@ +GSTREAMER_CFLAGS=@GSTREAMER_CFLAGS@ +GSTREAMER_LIBS=@GSTREAMER_LIBS@ TAGLIB_LIBS =`${USR_DIR}/bin/taglib-config --libs` @@ -97,6 +107,7 @@ TWOTEST_RUNNER = ${TMP_DIR}/twoTestRunner DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config export LD_LIBRARY_PATH:=${LD_LIBRARY_PATH}:${USR_LIB_DIR} +export GST_PLUGIN_PATH=${GST_REAL_LIB_DIR} #------------------------------------------------------------------------------- @@ -111,6 +122,7 @@ CXXFLAGS = @CXXFLAGS@ @DEFS@ @COVERAGE_CXXFLAGS@ -pthread \ -I${USR_INCLUDE_DIR} \ -I${BOOST_INCLUDE_DIR} \ -I${HELIX_INCLUDE_DIR} \ + -I${GSTREAMER_ELEMENTS_INCLUDE_DIR} \ -I${CORE_INCLUDE_DIR} \ -I${INCLUDE_DIR} -I${TMP_DIR} LDFLAGS = @LDFLAGS@ -pthread \ @@ -120,6 +132,7 @@ LDFLAGS = @LDFLAGS@ -pthread \ ${TAGLIB_LIBS} \ -L${USR_LIB_DIR} \ -L${CORE_LIB_DIR} \ + -L${GSTREAMER_ELEMENTS_LIB_DIR} \ -L${HELIX_LIB_DIR} \ -L${LIB_DIR} @@ -134,14 +147,15 @@ PLAYLIST_EXECUTOR_LIB_OBJS = ${TMP_DIR}/HelixPlayer.o \ ${TMP_DIR}/ClientContext.o \ ${TMP_DIR}/ErrorSink.o \ ${TMP_DIR}/HelixIIDs.o \ - ${TMP_DIR}/AudioPlayerFactory.o -# ${TMP_DIR}/GstreamerPlayer.o + ${TMP_DIR}/AudioPlayerFactory.o \ + ${TMP_DIR}/GstreamerPlayer.o TEST_RUNNER_OBJS = ${TMP_DIR}/TestRunner.o \ ${TMP_DIR}/HelixPlayerTest.o \ - ${TMP_DIR}/AudioPlayerFactoryTest.o -# ${TMP_DIR}/AudioPlayerFactoryGstreamerTest.o -# ${TMP_DIR}/GstreamerPlayerTest.o + ${TMP_DIR}/AudioPlayerFactoryTest.o \ + ${TMP_DIR}/AudioPlayerFactoryGstreamerTest.o \ + ${TMP_DIR}/GstreamerPlayerTest.o TEST_RUNNER_LIBS = -l${PLAYLIST_EXECUTOR_LIB} -l${CORE_LIB} \ + -l${GSTREAMER_ELEMENTS_LIB} \ ${HELIX_LIBS} ${TAGLIB_LIBS} \ -lcppunit -ldl -lm -lxmlrpc++ @@ -196,15 +210,20 @@ ${TMP_DIR}: ${DOXYGEN_DIR}: ${MKDIR} ${DOXYGEN_DIR} -${TEST_RUNNER}: ${CORE_LIB_FILE} ${TEST_RUNNER_OBJS} ${PLAYLIST_EXECUTOR_LIB_FILE} +${TEST_RUNNER}: ${CORE_LIB_FILE} ${GSTREAMER_ELEMENTS_LIB_FILE} \ + ${TEST_RUNNER_OBJS} ${PLAYLIST_EXECUTOR_LIB_FILE} ${CXX} ${LDFLAGS} -o $@ ${TEST_RUNNER_OBJS} ${TEST_RUNNER_LIBS} -${TWOTEST_RUNNER}: ${CORE_LIB_FILE} ${TWOTEST_RUNNER_OBJS} ${PLAYLIST_EXECUTOR_LIB_FILE} +${TWOTEST_RUNNER}: ${CORE_LIB_FILE} ${GSTREAMER_ELEMENTS_LIB_FILE} \ + ${TWOTEST_RUNNER_OBJS} ${PLAYLIST_EXECUTOR_LIB_FILE} ${CXX} ${LDFLAGS} -o $@ ${TWOTEST_RUNNER_OBJS} ${TEST_RUNNER_LIBS} ${CORE_LIB_FILE}: ${MAKE} -C ${CORE_DIR} +${GSTREAMER_ELEMENTS_LIB_FILE}: + ${MAKE} -C ${GSTREAMER_ELEMENTS_DIR} + #------------------------------------------------------------------------------- # Pattern rules diff --git a/livesupport/modules/playlistExecutor/etc/configure.ac b/livesupport/modules/playlistExecutor/etc/configure.ac index a47a999e2..4b510bfa3 100644 --- a/livesupport/modules/playlistExecutor/etc/configure.ac +++ b/livesupport/modules/playlistExecutor/etc/configure.ac @@ -21,7 +21,7 @@ dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl dnl Author : $Author: maroy $ -dnl Version : $Revision: 1.7 $ +dnl Version : $Revision: 1.8 $ dnl Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/etc/configure.ac,v $ dnl----------------------------------------------------------------------------- @@ -35,7 +35,7 @@ dnl----------------------------------------------------------------------------- AC_INIT(PlaylistExecutor, 1.0, bugs@campware.org) AC_PREREQ(2.59) AC_COPYRIGHT([Copyright (c) 2004 Media Development Loan Fund under the GNU GPL]) -AC_REVISION($Revision: 1.7 $) +AC_REVISION($Revision: 1.8 $) AC_CONFIG_SRCDIR(../src/HelixPlayer.cxx) @@ -48,9 +48,9 @@ PKG_CHECK_MODULES(LIBXMLPP,[libxml++-2.6 >= 2.6.0]) AC_SUBST(LIBXMLPP_CFLAGS) AC_SUBST(LIBXMLPP_LIBS) -dnl PKG_CHECK_MODULES(GSTREAMER,[gstreamer-0.8 >= 0.8]) -dnl AC_SUBST(GSTREAMER_CFLAGS) -dnl AC_SUBST(GSTREAMER_LIBS) +PKG_CHECK_MODULES(GSTREAMER,[gstreamer-0.8 >= 0.8]) +AC_SUBST(GSTREAMER_CFLAGS) +AC_SUBST(GSTREAMER_LIBS) dnl----------------------------------------------------------------------------- dnl enable compilaton for code coverage data diff --git a/livesupport/modules/playlistExecutor/src/AudioPlayerFactory.cxx b/livesupport/modules/playlistExecutor/src/AudioPlayerFactory.cxx index 5d22d21a5..62b3b9820 100644 --- a/livesupport/modules/playlistExecutor/src/AudioPlayerFactory.cxx +++ b/livesupport/modules/playlistExecutor/src/AudioPlayerFactory.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/AudioPlayerFactory.cxx,v $ ------------------------------------------------------------------------------*/ @@ -35,7 +35,7 @@ #include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h" #include "HelixPlayer.h" -//#include "GstreamerPlayer.h" +#include "GstreamerPlayer.h" using namespace LiveSupport::Core; @@ -106,7 +106,7 @@ AudioPlayerFactory :: configure(const xmlpp::Element & element) return; } -/* + nodes = element.get_children(GstreamerPlayer::getConfigElementName()); if (nodes.size() >= 1) { const xmlpp::Element * configElement = @@ -117,7 +117,7 @@ AudioPlayerFactory :: configure(const xmlpp::Element & element) return; } -*/ + throw std::invalid_argument("no audio player factories to configure"); } diff --git a/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx b/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx index 3a3fc77d1..9b9581cea 100644 --- a/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx +++ b/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx,v $ ------------------------------------------------------------------------------*/ @@ -34,6 +34,7 @@ #endif #include "LiveSupport/Core/TimeConversion.h" +#include "LiveSupport/GstreamerElements/autoplug.h" #include "GstreamerPlayer.h" @@ -56,11 +57,6 @@ const std::string GstreamerPlayer::configElementNameStr = "gstreamerPlayer"; */ static const std::string audioDeviceName = "audioDevice"; -/** - * The factories considered when creating the pipeline - */ -GList * GstreamerPlayer::factories = 0; - /* =============================================== local function prototypes */ @@ -103,7 +99,6 @@ GstreamerPlayer :: initialize(void) throw (std::exception) if (!gst_init_check(0, 0)) { throw std::runtime_error("couldn't initialize the gstreamer library"); } - initFactories(); // initialize the pipeline pipeline = gst_thread_new("audio-player"); @@ -111,88 +106,18 @@ GstreamerPlayer :: initialize(void) throw (std::exception) gst_object_ref(GST_OBJECT(pipeline)); gst_object_sink(GST_OBJECT(pipeline)); - filesrc = gst_element_factory_make("filesrc", "file-source"); - typefinder = gst_element_factory_make("typefind", "typefind"); - gst_element_link(filesrc, typefinder); - gst_bin_add_many(GST_BIN(pipeline), filesrc, typefinder, NULL); - g_signal_connect(pipeline, "error", G_CALLBACK(errorHandler), this); g_signal_connect(pipeline, "state-change", G_CALLBACK(stateChange), this); - g_signal_connect(typefinder, "have-type", G_CALLBACK(typeFound), this); audiosink = gst_element_factory_make("alsasink", "audiosink"); setAudioDevice(audioDevice); + gst_bin_add(GST_BIN(pipeline), audiosink); // set up other variables initialized = true; } -/*------------------------------------------------------------------------------ - * Initialize the list of factories - *----------------------------------------------------------------------------*/ -void -GstreamerPlayer :: initFactories(void) throw () -{ - if (factories) { - return; - } - - factories = gst_registry_pool_feature_filter( - (GstPluginFeatureFilter) featureFilter, FALSE, NULL); - // sort the factories according to their ranks - factories = g_list_sort(factories, (GCompareFunc) compareRanks); -} - - -/*------------------------------------------------------------------------------ - * Filter plugins so that only demixers, decoders and parsers are considered - *----------------------------------------------------------------------------*/ -gboolean -GstreamerPlayer :: featureFilter(GstPluginFeature * feature, - gpointer data) - throw () -{ - const gchar * klass; - guint rank; - - // we only care about element factories - if (!GST_IS_ELEMENT_FACTORY(feature)) { - return FALSE; - } - - // only parsers, demuxers and decoders - klass = gst_element_factory_get_klass(GST_ELEMENT_FACTORY(feature)); - if (g_strrstr(klass, "Demux") == NULL && - g_strrstr(klass, "Decoder") == NULL && - g_strrstr(klass, "Parse") == NULL) { - - return FALSE; - } - - // only select elements with autoplugging rank - rank = gst_plugin_feature_get_rank(feature); - if (rank < GST_RANK_MARGINAL) { - return FALSE; - } - - return TRUE; -} - - -/*------------------------------------------------------------------------------ - * Compare two plugins according to their ranks - *----------------------------------------------------------------------------*/ -gint -GstreamerPlayer :: compareRanks(GstPluginFeature * feature1, - GstPluginFeature * feature2) - throw () -{ - return gst_plugin_feature_get_rank(feature1) - - gst_plugin_feature_get_rank(feature2); -} - - /*------------------------------------------------------------------------------ * Handler for gstreamer errors. *----------------------------------------------------------------------------*/ @@ -209,202 +134,6 @@ GstreamerPlayer :: errorHandler(GstElement * pipeline, } -/*------------------------------------------------------------------------------ - * Handler for the event when a matching type has been found - *----------------------------------------------------------------------------*/ -void -GstreamerPlayer :: typeFound(GstElement * typefinder, - guint probability, - GstCaps * caps, - gpointer self) - throw () -{ - // actually plug now - GstreamerPlayer * player = (GstreamerPlayer*) self; - try { - player->tryToPlug(gst_element_get_pad(typefinder, "src"), caps); - } catch (std::logic_error &e) { - // TODO: handle error - std::cerr << e.what() << std::endl; - } -} - - -/*------------------------------------------------------------------------------ - * Try to plug a matching element to the specified pad - *----------------------------------------------------------------------------*/ -void -GstreamerPlayer :: tryToPlug(GstPad * pad, - const GstCaps * caps) - throw (std::logic_error) -{ - GstObject * parent = GST_OBJECT(gst_pad_get_parent(pad)); - const gchar * mime; - const GList * item; - GstCaps * res; - GstCaps * audiocaps; - - // don't plug if we're already plugged - if (GST_PAD_IS_LINKED(gst_element_get_pad(audiosink, "sink"))) { - throw std::logic_error(std::string("Omitting link for pad ") - + gst_object_get_name(parent) + ":" - + gst_pad_get_name(pad) - + " because we're alreadey linked"); - } - - // only plug audio - mime = gst_structure_get_name(gst_caps_get_structure(caps, 0)); - if (!g_strrstr (mime, "audio")) { - throw std::logic_error(std::string("Omitting link for pad ") - + gst_object_get_name(parent) + ":" - + gst_pad_get_name(pad) - + " because mimetype " - + mime - + " is non-audio"); - } - - // can it link to the audiopad? - audiocaps = gst_pad_get_caps(gst_element_get_pad(audiosink, "sink")); - res = gst_caps_intersect(caps, audiocaps); - if (res && !gst_caps_is_empty(res)) { - closeLink(pad, audiosink, "sink", NULL); - gst_caps_free(audiocaps); - gst_caps_free(res); - return; - } - gst_caps_free(audiocaps); - gst_caps_free(res); - - // try to plug from our list - for (item = factories; item != NULL; item = item->next) { - GstElementFactory * factory = GST_ELEMENT_FACTORY(item->data); - const GList * pads; - - for (pads = gst_element_factory_get_pad_templates (factory); - pads != NULL; - pads = pads->next) { - - GstPadTemplate * templ = GST_PAD_TEMPLATE(pads->data); - - // find the sink template - need an always pad - if (templ->direction != GST_PAD_SINK || - templ->presence != GST_PAD_ALWAYS) { - continue; - } - - // can it link? - res = gst_caps_intersect(caps, templ->caps); - if (res && !gst_caps_is_empty(res)) { - GstElement *element; - - // close link and return - gst_caps_free(res); - element = gst_element_factory_create(factory, NULL); - closeLink(pad, - element, - templ->name_template, - gst_element_factory_get_pad_templates(factory)); - - const gchar *klass = - gst_element_factory_get_klass(GST_ELEMENT_FACTORY(factory)); - if (g_strrstr(klass, "Decoder")) { - // if a decoder element, store it - decoder = element; - decoderSrc = gst_element_get_pad(decoder, "src"); - } - return; - } - gst_caps_free(res); - - // we only check one sink template per factory, so move on to the - // next factory now - break; - } - } - - throw std::logic_error(std::string("No compatible pad found to decode ") - + mime - + " on " - + gst_object_get_name (parent) + ":" - + gst_pad_get_name (pad)); -} - - -/*------------------------------------------------------------------------------ - * Close the element links - *----------------------------------------------------------------------------*/ -void -GstreamerPlayer :: closeLink(GstPad * srcpad, - GstElement * sinkelement, - const gchar * padname, - const GList * templlist) - throw () -{ - gboolean has_dynamic_pads = FALSE; - - // add the element to the pipeline and set correct state - gst_element_set_state(sinkelement, GST_STATE_PAUSED); - gst_bin_add(GST_BIN(pipeline), sinkelement); - gst_pad_link(srcpad, gst_element_get_pad(sinkelement, padname)); - gst_bin_sync_children_state(GST_BIN(pipeline)); - - // if we have static source pads, link those. If we have dynamic - // source pads, listen for new-pad signals on the element - for ( ; templlist != NULL; templlist = templlist->next) { - GstPadTemplate *templ = GST_PAD_TEMPLATE(templlist->data); - - // only sourcepads, no request pads - if (templ->direction != GST_PAD_SRC || - templ->presence == GST_PAD_REQUEST) { - - continue; - } - - switch (templ->presence) { - case GST_PAD_ALWAYS: { - GstPad *pad = gst_element_get_pad(sinkelement, - templ->name_template); - GstCaps *caps = gst_pad_get_caps(pad); - - // link - tryToPlug(pad, caps); - gst_caps_free(caps); - break; - } - - case GST_PAD_SOMETIMES: - has_dynamic_pads = TRUE; - break; - - default: - break; - } - } - - // listen for newly created pads if this element supports that - if (has_dynamic_pads) { - g_signal_connect(sinkelement, "new-pad", G_CALLBACK(newPad), this); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for when a new dynamic pad is created - *----------------------------------------------------------------------------*/ -void -GstreamerPlayer :: newPad(GstElement * element, - GstPad * pad, - gpointer self) - throw () -{ - GstreamerPlayer * player = (GstreamerPlayer*) self; - GstCaps * caps = gst_pad_get_caps(pad); - - player->tryToPlug(pad, caps); - gst_caps_free(caps); -} - - /*------------------------------------------------------------------------------ * Event handler for when the state of the pipeline changes *----------------------------------------------------------------------------*/ @@ -503,6 +232,10 @@ GstreamerPlayer :: open(const std::string fileUrl) { std::string filePath; + if (isOpened()) { + close(); + } + if (fileUrl.find("file:") == 0) { filePath = fileUrl.substr(5, fileUrl.size()); } else if (fileUrl.find("file://") == 0) { @@ -511,7 +244,23 @@ GstreamerPlayer :: open(const std::string fileUrl) throw std::invalid_argument("badly formed URL or unsupported protocol"); } + g_object_ref(G_OBJECT(audiosink)); + gst_bin_remove(GST_BIN(pipeline), audiosink); + + filesrc = gst_element_factory_make("filesrc", "file-source"); g_object_set(G_OBJECT(filesrc), "location", filePath.c_str(), NULL); + + decoder = ls_gst_autoplug_plug_source(filesrc, "decoder"); + + if (!decoder) { + throw std::invalid_argument(std::string("can't open URL ") + fileUrl); + } + + gst_element_link(decoder, audiosink); + gst_bin_add_many(GST_BIN(pipeline), filesrc, decoder, audiosink, NULL); + + gst_element_set_state(pipeline, GST_STATE_PAUSED); + gst_bin_sync_children_state(GST_BIN(pipeline)); } @@ -521,11 +270,7 @@ GstreamerPlayer :: open(const std::string fileUrl) bool GstreamerPlayer :: isOpened(void) throw () { - gchar * str; - - g_object_get(G_OBJECT(filesrc), "location", &str, NULL); - - return str != 0; + return decoder != 0; } @@ -539,8 +284,8 @@ GstreamerPlayer :: getPlaylength(void) throw () gint64 ns; GstFormat format = GST_FORMAT_TIME; - if (decoderSrc - && gst_pad_query(decoderSrc, GST_QUERY_TOTAL, &format, &ns) + if (decoder + && gst_element_query(decoder, GST_QUERY_TOTAL, &format, &ns) && format == GST_FORMAT_TIME) { // use microsec, as nanosec() is not found by the compiler (?) @@ -617,6 +362,12 @@ GstreamerPlayer :: close(void) throw () } gst_element_set_state(pipeline, GST_STATE_NULL); + gst_element_unlink(filesrc, decoder); + gst_element_unlink(decoder, audiosink); + gst_bin_remove(GST_BIN(pipeline), decoder); + gst_bin_remove(GST_BIN(pipeline), filesrc); + filesrc = 0; + decoder = 0; } diff --git a/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h b/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h index bd5292981..30011253f 100644 --- a/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h +++ b/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h,v $ ------------------------------------------------------------------------------*/ @@ -42,7 +42,7 @@ #include -//#include +#include #include "LiveSupport/Core/Configurable.h" #include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h" @@ -86,7 +86,7 @@ using namespace LiveSupport::Core; * * * @author $Author: maroy $ - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ class GstreamerPlayer : virtual public Configurable, virtual public AudioPlayerInterface @@ -107,32 +107,16 @@ class GstreamerPlayer : virtual public Configurable, */ GstElement * filesrc; - /** - * The typefinder element. - */ - GstElement * typefinder; - /** * The decoder element. */ GstElement * decoder; - /** - * The source pad of the decoder element. - * This pad can be used to navigate in a time-based manner. - */ - GstPad * decoderSrc; - /** * The audio sink */ GstElement * audiosink; - /** - * The list of factories considered when creating the pipeline. - */ - static GList * factories; - /** * The URL to play. */ @@ -162,40 +146,6 @@ class GstreamerPlayer : virtual public Configurable, */ ListenerVector listeners; - /** - * Initialize the list of factories that we're interested in - * when creating the pipeline. - */ - static void - initFactories(void) throw (); - - /** - * Filter plugins so that only factories for demuxers, decoders - * and parsers are considered. - * - * @param feature the features of the plugin to check - * @param data not used - * @return true of the supplied feature is a factory for a demuxer, - * decoder or parser, false otherwise - */ - static gboolean - featureFilter(GstPluginFeature * feature, - gpointer data) - throw (); - - /** - * Compare the plugin features according to their rank. - * - * @param feature1 one of the features to compare - * @param feature2 the second feature to compare - * @return 0 of the ranks are equal, <0 if feature1 is ranked lower, - * >0 if feature1 is ranked higher - */ - static gint - compareRanks(GstPluginFeature * feature1, - GstPluginFeature * feature2) - throw (); - /** * Handler to recieve errors from gstreamer. * @@ -212,34 +162,6 @@ class GstreamerPlayer : virtual public Configurable, gchar * debug, gpointer self) throw (); - /** - * Even handler for when a matching type was found by typefineder. - * - * @param typefinder the typefineder that found the match - * @param probability the probability of the match - * @param caps the capabilities of the found match - * @param self pointer to the associated GstreamPlayer object. - */ - static void - typeFound(GstElement * typefinder, - guint probability, - GstCaps * caps, - gpointer self) throw (); - - /** - * Event handler for when a new dynamic pad is found. Plug the found - * pad by calling tryToPlug(). - * - * @param element the element where the new pad came up. - * @param pad the new pad - * @param self reference to the associated GstreamerPlayer object - */ - static void - newPad(GstElement * element, - GstPad * pad, - gpointer self) - throw (); - /** * Event handler for the state change event on the pipeline. * Use this to catch events like playing has ended. @@ -256,33 +178,6 @@ class GstreamerPlayer : virtual public Configurable, gpointer self) throw (); - /** - * Try to plug a matching element to the specified pad - * - * @param pad the pad to plug to - * @param caps find a matching element to these capabilities - * @exception std::logic_error if couldn't plug - */ - void - tryToPlug(GstPad * pad, - const GstCaps * caps) - throw (std::logic_error); - - /** - * Close the link between a source pad and a sink element - * - * @param srcpad the source pad to link up - * @param sinkelement link srcpad to this element - * @param padname use this pad from sinkelement to link to - * @param templlist use pads from these templates - */ - void - closeLink(GstPad * srcpad, - GstElement * sinkelement, - const gchar * padname, - const GList * templlist) - throw (); - /** * Send the onStop event to all attached listeners. */ @@ -307,9 +202,7 @@ class GstreamerPlayer : virtual public Configurable, { pipeline = 0; filesrc = 0; - typefinder = 0; decoder = 0; - decoderSrc = 0; audiosink = 0; initialized = false; } diff --git a/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.cxx b/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.cxx index 5addb2593..3b867b911 100644 --- a/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.cxx +++ b/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -153,6 +153,35 @@ GstreamerPlayerTest :: simplePlayTest(void) } +/*------------------------------------------------------------------------------ + * Play a simple SMIL file + *----------------------------------------------------------------------------*/ +void +GstreamerPlayerTest :: smilTest(void) + throw (CPPUNIT_NS::Exception) +{ + Ptr::Ref sleepT(new time_duration(microseconds(10))); + + player->initialize(); + try { + player->open("file:var/simpleSmil.smil"); + } catch (std::invalid_argument &e) { + CPPUNIT_FAIL(e.what()); + } + CPPUNIT_ASSERT(!player->isPlaying()); + CPPUNIT_ASSERT_NO_THROW( + player->start(); + ); + CPPUNIT_ASSERT(player->isPlaying()); + while (player->isPlaying()) { + TimeConversion::sleep(sleepT); + } + CPPUNIT_ASSERT(!player->isPlaying()); + player->close(); + player->deInitialize(); +} + + /*------------------------------------------------------------------------------ * Check for error conditions *----------------------------------------------------------------------------*/ @@ -274,7 +303,9 @@ GstreamerPlayerTest :: eventListenerTest(void) ); CPPUNIT_ASSERT(!player->isPlaying()); CPPUNIT_ASSERT(!listener1->stopFlag); - player->start(); + CPPUNIT_ASSERT_NO_THROW( + player->start(); + ); CPPUNIT_ASSERT(player->isPlaying()); CPPUNIT_ASSERT(!listener1->stopFlag); while (player->isPlaying()) { @@ -284,6 +315,7 @@ GstreamerPlayerTest :: eventListenerTest(void) CPPUNIT_ASSERT(!player->isPlaying()); CPPUNIT_ASSERT(listener1->stopFlag); listener1->stopFlag = false; + player->close(); // try with two listeners Ptr::Ref listener2(new TestEventListener()); @@ -297,7 +329,9 @@ GstreamerPlayerTest :: eventListenerTest(void) CPPUNIT_ASSERT(!player->isPlaying()); CPPUNIT_ASSERT(!listener1->stopFlag); CPPUNIT_ASSERT(!listener2->stopFlag); - player->start(); + CPPUNIT_ASSERT_NO_THROW( + player->start(); + ); CPPUNIT_ASSERT(player->isPlaying()); CPPUNIT_ASSERT(!listener1->stopFlag); CPPUNIT_ASSERT(!listener2->stopFlag); @@ -311,6 +345,7 @@ GstreamerPlayerTest :: eventListenerTest(void) CPPUNIT_ASSERT(listener2->stopFlag); listener1->stopFlag = false; listener2->stopFlag = false; + player->close(); // try with only the second listener CPPUNIT_ASSERT_NO_THROW( @@ -322,7 +357,9 @@ GstreamerPlayerTest :: eventListenerTest(void) ); CPPUNIT_ASSERT(!player->isPlaying()); CPPUNIT_ASSERT(!listener2->stopFlag); - player->start(); + CPPUNIT_ASSERT_NO_THROW( + player->start(); + ); CPPUNIT_ASSERT(player->isPlaying()); CPPUNIT_ASSERT(!listener2->stopFlag); while (player->isPlaying()) { @@ -332,8 +369,8 @@ GstreamerPlayerTest :: eventListenerTest(void) CPPUNIT_ASSERT(!player->isPlaying()); CPPUNIT_ASSERT(listener2->stopFlag); listener2->stopFlag = false; - player->close(); + player->deInitialize(); } diff --git a/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.h b/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.h index ca202df50..894628efa 100644 --- a/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.h +++ b/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayerTest.h,v $ ------------------------------------------------------------------------------*/ @@ -58,7 +58,7 @@ namespace PlaylistExecutor { * Unit test for the GstreamerPlayer class. * * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @see GstreamerPlayer */ class GstreamerPlayerTest : public CPPUNIT_NS::TestFixture @@ -66,6 +66,7 @@ class GstreamerPlayerTest : public CPPUNIT_NS::TestFixture CPPUNIT_TEST_SUITE(GstreamerPlayerTest); CPPUNIT_TEST(firstTest); CPPUNIT_TEST(simplePlayTest); + CPPUNIT_TEST(smilTest); CPPUNIT_TEST(checkErrorConditions); CPPUNIT_TEST(eventListenerAttachTest); CPPUNIT_TEST(eventListenerTest); @@ -97,6 +98,14 @@ class GstreamerPlayerTest : public CPPUNIT_NS::TestFixture void simplePlayTest(void) throw (CPPUNIT_NS::Exception); + /** + * Play a simple SMIL file. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + smilTest(void) throw (CPPUNIT_NS::Exception); + /** * Check for error conditions. * diff --git a/livesupport/modules/playlistExecutor/var/simpleSmil.smil b/livesupport/modules/playlistExecutor/var/simpleSmil.smil index 070d739fb..cb6c244b7 100644 --- a/livesupport/modules/playlistExecutor/var/simpleSmil.smil +++ b/livesupport/modules/playlistExecutor/var/simpleSmil.smil @@ -1,6 +1,8 @@ - + + - diff --git a/livesupport/products/gLiveSupport/etc/Makefile.in b/livesupport/products/gLiveSupport/etc/Makefile.in index a7323a4b0..62aeebffc 100644 --- a/livesupport/products/gLiveSupport/etc/Makefile.in +++ b/livesupport/products/gLiveSupport/etc/Makefile.in @@ -20,8 +20,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # -# Author : $Author: fgerlits $ -# Version : $Revision: 1.44 $ +# Author : $Author: maroy $ +# Version : $Revision: 1.45 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/etc/Makefile.in,v $ # # @configure_input@ @@ -50,6 +50,9 @@ SRC_DIR = ${BASE_DIR}/src TMP_DIR = ${BASE_DIR}/tmp VAR_DIR = ${BASE_DIR}/var +REAL_BASE_DIR=$(shell cd ${BASE_DIR}; pwd) + + USR_DIR = ${BASE_DIR}/../../usr USR_INCLUDE_DIR = ${USR_DIR}/include USR_LIB_DIR = ${USR_DIR}/lib @@ -103,6 +106,13 @@ SCHEDULER_CLIENT_LIB_DIR = ${SCHEDULER_CLIENT_DIR}/lib SCHEDULER_CLIENT_LIB = livesupport_scheduler_client SCHEDULER_CLIENT_LIB_FILE = ${SCHEDULER_CLIENT_LIB_DIR}/lib${SCHEDULER_CLIENT_LIB}.a +GSTREAMER_ELEMENTS_DIR = ${MODULES_DIR}/gstreamerElements +GSTREAMER_ELEMENTS_INCLUDE_DIR = ${GSTREAMER_ELEMENTS_DIR}/include +GSTREAMER_ELEMENTS_LIB_DIR = ${GSTREAMER_ELEMENTS_DIR}/lib +GSTREAMER_ELEMENTS_LIB = livesupport_gstreamerelements +GSTREAMER_ELEMENTS_LIB_FILE = ${GSTREAMER_ELEMENTS_LIB_DIR}/lib${GSTREAMER_ELEMENTS_LIB}.a +GST_REAL_LIB_DIR=${REAL_BASE_DIR}/modules/gstreamerElements/lib + PLAYLIST_EXECUTOR_DIR = ${MODULES_DIR}/playlistExecutor PLAYLIST_EXECUTOR_INCLUDE_DIR = ${PLAYLIST_EXECUTOR_DIR}/include PLAYLIST_EXECUTOR_LIB_DIR = ${PLAYLIST_EXECUTOR_DIR}/lib @@ -123,8 +133,8 @@ CURL_LIBS=`${USR_DIR}/bin/curl-config --libs` GTKMM_CFLAGS=@GTKMM_CFLAGS@ GTKMM_LIBS=@GTKMM_LIBS@ -#GSTREAMER_CFLAGS=@GSTREAMER_CFLAGS@ -#GSTREAMER_LIBS=@GSTREAMER_LIBS@ +GSTREAMER_CFLAGS=@GSTREAMER_CFLAGS@ +GSTREAMER_LIBS=@GSTREAMER_LIBS@ ICU_CFLAGS= ICU_LIBS=`${USR_DIR}/bin/icu-config --ldflags-toolutil --ldflags-icuio` @@ -144,6 +154,7 @@ TEST_RUNNER = ${TMP_DIR}/testRunner DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config export LD_LIBRARY_PATH:=${LD_LIBRARY_PATH}:${USR_LIB_DIR} +export GST_PLUGIN_PATH=${GST_REAL_LIB_DIR} #------------------------------------------------------------------------------- @@ -164,6 +175,7 @@ CXXFLAGS = @CXXFLAGS@ @DEFS@ @COVERAGE_CXXFLAGS@ -pthread \ -I${STORAGE_INCLUDE_DIR} \ -I${WIDGETS_INCLUDE_DIR} \ -I${SCHEDULER_CLIENT_INCLUDE_DIR} \ + -I${GSTREAMER_ELEMENTS_INCLUDE_DIR} \ -I${PLAYLIST_EXECUTOR_INCLUDE_DIR} \ -I${TMP_DIR} LDFLAGS = @LDFLAGS@ -pthread \ @@ -180,6 +192,7 @@ LDFLAGS = @LDFLAGS@ -pthread \ -L${STORAGE_LIB_DIR} \ -L${WIDGETS_LIB_DIR} \ -L${SCHEDULER_CLIENT_LIB_DIR} \ + -L${GSTREAMER_ELEMENTS_LIB_DIR} \ -L${PLAYLIST_EXECUTOR_LIB_DIR} @@ -219,6 +232,7 @@ G_LIVESUPPORT_EXE_OBJS = ${TMP_DIR}/main.o FSDF = ${G_LIVESUPPORT_OBJS} \ ${TMP_DIR}/main.o G_LIVESUPPORT_EXE_LIBS = -l${PLAYLIST_EXECUTOR_LIB} \ + -l${GSTREAMER_ELEMENTS_LIB} \ -l${AUTHENTICATION_LIB} \ -l${STORAGE_LIB} \ -l${WIDGETS_LIB} \ @@ -338,6 +352,9 @@ ${WIDGETS_LIB_FILE}: ${SCHEDULER_CLIENT_LIB_FILE}: ${MAKE} -C ${SCHEDULER_CLIENT_DIR} +${GSTREAMER_ELEMENTS_LIB_FILE}: + ${MAKE} -C ${GSTREAMER_ELEMENTS_DIR} + ${PLAYLIST_EXECUTOR_LIB_FILE}: ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} diff --git a/livesupport/products/gLiveSupport/etc/configure.ac b/livesupport/products/gLiveSupport/etc/configure.ac index cf4519b5c..cf179e0a1 100644 --- a/livesupport/products/gLiveSupport/etc/configure.ac +++ b/livesupport/products/gLiveSupport/etc/configure.ac @@ -21,7 +21,7 @@ dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl dnl Author : $Author: maroy $ -dnl Version : $Revision: 1.7 $ +dnl Version : $Revision: 1.8 $ dnl Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/etc/configure.ac,v $ dnl----------------------------------------------------------------------------- @@ -35,7 +35,7 @@ dnl----------------------------------------------------------------------------- AC_INIT(gLiveSupport, 0.1, bugs@campware.org) AC_PREREQ(2.59) AC_COPYRIGHT([Copyright (c) 2004 Media Development Loan Fund under the GNU GPL]) -AC_REVISION($Revision: 1.7 $) +AC_REVISION($Revision: 1.8 $) AC_CONFIG_SRCDIR(../src/main.cxx) @@ -53,9 +53,9 @@ PKG_CHECK_MODULES(GTKMM,[gtkmm-2.4 >= 2.4.0]) AC_SUBST(GTKMM_CFLAGS) AC_SUBST(GTKMM_LIBS) -dnl PKG_CHECK_MODULES(GSTREAMER,[gstreamer-0.8 >= 0.8]) -dnl AC_SUBST(GSTREAMER_CFLAGS) -dnl AC_SUBST(GSTREAMER_LIBS) +PKG_CHECK_MODULES(GSTREAMER,[gstreamer-0.8 >= 0.8]) +AC_SUBST(GSTREAMER_CFLAGS) +AC_SUBST(GSTREAMER_LIBS) dnl----------------------------------------------------------------------------- dnl enable compilaton for code coverage data diff --git a/livesupport/products/scheduler/etc/Makefile.in b/livesupport/products/scheduler/etc/Makefile.in index e00012baa..d8d79de8a 100644 --- a/livesupport/products/scheduler/etc/Makefile.in +++ b/livesupport/products/scheduler/etc/Makefile.in @@ -20,8 +20,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # -# Author : $Author: fgerlits $ -# Version : $Revision: 1.59 $ +# Author : $Author: maroy $ +# Version : $Revision: 1.60 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/etc/Makefile.in,v $ # # @configure_input@ @@ -48,6 +48,9 @@ ETC_DIR = ${BASE_DIR}/etc SRC_DIR = ${BASE_DIR}/src TMP_DIR = ${BASE_DIR}/tmp +REAL_BASE_DIR=$(shell cd ${BASE_DIR}; pwd) + + USR_DIR = ${BASE_DIR}/../../usr USR_INCLUDE_DIR = ${USR_DIR}/include USR_LIB_DIR = ${USR_DIR}/lib @@ -67,8 +70,8 @@ LIBXMLPP_CFLAGS=@LIBXMLPP_CFLAGS@ LIBXMLPP_LIBS=@LIBXMLPP_LIBS@ LIBODBCXX_CFLAGS=@LIBODBCXX_CFLAGS@ LIBODBCXX_LIBS=@LIBODBCXX_LIBS@ -#GSTREAMER_CFLAGS=@GSTREAMER_CFLAGS@ -#GSTREAMER_LIBS=@GSTREAMER_LIBS@ +GSTREAMER_CFLAGS=@GSTREAMER_CFLAGS@ +GSTREAMER_LIBS=@GSTREAMER_LIBS@ CURL_LIBS=`${USR_DIR}/bin/curl-config --libs` @@ -107,6 +110,13 @@ STORAGE_LIB_FILE = ${STORAGE_LIB_DIR}/lib${STORAGE_LIB}.a STORAGE_SERVER_DIR = ${MODULES_DIR}/storageServer +GSTREAMER_ELEMENTS_DIR = ${MODULES_DIR}/gstreamerElements +GSTREAMER_ELEMENTS_INCLUDE_DIR = ${GSTREAMER_ELEMENTS_DIR}/include +GSTREAMER_ELEMENTS_LIB_DIR = ${GSTREAMER_ELEMENTS_DIR}/lib +GSTREAMER_ELEMENTS_LIB = livesupport_gstreamerelements +GSTREAMER_ELEMENTS_LIB_FILE = ${GSTREAMER_ELEMENTS_LIB_DIR}/lib${GSTREAMER_ELEMENTS_LIB}.a +GST_REAL_LIB_DIR=${REAL_BASE_DIR}/modules/gstreamerElements/lib + PLAYLIST_EXECUTOR_DIR = ${MODULES_DIR}/playlistExecutor PLAYLIST_EXECUTOR_INCLUDE_DIR = ${PLAYLIST_EXECUTOR_DIR}/include PLAYLIST_EXECUTOR_LIB_DIR = ${PLAYLIST_EXECUTOR_DIR}/lib @@ -133,6 +143,7 @@ TEST_RUNNER_SH = ${BIN_DIR}/run_tests.sh DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config export LD_LIBRARY_PATH:=${LD_LIBRARY_PATH}:${USR_LIB_DIR} +export GST_PLUGIN_PATH=${GST_REAL_LIB_DIR} #------------------------------------------------------------------------------- @@ -151,6 +162,7 @@ CXXFLAGS = @CXXFLAGS@ @DEFS@ @COVERAGE_CXXFLAGS@ -pthread \ -I${AUTHENTICATION_INCLUDE_DIR} \ -I${DB_INCLUDE_DIR} \ -I${STORAGE_INCLUDE_DIR} \ + -I${GSTREAMER_ELEMENTS_INCLUDE_DIR} \ -I${PLAYLIST_EXECUTOR_INCLUDE_DIR} \ -I${EVENT_SCHEDULER_INCLUDE_DIR} \ -I${TMP_DIR} @@ -167,6 +179,7 @@ LDFLAGS = @LDFLAGS@ -pthread \ -L${AUTHENTICATION_LIB_DIR} \ -L${DB_LIB_DIR} \ -L${STORAGE_LIB_DIR} \ + -L${GSTREAMER_ELEMENTS_LIB_DIR} \ -L${PLAYLIST_EXECUTOR_LIB_DIR} \ -L${EVENT_SCHEDULER_LIB_DIR} @@ -210,6 +223,7 @@ SCHEDULER_OBJS = ${TMP_DIR}/SignalDispatcher.o \ SCHEDULER_EXE_OBJS = ${SCHEDULER_OBJS} \ ${TMP_DIR}/main.o SCHEDULER_EXE_LIBS = -l${EVENT_SCHEDULER_LIB} -l${PLAYLIST_EXECUTOR_LIB} \ + -l${GSTREAMER_ELEMENTS_LIB} \ -l${STORAGE_LIB} -l${DB_LIB} -l${AUTHENTICATION_LIB} \ -l${CORE_LIB} \ ${HELIX_LIBS} \ @@ -392,6 +406,9 @@ ${DB_LIB_FILE}: ${STORAGE_LIB_FILE}: ${MAKE} -C ${STORAGE_DIR} +${GSTREAMER_ELEMENTS_LIB_FILE}: + ${MAKE} -C ${GSTREAMER_ELEMENTS_DIR} + ${PLAYLIST_EXECUTOR_LIB_FILE}: ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} diff --git a/livesupport/products/scheduler/etc/configure.ac b/livesupport/products/scheduler/etc/configure.ac index 18fd7e1dd..d7a3f6884 100644 --- a/livesupport/products/scheduler/etc/configure.ac +++ b/livesupport/products/scheduler/etc/configure.ac @@ -21,7 +21,7 @@ dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl dnl Author : $Author: maroy $ -dnl Version : $Revision: 1.9 $ +dnl Version : $Revision: 1.10 $ dnl Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/etc/configure.ac,v $ dnl----------------------------------------------------------------------------- @@ -35,7 +35,7 @@ dnl----------------------------------------------------------------------------- AC_INIT(Scheduler, 0.1, bugs@campware.org) AC_PREREQ(2.59) AC_COPYRIGHT([Copyright (c) 2004 Media Development Loan Fund under the GNU GPL]) -AC_REVISION($Revision: 1.9 $) +AC_REVISION($Revision: 1.10 $) AC_CONFIG_SRCDIR(../src/main.cxx) @@ -50,9 +50,9 @@ PKG_CHECK_MODULES(LIBODBCXX,[libodbc++]) AC_SUBST(LIBXMLPP_CFLAGS) AC_SUBST(LIBXMLPP_LIBS) -dnl PKG_CHECK_MODULES(GSTREAMER,[gstreamer-0.8 >= 0.8]) -dnl AC_SUBST(GSTREAMER_CFLAGS) -dnl AC_SUBST(GSTREAMER_LIBS) +PKG_CHECK_MODULES(GSTREAMER,[gstreamer-0.8 >= 0.8]) +AC_SUBST(GSTREAMER_CFLAGS) +AC_SUBST(GSTREAMER_LIBS) dnl----------------------------------------------------------------------------- dnl enable compilaton for code coverage data