RetroArch
record_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 #ifndef __RECORD_DRIVER_H
17 #define __RECORD_DRIVER_H
18 
19 #include <stdint.h>
20 #include <stddef.h>
21 
22 #include <boolean.h>
23 #include <retro_common_api.h>
24 
26 
28 {
32 };
33 
35 {
40 };
41 
43 {
57 
58 };
59 
60 /* Parameters passed to ffemu_new() */
62 {
63  /* Framerate per second of input video. */
64  double fps;
65  /* Sample rate of input audio. */
66  double samplerate;
67 
68  /* Desired output resolution. */
69  unsigned out_width;
70  unsigned out_height;
71 
72  /* Total size of framebuffer used in input. */
73  unsigned fb_width;
74  unsigned fb_height;
75 
76  /* Aspect ratio of input video. Parameters are passed to the muxer,
77  * the video itself is not scaled.
78  */
79  float aspect_ratio;
80 
81  /* Audio channels. */
82  unsigned channels;
83 
85 
86  /* Input pixel format. */
88 
89  /* Filename to dump to. */
90  const char *filename;
91 
92  /* Path to config. Optional. */
93  const char *config;
94 };
95 
97 {
98  const void *data;
99  unsigned width;
100  unsigned height;
101  int pitch;
102  bool is_dupe;
103 };
104 
106 {
107  const void *data;
108  size_t frames;
109 };
110 
111 typedef struct record_driver
112 {
113  void *(*init)(const struct record_params *params);
114  void (*free)(void *data);
115  bool (*push_video)(void *data, const struct record_video_data *video_data);
116  bool (*push_audio)(void *data, const struct record_audio_data *audio_data);
117  bool (*finalize)(void *data);
118  const char *ident;
120 
121 extern const record_driver_t record_ffmpeg;
122 extern const record_driver_t record_null;
123 
131 const char* config_get_record_driver_options(void);
132 
142 const record_driver_t *ffemu_find_backend(const char *ident);
143 
151 const void *record_driver_find_handle(int idx);
152 
160 const char *record_driver_find_ident(int idx);
161 
173  const struct record_params *params);
174 
175 void recording_dump_frame(const void *data, unsigned width,
176  unsigned height, size_t pitch, bool is_idle);
177 
178 bool recording_deinit(void);
179 
180 void find_record_driver(void);
181 
189 bool recording_init(void);
190 
191 bool recording_is_enabled(void);
192 
193 void recording_set_state(bool state);
194 
195 void streaming_set_state(bool state);
196 
197 void recording_push_audio(const int16_t *data, size_t samples);
198 
200 
202 
204 
205 unsigned *recording_driver_get_width(void);
206 
207 unsigned *recording_driver_get_height(void);
208 
209 void recording_driver_free_state(void);
210 
211 bool recording_is_enabled(void);
212 
213 bool streaming_is_enabled(void);
214 
216 
217 extern void *recording_data;
218 
220 
221 #endif
GLsizei samples
Definition: glext.h:7673
record_config_type
Definition: record_driver.h:42
Definition: record_driver.h:54
unsigned * recording_driver_get_width(void)
Definition: record_driver.c:527
Definition: record_driver.h:44
Definition: record_driver.h:47
bool streaming_is_enabled(void)
Definition: record_driver.c:293
unsigned fb_width
Definition: record_driver.h:73
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
const void * data
Definition: record_driver.h:107
unsigned height
Definition: record_driver.h:100
Definition: record_driver.h:39
GLenum const GLfloat * params
Definition: glext.h:6297
bool is_dupe
Definition: record_driver.h:102
void recording_dump_frame(const void *data, unsigned width, unsigned height, size_t pitch, bool is_idle)
Definition: record_driver.c:189
bool(* push_audio)(void *data, const struct record_audio_data *audio_data)
Definition: record_driver.h:116
void(* free)(void *data)
Definition: record_driver.h:114
Definition: record_driver.h:31
const void * data
Definition: record_driver.h:98
Definition: record_driver.h:56
streaming_mode
Definition: record_driver.h:34
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
int pitch
Definition: record_driver.h:101
const char * config
Definition: record_driver.h:93
const record_driver_t record_ffmpeg
Definition: record_ffmpeg.c:1682
Definition: ibxm.h:9
const record_driver_t record_null
Definition: record_null.c:56
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:6303
bool(* finalize)(void *data)
Definition: record_driver.h:117
const void * record_driver_find_handle(int idx)
Definition: record_driver.c:80
unsigned fb_height
Definition: record_driver.h:74
typedef bool(RETRO_CALLCONV *retro_replace_image_index_t)(unsigned index
void recording_driver_free_state(void)
Definition: record_driver.c:586
const char * record_driver_find_ident(int idx)
Definition: record_driver.c:65
Definition: record_driver.h:38
enum record_config_type preset
Definition: record_driver.h:84
Definition: record_driver.h:49
void find_record_driver(void)
Definition: record_driver.c:100
Definition: record_driver.h:51
enum ffemu_pix_format pix_fmt
Definition: record_driver.h:87
double fps
Definition: record_driver.h:64
const char * ident
Definition: record_driver.h:118
unsigned channels
Definition: record_driver.h:82
ffemu_pix_format
Definition: record_driver.h:27
Definition: record_driver.h:96
string backend
Definition: test_shaders.py:19
signed short int16_t
Definition: stdint.h:122
const char * filename
Definition: record_driver.h:90
static uint64_t state[MAX_PADS]
Definition: xenon360_input.c:33
void recording_push_audio(const int16_t *data, size_t samples)
Definition: record_driver.c:303
void recording_driver_update_streaming_url(void)
Definition: record_driver.c:537
float aspect_ratio
Definition: record_driver.h:79
Definition: record_driver.h:46
Definition: record_driver.h:111
Definition: record_driver.h:36
bool record_driver_init_first(const record_driver_t **backend, void **data, const struct record_params *params)
Definition: record_driver.c:169
Definition: record_driver.h:61
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 idx
Definition: pixman-arm-neon-asm.h:96
const char * config_get_record_driver_options(void)
Definition: record_driver.c:95
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
unsigned out_width
Definition: record_driver.h:69
size_t frames
Definition: record_driver.h:108
bool(* push_video)(void *data, const struct record_video_data *video_data)
Definition: record_driver.h:115
Definition: record_driver.h:29
unsigned * recording_driver_get_height(void)
Definition: record_driver.c:532
void streaming_set_state(bool state)
Definition: record_driver.c:298
Definition: record_driver.h:105
const record_driver_t * ffemu_find_backend(const char *ident)
Definition: record_driver.c:145
double samplerate
Definition: record_driver.h:66
unsigned out_height
Definition: record_driver.h:70
struct record_driver record_driver_t
GLint GLint GLsizei width
Definition: glext.h:6293
void * recording_driver_get_data_ptr(void)
Definition: record_driver.c:512
Definition: record_driver.h:53
Definition: record_driver.h:55
bool recording_is_enabled(void)
Definition: record_driver.c:283
void recording_driver_clear_data_ptr(void)
Definition: record_driver.c:517
Definition: record_driver.h:37
void recording_set_state(bool state)
Definition: record_driver.c:288
unsigned width
Definition: record_driver.h:99
Definition: record_driver.h:30
bool recording_init(void)
Definition: record_driver.c:321
Definition: record_driver.h:52
bool recording_deinit(void)
Definition: record_driver.c:264
void * recording_data
Definition: record_driver.c:56
Definition: record_driver.h:45
GLint GLint GLsizei GLsizei height
Definition: glext.h:6293
void recording_driver_set_data_ptr(void *data)
Definition: record_driver.c:522
Definition: record_driver.h:48