5 #include <mfreadwrite.h>
11 #define MAXVideoURLLenght 256
15 #define VFL_NO_FILE_URL_SET 1
16 #define VFL_URL_TO_LONG 2
17 #define VFL_PATH_TO_LONG 3
18 #define VFL_NO_VIDEO_SOURCE 4
19 #define VFL_VIDEO_ATTRIBUTES_NOT_SET 5
20 #define VFL_VIDEO_BUFFER_IS_NULL 6
21 #define VFL_COULD_NOT_CONVERT_PATH_TO_URL 25
22 #define VFL_COULD_NOT_READ_SOURCE_FILE 26
23 #define VFL_COULD_NOT_DECODE_FILE 27
24 #define VFL_COULD_NOT_GET_MEDIA_TYPE 28
25 #define VFL_COULD_NOT_GET_MEDIA_ATTRIBUTES 29
26 #define VFL_COULD_NOT_READ_ANY_FRAMES 30
27 #define VFL_NO_MORE_FRAMES 31
107 VFLResult loadAllFramesIntoBuffer(
int offset,
int distanceBetween);
121 VFLResult loadAllFramesIntoBuffer(
int offset,
int distanceBetween,
int lastFrame);
142 VFLResult addNextFrameToBuffer(
int distanceFromLast);
152 VFLResult getVideoResolution(
int *width,
int *height);
167 VFLResult getVideoBuffer(PBYTE *videoArray);
177 VFLResult getBufferFrameCount(
int *frameCount);
194 HRESULT setPosition(
const LONGLONG& hnsPosition);
217 void copyVideoListToVideoArray();
220 IMFSourceReader *p_videoReader;
222 int m_totalFrameCount;
223 UINT32 m_videoWidth, m_videoHeight;
224 bool m_videoBufferTransfered;
225 bool m_comInitialisationSuccessful;
226 bool m_mediaFoundationInitalisationSuccessful;
228 list<PBYTE, allocator<PBYTE>> *p_videoList;
230 void initializeFrameLoader();
231 VFLResult setVideoPath(PWSTR filePath,
bool reset);
232 VFLResult setVideoURL(PWSTR fileURL,
bool reset);
234 HRESULT configureDecoder(IMFSourceReader *pReader);
235 VFLResult copyFrameToBuffer(IMFSample *pSample);
236 void SafeRelease(IUnknown **ppT);