File: caption_decoder.h

package info (click to toggle)
zapping 0.10~cvs6-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 9,856 kB
  • ctags: 11,841
  • sloc: ansic: 111,154; asm: 11,770; sh: 9,812; xml: 2,742; makefile: 1,283; perl: 488
file content (154 lines) | stat: -rw-r--r-- 4,333 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
 *  libzvbi - Caption decoder
 *
 *  Copyright (C) 2000, 2001, 2002, 2005 Michael H. Schimek
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/* $Id: caption_decoder.h,v 1.1 2005/09/01 01:31:55 mschimek Exp $ */

#ifndef __ZVBI3_CAPTION_DECODER_H__
#define __ZVBI3_CAPTION_DECODER_H__

#include <inttypes.h>		/* uint8_t */
#include <stdarg.h>		/* va_list */

#include "macros.h"
#include "bcd.h"		/* vbi3_pgno */
#include "page.h"		/* vbi3_page */
#include "cache.h"		/* vbi3_cache */
#include "network.h"		/* vbi3_network */
#include "event.h"		/* vbi3_event_cb */
#include "sampling_par.h"	/* vbi3_videostd_set */

VBI3_BEGIN_DECLS

/**
 * @addtogroup Caption
 * @{
 */

typedef enum {
	VBI3_CAPTION_MODE_UNKNOWN,
	VBI3_CAPTION_MODE_POP_ON,
	VBI3_CAPTION_MODE_PAINT_ON,
	VBI3_CAPTION_MODE_ROLL_UP,
	VBI3_CAPTION_MODE_TEXT
} vbi3_caption_mode;

/**
 * @brief Meta data and statistical info about a Closed Caption channels.
 */
typedef struct {
	vbi3_pgno		channel;

	/** VBI3_SUBTITLE_PAGE or VBI3_NORMAL_PAGE. */
	vbi3_page_type		page_type;

	vbi3_caption_mode	caption_mode;

	/**
	 * Language, if a subtitle page. This is a ISO 639 two-character 
	 * language code string, for example "fr" for French. Can be
	 * NULL if unknown.
	 */
	const char *		language_code;

	double			last_received;

	void *			reserved1[2];
	unsigned int		reserved2[2];
} vbi3_cc_channel_stat;

extern void
vbi3_cc_channel_stat_destroy	(vbi3_cc_channel_stat *	cs)
  __attribute__ ((_vbi3_nonnull (1)));
extern void
vbi3_cc_channel_stat_init	(vbi3_cc_channel_stat *	cs)
  __attribute__ ((_vbi3_nonnull (1)));

/**
 * @brief Caption decoder.
 *
 * The contents of this structure are private.
 * Call vbi3_caption_decoder_new() to allocate a Caption decoder.
 */
typedef struct _vbi3_caption_decoder vbi3_caption_decoder;

extern vbi3_bool
vbi3_caption_decoder_get_cc_channel_stat
				(vbi3_caption_decoder *	cd,
				 vbi3_cc_channel_stat *	cs,
				 vbi3_pgno		channel)
  __attribute__ ((_vbi3_nonnull (1, 2)));
extern vbi3_page *
vbi3_caption_decoder_get_page_va_list
				(vbi3_caption_decoder *	cd,
				 vbi3_pgno		channel,
				 va_list		format_options)
  __attribute__ ((malloc,
		  _vbi3_nonnull (1)));
extern vbi3_page *
vbi3_caption_decoder_get_page	(vbi3_caption_decoder *	cd,
				 vbi3_pgno		channel,
				 ...)
  __attribute__ ((malloc,
		  _vbi3_nonnull (1),
		  _vbi3_sentinel));
extern vbi3_bool
vbi3_caption_decoder_feed	(vbi3_caption_decoder *	cd,
				 const uint8_t		buffer[2],
				 unsigned int		line,
				 double			timestamp)
  __attribute__ ((_vbi3_nonnull (1, 2)));
extern void
vbi3_caption_decoder_remove_event_handler
				(vbi3_caption_decoder *	cd,
				 vbi3_event_cb *	callback,
				 void *			user_data)
  __attribute__ ((_vbi3_nonnull (1)));
extern vbi3_bool
vbi3_caption_decoder_add_event_handler
				(vbi3_caption_decoder *	cd,
				 unsigned int		event_mask,
				 vbi3_event_cb *	callback,
				 void *			user_data)
  __attribute__ ((_vbi3_nonnull (1)));
extern vbi3_bool
vbi3_caption_decoder_get_network
				(vbi3_caption_decoder *	cd,
				 vbi3_network *		nk)
  __attribute__ ((_vbi3_nonnull (1, 2)));
extern vbi3_cache *
vbi3_caption_decoder_get_cache	(vbi3_caption_decoder *	cd)
  __attribute__ ((_vbi3_nonnull (1)));
extern void
vbi3_caption_decoder_reset	(vbi3_caption_decoder *	cd,
				 const vbi3_network *	nk,
				 vbi3_videostd_set	videostd_set);
extern void
vbi3_caption_decoder_delete	(vbi3_caption_decoder *	cd);
extern vbi3_caption_decoder *
vbi3_caption_decoder_new	(vbi3_cache *		ca,
				 const vbi3_network *	nk,
				 vbi3_videostd_set	videostd_set)
  __attribute__ ((malloc));

/** @} */

VBI3_END_DECLS

#endif /* __ZVBI3_CAPTION_DECODER_H__ */