|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* This file is part of libbluray
|
|
Packit |
5e46da |
* Copyright (C) 2009-2010 John Stebbins
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* This library is free software; you can redistribute it and/or
|
|
Packit |
5e46da |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
5e46da |
* License as published by the Free Software Foundation; either
|
|
Packit |
5e46da |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
5e46da |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
5e46da |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
5e46da |
* Lesser General Public License for more details.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
5e46da |
* License along with this library. If not, see
|
|
Packit |
5e46da |
* <http://www.gnu.org/licenses/>.
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#if !defined(_NAVIGATION_H_)
|
|
Packit |
5e46da |
#define _NAVIGATION_H_
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include "util/attributes.h"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include "mpls_data.h"
|
|
Packit |
5e46da |
#include "clpi_data.h"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
struct bd_disc;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#define CONNECT_NON_SEAMLESS 0
|
|
Packit |
5e46da |
#define CONNECT_SEAMLESS 1
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#define TITLES_ALL 0
|
|
Packit |
5e46da |
#define TITLES_FILTER_DUP_TITLE 0x01
|
|
Packit |
5e46da |
#define TITLES_FILTER_DUP_CLIP 0x02
|
|
Packit |
5e46da |
#define TITLES_RELEVANT (TITLES_FILTER_DUP_TITLE | TITLES_FILTER_DUP_CLIP)
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct nav_title_s NAV_TITLE;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct nav_mark_s NAV_MARK;
|
|
Packit |
5e46da |
struct nav_mark_s
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
int number;
|
|
Packit |
5e46da |
int mark_type;
|
|
Packit |
5e46da |
unsigned clip_ref;
|
|
Packit |
5e46da |
uint32_t clip_pkt;
|
|
Packit |
5e46da |
uint32_t clip_time;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
// Title relative metrics
|
|
Packit |
5e46da |
uint32_t title_pkt;
|
|
Packit |
5e46da |
uint32_t title_time;
|
|
Packit |
5e46da |
uint32_t duration;
|
|
Packit |
5e46da |
};
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct nav_mark_list_s NAV_MARK_LIST;
|
|
Packit |
5e46da |
struct nav_mark_list_s
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
unsigned count;
|
|
Packit |
5e46da |
NAV_MARK *mark;
|
|
Packit |
5e46da |
};
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct nav_clip_s NAV_CLIP;
|
|
Packit |
5e46da |
struct nav_clip_s
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
char name[11];
|
|
Packit |
5e46da |
uint32_t clip_id;
|
|
Packit |
5e46da |
unsigned ref;
|
|
Packit |
5e46da |
uint32_t start_pkt;
|
|
Packit |
5e46da |
uint32_t end_pkt;
|
|
Packit |
5e46da |
uint8_t connection;
|
|
Packit |
5e46da |
uint8_t angle;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
uint32_t duration;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
uint32_t in_time;
|
|
Packit |
5e46da |
uint32_t out_time;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
// Title relative metrics
|
|
Packit |
5e46da |
uint32_t title_pkt;
|
|
Packit |
5e46da |
uint32_t title_time;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
NAV_TITLE *title;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
CLPI_CL *cl;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
uint32_t stc_spn; /* start packet of clip STC sequence */
|
|
Packit |
5e46da |
};
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct nav_clip_list_s NAV_CLIP_LIST;
|
|
Packit |
5e46da |
struct nav_clip_list_s
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
unsigned count;
|
|
Packit |
5e46da |
NAV_CLIP *clip;
|
|
Packit |
5e46da |
};
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct nav_sub_path_s NAV_SUB_PATH;
|
|
Packit |
5e46da |
struct nav_sub_path_s
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
uint8_t type;
|
|
Packit |
5e46da |
NAV_CLIP_LIST clip_list;
|
|
Packit |
5e46da |
};
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
struct nav_title_s {
|
|
Packit |
5e46da |
struct bd_disc *disc;
|
|
Packit |
5e46da |
char name[11];
|
|
Packit |
5e46da |
uint8_t angle_count;
|
|
Packit |
5e46da |
uint8_t angle;
|
|
Packit |
5e46da |
NAV_CLIP_LIST clip_list;
|
|
Packit |
5e46da |
NAV_MARK_LIST chap_list;
|
|
Packit |
5e46da |
NAV_MARK_LIST mark_list;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
unsigned sub_path_count;
|
|
Packit |
5e46da |
NAV_SUB_PATH *sub_path;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
uint32_t packets;
|
|
Packit |
5e46da |
uint32_t duration;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
MPLS_PL *pl;
|
|
Packit |
5e46da |
};
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct nav_title_info_s NAV_TITLE_INFO;
|
|
Packit |
5e46da |
struct nav_title_info_s
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
char name[11];
|
|
Packit |
5e46da |
uint32_t mpls_id;
|
|
Packit |
5e46da |
uint32_t duration;
|
|
Packit |
5e46da |
unsigned ref;
|
|
Packit |
5e46da |
};
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct nav_title_list_s NAV_TITLE_LIST;
|
|
Packit |
5e46da |
struct nav_title_list_s
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
unsigned int count;
|
|
Packit |
5e46da |
NAV_TITLE_INFO *title_info;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
unsigned int main_title_idx;
|
|
Packit |
5e46da |
};
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE uint8_t nav_lookup_aspect(NAV_CLIP *clip, int pid);
|
|
Packit |
5e46da |
BD_PRIVATE NAV_TITLE* nav_title_open(struct bd_disc *disc, const char *playlist, unsigned angle) BD_ATTR_MALLOC;
|
|
Packit |
5e46da |
BD_PRIVATE void nav_title_close(NAV_TITLE **title);
|
|
Packit |
5e46da |
BD_PRIVATE NAV_CLIP* nav_next_clip(NAV_TITLE *title, NAV_CLIP *clip);
|
|
Packit |
5e46da |
BD_PRIVATE NAV_CLIP* nav_packet_search(NAV_TITLE *title, uint32_t pkt, uint32_t *clip_pkt,
|
|
Packit |
5e46da |
uint32_t *out_pkt, uint32_t *out_time);
|
|
Packit |
5e46da |
BD_PRIVATE void nav_clip_packet_search(NAV_CLIP *clip, uint32_t pkt, uint32_t *clip_pkt, uint32_t *clip_time);
|
|
Packit |
5e46da |
BD_PRIVATE NAV_CLIP* nav_time_search(NAV_TITLE *title, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt);
|
|
Packit |
5e46da |
BD_PRIVATE void nav_clip_time_search(NAV_CLIP *clip, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt);
|
|
Packit |
5e46da |
BD_PRIVATE NAV_CLIP* nav_chapter_search(NAV_TITLE *title, unsigned chapter, uint32_t *clip_pkt, uint32_t *out_pkt);
|
|
Packit |
5e46da |
BD_PRIVATE uint32_t nav_chapter_get_current(NAV_TITLE *title, uint32_t title_pkt);
|
|
Packit |
5e46da |
BD_PRIVATE NAV_CLIP* nav_mark_search(NAV_TITLE *title, unsigned mark, uint32_t *clip_pkt, uint32_t *out_pkt);
|
|
Packit |
5e46da |
BD_PRIVATE uint32_t nav_angle_change_search(NAV_CLIP *clip, uint32_t pkt, uint32_t *time);
|
|
Packit |
5e46da |
BD_PRIVATE NAV_CLIP* nav_set_angle(NAV_TITLE *title, NAV_CLIP *clip, unsigned angle);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE NAV_TITLE_LIST* nav_get_title_list(struct bd_disc *disc, uint32_t flags, uint32_t min_title_length) BD_ATTR_MALLOC;
|
|
Packit |
5e46da |
BD_PRIVATE void nav_free_title_list(NAV_TITLE_LIST **title_list);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#endif // _NAVIGATION_H_
|