~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to libmpdemux/tvi_def.h

  • Committer: Reinhard Tartler
  • Date: 2006-07-08 08:45:33 UTC
  • Revision ID: siretart@tauware.de-20060708084533-dbc155bde7122e78
imported mplayer_0.99+1.0pre7try2+cvs20060117

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()
 
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
}