DS Core: Add video recording

This commit is contained in:
Vicki Pfau 2017-03-04 12:54:39 -08:00
parent 928896f978
commit 2da8c63ec2
3 changed files with 13 additions and 0 deletions

View File

@ -111,6 +111,7 @@ struct DS {
struct VFile* bios9Vf;
struct VFile* firmwareVf;
struct mAVStream* stream;
struct mKeyCallback* keyCallback;
struct mCoreCallbacks* coreCallbacks;

View File

@ -162,6 +162,11 @@ static void _DSCoreSetCoreCallbacks(struct mCore* core, struct mCoreCallbacks* c
}
static void _DSCoreSetAVStream(struct mCore* core, struct mAVStream* stream) {
struct DS* ds = core->board;
ds->stream = stream;
if (stream && stream->videoDimensionsChanged) {
stream->videoDimensionsChanged(stream, DS_VIDEO_HORIZONTAL_PIXELS, DS_VIDEO_VERTICAL_PIXELS * 2);
}
}
static bool _DSCoreLoadROM(struct mCore* core, struct VFile* vf) {

View File

@ -835,4 +835,11 @@ void DSFrameEnded(struct DS* ds) {
if (callbacks && callbacks->videoFrameEnded) {
callbacks->videoFrameEnded(callbacks->context);
}
if (ds->stream && ds->stream->postVideoFrame) {
const color_t* pixels;
size_t stride;
ds->video.renderer->getPixels(ds->video.renderer, &stride, (const void**) &pixels);
ds->stream->postVideoFrame(ds->stream, pixels, stride);
}
}