/* * * Singe 2 * Copyright (C) 2006-2024 Scott Duensing * * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #ifndef VIDEOPLAYER_H #define VIDEOPLAYER_H #include #include "common.h" #define VIDEO_VOLUME_MAX 100 typedef void (*VideoIndexingCallbackT)(int32_t percent); int32_t videoGetAudioTrack(int32_t playerHandle); int32_t videoGetAudioTracks(int32_t playerHandle); int64_t videoGetFrame(int32_t playerHandle); int64_t videoGetFrameCount(int32_t playerHandle); int32_t videoGetHeight(int32_t playerHandle); const char *videoGetLanguage(int32_t playerHandle, int32_t audioTrack); const char *videoGetLanguageDescription(const char *languageCode); bool videoGetPixel(int32_t playerHandle, int32_t x, int32_t y, uint8_t *r, uint8_t *g, uint8_t *b); bool videoGetPixels(int32_t playerHandle, const uint8_t **pixels, int32_t *pitch); void videoGetVolume(int32_t playerHandle, int32_t *leftPercent, int32_t *rightPercent); int32_t videoGetWidth(int32_t playerHandle); void videoInit(int32_t mixerChunkFrames); bool videoIsPlaying(int32_t playerHandle); int32_t videoLoad(const char *videoFilename, const char *audioFilename, const char *indexPath, SDL_Renderer *renderer, bool rgb); void videoPause(int32_t playerHandle); void videoPlay(int32_t playerHandle); void videoQuit(void); void videoSeek(int32_t playerHandle, int64_t seekFrame); void videoSetAudioTrack(int32_t playerHandle, int32_t track); void videoSetIndexCallback(VideoIndexingCallbackT callback); void videoSetVolume(int32_t playerHandle, int32_t leftPercent, int32_t rightPercent); void videoUnload(int32_t playerHandle); int64_t videoUpdate(int32_t playerHandle, SDL_Texture **texture); #endif // VIDEOPLAYER_H