summaryrefslogtreecommitdiff
path: root/include/kitchensink/kitplayer.h
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2016-01-15 00:33:47 +0200
committerTuomas Virtanen <katajakasa@gmail.com>2016-01-16 17:57:00 +0200
commit20bfdbb781575fd6ee3c6e8624a09e314b65a162 (patch)
tree95e1f9bb6fc1835fc60c5a69b5abbd68b98381b5 /include/kitchensink/kitplayer.h
parentcd610394c6798884ff416bf9a91a55bae3a6971f (diff)
Initial work on subtitle streams
Diffstat (limited to 'include/kitchensink/kitplayer.h')
-rw-r--r--include/kitchensink/kitplayer.h17
1 files changed, 16 insertions, 1 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);