RDK Documentation (Open Sourced RDK Components)
TSProcessor Class Reference

MPEG TS Processor. Supports software Demuxer/ PTS re-stamping for trickmode. More...

#include <tsprocessor.h>

Inheritance diagram for TSProcessor:
Inheritance graph
Collaboration diagram for TSProcessor:
Collaboration graph

Data Structures

struct  _H264PPS
 Holds PPS parameters. More...
 
struct  _H264SPS
 Holds SPS parameters. More...
 

Public Member Functions

 TSProcessor (AampLogManager *logObj, class PrivateInstanceAAMP *aamp, StreamOperation streamOperation, int track=0, TSProcessor *peerTSProcessor=NULL, TSProcessor *auxTSProcessor=NULL)
 TSProcessor Constructor.
 
 TSProcessor (const TSProcessor &)=delete
 Copy constructor disabled. More...
 
TSProcessoroperator= (const TSProcessor &)=delete
 assignment operator disabled More...
 
 ~TSProcessor ()
 TSProcessor Destructor.
 
bool sendSegment (char *segment, size_t &size, double position, double duration, bool discontinuous, bool &ptsError)
 Does configured operation on the segment and injects data to sink Process and send media fragment. More...
 
void setRate (double rate, PlayMode mode)
 Set the playback rate. More...
 
void setThrottleEnable (bool enable)
 Enable/ disable throttle. More...
 
void setFrameRateForTM (int frameRate)
 Set frame rate for trick mode. More...
 
void abort ()
 Abort current operations and return all blocking calls immediately.
 
void reset ()
 Reset TS processor state.
 
void flush ()
 Flush all buffered data to sink. More...
 
void ChangeMuxedAudioTrack (unsigned char index)
 
int SelectAudioIndexToPlay ()
 
bool FilterAudioCodecBasedOnConfig (StreamOutputFormat audioFormat)
 Function to filter the audio codec based on the configuration. More...
 
void GetLanguageCode (std::string &lang)
 Function to get the language code. More...
 
void SetAudioGroupId (std::string &id)
 Function to set the group-ID. More...
 
void setApplyOffsetFlag (bool enable)
 Function to set a flag to identify both the av tracks are in TS format or not. More...
 
- Public Member Functions inherited from MediaProcessor
 MediaProcessor ()
 MediaProcessor constructor.
 
virtual ~MediaProcessor ()
 MediaProcessor destructor.
 
 MediaProcessor (const MediaProcessor &)=delete
 
MediaProcessoroperator= (const MediaProcessor &)=delete
 

Protected Member Functions

void getAudioComponents (const RecordingComponent **audioComponentsPtr, int &count)
 Get audio components. More...
 
void sendQueuedSegment (long long basepts=0, double updatedStartPositon=-1)
 Send queued segment. More...
 
void setBasePTS (double position, long long pts)
 set base PTS for demux operations More...
 

Private Types

typedef struct TSProcessor::_H264SPS H264SPS
 
typedef struct TSProcessor::_H264PPS H264PPS
 

Private Member Functions

void setPlayMode (PlayMode mode)
 Set to the playback mode. More...
 
void processPMTSection (unsigned char *section, int sectionLength)
 process PMT section and update media components. More...
 
void reTimestamp (unsigned char *&packet, int length)
 Does PTS re-stamping. More...
 
int insertPatPmt (unsigned char *buffer, bool trick, int bufferSize)
 Insert PAT and PMT sections. More...
 
void insertPCR (unsigned char *packet, int pid)
 insert PCR to the packet in case of PTS restamping More...
 
bool generatePATandPMT (bool trick, unsigned char **buff, int *bufflen, bool bHandleMCTrick=false)
 generate PAT and PMT based on media components More...
 
void putPmtByte (unsigned char *&pmt, int &index, unsigned char byte, int pmtPid)
 Appends a byte to PMT buffer. More...
 
bool processStartCode (unsigned char *buffer, bool &keepScanning, int length, int base)
 Process ES start code. More...
 
