* [linux-dvb] [PATCH] DMX_OUT_TSDEMUX_TAP: record two streams from same mux, resend
@ 2008-02-28 11:52 Peter Hartley
0 siblings, 0 replies; 2+ messages in thread
From: Peter Hartley @ 2008-02-28 11:52 UTC (permalink / raw)
To: linux-dvb; +Cc: v4l-dvb-maintainer
[-- Attachment #1: Type: text/plain, Size: 1702 bytes --]
[Resending patch with proper signed-off-by and updated description, but
otherwise unchanged]
Hi there,
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
too: open dvr0. But for capturing multiple video streams, it's surely
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.
Peter
Signed-off-by: Peter Hartley <pdh@utter.chaos.org.uk>
Acked-by: Andreas Oberritter <obi@linuxtv.org>
[-- Attachment #2: tsdemux.diff --]
[-- Type: text/x-patch, Size: 1365 bytes --]
--- include/linux/dvb/dmx.h~ 2008-01-24 22:58:37.000000000 +0000
+++ include/linux/dvb/dmx.h 2008-02-25 23:01:45.000000000 +0000
@@ -39,9 +39,10 @@ typedef enum
DMX_OUT_DECODER, /* Streaming directly to decoder. */
DMX_OUT_TAP, /* Output going to a memory buffer */
/* (to be retrieved via the read command).*/
- DMX_OUT_TS_TAP /* Output multiplexed into a new TS */
+ DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */
/* (to be retrieved by reading from the */
/* logical DVR device). */
+ DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
} dmx_output_t;
--- drivers/media/dvb/dvb-core/dmxdev.c~ 2008-01-24 22:58:37.000000000 +0000
+++ drivers/media/dvb/dvb-core/dmxdev.c 2008-02-25 23:02:29.000000000 +0000
@@ -374,7 +374,8 @@ static int dvb_dmxdev_ts_callback(const
return 0;
}
- if (dmxdevfilter->params.pes.output == DMX_OUT_TAP)
+ if (dmxdevfilter->params.pes.output == DMX_OUT_TAP
+ || dmxdevfilter->params.pes.output == DMX_OUT_TSDEMUX_TAP)
buffer = &dmxdevfilter->buffer;
else
buffer = &dmxdevfilter->dev->dvr_buffer;
@@ -618,7 +619,7 @@ static int dvb_dmxdev_filter_start(struc
else
ts_type = 0;
- if (otype == DMX_OUT_TS_TAP)
+ if (otype == DMX_OUT_TS_TAP || otype == DMX_OUT_TSDEMUX_TAP)
ts_type |= TS_PACKET;
if (otype == DMX_OUT_TAP)
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 2+ messages in thread
* [linux-dvb] [PATCH] DMX_OUT_TSDEMUX_TAP: record two streams from same mux, resend
@ 2008-03-09 21:13 Andrea
0 siblings, 0 replies; 2+ messages in thread
From: Andrea @ 2008-03-09 21:13 UTC (permalink / raw)
To: linux-dvb
> Hi there,
> 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
> too: open dvr0. But for capturing multiple video streams, it's surely
> 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).
Can I ask your opinion on the best solution for:
I would like to have 2 separate TS (audio + video + subtitles...) for 2 channels (same frequency).
Is it possible to set a DMX_SET_PES_FILTER with many pids?
Ideally I would like to multi-open the demux, set a PES filter for a few pids (currently I can do
only for 1), read from demux and save the TS.
So that I can have more the one applications running.
What I can do now is: multi-open the demux, set filter -1 (i.e. get everything), read, and only save
the pids I want.
I was just wondering what is the best solution.
I don't like to get many times the whole TS. It's a bit of a waste.
> 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.
Andrea
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-09 21:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-09 21:13 [linux-dvb] [PATCH] DMX_OUT_TSDEMUX_TAP: record two streams from same mux, resend Andrea
-- strict thread matches above, loose matches on Subject: below --
2008-02-28 11:52 Peter Hartley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox