Don't pass in the driver context to `camera_driver::device_list_new`
- Unlike some other drivers, the camera driver is only initialized when a core actually asks for it - Therefore, the driver context isn't available when it's time to ask for devices - I could refactor the camera driver to be created earlier, but then I'd need to refactor the other drivers as well - That'll come later in another PR
This commit is contained in:
parent
3c73b36cca
commit
ce1f31af8d
|
@ -34,8 +34,8 @@ static bool nullcamera_start(void *data) { return true; }
|
|||
static bool nullcamera_poll(void *a,
|
||||
retro_camera_frame_raw_framebuffer_t b,
|
||||
retro_camera_frame_opengl_texture_t c) { return true; }
|
||||
static struct string_list *nullcamera_device_list_new(const void *data) { return NULL; }
|
||||
static void nullcamera_device_list_free(const void *data, struct string_list *devices) {}
|
||||
static struct string_list *nullcamera_device_list_new() { return NULL; }
|
||||
static void nullcamera_device_list_free(struct string_list *devices) {}
|
||||
|
||||
static camera_driver_t camera_null = {
|
||||
nullcamera_init,
|
||||
|
|
|
@ -49,8 +49,8 @@ typedef struct camera_driver
|
|||
retro_camera_frame_raw_framebuffer_t frame_raw_cb,
|
||||
retro_camera_frame_opengl_texture_t frame_gl_cb);
|
||||
|
||||
struct string_list *(*device_list_new)(const void *driver_context);
|
||||
void (*device_list_free)(const void *driver_context, struct string_list *devices);
|
||||
struct string_list *(*device_list_new)(void);
|
||||
void (*device_list_free)(struct string_list *devices);
|
||||
|
||||
const char *ident;
|
||||
} camera_driver_t;
|
||||
|
|
|
@ -500,7 +500,7 @@ static bool ffmpeg_camera_poll(
|
|||
return true;
|
||||
}
|
||||
|
||||
static struct string_list *ffmpeg_camera_device_list_new(const void *driver_context)
|
||||
static struct string_list *ffmpeg_camera_device_list_new(void)
|
||||
{
|
||||
const AVInputFormat *input = NULL;
|
||||
struct string_list *list = string_list_new();
|
||||
|
@ -517,7 +517,7 @@ static struct string_list *ffmpeg_camera_device_list_new(const void *driver_cont
|
|||
return list;
|
||||
}
|
||||
|
||||
static void ffmpeg_camera_device_list_free(const void *driver_context, struct string_list *devices)
|
||||
static void ffmpeg_camera_device_list_free(struct string_list *devices)
|
||||
{
|
||||
struct string_list *sl = (struct string_list*)devices;
|
||||
|
||||
|
|
Loading…
Reference in New Issue