void checkIfInterlaced (unsigned char *packet, int length)
 Updates state variables depending on interlaced. More...
 
bool readTimeStamp (unsigned char *p, long long &value)
 Read time-stamp at the point. More...
 
void writeTimeStamp (unsigned char *p, int prefix, long long TS)
 Write time-stamp to buffer. More...
 
long long readPCR (unsigned char *p)
 Read PCR from a buffer. More...
 
void writePCR (unsigned char *p, long long PCR, bool clearExtension)
 Write PCR to a buffer. More...
 
unsigned char * createNullPFrame (int width, int height, int *nullPFrameLen)
 Create a Null P frame. More...
 
bool processSeqParameterSet (unsigned char *p, int length)
 process sequence parameter set and update state variables More...
 
void processPictureParameterSet (unsigned char *p, int length)
 Parse through the picture parameter set to get required items. More...
 
void processScalingList (unsigned char *&p, int &mask, int size)
 Consume all bits used by the scaling list. More...
 
unsigned int getBits (unsigned char *&p, int &mask, int bitCount)
 get bits based on mask and count More...
 
void putBits (unsigned char *&p, int &mask, int bitCount, unsigned int value)
 Put bits based on mask and count. More...
 
unsigned int getUExpGolomb (unsigned char *&p, int &mask)
 Gets unsigned EXP Golomb. More...
 
int getSExpGolomb (unsigned char *&p, int &mask)
 Getss signed EXP Golomb. More...
 
void updatePATPMT ()
 Generate and update PAT and PMT sections.
 
void abortUnlocked ()
 Abort TSProcessor operations and return blocking calls immediately. More...
 
bool processBuffer (unsigned char *buffer, int size, bool &insPatPmt)
 Process buffers and update internal states related to media components. More...
 
long long getCurrentTime ()
 Get current time stamp in milliseconds. More...
 
bool throttle ()
 Blocks based on PTS. Can be used for pacing injection. More...
 
void sendDiscontinuity (double position)
 Send discontinuity packet. Not relevant for demux operations. More...
 
void setupThrottle (int segmentDurationMs)
 Update internal state variables to set up throttle. More...
 
bool demuxAndSend (const void *ptr, size_t len, double fTimestamp, double fDuration, bool discontinuous, TrackToDemux trackToDemux=ePC_Track_Both)
 Demux TS and send elementary streams. More...
 
bool msleep (long long throttleDiff)
 sleep used internal by throttle logic More...
 

Private Attributes

class PrivateInstanceAAMPaamp
 
bool m_needDiscontinuity
 
long long m_currStreamOffset
 
long long m_currPTS
 
long long m_currTimeStamp
 
int m_currFrameNumber
 
int m_currFrameLength
 
long long m_currFrameOffset
 
bool m_trickExcludeAudio
 
int m_PatPmtLen
 
unsigned char * m_PatPmt
 
int m_PatPmtTrickLen
 
unsigned char * m_PatPmtTrick
 
int m_PatPmtPcrLen
 
unsigned char * m_PatPmtPcr
 
int m_patCounter
 
int m_pmtCounter
 
PlayMode m_playMode
 
PlayMode m_playModeNext
 
double m_playRate
 
double m_absPlayRate
 
double m_playRateNext
 
double m_apparentFrameRate
 
int m_packetSize
 
int m_ttsSize
 
int m_pcrPid
 
int m_videoPid
 
bool m_haveBaseTime
 
bool m_haveEmittedIFrame
 
bool m_haveUpdatedFirstPTS
 
int m_pcrPerPTSCount
 
long long m_baseTime
 
long long m_segmentBaseTime
 
long long m_basePCR
 
long long m_prevRateAdjustedPCR
 
long long m_currRateAdjustedPCR
 
long long m_currRateAdjustedPTS
 
unsigned char m_continuityCounters [8192]
 
unsigned char m_pidFilter [8192]
 
unsigned char m_pidFilterTrick [8192]
 
