summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2001-12-23 23:00:59 +0000
committerWim Taymans <wim.taymans@gmail.com>2001-12-23 23:00:59 +0000
commitcdb004a72294b899ab6094fd9f3acfa6bf7cfbf2 (patch)
tree076b4b14865d9b29dcca44d57919c749ca38114a
parent35e50facf7554f540e67b99bd79f06adbbf7dd24 (diff)
Fixed some leftover fixes
Original commit message from CVS: Fixed some leftover fixes
-rw-r--r--ext/dv/gstdvdec.c111
-rw-r--r--ext/flac/gstflacdec.c5
-rw-r--r--ext/ladspa/gstladspa.c29
-rw-r--r--ext/mikmod/gstmikmod.c5
4 files changed, 70 insertions, 80 deletions
diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c
index dfd0dcd5..4ea06b80 100644
--- a/ext/dv/gstdvdec.c
+++ b/ext/dv/gstdvdec.c
@@ -266,81 +266,78 @@ gst_dvdec_loop (GstElement *element)
dvdec = GST_DVDEC (element);
- do {
- // grab an input frame
- needed = BUFFER;
- if (dvdec->remaining > 0) {
- memcpy(&dvdec->inframe[BUFFER-needed],
- GST_BUFFER_DATA(dvdec->carryover)+(GST_BUFFER_SIZE(dvdec->carryover)-dvdec->remaining),
- dvdec->remaining);
- dvdec->remaining = 0;
- gst_buffer_unref(dvdec->carryover);
- }
- while (needed) {
- buf = gst_pad_pull(dvdec->sinkpad);
- if (needed < GST_BUFFER_SIZE(buf)) {
- memcpy(&dvdec->inframe[BUFFER-needed],GST_BUFFER_DATA(buf),needed);
-/***** NOTE: this is done because 1394src doesn't allow buffers to outlive the handler *****/
- dvdec->carryover = gst_buffer_copy(buf);
- dvdec->remaining = GST_BUFFER_SIZE(buf) - needed;
- needed = 0;
- } else {
- memcpy(&dvdec->inframe[BUFFER-needed],GST_BUFFER_DATA(buf),GST_BUFFER_SIZE(buf));
- needed -= GST_BUFFER_SIZE(buf);
- }
- gst_buffer_unref(buf);
+ // grab an input frame
+ needed = BUFFER;
+ if (dvdec->remaining > 0) {
+ memcpy(&dvdec->inframe[BUFFER-needed],
+ GST_BUFFER_DATA(dvdec->carryover)+(GST_BUFFER_SIZE(dvdec->carryover)-dvdec->remaining),
+ dvdec->remaining);
+ dvdec->remaining = 0;
+ gst_buffer_unref(dvdec->carryover);
+ }
+ while (needed) {
+ buf = gst_pad_pull(dvdec->sinkpad);
+ if (needed < GST_BUFFER_SIZE(buf)) {
+ memcpy(&dvdec->inframe[BUFFER-needed],GST_BUFFER_DATA(buf),needed);
+/**** NOTE: this is done because 1394src doesn't allow buffers to outlive the handler *****/
+ dvdec->carryover = gst_buffer_copy(buf);
+ dvdec->remaining = GST_BUFFER_SIZE(buf) - needed;
+ needed = 0;
+ } else {
+ memcpy(&dvdec->inframe[BUFFER-needed],GST_BUFFER_DATA(buf),GST_BUFFER_SIZE(buf));
+ needed -= GST_BUFFER_SIZE(buf);
}
+ gst_buffer_unref(buf);
+ }
- if (!GST_PAD_CAPS (dvdec->videosrcpad)) {
- gst_pad_set_caps (dvdec->videosrcpad, gst_pad_get_padtemplate_caps (dvdec->videosrcpad));
- }
+ if (!GST_PAD_CAPS (dvdec->videosrcpad)) {
+ gst_pad_set_caps (dvdec->videosrcpad, gst_pad_get_padtemplate_caps (dvdec->videosrcpad));
+ }
- if (!dvdec->pool) {
- dvdec->pool = gst_pad_get_bufferpool (dvdec->videosrcpad);
- }
+ if (!dvdec->pool) {
+ dvdec->pool = gst_pad_get_bufferpool (dvdec->videosrcpad);
+ }
- buf = NULL;
- if (dvdec->pool) {
- buf = gst_buffer_new_from_pool (dvdec->pool, 0, 0);
- }
+ buf = NULL;
+ if (dvdec->pool) {
+ buf = gst_buffer_new_from_pool (dvdec->pool, 0, 0);
+ }
- if (!buf) {
- // allocate an output frame
- buf = gst_buffer_new();
+ if (!buf) {
+ // allocate an output frame
+ buf = gst_buffer_new();
#ifdef RGB
- GST_BUFFER_SIZE(buf) = (720*HEIGHT)*3;
+ GST_BUFFER_SIZE(buf) = (720*HEIGHT)*3;
#else
- GST_BUFFER_SIZE(buf) = (720*HEIGHT)*2;
+ GST_BUFFER_SIZE(buf) = (720*HEIGHT)*2;
#endif
- GST_BUFFER_DATA(buf) = g_malloc(GST_BUFFER_SIZE(buf));
- outframe = GST_BUFFER_DATA(buf);
- } else {
- outframe = GST_BUFFER_DATA (buf);
- }
+ GST_BUFFER_DATA(buf) = g_malloc(GST_BUFFER_SIZE(buf));
+ outframe = GST_BUFFER_DATA(buf);
+ } else {
+ outframe = GST_BUFFER_DATA (buf);
+ }
- outframe_ptrs[0] = outframe;
- outframe_ptrs[1] = outframe_ptrs[0] + 720*HEIGHT;
- outframe_ptrs[2] = outframe_ptrs[1] + 360*HEIGHT;
+ outframe_ptrs[0] = outframe;
+ outframe_ptrs[1] = outframe_ptrs[0] + 720*HEIGHT;
+ outframe_ptrs[2] = outframe_ptrs[1] + 360*HEIGHT;
#ifdef RGB
- outframe_pitches[0] = 720*3;
+ outframe_pitches[0] = 720*3;
#else
- outframe_pitches[0] = 720*2; // huh?
+ outframe_pitches[0] = 720*2; // huh?
#endif
- outframe_pitches[1] = HEIGHT/2;
- outframe_pitches[2] = HEIGHT/2;
+ outframe_pitches[1] = HEIGHT/2;
+ outframe_pitches[2] = HEIGHT/2;
- // now we start decoding the frame
- dv_parse_header(dvdec->decoder,dvdec->inframe);
+ // now we start decoding the frame
+ dv_parse_header(dvdec->decoder,dvdec->inframe);
#ifdef RGB
- dv_decode_full_frame(dvdec->decoder,dvdec->inframe,e_dv_color_rgb,outframe_ptrs,outframe_pitches);
+ dv_decode_full_frame(dvdec->decoder,dvdec->inframe,e_dv_color_rgb,outframe_ptrs,outframe_pitches);
#else
- dv_decode_full_frame(dvdec->decoder,dvdec->inframe,e_dv_color_yuv,outframe_ptrs,outframe_pitches);
+ dv_decode_full_frame(dvdec->decoder,dvdec->inframe,e_dv_color_yuv,outframe_ptrs,outframe_pitches);
#endif
- gst_pad_push(dvdec->videosrcpad,buf);
-
- } while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element));
+ gst_pad_push(dvdec->videosrcpad,buf);
}
diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c
index 67291482..d7619b55 100644
--- a/ext/flac/gstflacdec.c
+++ b/ext/flac/gstflacdec.c
@@ -242,9 +242,6 @@ gst_flacdec_loop (GstElement *element)
FLAC__stream_decoder_process_metadata (flacdec->decoder);
}
- do {
- FLAC__stream_decoder_process_one_frame (flacdec->decoder);
- }
- while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element));
+ FLAC__stream_decoder_process_one_frame (flacdec->decoder);
}
diff --git a/ext/ladspa/gstladspa.c b/ext/ladspa/gstladspa.c
index 81740c25..e605ec34 100644
--- a/ext/ladspa/gstladspa.c
+++ b/ext/ladspa/gstladspa.c
@@ -640,26 +640,23 @@ gst_ladspa_loop (GstElement *element)
LADSPA_Descriptor *desc;
desc = ladspa->descriptor;
- do {
- printf("looping something\n");
+ printf("looping something\n");
- // first get all the necessary data from the input ports
- for (i=0;i<oclass->numsinkpads;i++){
- ladspa->buffers[i] = gst_pad_pull(ladspa->sinkpads[i]);
- printf("pulling buffer %d\n", i);
- }
+ // first get all the necessary data from the input ports
+ for (i=0;i<oclass->numsinkpads;i++){
+ ladspa->buffers[i] = gst_pad_pull(ladspa->sinkpads[i]);
+ printf("pulling buffer %d\n", i);
+ }
- for (i=0;i<oclass->numsinkpads;i++) {
+ for (i=0;i<oclass->numsinkpads;i++) {
// desc->connect_port(ladspa->handle,i,&(ladspa->controls[i]));
- }
+ }
- for (i=0;i<oclass->numsrcpads && i<oclass->numsinkpads;i++){
- printf("pushing buffer %d\n", i);
- gst_pad_push (ladspa->srcpads[i], ladspa->buffers[i]);
- ladspa->buffers[i] = NULL;
- }
-
- } while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element));
+ for (i=0;i<oclass->numsrcpads && i<oclass->numsinkpads;i++){
+ printf("pushing buffer %d\n", i);
+ gst_pad_push (ladspa->srcpads[i], ladspa->buffers[i]);
+ ladspa->buffers[i] = NULL;
+ }
}
static void
diff --git a/ext/mikmod/gstmikmod.c b/ext/mikmod/gstmikmod.c
index 9ab89e7c..a8b6a345 100644
--- a/ext/mikmod/gstmikmod.c
+++ b/ext/mikmod/gstmikmod.c
@@ -407,9 +407,8 @@ gst_mikmod_loop (GstElement *element)
do {
if ( Player_Active() )
drv_gst.Update();
-
- if (GST_ELEMENT_IS_COTHREAD_STOPPING (element))
- cothread_switch(cothread_current_main());
+
+ gst_element_yield (element);
}
while ( 1 );
}