[svn r861] removed concatmux element trunk
authorrenatofilho
Mon Sep 24 16:07:47 2007 +0100 (2007-09-24)
branchtrunk
changeset 85516857017fc11
parent 854 871e367c9d90
child 856 07b0a8668009
[svn r861] removed concatmux element
gst-gmyth/concatmux/Makefile.am
gst-gmyth/concatmux/gstconcatmux.c
     1.1 --- a/gst-gmyth/concatmux/Makefile.am	Mon Sep 24 16:06:54 2007 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,19 +0,0 @@
     1.4 -plugin_LTLIBRARIES = libgstconcatmux.la
     1.5 -
     1.6 -libgstconcatmux_la_SOURCES =	\
     1.7 -	gstconcatmux.c 
     1.8 -
     1.9 -libgstconcatmux_la_CFLAGS = \
    1.10 -	$(GST_CFLAGS) \
    1.11 -	$(GST_BASE_CFLAGS) \
    1.12 -	$(GST_PLUGINS_BASE_CFLAGS)
    1.13 -
    1.14 -libgstconcatmux_la_LIBADD = \
    1.15 -	$(GST_LIBS_LIBS)
    1.16 -
    1.17 -libgstconcatmux_la_LDFLAGS = \
    1.18 -	$(GST_LIBS) \
    1.19 -	$(GST_PLUGIN_LDFLAGS) \
    1.20 -	$(GST_BASE_LIBS) \
    1.21 -	$(GST_PLUGINS_BASE_LIBS)
    1.22 -
     2.1 --- a/gst-gmyth/concatmux/gstconcatmux.c	Mon Sep 24 16:06:54 2007 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,554 +0,0 @@
     2.4 -/*
     2.5 - * concat muxer plugin for GStreamer Copyright (C) 2004 Renato Filhps
     2.6 - * <renato.filho@indt.org.br> This library is free software; you can
     2.7 - * redistribute it and/or modify it under the terms of the GNU Library
     2.8 - * General Public License as published by the Free Software Foundation;
     2.9 - * either version 2 of the License, or (at your option) any later version.
    2.10 - * This library is distributed in the hope that it will be useful, but
    2.11 - * WITHOUT ANY WARRANTY; without even the implied warranty of
    2.12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library 
    2.13 - * General Public License for more details. You should have received a copy 
    2.14 - * of the GNU Library General Public License along with this library; if
    2.15 - * not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 
    2.16 - * 330, Boston, MA 02111-1307, USA. 
    2.17 - */
    2.18 -
    2.19 -/**
    2.20 - * SECTION:element-concatmux
    2.21 - * @short_description: Concat that takes one or several digital streams
    2.22 - * and muxes them to a single stream.
    2.23 - *
    2.24 - * <refsect2>
    2.25 - * <title>Sample pipelines</title>
    2.26 - * <para>
    2.27 - * Here is a simple pipeline to concat 2 files into a another file:
    2.28 - * <programlisting>
    2.29 - * gst-launch concatmux name=m ! filesink location=output.txt  filesrc location=file_a.txt !  m. filesrc location=file_b.txt ! m.
    2.30 - * </programlisting>
    2.31 - * </para>
    2.32 - * </refsect2>
    2.33 - */
    2.34 -
    2.35 -#ifdef HAVE_CONFIG_H
    2.36 -#include "config.h"
    2.37 -#endif
    2.38 -
    2.39 -#include <gst/gst.h>
    2.40 -#include <gst/base/gstcollectpads.h>
    2.41 -
    2.42 -#include <string.h>
    2.43 -
    2.44 -GST_DEBUG_CATEGORY_STATIC(gst_concat_mux_debug);
    2.45 -#define GST_CAT_DEFAULT gst_concat_mux_debug
    2.46 -
    2.47 -#define GST_TYPE_CONCAT_MUX (gst_concat_mux_get_type())
    2.48 -#define GST_CONCAT_MUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CONCAT_MUX, GstConcatMux))
    2.49 -#define GST_CONCAT_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CONCAT_MUX, GstConcatMux))
    2.50 -#define GST_IS_CONCAT_MUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CONCAT_MUX))
    2.51 -#define GST_IS_CONCAT_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CONCAT_MUX))
    2.52 -
    2.53 -typedef struct _GstConcatMux GstConcatMux;
    2.54 -typedef struct _GstConcatMuxClass GstConcatMuxClass;
    2.55 -
    2.56 -/**
    2.57 - * GstConcatMux:
    2.58 - *
    2.59 - * The opaque #GstConcatMux structure.
    2.60 - */
    2.61 -struct _GstConcatMux {
    2.62 -    GstElement      element;
    2.63 -
    2.64 -    /*
    2.65 -     * Caps 
    2.66 -     */
    2.67 -    GstCaps        *sink_caps;
    2.68 -
    2.69 -    /*
    2.70 -     * pad 
    2.71 -     */
    2.72 -    GstPad         *srcpad;
    2.73 -    GstPad         *sinkpad;
    2.74 -
    2.75 -    /*
    2.76 -     * sinkpads 
    2.77 -     */
    2.78 -    GSList         *sinks;
    2.79 -    gint            numpads;
    2.80 -
    2.81 -    /*
    2.82 -     * offset in stream 
    2.83 -     */
    2.84 -    guint64         offset;
    2.85 -    guint64         timeoffset;
    2.86 -    guint64         start_time;
    2.87 -
    2.88 -    gboolean        negotiated;
    2.89 -    gboolean        resync;
    2.90 -    gboolean        done;
    2.91 -};
    2.92 -
    2.93 -struct _GstConcatMuxClass {
    2.94 -    GstElementClass parent_class;
    2.95 -};
    2.96 -
    2.97 -/*
    2.98 - * elementfactory information 
    2.99 - */
   2.100 -static const GstElementDetails gst_concat_mux_details =
   2.101 -GST_ELEMENT_DETAILS("Concat muxer",
   2.102 -                    "Codec/Muxer",
   2.103 -                    "mux concat streams",
   2.104 -                    "Renato Filho <renato.filho@indt.org>");
   2.105 -
   2.106 -static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE("src",
   2.107 -                                                                  GST_PAD_SRC,
   2.108 -                                                                  GST_PAD_ALWAYS,
   2.109 -                                                                  GST_STATIC_CAPS_ANY);
   2.110 -
   2.111 -static GstStaticPadTemplate sink_factory =
   2.112 -GST_STATIC_PAD_TEMPLATE("sink_%d",
   2.113 -                        GST_PAD_SINK,
   2.114 -                        GST_PAD_REQUEST,
   2.115 -                        GST_STATIC_CAPS_ANY);
   2.116 -
   2.117 -static void     gst_concat_mux_base_init(gpointer g_class);
   2.118 -static void     gst_concat_mux_class_init(GstConcatMuxClass * klass);
   2.119 -static void     gst_concat_mux_init(GstConcatMux * concat_mux);
   2.120 -
   2.121 -static void     gst_concat_mux_finalize(GObject * object);
   2.122 -
   2.123 -static gboolean gst_concat_mux_handle_src_event(GstPad * pad,
   2.124 -                                                GstEvent * event);
   2.125 -static gboolean gst_concat_mux_handle_sink_event(GstPad * pad,
   2.126 -                                                 GstEvent * event);
   2.127 -
   2.128 -static GstPad  *gst_concat_mux_request_new_pad(GstElement * element,
   2.129 -                                               GstPadTemplate * templ,
   2.130 -                                               const gchar * name);
   2.131 -static GstStateChangeReturn gst_concat_mux_change_state(GstElement *
   2.132 -                                                        element,
   2.133 -                                                        GstStateChange
   2.134 -                                                        transition);
   2.135 -
   2.136 -static GstFlowReturn gst_concat_mux_chain(GstPad * pad, GstBuffer * buf);
   2.137 -static void     gst_concat_mux_clear(GstConcatMux * mux);
   2.138 -
   2.139 -
   2.140 -static GstElementClass *parent_class = NULL;
   2.141 -
   2.142 -GType
   2.143 -gst_concat_mux_get_type(void)
   2.144 -{
   2.145 -    static GType    concat_mux_type = 0;
   2.146 -
   2.147 -    if (!concat_mux_type) {
   2.148 -        static const GTypeInfo concat_mux_info = {
   2.149 -            sizeof(GstConcatMuxClass),
   2.150 -            gst_concat_mux_base_init,
   2.151 -            NULL,
   2.152 -            (GClassInitFunc) gst_concat_mux_class_init,
   2.153 -            NULL,
   2.154 -            NULL,
   2.155 -            sizeof(GstConcatMux),
   2.156 -            0,
   2.157 -            (GInstanceInitFunc) gst_concat_mux_init,
   2.158 -        };
   2.159 -
   2.160 -        concat_mux_type =
   2.161 -            g_type_register_static(GST_TYPE_ELEMENT, "GstConcatMux",
   2.162 -                                   &concat_mux_info, 0);
   2.163 -    }
   2.164 -    return concat_mux_type;
   2.165 -}
   2.166 -
   2.167 -static void
   2.168 -gst_concat_mux_base_init(gpointer g_class)
   2.169 -{
   2.170 -    GstElementClass *element_class = GST_ELEMENT_CLASS(g_class);
   2.171 -
   2.172 -    gst_element_class_add_pad_template(element_class,
   2.173 -                                       gst_static_pad_template_get
   2.174 -                                       (&src_factory));
   2.175 -    gst_element_class_add_pad_template(element_class,
   2.176 -                                       gst_static_pad_template_get
   2.177 -                                       (&sink_factory));
   2.178 -
   2.179 -    gst_element_class_set_details(element_class, &gst_concat_mux_details);
   2.180 -}
   2.181 -
   2.182 -static void
   2.183 -gst_concat_mux_class_init(GstConcatMuxClass * klass)
   2.184 -{
   2.185 -    GObjectClass   *gobject_class;
   2.186 -    GstElementClass *gstelement_class;
   2.187 -
   2.188 -    gobject_class = (GObjectClass *) klass;
   2.189 -    gstelement_class = (GstElementClass *) klass;
   2.190 -
   2.191 -    parent_class = g_type_class_peek_parent(klass);
   2.192 -
   2.193 -    gobject_class->finalize = gst_concat_mux_finalize;
   2.194 -
   2.195 -    gstelement_class->request_new_pad = gst_concat_mux_request_new_pad;
   2.196 -    gstelement_class->change_state = gst_concat_mux_change_state;
   2.197 -}
   2.198 -
   2.199 -static void
   2.200 -gst_concat_mux_init(GstConcatMux * concat_mux)
   2.201 -{
   2.202 -    GstElementClass *klass = GST_ELEMENT_GET_CLASS(concat_mux);
   2.203 -
   2.204 -    concat_mux->srcpad =
   2.205 -        gst_pad_new_from_template(gst_element_class_get_pad_template(klass,
   2.206 -                                                                     "src"),
   2.207 -                                  "src");
   2.208 -    gst_pad_set_event_function(concat_mux->srcpad,
   2.209 -                               gst_concat_mux_handle_src_event);
   2.210 -    gst_element_add_pad(GST_ELEMENT(concat_mux), concat_mux->srcpad);
   2.211 -}
   2.212 -
   2.213 -static void
   2.214 -gst_concat_mux_finalize(GObject * object)
   2.215 -{
   2.216 -    GstConcatMux   *concat_mux;
   2.217 -
   2.218 -    concat_mux = GST_CONCAT_MUX(object);
   2.219 -    gst_concat_mux_clear(GST_CONCAT_MUX(object));
   2.220 -
   2.221 -    G_OBJECT_CLASS(parent_class)->finalize(object);
   2.222 -}
   2.223 -
   2.224 -static void
   2.225 -gst_concat_mux_free_pad(gpointer data, gpointer user_data)
   2.226 -{
   2.227 -    GMutex         *mux;
   2.228 -
   2.229 -    mux = gst_pad_get_element_private(GST_PAD(data));
   2.230 -    g_mutex_unlock(mux);
   2.231 -    g_mutex_free(mux);
   2.232 -    gst_object_unref(GST_OBJECT(data));
   2.233 -}
   2.234 -
   2.235 -static void
   2.236 -gst_concat_mux_clear(GstConcatMux * mux)
   2.237 -{
   2.238 -    mux->resync = TRUE;
   2.239 -    mux->timeoffset = 0;
   2.240 -    mux->offset = 0;
   2.241 -    mux->negotiated = FALSE;
   2.242 -    mux->done = TRUE;
   2.243 -    if (mux->sinks != NULL) {
   2.244 -        g_slist_foreach(mux->sinks, gst_concat_mux_free_pad, mux);
   2.245 -        g_slist_free(mux->sinks);
   2.246 -        mux->sinks = NULL;
   2.247 -    }
   2.248 -}
   2.249 -
   2.250 -
   2.251 -static          GstPadLinkReturn
   2.252 -gst_concat_mux_sinkconnect(GstPad * pad, GstPad * peer)
   2.253 -{
   2.254 -    gchar          *pad_name = NULL;
   2.255 -    GstConcatMux   *concat_mux;
   2.256 -
   2.257 -    concat_mux = GST_CONCAT_MUX(gst_pad_get_parent(pad));
   2.258 -
   2.259 -    if (concat_mux->sink_caps != NULL) {
   2.260 -        GstCaps        *peer_caps = gst_pad_get_caps(peer);
   2.261 -        GstCaps        *intersect;
   2.262 -
   2.263 -        intersect = gst_caps_intersect(concat_mux->sink_caps, peer_caps);
   2.264 -        if (intersect == NULL) {
   2.265 -            gst_caps_unref(peer_caps);
   2.266 -            return GST_PAD_LINK_NOFORMAT;
   2.267 -        }
   2.268 -        gst_caps_unref(peer_caps);
   2.269 -        gst_caps_unref(intersect);
   2.270 -    } else {
   2.271 -        concat_mux->sink_caps = gst_pad_get_caps(pad);
   2.272 -    }
   2.273 -
   2.274 -    pad_name = gst_pad_get_name(pad);
   2.275 -
   2.276 -    GST_DEBUG_OBJECT(concat_mux, "sinkconnect triggered on %s", pad_name);
   2.277 -
   2.278 -    g_free(pad_name);
   2.279 -
   2.280 -    gst_object_unref(concat_mux);
   2.281 -
   2.282 -    return GST_PAD_LINK_OK;
   2.283 -}
   2.284 -
   2.285 -static GstPad  *
   2.286 -gst_concat_mux_request_new_pad(GstElement * element,
   2.287 -                               GstPadTemplate * templ,
   2.288 -                               const gchar * req_name)
   2.289 -{
   2.290 -    GstConcatMux   *concat_mux;
   2.291 -    GstPad         *newpad;
   2.292 -    GstElementClass *klass = GST_ELEMENT_GET_CLASS(element);
   2.293 -    GMutex         *mutex;
   2.294 -
   2.295 -    g_return_val_if_fail(templ != NULL, NULL);
   2.296 -
   2.297 -    if (templ->direction != GST_PAD_SINK) {
   2.298 -        g_warning("concat_mux: request pad that is not a SINK pad\n");
   2.299 -        return NULL;
   2.300 -    }
   2.301 -
   2.302 -    g_return_val_if_fail(GST_IS_CONCAT_MUX(element), NULL);
   2.303 -
   2.304 -    concat_mux = GST_CONCAT_MUX(element);
   2.305 -
   2.306 -    if (templ == gst_element_class_get_pad_template(klass, "sink_%d")) {
   2.307 -        gchar          *name;
   2.308 -
   2.309 -        /*
   2.310 -         * create new pad with the name 
   2.311 -         */
   2.312 -        name = g_strdup_printf("sink_%02d", concat_mux->numpads);
   2.313 -        g_debug("NEw pad %s", name);
   2.314 -        newpad = gst_pad_new_from_template(templ, name);
   2.315 -        g_free(name);
   2.316 -        concat_mux->sinks = g_slist_append(concat_mux->sinks, newpad);
   2.317 -        g_debug("New sink %p / %d", newpad,
   2.318 -                g_slist_length(concat_mux->sinks));
   2.319 -        concat_mux->numpads++;
   2.320 -    } else {
   2.321 -        g_warning("concat_mux: this is not our template!\n");
   2.322 -        return NULL;
   2.323 -    }
   2.324 -
   2.325 -    mutex = g_mutex_new();
   2.326 -
   2.327 -    if (concat_mux->sinkpad == NULL) {
   2.328 -        concat_mux->sinkpad = newpad;
   2.329 -    } else {
   2.330 -        g_mutex_lock(mutex);
   2.331 -    }
   2.332 -
   2.333 -    gst_pad_set_element_private(newpad, mutex);
   2.334 -    /*
   2.335 -     * setup some pad functions 
   2.336 -     */
   2.337 -    gst_pad_set_link_function(newpad, gst_concat_mux_sinkconnect);
   2.338 -    gst_pad_set_event_function(newpad, gst_concat_mux_handle_sink_event);
   2.339 -    gst_pad_set_chain_function(newpad, gst_concat_mux_chain);
   2.340 -
   2.341 -    /*
   2.342 -     * add the pad to the element 
   2.343 -     */
   2.344 -    gst_element_add_pad(element, newpad);
   2.345 -
   2.346 -    return newpad;
   2.347 -}
   2.348 -
   2.349 -/*
   2.350 - * handle events 
   2.351 - */
   2.352 -static          gboolean
   2.353 -gst_concat_mux_handle_src_event(GstPad * pad, GstEvent * event)
   2.354 -{
   2.355 -    GstConcatMux   *concat_mux;
   2.356 -    GstEventType    type;
   2.357 -
   2.358 -    concat_mux = GST_CONCAT_MUX(gst_pad_get_parent(pad));
   2.359 -
   2.360 -    type = event ? GST_EVENT_TYPE(event) : GST_EVENT_UNKNOWN;
   2.361 -
   2.362 -    switch (type) {
   2.363 -    case GST_EVENT_SEEK:
   2.364 -        /*
   2.365 -         * disable seeking for now 
   2.366 -         */
   2.367 -        return FALSE;
   2.368 -    default:
   2.369 -        break;
   2.370 -    }
   2.371 -
   2.372 -    gst_object_unref(concat_mux);
   2.373 -
   2.374 -    return gst_pad_event_default(pad, event);
   2.375 -}
   2.376 -
   2.377 -/*
   2.378 - * handle events 
   2.379 - */
   2.380 -static          gboolean
   2.381 -gst_concat_mux_handle_sink_event(GstPad * pad, GstEvent * event)
   2.382 -{
   2.383 -    GstConcatMux   *mux;
   2.384 -    GstEventType    type;
   2.385 -
   2.386 -    mux = GST_CONCAT_MUX(gst_pad_get_parent(pad));
   2.387 -
   2.388 -    type = event ? GST_EVENT_TYPE(event) : GST_EVENT_UNKNOWN;
   2.389 -
   2.390 -    switch (type) {
   2.391 -    case GST_EVENT_EOS:
   2.392 -        {
   2.393 -            mux->resync = TRUE;
   2.394 -            g_debug("sink EOS %p / %d", pad, g_slist_length(mux->sinks));
   2.395 -            /*
   2.396 -             * mark pad eos 
   2.397 -             */
   2.398 -            mux->sinks = g_slist_remove(mux->sinks, pad);
   2.399 -            g_debug("sink len %d", g_slist_length(mux->sinks));
   2.400 -            if (g_slist_length(mux->sinks) != 0) {
   2.401 -                GMutex         *mutex;
   2.402 -                mux->sinkpad = mux->sinks->data;
   2.403 -                mutex =
   2.404 -                    (GMutex *) gst_pad_get_element_private(mux->sinkpad);
   2.405 -                g_mutex_unlock(mutex);
   2.406 -                g_debug("sink pad %p", mux->sinkpad);
   2.407 -                return TRUE;
   2.408 -            }
   2.409 -
   2.410 -            g_debug("sink list is empty");
   2.411 -        }
   2.412 -    default:
   2.413 -        break;
   2.414 -    }
   2.415 -
   2.416 -    gst_object_unref(mux);
   2.417 -
   2.418 -    return gst_pad_event_default(pad, event);
   2.419 -}
   2.420 -
   2.421 -static          GstFlowReturn
   2.422 -gst_concat_mux_chain(GstPad * pad, GstBuffer * buf)
   2.423 -{
   2.424 -    GstConcatMux   *mux = (GstConcatMux *) GST_PAD_PARENT(pad);
   2.425 -    GstBuffer      *databuf = NULL;
   2.426 -    GstFlowReturn   ret = GST_FLOW_OK;
   2.427 -    GMutex         *mutex;
   2.428 -
   2.429 -
   2.430 -    mutex = (GMutex *) gst_pad_get_element_private(pad);
   2.431 -
   2.432 -    g_mutex_lock(mutex);
   2.433 -    if (mux->done) {
   2.434 -        g_debug("DONE pad %p", pad);
   2.435 -        g_mutex_unlock(mutex);
   2.436 -        return GST_FLOW_OK;
   2.437 -    }
   2.438 -
   2.439 -    databuf = gst_buffer_make_metadata_writable(buf);
   2.440 -
   2.441 -    if (!mux->negotiated) {
   2.442 -        /*
   2.443 -         * GstCaps *newcaps; newcaps = gst_pad_get_caps (mux->sinkpad);
   2.444 -         * 
   2.445 -         * g_debug ("CAPS: %s",gst_caps_to_string (newcaps));
   2.446 -         * 
   2.447 -         * if (!gst_pad_set_caps (mux->srcpad, newcaps)) goto nego_error; 
   2.448 -         */
   2.449 -        mux->negotiated = TRUE;
   2.450 -    }
   2.451 -
   2.452 -    /*
   2.453 -     * g_debug ("Running [%s]\n" "\tTOFFSET [%"G_GUINT64_FORMAT"]\n"
   2.454 -     * "\tB_TSTAMP [%"G_GUINT64_FORMAT"]\n" "\tB_DURATION
   2.455 -     * [%"G_GUINT64_FORMAT"]\n" "\tOFFSET [%"G_GUINT64_FORMAT"]\n"
   2.456 -     * "\tB_OFFSET [%"G_GUINT64_FORMAT"]", gst_element_get_name (mux),
   2.457 -     * mux->timeoffset, GST_BUFFER_TIMESTAMP (databuf),
   2.458 -     * GST_BUFFER_DURATION (databuf), mux->offset, GST_BUFFER_OFFSET
   2.459 -     * (databuf)); 
   2.460 -     */
   2.461 -
   2.462 -
   2.463 -    if (mux->resync) {
   2.464 -        g_debug("RESYNC [%s]", gst_element_get_name(mux));
   2.465 -        mux->timeoffset += GST_BUFFER_TIMESTAMP(databuf);
   2.466 -        GST_BUFFER_TIMESTAMP(databuf) = mux->timeoffset;
   2.467 -        mux->timeoffset += GST_BUFFER_DURATION(databuf);
   2.468 -
   2.469 -        mux->offset += GST_BUFFER_OFFSET(databuf);
   2.470 -        GST_BUFFER_OFFSET(databuf) = mux->offset;
   2.471 -        mux->offset += GST_BUFFER_SIZE(databuf);
   2.472 -        mux->resync = FALSE;
   2.473 -    } else {
   2.474 -
   2.475 -        GST_BUFFER_TIMESTAMP(databuf) = mux->timeoffset;
   2.476 -        mux->timeoffset += GST_BUFFER_DURATION(databuf);
   2.477 -
   2.478 -        GST_BUFFER_OFFSET(databuf) = mux->offset;
   2.479 -        mux->offset += GST_BUFFER_SIZE(databuf);
   2.480 -    }
   2.481 -
   2.482 -    gst_buffer_set_caps(databuf, GST_PAD_CAPS(pad));
   2.483 -    ret = gst_pad_push(mux->srcpad, databuf);
   2.484 -
   2.485 -    // gst_buffer_unref (buf);
   2.486 -
   2.487 -    g_mutex_unlock(mutex);
   2.488 -    return ret;
   2.489 -    /*
   2.490 -     * nego_error: { GST_WARNING_OBJECT (mux, "failed to set caps");
   2.491 -     * GST_ELEMENT_ERROR (mux, CORE, NEGOTIATION, (NULL), (NULL)); return
   2.492 -     * GST_FLOW_NOT_NEGOTIATED; } 
   2.493 -     */
   2.494 -    /*
   2.495 -     * no_caps: { GST_WARNING_OBJECT (mux, "no caps on the incoming buffer 
   2.496 -     * %p", best->buffer); GST_ELEMENT_ERROR (mux, CORE, NEGOTIATION,
   2.497 -     * (NULL), (NULL)); ret = GST_FLOW_NOT_NEGOTIATED; goto beach; } 
   2.498 -     */
   2.499 -}
   2.500 -
   2.501 -static          GstStateChangeReturn
   2.502 -gst_concat_mux_change_state(GstElement * element,
   2.503 -                            GstStateChange transition)
   2.504 -{
   2.505 -    GstConcatMux   *concat_mux;
   2.506 -    GstStateChangeReturn ret;
   2.507 -
   2.508 -    concat_mux = GST_CONCAT_MUX(element);
   2.509 -
   2.510 -    switch (transition) {
   2.511 -    case GST_STATE_CHANGE_READY_TO_PAUSED:
   2.512 -        concat_mux->done = FALSE;
   2.513 -        concat_mux->resync = TRUE;
   2.514 -        GST_DEBUG_OBJECT(concat_mux, "starting collect pads");
   2.515 -        break;
   2.516 -    case GST_STATE_CHANGE_PAUSED_TO_READY:
   2.517 -        GST_DEBUG_OBJECT(concat_mux, "stopping collect pads");
   2.518 -        gst_concat_mux_clear(concat_mux);
   2.519 -        break;
   2.520 -    default:
   2.521 -        break;
   2.522 -    }
   2.523 -
   2.524 -    ret =
   2.525 -        GST_ELEMENT_CLASS(parent_class)->change_state(element, transition);
   2.526 -    if (ret == GST_STATE_CHANGE_FAILURE)
   2.527 -        return ret;
   2.528 -
   2.529 -    switch (transition) {
   2.530 -    default:
   2.531 -        break;
   2.532 -    }
   2.533 -
   2.534 -    return ret;
   2.535 -}
   2.536 -
   2.537 -gboolean
   2.538 -gst_concat_mux_plugin_init(GstPlugin * plugin)
   2.539 -{
   2.540 -#ifdef ENABLE_NLS
   2.541 -    setlocale(LC_ALL, "");
   2.542 -    bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
   2.543 -#endif                          /* ENABLE_NLS */
   2.544 -
   2.545 -    GST_DEBUG_CATEGORY_INIT(gst_concat_mux_debug, "concatmux", 0,
   2.546 -                            "concat muxer");
   2.547 -
   2.548 -    return gst_element_register(plugin, "concatmux", GST_RANK_NONE,
   2.549 -                                GST_TYPE_CONCAT_MUX);
   2.550 -}
   2.551 -
   2.552 -GST_PLUGIN_DEFINE(GST_VERSION_MAJOR,
   2.553 -                  GST_VERSION_MINOR,
   2.554 -                  "concatmux",
   2.555 -                  "Concat streamers",
   2.556 -                  gst_concat_mux_plugin_init, VERSION, GST_LICENSE,
   2.557 -                  GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)