Add packet interleaving and improve encoder API

- Add interleaving of video/audio packets for outputs that are encoded
   and expect both video and audio data, sorting the packets and sending
   them to the output when both video and audio is received.

 - Combine create and initialize callbacks for the encoder API callback
   interface.
This commit is contained in:
jp9000
2014-04-04 23:21:19 -07:00
parent 42be968759
commit 8c74db9ffc
8 changed files with 175 additions and 89 deletions

View File

@@ -109,7 +109,8 @@ struct obs_encoder_info {
*
* @param settings Settings for the encoder
* @param encoder OBS encoder context
* @return Data associated with this encoder context
* @return Data associated with this encoder context, or
* NULL if initialization failed.
*/
void *(*create)(obs_data_t settings, obs_encoder_t encoder);
@@ -120,16 +121,6 @@ struct obs_encoder_info {
*/
void (*destroy)(void *data);
/**
* Initializes the encoder with the specified settings
*
* @param data Data associated with this encoder context
* @param settings Settings for the encoder
* @return true if the encoder settings are valid and the
* encoder is ready to be used, false otherwise
*/
bool (*initialize)(void *data, obs_data_t settings);
/**
* Encodes frame(s), and outputs encoded packets as they become
* available.