public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Hartley <pdh@utter.chaos.org.uk>
To: linux-dvb@linuxtv.org
Cc: v4l-dvb-maintainer@linuxtv.org
Subject: [linux-dvb] [PATCH] DMX_OUT_TSDEMUX_TAP: record two streams from same mux, resend
Date: Thu, 28 Feb 2008 11:52:26 +0000	[thread overview]
Message-ID: <1204199546.1002.12.camel@amd64.pyotr.org> (raw)

[-- 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

             reply	other threads:[~2008-02-28 11:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-28 11:52 Peter Hartley [this message]
     [not found] ` <47C91316.6020805@linuxtv.org>
2008-03-04 13:21   ` [linux-dvb] [v4l-dvb-maintainer] [PATCH] DMX_OUT_TSDEMUX_TAP: record two streams from same mux, resend Mauro Carvalho Chehab
  -- strict thread matches above, loose matches on Subject: below --
2008-03-09 21:13 [linux-dvb] " Andrea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1204199546.1002.12.camel@amd64.pyotr.org \
    --to=pdh@utter.chaos.org.uk \
    --cc=linux-dvb@linuxtv.org \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox