1 /* GStreamer Sub-Picture Unit - PGS handling
2 * Copyright (C) 2009 Jan Schmidt <thaytan@noraisin.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GSTSPU_PGS_H__
21 #define __GSTSPU_PGS_H__
23 #include "gstspu-common.h"
25 typedef struct SpuPgsState SpuPgsState;
26 typedef enum PgsCompositionObjectFlags PgsCompositionObjectFlags;
27 typedef enum PgsPresentationSegmentFlags PgsPresentationSegmentFlags;
28 typedef enum PgsObjectUpdateFlags PgsObjectUpdateFlags;
30 typedef struct PgsPresentationSegment PgsPresentationSegment;
31 typedef struct PgsCompositionObject PgsCompositionObject;
33 enum PgsPresentationSegmentFlags
35 PGS_PRES_SEGMENT_FLAG_UPDATE_PALETTE = 0x80
38 enum PgsCompositionObjectFlags
40 PGS_COMPOSITION_OBJECT_FLAG_CROPPED = 0x80,
41 PGS_COMPOSITION_OBJECT_FLAG_FORCED = 0x40
44 enum PgsObjectUpdateFlags
46 /* Set in an object_update if this is the beginning of new RLE data.
47 * If not set, the data is a continuation to be appended */
48 PGS_OBJECT_UPDATE_FLAG_START_RLE = 0x80,
49 PGS_OBJECT_UPDATE_FLAG_END_RLE = 0x40 /* This one is a guess */
52 struct PgsPresentationSegment
54 guint16 composition_no;
55 guint8 composition_state;
57 PgsPresentationSegmentFlags flags;
67 struct PgsCompositionObject
71 PgsCompositionObjectFlags flags;
77 guint32 rle_data_size;
78 guint32 rle_data_used;
80 /* Top left corner of this object */
83 /* Only valid if PGS_COMPOSITION_OBJECT_FLAG_CROPPED is set */
84 guint16 crop_x, crop_y, crop_w, crop_h;
88 GstBuffer *pending_cmd;
90 gboolean in_presentation_segment;
91 gboolean have_presentation_segment;
93 PgsPresentationSegment pres_seg;
95 SpuColour palette[256];
97 guint16 win_x, win_y, win_w, win_h;
100 void gstspu_pgs_handle_new_buf (GstDVDSpu * dvdspu, GstClockTime event_ts, GstBuffer *buf);
101 gboolean gstspu_pgs_execute_event (GstDVDSpu *dvdspu);
102 void gstspu_pgs_render (GstDVDSpu *dvdspu, GstBuffer *buf);
103 gboolean gstspu_pgs_handle_dvd_event (GstDVDSpu *dvdspu, GstEvent *event);
104 void gstspu_pgs_flush (GstDVDSpu *dvdspu);