mk_video_closefunction
mk_result mk_video_close(mk_video_t video)Close video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns MK_SUCCESS or an error result.
#include <modkit/video.h>24 functions · 6 structs · 8 enums · 13 typedefs · 6 macros
Optional asynchronous video playback.
Video is enabled with MODKIT_ENABLE_VIDEO. Disabled builds retain every symbol and return MK_ERROR_UNSUPPORTED. Players own a stable texture and a borrowed PCM-stream sound. Call mk_video_update() once per frame on the ModKit API thread before using mk_video_texture().
mk_video_closefunctionmk_result mk_video_close(mk_video_t video)Close video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns MK_SUCCESS or an error result.
mk_video_createfunctionmk_result mk_video_create(const mk_video_desc *desc, mk_video_t *out_video)Create video.
| Parameter | Type | Description |
|---|---|---|
desc | const mk_video_desc * | Configuration descriptor. |
out_video | mk_video_t * | Receives the video. |
Returns MK_SUCCESS or an error result.
mk_video_desc_initfunctionmk_video_desc mk_video_desc_init(void)Initialize the video desc.
Returns The resulting value.
mk_video_destroyfunctionmk_result mk_video_destroy(mk_video_t video)Destroy the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns MK_SUCCESS or an error result.
mk_video_get_infofunctionmk_result mk_video_get_info(mk_video_t video, mk_video_info *out_info)Get info from the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
out_info | mk_video_info * | Receives the info. |
Returns MK_SUCCESS or an error result.
mk_video_initfunctionmk_result mk_video_init(void)Initialize the video.
Returns MK_SUCCESS or an error result.
mk_video_is_initializedfunctionbool mk_video_is_initialized(void)Test whether the video is initialized.
Returns True when the condition holds.
mk_video_is_validfunctionbool mk_video_is_valid(mk_video_t video)Test whether the video is valid.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns True when the condition holds.
mk_video_open_filefunctionmk_result mk_video_open_file(mk_video_t video, const char *path)Open file for the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
path | const char * | Value for path. |
Returns MK_SUCCESS or an error result.
mk_video_pausefunctionmk_result mk_video_pause(mk_video_t video)Pause the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns MK_SUCCESS or an error result.
mk_video_playfunctionmk_result mk_video_play(mk_video_t video)Play video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns MK_SUCCESS or an error result.
mk_video_poll_eventfunctionbool mk_video_poll_event(mk_video_t video, mk_video_event *out_event)Poll event for the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
out_event | mk_video_event * | Receives the event. |
Returns True when the operation succeeds.
mk_video_seekfunctionmk_result mk_video_seek(mk_video_t video, double seconds)Seek video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
seconds | double | Value for seconds. |
Returns MK_SUCCESS or an error result.
mk_video_select_audio_trackfunctionmk_result mk_video_select_audio_track(mk_video_t video, int32_t track_index)Perform the video select audio track operation.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
track_index | int32_t | Value for track index. |
Returns MK_SUCCESS or an error result.
mk_video_set_audio_enabledfunctionmk_result mk_video_set_audio_enabled(mk_video_t video, bool enabled)Set audio enabled on the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
enabled | bool | Whether the feature is enabled. |
Returns MK_SUCCESS or an error result.
mk_video_set_busfunctionmk_result mk_video_set_bus(mk_video_t video, mk_audio_bus_t bus)Set bus on the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
bus | mk_audio_bus_t | Value for bus. |
Returns MK_SUCCESS or an error result.
mk_video_set_loopfunctionmk_result mk_video_set_loop(mk_video_t video, bool loop)Set loop on the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
loop | bool | Value for loop. |
Returns MK_SUCCESS or an error result.
mk_video_set_ratefunctionmk_result mk_video_set_rate(mk_video_t video, double rate)Set rate on the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
rate | double | Value for rate. |
Returns MK_SUCCESS or an error result.
mk_video_set_volumefunctionmk_result mk_video_set_volume(mk_video_t video, float volume)Set volume on the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
volume | float | Value for volume. |
Returns MK_SUCCESS or an error result.
mk_video_shutdownfunctionvoid mk_video_shutdown(void)Perform the video shutdown operation.
mk_video_soundfunctionmk_sound_t mk_video_sound(mk_video_t video)Perform the video sound operation.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns The resulting handle or value.
mk_video_stopfunctionmk_result mk_video_stop(mk_video_t video)Stop the video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns MK_SUCCESS or an error result.
mk_video_texturefunctionmk_texture_t mk_video_texture(mk_video_t video)Borrowed player-owned handles.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns The resulting handle or value.
mk_video_updatefunctionmk_result mk_video_update(mk_video_t video)Update video.
| Parameter | Type | Description |
|---|---|---|
video | mk_video_t | Value for video. |
Returns MK_SUCCESS or an error result.
mk_video_color_infostructData for video color info.
| Field | Type | Description |
|---|---|---|
primaries | mk_video_color_primaries_t | The primaries. |
transfer | mk_video_color_transfer_t | The transfer. |
matrix | mk_video_color_matrix_t | The matrix. |
range | mk_video_color_range_t | The range. |
bit_depth | uint8_t | The bit depth. |
mk_video_descstructData for video desc.
| Field | Type | Description |
|---|---|---|
backend | mk_video_backend_t | The backend. |
bus | mk_audio_bus_t | The bus. |
startup_buffer_ms | uint32_t | The startup buffer ms. |
max_video_frames | uint32_t | The max video frames. |
max_audio_ms | uint32_t | The max audio ms. |
autoplay | bool | The autoplay. |
loop | bool | The loop. |
audio_enabled | bool | The audio enabled. |
mk_video_eventstructData for video event.
| Field | Type | Description |
|---|---|---|
type | mk_video_event_type_t | The type. |
previous_state | mk_video_state_t | The previous state. |
state | mk_video_state_t | The state. |
result | mk_result | The result. |
position_seconds | double | The position seconds. |
track_index | int32_t | The track index. |
message | char | The message. |
mk_video_infostructData for video info.
| Field | Type | Description |
|---|---|---|
state | mk_video_state_t | The state. |
backend | mk_video_backend_t | The backend. |
requested_backend | mk_video_backend_t | The requested backend. |
requested_device_decode | mk_video_decode_mode_t | The requested device decode. |
hardware_available | bool | The hardware available. |
hardware_device_enabled | bool | The hardware device enabled. |
has_video | bool | The has video. |
has_audio | bool | The has audio. |
looping | bool | The looping. |
audio_enabled | bool | The audio enabled. |
width | uint16_t | The width. |
height | uint16_t | The height. |
duration_seconds | double | The duration seconds. |
position_seconds | double | The position seconds. |
buffered_seconds | double | The buffered seconds. |
rate | double | The rate. |
av_drift_seconds | double | The av drift seconds. |
frame_rate_num | uint32_t | The frame rate num. |
frame_rate_den | uint32_t | The frame rate den. |
track_count | uint32_t | The track count. |
selected_audio_track | int32_t | The selected audio track. |
presented_frames | uint64_t | The presented frames. |
dropped_frames | uint64_t | The dropped frames. |
video_codec | char | The video codec. |
audio_codec | char | The audio codec. |
color | mk_video_color_info_t | The color. |
tracks | mk_video_track_info_t | The tracks. |
mk_video_tstructData for video.
| Field | Type | Description |
|---|---|---|
id | uint32_t | The ID. |
mk_video_track_infostructData for video track info.
| Field | Type | Description |
|---|---|---|
type | mk_video_track_type_t | The type. |
stream_index | uint32_t | The stream index. |
codec | char | The codec. |
language | char | The language. |
title | char | The title. |
channels | uint32_t | The channels. |
sample_rate | uint32_t | The sample rate. |
selected | bool | The selected. |
mk_video_backendenumValues for video backend.
| Value | Description |
|---|---|
MK_VIDEO_BACKEND_NONE | Selects none. |
MK_VIDEO_BACKEND_AUTO | Selects auto. |
MK_VIDEO_BACKEND_HARDWARE | Selects hardware. |
MK_VIDEO_BACKEND_SOFTWARE | Selects software. |
mk_video_color_matrixenumValues for video color matrix.
| Value | Description |
|---|---|
MK_VIDEO_COLOR_MATRIX_UNKNOWN | Selects unknown. |
MK_VIDEO_COLOR_MATRIX_BT601 | Selects bt601. |
MK_VIDEO_COLOR_MATRIX_BT709 | Selects bt709. |
MK_VIDEO_COLOR_MATRIX_BT2020 | Selects bt2020. |
mk_video_color_primariesenumValues for video color primaries.
| Value | Description |
|---|---|
MK_VIDEO_COLOR_PRIMARIES_UNKNOWN | Selects unknown. |
MK_VIDEO_COLOR_PRIMARIES_BT709 | Selects bt709. |
MK_VIDEO_COLOR_PRIMARIES_BT2020 | Selects bt2020. |
mk_video_color_rangeenumValues for video color range.
| Value | Description |
|---|---|
MK_VIDEO_COLOR_RANGE_UNKNOWN | Selects unknown. |
MK_VIDEO_COLOR_RANGE_LIMITED | Selects limited. |
MK_VIDEO_COLOR_RANGE_FULL | Selects full. |
mk_video_color_transferenumValues for video color transfer.
| Value | Description |
|---|---|
MK_VIDEO_COLOR_TRANSFER_UNKNOWN | Selects unknown. |
MK_VIDEO_COLOR_TRANSFER_BT709 | Selects bt709. |
MK_VIDEO_COLOR_TRANSFER_SRGB | Selects srgb. |
MK_VIDEO_COLOR_TRANSFER_PQ | Selects pq. |
MK_VIDEO_COLOR_TRANSFER_HLG | Selects hlg. |
mk_video_event_typeenumValues for video event type.
| Value | Description |
|---|---|
MK_VIDEO_EVENT_READY | Selects ready. |
MK_VIDEO_EVENT_STATE_CHANGED | Selects state changed. |
MK_VIDEO_EVENT_SEEK_COMPLETE | Selects seek complete. |
MK_VIDEO_EVENT_LOOP | Selects loop. |
MK_VIDEO_EVENT_END | Selects end. |
MK_VIDEO_EVENT_TRACK_CHANGED | Selects track changed. |
MK_VIDEO_EVENT_RECOVERED | Selects recovered. |
MK_VIDEO_EVENT_ERROR | Selects error. |
mk_video_stateenumValues for video state.
| Value | Description |
|---|---|
MK_VIDEO_STATE_CLOSED | Selects closed. |
MK_VIDEO_STATE_OPENING | Selects opening. |
MK_VIDEO_STATE_BUFFERING | Selects buffering. |
MK_VIDEO_STATE_READY | Selects ready. |
MK_VIDEO_STATE_PLAYING | Selects playing. |
MK_VIDEO_STATE_PAUSED | Selects paused. |
MK_VIDEO_STATE_SEEKING | Selects seeking. |
MK_VIDEO_STATE_RECOVERING | Selects recovering. |
MK_VIDEO_STATE_ENDED | Selects ended. |
MK_VIDEO_STATE_ERROR | Selects error. |
mk_video_track_typeenumValues for video track type.
| Value | Description |
|---|---|
MK_VIDEO_TRACK_VIDEO | Selects video. |
MK_VIDEO_TRACK_AUDIO | Selects audio. |
mk_video_backend_ttypedeftypedef enum mk_video_backend mk_video_backend_tValues for video backend.
mk_video_color_info_ttypedeftypedef struct mk_video_color_info mk_video_color_info_tData for video color info.
mk_video_color_matrix_ttypedeftypedef enum mk_video_color_matrix mk_video_color_matrix_tValues for video color matrix.
mk_video_color_primaries_ttypedeftypedef enum mk_video_color_primaries mk_video_color_primaries_tValues for video color primaries.
mk_video_color_range_ttypedeftypedef enum mk_video_color_range mk_video_color_range_tValues for video color range.
mk_video_color_transfer_ttypedeftypedef enum mk_video_color_transfer mk_video_color_transfer_tValues for video color transfer.
mk_video_desctypedeftypedef struct mk_video_desc mk_video_descData for video desc.
mk_video_eventtypedeftypedef struct mk_video_event mk_video_eventData for video event.
mk_video_event_type_ttypedeftypedef enum mk_video_event_type mk_video_event_type_tValues for video event type.
mk_video_infotypedeftypedef struct mk_video_info mk_video_infoData for video info.
mk_video_state_ttypedeftypedef enum mk_video_state mk_video_state_tValues for video state.
mk_video_track_info_ttypedeftypedef struct mk_video_track_info mk_video_track_info_tData for video track info.
mk_video_track_type_ttypedeftypedef enum mk_video_track_type mk_video_track_type_tValues for video track type.
MK_VIDEO_CODEC_NAME_CAPACITYdefineMK_VIDEO_CODEC_NAME_CAPACITYConstant for video codec name capacity.
MK_VIDEO_EVENT_MESSAGE_CAPACITYdefineMK_VIDEO_EVENT_MESSAGE_CAPACITYConstant for video event message capacity.
MK_VIDEO_INVALIDdefineMK_VIDEO_INVALIDInvalid sentinel for video.
MK_VIDEO_LANGUAGE_CAPACITYdefineMK_VIDEO_LANGUAGE_CAPACITYConstant for video language capacity.
MK_VIDEO_MAX_TRACKSdefineMK_VIDEO_MAX_TRACKSMaximum supported video tracks.
MK_VIDEO_TRACK_TITLE_CAPACITYdefineMK_VIDEO_TRACK_TITLE_CAPACITYConstant for video track title capacity.