How to update configure for gstreamer-1.0

104 views
Skip to first unread message

Steve Cookson

unread,
Mar 31, 2014, 3:46:10 PM3/31/14
to wx-u...@googlegroups.com
Hi Guys,

I`m looking at a script called ¨configure.in¨ in wxPerl.  I`m trying to update it for gstreamer-1.0.  I assume you guys use the same script in wxWidgets install.

What I like to do is make the changes at the wxWidgets end if possible and allow it to cascade through.

I`m going to work on the MediaCtrl section later because I assume that will need to be updated, if only for the playbin2 thing, although really I like to be able to pass a pipeline and replace playbin with gst-parse-launch, which would allow any valid pipeline, but defaulting to playbin2.

In it there is a code-segment that looks like this (unmodified):


dnl ---------------------------------------------------------------------------
dnl wxMediaCtrl
dnl ---------------------------------------------------------------------------

USE_MEDIA=0

if test "$wxUSE_MEDIACTRL" = "yes" -o "$wxUSE_MEDIACTRL" = "auto"; then
    USE_MEDIA=1

    dnl -----------------------------------------------------------------------
    dnl GStreamer
    dnl -----------------------------------------------------------------------
    if test "$wxUSE_GTK" = 1; then
        wxUSE_GSTREAMER="no"

        dnl -------------------------------------------------------------------
        dnl Test for at least 0.8 gstreamer module from pkg-config
        dnl Even totem doesn't accept 0.9 evidently.
        dnl
        dnl So, we first check to see if 0.10 if available - if not we
        dnl try the older 0.8 version
        dnl -------------------------------------------------------------------
        GST_VERSION_MAJOR=0
        GST_VERSION_MINOR=10
        GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR

        if test "$wxUSE_GSTREAMER8" = "no"; then
            PKG_CHECK_MODULES(GST,
                [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION],
                [
                    wxUSE_GSTREAMER="yes"
                    GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION"
                ],
                [
                    AC_MSG_WARN([GStreamer 0.10 not available, falling back to 0.8])
                    GST_VERSION_MINOR=8
                ]
            )
        else
            dnl check only for 0.8
            GST_VERSION_MINOR=8
        fi

        if test $GST_VERSION_MINOR = "8"; then
            GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
            PKG_CHECK_MODULES(GST,
                [gstreamer-$GST_VERSION gstreamer-interfaces-$GST_VERSION gstreamer-gconf-$GST_VERSION],
                wxUSE_GSTREAMER="yes",
                [
                    AC_MSG_WARN([GStreamer 0.8/0.10 not available.])
                ])
        fi


        if test "$wxUSE_GSTREAMER" = "yes"; then
            CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
            EXTRALIBS_MEDIA="$GST_LIBS"

            AC_DEFINE(wxUSE_GSTREAMER)
        else
            USE_MEDIA=0
        fi

    elif test "$wxUSE_MAC" = 1; then 
         dnl We always have the necessary libraries under Mac 
         dnl but we need to link with it explicitly.
         GST_LIBS="-framework QTKit"
    fi

    if test $USE_MEDIA = 1; then
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer"
        AC_DEFINE(wxUSE_MEDIACTRL)
    else
        if test "$wxUSE_MEDIACTRL" = "yes"; then
            AC_MSG_ERROR([GStreamer not available])
        else
            dnl was set to 'auto'
            AC_MSG_WARN([GStreamer not available... disabling wxMediaCtrl])
        fi
    fi
fi


In order to make it install with gstreamer-1.0, I`ve changed it to look like this:


dnl ---------------------------------------------------------------------------
dnl wxMediaCtrl
dnl ---------------------------------------------------------------------------

USE_MEDIA=0

if test "$wxUSE_MEDIACTRL" = "yes" -o "$wxUSE_MEDIACTRL" = "auto"; then
    USE_MEDIA=1

    dnl -----------------------------------------------------------------------
    dnl GStreamer
    dnl -----------------------------------------------------------------------
    if test "$wxUSE_GTK" = 1; then
        wxUSE_GSTREAMER="no"

        dnl -------------------------------------------------------------------
        dnl Test for at least 0.8 gstreamer module from pkg-config
        dnl Even totem doesn't accept 0.9 evidently.
        dnl
        dnl So, we first check to see if 1.0 if available - if not we
        dnl check to see if 0.10 if available - if not we
        dnl try the older 0.8 version
        dnl -------------------------------------------------------------------
        
        GST_VERSION_MAJOR=1
        GST_VERSION_MINOR=0
        GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR

        if test "$wxUSE_GSTREAMER8" = "no"; then
            PKG_CHECK_MODULES(GST,
                [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION],
                [
                    wxUSE_GSTREAMER="yes"
                    GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION"
                ],
                [
                    AC_MSG_WARN([GStreamer 1.0 not available, falling back to 0.10])
                    GST_VERSION_MAJOR=0
                    GST_VERSION_MINOR=10
                    GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
                    PKG_CHECK_MODULES(GST,
     [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION],
     [
 wxUSE_GSTREAMER="yes"
 GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION"
     ],
     [
 AC_MSG_WARN([GStreamer 0.10 not available, falling back to 0.8])
 GST_VERSION_MINOR=8
     ]
 )
                ]
            )
        else
            dnl check only for 0.8
            GST_VERSION_MINOR=8
        fi

       
        if test $GST_VERSION_MINOR = "8"; then
            GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
            PKG_CHECK_MODULES(GST,
                [gstreamer-$GST_VERSION gstreamer-interfaces-$GST_VERSION gstreamer-gconf-$GST_VERSION],
                wxUSE_GSTREAMER="yes",
                [
                    AC_MSG_WARN([GStreamer 0.8/0.10/1.0 not available.])
                ])
        fi


        if test "$wxUSE_GSTREAMER" = "yes"; then
            CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
            EXTRALIBS_MEDIA="$GST_LIBS"

            AC_DEFINE(wxUSE_GSTREAMER)
        else
            USE_MEDIA=0
        fi

    elif test "$wxUSE_MAC" = 1; then 
         dnl We always have the necessary libraries under Mac 
         dnl but we need to link with it explicitly.
         GST_LIBS="-framework QTKit"
    fi

    if test $USE_MEDIA = 1; then
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer"
        AC_DEFINE(wxUSE_MEDIACTRL)
    else
        if test "$wxUSE_MEDIACTRL" = "yes"; then
            AC_MSG_ERROR([GStreamer not available])
        else
            dnl was set to 'auto'
            AC_MSG_WARN([GStreamer not available... disabling wxMediaCtrl])
        fi
    fi
fi


Anyhow I tried it unsuccessfully, even the error messages were wrong so I guess I`ve misunderstood the wxPerl Build logic.

I`m going to talk to the wxPerl people, but in the meantime, is there anything glaringly wrong?

Thanks very much.

What versions are you patching? I`ll send you a patch when it`s done.

Regards,

Steve.

Vadim Zeitlin

unread,
Apr 1, 2014, 7:41:50 AM4/1/14
to wx-u...@googlegroups.com
On Mon, 31 Mar 2014 12:46:10 -0700 (PDT) Steve Cookson wrote:

SC> In it there is a code-segment that looks like this (unmodified):
... 100 lines snipped ...
SC> In order to make it install with gstreamer-1.0, I`ve changed it to look
SC> like this:
... 100+ lines snipped ...

Sorry, this is impossible to read. Please show the diff of the changes
that you made which should be just a few lines.

SC> Anyhow I tried it unsuccessfully, even the error messages were wrong so I
SC> guess I`ve misunderstood the wxPerl Build logic.

The logic is dead simple, configure is just a shell script and to detect
gstreamer 1.0 you just need to add an invocation of PKG_CHECK_MODULES with
the version you want to test for.

Things to keep in mind:

1. After changing configure.in you need to regenerate configure from it,
you can do it by running autoconf manually or use "./autogen.sh" in the
wxWidgets directory.

2. To debug configure:
(a) Look at config.log generated by it.
(b) Edit configure (it's huge and horrible but you just need to find the
place you're interested in, e.g. search for "GStreamer" in it) and
add "set +x"/"set -x" around the part you're debugging.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Steve Cookson

unread,
Apr 1, 2014, 9:36:33 AM4/1/14
to wx-u...@googlegroups.com
Hi Vadim,

Thanks for your answer.

On Tuesday, April 1, 2014 12:41:50 PM UTC+1, Vadim Zeitlin wrote:
>
>
> Sorry, this is impossible to read. Please show the diff of the changes
> that you made which should be just a few lines.
>

I`ll post you something when I`ve played around with it some more.
Regards

Steve.
Reply all
Reply to author
Forward
0 new messages