AVBlocks for .NET  3.0
Audio and Video Software Development Kit
MediaSample Class Reference

Represents one or more samples of media data. More...

Inheritance diagram for MediaSample:

Public Member Functions

 MediaSample ()
 Creates and empty sample.
 
virtual object Clone ()
 Creates a deep copy of this object.
 

Static Public Member Functions

static Int32 VideoBufferSizeInBytes (Int32 frameWidth, Int32 frameHeight, ColorFormat colorFormat)
 Calculates the exact number of bytes that are needed for a video frame with the specified properties.
 

Properties

MediaBuffer Buffer [get, set]
 The buffer storage.
 
double EndTime [get, set]
 The time when the media sample should end.
 
MediaSampleFlags Flags [get, set]
 Various properties of the media sample.
 
PictureType PictureType [get, set]
 The picture type (I/P/B/etc.) of a demuxed, decoded or encoded frame.
 
double StartTime [get, set]
 Presentation timestamp.
 
UnmanagedMediaBuffer UnmanagedBuffer [get, set]
 Used to push and pull unmanaged data to/from Transcoder.
 

Detailed Description

Represents one or more samples of media data.

Member Function Documentation

◆ Clone()

virtual object Clone ( )
virtual

Creates a deep copy of this object.


Returns
A new MediaSample object.
Exceptions
System.OutOfMemoryExceptionThe object cannot be cloned because there's not enough memory.

References MediaSample.MediaSample(), MediaBuffer.Clone(), and UnmanagedMediaBuffer.Clone().

◆ VideoBufferSizeInBytes()

static Int32 VideoBufferSizeInBytes ( Int32  frameWidth,
Int32  frameHeight,
ColorFormat  colorFormat 
)
static

Calculates the exact number of bytes that are needed for a video frame with the specified properties.

Parameters
frameWidthFrame width in pixels.
frameHeightFrame height in pixels.
colorFormatThe color format represents how colors are coded in the video frame.
Returns
The number of bytes needed to store a video frame with the specified properties. Zero if it is not possible to calculate the video frame buffer size from the supplied arguments.

Property Documentation

◆ Buffer

MediaBuffer Buffer
getset

The buffer storage.

See also
MediaBuffer

Referenced by MediaInfo.Push(), and Transcoder.Push().

◆ EndTime

double EndTime
getset

The time when the media sample should end.

The EndTime is valid only if it is positive and greater than the StartTime. The default value -1.0

◆ Flags

MediaSampleFlags Flags
getset

Various properties of the media sample.

See also
MediaSampleFlags

◆ PictureType

The picture type (I/P/B/etc.) of a demuxed, decoded or encoded frame.

Currently this is returned only by the MPEG-2 encoder and is ignored by all encoders.

See also
PictureType

◆ StartTime

double StartTime
getset

Presentation timestamp.

The StartTime is valid if it is 0 or greater than 0. The default value -1.0

◆ UnmanagedBuffer

UnmanagedMediaBuffer UnmanagedBuffer
getset

Used to push and pull unmanaged data to/from Transcoder.

See also
Transcoder.PushUnmanaged, Transcoder.PullUnmanaged

Referenced by Transcoder.PullUnmanaged(), MediaInfo.PushUnmanaged(), and Transcoder.PushUnmanaged().