summaryrefslogtreecommitdiff
path: root/gst/closedcaption/cc608_decoder.h
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2018-03-20 07:53:54 +0100
committerEdward Hervey <bilboed@bilboed.com>2018-03-22 08:22:43 +0100
commit63383bb6d862b9597d04563d938b3c30463e6db6 (patch)
tree47f15babb994488d0c06c0f93e63c881d133cad4 /gst/closedcaption/cc608_decoder.h
parente26773a4d2c16b0ae5f4a640583cb87d731215c8 (diff)
closedcaption: Add more zvbi code (cea 608 decoding)
Not used yet. Same as current master zapping code. All LGPL licensed. * Ran gst-indent * Disabled "iconv-like" functions. Should be replaced by glib methods
Diffstat (limited to 'gst/closedcaption/cc608_decoder.h')
-rw-r--r--gst/closedcaption/cc608_decoder.h131
1 files changed, 131 insertions, 0 deletions
diff --git a/gst/closedcaption/cc608_decoder.h b/gst/closedcaption/cc608_decoder.h
new file mode 100644
index 000000000..8f88d531d
--- /dev/null
+++ b/gst/closedcaption/cc608_decoder.h
@@ -0,0 +1,131 @@
+/*
+ * libzvbi - EIA 608-B Closed Caption decoder
+ *
+ * Copyright (C) 2008 Michael H. Schimek
+ *
+ * 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
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ */
+
+/* $Id: cc608_decoder.h,v 1.2 2009-12-14 23:43:26 mschimek Exp $ */
+
+/* This code is experimental and not yet part of the library. */
+
+#ifndef __ZVBI_CC608_DECODER_H__
+#define __ZVBI_CC608_DECODER_H__
+
+#include <stdio.h>
+
+#include "format.h"
+#include "event.h"
+#include "sliced.h"
+
+VBI_BEGIN_DECLS
+
+/* Public */
+
+#define VBI_CAPTION_CC1 1 /* primary synchronous caption service (F1) */
+#define VBI_CAPTION_CC2 2 /* special non-synchronous use captions (F1) */
+#define VBI_CAPTION_CC3 3 /* secondary synchronous caption service (F2) */
+#define VBI_CAPTION_CC4 4 /* special non-synchronous use captions (F2) */
+
+#define VBI_CAPTION_T1 5 /* first text service (F1) */
+#define VBI_CAPTION_T2 6 /* second text service (F1) */
+#define VBI_CAPTION_T3 7 /* third text service (F2) */
+#define VBI_CAPTION_T4 8 /* fourth text service (F2) */
+
+/** @internal */
+typedef enum {
+ _VBI_CC608_MODE_UNKNOWN,
+ _VBI_CC608_MODE_ROLL_UP,
+ _VBI_CC608_MODE_POP_ON,
+ _VBI_CC608_MODE_PAINT_ON,
+ _VBI_CC608_MODE_TEXT
+} _vbi_cc608_mode;
+
+/** @internal */
+typedef enum {
+ _VBI_CC608_START_ROLLING = (1 << 0)
+} _vbi_cc608_event_flags;
+
+/** @internal */
+struct _vbi_event_cc608_page {
+ int channel;
+ _vbi_cc608_mode mode;
+ _vbi_cc608_event_flags flags;
+};
+
+/** @internal */
+struct _vbi_event_cc608_stream {
+ double capture_time;
+ int64_t pts;
+ int channel;
+ _vbi_cc608_mode mode;
+ vbi_char text[32];
+};
+
+typedef struct _vbi_cc608_decoder _vbi_cc608_decoder;
+
+extern void
+_vbi_cc608_dump (FILE * fp,
+ unsigned int c1,
+ unsigned int c2);
+extern vbi_bool
+_vbi_cc608_decoder_get_page (_vbi_cc608_decoder * cd,
+ vbi_page * pg,
+ vbi_pgno channel,
+ vbi_bool padding);
+extern vbi_bool
+_vbi_cc608_decoder_feed (_vbi_cc608_decoder * cd,
+ const uint8_t buffer[2],
+ unsigned int line,
+ double capture_time,
+ int64_t pts);
+extern vbi_bool
+_vbi_cc608_decoder_feed_frame (_vbi_cc608_decoder * cd,
+ const vbi_sliced * sliced,
+ unsigned int n_lines,
+ double capture_time,
+ int64_t pts);
+extern void
+_vbi_cc608_decoder_remove_event_handler
+ (_vbi_cc608_decoder * cd,
+ vbi_event_handler callback,
+ void * user_data);
+extern vbi_bool
+_vbi_cc608_decoder_add_event_handler
+ (_vbi_cc608_decoder * cd,
+ unsigned int event_mask,
+ vbi_event_handler callback,
+ void * user_data);
+extern void
+_vbi_cc608_decoder_reset (_vbi_cc608_decoder * cd);
+extern void
+_vbi_cc608_decoder_delete (_vbi_cc608_decoder * cd);
+extern _vbi_cc608_decoder *
+_vbi_cc608_decoder_new (void);
+
+/* Private */
+
+VBI_END_DECLS
+
+#endif /* __ZVBI_CC608_DECODER_H__ */
+
+/*
+Local variables:
+c-set-style: K&R
+c-basic-offset: 8
+End:
+*/