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