RetroArch
camera_driver.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2010-2014 - Hans-Kristian Arntzen
3  * Copyright (C) 2011-2017 - Daniel De Matteis
4  *
5  * RetroArch is free software: you can redistribute it and/or modify it under the terms
6  * of the GNU General Public License as published by the Free Software Found-
7  * ation, either version 3 of the License, or (at your option) any later version.
8  *
9  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  * PURPOSE. See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along with RetroArch.
14  * If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef __CAMERA_DRIVER__H
18 #define __CAMERA_DRIVER__H
19 
20 #include <stdint.h>
21 
22 #include <boolean.h>
23 #include <retro_common_api.h>
24 #include <libretro.h>
25 
27 
29 {
44 };
45 
46 typedef struct camera_driver
47 {
48  /* FIXME: params for initialization - queries for resolution,
49  * framerate, color format which might or might not be honored. */
50  void *(*init)(const char *device, uint64_t buffer_types,
51  unsigned width, unsigned height);
52 
53  void (*free)(void *data);
54 
55  bool (*start)(void *data);
56  void (*stop)(void *data);
57 
58  /* Polls the camera driver.
59  * Will call the appropriate callback if a new frame is ready.
60  * Returns true if a new frame was handled. */
61  bool (*poll)(void *data,
64 
65  const char *ident;
67 
73 
83 const char* config_get_camera_driver_options(void);
84 
92 const void *camera_driver_find_handle(int index);
93 
101 const char *camera_driver_find_ident(int index);
102 
103 void driver_camera_stop(void);
104 
105 bool driver_camera_start(void);
106 
107 void camera_driver_poll(void);
108 
110 
112 
113 #endif
camera_driver_t camera_android
Definition: android.c:197
Definition: camera_driver.h:32
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
camera_driver_t camera_avfoundation
Definition: camera_driver.h:30
GLuint start
Definition: glext.h:6292
void(* stop)(void *data)
Definition: camera_driver.h:56
bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
Definition: camera_driver.c:121
void driver_camera_stop(void)
Definition: camera_driver.c:100
bool(* poll)(void *data, retro_camera_frame_raw_framebuffer_t frame_raw_cb, retro_camera_frame_opengl_texture_t frame_gl_cb)
Definition: camera_driver.h:61
Definition: camera_driver.h:38
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
Definition: ibxm.h:9
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:6303
typedef bool(RETRO_CALLCONV *retro_replace_image_index_t)(unsigned index
Definition: camera_driver.h:39
camera_driver_t camera_rwebcam
Definition: rwebcam.c:60
bool driver_camera_start(void)
Definition: camera_driver.c:105
Definition: camera_driver.h:40
camera_driver_t camera_null
Definition: nullcamera.c:53
const char * camera_driver_find_ident(int index)
Definition: camera_driver.c:78
Definition: camera_driver.h:37
rarch_camera_ctl_state
Definition: camera_driver.h:28
static uint64_t state[MAX_PADS]
Definition: xenon360_input.c:33
Definition: camera_driver.h:34
void(RETRO_CALLCONV * retro_camera_frame_raw_framebuffer_t)(const uint32_t *buffer, unsigned width, unsigned height, size_t pitch)
Definition: libretro.h:1750
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
Definition: camera_driver.h:41
GLuint index
Definition: glext.h:6671
Definition: camera_driver.h:43
const char * config_get_camera_driver_options(void)
Definition: camera_driver.c:95
void(* free)(void *data)
Definition: camera_driver.h:53
const void * camera_driver_find_handle(int index)
Definition: camera_driver.c:63
GLint GLint GLsizei width
Definition: glext.h:6293
Definition: camera_driver.h:46
struct camera_driver camera_driver_t
Definition: camera_driver.h:42
camera_driver_t camera_v4l2
Definition: video4linux2.c:414
const char * ident
Definition: camera_driver.h:65
void camera_driver_poll(void)
Definition: camera_driver.c:110
Definition: camera_driver.h:31
Definition: camera_driver.h:33
Definition: camera_driver.h:36
struct nk_device device
Definition: nk_common.c:44
unsigned __int64 uint64_t
Definition: stdint.h:136
void(RETRO_CALLCONV * retro_camera_frame_opengl_texture_t)(unsigned texture_id, unsigned texture_target, const float *affine)
Definition: libretro.h:1771
GLint GLint GLsizei GLsizei height
Definition: glext.h:6293
Definition: camera_driver.h:35