diff options
Diffstat (limited to 'include/kitchensink')
-rw-r--r-- | include/kitchensink/kitplayer.h | 17 | ||||
-rw-r--r-- | include/kitchensink/kitsource.h | 5 |
2 files changed, 19 insertions, 3 deletions
diff --git a/include/kitchensink/kitplayer.h b/include/kitchensink/kitplayer.h index a0f97ad..ea86b31 100644 --- a/include/kitchensink/kitplayer.h +++ b/include/kitchensink/kitplayer.h @@ -24,6 +24,7 @@ typedef enum Kit_PlayerState { } Kit_PlayerState; typedef struct Kit_AudioFormat { + int stream_idx; ///< Stream index bool is_enabled; ///< Is stream enabled unsigned int format; ///< SDL Audio Format bool is_signed; ///< Signedness @@ -33,17 +34,24 @@ typedef struct Kit_AudioFormat { } Kit_AudioFormat; typedef struct Kit_VideoFormat { - bool is_enabled; ///<Is stream enabled + int stream_idx; ///< Stream index + bool is_enabled; ///< Is stream enabled unsigned int format; ///< SDL Pixel Format int width; ///< Width in pixels int height; ///< Height in pixels } Kit_VideoFormat; +typedef struct Kit_SubtitleFormat { + int stream_idx; ///< Stream index + bool is_enabled; ///< Is stream enabled +} Kit_SubtitleFormat; + typedef struct Kit_Player { // Local state Kit_PlayerState state; ///< Playback state Kit_VideoFormat vformat; ///< Video format information Kit_AudioFormat aformat; ///< Audio format information + Kit_SubtitleFormat sformat; ///< Subtitle format information // Synchronization double clock_sync; ///< Clock sync point @@ -54,18 +62,22 @@ typedef struct Kit_Player { SDL_Thread *dec_thread; ///< Decoder thread SDL_mutex *vmutex; ///< Video stream buffer lock SDL_mutex *amutex; ///< Audio stream buffer lock + SDL_mutex *smutex; ///< Subtitle stream buffer lock SDL_mutex *cmutex; ///< Control stream buffer lock // Buffers void *abuffer; ///<Audio stream buffer void *vbuffer; ///< Video stream buffer + void *sbuffer; ///< Subtitle stream buffer void *cbuffer; ///< Control stream buffer // FFmpeg internal state void *vcodec_ctx; ///< FFmpeg: Video codec context void *acodec_ctx; ///< FFmpeg: Audio codec context + void *scodec_ctx; ///< FFmpeg: Subtitle codec context void *tmp_vframe; ///< FFmpeg: Preallocated temporary video frame void *tmp_aframe; ///< FFmpeg: Preallocated temporary audio frame + void *tmp_sframe; ///< FFmpeg: Preallocated temporary subtitle frame void *swr; ///< FFmpeg: Audio resampler void *sws; ///< FFmpeg: Video converter @@ -79,8 +91,11 @@ typedef struct Kit_PlayerInfo { char acodec_name[KIT_CODECNAMEMAX]; ///< Audio codec long, more descriptive name char vcodec[KIT_CODECMAX]; ///< Video codec short name, eg. "x264" char vcodec_name[KIT_CODECNAMEMAX]; ///< Video codec long, more descriptive name + char scodec[KIT_CODECMAX]; ///< Subtitle codec short name, eg. "ass" + char scodec_name[KIT_CODECNAMEMAX]; ///< Subtitle codec long, more descriptive name Kit_VideoFormat video; ///< Video format information Kit_AudioFormat audio; ///< Audio format information + Kit_SubtitleFormat subtitle; ///< Subtitle format information } Kit_PlayerInfo; KIT_API Kit_Player* Kit_CreatePlayer(const Kit_Source *src); diff --git a/include/kitchensink/kitsource.h b/include/kitchensink/kitsource.h index aef9764..ed1711f 100644 --- a/include/kitchensink/kitsource.h +++ b/include/kitchensink/kitsource.h @@ -20,8 +20,9 @@ typedef enum Kit_StreamType { } Kit_StreamType; typedef struct Kit_Source { - int astream_idx; ///< Audiostream index - int vstream_idx; ///< Videostream index + int astream_idx; ///< Audio stream index + int vstream_idx; ///< Video stream index + int sstream_idx; ///< Subtitle stream index void *format_ctx; ///< FFmpeg: Videostream format context } Kit_Source; |