forked from andre-d/pympv
-
Notifications
You must be signed in to change notification settings - Fork 5
/
client.pxd
365 lines (260 loc) · 10.2 KB
/
client.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# 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 3 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, see <http://www.gnu.org/licenses/>.
cdef extern from "mpv/client.h":
ctypedef signed char int8_t
ctypedef short int16_t
ctypedef int int32_t
ctypedef long int64_t
ctypedef unsigned char uint8_t
ctypedef unsigned short uint16_t
ctypedef unsigned int uint32_t
ctypedef unsigned long uint64_t
ctypedef signed char int_least8_t
ctypedef short int_least16_t
ctypedef int int_least32_t
ctypedef long int_least64_t
ctypedef unsigned char uint_least8_t
ctypedef unsigned short uint_least16_t
ctypedef unsigned int uint_least32_t
ctypedef unsigned long uint_least64_t
ctypedef signed char int_fast8_t
ctypedef long int_fast16_t
ctypedef long int_fast32_t
ctypedef long int_fast64_t
ctypedef unsigned char uint_fast8_t
ctypedef unsigned long uint_fast16_t
ctypedef unsigned long uint_fast32_t
ctypedef unsigned long uint_fast64_t
ctypedef long intptr_t
ctypedef unsigned long uintptr_t
ctypedef long intmax_t
ctypedef unsigned long uintmax_t
unsigned long mpv_client_api_version() nogil
cdef struct mpv_handle:
pass
cdef enum mpv_error:
MPV_ERROR_SUCCESS
MPV_ERROR_EVENT_QUEUE_FULL
MPV_ERROR_NOMEM
MPV_ERROR_UNINITIALIZED
MPV_ERROR_INVALID_PARAMETER
MPV_ERROR_OPTION_NOT_FOUND
MPV_ERROR_OPTION_FORMAT
MPV_ERROR_OPTION_ERROR
MPV_ERROR_PROPERTY_NOT_FOUND
MPV_ERROR_PROPERTY_FORMAT
MPV_ERROR_PROPERTY_UNAVAILABLE
MPV_ERROR_PROPERTY_ERROR
MPV_ERROR_COMMAND
MPV_ERROR_LOADING_FAILED
MPV_ERROR_AO_INIT_FAILED
MPV_ERROR_VO_INIT_FAILED
MPV_ERROR_NOTHING_TO_PLAY
MPV_ERROR_UNKNOWN_FORMAT
MPV_ERROR_UNSUPPORTED
MPV_ERROR_NOT_IMPLEMENTED
const char *mpv_error_string(int error) nogil
void mpv_free(void *data) nogil
const char *mpv_client_name(mpv_handle *ctx) nogil
mpv_handle *mpv_create() nogil
int mpv_initialize(mpv_handle *ctx) nogil
void mpv_terminate_destroy(mpv_handle *ctx) nogil
int mpv_load_config_file(mpv_handle *ctx, const char *filename) nogil
int64_t mpv_get_time_us(mpv_handle *ctx) nogil
cdef enum mpv_format:
MPV_FORMAT_NONE
MPV_FORMAT_STRING
MPV_FORMAT_OSD_STRING
MPV_FORMAT_FLAG
MPV_FORMAT_INT64
MPV_FORMAT_DOUBLE
MPV_FORMAT_NODE
MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_NODE_MAP
cdef struct ____mpv_node_u_mpv_node_list:
pass
ctypedef ____mpv_node_u_mpv_node_list ____mpv_node_u_mpv_node_list_t
cdef union __mpv_node_u:
char *string
int flag
int64_t int64
double double_
mpv_node_list *list
ctypedef __mpv_node_u __mpv_node_u_t
cdef struct mpv_node:
__mpv_node_u_t u
mpv_format format
cdef struct mpv_node_list:
int num
mpv_node *values
char **keys
cdef struct mpv_byte_array:
void *data
size_t size
void mpv_free_node_contents(mpv_node *node) nogil
int mpv_set_option(mpv_handle *ctx, const char *name, mpv_format format, void *data) nogil
int mpv_set_option_string(mpv_handle *ctx, const char *name, const char *data) nogil
int mpv_command(mpv_handle *ctx, const char **args) nogil
int mpv_command_node(mpv_handle *ctx, mpv_node *args, mpv_node *result) nogil
int mpv_command_string(mpv_handle *ctx, const char *args) nogil
int mpv_command_async(mpv_handle *ctx, uint64_t reply_userdata, const char **args) nogil
int mpv_command_node_async(mpv_handle *ctx, uint64_t reply_userdata, mpv_node *args) nogil
int mpv_set_property(mpv_handle *ctx, const char *name, mpv_format format, void *data) nogil
int mpv_set_property_string(mpv_handle *ctx, const char *name, const char *data) nogil
int mpv_set_property_async(mpv_handle *ctx, uint64_t reply_userdata, const char *name, mpv_format format, void *data) nogil
int mpv_get_property(mpv_handle *ctx, const char *name, mpv_format format, void *data) nogil
char *mpv_get_property_string(mpv_handle *ctx, const char *name) nogil
char *mpv_get_property_osd_string(mpv_handle *ctx, const char *name) nogil
int mpv_get_property_async(mpv_handle *ctx, uint64_t reply_userdata, const char *name, mpv_format format) nogil
int mpv_observe_property(mpv_handle *mpv, uint64_t reply_userdata, const char *name, mpv_format format) nogil
int mpv_unobserve_property(mpv_handle *mpv, uint64_t registered_reply_userdata) nogil
enum mpv_event_id:
MPV_EVENT_NONE
MPV_EVENT_SHUTDOWN
MPV_EVENT_LOG_MESSAGE
MPV_EVENT_GET_PROPERTY_REPLY
MPV_EVENT_SET_PROPERTY_REPLY
MPV_EVENT_COMMAND_REPLY
MPV_EVENT_START_FILE
MPV_EVENT_END_FILE
MPV_EVENT_FILE_LOADED
MPV_EVENT_IDLE
MPV_EVENT_TICK
MPV_EVENT_CLIENT_MESSAGE
MPV_EVENT_VIDEO_RECONFIG
MPV_EVENT_AUDIO_RECONFIG
MPV_EVENT_SEEK
MPV_EVENT_PLAYBACK_RESTART
MPV_EVENT_PROPERTY_CHANGE
const char *mpv_event_name(mpv_event_id event) nogil
cdef struct mpv_event_property:
const char *name
mpv_format format
void *data
enum mpv_log_level:
MPV_LOG_LEVEL_NONE
MPV_LOG_LEVEL_FATAL
MPV_LOG_LEVEL_ERROR
MPV_LOG_LEVEL_WARN
MPV_LOG_LEVEL_INFO
MPV_LOG_LEVEL_V
MPV_LOG_LEVEL_DEBUG
MPV_LOG_LEVEL_TRACE
cdef struct mpv_event_log_message:
const char *prefix
const char *level
const char *text
int log_level
enum mpv_end_file_reason:
MPV_END_FILE_REASON_EOF
MPV_END_FILE_REASON_STOP
MPV_END_FILE_REASON_QUIT
MPV_END_FILE_REASON_ERROR
cdef struct mpv_event_end_file:
int reason
int error
cdef struct mpv_event_script_input_dispatch:
int arg0
const char *type
cdef struct mpv_event_client_message:
int num_args
const char **args
cdef struct mpv_event:
mpv_event_id event_id
int error
uint64_t reply_userdata
void *data
int mpv_request_event(mpv_handle *ctx, mpv_event_id event, int enable) nogil
int mpv_request_log_messages(mpv_handle *ctx, const char *min_level) nogil
mpv_event *mpv_wait_event(mpv_handle *ctx, double timeout) nogil
void mpv_wakeup(mpv_handle *ctx) nogil
void mpv_set_wakeup_callback(mpv_handle *ctx, void (*cb)(void *), void *d) nogil
int mpv_get_wakeup_pipe(mpv_handle *ctx) nogil
void mpv_wait_async_requests(mpv_handle *ctx) nogil
enum mpv_sub_api:
MPV_SUB_API_OPENGL_CB
void *mpv_get_sub_api(mpv_handle *ctx, mpv_sub_api sub_api) nogil
cdef extern from "mpv/render.h":
struct mpv_render_context:
pass
enum mpv_render_param_type:
MPV_RENDER_PARAM_INVALID
MPV_RENDER_PARAM_API_TYPE
MPV_RENDER_PARAM_OPENGL_INIT_PARAMS
MPV_RENDER_PARAM_OPENGL_FBO
MPV_RENDER_PARAM_FLIP_Y
MPV_RENDER_PARAM_DEPTH
MPV_RENDER_PARAM_ICC_PROFILE
MPV_RENDER_PARAM_AMBIENT_LIGHT
MPV_RENDER_PARAM_X11_DISPLAY
MPV_RENDER_PARAM_WL_DISPLAY
MPV_RENDER_PARAM_ADVANCED_CONTROL
MPV_RENDER_PARAM_NEXT_FRAME_INFO
MPV_RENDER_PARAM_BLOCK_FOR_TARGET_TIME
MPV_RENDER_PARAM_SKIP_RENDERING
MPV_RENDER_PARAM_DRM_DISPLAY
MPV_RENDER_PARAM_DRM_DRAW_SURFACE_SIZE
MPV_RENDER_PARAM_DRM_DISPLAY_V2
MPV_RENDER_PARAM_SW_SIZE
MPV_RENDER_PARAM_SW_FORMAT
MPV_RENDER_PARAM_SW_STRIDE
MPV_RENDER_PARAM_SW_POINTER
char *MPV_RENDER_API_TYPE_OPENGL
char *MPV_RENDER_API_TYPE_SW
enum mpv_render_frame_info_flag:
MPV_RENDER_FRAME_INFO_PRESENT
MPV_RENDER_FRAME_INFO_REDRAW
MPV_RENDER_FRAME_INFO_REPEAT
MPV_RENDER_FRAME_INFO_BLOCK_VSYNC
struct mpv_render_param:
mpv_render_param_type type
void *data
struct mpv_render_frame_info:
uint64_t flags
int64_t target_time
int mpv_render_context_create(mpv_render_context **res, mpv_handle *mpv,
mpv_render_param *params) nogil
int mpv_render_context_set_parameter(mpv_render_context *ctx,
mpv_render_param param) nogil
int mpv_render_context_get_info(mpv_render_context *ctx,
mpv_render_param param) nogil
ctypedef void (*mpv_render_update_fn)(void *cb_ctx) nogil
void mpv_render_context_set_update_callback(mpv_render_context *ctx,
mpv_render_update_fn callback,
void *callback_ctx) nogil
uint64_t mpv_render_context_update(mpv_render_context *ctx) nogil
enum mpv_render_update_flag:
MPV_RENDER_UPDATE_FRAME
int mpv_render_context_render(mpv_render_context *ctx, mpv_render_param *params) nogil
void mpv_render_context_report_swap(mpv_render_context *ctx) nogil
void mpv_render_context_free(mpv_render_context *ctx) nogil
cdef extern from "mpv/render_gl.h":
struct mpv_opengl_init_params:
void *(*get_proc_address)(void *ctx, const char *name)
void *get_proc_address_ctx
struct mpv_opengl_fbo:
int fbo
int w
int h
int internal_format
struct _drmModeAtomicReq:
pass
struct mpv_opengl_drm_params:
int fd
int crtc_id
int connector_id
_drmModeAtomicReq **atomic_request_ptr
int render_fd
struct mpv_opengl_drm_draw_surface_size:
int width
int height