diff options
author | Peter Hartley <pdh@utter.chaos.org.uk> | 2008-04-22 13:45:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:46 -0400 |
commit | b01cd937895ad4114a07114cfb6b8b5d2be52241 (patch) | |
tree | cf0046fa0228b07a214e2e601f9a4d1f61e7cc63 | |
parent | 3c66e4e18b250f4524f24fd5b4ccdcd12bef9cc2 (diff) |
V4L/DVB (7293): DMX_OUT_TSDEMUX_TAP: record two streams from same mux, resend
Currently (in linux-2.6.24, but linux-dvb hg looks similar), the
dmx_output_t in the dmx_pes_filter_params decides two things: whether
output is sent to demux0 or dvr0 (in dmxdev.c:dvb_dmxdev_ts_callback),
*and* whether to depacketise TS (in dmxdev.c:dvb_dmxdev_filter_start).
As it stands, those two things can't be set independently: output
destined for demux0 is depacketised, output for dvr0 isn't.
This is what you want for capturing multiple audio streams from the same
multiplex simultaneously: open demux0 several times and send
depacketised output there. And capturing a single video stream is fine
not what you want: you want multi-open (so demux0, not dvr0), but you
want the TS nature preserved (because that's what you want on output, as
you're going to re-multiplex it with the audio).
At least one existing solution -- GStreamer -- sends all its streams
simultaneously via dvr0 and demuxes again in userland, but it seems a
bit of a shame to pick out all the PIDs in kernel, stick them back
together in kernel, and send them to userland only to get unpicked
again, when the alternative is such a small API addition.
The attached patch adds a new value for dmx_output_t:
DMX_OUT_TSDEMUX_TAP, which sends TS to the demux0 device. With this
patch and a dvb-usb-dib0700 (and UK Freeview from Sandy Heath), I can
successfully capture an audio/video PID pair into a TS file that mplayer
can play back.
Signed-off-by: Peter Hartley <pdh@utter.chaos.org.uk>
Acked-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/dvb/dvb-core/dmxdev.c | 5 | ||||
-rw-r--r-- | include/linux/dvb/dmx.h | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c index f94bc31e3b33..e7f7aef862a8 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.c +++ b/drivers/media/dvb/dvb-core/dmxdev.c | |||
@@ -374,7 +374,8 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len, | |||
374 | return 0; | 374 | return 0; |
375 | } | 375 | } |
376 | 376 | ||
377 | if (dmxdevfilter->params.pes.output == DMX_OUT_TAP) | 377 | if (dmxdevfilter->params.pes.output == DMX_OUT_TAP |
378 | || dmxdevfilter->params.pes.output == DMX_OUT_TSDEMUX_TAP) | ||
378 | buffer = &dmxdevfilter->buffer; | 379 | buffer = &dmxdevfilter->buffer; |
379 | else | 380 | else |
380 | buffer = &dmxdevfilter->dev->dvr_buffer; | 381 | buffer = &dmxdevfilter->dev->dvr_buffer; |
@@ -618,7 +619,7 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) | |||
618 | else | 619 | else |
619 | ts_type = 0; | 620 | ts_type = 0; |
620 | 621 | ||
621 | if (otype == DMX_OUT_TS_TAP) | 622 | if (otype == DMX_OUT_TS_TAP || otype == DMX_OUT_TSDEMUX_TAP) |
622 | ts_type |= TS_PACKET; | 623 | ts_type |= TS_PACKET; |
623 | 624 | ||
624 | if (otype == DMX_OUT_TAP) | 625 | if (otype == DMX_OUT_TAP) |
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h index c6a2353c4e68..402fb7a8d922 100644 --- a/include/linux/dvb/dmx.h +++ b/include/linux/dvb/dmx.h | |||
@@ -39,9 +39,10 @@ typedef enum | |||
39 | DMX_OUT_DECODER, /* Streaming directly to decoder. */ | 39 | DMX_OUT_DECODER, /* Streaming directly to decoder. */ |
40 | DMX_OUT_TAP, /* Output going to a memory buffer */ | 40 | DMX_OUT_TAP, /* Output going to a memory buffer */ |
41 | /* (to be retrieved via the read command).*/ | 41 | /* (to be retrieved via the read command).*/ |
42 | DMX_OUT_TS_TAP /* Output multiplexed into a new TS */ | 42 | DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */ |
43 | /* (to be retrieved by reading from the */ | 43 | /* (to be retrieved by reading from the */ |
44 | /* logical DVR device). */ | 44 | /* logical DVR device). */ |
45 | DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */ | ||
45 | } dmx_output_t; | 46 | } dmx_output_t; |
46 | 47 | ||
47 | 48 | ||