unsigned char * m_nullPFrame
 
int m_nullPFrameLength
 
int m_nullPFrameNextCount
 
int m_nullPFrameOffset
 
int m_nullPFrameWidth
 
int m_nullPFrameHeight
 
int m_frameWidth
 
int m_frameHeight
 
bool m_scanForFrameSize
 
int m_scanRemainderSize
 
int m_scanRemainderLimit
 
unsigned char m_scanRemainder [(29) *3]
 
bool m_isH264
 
bool m_isMCChannel
 
bool m_isInterlaced
 
bool m_isInterlacedKnown
 
bool m_throttle
 
bool m_haveThrottleBase
 
long long m_lastThrottleContentTime
 
long long m_lastThrottleRealTime
 
long long m_baseThrottleContentTime
 
long long m_baseThrottleRealTime
 
uint33_t m_throttlePTS
 
bool m_insertPCR
 
int m_emulationPreventionCapacity
 
int m_emulationPreventionOffset
 
unsigned char * m_emulationPrevention
 
bool m_scanSkipPacketsEnabled
 
bool m_applyOffset
 
H264SPS m_SPS [32]
 
H264PPS m_PPS [256]
 
int m_currSPSId
 
int m_picOrderCount
 
bool m_updatePicOrderCount
 
bool m_havePAT
 Set to 1 when PAT buffer examined and loaded all program specific information.
 
int m_versionPAT
 Pat Version number.
 
int m_program
 Program number in the corresponding program map table.
 
int m_pmtPid
 For which PID the program information is available such as, audio pid, video pid, stream types, etc.
 
bool m_havePMT
 When PMT buffer examined the value is set to 1.
 
int m_versionPMT
 Version number for PMT which is being examined.
 
bool m_indexAudio
 If PCR Pid matches with any Audio PIDs associated for a recording, the value will be set to 1.
 
bool m_haveAspect
 Set to 1 when it found aspect ratio of current video.
 
bool m_haveFirstPTS
 The value is set to 1 if first PTS found from a recording after examining few KB of initial data.
 
uint33_t m_currentPTS
 Store the current PTS value of a recording.
 
int m_pmtCollectorNextContinuity
 Keeps next continuity counter for PMT packet at the time of examine the TS Buffer.
 
int m_pmtCollectorSectionLength
 Update section length while examining PMT table.
 
int m_pmtCollectorOffset
 If it is set, process subsequent parts of multi-packet PMT.
 
unsigned char * m_pmtCollector
 A buffer pointer to hold PMT data at the time of examining TS buffer.
 
bool m_scrambledWarningIssued
 
bool m_checkContinuity
 
int videoComponentCount
 
int audioComponentCount
 
RecordingComponent videoComponents [(8)]
 
RecordingComponent audioComponents [(8)]
 
bool m_dsmccComponentFound
 True if DSMCC found.
 
RecordingComponent m_dsmccComponent
 Digital storage media command and control (DSM-CC) Component.
 
uint33_t m_actualStartPTS
 
int m_throttleMaxDelayMs
 
int m_throttleMaxDiffSegments
 
int m_throttleDelayIgnoredMs
 
int m_throttleDelayForDiscontinuityMs
 
pthread_cond_t m_throttleCond
 
pthread_cond_t m_basePTSCond
 
pthread_mutex_t m_mutex
 
bool m_enabled
 
bool m_processing
 
int m_framesProcessedInSegment
 
long long m_lastPTSOfSegment
 
StreamOperation m_streamOperation
 
Demuxerm_vidDemuxer
 
Demuxerm_audDemuxer
 
Demuxerm_dsmccDemuxer
 
bool m_demux
 
TSProcessorm_peerTSProcessor
 
int m_packetStartAfterFirstPTS
 
unsigned char * m_queuedSegment
 
double m_queuedSegmentPos
 
double m_queuedSegmentDuration
 
size_t m_queuedSegmentLen
 
bool m_queuedSegmentDiscontinuous
 
double m_startPosition
 
int m_track
 
long long m_last_frame_time
 
bool m_demuxInitialized
 
long long m_basePTSFromPeer
 
unsigned char m_AudioTrackIndexToPlay
 
TSProcessorm_auxTSProcessor
 
bool m_auxiliaryAudio
 
AampLogManagermLogObj
 
std::string m_audioGroupId
 

yes

MPEG TS Processor. Supports software Demuxer/ PTS re-stamping for trickmode.

Definition at line 95 of file tsprocessor.h.


Data Structure Documentation

◆ TSProcessor::_H264PPS

struct TSProcessor::_H264PPS

Holds PPS parameters.

Definition at line 465 of file tsprocessor.h.

Collaboration diagram for TSProcessor::_H264PPS:
Collaboration graph
Data Fields
int spsId

◆ TSProcessor::_H264SPS

struct TSProcessor::_H264SPS

Holds SPS parameters.

Definition at line 451 of file tsprocessor.h.

Collaboration diagram for TSProcessor::_H264SPS:
Collaboration graph
Data Fields
int picOrderCountType
int maxPicOrderCount
int log2MaxFrameNumMinus4
int log2MaxPicOrderCntLsbMinus4
int separateColorPlaneFlag
int frameMBSOnlyFlag

Constructor & Destructor Documentation

◆ TSProcessor()

TSProcessor::TSProcessor ( const TSProcessor )
delete

Copy constructor disabled.

Member Function Documentation

◆ operator=()

TSProcessor& TSProcessor::operator= ( const TSProcessor )
delete

assignment operator disabled

◆ sendSegment()

TSProcessor::sendSegment ( char *  segment,
size_t &  size,
double  position,
double  duration,
bool  discontinuous,
bool &  ptsError 
)
virtual

Does configured operation on the segment and injects data to sink Process and send media fragment.

Parameters
[in]segmentBuffer containing the data segment
[in]sizeSpecifies size of the segment in bytes.
[in]positionPosition of the segment in seconds
[in]durationDuration of the segment in seconds
[in]discontinuoustrue if fragment is discontinuous
[out]trueon PTS error

Implements MediaProcessor.

Definition at line 2436 of file tsprocessor.cpp.

◆ setRate()

TSProcessor::setRate ( double  rate,
PlayMode  mode 
)
virtual

Set the playback rate.

Note
mode is not relevant for demux operations
Parameters
[in]rateplay rate could be 1.0=Normal Playback, 0.0=Pause, etc
[in]modeplay mode such as PlayMode_normal, PlayMode_retimestamp_Ionly, PlayMode_retimestamp_IPB, PlayMode_retimestamp_IandP or PlayMode_reverse_GOP.

Implements MediaProcessor.

Definition at line 3439 of file tsprocessor.cpp.

◆ setThrottleEnable()

TSProcessor::setThrottleEnable ( bool  enable)
virtual

Enable/ disable throttle.

Parameters
[in]enabletrue to enable throttle, false to disable

Implements MediaProcessor.

Definition at line 3457 of file tsprocessor.cpp.

◆ setFrameRateForTM()

void TSProcessor::setFrameRateForTM ( int  frameRate)
inlinevirtual

Set frame rate for trick mode.

Parameters
[in]frameRaterate per second

Implements MediaProcessor.

Definition at line 148 of file tsprocessor.h.

◆ flush()

TSProcessor::flush ( )

Flush all buffered data to sink.

Note
Relevant only when s/w demux is used

Definition at line 2344 of file tsprocessor.cpp.

◆ FilterAudioCodecBasedOnConfig()

bool TSProcessor::FilterAudioCodecBasedOnConfig ( StreamOutputFormat  audioFormat)

Function to filter the audio codec based on the configuration.

Parameters
[in]audioFormat
[out]boolignoreProfile - true/false

Definition at line 4657 of file tsprocessor.cpp.

◆ GetLanguageCode()

void TSProcessor::GetLanguageCode ( std::string &  lang)

Function to get the language code.

Parameters
[in]string- language

Definition at line 4700 of file tsprocessor.cpp.

◆ SetAudioGroupId()

void TSProcessor::SetAudioGroupId ( std::string &  id)
virtual

Function to set the group-ID.

Parameters
[in]string- id

Reimplemented from MediaProcessor.

Definition at line 4709 of file tsprocessor.cpp.

◆ setApplyOffsetFlag()

void TSProcessor::setApplyOffsetFlag ( bool  enable)
virtual

Function to set a flag to identify both the av tracks are in TS format or not.

Function to set offsetflag. if the value is fasle, no need to apply offset while doing pts restamping.

Parameters
[in]bool- true/false

Reimplemented from MediaProcessor.

Definition at line 3993 of file tsprocessor.cpp.

◆ getAudioComponents()

TSProcessor::getAudioComponents ( const RecordingComponent **  audioComponentsPtr,
int &  count 
)
protected

Get audio components.

Parameters
[out]audioComponentsPtrpointer to audio component array
[out]countNumber of audio components

Definition at line 4578 of file tsprocessor.cpp.

◆ sendQueuedSegment()

TSProcessor::sendQueuedSegment ( long long  basepts = 0,
double  updatedStartPositon = -1 
)
protected

Send queued segment.

Parameters
[in]baseptsnew base pts to be set. Valid only for eStreamOp_DEMUX_AUDIO.
[in]updatedStartPositonNew start position of queued segment.

Definition at line 2371 of file tsprocessor.cpp.

◆ setBasePTS()

TSProcessor::setBasePTS ( double  position,
long long  pts 
)
protected

set base PTS for demux operations

Parameters
[in]positionstart position of fragment
[in]ptsbase pts for demux operations.

Definition at line 2415 of file tsprocessor.cpp.

◆ setPlayMode()

TSProcessor::setPlayMode ( PlayMode  mode)
private

Set to the playback mode.

Note
Not relevant for demux operations
Parameters
[in]modeplay mode such as PlayMode_normal, PlayMode_retimestamp_Ionly, PlayMode_retimestamp_IPB, PlayMode_retimestamp_IandP or PlayMode_reverse_GOP.

Definition at line 3398 of file tsprocessor.cpp.

◆ processPMTSection()

TSProcessor::processPMTSection ( unsigned char *  section,
int  sectionLength 
)
private

process PMT section and update media components.

Note
Call with section pointing to first byte after section_length
Parameters
[in]sectioncharacter buffer containing PMT section
[in]sectionLengthlength of PMT section

Definition at line 1080 of file tsprocessor.cpp.

◆ reTimestamp()

TSProcessor::reTimestamp ( unsigned char *&  packet,
int  length 
)
private

Does PTS re-stamping.

Parameters
[in,out]packetTS data to re-stamp
[in]length[in]TS data size

Definition at line 3037 of file tsprocessor.cpp.

◆ insertPatPmt()

TSProcessor::insertPatPmt ( unsigned char *  buffer,
bool  trick,
int  bufferSize 
)
private

Insert PAT and PMT sections.

Return values
lengthof output buffer
Parameters
[out]bufferPAT and PMT is copied to this buffer
[in]tricktrue on trick mode, false on normal playback
[in]bufferSizesize of buffer

Definition at line 1011 of file tsprocessor.cpp.

◆ insertPCR()

TSProcessor::insertPCR ( unsigned char *  packet,
int  pid 
)
private

insert PCR to the packet in case of PTS restamping

Parameters
[in]packet[in,out]buffer to which PCR to be inserted
[in]pid[in]pcr pid

Definition at line 1047 of file tsprocessor.cpp.

◆ generatePATandPMT()

TSProcessor::generatePATandPMT ( bool  trick,
unsigned char **  buff,
int *  bufflen,
bool  bHandleMCTrick = false 
)
private

generate PAT and PMT based on media components

Parameters
[in]tricktrue on trickmode
[out]buffPAT and PMT copied to this buffer
[out]buflenLength of buff
[in]bHandleMCTricktrue if audio pid is same as PCR pid

Definition at line 3466 of file tsprocessor.cpp.

◆ putPmtByte()

TSProcessor::putPmtByte ( unsigned char *&  pmt,
int &  index,
unsigned char  byte,
int  pmtPid 
)
private

Appends a byte to PMT buffer.

Parameters
[in,out]pmtbuffer in which PMT is being constructed
[in,out]indexcurrent index of PMT construction.
[in]bytebyte to be written at index
[in]pmtPidPID of PMT

Definition at line 3870 of file tsprocessor.cpp.

◆ processStartCode()

TSProcessor::processStartCode ( unsigned char *  buffer,
bool &  keepScanning,
int  length,
int  base 
)
private

Process ES start code.

Parameters
[in]bufferbuffer containing start code
[in]keepScanningtrue to keep on scanning
[in]lengthsize of the buffer
[in]baseNot used

Definition at line 2622 of file tsprocessor.cpp.

◆ checkIfInterlaced()

TSProcessor::checkIfInterlaced ( unsigned char *  packet,
int  length 
)
private

Updates state variables depending on interlaced.

Parameters
[in]packetbuffer containing TS packet
[in]lengthlength of buffer

Definition at line 2893 of file tsprocessor.cpp.

◆ readTimeStamp()

TSProcessor::readTimeStamp ( unsigned char *  p,
long long &  TS 
)
private

Read time-stamp at the point.

Return values
trueif time-stamp is present.
Parameters
[in]pbuffer position containing time-stamp
[out]TStime-stamp

Definition at line 3905 of file tsprocessor.cpp.

◆ writeTimeStamp()

TSProcessor::writeTimeStamp ( unsigned char *  p,
int  prefix,
long long  TS 
)
private

Write time-stamp to buffer.

Parameters
[out]pbuffer to which TS to be written
[in]prefixof time-stamp
[in]TStime-stamp

Definition at line 3948 of file tsprocessor.cpp.

◆ readPCR()

TSProcessor::readPCR ( unsigned char *  p)
private

Read PCR from a buffer.

Parameters
[in]pstart of PCR data

Definition at line 3960 of file tsprocessor.cpp.

◆ writePCR()

TSProcessor::writePCR ( unsigned char *  p,
long long  PCR,
bool  clearExtension 
)
private

Write PCR to a buffer.

Parameters
[out]pbuffer to write PCR
[in]PCRtimestamp to be written
[in]clearExtensionclear PCR extension

Definition at line 3973 of file tsprocessor.cpp.

◆ createNullPFrame()

TSProcessor::createNullPFrame ( int  width,
int  height,
int *  nullPFrameLen 
)
private

Create a Null P frame.

Return values
Buffercontaining P frame
Parameters
[in]widthwidth of P frame to be constructed
[in]heightheight of P frame
[out]nullPFrameLenlength of constructed p frame

Definition at line 4075 of file tsprocessor.cpp.

◆ processSeqParameterSet()

TSProcessor::processSeqParameterSet ( unsigned char *  p,
int  length 
)
private

process sequence parameter set and update state variables

Return values
trueif SPS is processed successfully
Parameters
[in]ppointer containing SPS
[in]lengthsize of SPS

Definition at line 4226 of file tsprocessor.cpp.

◆ processPictureParameterSet()

TSProcessor::processPictureParameterSet ( unsigned char *  p,
int  length 
)
private

Parse through the picture parameter set to get required items.

Parameters
[in]pbuffer containing PPS
[in]lengthsize of PPS

Definition at line 4446 of file tsprocessor.cpp.

◆ processScalingList()

TSProcessor::processScalingList ( unsigned char *&  p,
int &  mask,
int  size 
)
private

Consume all bits used by the scaling list.

Parameters
[in]pbuffer containing scaling list
[in]maskmask
[in]sizelenght of scaling list

Definition at line 4463 of file tsprocessor.cpp.

◆ getBits()

