1package mpv 2 3//#include <mpv/client.h> 4import "C" 5 6//Errors mpv_error 7const ( 8 /** 9 * No error happened (used to signal successful operation). 10 * Keep in mind that many API functions returning error codes can also 11 * return positive values, which also indicate success. API users can 12 * hardcode the fact that ">= 0" means success. 13 */ 14 ERROR_SUCCESS Error = C.MPV_ERROR_SUCCESS 15 /** 16 * The event ringbuffer is full. This means the client is choked, and can't 17 * receive any events. This can happen when too many asynchronous requests 18 * have been made, but not answered. Probably never happens in practice, 19 * unless the mpv core is frozen for some reason, and the client keeps 20 * making asynchronous requests. (Bugs in the client API implementation 21 * could also trigger this, e.g. if events become "lost".) 22 */ 23 ERROR_EVENT_QUEUE_FULL Error = C.MPV_ERROR_EVENT_QUEUE_FULL 24 /** 25 * Memory allocation failed. 26 */ 27 ERROR_NOMEM Error = C.MPV_ERROR_NOMEM 28 /** 29 * The mpv core wasn't configured and initialized yet. See the notes in 30 * mpv_create(). 31 */ 32 ERROR_UNINITIALIZED Error = C.MPV_ERROR_UNINITIALIZED 33 /** 34 * Generic catch-all error if a parameter is set to an invalid or 35 * unsupported value. This is used if there is no better error code. 36 */ 37 ERROR_INVALID_PARAMETER Error = C.MPV_ERROR_INVALID_PARAMETER 38 /** 39 * Trying to set an option that doesn't exist. 40 */ 41 ERROR_OPTION_NOT_FOUND Error = C.MPV_ERROR_OPTION_NOT_FOUND 42 /** 43 * Trying to set an option using an unsupported MPV_FORMAT. 44 */ 45 ERROR_OPTION_FORMAT Error = C.MPV_ERROR_OPTION_FORMAT 46 /** 47 * Setting the option failed. Typically this happens if the provided option 48 * value could not be parsed. 49 */ 50 ERROR_OPTION_ERROR Error = C.MPV_ERROR_OPTION_ERROR 51 /** 52 * The accessed property doesn't exist. 53 */ 54 ERROR_PROPERTY_NOT_FOUND Error = C.MPV_ERROR_PROPERTY_NOT_FOUND 55 /** 56 * Trying to set or get a property using an unsupported MPV_FORMAT. 57 */ 58 ERROR_PROPERTY_FORMAT Error = C.MPV_ERROR_PROPERTY_FORMAT 59 /** 60 * The property exists, but is not available. This usually happens when the 61 * associated subsystem is not active, e.g. querying audio parameters while 62 * audio is disabled. 63 */ 64 ERROR_PROPERTY_UNAVAILABLE Error = C.MPV_ERROR_PROPERTY_UNAVAILABLE 65 /** 66 * Error setting or getting a property. 67 */ 68 ERROR_PROPERTY_ERROR Error = C.MPV_ERROR_PROPERTY_ERROR 69 /** 70 * General error when running a command with mpv_command and similar. 71 */ 72 ERROR_COMMAND Error = C.MPV_ERROR_COMMAND 73 /** 74 * Generic error on loading (used with mpv_event_end_file.error). 75 */ 76 ERROR_LOADING_FAILED Error = C.MPV_ERROR_LOADING_FAILED 77 /** 78 * Initializing the audio output failed. 79 */ 80 ERROR_AO_INIT_FAILED Error = C.MPV_ERROR_AO_INIT_FAILED 81 /** 82 * Initializing the video output failed. 83 */ 84 ERROR_VO_INIT_FAILED Error = C.MPV_ERROR_VO_INIT_FAILED 85 /** 86 * There was no audio or video data to play. This also happens if the 87 * file was recognized, but did not contain any audio or video streams, 88 * or no streams were selected. 89 */ 90 ERROR_NOTHING_TO_PLAY Error = C.MPV_ERROR_NOTHING_TO_PLAY 91 /** 92 * When trying to load the file, the file format could not be determined, 93 * or the file was too broken to open it. 94 */ 95 ERROR_UNKNOWN_FORMAT Error = C.MPV_ERROR_UNKNOWN_FORMAT 96 /** 97 * Generic error for signaling that certain system requirements are not 98 * fulfilled. 99 */ 100 ERROR_UNSUPPORTED Error = C.MPV_ERROR_UNSUPPORTED 101 /** 102 * The API function which was called is a stub only. 103 */ 104 MPV_ERROR_NOT_IMPLEMENTED Error = C.MPV_ERROR_UNSUPPORTED 105) 106 107type Format int 108 109//Format mpv_format 110const ( 111 FORMAT_NONE Format = C.MPV_FORMAT_NONE 112 /** 113 * The basic type is char*. It returns the raw property string, like 114 * using ${=property} in input.conf (see input.rst). 115 * 116 * NULL isn't an allowed value. 117 * 118 * Warning: although the encoding is usually UTF-8, this is not always the 119 * case. File tags often store strings in some legacy codepage, 120 * and even filenames don't necessarily have to be in UTF-8 (at 121 * least on Linux). If you pass the strings to code that requires 122 * valid UTF-8, you have to sanitize it in some way. 123 * On Windows, filenames are always UTF-8, and libmpv converts 124 * between UTF-8 and UTF-16 when using win32 API functions. See 125 * the "Encoding of filenames" section for details. 126 * 127 * Example for reading: 128 * 129 * char *result = NULL; 130 * if (mpv_get_property(ctx, "property", FORMAT_STRING, = C.MPV_FORMAT_STRING, 131 * goto error; 132 * printf("%s\n", result); 133 * mpv_free(result); 134 * 135 * Or just use mpv_get_property_string(). 136 * 137 * Example for writing: 138 * 139 * char *value = "the new value"; 140 * // yep, you pass the address to the variable 141 * // (needed for symmetry with other types and mpv_get_property) 142 * mpv_set_property(ctx, "property", FORMAT_STRING, = C.MPV_FORMAT_STRING, 143 * 144 * Or just use mpv_set_property_string(). 145 * 146 */ 147 FORMAT_STRING Format = C.MPV_FORMAT_STRING 148 /** 149 * The basic type is char*. It returns the OSD property string, like 150 * using ${property} in input.conf (see input.rst). In many cases, this 151 * is the same as the raw string, but in other cases it's formatted for 152 * display on OSD. It's intended to be human readable. Do not attempt to 153 * parse these strings. 154 * 155 * Only valid when doing read access. The rest works like MPV_FORMAT_STRING. 156 */ 157 FORMAT_OSD_STRING Format = C.MPV_FORMAT_OSD_STRING 158 /** 159 * The basic type is int. The only allowed values are 0 ("no") 160 * and 1 ("yes"). 161 * 162 * Example for reading: 163 * 164 * int result; 165 * if (mpv_get_property(ctx, "property", FORMAT_FLAG, = C.MPV_FORMAT_FLAG, 166 * goto error; 167 * printf("%s\n", result ? "true" : "false"); 168 * 169 * Example for writing: 170 * 171 * int flag = 1; 172 * mpv_set_property(ctx, "property", FORMAT_STRING, = C.MPV_FORMAT_STRING, 173 */ 174 FORMAT_FLAG Format = C.MPV_FORMAT_FLAG 175 /** 176 * The basic type is int64_t. 177 */ 178 FORMAT_INT64 Format = C.MPV_FORMAT_INT64 179 /** 180 * The basic type is double. 181 */ 182 FORMAT_DOUBLE Format = C.MPV_FORMAT_DOUBLE 183 /** 184 * The type is mpv_node. 185 * 186 * For reading, you usually would pass a pointer to a stack-allocated 187 * mpv_node value to mpv, and when you're done you call 188 * mpv_free_node_contents(&node). 189 * You're expected not to write to the data - if you have to, copy it 190 * first (which you have to do manually). 191 * 192 * For writing, you construct your own mpv_node, and pass a pointer to the 193 * API. The API will never write to your data (and copy it if needed), so 194 * you're free to use any form of allocation or memory management you like. 195 * 196 * Warning: when reading, always check the mpv_node.format member. For 197 * example, properties might change their type in future versions 198 * of mpv, or sometimes even during runtime. 199 * 200 * Example for reading: 201 * 202 * mpv_node result; 203 * if (mpv_get_property(ctx, "property", FORMAT_NODE, = C.MPV_FORMAT_NODE, 204 * goto error; 205 * printf("format=%d\n", (int)result.format); 206 * mpv_free_node_contents(&result). 207 * 208 * Example for writing: 209 * 210 * mpv_node value; 211 * value.format = MPV_FORMAT_STRING; 212 * value.u.string = "hello"; 213 * mpv_set_property(ctx, "property", FORMAT_NODE, = C.MPV_FORMAT_NODE, 214 */ 215 FORMAT_NODE Format = C.MPV_FORMAT_NODE 216 /** 217 * Used with mpv_node only. Can usually not be used directly. 218 */ 219 FORMAT_NODE_ARRAY Format = C.MPV_FORMAT_NODE_ARRAY 220 /** 221 * See MPV_FORMAT_NODE_ARRAY. 222 */ 223 FORMAT_NODE_MAP Format = C.MPV_FORMAT_NODE_MAP 224 /** 225 * A raw, untyped byte array. Only used only with mpv_node, and only in 226 * some very special situations. (Currently, only for the screenshot_raw 227 * command.) 228 */ 229 FORMAT_BYTE_ARRAY = C.MPV_FORMAT_BYTE_ARRAY 230) 231 232type EventId int 233 234//EventId mpv_event_id 235const ( 236 /** 237 * Nothing happened. Happens on timeouts or sporadic wakeups. 238 */ 239 EVENT_NONE EventId = C.MPV_EVENT_NONE 240 /** 241 * Happens when the player quits. The player enters a state where it tries 242 * to disconnect all clients. Most requests to the player will fail, and 243 * mpv_wait_event() will always return instantly (returning new shutdown 244 * events if no other events are queued). The client should react to this 245 * and quit with mpv_detach_destroy() as soon as possible. 246 */ 247 EVENT_SHUTDOWN EventId = C.MPV_EVENT_SHUTDOWN 248 /** 249 * See mpv_request_log_messages(). 250 */ 251 EVENT_LOG_MESSAGE EventId = C.MPV_EVENT_LOG_MESSAGE 252 /** 253 * Reply to a mpv_get_property_async() request. 254 * See also mpv_event and mpv_event_property. 255 */ 256 EVENT_GET_PROPERTY_REPLY EventId = C.MPV_EVENT_GET_PROPERTY_REPLY 257 /** 258 * Reply to a mpv_set_property_async() request. 259 * (Unlike EVENT_GET_PROPERTY, = C.MPV_EVENT_GET_PROPERTY, 260 */ 261 EVENT_SET_PROPERTY_REPLY EventId = C.MPV_EVENT_SET_PROPERTY_REPLY 262 /** 263 * Reply to a mpv_command_async() request. 264 */ 265 EVENT_COMMAND_REPLY EventId = C.MPV_EVENT_COMMAND_REPLY 266 /** 267 * Notification before playback start of a file (before the file is loaded). 268 */ 269 EVENT_START_FILE EventId = C.MPV_EVENT_START_FILE 270 /** 271 * Notification after playback end (after the file was unloaded). 272 * See also mpv_event and mpv_event_end_file. 273 */ 274 EVENT_END_FILE EventId = C.MPV_EVENT_END_FILE 275 /** 276 * Notification when the file has been loaded (headers were read etc.), and 277 * decoding starts. 278 */ 279 EVENT_FILE_LOADED EventId = C.MPV_EVENT_FILE_LOADED 280 /** 281 * The list of video/audio/subtitle tracks was changed. (E.g. a new track 282 * was found. This doesn't necessarily indicate a track switch; for this, 283 * EVENT_TRACK_SWITCHED = C.MPV_EVENT_TRACK_SWITCHED 284 * 285 * @deprecated This is equivalent to using mpv_observe_property() on the 286 * "track-list" property. The event is redundant, and might 287 * be removed in the far future. 288 */ 289 EVENT_TRACKS_CHANGED EventId = C.MPV_EVENT_TRACKS_CHANGED 290 /** 291 * A video/audio/subtitle track was switched on or off. 292 * 293 * @deprecated This is equivalent to using mpv_observe_property() on the 294 * "vid", "aid", and "sid" properties. The event is redundant, 295 * and might be removed in the far future. 296 */ 297 EVENT_TRACK_SWITCHED EventId = C.MPV_EVENT_TRACK_SWITCHED 298 /** 299 * Idle mode was entered. In this mode, no file is played, and the playback 300 * core waits for new commands. (The command line player normally quits 301 * instead of entering idle mode, unless --idle was specified. If mpv 302 * was started with mpv_create(), idle mode is enabled by default.) 303 */ 304 EVENT_IDLE EventId = C.MPV_EVENT_IDLE 305 /** 306 * Playback was paused. This indicates the user pause state. 307 * 308 * The user pause state is the state the user requested (changed with the 309 * "pause" property). There is an internal pause state too, which is entered 310 * if e.g. the network is too slow (the "core-idle" property generally 311 * indicates whether the core is playing or waiting). 312 * 313 * This event is sent whenever any pause states change, not only the user 314 * state. You might get multiple events in a row while these states change 315 * independently. But the event ID sent always indicates the user pause 316 * state. 317 * 318 * If you don't want to deal with this, use mpv_observe_property() on the 319 * "pause" property and ignore EVENT_PAUSE/UNPAUSE. = C.MPV_EVENT_PAUSE/UNPAUSE. 320 * "core-idle" property tells you whether video is actually playing or not. 321 * 322 * @deprecated The event is redundant with mpv_observe_property() as 323 * mentioned above, and might be removed in the far future. 324 */ 325 EVENT_PAUSE EventId = C.MPV_EVENT_PAUSE 326 /** 327 * Playback was unpaused. See EVENT_PAUSE = C.MPV_EVENT_PAUSE 328 * 329 * @deprecated The event is redundant with mpv_observe_property() as 330 * explained in the EVENT_PAUSE = C.MPV_EVENT_PAUSE 331 * removed in the far future. 332 */ 333 EVENT_UNPAUSE EventId = C.MPV_EVENT_UNPAUSE 334 /** 335 * Sent every time after a video frame is displayed. Note that currently, 336 * this will be sent in lower frequency if there is no video, or playback 337 * is paused - but that will be removed in the future, and it will be 338 * restricted to video frames only. 339 */ 340 EVENT_TICK EventId = C.MPV_EVENT_TICK 341 /** 342 * @deprecated This was used internally with the internal "script_dispatch" 343 * command to dispatch keyboard and mouse input for the OSC. 344 * It was never useful in general and has been completely 345 * replaced with "script_binding". 346 * This event never happens anymore, and is included in this 347 * header only for compatibility. 348 */ 349 EVENT_SCRIPT_INPUT_DISPATCH EventId = C.MPV_EVENT_SCRIPT_INPUT_DISPATCH 350 /** 351 * Triggered by the script_message input command. The command uses the 352 * first argument of the command as client name (see mpv_client_name()) to 353 * dispatch the message, and passes along all arguments starting from the 354 * second argument as strings. 355 * See also mpv_event and mpv_event_client_message. 356 */ 357 EVENT_CLIENT_MESSAGE EventId = C.MPV_EVENT_CLIENT_MESSAGE 358 /** 359 * Happens after video changed in some way. This can happen on resolution 360 * changes, pixel format changes, or video filter changes. The event is 361 * sent after the video filters and the VO are reconfigured. Applications 362 * embedding a mpv window should listen to this event in order to resize 363 * the window if needed. 364 * Note that this event can happen sporadically, and you should check 365 * yourself whether the video parameters really changed before doing 366 * something expensive. 367 */ 368 EVENT_VIDEO_RECONFIG EventId = C.MPV_EVENT_VIDEO_RECONFIG 369 /** 370 * Similar to EVENT_VIDEO_RECONFIG. = C.MPV_EVENT_VIDEO_RECONFIG. 371 * because there is no such thing as audio output embedding. 372 */ 373 EVENT_AUDIO_RECONFIG EventId = C.MPV_EVENT_AUDIO_RECONFIG 374 /** 375 * Happens when metadata (like file tags) is possibly updated. (It's left 376 * unspecified whether this happens on file start or only when it changes 377 * within a file.) 378 * 379 * @deprecated This is equivalent to using mpv_observe_property() on the 380 * "metadata" property. The event is redundant, and might 381 * be removed in the far future. 382 */ 383 EVENT_METADATA_UPDATE EventId = C.MPV_EVENT_METADATA_UPDATE 384 /** 385 * Happens when a seek was initiated. Playback stops. Usually it will 386 * resume with EVENT_PLAYBACK_RESTART = C.MPV_EVENT_PLAYBACK_RESTART 387 */ 388 EVENT_SEEK EventId = C.MPV_EVENT_SEEK 389 /** 390 * There was a discontinuity of some sort (like a seek), and playback 391 * was reinitialized. Usually happens after seeking, or ordered chapter 392 * segment switches. The main purpose is allowing the client to detect 393 * when a seek request is finished. 394 */ 395 EVENT_PLAYBACK_RESTART EventId = C.MPV_EVENT_PLAYBACK_RESTART 396 /** 397 * Event sent due to mpv_observe_property(). 398 * See also mpv_event and mpv_event_property. 399 */ 400 EVENT_PROPERTY_CHANGE EventId = C.MPV_EVENT_PROPERTY_CHANGE 401 /** 402 * Happens when the current chapter changes. 403 * 404 * @deprecated This is equivalent to using mpv_observe_property() on the 405 * "chapter" property. The event is redundant, and might 406 * be removed in the far future. 407 */ 408 EVENT_CHAPTER_CHANGE EventId = C.MPV_EVENT_CHAPTER_CHANGE 409 /** 410 * Happens if the internal per-mpv_handle ringbuffer overflows, and at 411 * least 1 event had to be dropped. This can happen if the client doesn't 412 * read the event queue quickly enough with mpv_wait_event(), or if the 413 * client makes a very large number of asynchronous calls at once. 414 * 415 * Event delivery will continue normally once this event was returned 416 * (this forces the client to empty the queue completely). 417 */ 418 EVENT_QUEUE_OVERFLOW EventId = C.MPV_EVENT_QUEUE_OVERFLOW 419 // Internal note: adjust INTERNAL_EVENT_BASE when adding new events. 420) 421 422func (eid EventId) String() string { 423 switch eid { 424 case EVENT_NONE: 425 { 426 return "EVENT_NONE" 427 } 428 case EVENT_SHUTDOWN: 429 { 430 return "EVENT_SHUTDOWN" 431 } 432 case EVENT_LOG_MESSAGE: 433 { 434 return "EVENT_LOG_MESSAGE" 435 } 436 case EVENT_GET_PROPERTY_REPLY: 437 { 438 return "EVENT_GET_PROPERTY_REPLY" 439 } 440 case EVENT_SET_PROPERTY_REPLY: 441 { 442 return "EVENT_SET_PROPERTY_REPLY" 443 } 444 case EVENT_COMMAND_REPLY: 445 { 446 return "EVENT_COMMAND_REPLY" 447 } 448 case EVENT_START_FILE: 449 { 450 return "EVENT_START_FILE" 451 } 452 case EVENT_END_FILE: 453 { 454 return "EVENT_END_FILE" 455 } 456 case EVENT_FILE_LOADED: 457 { 458 return "EVENT_FILE_LOADED" 459 } 460 case EVENT_TRACKS_CHANGED: 461 { 462 return "EVENT_TRACKS_CHANGED" 463 } 464 case EVENT_TRACK_SWITCHED: 465 { 466 return "EVENT_TRACK_SWITCHED" 467 } 468 case EVENT_IDLE: 469 { 470 return "EVENT_IDLE" 471 } 472 case EVENT_PAUSE: 473 { 474 return "EVENT_PAUSE" 475 } 476 case EVENT_UNPAUSE: 477 { 478 return "EVENT_UNPAUSE" 479 } 480 case EVENT_TICK: 481 { 482 return "EVENT_TICK" 483 } 484 case EVENT_SCRIPT_INPUT_DISPATCH: 485 { 486 return "EVENT_SCRIPT_INPUT_DISPATCH" 487 } 488 case EVENT_CLIENT_MESSAGE: 489 { 490 return "EVENT_CLIENT_MESSAGE" 491 } 492 case EVENT_VIDEO_RECONFIG: 493 { 494 return "EVENT_VIDEO_RECONFIG" 495 } 496 case EVENT_AUDIO_RECONFIG: 497 { 498 return "EVENT_AUDIO_RECONFIG" 499 } 500 case EVENT_METADATA_UPDATE: 501 { 502 return "EVENT_METADATA_UPDATE" 503 } 504 case EVENT_SEEK: 505 { 506 return "EVENT_SEEK" 507 } 508 case EVENT_PLAYBACK_RESTART: 509 { 510 return "EVENT_PLAYBACK_RESTART" 511 } 512 case EVENT_PROPERTY_CHANGE: 513 { 514 return "EVENT_PROPERTY_CHANGE" 515 } 516 case EVENT_CHAPTER_CHANGE: 517 { 518 return "EVENT_CHAPTER_CHANGE" 519 } 520 case EVENT_QUEUE_OVERFLOW: 521 { 522 return "EVENT_QUEUE_OVERFLOW" 523 } 524 } 525 return "UNKNOWN_EVENT" 526} 527 528//Log level mpv_log_level 529const ( 530 LOG_LEVEL_NONE = C.MPV_LOG_LEVEL_NONE /// "no" - disable absolutely all messages 531 LOG_LEVEL_FATAL = C.MPV_LOG_LEVEL_FATAL /// "fatal" - critical/aborting errors 532 LOG_LEVEL_ERROR = C.MPV_LOG_LEVEL_ERROR /// "error" - simple errors 533 LOG_LEVEL_WARN = C.MPV_LOG_LEVEL_WARN /// "warn" - possible problems 534 LOG_LEVEL_INFO = C.MPV_LOG_LEVEL_INFO /// "info" - informational message 535 LOG_LEVEL_V = C.MPV_LOG_LEVEL_V /// "v" - noisy informational message 536 LOG_LEVEL_DEBUG = C.MPV_LOG_LEVEL_DEBUG /// "debug" - very noisy technical information 537 LOG_LEVEL_TRACE = C.MPV_LOG_LEVEL_TRACE /// "trace" - extremely noisy 538) 539 540type EndFileReason int 541 542//EndFileReason mpv_end_file_reason 543const ( 544 /** 545 * The end of file was reached. Sometimes this may also happen on 546 * incomplete or corrupted files, or if the network connection was 547 * interrupted when playing a remote file. It also happens if the 548 * playback range was restricted with --end or --frames or similar. 549 */ 550 END_FILE_REASON_EOF EndFileReason = C.MPV_END_FILE_REASON_EOF 551 /** 552 * Playback was stopped by an external action (e.g. playlist controls). 553 */ 554 END_FILE_REASON_STOP EndFileReason = C.MPV_END_FILE_REASON_STOP 555 /** 556 * Playback was stopped by the quit command or player shutdown. 557 */ 558 END_FILE_REASON_QUIT EndFileReason = C.MPV_END_FILE_REASON_QUIT 559 /** 560 * Some kind of error happened that lead to playback abort. Does not 561 * necessarily happen on incomplete or broken files (in these cases, both 562 * MPV_END_FILE_REASON_ERROR or MPV_END_FILE_REASON_EOF are possible). 563 * 564 * mpv_event_end_file.error will be set. 565 */ 566 END_FILE_REASON_ERROR EndFileReason = C.MPV_END_FILE_REASON_ERROR 567 /** 568 * The file was a playlist or similar. When the playlist is read, its 569 * entries will be appended to the playlist after the entry of the current 570 * file, the entry of the current file is removed, and a MPV_EVENT_END_FILE 571 * event is sent with reason set to MPV_END_FILE_REASON_REDIRECT. Then 572 * playback continues with the playlist contents. 573 * Since API version 1.18. 574 */ 575 END_FILE_REASON_REDIRECT EndFileReason = C.MPV_END_FILE_REASON_REDIRECT 576) 577 578func (efr EndFileReason) String() string { 579 switch efr { 580 case END_FILE_REASON_EOF: 581 return "END_FILE_REASON_EOF" 582 case END_FILE_REASON_STOP: 583 return "END_FILE_REASON_STOP" 584 case END_FILE_REASON_QUIT: 585 return "END_FILE_REASON_QUIT" 586 case END_FILE_REASON_ERROR: 587 return "END_FILE_REASON_ERROR" 588 case END_FILE_REASON_REDIRECT: 589 return "END_FILE_REASON_REDIRECT" 590 default: 591 return "END_FILE_REASON_UNKNOWN" 592 } 593} 594 595type SubApi int 596 597//mpv_sub_api 598const ( 599 /** 600 * For using mpv's OpenGL renderer on an external OpenGL context. 601 * mpv_get_sub_api(MPV_SUB_API_OPENGL_CB) returns mpv_opengl_cb_context*. 602 * This context can be used with mpv_opengl_cb_* functions. 603 * Will return NULL if unavailable (if OpenGL support was not compiled in). 604 * See opengl_cb.h for details. 605 */ 606 SUB_API_OPENGL_CB SubApi = C.MPV_SUB_API_OPENGL_CB 607) 608