2 * Copyright (C) 2015 Samsung Electronics Co., Ltd.
3 * @Author: Chengjun Wang <cjun.wang@samsung.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
22 #ifndef __GST_CEA_CC_OVERLAY_H__
23 #define __GST_CEA_CC_OVERLAY_H__
26 #include <pango/pangocairo.h>
27 #include <gstcea708decoder.h>
30 #define GST_TYPE_CEA_CC_OVERLAY \
31 (gst_cea_cc_overlay_get_type())
32 #define GST_CEA_CC_OVERLAY(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CEA_CC_OVERLAY,GstCeaCcOverlay))
34 #define GST_CEA_CC_OVERLAY_CLASS(klass) \
35 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CEA_CC_OVERLAY,GstCeaCcOverlayClass))
36 #define GST_CEA_CC_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
37 GST_TYPE_CEA_CC_OVERLAY, GstCeaCcOverlayClass))
38 #define GST_IS_CEA_CC_OVERLAY(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CEA_CC_OVERLAY))
40 #define GST_IS_CEA_CC_OVERLAY_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CEA_CC_OVERLAY))
43 typedef struct _GstCeaCcOverlay GstCeaCcOverlay;
44 typedef struct _GstCeaCcOverlayClass GstCeaCcOverlayClass;
55 * GstBaseTextOverlayHAlign:
56 * @GST_CEA_CC_OVERLAY_WIN_H_LEFT: closed caption window horizontal anchor left
57 * @GST_CEA_CC_OVERLAY_WIN_H_CENTER: closed caption window horizontal anchor center
58 * @GST_CEA_CC_OVERLAY_WIN_H_RIGHT: closed caption window horizontal anchor right
59 * @GST_CEA_CC_OVERLAY_WIN_H_AUTO: closed caption window horizontal anchor auto
61 * Closed Caption Window Horizontal anchor position.
65 GST_CEA_CC_OVERLAY_WIN_H_LEFT,
66 GST_CEA_CC_OVERLAY_WIN_H_CENTER,
67 GST_CEA_CC_OVERLAY_WIN_H_RIGHT,
68 GST_CEA_CC_OVERLAY_WIN_H_AUTO
69 } GstCeaCcOverlayWinHPos;
74 * Opaque ccoverlay data structure.
76 struct _GstCeaCcOverlay
79 GstPad *video_sinkpad;
82 /* There are two possible 608 streams encapsulated by 708 */
83 gint16 cea608_index[NUM_608_CCTYPES];
85 guint8 cea608_buffer[NUM_608_CCTYPES][DTVCC_LENGTH];
86 guint8 cea708_buffer[DTVCC_LENGTH];
88 /* TRUE if input is CDP, FALSE if cc_data triplet */
92 GstSegment cc_segment;
93 GstVideoOverlayComposition *current_composition;
94 guint64 current_comp_start_time;
95 GstVideoOverlayComposition *next_composition;
96 guint64 next_comp_start_time;
97 GstCeaCcOverlayWinHPos default_window_h_pos;
98 gboolean cc_pad_linked;
99 gboolean video_flushing;
101 gboolean cc_flushing;
105 GCond cond; /* to signal removal of a queued text
106 * buffer, arrival of a text buffer,
107 * a text segment update, or a change
108 * in status (e.g. shutdown, flushing) */
111 GstVideoFormat format;
119 gboolean need_update;
121 gboolean attach_compo_to_buffer;
124 /* FIXME : Pango context and MT-safe since 1.32.6 */
125 struct _GstCeaCcOverlayClass
127 GstElementClass parent_class;
129 PangoContext *pango_context;
133 GType gst_cea_cc_overlay_get_type (void);
136 #endif /* __GST_CEA_CC_OVERLAY_H__ */