TSProcessor::getBits ( unsigned char *&  p,
int &  mask,
int  bitCount 
)
private

get bits based on mask and count

Return values
valueof bits
Parameters
[in,out]ppointer being processed, updated internally
[in,out]maskmask to be applied
[in]bitCountNumber of bits to be processed.

Definition at line 4482 of file tsprocessor.cpp.

◆ putBits()

TSProcessor::putBits ( unsigned char *&  p,
int &  mask,
int  bitCount,
unsigned int  value 
)
private

Put bits based on mask and count.

Parameters
[in,out]preference of buffer to which bits to be put
[in,out]maskmask to be applied
[in]bitCountcount of bits to be put
[in]valuebits to be put

Definition at line 4506 of file tsprocessor.cpp.

◆ getUExpGolomb()

TSProcessor::getUExpGolomb ( unsigned char *&  p,
int &  mask 
)
private

Gets unsigned EXP Golomb.

Parameters
[in,out]pbuffer
[in,out]maskbitmask
Return values
UnsignedEXP Golomb

Definition at line 4532 of file tsprocessor.cpp.

◆ getSExpGolomb()

TSProcessor::getSExpGolomb ( unsigned char *&  p,
int &  mask 
)
private

Getss signed EXP Golomb.

Parameters
[in,out]pbuffer
[in,out]bitmask
Return values
signedEXP Golomb

Definition at line 4564 of file tsprocessor.cpp.

◆ abortUnlocked()

TSProcessor::abortUnlocked ( )
private

Abort TSProcessor operations and return blocking calls immediately.

Note
Make sure that caller holds m_mutex before invoking this function

Definition at line 3412 of file tsprocessor.cpp.

◆ processBuffer()

TSProcessor::processBuffer ( unsigned char *  buffer,
int  size,
bool &  insPatPmt 
)
private

Process buffers and update internal states related to media components.

Return values
falseif operation is aborted.
Parameters
[in]buffercontains TS data
[in]sizelenght of the buffer
[out]insPatPmtindicates if PAT and PMT needs to inserted

Definition at line 1672 of file tsprocessor.cpp.

◆ getCurrentTime()

TSProcessor::getCurrentTime ( )
private

Get current time stamp in milliseconds.

Return values
timestamp in milliseconds

Definition at line 1500 of file tsprocessor.cpp.

◆ throttle()

TSProcessor::throttle ( )
private

Blocks based on PTS. Can be used for pacing injection.

Return values
trueif aborted

Definition at line 1553 of file tsprocessor.cpp.

◆ sendDiscontinuity()

TSProcessor::sendDiscontinuity ( double  position)
private

Send discontinuity packet. Not relevant for demux operations.

Parameters
[in]positionposition in seconds

Definition at line 1386 of file tsprocessor.cpp.

◆ setupThrottle()

TSProcessor::setupThrottle ( int  segmentDurationMs)
private

Update internal state variables to set up throttle.

Parameters
[in]segmentDurationMsSignedDuration of segment

Definition at line 2107 of file tsprocessor.cpp.

◆ demuxAndSend()

TSProcessor::demuxAndSend ( const void *  ptr,
size_t  len,
double  position,
double  duration,
bool  discontinuous,
TrackToDemux  trackToDemux = ePC_Track_Both 
)
private

Demux TS and send elementary streams.

Return values
trueon success, false on PTS error
Parameters
[in]ptrbuffer containing TS data
[in]lenlenght of buffer
[in]positionposition of segment in seconds
[in]durationduration of segment in seconds
[in]discontinuoustrue if segment is discontinous
[in]trackToDemuxmedia track to do the operation

Definition at line 2121 of file tsprocessor.cpp.

◆ msleep()

TSProcessor::msleep ( long long  throttleDiff)
private

sleep used internal by throttle logic

Parameters
[in]throttleDifftime in milliseconds
Return values
trueon abort

Definition at line 1515 of file tsprocessor.cpp.


The documentation for this class was generated from the following files: