Table of Contents

Class ConfigurationParser

Namespace
VAST.Codecs.Mpeg2
Assembly
VAST.Common.dll

Provides parsing functionality for MPEG-1 and MPEG-2 video sequence headers and extensions.

public class ConfigurationParser
Inheritance
ConfigurationParser
Inherited Members

Constructors

ConfigurationParser()

Initializes a new instance of the ConfigurationParser class.

public ConfigurationParser()

Properties

AspectRatio

Gets the pixel aspect ratio calculated from the display aspect ratio and display size.

public Rational AspectRatio { get; }

Property Value

Rational

Bitrate

Gets the bitrate in bits per second parsed from the sequence header and extension.

public int Bitrate { get; }

Property Value

int

CodecPrivateData

Gets the codec private data containing the sequence header and extensions.

public byte[] CodecPrivateData { get; }

Property Value

byte[]

FrameRate

Gets the frame rate as a rational number parsed from the sequence header.

public Rational FrameRate { get; }

Property Value

Rational

HaveBFrames

Gets a value indicating whether the video stream contains B-frames (bidirectional predicted frames).

public bool HaveBFrames { get; }

Property Value

bool

Height

Gets the video height in pixels parsed from the sequence header.

public int Height { get; }

Property Value

int

IsInterlaced

Gets a value indicating whether the video is interlaced.

public bool IsInterlaced { get; }

Property Value

bool

IsMpeg2

Gets a value indicating whether the stream is MPEG-2 (has sequence extension) rather than MPEG-1.

public bool IsMpeg2 { get; }

Property Value

bool

IsTopFieldFirst

Gets a value indicating whether the top field is displayed first in interlaced video.

public bool IsTopFieldFirst { get; }

Property Value

bool

ProfileLevel

Gets the profile and level indicator parsed from the sequence extension (MPEG-2 only).

public int ProfileLevel { get; }

Property Value

int

Width

Gets the video width in pixels parsed from the sequence header.

public int Width { get; }

Property Value

int

Methods

FindAnyStartCode(VersatileBuffer, int, ref StartCodes)

Finds the position of any MPEG start code in the buffer starting from the specified offset.

public static int FindAnyStartCode(VersatileBuffer buffer, int offset, ref StartCodes startCode)

Parameters

buffer VersatileBuffer

The buffer to search.

offset int

The offset within the buffer to start searching.

startCode StartCodes

When this method returns, contains the type of start code found.

Returns

int

The position of the start code, or -1 if not found.

FindPictureHeader(VersatileBuffer)

Finds the position of the picture header start code in the buffer.

public static int FindPictureHeader(VersatileBuffer buffer)

Parameters

buffer VersatileBuffer

The buffer to search.

Returns

int

The position of the picture header start code, or -1 if not found.

FindSequenceHeader(VersatileBuffer)

Finds the position of the sequence header start code in the buffer.

public static int FindSequenceHeader(VersatileBuffer buffer)

Parameters

buffer VersatileBuffer

The buffer to search.

Returns

int

The position of the sequence header start code, or -1 if not found.

FindSliceHeader(VersatileBuffer)

Finds the position of a slice header start code in the buffer.

public static int FindSliceHeader(VersatileBuffer buffer)

Parameters

buffer VersatileBuffer

The buffer to search.

Returns

int

The position of a slice header start code, or -1 if not found.

FindUserData(VersatileBuffer)

Finds the position of the user data start code in the buffer.

public static int FindUserData(VersatileBuffer buffer)

Parameters

buffer VersatileBuffer

The buffer to search.

Returns

int

The position of the user data start code, or -1 if not found.

Parse(byte[])

Parses MPEG-1/2 video configuration from a byte array containing the sequence header.

public bool Parse(byte[] buffer)

Parameters

buffer byte[]

The buffer containing the MPEG video data with sequence header.

Returns

bool

True if parsing succeeded; otherwise, false.

Parse(VersatileBuffer)

Parses MPEG-1/2 video configuration from a VersatileBuffer containing the sequence header.

public bool Parse(VersatileBuffer packet)

Parameters

packet VersatileBuffer

The buffer containing the MPEG video data with sequence header.

Returns

bool

True if parsing succeeded; otherwise, false.