Commit 6e6e4660 authored by Stefanos Kornilios Mitsis Poiitidis's avatar Stefanos Kornilios Mitsis Poiitidis
Browse files

pipe video to record:rawvid if set

Can be used to stream/record video, like
./reicast.elf -config record:rawvid=>(ffmpeg -f rawvideo -pixel_format rgb24 -video_size 640x480 -i - test.mpg) #(from bash)
parent 115ee47e
......@@ -625,6 +625,17 @@ int screen_height;
void gl_swap()
static FILE* fd = fopen(cfgLoadStr("record", "rawvid","").c_str(), "wb");
if (fd) {
int bytesz = screen_width* screen_height * 3;
u8* img = new u8[bytesz];
glReadPixels(0,0,screen_width,screen_height,GL_RGB, GL_UNSIGNED_BYTE,img);
fwrite(img, 1, bytesz, fd);
glXSwapBuffers((Display*)libPvr_GetRenderSurface(), (GLXDrawable)libPvr_GetRenderTarget());
Window win;
Markdown is supported
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