comparison stream/tvi_def.h @ 19271:64d82a45a05d

introduce new 'stream' directory for all stream layer related components and split them from libmpdemux
author ben
date Mon, 31 Jul 2006 17:39:17 +0000
parents libmpdemux/tvi_def.h@f580a7755ac5
children 6cabac4d35b5
comparison
equal deleted inserted replaced
19270:7d39b911f0bd 19271:64d82a45a05d
1 #include <stdlib.h> /* malloc */
2 #include <string.h> /* memset */
3
4 static int init(priv_t *priv);
5 static int uninit(priv_t *priv);
6 static int control(priv_t *priv, int cmd, void *arg);
7 static int start(priv_t *priv);
8 static double grab_video_frame(priv_t *priv, char *buffer, int len);
9 #ifdef HAVE_TV_BSDBT848
10 static double grabimmediate_video_frame(priv_t *priv, char *buffer, int len);
11 #endif
12 static int get_video_framesize(priv_t *priv);
13 static double grab_audio_frame(priv_t *priv, char *buffer, int len);
14 static int get_audio_framesize(priv_t *priv);
15
16 static tvi_functions_t functions =
17 {
18 init,
19 uninit,
20 control,
21 start,
22 grab_video_frame,
23 #ifdef HAVE_TV_BSDBT848
24 grabimmediate_video_frame,
25 #endif
26 get_video_framesize,
27 grab_audio_frame,
28 get_audio_framesize
29 };
30
31 static tvi_handle_t *new_handle(void)
32 {
33 tvi_handle_t *h = (tvi_handle_t *)malloc(sizeof(tvi_handle_t));
34
35 if (!h)
36 return(NULL);
37 h->priv = (priv_t *)malloc(sizeof(priv_t));
38 if (!h->priv)
39 {
40 free(h);
41 return(NULL);
42 }
43 memset(h->priv, 0, sizeof(priv_t));
44 h->info = &info;
45 h->functions = &functions;
46 h->seq = 0;
47 h->chanlist = -1;
48 h->chanlist_s = NULL;
49 h->norm = -1;
50 h->channel = -1;
51 return(h);
52 }
53
54 static void free_handle(tvi_handle_t *h)
55 {
56 if (h) {
57 if (h->priv)
58 free(h->priv);
59 free(h);
60 }
61 }