C# Класс HCS_Encoder.Outputs.SmoothStream.Multiplexing.MpegTS_Demux

Class to handle the input of MPEG Transport files. Keeps a buffer of the Video and Audio streams. Output frames are suitable for remuxing into MP4 files.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
Packets Queue>.Dictionary
Payloads MemoryStream>.Dictionary
Timestamps long>.Dictionary
VideoPID int
WaitingFrames Queue>.Dictionary

Открытые методы

Метод Описание
FeedTransportStream ( Stream TransportStream, double MinimumTime ) : void

Feed a data stream into the demuxer. Stream MUST be aligned to packets. This method is NOT THREAD SAFE -- lock Demux before calling. Feed must come from one logical transport stream only (to decode another stream, start another demux object).

GetAvailableAudio ( ) : List

Return all completed video frames (removes them from completion queue)

GetAvailableVideo ( ) : List

Return all completed video frames (removes them from completion queue)

MpegTS_Demux ( ) : System

Create a new demuxer, prepared for stream feeding. Timestamps will be converted from MPEG timing (90kHz) to .Net timing (10MHz). The demuxer should be kept and fed data when available. Creating a new demuxer for each data fragment will cause information loss.

Приватные методы

Метод Описание
AgregatePayload ( int PES_PID, Queue Pkts, double MinimumTime ) : void

Concatenate packet payloads, splitting at start-of-payload points. Passes these to DecodeFrame()

DecodeFrame ( int PES_PID, MemoryStream StreamData, double MinimumTime ) : void

Called by 'AgregatePayload()' as soon as a frame has been completed. Adds a GenericMediaFrame to the WaitingFrames queue if possible.

DecodePAT ( ) : int

Scan for the first non-empty PAT, and use it to read the PID for the PMT table.

GetCompletedFrames ( int PID ) : List

Return complete frames for the given PID, clearing the queue.

MapVideoAudioPIDs ( ) : void

Read PAT table, find PMT table, and read that to get the *FIRST* video & audio PIDs. Will not change the PIDs after they've first been mapped (to prevent accidental switching).

MpegToNetTime ( long timestamp ) : long

Convert from MPEG 90kHz clock to .Net 10MHz clock.

Описание методов

FeedTransportStream() публичный Метод

Feed a data stream into the demuxer. Stream MUST be aligned to packets. This method is NOT THREAD SAFE -- lock Demux before calling. Feed must come from one logical transport stream only (to decode another stream, start another demux object).
public FeedTransportStream ( Stream TransportStream, double MinimumTime ) : void
TransportStream Stream Source data stream. Must be readable, does not need to be seekable.
MinimumTime double
Результат void

GetAvailableAudio() публичный Метод

Return all completed video frames (removes them from completion queue)
public GetAvailableAudio ( ) : List
Результат List

GetAvailableVideo() публичный Метод

Return all completed video frames (removes them from completion queue)
public GetAvailableVideo ( ) : List
Результат List

MpegTS_Demux() публичный Метод

Create a new demuxer, prepared for stream feeding. Timestamps will be converted from MPEG timing (90kHz) to .Net timing (10MHz). The demuxer should be kept and fed data when available. Creating a new demuxer for each data fragment will cause information loss.
public MpegTS_Demux ( ) : System
Результат System

Описание свойств

Packets защищенное свойство

protected Dictionary> Packets
Результат Queue>.Dictionary

Payloads защищенное свойство

protected Dictionary Payloads
Результат MemoryStream>.Dictionary

Timestamps защищенное свойство

protected Dictionary Timestamps
Результат long>.Dictionary

VideoPID защищенное свойство

protected int VideoPID
Результат int

WaitingFrames защищенное свойство

protected Dictionary> WaitingFrames
Результат Queue>.Dictionary