~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to libmpdemux/tvi_def.h

  • Committer: William Grant
  • Date: 2007-02-03 03:16:07 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: william.grant@ubuntu.org.au-20070203031607-08gc2ompbz6spt9i
Update to 1.0rc1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
}