2009-05-20 07:55:40 +00:00
|
|
|
/* GStreamer Sub-Picture Unit - PGS handling
|
|
|
|
* Copyright (C) 2009 Jan Schmidt <thaytan@noraisin.net>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:38:00 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2009-05-20 07:55:40 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GSTSPU_PGS_H__
|
|
|
|
#define __GSTSPU_PGS_H__
|
|
|
|
|
2009-05-23 22:19:05 +00:00
|
|
|
#include "gstspu-common.h"
|
2009-05-20 07:55:40 +00:00
|
|
|
|
2009-05-23 22:19:05 +00:00
|
|
|
typedef struct SpuPgsState SpuPgsState;
|
|
|
|
typedef enum PgsCompositionObjectFlags PgsCompositionObjectFlags;
|
|
|
|
typedef enum PgsPresentationSegmentFlags PgsPresentationSegmentFlags;
|
|
|
|
typedef enum PgsObjectUpdateFlags PgsObjectUpdateFlags;
|
2009-05-20 07:55:40 +00:00
|
|
|
|
2009-05-23 22:19:05 +00:00
|
|
|
typedef struct PgsPresentationSegment PgsPresentationSegment;
|
|
|
|
typedef struct PgsCompositionObject PgsCompositionObject;
|
2009-05-20 07:55:40 +00:00
|
|
|
|
2009-05-23 22:19:05 +00:00
|
|
|
enum PgsPresentationSegmentFlags
|
|
|
|
{
|
|
|
|
PGS_PRES_SEGMENT_FLAG_UPDATE_PALETTE = 0x80
|
|
|
|
};
|
2009-05-20 07:55:40 +00:00
|
|
|
|
2009-05-23 22:19:05 +00:00
|
|
|
enum PgsCompositionObjectFlags
|
|
|
|
{
|
|
|
|
PGS_COMPOSITION_OBJECT_FLAG_CROPPED = 0x80,
|
|
|
|
PGS_COMPOSITION_OBJECT_FLAG_FORCED = 0x40
|
|
|
|
};
|
2009-05-20 07:55:40 +00:00
|
|
|
|
2009-05-23 22:19:05 +00:00
|
|
|
enum PgsObjectUpdateFlags
|
|
|
|
{
|
2009-05-20 07:55:40 +00:00
|
|
|
/* Set in an object_update if this is the beginning of new RLE data.
|
|
|
|
* If not set, the data is a continuation to be appended */
|
2009-05-23 22:19:05 +00:00
|
|
|
PGS_OBJECT_UPDATE_FLAG_START_RLE = 0x80,
|
|
|
|
PGS_OBJECT_UPDATE_FLAG_END_RLE = 0x40 /* This one is a guess */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PgsPresentationSegment
|
|
|
|
{
|
|
|
|
guint16 composition_no;
|
|
|
|
guint8 composition_state;
|
|
|
|
|
|
|
|
PgsPresentationSegmentFlags flags;
|
|
|
|
|
|
|
|
guint8 palette_id;
|
|
|
|
|
|
|
|
guint16 vid_w, vid_h;
|
|
|
|
guint8 vid_fps_code;
|
|
|
|
|
|
|
|
GArray *objects;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PgsCompositionObject
|
|
|
|
{
|
|
|
|
guint16 id;
|
|
|
|
guint8 version;
|
|
|
|
PgsCompositionObjectFlags flags;
|
|
|
|
|
|
|
|
guint8 win_id;
|
|
|
|
|
|
|
|
guint8 rle_data_ver;
|
|
|
|
guint8 *rle_data;
|
|
|
|
guint32 rle_data_size;
|
|
|
|
guint32 rle_data_used;
|
|
|
|
|
|
|
|
/* Top left corner of this object */
|
|
|
|
guint16 x, y;
|
|
|
|
|
|
|
|
/* Only valid if PGS_COMPOSITION_OBJECT_FLAG_CROPPED is set */
|
|
|
|
guint16 crop_x, crop_y, crop_w, crop_h;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SpuPgsState {
|
|
|
|
GstBuffer *pending_cmd;
|
|
|
|
|
|
|
|
gboolean in_presentation_segment;
|
|
|
|
gboolean have_presentation_segment;
|
|
|
|
|
|
|
|
PgsPresentationSegment pres_seg;
|
|
|
|
|
|
|
|
SpuColour palette[256];
|
|
|
|
|
|
|
|
guint16 win_x, win_y, win_w, win_h;
|
|
|
|
};
|
|
|
|
|
|
|
|
void gstspu_pgs_handle_new_buf (GstDVDSpu * dvdspu, GstClockTime event_ts, GstBuffer *buf);
|
|
|
|
gboolean gstspu_pgs_execute_event (GstDVDSpu *dvdspu);
|
2011-10-08 13:16:25 +00:00
|
|
|
void gstspu_pgs_render (GstDVDSpu *dvdspu, GstVideoFrame *frame);
|
2009-05-23 22:19:05 +00:00
|
|
|
gboolean gstspu_pgs_handle_dvd_event (GstDVDSpu *dvdspu, GstEvent *event);
|
|
|
|
void gstspu_pgs_flush (GstDVDSpu *dvdspu);
|
2009-05-20 07:55:40 +00:00
|
|
|
|
|
|
|
#endif
|