VideoVis  0.9
Generates a volume visualisation of a video
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
CVideoFrameToTextureLoader Class Reference

This class loads video files and save them into a 3D texture. More...

#include <VideoFrameToTextureLoader.h>

Inheritance diagram for CVideoFrameToTextureLoader:
CVideoFrameLoader

Public Member Functions

 CVideoFrameToTextureLoader ()
 This is the default constructor. More...
 
 CVideoFrameToTextureLoader (PWSTR filePath)
 Constructor to load a file. More...
 
 ~CVideoFrameToTextureLoader (void)
 Destructor. More...
 
VFLResult loadAllFramesIntoTexture ()
 Loads all video frames of the opend video file and transfers it into the bound texture. More...
 
VFLResult loadAllFramesIntoTexture (int offset, int distanceBetween)
 Loads all video frames with offset and distance between and transfers it into the bound texture. More...
 
VFLResult loadAllFramesIntoTexture (int offset, int distanceBetween, int lastFrame)
 Loads all video frames with offset, distance between and sets a last frame and transfers it into the bound texture. More...
 
VFLResult transferVideoBufferToTexture ()
 Transfers the video buffer byte array into a previously bound texture. More...
 
- Public Member Functions inherited from CVideoFrameLoader
 CVideoFrameLoader (void)
 This is the default constructor. More...
 
 CVideoFrameLoader (PWSTR filePath)
 Constructor to load a file. More...
 
 ~CVideoFrameLoader (void)
 Destructor. More...
 
VFLResult setVideoPath (PWSTR filePath)
 Opens a new videofile. More...
 
VFLResult setVideoURL (PWSTR fileURL)
 Opens a new videofile. More...
 
VFLResult loadAllFramesIntoBuffer ()
 Loads all video frames of the opend video file. More...
 
VFLResult loadAllFramesIntoBuffer (int offset, int distanceBetween)
 Loads all video frames with offset and distance between. More...
 
VFLResult loadAllFramesIntoBuffer (int offset, int distanceBetween, int lastFrame)
 Loads all video frames with offset, distance between and sets a last frame. More...
 
VFLResult addNextFrameToBuffer ()
 Adds the next frame at the current video file position. More...
 
VFLResult addNextFrameToBuffer (int distanceFromLast)
 Adds the next frame at an offset from the current video file position. More...
 
VFLResult getVideoResolution (int *width, int *height)
 Returns the resolution of the current loaded video file. More...
 
VFLResult getVideoBuffer (PBYTE *videoArray)
 Returns the BYTE-Array in which the video data is stored. More...
 
VFLResult getBufferFrameCount (int *frameCount)
 Returns the number of fames that have been saved to the byte array. More...
 
void reset ()
 Resets the "play head" to the starting position. More...
 
HRESULT setPosition (const LONGLONG &hnsPosition)
 Sets the position of the "play head" to a new time code. More...
 

Protected Member Functions

virtual VFLResult resetProperties ()
 Completly resets the object. More...
 
- Protected Member Functions inherited from CVideoFrameLoader
void copyVideoListToVideoArray ()
 Copies the video data from the internal storage into the video array. More...
 

Protected Attributes

PFNGLTEXIMAGE3DPROC glTexImage3D
 
- Protected Attributes inherited from CVideoFrameLoader
PBYTE p_videoArray
 

Detailed Description

This class loads video files and save them into a 3D texture.

This class can load video files into a BYTE-Array and transfer this array into a 3D texture. It is derived from the CVideoFrameLoader class. It uses the windows media foundation framework and should work under Windows 7, 8 and later. It can load all frames of a video file, all frames after an offset or single frames with a given distance to the last loaded frame.

Definition at line 16 of file VideoFrameToTextureLoader.h.

Constructor & Destructor Documentation

CVideoFrameToTextureLoader::CVideoFrameToTextureLoader ( )

This is the default constructor.

It simple initialises the object. To open a video file you can use the other constructor, the setVideoPath(PWSTR filePath) method or the setVideoURL(PWSTR fileURL) method.

See Also
CVideoFrameToTextureLoader(PWSTR filePath), setVideoPath(PWSTR filePath), setVideoURL(PWSTR fileURL)

Definition at line 3 of file VideoFrameToTextureLoader.cpp.

CVideoFrameToTextureLoader::CVideoFrameToTextureLoader ( PWSTR  filePath)

Constructor to load a file.

Initialises the object and loads the specified file.

Parameters
filePatha pointer to a WSTR which contains the path to the video file in windows syntax
See Also
CVideoFrameToTextureLoader(), setVideoPath(PWSTR filePath), setVideoURL(PWSTR fileURL)

Definition at line 8 of file VideoFrameToTextureLoader.cpp.

CVideoFrameToTextureLoader::~CVideoFrameToTextureLoader ( void  )

Destructor.

Cleans up all reserved memory.

Definition at line 13 of file VideoFrameToTextureLoader.cpp.

Member Function Documentation

VFLResult CVideoFrameToTextureLoader::loadAllFramesIntoTexture ( )

Loads all video frames of the opend video file and transfers it into the bound texture.

The frames will be saved into a BYTE buffer. The buffer is then transfered into a 3D texture. You have to bind an apropriate texture before calling this method.

Returns
returns VFL_NO_MORE_FRAMES if the operation succeded and the video has ended.
See Also
loadAllFramesIntoTexture(int offset, int distanceBetween), loadAllFramesIntoTexture(int offset, int distanceBetween, int lastFrame)
setVideoPath(PWSTR filePath), setVideoURL(PWSTR fileURL), CVideoFrameToTextureLoader(PWSTR filePath)
transferVideoBufferToTexture()

Definition at line 18 of file VideoFrameToTextureLoader.cpp.

VFLResult CVideoFrameToTextureLoader::loadAllFramesIntoTexture ( int  offset,
int  distanceBetween 
)

Loads all video frames with offset and distance between and transfers it into the bound texture.

The frames will be saved into a BYTE buffer. The buffer is then transfered into a 3D texture. You have to bind an apropriate texture before calling this method.

Parameters
offsetan integer value starting by 0 that specifies the offset of frames from the start of the video
distanceBetweenan integer value the specifies the number of frames between to frames, that are left out
Returns
returns VFL_NO_MORE_FRAMES if the operation succeded and the video has ended.
See Also
loadAllFramesIntoTexture(), loadAllFramesIntoTexture(int offset, int distanceBetween, int lastFrame)
setVideoPath(PWSTR filePath), setVideoURL(PWSTR fileURL), CVideoFrameToTextureLoader(PWSTR filePath)
transferVideoBufferToTexture()

Definition at line 23 of file VideoFrameToTextureLoader.cpp.

VFLResult CVideoFrameToTextureLoader::loadAllFramesIntoTexture ( int  offset,
int  distanceBetween,
int  lastFrame 
)

Loads all video frames with offset, distance between and sets a last frame and transfers it into the bound texture.

The frames will be saved into a BYTE buffer. The buffer is then transfered into a 3D texture. You have to bind an apropriate texture before calling this method.

Parameters
offsetan integer value starting by 0 that specifies the offset of frames from the start of the video
distanceBetweenan integer value the specifies the number of frames between to frames, that are left out
lastFramean inteber value specifying the last frame that should be read; if 0 the method reads till the last frame of the video file
Returns
returns VFL_OK if the operation succeded or VFL_NO_MORE_FRAMES if the operation succeded and the video has ended
See Also
loadAllFramesIntoTexture(), loadAllFramesIntoTexture(int offset, int distanceBetween)
setVideoPath(PWSTR filePath), setVideoURL(PWSTR fileURL), CVideoFrameToTextureLoader(PWSTR filePath)
transferVideoBufferToTexture()

Definition at line 28 of file VideoFrameToTextureLoader.cpp.

VFLResult CVideoFrameToTextureLoader::resetProperties ( )
protectedvirtual

Completly resets the object.

This virtual method is called to reset the reset all neccessary member properties bevor a new video file is loaded. Overwrite this method to reset your own properties before a new video file is loaded, if you derive from this class.

Returns
returns VFL_OK;
See Also
reset()
setVideoPath(PWSTR filePath), setVideoURL(PWSTR fileURL), CVideoFrameLoader(PWSTR filePath)

Reimplemented from CVideoFrameLoader.

Definition at line 79 of file VideoFrameToTextureLoader.cpp.

VFLResult CVideoFrameToTextureLoader::transferVideoBufferToTexture ( )

Transfers the video buffer byte array into a previously bound texture.

The video array is transfered into a 3D texture. You have to bind an apropriate texture before calling this method.

Returns
returns VFL_OK if the operation succeeded
See Also
loadAllFramesIntoBuffer(), loadAllFramesIntoBuffer(int offset, int distanceBetween), loadAllFramesIntoBuffer(int offset, int distanceBetween, int lastFrame)
addNextFrameToBuffer(), addNextFrameToBuffer(int distanceFromLast)

Definition at line 61 of file VideoFrameToTextureLoader.cpp.

Member Data Documentation

PFNGLTEXIMAGE3DPROC CVideoFrameToTextureLoader::glTexImage3D
protected

Definition at line 94 of file VideoFrameToTextureLoader.h.


The documentation for this class was generated from the following files: