// vita_video.h - SceAvPlayer video playback for Deltarune Vita // Implements GML video_open / video_draw / video_close / video_get_status / video_get_duration // using the Vita hardware H.264 decoder via sceAvPlayer. #pragma once #include #include // video_status_* constants (must match GML constants) #define VITA_VIDEO_STATUS_NONE 0 #define VITA_VIDEO_STATUS_PREPARING 1 #define VITA_VIDEO_STATUS_PLAYING 2 #define VITA_VIDEO_STATUS_PAUSED 3 #define VITA_VIDEO_EVENT_NONE 0 #define VITA_VIDEO_EVENT_START 1 #define VITA_VIDEO_EVENT_END 2 #define VITA_VIDEO_SURFACE_ID (-700001) typedef struct VitaVideoMemoryStats { uint64_t cpuBytes; uint64_t cpuPeakBytes; uint64_t gpuBytes; uint64_t gpuPeakBytes; } VitaVideoMemoryStats; // Initialise the sceAvPlayer subsystem. Call once after vitaGL is ready. int VitaVideo_init(void); // Release all video resources. void VitaVideo_shutdown(void); // Open and start playing an MP4. int VitaVideo_open(const char* path); bool VitaVideo_updateFrame(void); bool VitaVideo_hasDecodedFrame(void); // Draw the latest decoded frame into the rectangle. void VitaVideo_draw(float x, float y, float w, float h); void VitaVideo_drawHost(float x, float y, float w, float h); // Draw an ordinary RGBA GL texture over the host framebuffer using the same safe shader path. void VitaVideo_drawTextureHost(unsigned int texture, float x, float y, float w, float h, float opacity); float VitaVideo_getWidth(void); float VitaVideo_getHeight(void); // Stop and release. void VitaVideo_close(void); // Pause/resume. void VitaVideo_pause(void); void VitaVideo_resume(void); // Returns VITA_VIDEO_STATUS_*. int VitaVideo_getStatus(void); // Returns duration/position in milliseconds, matching GameMaker's video API. float VitaVideo_getDuration(void); float VitaVideo_getPosition(void); // Returns and clears a pending GameMaker async video event. int VitaVideo_consumeEvent(void); void VitaVideo_setLooping(bool enabled); void VitaVideo_setVolume(float volume); // Memory owned by sceAvPlayer callbacks. This is separate from vitaGL's pools. void VitaVideo_getMemoryStats(VitaVideoMemoryStats* stats);