-
Notifications
You must be signed in to change notification settings - Fork 1
/
cop_utility.h
46 lines (38 loc) · 1.28 KB
/
cop_utility.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
#ifndef COP_UTILITY_H
#define COP_UTILITY_H
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdbool.h> // bool
#include <string.h>
#include <time.h>
#include <sys/statvfs.h> // filesystem
#include <dirent.h> // List files
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswresample/swresample.h>
#include <libswscale/swscale.h>
#include <libavutil/avstring.h>
#include <libavutil/avutil.h>
#include <libavutil/imgutils.h>
#include <libavutil/base64.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_thread.h>
#include "cop_list.h"
// A generic buffer size used for network and strings. Use whenever possible.
#define BUFFER_SIZE 512
void cop_debug(const char* format, ...);
void cop_error(const char* format, ...);
char* get_timestamp();
char* concat(const char *str1, const char *str2);
int str_to_int(char* num);
char* int_to_str(int num);
bool equals(char* str1, char* str2);
int compare(char* str1, char* str2);
bool contains(char* str, char* find);
char* rand_str(size_t length);
unsigned long get_available_space_mb(const char* path);
void house_keeping(char* path, char* prefix);
int decode(AVCodecContext *avctx, AVFrame *frame, AVPacket *pkt, int *got_frame);
int encode(AVCodecContext *avctx, AVFrame *frame, AVPacket *pkt, int *got_frame);
#endif