1
0
Fork 0

Added bd_get_clip_infos

This function allows for querying information directly related to the
clips inside a title.
This commit is contained in:
Hendrik Leppkes 2011-03-28 22:39:52 +02:00
parent 8862ab84bc
commit 52c1bbba6e
3 changed files with 31 additions and 1 deletions

View File

@ -54,6 +54,7 @@ EXPORTS
bd_free_mpls
bd_read_mobj
bd_free_mobj
bd_get_clip_infos
; additional functions
bd_set_debug_handler

View File

@ -3917,3 +3917,20 @@ void bd_free_bdjo(struct bdjo_data *obj)
{
bdjo_free(&obj);
}
int bd_get_clip_infos(BLURAY *bd, unsigned clip, uint64_t *clip_start_time, uint64_t *stream_start_time, uint64_t *pos, uint64_t *duration)
{
if (bd && bd->title && bd->title->clip_list.count > clip) {
if (clip_start_time)
*clip_start_time = (uint64_t)bd->title->clip_list.clip[clip].title_time << 1;
if (stream_start_time)
*stream_start_time = (uint64_t)bd->title->clip_list.clip[clip].in_time << 1;
if (pos)
*pos = (uint64_t)bd->title->clip_list.clip[clip].title_pkt * 192;
if (duration)
*duration = (uint64_t)bd->title->clip_list.clip[clip].duration << 1;
return 1;
}
return 0;
}

View File

@ -177,7 +177,7 @@ typedef enum {
BLURAY_AUDIO_FORMAT_MONO = 1,
BLURAY_AUDIO_FORMAT_STEREO = 3,
BLURAY_AUDIO_FORMAT_MULTI_CHAN = 6,
BLURAY_AUDIO_FORMAT_COMBO = 12 // Stereo ac3/dts,
BLURAY_AUDIO_FORMAT_COMBO = 12 // Stereo ac3/dts,
} bd_audio_format_e;
// multi mlp/dts-hd
@ -1129,6 +1129,18 @@ int bd_read_file(BLURAY *, const char *path, void **data, int64_t *size);
struct bd_dir_s *bd_open_dir(BLURAY *, const char *dir);
struct bd_file_s *bd_open_file_dec(BLURAY *, const char *path);
/**
*
* Get information about the clip
*
* @param bd BLURAY object
* @param clip clip index
* @param clip_start_time start of the clip (in the total title) (in 90khz)
* @param stream_start_time first pts in the clip (in 90khz)
* @param byte position of the clip (absolute)
* @param duration duration of the clip (in 90khz)
*/
int bd_get_clip_infos(BLURAY *bd, unsigned clip, uint64_t *clip_start_time, uint64_t *stream_start_time, uint64_t *pos, uint64_t *duration);
#ifdef __cplusplus
}