Commit 9d7cee2d authored by François Grisez's avatar François Grisez

Add comments to mkv_reader.h and stream_regulator.h

parent 35dc840c
......@@ -81,31 +81,86 @@ typedef struct {
int channels;
} MKVAudioTrack;
typedef struct {
uint8_t track;
uint64_t cluster_pos;
uint64_t relative_pos;
} MKVCueTrackPosition;
typedef struct {
uint64_t time;
MSList *track_positions;
} MKVCuePoint;
typedef struct _MKVTrackReader MKVTrackReader;
/**
* @brief Open a MKV file for reading
* @param filename Name of the file to open
* @return A pointer on a MKVReader. NULL if opening fails
*/
extern MKVReader *mkv_reader_open(const char *filename);
/**
* @brief Close a MKV file.
* All associated track readers will be automatically destroyed
* @param obj MKVReader
*/
extern void mkv_reader_close(MKVReader *obj);
/**
* @brief Get information about the Matroska segment
* @param reader MKVReader
* @return Matroska segment information
*/
extern inline const MKVSegmentInfo *mkv_reader_get_segment_info(const MKVReader *reader);
/**
* @brief Get the default track for a specified track type
* @param r MKVReader object
* @param track_type Type of the track
* @return A pointer on a track descriptor
*/
extern const MKVTrack *mkv_reader_get_default_track(MKVReader *r, int track_type);
/**
* @brief Get the first track of the specified type
* @param r MKVReader object
* @param track_type Type of the track
* @return A track descriptor
*/
extern const MKVTrack *mkv_reader_get_first_track(MKVReader *r, int track_type);
/**
* @brief Create a track reader from its track number
* @param reader MKVReader
* @param track_num Track number
* @return A pointer on a track reader
*/
extern MKVTrackReader *mkv_reader_get_track_reader(MKVReader *reader, int track_num);
/**
* @brief Set the reading head of each assocated track reader at a specific position
* @param reader MKVReader
* @param pos_ms Position of the head in miliseconds
* @return The effective position of the head after the operation
*/
extern int mkv_reader_seek(MKVReader *reader, int pos_ms);
/**
* @brief Get the next block
* @param reader MKVReader
* @param block Block data
* @param end_of_track Return TRUE when the end of the track has been reached
*/
extern void mkv_track_reader_next_block(MKVTrackReader *reader, MKVBlock **block, bool_t *end_of_track);
/**
* @brief Reset the track reader.
* The reading head is set at the start of the track
* @param reader MKVReader
*/
extern void mkv_track_reader_reset(MKVTrackReader *reader);
/**
* @brief Destroy a track reader
* @param reader Track reader to destroy
*/
extern void mkv_track_reader_destroy(MKVTrackReader *reader);
/**
* @brief Free block data
* @param block MKV block to free
*/
extern void mkv_block_free(MKVBlock *block);
#endif
......@@ -23,12 +23,46 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ortp/str_utils.h"
#include "mediastreamer2/msticker.h"
/**
* @brief MSStreamRegulator aims to synchronise a stream of mblk_t with a ticker
*/
typedef struct _MSStreamRegulator MSStreamRegulator;
/**
* @brief Create an MSStreamRegulator
* @param ticker Ticker which will be used to synchronise the mblkt
* @param clock_rate Clock rate used to encode timestamp in the mblk_t
* @return The pointer on the created MSStreamRegulator
*/
extern MSStreamRegulator *ms_stream_regulator_new(MSTicker *ticker, int64_t clock_rate);
/**
* @brief Destroy an MSStreamRegulator
* @param obj Stream regulator to destroy
*/
extern void ms_stream_regulator_free(MSStreamRegulator *obj);
/**
* @brief Put an mblk_t buffer in the waiting queue of the stream regulator
* @param obj MSStreamRegulator
* @param pkt Buffer to store
*/
extern void ms_stream_regulator_push(MSStreamRegulator *obj, mblk_t *pkt);
/**
* @brief Get the next waiting buffer.
* If the timestamp of the next buffer is greater than ticker time, the buffer is unqueued
* and the function return a pointer on it. Else, no buffer is unqueued and NULL is returned
* @param obj MSStreamRegulator
* @return Pointer on the unqueued buffer
*/
extern mblk_t *ms_stream_regulator_get(MSStreamRegulator *obj);
/**
* @brief Reset the stream regulator
* All waiting buffer are destroyed
* @param obj MSStreamRegulator
*/
extern void ms_stream_regulator_reset(MSStreamRegulator *obj);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment