annotate libmpdemux/tvi_dummy.c @ 3055:38df49b91824

remove dga support
author pontscho
date Wed, 21 Nov 2001 18:40:59 +0000
parents c63562f5f56f
children 5fb624943c90
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
1 /*
09d5c9834580 tv update
alex
parents: 2790
diff changeset
2 Only a sample!
09d5c9834580 tv update
alex
parents: 2790
diff changeset
3 */
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
4
98769cea155c added tv subsystem
alex
parents:
diff changeset
5 #include "config.h"
98769cea155c added tv subsystem
alex
parents:
diff changeset
6
98769cea155c added tv subsystem
alex
parents:
diff changeset
7 #ifdef USE_TV
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
8
09d5c9834580 tv update
alex
parents: 2790
diff changeset
9 #include <stdio.h>
2830
596a6ba3520f never include files from public headers...
arpi
parents: 2815
diff changeset
10 #include "../libvo/img_format.h"
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
11 #include "tv.h"
98769cea155c added tv subsystem
alex
parents:
diff changeset
12
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
13 /* information about this file */
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
14 static tvi_info_t info = {
98769cea155c added tv subsystem
alex
parents:
diff changeset
15 "NULL-TV",
98769cea155c added tv subsystem
alex
parents:
diff changeset
16 "dummy",
98769cea155c added tv subsystem
alex
parents:
diff changeset
17 "alex",
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
18 NULL
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
19 };
98769cea155c added tv subsystem
alex
parents:
diff changeset
20
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
21 /* private data's */
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
22 typedef struct {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
23 int width;
09d5c9834580 tv update
alex
parents: 2790
diff changeset
24 int height;
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
25 } priv_t;
98769cea155c added tv subsystem
alex
parents:
diff changeset
26
98769cea155c added tv subsystem
alex
parents:
diff changeset
27 #include "tvi_def.h"
98769cea155c added tv subsystem
alex
parents:
diff changeset
28
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
29 /* handler creator - entry point ! */
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
30 tvi_handle_t *tvi_init_dummy(char *device)
98769cea155c added tv subsystem
alex
parents:
diff changeset
31 {
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
32 return(new_handle());
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
33 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
34
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
35 /* initialisation */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
36 static int init(priv_t *priv, tvi_param_t *params)
09d5c9834580 tv update
alex
parents: 2790
diff changeset
37 {
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
38 return(1);
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
39 }
09d5c9834580 tv update
alex
parents: 2790
diff changeset
40
09d5c9834580 tv update
alex
parents: 2790
diff changeset
41 /* that's the real start, we'got the format parameters (checked with control) */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
42 static int start(priv_t *priv)
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
43 {
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
44 return(1);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
45 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
46
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
47 static int uninit(priv_t *priv)
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
48 {
98769cea155c added tv subsystem
alex
parents:
diff changeset
49 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
50
98769cea155c added tv subsystem
alex
parents:
diff changeset
51 static int control(priv_t *priv, int cmd, void *arg)
98769cea155c added tv subsystem
alex
parents:
diff changeset
52 {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
53 switch(cmd)
09d5c9834580 tv update
alex
parents: 2790
diff changeset
54 {
09d5c9834580 tv update
alex
parents: 2790
diff changeset
55 case TVI_CONTROL_IS_VIDEO:
09d5c9834580 tv update
alex
parents: 2790
diff changeset
56 return(TVI_CONTROL_TRUE);
09d5c9834580 tv update
alex
parents: 2790
diff changeset
57 case TVI_CONTROL_VID_GET_FORMAT:
09d5c9834580 tv update
alex
parents: 2790
diff changeset
58 (int)*(void **)arg = IMGFMT_YV12;
09d5c9834580 tv update
alex
parents: 2790
diff changeset
59 return(TVI_CONTROL_TRUE);
2815
alex
parents: 2802
diff changeset
60 case TVI_CONTROL_VID_SET_FORMAT:
alex
parents: 2802
diff changeset
61 {
alex
parents: 2802
diff changeset
62 int req_fmt = (int)*(void **)arg;
alex
parents: 2802
diff changeset
63 if (req_fmt != IMGFMT_YV12)
alex
parents: 2802
diff changeset
64 return(TVI_CONTROL_FALSE);
alex
parents: 2802
diff changeset
65 return(TVI_CONTROL_TRUE);
alex
parents: 2802
diff changeset
66 }
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
67 case TVI_CONTROL_VID_SET_WIDTH:
09d5c9834580 tv update
alex
parents: 2790
diff changeset
68 priv->width = (int)*(void **)arg;
09d5c9834580 tv update
alex
parents: 2790
diff changeset
69 return(TVI_CONTROL_TRUE);
09d5c9834580 tv update
alex
parents: 2790
diff changeset
70 case TVI_CONTROL_VID_SET_HEIGHT:
09d5c9834580 tv update
alex
parents: 2790
diff changeset
71 priv->height = (int)*(void **)arg;
09d5c9834580 tv update
alex
parents: 2790
diff changeset
72 return(TVI_CONTROL_TRUE);
09d5c9834580 tv update
alex
parents: 2790
diff changeset
73 case TVI_CONTROL_VID_CHK_WIDTH:
09d5c9834580 tv update
alex
parents: 2790
diff changeset
74 case TVI_CONTROL_VID_CHK_HEIGHT:
09d5c9834580 tv update
alex
parents: 2790
diff changeset
75 return(TVI_CONTROL_TRUE);
09d5c9834580 tv update
alex
parents: 2790
diff changeset
76 }
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
77 return(TVI_CONTROL_UNKNOWN);
98769cea155c added tv subsystem
alex
parents:
diff changeset
78 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
79
98769cea155c added tv subsystem
alex
parents:
diff changeset
80 static int grab_video_frame(priv_t *priv, char *buffer, int len)
98769cea155c added tv subsystem
alex
parents:
diff changeset
81 {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
82 memset(buffer, 0x42, len);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
83 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
84
98769cea155c added tv subsystem
alex
parents:
diff changeset
85 static int get_video_framesize(priv_t *priv)
98769cea155c added tv subsystem
alex
parents:
diff changeset
86 {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
87 /* YV12 */
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
88 return(priv->width*priv->height*12/8);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
89 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
90
98769cea155c added tv subsystem
alex
parents:
diff changeset
91 static int grab_audio_frame(priv_t *priv, char *buffer, int len)
98769cea155c added tv subsystem
alex
parents:
diff changeset
92 {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
93 memset(buffer, 0x42, len);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
94 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
95
98769cea155c added tv subsystem
alex
parents:
diff changeset
96 static int get_audio_framesize(priv_t *priv)
98769cea155c added tv subsystem
alex
parents:
diff changeset
97 {
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
98 return(1);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
99 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
100
98769cea155c added tv subsystem
alex
parents:
diff changeset
101 #endif /* USE_TV */