Fixed some plugins

Original commit message from CVS:
Fixed some plugins
This commit is contained in:
Wim Taymans 2001-12-28 20:24:41 +00:00
parent d0e007a680
commit 42cc21cd97
7 changed files with 21 additions and 31 deletions

View file

@ -215,8 +215,8 @@ gst_afsrc_get (GstPad *pad)
frameCount); frameCount);
readbytes = readframes * (src->channels * src->width / 8); readbytes = readframes * (src->channels * src->width / 8);
if (readbytes == 0) { if (readbytes == 0) {
gst_element_signal_eos (GST_ELEMENT (src)); gst_element_set_eos (GST_ELEMENT (src));
return NULL; return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
} }
GST_BUFFER_SIZE (buf) = readbytes; GST_BUFFER_SIZE (buf) = readbytes;

View file

@ -239,7 +239,6 @@ gst_sdlvideosink_chain (GstPad *pad, GstBuffer *buf)
sdlvideosink = GST_SDLVIDEOSINK (gst_pad_get_parent (pad)); sdlvideosink = GST_SDLVIDEOSINK (gst_pad_get_parent (pad));
if (!GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLUSH)) {
GST_DEBUG (0,"videosink: clock wait: %llu\n", GST_BUFFER_TIMESTAMP(buf)); GST_DEBUG (0,"videosink: clock wait: %llu\n", GST_BUFFER_TIMESTAMP(buf));
jitter = gst_clock_current_diff(sdlvideosink->clock, GST_BUFFER_TIMESTAMP (buf)); jitter = gst_clock_current_diff(sdlvideosink->clock, GST_BUFFER_TIMESTAMP (buf));
@ -252,7 +251,6 @@ gst_sdlvideosink_chain (GstPad *pad, GstBuffer *buf)
else { else {
gst_clock_wait(sdlvideosink->clock, GST_BUFFER_TIMESTAMP(buf), GST_OBJECT(sdlvideosink)); gst_clock_wait(sdlvideosink->clock, GST_BUFFER_TIMESTAMP(buf), GST_OBJECT(sdlvideosink));
} }
}
/* Lock SDL/yuv-overlay */ /* Lock SDL/yuv-overlay */
if ( SDL_LockSurface(sdlvideosink->screen) < 0 ) { if ( SDL_LockSurface(sdlvideosink->screen) < 0 ) {

View file

@ -571,7 +571,6 @@ gst_flxdec_loop (GstElement *element)
GST_BUFFER_DATA(flxdec->frame), GST_BUFFER_DATA(flxdec->frame),
GST_BUFFER_DATA(flxdec->out)); GST_BUFFER_DATA(flxdec->out));
//GST_BUFFER_FLAG_SET(flxdec->out, GST_BUFFER_FLUSH);
gst_pad_push(flxdec->srcpad, flxdec->out); gst_pad_push(flxdec->srcpad, flxdec->out);
break; break;

View file

@ -252,10 +252,11 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
time_stamp = GST_BUFFER_TIMESTAMP(buf); time_stamp = GST_BUFFER_TIMESTAMP(buf);
/* FIXME, handle events here */
if (GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLUSH)) { /*
gst_mp1videoparse_flush(mp1videoparse); gst_mp1videoparse_flush(mp1videoparse);
} */
if (mp1videoparse->partialbuf) { if (mp1videoparse->partialbuf) {
offset = GST_BUFFER_SIZE(mp1videoparse->partialbuf); offset = GST_BUFFER_SIZE(mp1videoparse->partialbuf);
@ -349,7 +350,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
GST_BUFFER_TIMESTAMP(outbuf) = mp1videoparse->last_pts; GST_BUFFER_TIMESTAMP(outbuf) = mp1videoparse->last_pts;
if (mp1videoparse->in_flush) { if (mp1videoparse->in_flush) {
GST_BUFFER_FLAG_SET(outbuf, GST_BUFFER_FLUSH); /* FIXME, send a flush event here */
mp1videoparse->in_flush = FALSE; mp1videoparse->in_flush = FALSE;
} }

View file

@ -247,13 +247,14 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
last_ts = GST_BUFFER_TIMESTAMP(buf); last_ts = GST_BUFFER_TIMESTAMP(buf);
if (GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLUSH)) { /* FIXME, do flush */
/*
if (mp3parse->partialbuf) { if (mp3parse->partialbuf) {
gst_buffer_unref(mp3parse->partialbuf); gst_buffer_unref(mp3parse->partialbuf);
mp3parse->partialbuf = NULL; mp3parse->partialbuf = NULL;
} }
mp3parse->in_flush = TRUE; mp3parse->in_flush = TRUE;
} */
// if we have something left from the previous frame // if we have something left from the previous frame
if (mp3parse->partialbuf) { if (mp3parse->partialbuf) {
@ -329,12 +330,9 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
if (mp3parse->skip == 0) { if (mp3parse->skip == 0) {
GST_DEBUG (0,"mp3parse: pushing buffer of %d bytes\n",GST_BUFFER_SIZE(outbuf)); GST_DEBUG (0,"mp3parse: pushing buffer of %d bytes\n",GST_BUFFER_SIZE(outbuf));
if (mp3parse->in_flush) { if (mp3parse->in_flush) {
GST_BUFFER_FLAG_SET(outbuf, GST_BUFFER_FLUSH); /* FIXME do some sort of flush event */
mp3parse->in_flush = FALSE; mp3parse->in_flush = FALSE;
} }
else {
GST_BUFFER_FLAG_UNSET(outbuf, GST_BUFFER_FLUSH);
}
GST_BUFFER_TIMESTAMP(outbuf) = last_ts; GST_BUFFER_TIMESTAMP(outbuf) = last_ts;
gst_pad_push(mp3parse->srcpad,outbuf); gst_pad_push(mp3parse->srcpad,outbuf);
} }

View file

@ -39,7 +39,7 @@
while (GST_IS_EVENT(in)) { while (GST_IS_EVENT(in)) {
switch (GST_EVENT_TYPE(in)) { switch (GST_EVENT_TYPE(in)) {
case GST_EVENT_EOS: case GST_EVENT_EOS:
gst_element_set_state((GstElement*)filter, GST_STATE_PAUSED); gst_element_set_eos((GstElement*)filter);
gst_pad_push(filter->srcpad, in); gst_pad_push(filter->srcpad, in);
return; return;
default: default:

View file

@ -262,12 +262,6 @@ vcdsrc_get (GstPad *pad)
goto read_sector; goto read_sector;
} }
/* if (readbytes == 0) { */
/* gst_src_signal_eos(GST_SRC(vcdsrc)); */
/* gst_element_set_state(GST_ELEMENT(vcdsrc),~GST_STATE_PLAYING); */
/* gst_element_set_state(GST_ELEMENT(vcdsrc),~GST_STATE_RUNNING); */
/* return; */
/* } */
GST_BUFFER_OFFSET(buf) = vcdsrc->curoffset; GST_BUFFER_OFFSET(buf) = vcdsrc->curoffset;
GST_BUFFER_SIZE(buf) = vcdsrc->bytes_per_read; GST_BUFFER_SIZE(buf) = vcdsrc->bytes_per_read;