summaryrefslogtreecommitdiff
path: root/src/post
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2004-05-29 14:45:25 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2004-05-29 14:45:25 +0000
commita74413f06efef91496b3f5b9f749b328ede19ac8 (patch)
tree4077995d8ad8c0fc3784d9c7d91a40e1b15e731c /src/post
parentcd2b6b26d53a8d879250cd28f0dfbb1cf2b04355 (diff)
downloadxine-lib-a74413f06efef91496b3f5b9f749b328ede19ac8.tar.gz
xine-lib-a74413f06efef91496b3f5b9f749b328ede19ac8.tar.bz2
separate the two semantics of querying a port's status with a NULL stream;
before, NULL could mean two things: no stream at all or a stream that does not want to be addressed; now the latter is represented by the new XINE_ANON_STREAM resulting changes: * the status() functions now behave differently for NULL and XINE_ANON_STREAM (as the commentary always implied, but this was not the case, so post plugin rewiring went wrong, because it relies on the status() function) * the NULL_STREAM defines in audio_out and video_out are obsolete * update the function comments in the headers * update the post plugin rewire functions to use the status() functions to check, if the old port was opened and handle the new one accordingly; this makes open_count obsolete * change all post plugins accordingly (mostly using XINE_ANON_STREAM instead of NULL) additional change: * the status() function of audio port now returns the bits/rate/mode values of the input and not the output; this is more likely to be what a post plugin wants * the reimplementation of status() in the upmix plugin is obsolete CVS patchset: 6603 CVS date: 2004/05/29 14:45:25
Diffstat (limited to 'src/post')
-rw-r--r--src/post/audio/upmix.c29
-rw-r--r--src/post/deinterlace/xine_plugin.c7
-rw-r--r--src/post/goom/xine_goom.c22
-rw-r--r--src/post/mosaico/mosaico.c4
-rw-r--r--src/post/mosaico/switch.c4
-rw-r--r--src/post/visualizations/fftgraph.c20
-rw-r--r--src/post/visualizations/fftscope.c20
-rw-r--r--src/post/visualizations/fooviz.c20
-rw-r--r--src/post/visualizations/oscope.c20
9 files changed, 49 insertions, 97 deletions
diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c
index 091a39b0c..e08174995 100644
--- a/src/post/audio/upmix.c
+++ b/src/post/audio/upmix.c
@@ -23,7 +23,7 @@
* It simply creates output channels to match the speaker arrangement.
* E.g. Converts Stereo into Surround 5.1
*
- * $Id: upmix.c,v 1.13 2004/05/23 16:20:56 mroi Exp $
+ * $Id: upmix.c,v 1.14 2004/05/29 14:45:25 mroi Exp $
*
*/
@@ -177,14 +177,10 @@ static int upmix_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
- if (stream)
- port->stream = stream;
- else
- port->stream = POST_NULL_STREAM;
+ port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
- port->open_count++;
capabilities = port->original_port->get_capabilities(port->original_port);
this->ratio = (double)FOO_WIDTH/(double)FOO_HEIGHT;
@@ -223,15 +219,16 @@ static int upmix_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
return port->original_port->open(port->original_port, stream, bits, rate, mode );
}
+#if 0
static void upmix_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream ) {
post_audio_port_t *port = (post_audio_port_t *)port_gen;
port->stream = NULL;
port->original_port->close(port->original_port, stream );
- port->open_count--;
_x_post_dec_usage(port);
}
+#endif
static int upmix_frames_2to51_any_to_float( uint8_t *dst8, uint8_t *src8, int num_frames, int step_channel_in, af_sub_t *sub) {
float *dst=(float *)dst8;
@@ -383,19 +380,6 @@ static void upmix_port_put_buffer (xine_audio_port_t *port_gen,
return;
}
-static int upmix_port_audio_status(xine_audio_port_t *port_gen, xine_stream_t *stream,
- uint32_t *bits, uint32_t *rate, int *mode) {
- post_audio_port_t *port = (post_audio_port_t *)port_gen;
-
- if (port->port_lock) pthread_mutex_lock(port->port_lock);
- *bits = port->bits;
- *rate = port->rate;
- *mode = port->mode;
- if (port->port_lock) pthread_mutex_unlock(port->port_lock);
- return 1;
-}
-
-
static void upmix_dispose(post_plugin_t *this_gen)
{
post_plugin_upmix_t *this = (post_plugin_upmix_t *)this_gen;
@@ -414,7 +398,7 @@ static post_plugin_t *upmix_open_plugin(post_class_t *class_gen, int inputs,
post_plugin_upmix_t *this = (post_plugin_upmix_t *)xine_xmalloc(sizeof(post_plugin_upmix_t));
post_in_t *input;
post_out_t *output;
- xine_post_in_t *input_api;
+ xine_post_in_t *input_api;
post_audio_port_t *port;
if (!this || !audio_target || !audio_target[0] ) {
@@ -428,9 +412,10 @@ static post_plugin_t *upmix_open_plugin(post_class_t *class_gen, int inputs,
port = _x_post_intercept_audio_port(&this->post, audio_target[0], &input, &output);
port->new_port.open = upmix_port_open;
+#if 0
port->new_port.close = upmix_port_close;
+#endif
port->new_port.put_buffer = upmix_port_put_buffer;
- port->new_port.status = upmix_port_audio_status;
input_api = &this->params_input;
input_api->name = "parameters";
diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c
index f44a7a213..21ffd0634 100644
--- a/src/post/deinterlace/xine_plugin.c
+++ b/src/post/deinterlace/xine_plugin.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_plugin.c,v 1.31 2004/04/17 19:54:31 mroi Exp $
+ * $Id: xine_plugin.c,v 1.32 2004/05/29 14:45:25 mroi Exp $
*
* advanced video deinterlacer plugin
* Jun/2003 by Miguel Freitas
@@ -468,10 +468,7 @@ static void deinterlace_open(xine_video_port_t *port_gen, xine_stream_t *stream)
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
- if (stream)
- port->stream = stream;
- else
- port->stream = POST_NULL_STREAM;
+ port->stream = stream;
port->original_port->open(port->original_port, stream);
port->original_port->set_property(port->original_port,
XINE_PARAM_VO_DEINTERLACE,
diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c
index 4575e0078..45f90925d 100644
--- a/src/post/goom/xine_goom.c
+++ b/src/post/goom/xine_goom.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_goom.c,v 1.52 2004/05/18 03:17:02 miguelfreitas Exp $
+ * $Id: xine_goom.c,v 1.53 2004/05/29 14:45:26 mroi Exp $
*
* GOOM post plugin.
*
@@ -341,8 +341,8 @@ static int goom_rewire_video(xine_post_out_t *output_gen, void *data)
if (!data)
return 0;
/* register our stream at the new output port */
- old_port->close(old_port, NULL);
- new_port->open(new_port, NULL);
+ old_port->close(old_port, XINE_ANON_STREAM);
+ new_port->open(new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -357,14 +357,10 @@ static int goom_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
- if (stream)
- port->stream = stream;
- else
- port->stream = POST_NULL_STREAM;
+ port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
- port->open_count++;
this->channels = _x_ao_mode2channels(mode);
this->sample_rate = rate;
@@ -373,7 +369,7 @@ static int goom_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
init_yuv_planes(&this->yuv, this->width, this->height);
this->skip_frame = 0;
- this->vo_port->open(this->vo_port, NULL);
+ this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
return port->original_port->open(port->original_port, stream, bits, rate, mode );
@@ -388,13 +384,11 @@ static void goom_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream )
port->stream = NULL;
- this->vo_port->close(this->vo_port, NULL);
+ this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
port->original_port->close(port->original_port, stream );
- port->open_count--;
-
_x_post_dec_usage(port);
}
@@ -535,10 +529,10 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
}
}
- this->skip_frame = frame->draw(frame, NULL);
+ this->skip_frame = frame->draw(frame, XINE_ANON_STREAM);
} else {
frame->bad_frame = 1;
- frame->draw(frame, NULL);
+ frame->draw(frame, XINE_ANON_STREAM);
this->skip_frame--;
}
frame->free(frame);
diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c
index 31a55dc99..67b9e3e5d 100644
--- a/src/post/mosaico/mosaico.c
+++ b/src/post/mosaico/mosaico.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mosaico.c,v 1.23 2004/04/17 19:54:31 mroi Exp $
+ * $Id: mosaico.c,v 1.24 2004/05/29 14:45:26 mroi Exp $
*/
/*
@@ -294,7 +294,7 @@ static void mosaico_close(xine_video_port_t *port_gen, xine_stream_t *stream)
pthread_mutex_lock(&this->mutex);
free_frame = this->pip[pip_num].frame;
this->pip[pip_num].frame = NULL;
- port->original_port->close(port->original_port, NULL);
+ port->original_port->close(port->original_port, port->stream);
pthread_mutex_unlock(&this->mutex);
if (free_frame)
diff --git a/src/post/mosaico/switch.c b/src/post/mosaico/switch.c
index ce4a8cd85..e63275d06 100644
--- a/src/post/mosaico/switch.c
+++ b/src/post/mosaico/switch.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: switch.c,v 1.13 2004/04/17 19:54:31 mroi Exp $
+ * $Id: switch.c,v 1.14 2004/05/29 14:45:26 mroi Exp $
*/
/*
@@ -253,7 +253,7 @@ static int switch_draw(vo_frame_t *frame, xine_stream_t *stream)
pthread_cond_wait(&this->display_condition_changed, &this->mutex);
if (this->selected_source == source_num) {
_x_post_frame_copy_down(frame, frame->next);
- skip = frame->next->draw(frame->next, NULL);
+ skip = frame->next->draw(frame->next, XINE_ANON_STREAM);
_x_post_frame_copy_up(frame, frame->next);
this->vpts_limit = frame->vpts + frame->duration;
if (skip) {
diff --git a/src/post/visualizations/fftgraph.c b/src/post/visualizations/fftgraph.c
index eeb0f246e..1b88b4521 100644
--- a/src/post/visualizations/fftgraph.c
+++ b/src/post/visualizations/fftgraph.c
@@ -20,7 +20,7 @@
* FftGraph Visualization Post Plugin For xine
* by Thibaut Mattern (tmattern@noos.fr)
*
- * $Id: fftgraph.c,v 1.11 2004/05/18 03:17:03 miguelfreitas Exp $
+ * $Id: fftgraph.c,v 1.12 2004/05/29 14:45:26 mroi Exp $
*
*/
@@ -196,8 +196,8 @@ static int fftgraph_rewire_video(xine_post_out_t *output_gen, void *data)
if (!data)
return 0;
/* register our stream at the new output port */
- old_port->close(old_port, NULL);
- new_port->open(new_port, NULL);
+ old_port->close(old_port, XINE_ANON_STREAM);
+ new_port->open(new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -217,14 +217,10 @@ static int fftgraph_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
- if (stream)
- port->stream = stream;
- else
- port->stream = POST_NULL_STREAM;
+ port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
- port->open_count++;
this->ratio = (double)FFTGRAPH_WIDTH / (double)FFTGRAPH_HEIGHT;
@@ -235,7 +231,7 @@ static int fftgraph_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
this->samples_per_frame = rate / FPS;
this->data_idx = 0;
- this->vo_port->open(this->vo_port, NULL);
+ this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
this->fft = fft_new(FFT_BITS);
@@ -300,13 +296,11 @@ static void fftgraph_port_close(xine_audio_port_t *port_gen, xine_stream_t *stre
fft_dispose(this->fft);
this->fft = NULL;
- this->vo_port->close(this->vo_port, NULL);
+ this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
port->original_port->close(port->original_port, stream );
- port->open_count--;
-
_x_post_dec_usage(port);
}
@@ -387,7 +381,7 @@ static void fftgraph_port_put_buffer (xine_audio_port_t *port_gen,
draw_fftgraph(this, frame);
- frame->draw(frame, NULL);
+ frame->draw(frame, XINE_ANON_STREAM);
frame->free(frame);
}
} while( this->sample_counter >= this->samples_per_frame );
diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c
index d2a98bb9f..95ed6969e 100644
--- a/src/post/visualizations/fftscope.c
+++ b/src/post/visualizations/fftscope.c
@@ -22,7 +22,7 @@
*
* FFT code by Steve Haehnichen, originally licensed under GPL v1
*
- * $Id: fftscope.c,v 1.26 2004/05/18 03:17:03 miguelfreitas Exp $
+ * $Id: fftscope.c,v 1.27 2004/05/29 14:45:26 mroi Exp $
*
*/
@@ -260,8 +260,8 @@ static int fftscope_rewire_video(xine_post_out_t *output_gen, void *data)
if (!data)
return 0;
/* register our stream at the new output port */
- old_port->close(old_port, NULL);
- new_port->open(new_port, NULL);
+ old_port->close(old_port, XINE_ANON_STREAM);
+ new_port->open(new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -277,14 +277,10 @@ static int fftscope_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
- if (stream)
- port->stream = stream;
- else
- port->stream = POST_NULL_STREAM;
+ port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
- port->open_count++;
this->ratio = (double)FFT_WIDTH/(double)FFT_HEIGHT;
@@ -295,7 +291,7 @@ static int fftscope_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
this->data_idx = 0;
this->fft = fft_new(FFT_BITS);
- this->vo_port->open(this->vo_port, NULL);
+ this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
for (c = 0; c < this->channels; c++) {
@@ -321,13 +317,11 @@ static void fftscope_port_close(xine_audio_port_t *port_gen, xine_stream_t *stre
fft_dispose(this->fft);
this->fft = NULL;
- this->vo_port->close(this->vo_port, NULL);
+ this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
port->original_port->close(port->original_port, stream );
- port->open_count--;
-
_x_post_dec_usage(port);
}
@@ -408,7 +402,7 @@ static void fftscope_port_put_buffer (xine_audio_port_t *port_gen,
draw_fftscope(this, frame);
- frame->draw(frame, NULL);
+ frame->draw(frame, XINE_ANON_STREAM);
frame->free(frame);
}
} while( this->sample_counter >= this->samples_per_frame );
diff --git a/src/post/visualizations/fooviz.c b/src/post/visualizations/fooviz.c
index d4d671749..08fa83c4f 100644
--- a/src/post/visualizations/fooviz.c
+++ b/src/post/visualizations/fooviz.c
@@ -23,7 +23,7 @@
* process. It simply paints the screen a solid color and rotates through
* colors on each iteration.
*
- * $Id: fooviz.c,v 1.22 2004/05/18 03:17:03 miguelfreitas Exp $
+ * $Id: fooviz.c,v 1.23 2004/05/29 14:45:26 mroi Exp $
*
*/
@@ -93,8 +93,8 @@ static int fooviz_rewire_video(xine_post_out_t *output_gen, void *data)
if (!data)
return 0;
/* register our stream at the new output port */
- old_port->close(old_port, NULL);
- new_port->open(new_port, NULL);
+ old_port->close(old_port, XINE_ANON_STREAM);
+ new_port->open(new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -109,21 +109,17 @@ static int fooviz_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
- if (stream)
- port->stream = stream;
- else
- port->stream = POST_NULL_STREAM;
+ port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
- port->open_count++;
this->ratio = (double)FOO_WIDTH/(double)FOO_HEIGHT;
this->channels = _x_ao_mode2channels(mode);
this->samples_per_frame = rate / FPS;
this->data_idx = 0;
- this->vo_port->open(this->vo_port, NULL);
+ this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
return port->original_port->open(port->original_port, stream, bits, rate, mode );
@@ -136,13 +132,11 @@ static void fooviz_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream
port->stream = NULL;
- this->vo_port->close(this->vo_port, NULL);
+ this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
port->original_port->close(port->original_port, stream );
- port->open_count--;
-
_x_post_dec_usage(port);
}
@@ -222,7 +216,7 @@ static void fooviz_port_put_buffer (xine_audio_port_t *port_gen,
memset(frame->base[0], this->current_yuv_byte, FOO_WIDTH * FOO_HEIGHT * 2);
this->current_yuv_byte += 3;
- frame->draw(frame, NULL);
+ frame->draw(frame, XINE_ANON_STREAM);
frame->free(frame);
}
} while( this->sample_counter >= this->samples_per_frame );
diff --git a/src/post/visualizations/oscope.c b/src/post/visualizations/oscope.c
index 44204a0b3..93041e393 100644
--- a/src/post/visualizations/oscope.c
+++ b/src/post/visualizations/oscope.c
@@ -20,7 +20,7 @@
* Basic Oscilloscope Visualization Post Plugin For xine
* by Mike Melanson (melanson@pcisys.net)
*
- * $Id: oscope.c,v 1.18 2004/05/18 03:17:03 miguelfreitas Exp $
+ * $Id: oscope.c,v 1.19 2004/05/29 14:45:26 mroi Exp $
*
*/
@@ -163,8 +163,8 @@ static int oscope_rewire_video(xine_post_out_t *output_gen, void *data)
if (!data)
return 0;
- old_port->close(old_port, NULL);
- new_port->open(new_port, NULL);
+ old_port->close(old_port, XINE_ANON_STREAM);
+ new_port->open(new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -179,14 +179,10 @@ static int oscope_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
- if (stream)
- port->stream = stream;
- else
- port->stream = POST_NULL_STREAM;
+ port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
- port->open_count++;
this->ratio = (double)OSCOPE_WIDTH/(double)OSCOPE_HEIGHT;
@@ -197,7 +193,7 @@ static int oscope_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
this->data_idx = 0;
init_yuv_planes(&this->yuv, OSCOPE_WIDTH, OSCOPE_HEIGHT);
- this->vo_port->open(this->vo_port, NULL);
+ this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
return port->original_port->open(port->original_port, stream, bits, rate, mode );
@@ -210,13 +206,11 @@ static void oscope_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream
port->stream = NULL;
- this->vo_port->close(this->vo_port, NULL);
+ this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
port->original_port->close(port->original_port, stream );
- port->open_count--;
-
_x_post_dec_usage(port);
}
@@ -292,7 +286,7 @@ static void oscope_port_put_buffer (xine_audio_port_t *port_gen,
draw_oscope_dots(this);
yuv444_to_yuy2(&this->yuv, frame->base[0], frame->pitches[0]);
- frame->draw(frame, NULL);
+ frame->draw(frame, XINE_ANON_STREAM);
frame->free(frame);
}