|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* This file is part of libbluray
|
|
Packit |
5e46da |
* Copyright (C) 2010-2013 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_PROCESSOR_H_)
|
|
Packit |
5e46da |
#define _GRAPHICS_PROCESSOR_H_
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include "pg.h"
|
|
Packit |
5e46da |
#include "ig.h"
|
|
Packit |
5e46da |
#include "textst.h"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include "util/attributes.h"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include <stdint.h>
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct graphics_processor_s GRAPHICS_PROCESSOR;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* PG_DISPLAY_SET
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct {
|
|
Packit |
5e46da |
int64_t valid_pts;
|
|
Packit |
5e46da |
uint8_t complete; /* set complete: last decoded segment was END_OF_DISPLAY */
|
|
Packit |
5e46da |
uint8_t epoch_start;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
unsigned num_palette;
|
|
Packit |
5e46da |
unsigned num_object;
|
|
Packit |
5e46da |
unsigned num_window;
|
|
Packit |
5e46da |
unsigned num_dialog; /* number of decoded dialog segments */
|
|
Packit |
5e46da |
unsigned total_dialog; /* total dialog segments in stream */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PG_PALETTE *palette;
|
|
Packit |
5e46da |
BD_PG_OBJECT *object;
|
|
Packit |
5e46da |
BD_PG_WINDOW *window;
|
|
Packit |
5e46da |
BD_TEXTST_DIALOG_PRESENTATION *dialog;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* only one of the following segments can be present */
|
|
Packit |
5e46da |
BD_IG_INTERACTIVE *ics;
|
|
Packit |
5e46da |
BD_PG_COMPOSITION *pcs;
|
|
Packit |
5e46da |
BD_TEXTST_DIALOG_STYLE *style;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
uint8_t decoding; /* internal flag: PCS/ICS decoded, but no end of presentation seen yet */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
} PG_DISPLAY_SET;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE void pg_display_set_free(PG_DISPLAY_SET **s);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* graphics processor
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE GRAPHICS_PROCESSOR *graphics_processor_init(void);
|
|
Packit |
5e46da |
BD_PRIVATE void graphics_processor_free(GRAPHICS_PROCESSOR **p);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/**
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* Decode data from MPEG-TS input stream
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* Segments are queued and decoded when DTS <= STC.
|
|
Packit |
5e46da |
* If STC < 0, all segments are immediately decoded to display set.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* @param p GRAPHICS_PROCESSOR object
|
|
Packit |
5e46da |
* @param s display set
|
|
Packit |
5e46da |
* @param pid mpeg-ts PID to decode (HDMV IG/PG stream)
|
|
Packit |
5e46da |
* @param unit mpeg-ts data
|
|
Packit |
5e46da |
* @param num_units number of aligned units in data
|
|
Packit |
5e46da |
* @param stc current playback time
|
|
Packit |
5e46da |
* @return 1 if display set was completed, 0 otherwise
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
BD_PRIVATE int
|
|
Packit |
5e46da |
graphics_processor_decode_ts(GRAPHICS_PROCESSOR *p,
|
|
Packit |
5e46da |
PG_DISPLAY_SET **s,
|
|
Packit |
5e46da |
uint16_t pid, uint8_t *unit, unsigned num_units,
|
|
Packit |
5e46da |
int64_t stc);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#endif // _GRAPHICS_PROCESSOR_H_
|