diff options
-rw-r--r-- | frontend_local.c | 4 | ||||
-rw-r--r-- | xine_frontend.c | 6 | ||||
-rw-r--r-- | xine_frontend.h | 4 | ||||
-rw-r--r-- | xine_input_vdr.c | 48 | ||||
-rw-r--r-- | xine_input_vdr.h | 4 |
5 files changed, 45 insertions, 21 deletions
diff --git a/frontend_local.c b/frontend_local.c index dbf9a617..dc5928e2 100644 --- a/frontend_local.c +++ b/frontend_local.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_local.c,v 1.43 2009-08-18 12:51:42 phintuka Exp $ + * $Id: frontend_local.c,v 1.44 2010-02-14 12:53:06 phintuka Exp $ * */ @@ -123,7 +123,7 @@ int cXinelibLocal::Play_PES(const uchar *data, int len) { LOCK_FE; if (fe && Running()) { - int done = fe->xine_queue_pes_packet(fe, (char*)data, len); + int done = fe->xine_queue_pes_packet(fe, 0, m_StreamPos, (const char *)data, len); if (done >= 0) { Lock(); m_StreamPos += done; diff --git a/xine_frontend.c b/xine_frontend.c index c72fe167..d3051f79 100644 --- a/xine_frontend.c +++ b/xine_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_frontend.c,v 1.111 2010-02-03 14:45:03 phintuka Exp $ + * $Id: xine_frontend.c,v 1.112 2010-02-14 12:53:06 phintuka Exp $ * */ @@ -1331,14 +1331,14 @@ static int xine_osd_command(frontend_t *this_gen, struct osd_command_s *cmd) { return this->input_plugin->f.push_input_osd(this->input_plugin, cmd); } -static int xine_queue_pes_packet(frontend_t *this_gen, const char *data, int len) +static int xine_queue_pes_packet(frontend_t *this_gen, int stream, uint64_t pos, const char *data, int len) { fe_t *this = (fe_t*)this_gen; if(!find_input_plugin(this)) return 0/*-1*/; - return this->input_plugin->f.push_input_write(this->input_plugin, data, len); + return this->input_plugin->f.push_input_write(this->input_plugin, stream, pos, data, len); } /* diff --git a/xine_frontend.h b/xine_frontend.h index 2deb4e1e..9f752bcd 100644 --- a/xine_frontend.h +++ b/xine_frontend.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_frontend.h,v 1.20 2009-12-29 13:45:54 phintuka Exp $ + * $Id: xine_frontend.h,v 1.21 2010-02-14 12:53:06 phintuka Exp $ * */ @@ -104,7 +104,7 @@ struct frontend_s { /* Data transfer VDR -> frontend/xine */ int (*xine_osd_command)(frontend_t*, struct osd_command_s *cmd); int (*xine_control)(frontend_t*, const char *cmd); - int (*xine_queue_pes_packet)(frontend_t*, const char *data, int len); + int (*xine_queue_pes_packet)(frontend_t*, int stream, uint64_t pos, const char *data, int len); char *(*grab)(frontend_t*, int *size, int jpeg, int quality, int width, int height); diff --git a/xine_input_vdr.c b/xine_input_vdr.c index 6448b519..e1c56650 100644 --- a/xine_input_vdr.c +++ b/xine_input_vdr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_input_vdr.c,v 1.295 2010-02-09 09:45:52 phintuka Exp $ + * $Id: xine_input_vdr.c,v 1.296 2010-02-14 12:53:06 phintuka Exp $ * */ @@ -118,6 +118,12 @@ #define CONTROL_BUF_BLANK (CONTROL_BUF_BASE|0x00010000) /* 0x0f010000 */ #define CONTROL_BUF_CLEAR (CONTROL_BUF_BASE|0x00020000) /* 0x0f020000 */ #define BUF_NETWORK_BLOCK (BUF_DEMUX_BLOCK |0x00010000) /* 0x05010000 */ +#define BUF_LOCAL_BLOCK (BUF_DEMUX_BLOCK |0x00020000) /* 0x05020000 */ + +typedef struct { + uint64_t pos; + uint8_t payload[0]; +} stream_local_header_t; #define SPU_CHANNEL_NONE (-2) #define SPU_CHANNEL_AUTO (-1) @@ -128,7 +134,7 @@ # include <linux/unistd.h> /* syscall(__NR_gettid) */ #endif -static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.295 2010-02-09 09:45:52 phintuka Exp $"; +static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.296 2010-02-14 12:53:06 phintuka Exp $"; static const char log_module_input_vdr[] = "[input_vdr] "; #define LOG_MODULENAME log_module_input_vdr #define SysLogLevel iSysLogLevel @@ -1331,7 +1337,8 @@ static buf_element_t *get_buf_element(vdr_input_plugin_t *this, int size, int fo if(!buf) buf = this->stream->audio_fifo->buffer_pool_try_alloc(this->stream->audio_fifo); - if(buf) { + /* set up defaults */ + if (buf) { buf->content = buf->mem; buf->size = 0; buf->type = BUF_DEMUX_BLOCK; @@ -1364,6 +1371,17 @@ static buf_element_t *get_buf_element_timed(vdr_input_plugin_t *this, int size, static void strip_network_headers(vdr_input_plugin_t *this, buf_element_t *buf) { + if (buf->type == BUF_LOCAL_BLOCK) { + stream_local_header_t *header = (stream_local_header_t *)buf->content; + this->curpos = header->pos; + + buf->content += sizeof(stream_local_header_t); + buf->size -= sizeof(stream_local_header_t); + buf->type = BUF_DEMUX_BLOCK; + + return; + } + if (buf->type == BUF_NETWORK_BLOCK) { if (this->udp || this->rtp) { stream_udp_header_t *header = (stream_udp_header_t *)buf->content; @@ -4260,7 +4278,7 @@ static buf_element_t *vdr_plugin_read_block_udp(vdr_input_plugin_t *this) } #ifdef TEST_PIP -static int write_slave_stream(vdr_input_plugin_t *this, const char *data, int len) +static int write_slave_stream(vdr_input_plugin_t *this, int stream, const char *data, int len) { fifo_input_plugin_t *slave; buf_element_t *buf; @@ -4309,7 +4327,7 @@ static int write_slave_stream(vdr_input_plugin_t *this, const char *data, int le } #endif -static int vdr_plugin_write(vdr_input_plugin_if_t *this_if, const char *data, int len) +static int vdr_plugin_write(vdr_input_plugin_if_t *this_if, int stream, uint64_t pos, const char *data, int len) { vdr_input_plugin_t *this = (vdr_input_plugin_t *) this_if; buf_element_t *buf = NULL; @@ -4318,11 +4336,11 @@ static int vdr_plugin_write(vdr_input_plugin_if_t *this_if, const char *data, in return len; #ifdef TEST_PIP - /* some (older?) VDR recordings have video PID != 0xE0 ... */ - - /* slave (PES) */ - if(!buf[0] && ((uint8_t*)data)[3] > 0xe0 && ((uint8_t*)data)[3] <= 0xef) - return write_slave_stream(this, data, len); + if (stream) + return write_slave_stream(this, stream, data, len); +#else + if (stream) + return len; #endif TRACE("vdr_plugin_write (%d bytes)", len); @@ -4351,8 +4369,13 @@ static int vdr_plugin_write(vdr_input_plugin_if_t *this_if, const char *data, in return len; } - buf->size = len; - xine_fast_memcpy(buf->content, data, len); + stream_local_header_t *hdr = (stream_local_header_t*)buf->content; + hdr->pos = pos; + + buf->type = BUF_LOCAL_BLOCK; + buf->size = len + sizeof(stream_local_header_t); + xine_fast_memcpy(buf->content + sizeof(stream_local_header_t), data, len); + this->block_buffer->put(this->block_buffer, buf); VDR_ENTRY_UNLOCK(); @@ -4445,6 +4468,7 @@ static buf_element_t *preprocess_buf(vdr_input_plugin_t *this, buf_element_t *bu /* demuxed video, control messages, ... go directly to demuxer */ if (buf->type != BUF_NETWORK_BLOCK && + buf->type != BUF_LOCAL_BLOCK && buf->type != BUF_DEMUX_BLOCK) return buf; diff --git a/xine_input_vdr.h b/xine_input_vdr.h index 1039ca8c..2d0cedf9 100644 --- a/xine_input_vdr.h +++ b/xine_input_vdr.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_input_vdr.h,v 1.10 2009-02-25 14:34:24 phintuka Exp $ + * $Id: xine_input_vdr.h,v 1.11 2010-02-14 12:53:06 phintuka Exp $ * */ @@ -26,7 +26,7 @@ struct frontend_s; typedef struct vdr_input_plugin_funcs_s { /* VDR --> input plugin (only local mode) */ - int (*push_input_write) (struct vdr_input_plugin_if_s *, const char *, int); + int (*push_input_write) (struct vdr_input_plugin_if_s *, int, uint64_t, const char *, int); int (*push_input_control)(struct vdr_input_plugin_if_s *, const char *); int (*push_input_osd) (struct vdr_input_plugin_if_s *, struct osd_command_s *); |