|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* This file is part of libbluray
|
|
Packit |
5e46da |
* Copyright (C) 2010 Petri Hintukainen <phintuka@users.sourceforge.net>
|
|
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(_HDMV_VM_H_)
|
|
Packit |
5e46da |
#define _HDMV_VM_H_
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include "util/attributes.h"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include <stdint.h>
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* events from hdmv_run()
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef enum {
|
|
Packit |
5e46da |
HDMV_EVENT_NONE = 0, /* no events */
|
|
Packit |
5e46da |
HDMV_EVENT_END, /* end of program (movie object) */
|
|
Packit |
5e46da |
HDMV_EVENT_IG_END, /* end of program (interactive) */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* playback control
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
HDMV_EVENT_TITLE, /* play title (from disc index) */
|
|
Packit |
5e46da |
HDMV_EVENT_PLAY_PL, /* select playlist */
|
|
Packit |
5e46da |
HDMV_EVENT_PLAY_PI, /* seek to playitem */
|
|
Packit |
5e46da |
HDMV_EVENT_PLAY_PM, /* seek to playmark */
|
|
Packit |
5e46da |
HDMV_EVENT_PLAY_STOP, /* stop playing playlist */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
HDMV_EVENT_STILL, /* param: boolean */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* -> graphics controller
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
HDMV_EVENT_SET_BUTTON_PAGE,
|
|
Packit |
5e46da |
HDMV_EVENT_ENABLE_BUTTON,
|
|
Packit |
5e46da |
HDMV_EVENT_DISABLE_BUTTON,
|
|
Packit |
5e46da |
HDMV_EVENT_POPUP_OFF,
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
} hdmv_event_e;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct hdmv_vm_event_s {
|
|
Packit |
5e46da |
hdmv_event_e event;
|
|
Packit |
5e46da |
uint32_t param;
|
|
Packit |
5e46da |
} HDMV_EVENT;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
struct bd_registers_s;
|
|
Packit |
5e46da |
struct bd_disc;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct hdmv_vm_s HDMV_VM;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE HDMV_VM *hdmv_vm_init(struct bd_disc *disc, struct bd_registers_s *regs,
|
|
Packit |
5e46da |
unsigned num_titles, unsigned first_play_available, unsigned top_menu_available);
|
|
Packit |
5e46da |
BD_PRIVATE void hdmv_vm_free(HDMV_VM **p);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE int hdmv_vm_select_object(HDMV_VM *p, uint32_t object);
|
|
Packit |
5e46da |
BD_PRIVATE int hdmv_vm_set_object(HDMV_VM *p, int num_nav_cmds, void *nav_cmds);
|
|
Packit |
5e46da |
BD_PRIVATE int hdmv_vm_run(HDMV_VM *p, HDMV_EVENT *ev);
|
|
Packit |
5e46da |
BD_PRIVATE int hdmv_vm_get_event(HDMV_VM *p, HDMV_EVENT *ev);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE int hdmv_vm_running(HDMV_VM *p);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#define HDMV_MENU_CALL_MASK 0x01
|
|
Packit |
5e46da |
#define HDMV_TITLE_SEARCH_MASK 0x02
|
|
Packit |
5e46da |
BD_PRIVATE uint32_t hdmv_vm_get_uo_mask(HDMV_VM *p);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/**
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* Suspend playlist playback
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* This function assumes playlist is currently playing and
|
|
Packit |
5e46da |
* movie object execution is suspended at PLAY_PL instruction.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* If resume_intention_flag of current movie object is 1:
|
|
Packit |
5e46da |
* Copy playback position PSRs to backup registers
|
|
Packit |
5e46da |
* (suspend playlist playback at current position)
|
|
Packit |
5e46da |
* If resume_intention_flag of current movie object is 0:
|
|
Packit |
5e46da |
* Discard current movie object
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* @param p HDMV_VM object
|
|
Packit |
5e46da |
* @return 0 on success, -1 if error
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
BD_PRIVATE int hdmv_vm_suspend_pl(HDMV_VM *p);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/**
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* Resume HDMV execution
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* Continue execution of movie object after playlist playback.
|
|
Packit |
5e46da |
* Do not restore backup PSRs.
|
|
Packit |
5e46da |
* This function is called when playlist playback ends.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* @param p HDMV_VM object
|
|
Packit |
5e46da |
* @return 0 on success, -1 if error
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
BD_PRIVATE int hdmv_vm_resume(HDMV_VM *p);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* save / restore VM state
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* VM state size */
|
|
Packit |
5e46da |
#define HDMV_STATE_SIZE 10 /* * sizeof(uint32_t) */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE int hdmv_vm_save_state(HDMV_VM *p, uint32_t *s);
|
|
Packit |
5e46da |
BD_PRIVATE void hdmv_vm_restore_state(HDMV_VM *p, const uint32_t *s);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#endif // _HDMV_VM_H_
|