diff options
-rw-r--r-- | src/demuxers/demux_mpeg_block.c | 12 | ||||
-rw-r--r-- | src/demuxers/demux_ts.c | 9 | ||||
-rw-r--r-- | src/dxr3/dxr3_decode_spu.c | 15 | ||||
-rw-r--r-- | src/input/input_dvd.c | 11 | ||||
-rw-r--r-- | src/libffmpeg/xine_decoder.c | 8 | ||||
-rw-r--r-- | src/libspudec/xine_decoder.c | 15 | ||||
-rw-r--r-- | src/xine-engine/buffer.h | 24 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 66 |
8 files changed, 94 insertions, 66 deletions
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 6c450685b..cdac6b4c3 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.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: demux_mpeg_block.c,v 1.137 2002/11/10 13:33:14 mroi Exp $ + * $Id: demux_mpeg_block.c,v 1.138 2002/11/15 00:20:31 miguelfreitas Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -323,7 +323,10 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m buf->content = p; buf->size = packet_len; - buf->type = BUF_SPU_NAV; + buf->type = BUF_SPU_DVD; + buf->decoder_flags |= BUF_FLAG_SPECIAL; + buf->decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE; + buf->decoder_info[2] = SPU_DVD_SUBTYPE_NAV; buf->pts = 0; /* NAV packets do not have PES values */ buf->input_pos = this->input->get_current_pos(this->input); buf->input_length = this->input->get_length (this->input); @@ -460,7 +463,10 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m buf->content = p+1; buf->size = packet_len-1; - buf->type = BUF_SPU_PACKAGE + spu_id; + buf->type = BUF_SPU_DVD + spu_id; + buf->decoder_flags |= BUF_FLAG_SPECIAL; + buf->decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE; + buf->decoder_info[2] = SPU_DVD_SUBTYPE_PACKAGE; buf->pts = pts; if( !preview_mode ) check_newpts( this, pts, PTS_VIDEO ); diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 3690ff317..ae2037a06 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.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: demux_ts.c,v 1.64 2002/11/14 12:45:33 miguelfreitas Exp $ + * $Id: demux_ts.c,v 1.65 2002/11/15 00:20:31 miguelfreitas Exp $ * * Demultiplexer for MPEG2 Transport Streams. * @@ -501,7 +501,7 @@ static int demux_ts_parse_pes_header (demux_ts_media *m, m->content = p+1; m->size = packet_len-1; - m->type = BUF_SPU_PACKAGE + spu_id; + m->type = BUF_SPU_DVD + spu_id; return 1; } else if ((p[0] & 0xF0) == 0x80) { @@ -590,6 +590,11 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts, m->buf->content = m->buf->mem; m->buf->size = m->buffered_bytes; m->buf->type = m->type; + if( (m->buf->type & 0xffff0000) == BUF_SPU_DVD ) { + m->buf->decoder_flags |= BUF_FLAG_SPECIAL; + m->buf->decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE; + m->buf->decoder_info[2] = SPU_DVD_SUBTYPE_PACKAGE; + } m->buf->pts = m->pts; m->buf->decoder_info[0] = 1; m->buf->input_pos = this->input->get_current_pos(this->input); diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c index 5beb40ee9..74729dc03 100644 --- a/src/dxr3/dxr3_decode_spu.c +++ b/src/dxr3/dxr3_decode_spu.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: dxr3_decode_spu.c,v 1.24 2002/10/26 20:52:08 mroi Exp $ + * $Id: dxr3_decode_spu.c,v 1.25 2002/11/15 00:20:31 miguelfreitas Exp $ */ /* dxr3 spu decoder plugin. @@ -57,7 +57,7 @@ static void *dxr3_spudec_init_plugin(xine_t *xine, void *); /* plugin catalog information */ -static uint32_t supported_types[] = { BUF_SPU_PACKAGE, BUF_SPU_CLUT, BUF_SPU_NAV, BUF_SPU_SUBP_CONTROL, 0 }; +static uint32_t supported_types[] = { BUF_SPU_DVD, 0 }; static decoder_info_t dxr3_spudec_info = { supported_types, /* supported types */ @@ -259,7 +259,12 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) dxr3_spudec_handle_event(this); - if (buf->type == BUF_SPU_CLUT) { + if ( (buf->type & 0xffff0000) != BUF_SPU_DVD || + !(buf->decoder_flags & BUF_FLAG_SPECIAL) || + buf->decoder_info[1] != BUF_SPECIAL_SPU_DVD_SUBTYPE ) + return; + + if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_CLUT ) { #if LOG_SPU printf("dxr3_decode_spu: BUF_SPU_CLUT\n"); #endif @@ -274,7 +279,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock); return; } - if(buf->type == BUF_SPU_SUBP_CONTROL) { + if( buf->decoder_info[2] == SPU_DVD_SUBTYPE_SUBP_CONTROL ) { /* FIXME: is BUF_SPU_SUBP_CONTROL used anymore? */ int i; uint32_t *subp_control = (uint32_t *)buf->content; @@ -283,7 +288,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) this->spu_stream_state[i].stream_filter = subp_control[i]; return; } - if(buf->type == BUF_SPU_NAV) { + if( buf->decoder_info[2] == SPU_DVD_SUBTYPE_NAV ) { uint8_t *p = buf->content; #if LOG_BTN diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index fbb75e2e9..3644b9b56 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -18,7 +18,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: input_dvd.c,v 1.113 2002/11/03 23:03:31 siggi Exp $ + * $Id: input_dvd.c,v 1.114 2002/11/15 00:20:32 miguelfreitas Exp $ * */ @@ -617,7 +617,10 @@ static buf_element_t *dvd_plugin_read_block (input_plugin_t *this_gen, case DVDNAV_SPU_CLUT_CHANGE: { buf->content = block; - buf->type = BUF_SPU_CLUT; + buf->type = BUF_SPU_DVD; + buf->decoder_flags |= BUF_FLAG_SPECIAL; + buf->decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE; + buf->decoder_info[2] = SPU_DVD_SUBTYPE_CLUT; finished = 1; } break; @@ -1676,6 +1679,10 @@ static void *init_class (xine_t *xine, void *data) { /* * $Log: input_dvd.c,v $ + * Revision 1.114 2002/11/15 00:20:32 miguelfreitas + * cleaning up spu types. now avi subtitles may be enabled again. + * (+ missed ffmpeg/dv patch) + * * Revision 1.113 2002/11/03 23:03:31 siggi * some more release-related fixes... * diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index 01cec035a..fb1d419cb 100644 --- a/src/libffmpeg/xine_decoder.c +++ b/src/libffmpeg/xine_decoder.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_decoder.c,v 1.68 2002/11/14 04:22:55 tmmm Exp $ + * $Id: xine_decoder.c,v 1.69 2002/11/15 00:20:32 miguelfreitas Exp $ * * xine decoder plugin using ffmpeg * @@ -387,6 +387,11 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("sorenson svq 1 (ffmpeg)"); break; + case BUF_VIDEO_DV: + codec = avcodec_find_decoder (CODEC_ID_DVVIDEO); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("DV (ffmpeg)"); + break; default: printf ("ffmpeg: unknown video format (buftype: 0x%08X)\n", buf->type & 0xFFFF0000); @@ -980,6 +985,7 @@ static uint32_t supported_video_types[] = { /* BUF_VIDEO_SORENSON_V1 */ BUF_VIDEO_JPEG, BUF_VIDEO_MPEG, + BUF_VIDEO_DV, 0 }; diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c index 5625e0f51..bbad6f819 100644 --- a/src/libspudec/xine_decoder.c +++ b/src/libspudec/xine_decoder.c @@ -19,7 +19,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_decoder.c,v 1.84 2002/11/01 11:02:52 jcdutton Exp $ + * $Id: xine_decoder.c,v 1.85 2002/11/15 00:20:33 miguelfreitas Exp $ * * stuff needed to turn libspu into a xine decoder plugin */ @@ -77,7 +77,12 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { #ifdef LOG_DEBUG printf("libspudec:got buffer type = %x\n", buf->type); #endif - if (buf->type == BUF_SPU_CLUT) { + if ( (buf->type & 0xffff0000) != BUF_SPU_DVD || + !(buf->decoder_flags & BUF_FLAG_SPECIAL) || + buf->decoder_info[1] != BUF_SPECIAL_SPU_DVD_SUBTYPE ) + return; + + if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_CLUT ) { printf("libspudec: SPU CLUT\n"); if (buf->content[0]) { /* cheap endianess detection */ xine_fast_memcpy(this->state.clut, buf->content, sizeof(uint32_t)*16); @@ -91,7 +96,7 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { return; } - if (buf->type == BUF_SPU_SUBP_CONTROL) { + if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_SUBP_CONTROL ) { /* FIXME: I don't think SUBP_CONTROL is used any more */ int i; uint32_t *subp_control = (uint32_t*) buf->content; @@ -100,7 +105,7 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { } return; } - if (buf->type == BUF_SPU_NAV) { + if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_NAV ) { #ifdef LOG_DEBUG printf("libspudec:got nav packet 1\n"); #endif @@ -443,7 +448,7 @@ static void *init_plugin (xine_t *xine, void *data) { } /* plugin catalog information */ -static uint32_t supported_types[] = { BUF_SPU_PACKAGE, BUF_SPU_CLUT, BUF_SPU_NAV, BUF_SPU_SUBP_CONTROL, 0 }; +static uint32_t supported_types[] = { BUF_SPU_DVD, 0 }; static decoder_info_t dec_info_data = { supported_types, /* supported types */ diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index 6fdabb9ea..292c1b461 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.h @@ -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: buffer.h,v 1.77 2002/11/09 23:22:33 guenter Exp $ + * $Id: buffer.h,v 1.78 2002/11/15 00:20:34 miguelfreitas Exp $ * * * contents: @@ -172,12 +172,9 @@ extern "C" { /* spu buffer types: */ #define BUF_SPU_BASE 0x04000000 -#define BUF_SPU_CLUT 0x04000000 -#define BUF_SPU_PACKAGE 0x04010000 -#define BUF_SPU_SUBP_CONTROL 0x04020000 -#define BUF_SPU_NAV 0x04030000 -#define BUF_SPU_TEXT 0x04040000 -#define BUF_SPU_CC 0x04050000 +#define BUF_SPU_DVD 0x04000000 +#define BUF_SPU_TEXT 0x04010000 +#define BUF_SPU_CC 0x04020000 /* demuxer block types: */ @@ -306,6 +303,19 @@ struct buf_element_s { */ #define BUF_SPECIAL_VQA_VECTOR_SIZE 7 +/* + * In a BUF_SPECIAL_SPU_DVD_SUBTYPE: + * decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE + * decoder_info[2] = subtype + * decoder_info[3] = + * This buffer is pass SPU subtypes from DVDs + */ +#define BUF_SPECIAL_SPU_DVD_SUBTYPE 8 +#define SPU_DVD_SUBTYPE_CLUT 1 +#define SPU_DVD_SUBTYPE_PACKAGE 2 +#define SPU_DVD_SUBTYPE_SUBP_CONTROL 3 +#define SPU_DVD_SUBTYPE_NAV 4 + typedef struct palette_entry_s palette_entry_t; struct palette_entry_s diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index 7252818b5..86ee1b55d 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.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: video_decoder.c,v 1.109 2002/11/12 18:40:55 miguelfreitas Exp $ + * $Id: video_decoder.c,v 1.110 2002/11/15 00:20:34 miguelfreitas Exp $ * */ @@ -50,11 +50,6 @@ static void update_spu_decoder (xine_stream_t *stream, int type) { stream->spu_decoder_streamtype = streamtype; stream->spu_decoder_plugin = get_spu_decoder (stream, streamtype); - /* obsolete? - if (this->spu_decoder_plugin ) - this->spu_decoder_plugin->init (this->spu_decoder_plugin, - this->video_out); - */ } return ; } @@ -118,35 +113,6 @@ void *video_decoder_loop (void *stream_gen) { DISC_STREAMSTART, 0); break; -/* case BUF_SPU_TEXT is not handled yet. - * There is a need to multiply plugins to be loaded at once. - * E.g. The DVD SPU decoder and the DVD NAV decoder need - * to be open at the same time for the entire DVD. - * BUF_SPU_TEXT can also happen at the same time as playing a DVD, - * so two or more subtitle plugins need to be able to co-exist at the same time. - * Currently, if we see a BUF_SPU_NAV and then a BUF_SPU_PACKAGE, - * we call dispose for changing to NAV to PACKAGE. This causes - * libspudec to looses NAV state, and thus no menus appear. - * As a work around, once libspudec is opened, we will never close it. - * - */ - case BUF_SPU_SUBP_CONTROL: - case BUF_SPU_CLUT: - case BUF_SPU_PACKAGE: - case BUF_SPU_NAV: - xine_profiler_start_count (prof_spu_decode); - if (stream->stream_info[XINE_STREAM_INFO_IGNORE_SPU]) - break; - if (!stream->spu_decoder_plugin) { - update_spu_decoder(stream, buf->type); - } - if (stream->spu_decoder_plugin) { - stream->spu_decoder_plugin->decode_data (stream->spu_decoder_plugin, buf); - } - - xine_profiler_stop_count (prof_spu_decode); - break; - case BUF_CONTROL_SPU_CHANNEL: { xine_event_t ui_event; @@ -289,13 +255,14 @@ void *video_decoder_loop (void *stream_gen) { break; default: - xine_profiler_start_count (prof_video_decode); - - if (stream->stream_info[XINE_STREAM_INFO_IGNORE_VIDEO]) - break; if ( (buf->type & 0xFF000000) == BUF_VIDEO_BASE ) { + if (stream->stream_info[XINE_STREAM_INFO_IGNORE_VIDEO]) + break; + + xine_profiler_start_count (prof_video_decode); + /* printf ("video_decoder: got package %d, decoder_info[0]:%d\n", buf, buf->decoder_info[0]); @@ -324,6 +291,25 @@ void *video_decoder_loop (void *stream_gen) { buf_video_name( buf->type ) ); buftype_unknown = buf->type; } + + xine_profiler_stop_count (prof_video_decode); + + } else if ( (buf->type & 0xFF000000) == BUF_SPU_BASE ) { + + if (stream->stream_info[XINE_STREAM_INFO_IGNORE_SPU]) + break; + + xine_profiler_start_count (prof_spu_decode); + + update_spu_decoder(stream, buf->type); + + if (stream->spu_decoder_plugin) { + stream->spu_decoder_plugin->decode_data (stream->spu_decoder_plugin, buf); + } + + xine_profiler_stop_count (prof_spu_decode); + break; + } else if (buf->type != buftype_unknown) { xine_log (stream->xine, XINE_LOG_MSG, "video_decoder: unknown buffer type: %08x\n", @@ -331,8 +317,6 @@ void *video_decoder_loop (void *stream_gen) { buftype_unknown = buf->type; } - xine_profiler_stop_count (prof_video_decode); - break; } |