Class ConfigurationParser
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
Bitrate
Gets the bitrate in bits per second parsed from the sequence header and extension.
public int Bitrate { get; }
Property Value
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
HaveBFrames
Gets a value indicating whether the video stream contains B-frames (bidirectional predicted frames).
public bool HaveBFrames { get; }
Property Value
Height
Gets the video height in pixels parsed from the sequence header.
public int Height { get; }
Property Value
IsInterlaced
Gets a value indicating whether the video is interlaced.
public bool IsInterlaced { get; }
Property Value
IsMpeg2
Gets a value indicating whether the stream is MPEG-2 (has sequence extension) rather than MPEG-1.
public bool IsMpeg2 { get; }
Property Value
IsTopFieldFirst
Gets a value indicating whether the top field is displayed first in interlaced video.
public bool IsTopFieldFirst { get; }
Property Value
ProfileLevel
Gets the profile and level indicator parsed from the sequence extension (MPEG-2 only).
public int ProfileLevel { get; }
Property Value
Width
Gets the video width in pixels parsed from the sequence header.
public int Width { get; }
Property Value
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
bufferVersatileBufferThe buffer to search.
offsetintThe offset within the buffer to start searching.
startCodeStartCodesWhen 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
bufferVersatileBufferThe 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
bufferVersatileBufferThe 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
bufferVersatileBufferThe 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
bufferVersatileBufferThe 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
bufferbyte[]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
packetVersatileBufferThe buffer containing the MPEG video data with sequence header.
Returns
- bool
True if parsing succeeded; otherwise, false.