|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* This file is part of libbluray
|
|
Packit |
5e46da |
* Copyright (C) 2010-2012 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(_GRAPHICS_CONTROLLER_H_)
|
|
Packit |
5e46da |
#define _GRAPHICS_CONTROLLER_H_
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include "util/attributes.h"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include "bdnav/uo_mask_table.h"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include <stdint.h>
|
|
Packit |
5e46da |
#include <stddef.h> /* size_t */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
struct bd_registers_s;
|
|
Packit |
5e46da |
struct bd_overlay_s;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* types
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct graphics_controller_s GRAPHICS_CONTROLLER;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef void (*gc_overlay_proc_f)(void *, const struct bd_overlay_s * const);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef enum {
|
|
Packit |
5e46da |
/* */
|
|
Packit |
5e46da |
GC_CTRL_INIT_MENU, /* */
|
|
Packit |
5e46da |
GC_CTRL_NOP, /* No input. Render page / run timers / run animations */
|
|
Packit |
5e46da |
GC_CTRL_RESET, /* reset graphics controller */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* user input */
|
|
Packit |
5e46da |
GC_CTRL_VK_KEY, /* param: bd_vk_key_e */
|
|
Packit |
5e46da |
GC_CTRL_MOUSE_MOVE, /* move selected button to (x,y), param: (x<<16 | y) */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* HDMV VM control messages */
|
|
Packit |
5e46da |
GC_CTRL_ENABLE_BUTTON, /* param: button_id */
|
|
Packit |
5e46da |
GC_CTRL_DISABLE_BUTTON, /* param: button_id */
|
|
Packit |
5e46da |
GC_CTRL_SET_BUTTON_PAGE,
|
|
Packit |
5e46da |
GC_CTRL_POPUP, /* param: on/off */
|
|
Packit |
5e46da |
GC_CTRL_IG_END, /* execution of IG object is complete */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* PG */
|
|
Packit |
5e46da |
GC_CTRL_PG_UPDATE, /* render decoded PG composition */
|
|
Packit |
5e46da |
GC_CTRL_PG_RESET, /* reset PG composition state */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* TextST */
|
|
Packit |
5e46da |
GC_CTRL_PG_CHARCODE,
|
|
Packit |
5e46da |
GC_CTRL_STYLE_SELECT, /* select next TextST user style */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
} gc_ctrl_e;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#define GC_STATUS_NONE 0
|
|
Packit |
5e46da |
#define GC_STATUS_POPUP 1 /* popup menu loaded */
|
|
Packit |
5e46da |
#define GC_STATUS_MENU_OPEN 2 /* menu open */
|
|
Packit |
5e46da |
#define GC_STATUS_ANIMATE 4 /* animation or effect running */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct {
|
|
Packit |
5e46da |
/* HDMV navigation command sequence */
|
|
Packit |
5e46da |
int num_nav_cmds;
|
|
Packit |
5e46da |
void *nav_cmds;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Sound idx */
|
|
Packit |
5e46da |
int sound_id_ref;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* graphics status (none, menu, popup) */
|
|
Packit |
5e46da |
uint32_t status; /* bit mask */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* */
|
|
Packit |
5e46da |
uint32_t wakeup_time;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_UO_MASK page_uo_mask;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
} GC_NAV_CMDS;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* init / free
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE GRAPHICS_CONTROLLER *gc_init(struct bd_registers_s *regs,
|
|
Packit |
5e46da |
void *handle, gc_overlay_proc_f func);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE void gc_free(GRAPHICS_CONTROLLER **p);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/**
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* Decode data from MPEG-TS input stream
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* @param p GRAPHICS_CONTROLLER object
|
|
Packit |
5e46da |
* @param pid mpeg-ts PID to decode (HDMV IG/PG stream)
|
|
Packit |
5e46da |
* @param block mpeg-ts data
|
|
Packit |
5e46da |
* @param num_blocks number of aligned units in data
|
|
Packit |
5e46da |
* @param stc current playback time
|
|
Packit |
5e46da |
* @return <0 on error, 0 when not complete, >0 when complete
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
BD_PRIVATE int gc_decode_ts(GRAPHICS_CONTROLLER *p,
|
|
Packit |
5e46da |
uint16_t pid,
|
|
Packit |
5e46da |
uint8_t *block, unsigned num_blocks,
|
|
Packit |
5e46da |
int64_t stc);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* run graphics controller
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE int gc_run(GRAPHICS_CONTROLLER *p,
|
|
Packit |
5e46da |
/* in */ gc_ctrl_e msg, uint32_t param,
|
|
Packit |
5e46da |
/* out */ GC_NAV_CMDS *cmds);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* Add TextST font
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE int gc_add_font(GRAPHICS_CONTROLLER *p,
|
|
Packit |
5e46da |
void *data, size_t size);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#endif // _GRAPHICS_CONTROLLER_H_
|