mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
made a quick hack in adder to set GST_ELEMENT_COTHREAD_STOPPING after one interation to force return to main program;...
Original commit message from CVS: * made a quick hack in adder to set GST_ELEMENT_COTHREAD_STOPPING after one interation to force return to main program; should probably be fixed in a better way * cleaned mixer up, it now works with delayed start. Drinks are in order.
This commit is contained in:
parent
b3484a042a
commit
4902cf1f80
2 changed files with 22 additions and 14 deletions
|
@ -6,8 +6,11 @@
|
||||||
*
|
*
|
||||||
* Latest change : 28/04/2001
|
* Latest change : 28/04/2001
|
||||||
* trying to adapt to incsched
|
* trying to adapt to incsched
|
||||||
*
|
* delayed start for channels > 1
|
||||||
* Version : 0.4.1
|
* now works by quickhacking the
|
||||||
|
* adder plugin to set
|
||||||
|
* GST_ELEMENT_COTHREAD_STOPPING
|
||||||
|
* Version : 0.5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -132,7 +135,7 @@ int main(int argc,char *argv[])
|
||||||
channel_in = create_input_channel (i, argv[i]);
|
channel_in = create_input_channel (i, argv[i]);
|
||||||
input_channels = g_list_append (input_channels, channel_in);
|
input_channels = g_list_append (input_channels, channel_in);
|
||||||
|
|
||||||
//gst_element_set_state (main_bin, GST_STATE_PAUSED);
|
if (i > 1) gst_element_set_state (main_bin, GST_STATE_PAUSED);
|
||||||
gst_bin_add (GST_BIN(main_bin), channel_in->pipe);
|
gst_bin_add (GST_BIN(main_bin), channel_in->pipe);
|
||||||
|
|
||||||
/* request pads and connect to adder */
|
/* request pads and connect to adder */
|
||||||
|
@ -188,11 +191,12 @@ int main(int argc,char *argv[])
|
||||||
playing = TRUE;
|
playing = TRUE;
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
printf ("main: iterating %d\n", j);
|
//printf ("main: start iterating from 0");
|
||||||
while (playing && j < 100)
|
while (playing && j < 100)
|
||||||
{
|
{
|
||||||
|
// printf ("main: iterating %d\n", j);
|
||||||
gst_bin_iterate(GST_BIN(main_bin));
|
gst_bin_iterate(GST_BIN(main_bin));
|
||||||
fprintf(stderr,"after iterate()\n");
|
//fprintf(stderr,"after iterate()\n");
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +204,7 @@ int main(int argc,char *argv[])
|
||||||
while (playing)
|
while (playing)
|
||||||
{
|
{
|
||||||
gst_bin_iterate(GST_BIN(main_bin));
|
gst_bin_iterate(GST_BIN(main_bin));
|
||||||
fprintf(stderr,"after iterate()\n");
|
//fprintf(stderr,"after iterate()\n");
|
||||||
}
|
}
|
||||||
/* stop the bin */
|
/* stop the bin */
|
||||||
gst_element_set_state(main_bin, GST_STATE_NULL);
|
gst_element_set_state(main_bin, GST_STATE_NULL);
|
||||||
|
@ -323,7 +327,7 @@ create_input_channel (int id, char* location)
|
||||||
new_element = gst_bin_new ("autoplug_bin");
|
new_element = gst_bin_new ("autoplug_bin");
|
||||||
|
|
||||||
/* static plug, use mad plugin and assume mp3 input */
|
/* static plug, use mad plugin and assume mp3 input */
|
||||||
decoder = gst_elementfactory_make ("mad", "mad");
|
decoder = gst_elementfactory_make ("mad", "mpg123");
|
||||||
|
|
||||||
gst_bin_add (GST_BIN (new_element), decoder);
|
gst_bin_add (GST_BIN (new_element), decoder);
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,11 @@
|
||||||
*
|
*
|
||||||
* Latest change : 28/04/2001
|
* Latest change : 28/04/2001
|
||||||
* trying to adapt to incsched
|
* trying to adapt to incsched
|
||||||
*
|
* delayed start for channels > 1
|
||||||
* Version : 0.4.1
|
* now works by quickhacking the
|
||||||
|
* adder plugin to set
|
||||||
|
* GST_ELEMENT_COTHREAD_STOPPING
|
||||||
|
* Version : 0.5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -132,7 +135,7 @@ int main(int argc,char *argv[])
|
||||||
channel_in = create_input_channel (i, argv[i]);
|
channel_in = create_input_channel (i, argv[i]);
|
||||||
input_channels = g_list_append (input_channels, channel_in);
|
input_channels = g_list_append (input_channels, channel_in);
|
||||||
|
|
||||||
//gst_element_set_state (main_bin, GST_STATE_PAUSED);
|
if (i > 1) gst_element_set_state (main_bin, GST_STATE_PAUSED);
|
||||||
gst_bin_add (GST_BIN(main_bin), channel_in->pipe);
|
gst_bin_add (GST_BIN(main_bin), channel_in->pipe);
|
||||||
|
|
||||||
/* request pads and connect to adder */
|
/* request pads and connect to adder */
|
||||||
|
@ -188,11 +191,12 @@ int main(int argc,char *argv[])
|
||||||
playing = TRUE;
|
playing = TRUE;
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
printf ("main: iterating %d\n", j);
|
//printf ("main: start iterating from 0");
|
||||||
while (playing && j < 100)
|
while (playing && j < 100)
|
||||||
{
|
{
|
||||||
|
// printf ("main: iterating %d\n", j);
|
||||||
gst_bin_iterate(GST_BIN(main_bin));
|
gst_bin_iterate(GST_BIN(main_bin));
|
||||||
fprintf(stderr,"after iterate()\n");
|
//fprintf(stderr,"after iterate()\n");
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +204,7 @@ int main(int argc,char *argv[])
|
||||||
while (playing)
|
while (playing)
|
||||||
{
|
{
|
||||||
gst_bin_iterate(GST_BIN(main_bin));
|
gst_bin_iterate(GST_BIN(main_bin));
|
||||||
fprintf(stderr,"after iterate()\n");
|
//fprintf(stderr,"after iterate()\n");
|
||||||
}
|
}
|
||||||
/* stop the bin */
|
/* stop the bin */
|
||||||
gst_element_set_state(main_bin, GST_STATE_NULL);
|
gst_element_set_state(main_bin, GST_STATE_NULL);
|
||||||
|
@ -323,7 +327,7 @@ create_input_channel (int id, char* location)
|
||||||
new_element = gst_bin_new ("autoplug_bin");
|
new_element = gst_bin_new ("autoplug_bin");
|
||||||
|
|
||||||
/* static plug, use mad plugin and assume mp3 input */
|
/* static plug, use mad plugin and assume mp3 input */
|
||||||
decoder = gst_elementfactory_make ("mad", "mad");
|
decoder = gst_elementfactory_make ("mad", "mpg123");
|
||||||
|
|
||||||
gst_bin_add (GST_BIN (new_element), decoder);
|
gst_bin_add (GST_BIN (new_element), decoder);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue