forked from jnohlgard/python-v4l2capture
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mfvideoout.cpp
75 lines (49 loc) · 1.16 KB
/
mfvideoout.cpp
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "mfvideoout.h"
#include <mfapi.h>
#include <Mferror.h>
//http://msdn.microsoft.com/en-us/library/windows/desktop/ms700134%28v=vs.85%29.aspx
MfVideoOut::MfVideoOut(const char *devName) : Base_Video_Out()
{
HRESULT hr = MFStartup(MF_VERSION);
if(!SUCCEEDED(hr))
throw std::runtime_error("Media foundation startup failed");
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if(hr == RPC_E_CHANGED_MODE)
throw std::runtime_error("CoInitializeEx failed");
}
MfVideoOut::~MfVideoOut()
{
MFShutdown();
CoUninitialize();
}
void MfVideoOut::SendFrame(const char *imgIn, unsigned imgLen, const char *pxFmt, int width, int height)
{
}
void MfVideoOut::Stop()
{
}
int MfVideoOut::WaitForStop()
{
return 1;
}
void MfVideoOut::SetOutputSize(int width, int height)
{
}
void MfVideoOut::SetOutputPxFmt(const char *fmt)
{
}
void MfVideoOut::Run()
{
}
//*******************************************************************************
void *MfVideoOut_Worker_thread(void *arg)
{
class MfVideoOut *argobj = (class MfVideoOut*) arg;
argobj->Run();
return NULL;
}
std::vector<std::string> List_out_devices()
{
std::vector<std::string> out;
return out;
}