Murl::IVideoStream Interface Referenceabstract

The video stream interface. More...

#include "murl_i_video_stream.h"

Inheritance diagram for Murl::IVideoStream:

Public Member Functions

virtual ~IVideoStream ()
 The destructor.
 
virtual IVideoStreamClone () const =0
 Create a clone of the video stream object. More...
 
virtual IVideoStreamClone (IEnums::PixelFormat pixelFormat) const =0
 Create a clone of the video with a specified pixel format. More...
 
virtual IVideoStreamClone (IEnums::PixelFormat pixelFormat, UInt32 pixelSizeX, UInt32 pixelSizeY) const =0
 Create a clone of the video with a specified pixel format and size. More...
 
virtual IVideoStreamClone (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 ConstDataGetDecodedData (UInt32 mipLevel, UInt32 planeIndex)=0
 Get the decoded data. More...
 
virtual const IVideoSurfaceGetDecodedSurface (UInt32 mipLevel, UInt32 planeIndex)=0
 Get the decoded surface. More...
 
virtual const MutableDataLockDecodedData (UInt32 mipLevel, UInt32 planeIndex)=0
 Lock the decoded data. More...
 
virtual IVideoSurfaceLockDecodedSurface (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]

virtual IVideoStream* Murl::IVideoStream::Clone ( ) const
pure virtual

Create a clone of the video stream object.

Returns
The new video stream object.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ Clone() [2/4]

virtual IVideoStream* Murl::IVideoStream::Clone ( IEnums::PixelFormat  pixelFormat) const
pure virtual

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

Parameters
pixelFormatThe 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]

virtual IVideoStream* Murl::IVideoStream::Clone ( IEnums::PixelFormat  pixelFormat,
UInt32  pixelSizeX,
UInt32  pixelSizeY 
) const
pure virtual

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

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
The new video stream object or null if conversion is not available.

Implemented in Murl::Util::VideoStream.

◆ Clone() [4/4]

virtual IVideoStream* Murl::IVideoStream::Clone ( IEnums::PixelFormat  pixelFormat,
UInt32  pixelSizeX,
UInt32  pixelSizeY,
IEnums::MipMapGenerationMode  mipMapGen 
) const
pure virtual

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

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
The new video stream object or null if conversion is not available.

Implemented in Murl::Util::VideoStream.

◆ GetNumberOfFrames()

virtual UInt32 Murl::IVideoStream::GetNumberOfFrames ( ) const
pure virtual

Get the total number of frames.

Returns
The number of frames.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetFrameIndex()

virtual UInt32 Murl::IVideoStream::GetFrameIndex ( Double  startTime) const
pure virtual

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

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetStartTime()

virtual Double Murl::IVideoStream::GetStartTime ( UInt32  frameIndex) const
pure virtual

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

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetFrameRate()

virtual Double Murl::IVideoStream::GetFrameRate ( ) const
pure virtual

Get the number of frames per second.

Returns
The number of frames per second.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetFrameDuration()

virtual Double Murl::IVideoStream::GetFrameDuration ( ) const
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.

Referenced by ~IVideoStream().

◆ GetTotalDuration()

virtual Double Murl::IVideoStream::GetTotalDuration ( ) const
pure virtual

Get the total duration of the stream, in seconds.

Returns
The total duration.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetNumberOfMipLevels()

virtual UInt32 Murl::IVideoStream::GetNumberOfMipLevels ( ) const
pure virtual

Get the number of mip levels.

Returns
The number of mip levels.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetNumberOfPlanes()

virtual UInt32 Murl::IVideoStream::GetNumberOfPlanes ( ) const
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.

Referenced by ~IVideoStream().

◆ GetPixelFormat() [1/2]

virtual IEnums::PixelFormat Murl::IVideoStream::GetPixelFormat ( ) const
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.

Referenced by ~IVideoStream().

◆ GetBytesPerPixel() [1/2]

virtual UInt32 Murl::IVideoStream::GetBytesPerPixel ( ) const
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.

Referenced by ~IVideoStream().

◆ GetPixelSizeX() [1/2]

virtual UInt32 Murl::IVideoStream::GetPixelSizeX ( UInt32  mipLevel) const
pure virtual

Get the number of horizontal pixels.

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetPixelSizeY() [1/2]

virtual UInt32 Murl::IVideoStream::GetPixelSizeY ( UInt32  mipLevel) const
pure virtual

Get the number of vertical pixels.

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetBytesPerLine() [1/2]

virtual UInt32 Murl::IVideoStream::GetBytesPerLine ( UInt32  mipLevel) const
pure virtual

Get the number of bytes per line.

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetNumberOfBytes() [1/2]

virtual UInt32 Murl::IVideoStream::GetNumberOfBytes ( UInt32  mipLevel) const
pure virtual

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

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetPixelFormat() [2/2]

virtual IEnums::PixelFormat Murl::IVideoStream::GetPixelFormat ( UInt32  planeIndex) const
pure virtual

Get the pixel format of a given plane.

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

Implemented in Murl::Util::VideoStream.

◆ GetBytesPerPixel() [2/2]

virtual UInt32 Murl::IVideoStream::GetBytesPerPixel ( UInt32  planeIndex) const
pure virtual

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
planeIndexThe 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]

virtual UInt32 Murl::IVideoStream::GetPixelSizeX ( UInt32  mipLevel,
UInt32  planeIndex 
) const
pure virtual

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

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

Implemented in Murl::Util::VideoStream.

◆ GetPixelSizeY() [2/2]

virtual UInt32 Murl::IVideoStream::GetPixelSizeY ( UInt32  mipLevel,
UInt32  planeIndex 
) const
pure virtual

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

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

Implemented in Murl::Util::VideoStream.

◆ GetBytesPerLine() [2/2]

virtual UInt32 Murl::IVideoStream::GetBytesPerLine ( UInt32  mipLevel,
UInt32  planeIndex 
) const
pure virtual

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

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

Implemented in Murl::Util::VideoStream.

◆ GetNumberOfBytes() [2/2]

virtual UInt32 Murl::IVideoStream::GetNumberOfBytes ( UInt32  mipLevel,
UInt32  planeIndex 
) const
pure virtual

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

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

Implemented in Murl::Util::VideoStream.

◆ IsReadyForDecoding()

virtual Bool Murl::IVideoStream::IsReadyForDecoding ( ) const
pure virtual

Check if the stream is ready to be decoded.

Returns
true if ready.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ StartDecoding()

virtual Bool Murl::IVideoStream::StartDecoding ( )
pure virtual

Start decoding the stream.

Has to be called before Decode().

Returns
true if successful.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ EndDecoding()

virtual Bool Murl::IVideoStream::EndDecoding ( )
pure virtual

End decoding the stream.

Has to be called after Decode().

Returns
true if successful.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ Decode()

virtual UInt32 Murl::IVideoStream::Decode ( UInt32  mipLevel,
UInt32  planeIndex,
Data dstBuffer,
IEnums::PixelFormat  dstFormat,
UInt32  firstFrame,
UInt32  numFrames 
)
pure virtual

Decode the stream.

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

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
The number of decoded frames.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ SetCurrentMode()

virtual Bool Murl::IVideoStream::SetCurrentMode ( IEnums::StreamMode  mode)
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
modeThe access mode to apply.
Returns
true if a new frame was triggered.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetCurrentMode()

virtual const IEnums::StreamMode Murl::IVideoStream::GetCurrentMode ( ) const
pure virtual

Get the stream's current access mode.

Returns
The current access mode.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ SetCurrentTimeOffset()

virtual Bool Murl::IVideoStream::SetCurrentTimeOffset ( Double  timeOffset)
pure virtual

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
timeOffsetThe time offset in seconds.
Returns
true if a new frame was triggered.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetCurrentTimeOffset()

virtual Double Murl::IVideoStream::GetCurrentTimeOffset ( ) const
pure virtual

Get the current time offset.

Returns
The time offset in seconds.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ PrepareDecodedData()

virtual Bool Murl::IVideoStream::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.

Referenced by ~IVideoStream().

◆ FinishDecodedData()

virtual Bool Murl::IVideoStream::FinishDecodedData ( )
pure virtual

Finish decoded data after a call to PrepareDecodedData().

Returns
true if successful.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ ReleaseDecodedData()

virtual Bool Murl::IVideoStream::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.

Referenced by ~IVideoStream().

◆ GetDecodedTimeOffset()

virtual Double Murl::IVideoStream::GetDecodedTimeOffset ( ) const
pure virtual

Get the time offset of the recently decoded data buffer.

Returns
The time offset in seconds.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetDecodedFrameIndex()

virtual UInt64 Murl::IVideoStream::GetDecodedFrameIndex ( ) const
pure virtual

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

Returns
The frame index.

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetDecodedData()

virtual const ConstData& Murl::IVideoStream::GetDecodedData ( UInt32  mipLevel,
UInt32  planeIndex 
)
pure virtual

Get the decoded data.

PrepareDecodedData() has to be called before, see also FinishDecodedData().

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ GetDecodedSurface()

virtual const IVideoSurface* Murl::IVideoStream::GetDecodedSurface ( UInt32  mipLevel,
UInt32  planeIndex 
)
pure virtual

Get the decoded surface.

PrepareDecodedData() has to be called before, see also FinishDecodedData().

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ LockDecodedData()

virtual const MutableData& Murl::IVideoStream::LockDecodedData ( UInt32  mipLevel,
UInt32  planeIndex 
)
pure virtual

Lock the decoded data.

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ LockDecodedSurface()

virtual IVideoSurface* Murl::IVideoStream::LockDecodedSurface ( UInt32  mipLevel,
UInt32  planeIndex 
)
pure virtual

Lock the decoded surface.

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ UnlockDecodedData()

virtual Bool Murl::IVideoStream::UnlockDecodedData ( UInt32  mipLevel,
UInt32  planeIndex 
)
pure virtual

Unlock the decoded data.

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().

◆ UnlockDecodedSurface()

virtual Bool Murl::IVideoStream::UnlockDecodedSurface ( UInt32  mipLevel,
UInt32  planeIndex 
)
pure virtual

Unlock the decoded surface.

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

Implemented in Murl::Util::VideoStream.

Referenced by ~IVideoStream().


The documentation for this interface was generated from the following file:
  • murl_i_video_stream.h


Copyright © 2011-2018 Spraylight GmbH.