Skip to content

Commit

Permalink
dash_mpd_segment callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ireader committed Jan 14, 2018
1 parent efa6433 commit 57885e5
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 114 deletions.
12 changes: 5 additions & 7 deletions libdash/include/dash-mpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ extern "C" {

typedef struct dash_mpd_t dash_mpd_t;

struct dash_mpd_notify_t
{
int (*onupdate)(void* param);
};
typedef int (*dash_mpd_segment)(void* param, int adapation, const void* data, size_t bytes, int64_t pts, int64_t dts, int64_t duration, const char* name);

dash_mpd_t* dash_mpd_create(const char* name, int flags, struct dash_mpd_notify_t* notify, void* param);
dash_mpd_t* dash_mpd_create(int flags, dash_mpd_segment handler, void* param);
void dash_mpd_destroy(dash_mpd_t* mpd);

/// @param[in] prefix dash adapation set name prefix
/// @return >=0-adapation id, <0-error
int dash_mpd_add_video_adapation_set(dash_mpd_t* mpd, uint8_t object, int width, int height, const void* extra_data, size_t extra_data_size);
int dash_mpd_add_audio_adapation_set(dash_mpd_t* mpd, uint8_t object, int channel_count, int bits_per_sample, int sample_rate, const void* extra_data, size_t extra_data_size);
int dash_mpd_add_video_adapation_set(dash_mpd_t* mpd, const char* prefix, uint8_t object, int width, int height, const void* extra_data, size_t extra_data_size);
int dash_mpd_add_audio_adapation_set(dash_mpd_t* mpd, const char* prefix, uint8_t object, int channel_count, int bits_per_sample, int sample_rate, const void* extra_data, size_t extra_data_size);

/// @param[in] adapation create by dash_mpd_add_video_adapation_set/dash_mpd_add_audio_adapation_set
int dash_mpd_input(dash_mpd_t* mpd, int adapation, const void* data, size_t bytes, int64_t pts, int64_t dts, int flags);
Expand Down
Loading

0 comments on commit 57885e5

Please sign in to comment.