2012-04-21 23:13:50 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2011-12-24 13:46:12 +01:00
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2011-12-24 13:46:12 +01:00
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2011-12-24 13:46:12 +01:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 23:31:57 +02:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2011-12-24 13:46:12 +01:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-05-04 11:47:55 +02:00
|
|
|
#include "ffemu.h"
|
|
|
|
#include <string.h>
|
2011-12-25 12:47:47 +01:00
|
|
|
|
2014-04-01 00:09:18 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-05-04 11:47:55 +02:00
|
|
|
static const ffemu_backend_t *ffemu_backends[] = {
|
|
|
|
#ifdef HAVE_FFMPEG
|
|
|
|
&ffemu_ffmpeg,
|
2012-09-02 23:49:30 +02:00
|
|
|
#endif
|
2014-05-04 11:47:55 +02:00
|
|
|
NULL,
|
2011-12-25 16:11:48 +01:00
|
|
|
};
|
2011-01-03 17:51:17 +01:00
|
|
|
|
2014-05-04 11:47:55 +02:00
|
|
|
const ffemu_backend_t *ffemu_find_backend(const char *ident)
|
2012-11-28 15:38:43 +01:00
|
|
|
{
|
2013-10-22 21:26:33 +02:00
|
|
|
unsigned i;
|
2014-05-04 11:47:55 +02:00
|
|
|
for (i = 0; ffemu_backends[i]; i++)
|
2012-11-23 22:46:21 +01:00
|
|
|
{
|
2014-05-04 11:47:55 +02:00
|
|
|
if (!strcmp(ffemu_backends[i]->ident, ident))
|
|
|
|
return ffemu_backends[i];
|
2012-11-26 17:37:31 +01:00
|
|
|
}
|
2012-11-23 22:46:21 +01:00
|
|
|
|
2011-01-03 17:51:17 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-08-20 17:18:43 +02:00
|
|
|
bool ffemu_init_first(const ffemu_backend_t **backend, void **data,
|
|
|
|
const struct ffemu_params *params)
|
2011-01-03 17:51:17 +01:00
|
|
|
{
|
2014-05-04 11:47:55 +02:00
|
|
|
unsigned i;
|
|
|
|
for (i = 0; ffemu_backends[i]; i++)
|
2011-06-14 21:35:31 +02:00
|
|
|
{
|
2014-05-04 11:47:55 +02:00
|
|
|
void *handle = ffemu_backends[i]->init(params);
|
|
|
|
if (handle)
|
2011-06-14 21:35:31 +02:00
|
|
|
{
|
2014-05-04 11:47:55 +02:00
|
|
|
*backend = ffemu_backends[i];
|
|
|
|
*data = handle;
|
|
|
|
return true;
|
2011-06-14 21:35:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-04 11:47:55 +02:00
|
|
|
return false;
|
2011-06-14 21:35:31 +02:00
|
|
|
}
|
2011-10-06 20:31:39 +02:00
|
|
|
|