This repository has been archived by the owner on Sep 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
yeti.h
61 lines (51 loc) · 1.64 KB
/
yeti.h
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
#pragma once
#include <malloc.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <vfw.h>
#include <malloc.h>
#include <stdio.h>
#include <assert.h>
#include "resource.h"
inline void* ALIGNED_MALLOC (void* ptr, size_t size, int align, char* str)
{
if(ptr)
{
#ifdef _DEBUG
char msg[128];
sprintf_s(msg, 128, "Buffer '%s' is not null, attempting to free it...", str);
MessageBox(HWND_DESKTOP, msg, "Error", MB_OK | MB_ICONEXCLAMATION);
#endif
_aligned_free(ptr);
}
return _aligned_malloc(size, align);
}
#define ALIGNED_FREE(ptr, str) { \
if (ptr){ \
try {\
_aligned_free((void*)ptr);\
} catch ( ... ){ } \
} \
ptr = NULL;\
}
static const DWORD FOURCC_YETI = mmioFOURCC('Y','E','T','I');
static const DWORD FOURCC_YUY2 = mmioFOURCC('Y','U','Y','2');
static const DWORD FOURCC_UYVY = mmioFOURCC('U','Y','V','Y');
static const DWORD FOURCC_YV16 = mmioFOURCC('Y','V','1','6');
static const DWORD FOURCC_YV12 = mmioFOURCC('Y','V','1','2');
static const char SettingsFile[] = "yeti.ini";
static const char SettingsHeading[] = "settings";
// possible frame flags
#define DELTAFRAME (BYTE)0x0
#define KEYFRAME (BYTE)0x1
#define YUY2_FRAME (BYTE)0x00
#define YUY2_DELTAFRAME (YUY2_FRAME | DELTAFRAME)
#define YUY2_KEYFRAME (YUY2_FRAME | KEYFRAME)
#define YV12_FRAME (BYTE)0x10
#define YV12_DELTAFRAME (YV12_FRAME | DELTAFRAME)
#define YV12_KEYFRAME (YV12_FRAME | KEYFRAME)
// possible colorspaces
#define RGB24 24
#define RGB32 32
#define YUY2 16
#define YV12 12