mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
Ok, all // comments removed except the bloddy nested ones
Original commit message from CVS: Ok, all // comments removed except the bloddy nested ones
This commit is contained in:
parent
b92cdd41c4
commit
3f55af9bb4
5 changed files with 116 additions and 115 deletions
|
@ -28,7 +28,7 @@ void have_type(GstElement *element, GstCaps *caps, GstCaps **private_caps) {
|
|||
|
||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||
|
||||
// disconnect the typefind from the pipeline and remove it
|
||||
/* disconnect the typefind from the pipeline and remove it */
|
||||
gst_element_disconnect(cache,"src",typefind,"sink");
|
||||
gst_bin_remove(GST_BIN(autobin),typefind);
|
||||
|
||||
|
|
|
@ -134,13 +134,13 @@ gst_autoplugcache_class_init (GstAutoplugCacheClass *klass)
|
|||
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BUFFER_COUNT,
|
||||
g_param_spec_int("buffer_count","buffer_count","buffer_count",
|
||||
0,G_MAXINT,0,G_PARAM_READABLE)); // CHECKME!
|
||||
0,G_MAXINT,0,G_PARAM_READABLE)); /* CHECKME! */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CAPS_PROXY,
|
||||
g_param_spec_boolean("caps_proxy","caps_proxy","caps_proxy",
|
||||
FALSE,G_PARAM_READWRITE)); // CHECKME!
|
||||
FALSE,G_PARAM_READWRITE)); /* CHECKME! */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_RESET,
|
||||
g_param_spec_boolean("reset","reset","reset",
|
||||
FALSE,G_PARAM_WRITABLE)); // CHECKME!
|
||||
FALSE,G_PARAM_WRITABLE)); /* CHECKME! */
|
||||
|
||||
gst_autoplugcache_signals[FIRST_BUFFER] =
|
||||
g_signal_new ("first_buffer", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
|
||||
|
@ -164,16 +164,16 @@ gst_autoplugcache_init (GstAutoplugCache *cache)
|
|||
gst_element_set_loop_function(GST_ELEMENT(cache), GST_DEBUG_FUNCPTR(gst_autoplugcache_loop));
|
||||
|
||||
cache->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
||||
// gst_pad_set_negotiate_function (cache->sinkpad, gst_autoplugcache_nego_sink);
|
||||
/* gst_pad_set_negotiate_function (cache->sinkpad, gst_autoplugcache_nego_sink); */
|
||||
gst_element_add_pad (GST_ELEMENT(cache), cache->sinkpad);
|
||||
|
||||
cache->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||
// gst_pad_set_negotiate_function (cache->srcpad, gst_autoplugcache_nego_src);
|
||||
/* gst_pad_set_negotiate_function (cache->srcpad, gst_autoplugcache_nego_src); */
|
||||
gst_element_add_pad (GST_ELEMENT(cache), cache->srcpad);
|
||||
|
||||
cache->caps_proxy = FALSE;
|
||||
|
||||
// provide a zero basis for the cache
|
||||
/* provide a zero basis for the cache */
|
||||
cache->cache = g_list_prepend(NULL, NULL);
|
||||
cache->cache_start = cache->cache;
|
||||
cache->buffer_count = 0;
|
||||
|
@ -204,29 +204,29 @@ gst_autoplugcache_loop (GstElement *element)
|
|||
*/
|
||||
|
||||
do {
|
||||
// the first time through, the current_playout pointer is going to be NULL
|
||||
/* the first time through, the current_playout pointer is going to be NULL */
|
||||
if (cache->current_playout == NULL) {
|
||||
// get a buffer
|
||||
/* get a buffer */
|
||||
buf = gst_pad_pull (cache->sinkpad);
|
||||
|
||||
// add it to the cache, though cache == NULL
|
||||
/* add it to the cache, though cache == NULL */
|
||||
gst_buffer_ref (buf);
|
||||
cache->cache = g_list_prepend (cache->cache, buf);
|
||||
cache->buffer_count++;
|
||||
|
||||
// set the current_playout pointer
|
||||
/* set the current_playout pointer */
|
||||
cache->current_playout = cache->cache;
|
||||
|
||||
g_signal_emit (G_OBJECT(cache), gst_autoplugcache_signals[FIRST_BUFFER], 0, buf);
|
||||
|
||||
// send the buffer on its way
|
||||
/* send the buffer on its way */
|
||||
gst_pad_push (cache->srcpad, buf);
|
||||
}
|
||||
|
||||
// the steady state is where the playout is at the front of the cache
|
||||
/* the steady state is where the playout is at the front of the cache */
|
||||
else if (g_list_previous(cache->current_playout) == NULL) {
|
||||
|
||||
// if we've been told to fire an empty signal (after a reset)
|
||||
/* if we've been told to fire an empty signal (after a reset) */
|
||||
if (cache->fire_empty) {
|
||||
int oldstate = GST_STATE(cache);
|
||||
GST_DEBUG(0,"at front of cache, about to pull, but firing signal\n");
|
||||
|
@ -240,24 +240,24 @@ gst_autoplugcache_loop (GstElement *element)
|
|||
gst_object_unref (GST_OBJECT (cache));
|
||||
}
|
||||
|
||||
// get a buffer
|
||||
/* get a buffer */
|
||||
buf = gst_pad_pull (cache->sinkpad);
|
||||
|
||||
// add it to the front of the cache
|
||||
/* add it to the front of the cache */
|
||||
gst_buffer_ref (buf);
|
||||
cache->cache = g_list_prepend (cache->cache, buf);
|
||||
cache->buffer_count++;
|
||||
|
||||
// set the current_playout pointer
|
||||
/* set the current_playout pointer */
|
||||
cache->current_playout = cache->cache;
|
||||
|
||||
// send the buffer on its way
|
||||
/* send the buffer on its way */
|
||||
gst_pad_push (cache->srcpad, buf);
|
||||
}
|
||||
|
||||
// otherwise we're trundling through existing cached buffers
|
||||
/* otherwise we're trundling through existing cached buffers */
|
||||
else {
|
||||
// move the current_playout pointer
|
||||
/* move the current_playout pointer */
|
||||
cache->current_playout = g_list_previous (cache->current_playout);
|
||||
|
||||
if (cache->fire_first) {
|
||||
|
@ -265,7 +265,7 @@ gst_autoplugcache_loop (GstElement *element)
|
|||
cache->fire_first = FALSE;
|
||||
}
|
||||
|
||||
// push that buffer
|
||||
/* push that buffer */
|
||||
gst_pad_push (cache->srcpad, GST_BUFFER(cache->current_playout->data));
|
||||
}
|
||||
} while (!GST_FLAG_IS_SET (element, GST_ELEMENT_COTHREAD_STOPPING));
|
||||
|
@ -291,7 +291,7 @@ gst_autoplugcache_nego_sink (GstPad *pad, GstCaps **caps, gpointer *data)
|
|||
static GstElementStateReturn
|
||||
gst_autoplugcache_change_state (GstElement *element)
|
||||
{
|
||||
// FIXME this should do something like free the cache on ->NULL
|
||||
/* FIXME this should do something like free the cache on ->NULL */
|
||||
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
||||
return GST_ELEMENT_CLASS (parent_class)->change_state (element);
|
||||
|
||||
|
@ -318,14 +318,14 @@ GST_DEBUG(0,"caps_proxy is %d\n",cache->caps_proxy);
|
|||
}
|
||||
break;
|
||||
case ARG_RESET:
|
||||
// no idea why anyone would set this to FALSE, but just in case ;-)
|
||||
/* no idea why anyone would set this to FALSE, but just in case ;-) */
|
||||
if (g_value_get_boolean (value)) {
|
||||
GST_DEBUG(0,"resetting playout pointer\n");
|
||||
// reset the playout pointer to the begining again
|
||||
/* reset the playout pointer to the begining again */
|
||||
cache->current_playout = cache->cache_start;
|
||||
// now we can fire a signal when the cache runs dry
|
||||
/* now we can fire a signal when the cache runs dry */
|
||||
cache->fire_empty = TRUE;
|
||||
// also set it up to fire the first_buffer signal again
|
||||
/* also set it up to fire the first_buffer signal again */
|
||||
cache->fire_first = TRUE;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -87,7 +87,7 @@ static void gst_autoplugger_init (GstAutoplugger *queue);
|
|||
static void gst_autoplugger_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
|
||||
static void gst_autoplugger_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
|
||||
|
||||
//static GstElementStateReturn gst_autoplugger_change_state (GstElement *element);
|
||||
/*static GstElementStateReturn gst_autoplugger_change_state (GstElement *element);*/
|
||||
|
||||
|
||||
static void gst_autoplugger_external_sink_caps_changed (GstPad *pad, GstCaps *caps, GstAutoplugger *autoplugger);
|
||||
|
@ -102,7 +102,7 @@ static void gst_autoplugger_cache_empty (GstElement *element, GstAutoplugger *
|
|||
static void gst_autoplugger_typefind_have_type (GstElement *element, GstCaps *caps, GstAutoplugger *autoplugger);
|
||||
|
||||
static GstElementClass *parent_class = NULL;
|
||||
//static guint gst_autoplugger_signals[LAST_SIGNAL] = { 0 };
|
||||
/*static guint gst_autoplugger_signals[LAST_SIGNAL] = { 0 };*/
|
||||
|
||||
GType
|
||||
gst_autoplugger_get_type(void) {
|
||||
|
@ -155,33 +155,33 @@ gst_autoplugger_class_init (GstAutopluggerClass *klass)
|
|||
gobject_class->set_property = gst_autoplugger_set_property;
|
||||
gobject_class->get_property = gst_autoplugger_get_property;
|
||||
|
||||
// gstelement_class->change_state = gst_autoplugger_change_state;
|
||||
/* gstelement_class->change_state = gst_autoplugger_change_state; */
|
||||
}
|
||||
|
||||
static void
|
||||
gst_autoplugger_init (GstAutoplugger *autoplugger)
|
||||
{
|
||||
// create the autoplugger cache, which is the fundamental unit of the autopluggerger
|
||||
// FIXME we need to find a way to set element's name before _init
|
||||
// FIXME ... so we can name the subelements uniquely
|
||||
/* create the autoplugger cache, which is the fundamental unit of the autopluggerger */
|
||||
/* FIXME we need to find a way to set element's name before _init */
|
||||
/* FIXME ... so we can name the subelements uniquely */
|
||||
autoplugger->cache = gst_elementfactory_make("autoplugcache", "unnamed_autoplugcache");
|
||||
g_return_if_fail (autoplugger->cache != NULL);
|
||||
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "turning on caps nego proxying in cache\n");
|
||||
g_object_set(G_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);
|
||||
|
||||
// attach signals to the cache
|
||||
/* attach signals to the cache */
|
||||
g_signal_connect (G_OBJECT (autoplugger->cache), "first_buffer",
|
||||
G_CALLBACK (gst_autoplugger_cache_first_buffer), autoplugger);
|
||||
|
||||
// add the cache to self
|
||||
/* add the cache to self */
|
||||
gst_bin_add (GST_BIN(autoplugger), autoplugger->cache);
|
||||
|
||||
// get the cache's pads so we can attach stuff to them
|
||||
/* get the cache's pads so we can attach stuff to them */
|
||||
autoplugger->cache_sinkpad = gst_element_get_pad (autoplugger->cache, "sink");
|
||||
autoplugger->cache_srcpad = gst_element_get_pad (autoplugger->cache, "src");
|
||||
|
||||
// attach handlers to the typefind pads
|
||||
/* attach handlers to the typefind pads */
|
||||
g_signal_connect (G_OBJECT (autoplugger->cache_sinkpad), "caps_changed",
|
||||
G_CALLBACK (gst_autoplugger_external_sink_caps_changed), autoplugger);
|
||||
g_signal_connect (G_OBJECT (autoplugger->cache_srcpad), "caps_changed",
|
||||
|
@ -190,12 +190,12 @@ gst_autoplugger_init (GstAutoplugger *autoplugger)
|
|||
G_CALLBACK (gst_autoplugger_external_sink_caps_nego_failed), autoplugger);
|
||||
g_signal_connect (G_OBJECT (autoplugger->cache_srcpad), "caps_nego_failed",
|
||||
G_CALLBACK (gst_autoplugger_external_src_caps_nego_failed), autoplugger);
|
||||
// g_signal_connect (G_OBJECT (autoplugger->cache_sinkpad), "connected",
|
||||
// gst_autoplugger_external_sink_connected, autoplugger);
|
||||
// g_signal_connect (G_OBJECT (autoplugger->cache_srcpad), "connected",
|
||||
// gst_autoplugger_external_src_connected, autoplugger);
|
||||
/* g_signal_connect (G_OBJECT (autoplugger->cache_sinkpad), "connected", */
|
||||
/* gst_autoplugger_external_sink_connected, autoplugger);*/
|
||||
/* g_signal_connect (G_OBJECT (autoplugger->cache_srcpad), "connected", */
|
||||
/* gst_autoplugger_external_src_connected, autoplugger); */
|
||||
|
||||
// ghost both of these pads to the outside world
|
||||
/* ghost both of these pads to the outside world */
|
||||
gst_element_add_ghost_pad (GST_ELEMENT(autoplugger), autoplugger->cache_sinkpad, "sink");
|
||||
gst_element_add_ghost_pad (GST_ELEMENT(autoplugger), autoplugger->cache_srcpad, "src");
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ gst_autoplugger_external_sink_connected(GstPad *pad, GstPad *peerpad, GstAutoplu
|
|||
GstCaps *peercaps, *peertemplatecaps;
|
||||
|
||||
GST_INFO(GST_CAT_AUTOPLUG, "have cache:sink connected");
|
||||
// autoplugger->sinkpadpeer = peerpad;
|
||||
/* autoplugger->sinkpadpeer = peerpad; */
|
||||
|
||||
if (autoplugger->sinkpadpeer) {
|
||||
peercaps = GST_PAD_CAPS(autoplugger->sinkpadpeer);
|
||||
|
@ -233,7 +233,7 @@ gst_autoplugger_external_src_connected(GstPad *pad, GstPad *peerpad, GstAutoplug
|
|||
GstCaps *peercaps, *peertemplatecaps;
|
||||
|
||||
GST_INFO(GST_CAT_AUTOPLUG, "have cache:src connected");
|
||||
// autoplugger->srcpadpeer = peerpad;
|
||||
/* autoplugger->srcpadpeer = peerpad; */
|
||||
|
||||
if (autoplugger->srcpadpeer) {
|
||||
peercaps = GST_PAD_CAPS(autoplugger->srcpadpeer);
|
||||
|
@ -247,8 +247,8 @@ gst_autoplugger_external_src_connected(GstPad *pad, GstPad *peerpad, GstAutoplug
|
|||
GST_INFO(GST_CAT_AUTOPLUG, "there are some caps on this pad's peer's padtemplate %s",
|
||||
gst_caps_get_mime(peertemplatecaps));
|
||||
autoplugger->sinktemplatecaps = peertemplatecaps;
|
||||
// GST_DEBUG(GST_CAT_AUTOPLUG, "turning on caps nego proxying in cache\n");
|
||||
// gtk_object_set(G_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);
|
||||
/* GST_DEBUG(GST_CAT_AUTOPLUG, "turning on caps nego proxying in cache\n"); */
|
||||
/* gtk_object_set(G_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ gst_autoplugger_autoplug(GstAutoplugger *autoplugger,GstPad *srcpad,GstCaps *src
|
|||
GST_DEBUG(GST_CAT_AUTOPLUG,"srcpadcaps are of type %s\n",gst_caps_get_mime(srccaps));
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG,"sinkpadcaps are of type %s\n",gst_caps_get_mime(sinkcaps));
|
||||
|
||||
// disconnect the pads
|
||||
/* disconnect the pads */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "disconnecting the pads that will be joined by an autobin\n");
|
||||
gst_pad_disconnect(srcpad,sinkpad);
|
||||
|
||||
|
@ -297,23 +297,23 @@ gst_autoplugger_autoplug(GstAutoplugger *autoplugger,GstPad *srcpad,GstCaps *src
|
|||
|
||||
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
|
||||
|
||||
// FIXME this is a hack
|
||||
// GST_DEBUG(GST_CAT_AUTOPLUG, "copying failed caps to srcpad %s:%s to ensure renego\n",GST_DEBUG_PAD_NAME(autoplugger->cache_srcpad));
|
||||
// gst_pad_set_caps(srcpad,srccaps);
|
||||
/* FIXME this is a hack */
|
||||
/* GST_DEBUG(GST_CAT_AUTOPLUG, "copying failed caps to srcpad %s:%s to ensure renego\n",GST_DEBUG_PAD_NAME(autoplugger->cache_srcpad)); */
|
||||
/* gst_pad_set_caps(srcpad,srccaps); */
|
||||
|
||||
if (GST_PAD_CAPS(srcpad) == NULL) GST_DEBUG(GST_CAT_AUTOPLUG,"no caps on cache:src!\n");
|
||||
|
||||
// attach the autoplugged bin
|
||||
/* attach the autoplugged bin */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "attaching the autoplugged bin between the two pads\n");
|
||||
gst_pad_connect(srcpad,gst_element_get_pad(autoplugger->autobin,"sink"));
|
||||
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
|
||||
gst_pad_connect(gst_element_get_pad(autoplugger->autobin,"src_00"),sinkpad);
|
||||
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
|
||||
|
||||
// FIXME try to force the renego
|
||||
// GST_DEBUG(GST_CAT_AUTOPLUG, "trying to force everyone to nego\n");
|
||||
// gst_pad_renegotiate(gst_element_get_pad(autoplugger->autobin,"sink"));
|
||||
// gst_pad_renegotiate(sinkpad);
|
||||
/* FIXME try to force the renego */
|
||||
/* GST_DEBUG(GST_CAT_AUTOPLUG, "trying to force everyone to nego\n"); */
|
||||
/* gst_pad_renegotiate(gst_element_get_pad(autoplugger->autobin,"sink")); */
|
||||
/* gst_pad_renegotiate(sinkpad); */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ gst_autoplugger_external_sink_caps_nego_failed(GstPad *pad, gboolean *result, Gs
|
|||
|
||||
autoplugger->paused++;
|
||||
if (autoplugger->paused == 1)
|
||||
// try to PAUSE the whole thing
|
||||
/* try to PAUSE the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED);
|
||||
|
||||
srcpad_peer = GST_PAD(GST_PAD_PEER(autoplugger->cache_srcpad));
|
||||
|
@ -349,12 +349,12 @@ gst_autoplugger_external_sink_caps_nego_failed(GstPad *pad, gboolean *result, Gs
|
|||
if (gst_autoplugger_autoplug(autoplugger,autoplugger->cache_srcpad,sinkpad_peer_caps,srcpad_peer_caps))
|
||||
*result = TRUE;
|
||||
|
||||
// force renego
|
||||
/* force renego */
|
||||
gst_pad_renegotiate(GST_PAD(GST_PAD_PEER(autoplugger->cache_sinkpad)));
|
||||
|
||||
autoplugger->paused--;
|
||||
if (autoplugger->paused == 0)
|
||||
// try to PLAY the whole thing
|
||||
/* try to PLAY the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PLAYING);
|
||||
|
||||
GST_INFO(GST_CAT_AUTOPLUG, "done dealing with caps nego failure on sinkpad %s:%s",GST_DEBUG_PAD_NAME(pad));
|
||||
|
@ -372,7 +372,7 @@ gst_autoplugger_external_src_caps_nego_failed(GstPad *pad, gboolean *result, Gst
|
|||
|
||||
autoplugger->paused++;
|
||||
if (autoplugger->paused == 1)
|
||||
// try to PAUSE the whole thing
|
||||
/* try to PAUSE the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED);
|
||||
|
||||
srcpad_caps = GST_PAD_CAPS(autoplugger->cache_srcpad);
|
||||
|
@ -389,7 +389,7 @@ gst_autoplugger_external_src_caps_nego_failed(GstPad *pad, gboolean *result, Gst
|
|||
|
||||
autoplugger->paused--;
|
||||
if (autoplugger->paused == 0)
|
||||
// try to PLAY the whole thing
|
||||
/* try to PLAY the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PLAYING);
|
||||
|
||||
autoplugger->disable_nocaps = TRUE;
|
||||
|
@ -407,30 +407,30 @@ gst_autoplugger_cache_empty(GstElement *element, GstAutoplugger *autoplugger)
|
|||
|
||||
autoplugger->paused++;
|
||||
if (autoplugger->paused == 1)
|
||||
// try to PAUSE the whole thing
|
||||
/* try to PAUSE the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED);
|
||||
|
||||
// disconnect the cache from its peers
|
||||
/* disconnect the cache from its peers */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "disconnecting autoplugcache from its peers\n");
|
||||
cache_sinkpad_peer = GST_PAD (GST_PAD_PEER(autoplugger->cache_sinkpad));
|
||||
cache_srcpad_peer = GST_PAD (GST_PAD_PEER(autoplugger->cache_srcpad));
|
||||
gst_pad_disconnect(cache_sinkpad_peer,autoplugger->cache_sinkpad);
|
||||
gst_pad_disconnect(autoplugger->cache_srcpad,cache_srcpad_peer);
|
||||
|
||||
// remove the cache from self
|
||||
/* remove the cache from self */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "removing the cache from the autoplugger\n");
|
||||
gst_bin_remove (GST_BIN(autoplugger), autoplugger->cache);
|
||||
|
||||
// connect the two pads
|
||||
/* connect the two pads */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "reconnecting the autoplugcache's former peers\n");
|
||||
gst_pad_connect(cache_sinkpad_peer,cache_srcpad_peer);
|
||||
|
||||
autoplugger->paused--;
|
||||
if (autoplugger->paused == 0)
|
||||
// try to PLAY the whole thing
|
||||
/* try to PLAY the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PLAYING);
|
||||
|
||||
// xmlSaveFile("autoplugger.gst", gst_xml_write(GST_ELEMENT_SCHED(autoplugger)->parent));
|
||||
/* xmlSaveFile("autoplugger.gst", gst_xml_write(GST_ELEMENT_SCHED(autoplugger)->parent)); */
|
||||
|
||||
GST_INFO(GST_CAT_AUTOPLUG, "autoplugger_cache_empty finished");
|
||||
}
|
||||
|
@ -444,17 +444,17 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
|
|||
|
||||
autoplugger->paused++;
|
||||
if (autoplugger->paused == 1)
|
||||
// try to PAUSE the whole thing
|
||||
/* try to PAUSE the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED);
|
||||
|
||||
// first disconnect the typefind and shut it down
|
||||
/* first disconnect the typefind and shut it down */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "disconnecting typefind from the cache\n");
|
||||
gst_pad_disconnect(autoplugger->cache_srcpad,autoplugger->typefind_sinkpad);
|
||||
gst_bin_remove(GST_BIN(autoplugger),autoplugger->typefind);
|
||||
|
||||
// FIXME FIXME now we'd compare caps and see if we need to autoplug something in the middle, but for
|
||||
// now we're going to just reconnect where we left off
|
||||
// FIXME FIXME FIXME!!!: this should really be done in the caps failure!!!
|
||||
/* FIXME FIXME now we'd compare caps and see if we need to autoplug something in the middle, but for */
|
||||
/* now we're going to just reconnect where we left off */
|
||||
/* FIXME FIXME FIXME!!!: this should really be done in the caps failure!!! */
|
||||
/*
|
||||
if (!autoplugger->autoplug) {
|
||||
autoplugger->autoplug = gst_autoplugfactory_make("static");
|
||||
|
@ -474,26 +474,26 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
|
|||
gst_pad_connect(gst_element_get_pad(autoplugger->autobin,"src_00"),autoplugger->srcpadpeer);
|
||||
*/
|
||||
|
||||
// FIXME set the caps on the new connection
|
||||
// GST_DEBUG(GST_CAT_AUTOPLUG,"forcing caps on the typefound pad\n");
|
||||
// gst_pad_set_caps(autoplugger->cache_srcpad,caps);
|
||||
|
||||
// reattach the original outside srcpad
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG,"re-attaching downstream peer to autoplugcache\n");
|
||||
/* FIXME set the caps on the new connection
|
||||
* GST_DEBUG(GST_CAT_AUTOPLUG,"forcing caps on the typefound pad\n");
|
||||
* gst_pad_set_caps(autoplugger->cache_srcpad,caps);
|
||||
* reattach the original outside srcpad
|
||||
*/
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG,"re-attaching downstream peer to autoplugcache\n");
|
||||
gst_pad_connect(autoplugger->cache_srcpad,autoplugger->srcpadpeer);
|
||||
|
||||
// now reset the autoplugcache
|
||||
/* now reset the autoplugcache */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "resetting the cache to send first buffer(s) again\n");
|
||||
g_object_set(G_OBJECT(autoplugger->cache),"reset",TRUE,NULL);
|
||||
|
||||
// attach the cache_empty handler
|
||||
// FIXME this is the wrong place, it shouldn't be done until we get successful caps nego!
|
||||
/* attach the cache_empty handler */
|
||||
/* FIXME this is the wrong place, it shouldn't be done until we get successful caps nego! */
|
||||
g_signal_connect (G_OBJECT(autoplugger->cache),"cache_empty",
|
||||
G_CALLBACK (gst_autoplugger_cache_empty), autoplugger);
|
||||
|
||||
autoplugger->paused--;
|
||||
if (autoplugger->paused == 0)
|
||||
// try to PLAY the whole thing
|
||||
/* try to PLAY the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PLAYING);
|
||||
|
||||
GST_INFO(GST_CAT_AUTOPLUG, "typefind_have_type finished");
|
||||
|
@ -506,7 +506,7 @@ gst_autoplugger_cache_first_buffer(GstElement *element,GstBuffer *buf,GstAutoplu
|
|||
GST_INFO(GST_CAT_AUTOPLUG, "have first buffer through cache");
|
||||
autoplugger->cache_first_buffer = TRUE;
|
||||
|
||||
// if there are no established caps, worry
|
||||
/* if there are no established caps, worry */
|
||||
if (!autoplugger->sinkcaps) {
|
||||
GST_INFO(GST_CAT_AUTOPLUG, "have no caps for the buffer, Danger Will Robinson!");
|
||||
|
||||
|
@ -519,15 +519,15 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
|
|||
|
||||
autoplugger->paused++;
|
||||
if (autoplugger->paused == 1)
|
||||
// try to PAUSE the whole thing
|
||||
/* try to PAUSE the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED);
|
||||
|
||||
// detach the srcpad
|
||||
/* detach the srcpad */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "disconnecting cache from its downstream peer\n");
|
||||
autoplugger->srcpadpeer = GST_PAD(GST_PAD_PEER(autoplugger->cache_srcpad));
|
||||
gst_pad_disconnect(autoplugger->cache_srcpad,autoplugger->srcpadpeer);
|
||||
|
||||
// instantiate the typefind and set up the signal handlers
|
||||
/* instantiate the typefind and set up the signal handlers */
|
||||
if (!autoplugger->typefind) {
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "creating typefind and setting signal handler\n");
|
||||
autoplugger->typefind = gst_elementfactory_make("typefind","unnamed_typefind");
|
||||
|
@ -535,26 +535,27 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
|
|||
g_signal_connect (G_OBJECT(autoplugger->typefind),"have_type",
|
||||
G_CALLBACK (gst_autoplugger_typefind_have_type), autoplugger);
|
||||
}
|
||||
// add it to self and attach it
|
||||
/* add it to self and attach it */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "adding typefind to self and connecting to cache\n");
|
||||
gst_bin_add(GST_BIN(autoplugger),autoplugger->typefind);
|
||||
gst_pad_connect(autoplugger->cache_srcpad,autoplugger->typefind_sinkpad);
|
||||
|
||||
// bring the typefind into playing state
|
||||
/* bring the typefind into playing state */
|
||||
GST_DEBUG(GST_CAT_AUTOPLUG, "setting typefind state to PLAYING\n");
|
||||
gst_element_set_state(autoplugger->cache,GST_STATE_PLAYING);
|
||||
|
||||
autoplugger->paused--;
|
||||
if (autoplugger->paused == 0)
|
||||
// try to PLAY the whole thing
|
||||
/* try to PLAY the whole thing */
|
||||
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PLAYING);
|
||||
|
||||
GST_INFO(GST_CAT_AUTOPLUG,"here we go into nothingness, hoping the typefind will return us to safety");
|
||||
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
|
||||
} else {
|
||||
// // attach the cache_empty handler, since the cache simply isn't needed
|
||||
// g_signal_connect (G_OBJECT(autoplugger->cache),"cache_empty",
|
||||
// gst_autoplugger_cache_empty,autoplugger);
|
||||
/* // attach the cache_empty handler, since the cache simply isn't needed
|
||||
* g_signal_connect (G_OBJECT(autoplugger->cache),"cache_empty",
|
||||
* gst_autoplugger_cache_empty,autoplugger);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
|
|||
while (sinkpads) {
|
||||
GstPad *sinkpad = (GstPad *)sinkpads->data;
|
||||
|
||||
// if we have a match, connect the pads
|
||||
/* if we have a match, connect the pads */
|
||||
if (gst_pad_get_direction(sinkpad) == GST_PAD_SINK &&
|
||||
!GST_PAD_CONNECTED(sinkpad))
|
||||
{
|
||||
|
@ -336,7 +336,7 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
|
|||
|
||||
chains = g_list_next (chains);
|
||||
}
|
||||
//FIXME, free the list
|
||||
/*FIXME, free the list */
|
||||
|
||||
result = gst_bin_new ("autoplug_bin");
|
||||
|
||||
|
@ -356,10 +356,10 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
|
|||
GstElement *element;
|
||||
gchar *name;
|
||||
|
||||
// fase 3: add common elements
|
||||
/* fase 3: add common elements */
|
||||
factory = (GstElementFactory *) (factories[0]->data);
|
||||
|
||||
// check to other paths for matching elements (factories)
|
||||
/* check to other paths for matching elements (factories) */
|
||||
for (i=1; i<numsinks; i++) {
|
||||
if (factory != (GstElementFactory *) (factories[i]->data)) {
|
||||
goto differ;
|
||||
|
@ -384,7 +384,7 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
|
|||
if (srcelement != NULL) {
|
||||
gst_autoplug_pads_autoplug (srcelement, element);
|
||||
}
|
||||
// this is the first element, find a good ghostpad
|
||||
/* this is the first element, find a good ghostpad */
|
||||
else {
|
||||
GList *pads;
|
||||
|
||||
|
@ -406,7 +406,7 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
|
|||
|
||||
srcelement = element;
|
||||
|
||||
// advance the pointer in all lists
|
||||
/* advance the pointer in all lists */
|
||||
for (i=0; i<numsinks; i++) {
|
||||
factories[i] = g_list_next (factories[i]);
|
||||
}
|
||||
|
@ -416,13 +416,13 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
|
|||
|
||||
differ:
|
||||
|
||||
// loop over all the sink elements
|
||||
/* loop over all the sink elements */
|
||||
for (i = 0; i < numsinks; i++) {
|
||||
GstElement *thesrcelement = srcelement;
|
||||
GstElement *thebin = GST_ELEMENT(result);
|
||||
|
||||
while (factories[i]) {
|
||||
// fase 4: add other elements...
|
||||
/* fase 4: add other elements... */
|
||||
GstElementFactory *factory;
|
||||
GstElement *element;
|
||||
|
||||
|
@ -437,7 +437,7 @@ differ:
|
|||
|
||||
gst_autoplug_pads_autoplug(thesrcelement, element);
|
||||
|
||||
// this element is now the new source element
|
||||
/* this element is now the new source element */
|
||||
thesrcelement = element;
|
||||
|
||||
factories[i] = g_list_next(factories[i]);
|
||||
|
|
|
@ -181,7 +181,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
|
|||
while (sinkpads) {
|
||||
GstPad *sinkpad = (GstPad *)sinkpads->data;
|
||||
|
||||
// if we have a match, connect the pads
|
||||
/* if we have a match, connect the pads */
|
||||
if (gst_pad_get_direction(sinkpad) == GST_PAD_SINK &&
|
||||
!GST_PAD_CONNECTED (pad) && !GST_PAD_CONNECTED(sinkpad))
|
||||
{
|
||||
|
@ -258,7 +258,7 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
|
|||
|
||||
if (IS_CAPS (src) && IS_CAPS (dest)) {
|
||||
res = gst_caps_check_compatibility ((GstCaps *)src, (GstCaps *)dest);
|
||||
//GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"caps %d to caps %d %d", ((GstCaps *)src)->id, ((GstCaps *)dest)->id, res);
|
||||
/*GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"caps %d to caps %d %d", ((GstCaps *)src)->id, ((GstCaps *)dest)->id, res); */
|
||||
}
|
||||
else if (IS_CAPS (src)) {
|
||||
GstPadTemplate *templ;
|
||||
|
@ -270,7 +270,7 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
|
|||
else
|
||||
res = FALSE;
|
||||
|
||||
//GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory %s to src caps %d %d", ((GstElementFactory *)dest)->name, ((GstCaps *)src)->id, res);
|
||||
/*GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory %s to src caps %d %d", ((GstElementFactory *)dest)->name, ((GstCaps *)src)->id, res);*/
|
||||
}
|
||||
else if (IS_CAPS (dest)) {
|
||||
GstPadTemplate *templ;
|
||||
|
@ -281,7 +281,7 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
|
|||
res = TRUE;
|
||||
else
|
||||
res = FALSE;
|
||||
//GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory %s to sink caps %d %d", ((GstElementFactory *)src)->name, ((GstCaps *)dest)->id, res);
|
||||
/*GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory %s to sink caps %d %d", ((GstElementFactory *)src)->name, ((GstCaps *)dest)->id, res);*/
|
||||
}
|
||||
else {
|
||||
res = gst_autoplug_can_match ((GstElementFactory *)src, (GstElementFactory *)dest);
|
||||
|
@ -368,7 +368,7 @@ next:
|
|||
|
||||
chains = g_list_next (chains);
|
||||
}
|
||||
//FIXME, free the list
|
||||
/*FIXME, free the list */
|
||||
|
||||
result = gst_bin_new ("autoplug_bin");
|
||||
|
||||
|
@ -387,10 +387,10 @@ next:
|
|||
GstElementFactory *factory;
|
||||
GstElement *element;
|
||||
|
||||
// fase 3: add common elements
|
||||
/* fase 3: add common elements */
|
||||
factory = (GstElementFactory *) (factories[0]->data);
|
||||
|
||||
// check to other paths for matching elements (factories)
|
||||
/* check to other paths for matching elements (factories) */
|
||||
for (i=1; i<numsinks; i++) {
|
||||
if (factory != (GstElementFactory *) (factories[i]->data)) {
|
||||
goto differ;
|
||||
|
@ -405,7 +405,7 @@ next:
|
|||
if (srcelement != NULL) {
|
||||
gst_autoplug_pads_autoplug (srcelement, element);
|
||||
}
|
||||
// this is the first element, find a good ghostpad
|
||||
/* this is the first element, find a good ghostpad */
|
||||
else {
|
||||
GList *pads;
|
||||
|
||||
|
@ -427,7 +427,7 @@ next:
|
|||
|
||||
srcelement = element;
|
||||
|
||||
// advance the pointer in all lists
|
||||
/* advance the pointer in all lists */
|
||||
for (i=0; i<numsinks; i++) {
|
||||
factories[i] = g_list_next (factories[i]);
|
||||
}
|
||||
|
@ -437,7 +437,7 @@ next:
|
|||
|
||||
differ:
|
||||
|
||||
// loop over all the sink elements
|
||||
/* loop over all the sink elements */
|
||||
for (i = 0; i < numsinks; i++) {
|
||||
GstElement *thesrcelement = srcelement;
|
||||
GstElement *thebin = GST_ELEMENT(result);
|
||||
|
@ -450,7 +450,7 @@ differ:
|
|||
use_thread = have_common;
|
||||
|
||||
while (factories[i] || sinkelement) {
|
||||
// fase 4: add other elements...
|
||||
/* fase 4: add other elements... */
|
||||
GstElementFactory *factory;
|
||||
GstElement *element;
|
||||
|
||||
|
@ -465,7 +465,7 @@ differ:
|
|||
sinkelement = NULL;
|
||||
}
|
||||
|
||||
// this element suggests the use of a thread, so we set one up...
|
||||
/* this element suggests the use of a thread, so we set one up... */
|
||||
if (GST_ELEMENT_IS_THREAD_SUGGESTED(element) || use_thread) {
|
||||
GstElement *queue;
|
||||
GstPad *srcpad;
|
||||
|
@ -475,11 +475,11 @@ differ:
|
|||
|
||||
GST_DEBUG (0,"sugest new thread for \"%s\" %08x\n", GST_ELEMENT_NAME (element), GST_FLAGS(element));
|
||||
|
||||
// create a new queue and add to the previous bin
|
||||
/* create a new queue and add to the previous bin */
|
||||
queue = gst_elementfactory_make("queue", g_strconcat("queue_", GST_ELEMENT_NAME(element), NULL));
|
||||
GST_DEBUG (0,"adding element \"%s\"\n", GST_ELEMENT_NAME (element));
|
||||
|
||||
// this will be the new bin for all following elements
|
||||
/* this will be the new bin for all following elements */
|
||||
thebin = gst_elementfactory_make("thread", g_strconcat("thread_", GST_ELEMENT_NAME(element), NULL));
|
||||
|
||||
gst_bin_add(GST_BIN(thebin), queue);
|
||||
|
@ -497,7 +497,7 @@ differ:
|
|||
gst_autoplug_signal_new_object (GST_AUTOPLUG (autoplug), GST_OBJECT (thebin));
|
||||
thesrcelement = queue;
|
||||
}
|
||||
// no thread needed, easy case
|
||||
/* no thread needed, easy case */
|
||||
else {
|
||||
GST_DEBUG (0,"adding element %s\n", GST_ELEMENT_NAME (element));
|
||||
gst_bin_add(GST_BIN(thebin), element);
|
||||
|
@ -505,7 +505,7 @@ differ:
|
|||
}
|
||||
gst_autoplug_pads_autoplug(thesrcelement, element);
|
||||
|
||||
// this element is now the new source element
|
||||
/* this element is now the new source element */
|
||||
thesrcelement = element;
|
||||
|
||||
factories[i] = g_list_next(factories[i]);
|
||||
|
|
Loading…
Reference in a new issue