-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathFrameTransformFilter.h
More file actions
52 lines (44 loc) · 1.78 KB
/
Copy pathFrameTransformFilter.h
File metadata and controls
52 lines (44 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// FrameTransformFilter.h - FrameTransformFilter header file
// Written by Ted Burke - last modified 7-3-2012
//
// Copyright Ted Burke, 2011-2012, All rights reserved.
//
// Website: http://batchloaf.wordpress.com
//
#ifndef FRAMETRANSFORMFILTER_H
#define FRAMETRANSFORMFILTER_H
#include <dshow.h>
#include <streams.h>
// I generated the following GUID for this filter using the
// online GUID generator at http://www.guidgen.com/
// {d6ece2e3-72aa-4157-b489-52c3fd693ce9}
DEFINE_GUID(CLSID_FrameTransformFilter,
0xd6ece2e3, 0x72aa, 0x4157, 0xb4, 0x89, 0x52, 0xc3, 0xfd, 0x69, 0x3c, 0xe9);
// My frame transforming filter class
class FrameTransformFilter : public CTransformFilter
{
public:
// Constructor
FrameTransformFilter(int w, int h);
// Provide a function to allow a PGM file copy of the
// next frame to be requested
void saveNextFrameToFile(char *filename);
void setCommand(char *command);
int filesSaved();
// Methods required for filters derived from CTransformFilter
HRESULT CheckInputType(const CMediaType *mtIn);
HRESULT GetMediaType(int iPosition, CMediaType *pMediaType);
HRESULT CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut);
HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pProp);
HRESULT Transform(IMediaSample *pSource, IMediaSample *pDest);
private:
int width; // video frame width in pixels
int height; // video frame height in pixels
int save_frame_to_file; // flag to request saving next frame to PGM file
char filename[200]; // filename to use when saving a capture frame to file
int files_saved; // counter for number of frames saved to PGM files
int run_command; // flag to execute program after each file capture
char command[200]; // command to run after each image file is saved
};
#endif // FRAMETRANSFORMFILTER_H