[vlc-devel] [PATCH]v2 codec: Add GStreamer based decoder module

ved kpl ved.kpl at gmail.com
Sat Apr 26 16:50:39 CEST 2014


On Sat, Apr 26, 2014 at 5:59 PM, Jean-Baptiste Kempf <jb at videolan.org>wrote:

> On 26 Apr, Vikram Fugro wrote :
> >  dnl
> > +dnl gstreamer decode plugins
> > +dnl
> > +AC_ARG_ENABLE(gstreamer-decode,
> > +[  --enable-gstreamer-decode        gstreamer decode plugins support,
> currently supports only video decoders (default enabled)])
> > +
> > +dnl
> > +dnl gstreamer core libs, will be mandatory for all types of gstreamer
> based modules
> > +dnl
> > +AS_IF([test "${enable_gstreamer_decode}" != "no"], [
> > +  PKG_CHECK_MODULES(GSTREAMER_APP,[gstreamer-app-1.0], [
> > +  ],[
> > +    AC_MSG_ERROR([${GSTREAMER_APP_PKG_ERRORS}. Please disable all the
> gstreamer based modules to ignore this error.])
> > +  ])
> > +],[
> > +])
> > +
> > +dnl
> > +dnl gstreamer plugins for decoder codec module.
> > +dnl
> > +AS_IF([test "${enable_gstreamer_decode}" != "no"], [
> > +  dnl
> > +  dnl Currently supports only video decoders
> > +  dnl
> > +  PKG_CHECK_MODULES(GSTREAMER_VIDEO,[gstreamer-basevideo-1.0
> gstreamer-video-1.0], [
> > +    VLC_SAVE_FLAGS
> > +    CPPFLAGS="${CPPFLAGS} ${GSTREAMER_VIDEO_CFLAGS}
> ${GSTREAMER_APP_CFLAGS}"
> > +    CFLAGS="${CFLAGS} ${GSTREAMER_VIDEO_CFLAGS} ${GSTREAMER_APP_CFLAGS}"
> > +    VLC_ADD_PLUGIN([gstdecode])
> > +    VLC_ADD_LIBS([gstdecode],[$GSTREAMER_VIDEO_LIBS])
> > +    VLC_ADD_LIBS([gstdecode],[$GSTREAMER_APP_LIBS])
> > +    VLC_RESTORE_FLAGS
> > +  ],[
> > +    AC_MSG_ERROR([${GSTREAMER_VIDEO_PKG_ERRORS}. Pass
> --disable-gstreamer-decode to ignore this error.])
> > +  ])
> > +],[
> > +])
> > +AM_CONDITIONAL([HAVE_GSTREAMER_DECODE], [test
> "${have_gstreamer_decode}" != "no"])
> > +
>
> I prefered the old code:
> PKG_ENABLE_MODULES_VLC([GSTDECODE], [], [gstreamer-app-1.0
>     gstreamer-basevideo-1.0 gstreamer-video-1.0 ], [Gstreamer video
>     decoder], [auto])A

   Vikram: OK.. Remi please let me know if it is fine for you. Also,
gstreamer-basevideo is not required. It is useless here. I'll remove it.

> +#define MODULE_DESCRIPTION N_( "Decoders' plugins " \
> > +        "delivered by the GStreamer library. " \
> > +        "Currently supports only video decoders such as " \
> > +        "h264, mpeg4, wmv, mpeg2, vp8, etc. " )
>
> Do not translate stuff that will change "soon".
> Vikram: OK' I'll just mention "Uses GStreamer framework's plugins to
> decode the media codecs"
>


> > +static gboolean seek_data_cb( GstAppSrc* p_src, guint64 l_offset,
> > +        gpointer p_data )
> > +{
> > +    decoder_t* p_dec = ( decoder_t* )p_data;
> > +    msg_Dbg( p_dec, "appsrc seeking to %llu", (unsigned long
> long)l_offset );
>
> %PRIu64 ?
>
   Vikram: right. will fix that.

>
> > +    return TRUE;
> > +}
> > +
>
> >
> +/*****************************************************************************
> > + * OpenDecoder: probe the decoder and return score
> > +
> *****************************************************************************/
> > +static int OpenDecoder( vlc_object_t *p_this )
> > +{
> > +    decoder_t *p_dec = ( decoder_t* )p_this;
> > +    decoder_sys_t *p_sys;
> > +    GstStateChangeReturn i_ret;
> > +    gboolean b_ret;
> > +    GstCaps* p_caps = NULL;
> > +    GstStructure* p_str = NULL;
> > +    GstAppSrcCallbacks cb;
> > +    int i_rval = VLC_SUCCESS;
> > +    GList* p_list = NULL;
> > +    bool dbin;
> > +
> > +#define VLC_GST_CHECK(r, v, s, t) \
> > +    { if(r == v) { msg_Err(p_dec, s); i_rval = t; goto fail; } }
> > +
> > +    vlc_gst_init ( );
> > +
> > +    p_str = vlc_to_gst_fmt( &p_dec->fmt_in );
> > +    if( !p_str ) {
> > +        return VLC_EGENERIC;
> > +    }
> > +
> > +    /* Allocate the memory needed to store the decoder's structure */
> > +    if( ( p_dec->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) ) ) ==
> NULL )
> > +        return VLC_ENOMEM;
> > +
> > +    dbin = var_CreateGetBool( p_dec, "use-decodebin" );
> > +    msg_Info( p_dec, "Using decodebin? %s", dbin ? "yes ":"no" );
>
> This message is too early. You might fail after.
> Vikram: OK, i'll leave it there only and change info to dbg.
>


> THe rest looks good
> Vikram: Thanks!
>
> With my kindest regards,
>
> T--
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
>

   Thanks,
   Vikram

> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140426/c2c68d74/attachment.html>


More information about the vlc-devel mailing list