-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All the reverse-engineering work comes from AntonioND [1]. A new video backend API has been added to grab video images. By default, a dummy backend is provided. However, an OpenCV based backend is also provided (if enabled at compile-time with OPENCV=1). Other implementation should be possible (GStreamer for instance ?) in the future. With the OpenCV backend, the video device selection can be done using the Core parameter: [Core] GbCameraVideoDevice=<my_device> Where <my_device> can be either an integer which represent the device number (0 for default) or a string which specify the video device path. Tested with 64DD Mario Talent Studio (Japan), a transfer pak plugged in the first controller with a Japanese GameBoy camera. Also since the core currently requires a cart ROM (even if should strictly be required) I used Perfect Dark (Japan) to allow using the Transfer Pak. This is a core/ui limitation not related to this PR. [1] https://github.com/AntonioND/gbcam-rev-engineer
- Loading branch information
Showing
15 changed files
with
812 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* Mupen64plus - video_backend.h * | ||
* Mupen64Plus homepage: https://mupen64plus.org/ * | ||
* Copyright (C) 2017 Bobby Smiles * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program 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. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, write to the * | ||
* Free Software Foundation, Inc., * | ||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
|
||
#ifndef M64P_BACKENDS_API_VIDEO_BACKEND_H | ||
#define M64P_BACKENDS_API_VIDEO_BACKEND_H | ||
|
||
#include "api/m64p_types.h" | ||
|
||
struct video_input_backend_interface | ||
{ | ||
/* Open a video stream with following properties (width, height) | ||
* Returns M64ERR_SUCCESS on success. | ||
*/ | ||
m64p_error (*open)(void* vin, unsigned int width, unsigned int height); | ||
|
||
/* Close a previsouly opened video stream. | ||
*/ | ||
void (*close)(void* vin); | ||
|
||
/* Grab a BGR image on an open stream | ||
* Returns M64ERR_SUCCESS on success. | ||
*/ | ||
m64p_error (*grab_image)(void* vin, void* data); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* Mupen64plus - dummy_video_backend.c * | ||
* Mupen64Plus homepage: https://mupen64plus.org/ * | ||
* Copyright (C) 2018 Bobby Smiles * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program 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. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, write to the * | ||
* Free Software Foundation, Inc., * | ||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
|
||
#include "backends/dummy_video_backend.h" | ||
#include "backends/api/video_backend.h" | ||
|
||
#include "api/m64p_types.h" | ||
|
||
static m64p_error dummy_video_open(void* vin, unsigned int width, unsigned int height) | ||
{ | ||
return M64ERR_SUCCESS; | ||
} | ||
|
||
static void dummy_video_close(void* vin) | ||
{ | ||
} | ||
|
||
static m64p_error dummy_grab_image(void* vin, void* data) | ||
{ | ||
return M64ERR_UNSUPPORTED; | ||
} | ||
|
||
const struct video_input_backend_interface g_idummy_video_input_backend = | ||
{ | ||
dummy_video_open, | ||
dummy_video_close, | ||
dummy_grab_image | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* Mupen64plus - dummy_video_backend.h * | ||
* Mupen64Plus homepage: https://mupen64plus.org/ * | ||
* Copyright (C) 2018 Bobby Smiles * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program 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. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, write to the * | ||
* Free Software Foundation, Inc., * | ||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
|
||
#ifndef M64P_BACKENDS_DUMMY_VIDEO_BACKEND_H | ||
#define M64P_BACKENDS_DUMMY_VIDEO_BACKEND_H | ||
|
||
#include "api/video_backend.h" | ||
|
||
extern const struct video_input_backend_interface g_idummy_video_input_backend; | ||
|
||
#endif |
Oops, something went wrong.