Murl Engine Lua Addon API  Version 1.0 beta
Murl.IVideoStream

The video stream interface.


Table members

Methods


Clone()

Create a clone of the video stream object.

Murl.IVideoStream Clone()

Returns
Murl.IVideoStream The new video stream object.

Clone(pixelFormat)

Create a clone of the video with a specified pixel format.

Murl.IVideoStream Clone(Murl.IEnums.PixelFormat pixelFormat)

Parameters
pixelFormatThe pixel format of the new video object.
Returns
Murl.IVideoStream The new video stream object or null if conversion is not available.

Clone(pixelFormat, pixelSizeX, pixelSizeY)

Create a clone of the video with a specified pixel format and size.

Murl.IVideoStream Clone(Murl.IEnums.PixelFormat pixelFormat, Integer pixelSizeX, Integer pixelSizeY)

Parameters
pixelFormatThe pixel format of the new video object.
pixelSizeXThe number of horizontal pixels of the new video object.
pixelSizeYThe number of vertical pixels of the new video object.
Returns
Murl.IVideoStream The new video stream object or null if conversion is not available.

Clone(pixelFormat, pixelSizeX, pixelSizeY, mipMapGen)

Create a clone with a specified pixel format and size and optional mip-mapping

Murl.IVideoStream Clone(Murl.IEnums.PixelFormat pixelFormat, Integer pixelSizeX, Integer pixelSizeY, Murl.IEnums.MipMapGenerationMode mipMapGen)

Parameters
pixelFormatThe pixel format of the new video object.
pixelSizeXThe number of horizontal pixels of the new video object.
pixelSizeYThe number of vertical pixels of the new video object.
mipMapGenSpecifies if and how mip maps are generated.
Returns
Murl.IVideoStream The new video stream object or null if conversion is not available.

GetNumberOfFrames()

Get the total number of frames.

Integer GetNumberOfFrames()

Returns
Integer The number of frames.

GetFrameIndex(startTime)

Get the index of the frame at a given start time.

Integer GetFrameIndex(Number startTime)

Parameters
startTimeThe frame start time in seconds.
Returns
Integer The frame index.

GetStartTime(frameIndex)

Get the start time of a frame at a given index.

Number GetStartTime(Integer frameIndex)

Parameters
frameIndexThe index of the frame to query.
Returns
Number The frame's start time.

GetFrameRate()

Get the number of frames per second.

Number GetFrameRate()

Returns
Number The number of frames per second.

GetFrameDuration()

Get the duration of a single frame, i.e. the inverse frame rate.

Number GetFrameDuration()

Returns
Number The frame duration in seconds.

GetTotalDuration()

Get the total duration of the stream, in seconds.

Number GetTotalDuration()

Returns
Number The total duration.

GetNumberOfMipLevels()

Get the number of mip levels.

Integer GetNumberOfMipLevels()

Returns
Integer The number of mip levels.

GetNumberOfPlanes()

Get the number of color planes. Regular pixel formats (e.g. IEnums::PIXEL_FORMAT_R8_G8_B8_A8) only have one plane. Planar YUV formats store 3 individual planes, one for each of the Y, U and V components, in the order given by the pixel format itself (e.g. IEnums::PIXEL_FORMAT_Y8_U8_V8). Semi-planar YUV formats have 2 planes, with index 0 representing the Y plane, and index 1 storing the U and V components per pixel.

Integer GetNumberOfPlanes()

Returns
Integer The number of color planes.

GetPixelFormat()

Get the pixel format of the stream. For regular (single plane) formats, this method usually returns the same pixel format as the surfaces returned by GetDecodedSurface() or LockDecodedSurface(). For multi-plane formats (such as IEnums::PIXEL_FORMAT_Y8_U8_V8) it returns the respective format, whereas the individual plane surfaces return their internal format, such as IEnums::PIXEL_FORMAT_L8 for a Y plane or IEnums::PIXEL_FORMAT_L8_A8 for a combined UV plane.

Murl.IEnums.PixelFormat GetPixelFormat()

Returns
Murl.IEnums.PixelFormat The pixel format of the stream.

GetPixelFormat(planeIndex)

Get the pixel format of a given plane.

Murl.IEnums.PixelFormat GetPixelFormat(Integer planeIndex)

Parameters
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Murl.IEnums.PixelFormat The pixel format of the plane.

GetBytesPerPixel()

Get the number of bytes per pixel. This method is a convenience to get the number of bytes per pixel for the stream's pixel format, it only returns a concrete value for single-plane pixel formats. Querying the number of bytes per pixel for multi-plane formats must be done by calling the overloaded method GetBytesPerPixel(UInt32 planeIndex).

Integer GetBytesPerPixel()

Returns
Integer The number of bytes per pixel for the stream format.

GetBytesPerPixel(planeIndex)

Get the number of bytes per pixel for a given plane. This method is a convenience to get the number of bytes per pixel for a color plane given by its index.

Integer GetBytesPerPixel(Integer planeIndex)

Parameters
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Integer The number of bytes per pixel for the given plane.

GetPixelSizeX(mipLevel)

Get the number of horizontal pixels.

Integer GetPixelSizeX(Integer mipLevel)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
Returns
Integer The number of horizontal pixels.

GetPixelSizeX(mipLevel, planeIndex)

Get the number of horizontal pixels of a given color plane.

