![]() |
Murl Engine API
Version 2025.1
|
The video stream interface. More...
#include <murl_i_video_stream.h>
The video stream interface.
Public Member Functions | |
| ~IVideoStream () override | |
| The destructor. | |
| virtual IVideoStream * | Clone () const =0 |
| Create a clone of the video stream object. More... | |
| virtual IVideoStream * | Clone (IEnums::PixelFormat pixelFormat) const =0 |
| Create a clone of the video with a specified pixel format. More... | |
| virtual IVideoStream * | Clone (IEnums::PixelFormat pixelFormat, UInt32 pixelSizeX, UInt32 pixelSizeY) const =0 |
| Create a clone of the video with a specified pixel format and size. More... | |
| virtual IVideoStream * | Clone (IEnums::PixelFormat pixelFormat, UInt32 pixelSizeX, UInt32 pixelSizeY, IEnums::MipMapGenerationMode mipMapGen) const =0 |
| Create a clone with a specified pixel format and size and optional mip-mapping. More... | |
| virtual UInt32 | GetNumberOfFrames () const =0 |
| Get the total number of frames. More... | |
| virtual UInt32 | GetFrameIndex (Double startTime) const =0 |
| Get the index of the frame at a given start time. More... | |
| virtual Double | GetStartTime (UInt32 frameIndex) const =0 |
| Get the start time of a frame at a given index. More... | |
| virtual Double | GetFrameRate () const =0 |
| Get the number of frames per second. More... | |
| virtual Double | GetFrameDuration () const =0 |
| Get the duration of a single frame, i.e. More... | |
| virtual Double | GetTotalDuration () const =0 |
| Get the total duration of the stream, in seconds. More... | |
| virtual UInt32 | GetNumberOfMipLevels () const =0 |
| Get the number of mip levels. More... | |
| virtual UInt32 | GetNumberOfPlanes () const =0 |
| Get the number of color planes. More... | |
| virtual IEnums::PixelFormat | GetPixelFormat () const =0 |
| Get the pixel format of the stream. More... | |
| virtual UInt32 | GetBytesPerPixel () const =0 |
| Get the number of bytes per pixel. More... | |
| virtual UInt32 | GetPixelSizeX (UInt32 mipLevel) const =0 |
| Get the number of horizontal pixels. More... | |
| virtual UInt32 | GetPixelSizeY (UInt32 mipLevel) const =0 |
| Get the number of vertical pixels. More... | |
| virtual UInt32 | GetBytesPerLine (UInt32 mipLevel) const =0 |
| Get the number of bytes per line. More... | |
| virtual UInt32 | GetNumberOfBytes (UInt32 mipLevel) const =0 |
| Get the number of bytes occupied by a single decoded mip level image. More... | |
| virtual IEnums::PixelFormat | GetPixelFormat (UInt32 planeIndex) const =0 |
| Get the pixel format of a given plane. More... | |
| virtual UInt32 | GetBytesPerPixel (UInt32 planeIndex) const =0 |
| Get the number of bytes per pixel for a given plane. More... | |
| virtual UInt32 | GetPixelSizeX (UInt32 mipLevel, UInt32 planeIndex) const =0 |
| Get the number of horizontal pixels of a given color plane. More... | |
| virtual UInt32 | GetPixelSizeY (UInt32 mipLevel, UInt32 planeIndex) const =0 |
| Get the number of vertical pixels of a given color plane. More... | |
| virtual UInt32 | GetBytesPerLine (UInt32 mipLevel, UInt32 planeIndex) const =0 |
| Get the number of bytes per line of a given color plane. More... | |
| virtual UInt32 | GetNumberOfBytes (UInt32 mipLevel, UInt32 planeIndex) const =0 |
| Get the number of bytes occupied by a single decoded mip level plane. More... | |
| virtual Bool | IsReadyForDecoding () const =0 |
| Check if the stream is ready to be decoded. More... | |
| virtual Bool | StartDecoding ()=0 |
| Start decoding the stream. More... | |
| virtual Bool | EndDecoding ()=0 |
| End decoding the stream. More... | |
| virtual UInt32 | Decode (UInt32 mipLevel, UInt32 planeIndex, Data &dstBuffer, IEnums::PixelFormat dstFormat, UInt32 firstFrame, UInt32 numFrames)=0 |
| Decode the stream. More... | |
| virtual Bool | SetCurrentMode (IEnums::StreamMode mode)=0 |
| Set the stream's current access mode. More... | |
| virtual const IEnums::StreamMode | GetCurrentMode () const =0 |
| Get the stream's current access mode. More... | |
| virtual Bool | SetCurrentTimeOffset (Double timeOffset)=0 |
| Set the current time offset for subsequent PrepareDecodedData() calls. More... | |
| virtual Double | GetCurrentTimeOffset () const =0 |
| Get the current time offset. More... | |
| virtual Bool | PrepareDecodedData ()=0 |
| Prepare decoded data, creating the underlying pixel storage if needed. More... | |
| virtual Bool | FinishDecodedData ()=0 |
| Finish decoded data after a call to PrepareDecodedData(). More... | |
| virtual Bool | ReleaseDecodedData ()=0 |
| Release decoded data. More... | |
| virtual Double | GetDecodedTimeOffset () const =0 |
| Get the time offset of the recently decoded data buffer. More... | |
| virtual UInt64 | GetDecodedFrameIndex () const =0 |
| Get the index of the recently decoded buffer's frame. More... | |
| virtual const ConstData & | GetDecodedData (UInt32 mipLevel, UInt32 planeIndex)=0 |
| Get the decoded data. More... | |
| virtual const IVideoSurface * | GetDecodedSurface (UInt32 mipLevel, UInt32 planeIndex)=0 |
| Get the decoded surface. More... | |
| virtual const MutableData & | LockDecodedData (UInt32 mipLevel, UInt32 planeIndex)=0 |
| Lock the decoded data. More... | |
| virtual IVideoSurface * | LockDecodedSurface (UInt32 mipLevel, UInt32 planeIndex)=0 |
| Lock the decoded surface. More... | |
| virtual Bool | UnlockDecodedData (UInt32 mipLevel, UInt32 planeIndex)=0 |
| Unlock the decoded data. More... | |
| virtual Bool | UnlockDecodedSurface (UInt32 mipLevel, UInt32 planeIndex)=0 |
| Unlock the decoded surface. More... | |
|
pure virtual |
Create a clone of the video stream object.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Create a clone of the video with a specified pixel format.
| pixelFormat | The pixel format of the new video object. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Create a clone of the video with a specified pixel format and size.
| 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. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Create a clone with a specified pixel format and size and optional mip-mapping.
| 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. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the total number of frames.
Implemented in Murl::Util::VideoStream.
Get the index of the frame at a given start time.
| startTime | The frame start time in seconds. |
Implemented in Murl::Util::VideoStream.
Get the start time of a frame at a given index.
| frameIndex | The index of the frame to query. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the number of frames per second.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the duration of a single frame, i.e.
the inverse frame rate.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the total duration of the stream, in seconds.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the number of mip levels.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
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.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
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.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
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).
Implemented in Murl::Util::VideoStream.
Get the number of horizontal pixels.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
Implemented in Murl::Util::VideoStream.
Get the number of vertical pixels.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
Implemented in Murl::Util::VideoStream.
Get the number of bytes per line.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
Implemented in Murl::Util::VideoStream.
Get the number of bytes occupied by a single decoded mip level image.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the pixel format of a given plane.
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
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.
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the number of horizontal pixels of a given color plane.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the number of vertical pixels of a given color plane.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the number of bytes per line of a given color plane.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the number of bytes occupied by a single decoded mip level plane.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Check if the stream is ready to be decoded.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Start decoding the stream.
Has to be called before Decode().
Implemented in Murl::Util::VideoStream.
|
pure virtual |
End decoding the stream.
Has to be called after Decode().
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Decode the stream.
StartDecoding() has to be called before, see also EndDecoding().
| 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. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
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.
| mode | The access mode to apply. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the stream's current access mode.
Implemented in Murl::Util::VideoStream.
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.
| timeOffset | The time offset in seconds. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the current time offset.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Prepare decoded data, creating the underlying pixel storage if needed.
Decode a single frame at the current position, see GetDecodedData().
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Finish decoded data after a call to PrepareDecodedData().
Implemented in Murl::Util::VideoStream.
|
pure virtual |
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.
Implemented in Murl::Util::VideoStream, and Murl::Util::EvictableVideoStream.
|
pure virtual |
Get the time offset of the recently decoded data buffer.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the index of the recently decoded buffer's frame.
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the decoded data.
PrepareDecodedData() has to be called before, see also FinishDecodedData().
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Get the decoded surface.
PrepareDecodedData() has to be called before, see also FinishDecodedData().
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Lock the decoded data.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Lock the decoded surface.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Unlock the decoded data.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.
|
pure virtual |
Unlock the decoded surface.
| mipLevel | The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. |
| planeIndex | The color plane index in the range [0 .. GetNumberOfPlanes() - 1]. |
Implemented in Murl::Util::VideoStream.