-
Notifications
You must be signed in to change notification settings - Fork 0
/
ga-common.h
82 lines (71 loc) · 2.17 KB
/
ga-common.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Copyright (c) 2013 Chun-Ying Huang
* Modification Copyright (c) 2021 me(github.com/am009)
*
* This file is part of GamingAnywhere (GA).
*
* GA is free software; you can redistribute it and/or modify it
* under the terms of the 3-clause BSD License as published by the
* Free Software Foundation: http://directory.fsf.org/wiki/License:BSD_3Clause
*
* GA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the 3-clause BSD License along with GA;
* if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* @file
* header: common GA functions and macros
*/
#ifndef __GA_COMMON_H__
#define __GA_COMMON_H__
//#if defined WIN32 && defined GA_LIB
///** Functions exported from DLL's */
//#define EXPORT __declspec(dllexport)
//#elif defined WIN32 && ! defined GA_LIB
///** Functions imported from DLL's */
//#define EXPORT __declspec(dllimport)
//#else
///** Not used in UNIX-like systems, but required for compatible with WIN32 libraries */
//#define EXPORT
//#endif
#define EXPORT
//#ifdef __cplusplus
//extern "C" {
//#endif
//#include <libavcodec/avcodec.h>
//#ifdef __cplusplus
//}
//#endif
#include "ga-win32.h"
#include <string>
/** Enable audio subsystem? */
#define ENABLE_AUDIO
/** Unit size size for RGBA pixels, in bytes */
#define RGBA_SIZE 4
struct gaRect {
int left, top;
int right, bottom;
int width, height;
int linesize;
int size;
};
struct gaImage {
int width;
int height;
int bytes_per_line;
};
//EXPORT long long tvdiff_us(struct timeval *tv1, struct timeval *tv2);
//EXPORT long long ga_usleep(long long interval, struct timeval *ptv);
//EXPORT int ga_log(const char *fmt, ...);
EXPORT int ga_error(const char *fmt, ...);
//EXPORT int ga_malloc(int size, void **ptr, int *alignment);
//EXPORT int ga_alignment(void *ptr, int alignto);
EXPORT long ga_gettid();
int winsock_init();
char* getCmdOption(char** begin, char** end, const std::string& option);
bool cmdOptionExists(char** begin, char** end, const std::string& option);
#endif