[Live-devel] Separating Transport Stream IDs from PES IDs

Piers Hawksley piers.hawksley at panogenics.com
Fri Jun 27 04:25:07 PDT 2014


Hi Ross,

Thanks for you suggestions on the patch I sent in. I have removed the 
rogue member variable I proposed and made fCurrentPID protected and 
ensured the MPEG2TransportStreamMultiplexor constructor initialises it.

fCurrentPID is now set in 
MPEG2TransportStreamFromESSource::addNewInputSource to:
(by default) the stream ID provided (e.g. the current behaviour, where 
stream ID may be set in addNewVideoSource or addNewAudioSource); or,
the value provided (limited to 0x00 to 0xff).

I've used PID as the new variable name (it sets the PCR PID and 
Elementary ID in the Program Map Table and the Packet ID of the rest of 
the stream) and kept stream_id as the video / audio stream ID.

Please consider this revised patch for inclusion in your next release. 
It extends the current code to allow the Transport Stream Packet ID to 
be set explicitly. It is limited to 8 bit values not the 13 bits 
available due to the value of PID_TABLE_SIZE in 
MPEG2TransportStreamMultiplexor.hh.

Many Thanks,

Piers

-------------- next part --------------
34a35
>     fCurrentPID(0),
37c38
<     fPCR_PID(0), fCurrentPID(0),
---
>     fPCR_PID(0),
109c110
<     fCurrentPID = stream_id;
---
>     // fCurrentPID now set in MPEG2TransportStreamFromESSource::addNewInputSource
-------------- next part --------------
61a62,64
>       // Note: We used to map 8-bit stream_ids directly to PIDs, now we set it
>       //  in MPEG2TransportStreamFromESSource::addNewInputSource
>   u_int8_t fCurrentPID;
72,73c75
<   u_int8_t fPCR_PID, fCurrentPID;
<       // Note: We map 8-bit stream_ids directly to PIDs
---
>   u_int8_t fPCR_PID;
-------------- next part --------------
82c82
< ::addNewVideoSource(FramedSource* inputSource, int mpegVersion) {
---
> ::addNewVideoSource(FramedSource* inputSource, int mpegVersion, int16_t PID) {
84c84
<   addNewInputSource(inputSource, streamId, mpegVersion);
---
>   addNewInputSource(inputSource, streamId, mpegVersion, PID);
89c89
< ::addNewAudioSource(FramedSource* inputSource, int mpegVersion) {
---
> ::addNewAudioSource(FramedSource* inputSource, int mpegVersion, int16_t PID) {
91c91
<   addNewInputSource(inputSource, streamId, mpegVersion);
---
>   addNewInputSource(inputSource, streamId, mpegVersion, PID);
146c146
< 		    u_int8_t streamId, int mpegVersion) {
---
> 		    u_int8_t streamId, int mpegVersion, int16_t PID) {
147a148,153
>   // Note that fCurrentPID is 8 bits not 13 bits as it is limited by
>   //  PID_TABLE_SIZE in MPEG2TransportStreamMultiplexor.hh
>   if (PID == -1)
>     fCurrentPID = streamId;
>   else
>     fCurrentPID = u_int8_t(PID);
-------------- next part --------------
33c33
<   void addNewVideoSource(FramedSource* inputSource, int mpegVersion);
---
>   void addNewVideoSource(FramedSource* inputSource, int mpegVersion, int16_t PID = -1);
35c35
<   void addNewAudioSource(FramedSource* inputSource, int mpegVersion);
---
>   void addNewAudioSource(FramedSource* inputSource, int mpegVersion, int16_t PID = -1);
43c43
< 			 u_int8_t streamId, int mpegVersion);
---
> 			 u_int8_t streamId, int mpegVersion, int16_t PID = -1);


More information about the live-devel mailing list