![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The video stream interface.
Create a clone of the video stream object.
Murl.IVideoStream Clone()
Create a clone of the video with a specified pixel format.
Murl.IVideoStream Clone(Murl.IEnums.PixelFormat pixelFormat)
pixelFormat | The pixel format of the new video object. |
Create a clone of the video with a specified pixel format and size.
Murl.IVideoStream Clone(Murl.IEnums.PixelFormat pixelFormat, Integer pixelSizeX, Integer pixelSizeY)
pixelFormat | The pixel format of the new video object. |
pixelSizeX | The number of horizontal pixels of the new video object. |
pixelSizeY | The number of vertical pixels of the new video object. |
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)
pixelFormat | The pixel format of the new video object. |
pixelSizeX | The number of horizontal pixels of the new video object. |
pixelSizeY | The number of vertical pixels of the new video object. |
mipMapGen | Specifies if and how mip maps are generated. |
Get the total number of frames.
Integer GetNumberOfFrames()
Get the index of the frame at a given start time.
Integer GetFrameIndex(Number startTime)
startTime | The frame start time in seconds. |
Get the start time of a frame at a given index.
Number GetStartTime(Integer frameIndex)
frameIndex | The index of the frame to query. |
Get the number of frames per second.
Number GetFrameRate()
Get the duration of a single frame, i.e. the inverse frame rate.
Number GetFrameDuration()
Get the total duration of the stream, in seconds.
Number GetTotalDuration()
Get the number of mip levels.
Integer GetNumberOfMipLevels()
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()
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()
Get the pixel format of a given plane.
Murl.IEnums.PixelFormat GetPixelFormat(Integer planeIndex)
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
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()
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)
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Get the number of horizontal pixels.
Integer GetPixelSizeX(Integer mipLevel)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
Get the number of horizontal pixels of a given color plane.
Integer GetPixelSizeX(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Get the number of vertical pixels.
Integer GetPixelSizeY(Integer mipLevel)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
Get the number of vertical pixels of a given color plane.
Integer GetPixelSizeY(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Get the number of bytes per line.
Integer GetBytesPerLine(Integer mipLevel)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
Get the number of bytes per line of a given color plane.
Integer GetBytesPerLine(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Get the number of bytes occupied by a single decoded mip level image.
Integer GetNumberOfBytes(Integer mipLevel)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
Get the number of bytes occupied by a single decoded mip level plane.
Integer GetNumberOfBytes(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Check if the stream is ready to be decoded.
Boolean IsReadyForDecoding()
Start decoding the stream. Has to be called before Decode().
Boolean StartDecoding()
End decoding the stream. Has to be called after Decode().
Boolean EndDecoding()
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)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
dstBuffer | The destination data. |
dstFormat | The destination pixel format. |
firstFrame | The first frame to decode. |
numFrames | The number of frames to decode. |
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)
mode | The access mode to apply. |
Get the stream's current access mode.
Murl.IEnums.StreamMode GetCurrentMode()
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)
timeOffset | The time offset in seconds. |
Get the current time offset.
Number GetCurrentTimeOffset()
Prepare decoded data, creating the underlying pixel storage if needed. Decode a single frame at the current position, see GetDecodedData().
Boolean PrepareDecodedData()
Finish decoded data after a call to PrepareDecodedData().
Boolean FinishDecodedData()
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()
Get the time offset of the recently decoded data buffer.
Number GetDecodedTimeOffset()
Get the index of the recently decoded buffer's frame.
Integer GetDecodedFrameIndex()
Get the decoded data. PrepareDecodedData() has to be called before, see also FinishDecodedData().
Murl.ConstData GetDecodedData(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Get the decoded surface. PrepareDecodedData() has to be called before, see also FinishDecodedData().
Murl.IVideoSurface GetDecodedSurface(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Lock the decoded data.
Murl.MutableData LockDecodedData(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Lock the decoded surface.
Murl.IVideoSurface LockDecodedSurface(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Unlock the decoded data.
Boolean UnlockDecodedData(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Unlock the decoded surface.
Boolean UnlockDecodedSurface(Integer mipLevel, Integer planeIndex)
mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |