The video stream interface. More...
#include "murl_i_video_stream.h"
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... | |
Detailed Description
The video stream interface.
Member Function Documentation
◆ Clone() [1/4]
|
pure virtual |
Create a clone of the video stream object.
- Returns
- The new video stream object.
Implemented in Murl::Util::VideoStream.
◆ Clone() [2/4]
|
pure virtual |
Create a clone of the video with a specified pixel format.
- Parameters
-
pixelFormat The pixel format of the new video object.
- Returns
- The new video stream object or null if conversion is not available.
Implemented in Murl::Util::VideoStream.
◆ Clone() [3/4]
|
pure virtual |
Create a clone of the video with a specified pixel format and size.
- Parameters
-
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.
- Returns
- The new video stream object or null if conversion is not available.
Implemented in Murl::Util::VideoStream.
◆ Clone() [4/4]
|
pure virtual |
Create a clone with a specified pixel format and size and optional mip-mapping.
- Parameters
-
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.
- Returns
- The new video stream object or null if conversion is not available.
Implemented in Murl::Util::VideoStream.
◆ GetNumberOfFrames()
|
pure virtual |
Get the total number of frames.
- Returns
- The number of frames.
Implemented in Murl::Util::VideoStream.
◆ GetFrameIndex()
Get the index of the frame at a given start time.
- Parameters
-
startTime The frame start time in seconds.
- Returns
- The frame index.
Implemented in Murl::Util::VideoStream.
◆ GetStartTime()
Get the start time of a frame at a given index.
- Parameters
-
frameIndex The index of the frame to query.
- Returns
- The frame's start time.
Implemented in Murl::Util::VideoStream.
◆ GetFrameRate()
|
pure virtual |
Get the number of frames per second.
- Returns
- The number of frames per second.
Implemented in Murl::Util::VideoStream.
◆ GetFrameDuration()
|
pure virtual |
Get the duration of a single frame, i.e.
the inverse frame rate.
- Returns
- The frame duration in seconds.
Implemented in Murl::Util::VideoStream.
◆ GetTotalDuration()
|
pure virtual |
Get the total duration of the stream, in seconds.
- Returns
- The total duration.
Implemented in Murl::Util::VideoStream.
◆ GetNumberOfMipLevels()
|
pure virtual |
Get the number of mip levels.
- Returns
- The number of mip levels.
Implemented in Murl::Util::VideoStream.
◆ GetNumberOfPlanes()
|
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.
- Returns
- The number of color planes.
Implemented in Murl::Util::VideoStream.
◆ GetPixelFormat() [1/2]
|
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.
- Returns
- The pixel format of the stream.
Implemented in Murl::Util::VideoStream.
◆ GetBytesPerPixel() [1/2]
|
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).
- Returns
- The number of bytes per pixel for the stream format.
Implemented in Murl::Util::VideoStream.
◆ GetPixelSizeX() [1/2]
Get the number of horizontal pixels.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1].
- Returns
- The number of horizontal pixels.
Implemented in Murl::Util::VideoStream.
◆ GetPixelSizeY() [1/2]
Get the number of vertical pixels.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1].
- Returns
- The number of vertical pixels.
Implemented in Murl::Util::VideoStream.
◆ GetBytesPerLine() [1/2]
Get the number of bytes per line.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1].
- Returns
- The number of bytes per line.
Implemented in Murl::Util::VideoStream.
◆ GetNumberOfBytes() [1/2]
Get the number of bytes occupied by a single decoded mip level image.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1].
- Returns
- The number of bytes.
Implemented in Murl::Util::VideoStream.
◆ GetPixelFormat() [2/2]
|
pure virtual |
Get the pixel format of a given plane.
- Parameters
-
planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The pixel format of the plane.
Implemented in Murl::Util::VideoStream.
◆ GetBytesPerPixel() [2/2]
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.
- Parameters
-
planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The number of bytes per pixel for the given plane.
Implemented in Murl::Util::VideoStream.
◆ GetPixelSizeX() [2/2]
|
pure virtual |
Get the number of horizontal pixels of a given color plane.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The number of horizontal pixels.
Implemented in Murl::Util::VideoStream.
◆ GetPixelSizeY() [2/2]
|
pure virtual |
Get the number of vertical pixels of a given color plane.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The number of vertical pixels.
Implemented in Murl::Util::VideoStream.
◆ GetBytesPerLine() [2/2]
|
pure virtual |
Get the number of bytes per line of a given color plane.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The number of bytes per line.
Implemented in Murl::Util::VideoStream.
◆ GetNumberOfBytes() [2/2]
|
pure virtual |
Get the number of bytes occupied by a single decoded mip level plane.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The number of bytes.
Implemented in Murl::Util::VideoStream.
◆ IsReadyForDecoding()
|
pure virtual |
Check if the stream is ready to be decoded.
- Returns
- true if ready.
Implemented in Murl::Util::VideoStream.
◆ StartDecoding()
|
pure virtual |
Start decoding the stream.
Has to be called before Decode().
- Returns
- true if successful.
Implemented in Murl::Util::VideoStream.
◆ EndDecoding()
|
pure virtual |
End decoding the stream.
Has to be called after Decode().
- Returns
- true if successful.
Implemented in Murl::Util::VideoStream.
◆ Decode()
|
pure virtual |
Decode the stream.
StartDecoding() has to be called before, see also EndDecoding().
- Parameters
-
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.
- Returns
- The number of decoded frames.
Implemented in Murl::Util::VideoStream.
◆ SetCurrentMode()
|
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.
- Parameters
-
mode The access mode to apply.
- Returns
- true if a new frame was triggered.
Implemented in Murl::Util::VideoStream.
◆ GetCurrentMode()
|
pure virtual |
Get the stream's current access mode.
- Returns
- The current access mode.
Implemented in Murl::Util::VideoStream.
◆ SetCurrentTimeOffset()
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.
- Parameters
-
timeOffset The time offset in seconds.
- Returns
- true if a new frame was triggered.
Implemented in Murl::Util::VideoStream.
◆ GetCurrentTimeOffset()
|
pure virtual |
Get the current time offset.
- Returns
- The time offset in seconds.
Implemented in Murl::Util::VideoStream.
◆ PrepareDecodedData()
|
pure virtual |
Prepare decoded data, creating the underlying pixel storage if needed.
Decode a single frame at the current position, see GetDecodedData().
- Returns
- true if successful.
Implemented in Murl::Util::VideoStream.
◆ FinishDecodedData()
|
pure virtual |
Finish decoded data after a call to PrepareDecodedData().
- Returns
- true if successful.
Implemented in Murl::Util::VideoStream.
◆ ReleaseDecodedData()
|
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.
- Returns
- true if successful.
Implemented in Murl::Util::VideoStream, and Murl::Util::EvictableVideoStream.
◆ GetDecodedTimeOffset()
|
pure virtual |
Get the time offset of the recently decoded data buffer.
- Returns
- The time offset in seconds.
Implemented in Murl::Util::VideoStream.
◆ GetDecodedFrameIndex()
|
pure virtual |
Get the index of the recently decoded buffer's frame.
- Returns
- The frame index.
Implemented in Murl::Util::VideoStream.
◆ GetDecodedData()
|
pure virtual |
Get the decoded data.
PrepareDecodedData() has to be called before, see also FinishDecodedData().
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The decoded data or empty data if not supported.
Implemented in Murl::Util::VideoStream.
◆ GetDecodedSurface()
|
pure virtual |
Get the decoded surface.
PrepareDecodedData() has to be called before, see also FinishDecodedData().
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The decoded surface or null if not supported.
Implemented in Murl::Util::VideoStream.
◆ LockDecodedData()
|
pure virtual |
Lock the decoded data.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The mutable data or empty data if not supported.
Implemented in Murl::Util::VideoStream.
◆ LockDecodedSurface()
|
pure virtual |
Lock the decoded surface.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- The mutable surface or null if not supported.
Implemented in Murl::Util::VideoStream.
◆ UnlockDecodedData()
|
pure virtual |
Unlock the decoded data.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- true if successful.
Implemented in Murl::Util::VideoStream.
◆ UnlockDecodedSurface()
|
pure virtual |
Unlock the decoded surface.
- Parameters
-
mipLevel The mip level in the range [0 .. GetNumberOfMipLevels() - 1]. planeIndex The color plane index in the range [0 .. GetNumberOfPlanes() - 1].
- Returns
- true if successful.
Implemented in Murl::Util::VideoStream.
The documentation for this interface was generated from the following file:
- murl_i_video_stream.h