diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-10-30 22:40:53 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-10-30 22:40:53 +0000 |
commit | fe9eb37f05b677071f9de1b9e69c535aa2293d0b (patch) | |
tree | 54cbc02374f1fb4a466b360040a6b8a0a00d5674 /src/post/visualizations/fftscope.c | |
parent | deb61082227d4de4694578cdb96c156483c3cbac (diff) | |
download | xine-lib-fe9eb37f05b677071f9de1b9e69c535aa2293d0b.tar.gz xine-lib-fe9eb37f05b677071f9de1b9e69c535aa2293d0b.tar.bz2 |
* modify the engine slightly, so that the stream member in a video frame or
audio buffer can be NULL; this should be used to indicate that the frame/
buffer does not come directly from a stream, but was generated otherwise
(the most important result is that frames/buffers with stream NULL will not
be passed through metronom)
* modify visualization post plugins so they set the stream on the generated
frames to NULL, this avoids cluttering metronom, when playing a stream with
audio AND video AND a visualization post
* this also means modifying the way post plugins provide vpts values:
they have to calculate them themselves for now
CVS patchset: 5647
CVS date: 2003/10/30 22:40:53
Diffstat (limited to 'src/post/visualizations/fftscope.c')
-rw-r--r-- | src/post/visualizations/fftscope.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c index d7a48272d..4cdc8b93c 100644 --- a/src/post/visualizations/fftscope.c +++ b/src/post/visualizations/fftscope.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2002 the xine project + * Copyright (C) 2000-2003 the xine project * * This file is part of xine, a free video player. * @@ -22,7 +22,7 @@ * * FFT code by Steve Haehnichen, originally licensed under GPL v1 * - * $Id: fftscope.c,v 1.16 2003/09/14 12:44:20 tmattern Exp $ + * $Id: fftscope.c,v 1.17 2003/10/30 22:40:53 mroi Exp $ * */ @@ -33,6 +33,7 @@ #include "xineutils.h" #include "post.h" #include "bswap.h" +#include "visualizations.h" #include "fft.h" #define FPS 20 @@ -83,7 +84,7 @@ struct post_plugin_fftscope_s { /* * Fade out a YUV pixel */ -void fade_out_yuv(uint8_t *y, uint8_t *u, uint8_t *v, float factor) { +static void fade_out_yuv(uint8_t *y, uint8_t *u, uint8_t *v, float factor) { #if 0 float r, g, b; @@ -373,17 +374,10 @@ static void fftscope_port_put_buffer (xine_audio_port_t *port_gen, int16_t *data; int8_t *data8; int samples_used = 0; - uint64_t vpts = buf->vpts; + int64_t pts = buf->vpts; + int64_t vpts = 0; int i, c; - /* HACK: compute a pts using metronom internals */ - if (!vpts) { - metronom_t *metronom = this->stream->metronom; - pthread_mutex_lock(&metronom->lock); - vpts = metronom->audio_vpts - metronom->vpts_offset; - pthread_mutex_unlock(&metronom->lock); - } - /* make a copy of buf data for private use */ if( this->buf.mem_size < buf->mem_size ) { this->buf.mem = realloc(this->buf.mem, buf->mem_size); @@ -441,15 +435,23 @@ static void fftscope_port_put_buffer (xine_audio_port_t *port_gen, VO_BOTH_FIELDS); frame->extra_info->invalid = 1; frame->bad_frame = 0; - frame->pts = vpts; - vpts = 0; - frame->duration = 90000 * this->samples_per_frame / this->sample_rate; + if (!vpts) { + vpts = this->stream->metronom->audio_vpts; + frame->pts = pts; + frame->vpts = vpts; + pts = 0; + vpts += frame->duration; + } else { + frame->pts = 0; + frame->vpts = vpts; + vpts += frame->duration; + } this->sample_counter -= this->samples_per_frame; draw_fftscope(this, frame); - frame->draw(frame, stream); + frame->draw(frame, NULL); frame->free(frame); } } while( this->sample_counter >= this->samples_per_frame ); |