Integer GetPixelSizeX(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Integer The number of horizontal pixels.

GetPixelSizeY(mipLevel)

Get the number of vertical pixels.

Integer GetPixelSizeY(Integer mipLevel)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
Returns
Integer The number of vertical pixels.

GetPixelSizeY(mipLevel, planeIndex)

Get the number of vertical pixels of a given color plane.

Integer GetPixelSizeY(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Integer The number of vertical pixels.

GetBytesPerLine(mipLevel)

Get the number of bytes per line.

Integer GetBytesPerLine(Integer mipLevel)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
Returns
Integer The number of bytes per line.

GetBytesPerLine(mipLevel, planeIndex)

Get the number of bytes per line of a given color plane.

Integer GetBytesPerLine(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Integer The number of bytes per line.

GetNumberOfBytes(mipLevel)

Get the number of bytes occupied by a single decoded mip level image.

Integer GetNumberOfBytes(Integer mipLevel)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
Returns
Integer The number of bytes.

GetNumberOfBytes(mipLevel, planeIndex)

Get the number of bytes occupied by a single decoded mip level plane.

Integer GetNumberOfBytes(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Integer The number of bytes.

IsReadyForDecoding()

Check if the stream is ready to be decoded.

Boolean IsReadyForDecoding()

Returns
Boolean true if ready.

StartDecoding()

Start decoding the stream. Has to be called before Decode().

Boolean StartDecoding()

Returns
Boolean true if successful.

EndDecoding()

End decoding the stream. Has to be called after Decode().

Boolean EndDecoding()

Returns
Boolean true if successful.

Decode(mipLevel, planeIndex, dstBuffer, dstFormat, firstFrame, numFrames)

Decode the stream. StartDecoding() has to be called before, see also EndDecoding().

Integer, Murl.Data Decode(Integer mipLevel, Integer planeIndex, Murl.Data dstBuffer, Murl.IEnums.PixelFormat dstFormat, Integer firstFrame, Integer numFrames)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
dstBufferThe destination data.
dstFormatThe destination pixel format.
firstFrameThe first frame to decode.
numFramesThe number of frames to decode.
Returns
Integer The number of decoded frames.
Murl.Data dstBuffer The destination data.

SetCurrentMode(mode)

Set the stream's current access mode. This serves as a hint to a possible underlying stream decoder, to be able to do optimal decoding whether single frame access or a continuous sequence of frames is desired. This method returns true whenever the given time offset triggers the decoding of a new frame.

Boolean SetCurrentMode(Murl.IEnums.StreamMode mode)

Parameters
modeThe access mode to apply.
Returns
Boolean true if a new frame was triggered.

GetCurrentMode()

Get the stream's current access mode.

Murl.IEnums.StreamMode GetCurrentMode()

Returns
Murl.IEnums.StreamMode The current access mode.

SetCurrentTimeOffset(timeOffset)

Set the current time offset for subsequent PrepareDecodedData() calls. This method returns true whenever the given time offset triggers the decoding of a new frame.

Boolean SetCurrentTimeOffset(Number timeOffset)

Parameters
timeOffsetThe time offset in seconds.
Returns
Boolean true if a new frame was triggered.

GetCurrentTimeOffset()

Get the current time offset.

Number GetCurrentTimeOffset()

Returns
Number The time offset in seconds.

PrepareDecodedData()

Prepare decoded data, creating the underlying pixel storage if needed. Decode a single frame at the current position, see GetDecodedData().

Boolean PrepareDecodedData()

Returns
Boolean true if successful.

FinishDecodedData()

Finish decoded data after a call to PrepareDecodedData().

Boolean FinishDecodedData()

Returns
Boolean true if successful.

ReleaseDecodedData()

Release decoded data. If the stream supports re-creating its contents on its own, it may free any underlying pixel storage to save memory on this call, otherwise this may be a no-op.

Boolean ReleaseDecodedData()

Returns
Boolean true if successful.

GetDecodedTimeOffset()

Get the time offset of the recently decoded data buffer.

Number GetDecodedTimeOffset()

Returns
Number The time offset in seconds.

GetDecodedFrameIndex()

Get the index of the recently decoded buffer's frame.

Integer GetDecodedFrameIndex()

Returns
Integer The frame index.

GetDecodedData(mipLevel, planeIndex)

Get the decoded data. PrepareDecodedData() has to be called before, see also FinishDecodedData().

Murl.ConstData GetDecodedData(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Murl.ConstData The decoded data or empty data if not supported.

GetDecodedSurface(mipLevel, planeIndex)

Get the decoded surface. PrepareDecodedData() has to be called before, see also FinishDecodedData().

Murl.IVideoSurface GetDecodedSurface(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Murl.IVideoSurface The decoded surface or null if not supported.

LockDecodedData(mipLevel, planeIndex)

Lock the decoded data.

Murl.MutableData LockDecodedData(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Murl.MutableData The mutable data or empty data if not supported.

LockDecodedSurface(mipLevel, planeIndex)

Lock the decoded surface.

Murl.IVideoSurface LockDecodedSurface(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Murl.IVideoSurface The mutable surface or null if not supported.

UnlockDecodedData(mipLevel, planeIndex)

Unlock the decoded data.

Boolean UnlockDecodedData(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Boolean true if successful.

UnlockDecodedSurface(mipLevel, planeIndex)

Unlock the decoded surface.

Boolean UnlockDecodedSurface(Integer mipLevel, Integer planeIndex)

Parameters
mipLevelThe mip level in the range [0 .. GetNumberOfMipLevels() - 1].
planeIndexThe color plane index in the range [0 .. GetNumberOfPlanes() - 1].
Returns
Boolean true if successful.