After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697239 - [mpegtsmux] Let prog-map define the program number
[mpegtsmux] Let prog-map define the program number
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other Linux
: Normal enhancement
: 1.1.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 690934
Blocks:
 
 
Reported: 2013-04-04 07:52 UTC by Jesper Larsen
Modified: 2013-08-21 11:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to let prog-map set program number (3.71 KB, patch)
2013-04-04 07:53 UTC, Jesper Larsen
needs-work Details | Review
[PATCH v2] mpegtsmux: Set the program number from prog-map (3.33 KB, patch)
2013-08-21 10:58 UTC, Jesper Larsen
committed Details | Review

Description Jesper Larsen 2013-04-04 07:52:46 UTC
In the current implementation, the prog-map property of mpegtsmux is used to group PID's together. There is no way to actually set the program number used in the TS stream.

With the attached patch, the muxer will use the values set in the prog-map as the actual program number. This will enable you to make a TS stream with i.e. 2 programs with program number 10 and 20. If a prog-map is not set, or the value is set to 0, the muxer behaves as before, assigning programs in an incremental order.

With the patches discussed in https://bugzilla.gnome.org/show_bug.cgi?id=690934 that fixes the program property of tsdemux, this will give you more control of the programs in the TS stream.
Comment 1 Jesper Larsen 2013-04-04 07:53:54 UTC
Created attachment 240573 [details] [review]
Patch to let prog-map set program number
Comment 2 Jesper Larsen 2013-06-10 07:29:33 UTC
Any comments on the proposed patch? It still applies on master.
Comment 3 Edward Hervey 2013-08-21 09:09:23 UTC
Review of attachment 240573 [details] [review]:

apart from the comments, looks good to me.

::: gst/mpegtsmux/tsmux/tsmux.c
@@ +469,3 @@
 
+static gint
+tsmux_program_compare (gconstpointer * a, gconstpointer * b)

You could just move this before where it's being used and avoid the forward declaration.

@@ +474,3 @@
+  gint *needle = (gint *) b;
+
+  return (program->pgm_number - *needle);

Just make the arguments of this compare function be (TsMuxProgram *program, gint *needle) and remove the temporary variables.

You'll then need to cast this function to (GCompareFunc) when you provide it to g_list_find_custom.
Comment 4 Jesper Larsen 2013-08-21 10:58:53 UTC
Created attachment 252520 [details] [review]
[PATCH v2] mpegtsmux: Set the program number from prog-map

Updated patch according to the comments by Edward Hervey
Comment 5 Edward Hervey 2013-08-21 11:05:15 UTC
commit e4a0c4d5092639e01fa8c9db4f8225b27c1d5c2e
Author: Jesper Larsen <jesper.larsen@ixonos.com>
Date:   Sun Mar 10 17:02:18 2013 +0100

    mpegtsmux: Set the program number from prog-map
    
    The prog-map property of mpegtsmux only allows you to group pids together in a program.
    The program number set in the PAT/PMT tables cannot be set explicitly.
    
    This patch will set the program number according to the prog-map.
    If a program id of 0 is given, the first vacant program number starting from 1 will be used.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697239