Commit ab3223a8 authored by Martin Pulec's avatar Martin Pulec
Browse files

UltraGrid plugin: added a test driver

parent 4564986a
#ifdef _WIN32
#include <windows.h>
#include <io.h>
#include <signal.h>
#define usleep(us) Sleep(us / 1000)
#else
#include <unistd.h>
#endif
#include <cstdio>
#include <vector>
#include "ultragrid.h"
#define WIDTH 5120
#define HEIGHT 1440
#define FPS 30
using std::vector;
bool should_exit = false;
static void signal_handler(int signal) {
char msg[] = "Signal caught... Exiting\n";
write(2, msg, sizeof msg - 1);
should_exit = true;
}
int main() {
vector <unsigned char> buffer(WIDTH * HEIGHT / 2 * 3, 0xff);
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
while (!should_exit) {
cesnet_set_render_buffer_yuv_i420(buffer.data(), buffer.data() + WIDTH * HEIGHT, buffer.data() + WIDTH * HEIGHT / 4, WIDTH, HEIGHT);
usleep(1000L * 1000 / FPS);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment