annotate stream/tvi_dummy.c @ 22901:a7605669b114

renamed libdha.[hc] to dha.[hc]
author ben
date Fri, 06 Apr 2007 15:26:41 +0000
parents 6cabac4d35b5
children 452595810016
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
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
7 #include <stdio.h>
19431
ac69ba536915 Explicitly include libmpcodecs/img_format.h and libvo/fastmemcpy.h.
diego
parents: 19271
diff changeset
8 #include "libmpcodecs/img_format.h"
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
9 #include "tv.h"
98769cea155c added tv subsystem
alex
parents:
diff changeset
10
22381
6cabac4d35b5 tv driver loading rework. As a side effect "-tv driver=help" option is
voroshil
parents: 19431
diff changeset
11 static tvi_handle_t *tvi_init_dummy(char *device,char *adevice);
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
12 /* information about this file */
22381
6cabac4d35b5 tv driver loading rework. As a side effect "-tv driver=help" option is
voroshil
parents: 19431
diff changeset
13 tvi_info_t tvi_info_dummy = {
6cabac4d35b5 tv driver loading rework. As a side effect "-tv driver=help" option is
voroshil
parents: 19431
diff changeset
14 tvi_init_dummy,
2790
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 ! */
22381
6cabac4d35b5 tv driver loading rework. As a side effect "-tv driver=help" option is
voroshil
parents: 19431
diff changeset
30 static tvi_handle_t *tvi_init_dummy(char *device,char *adevice)
2790
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 */
3815
622a9ade4517 updated
alex
parents: 3375
diff changeset
36 static int init(priv_t *priv)
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
37 {
3375
5fb624943c90 default size 320x200
alex
parents: 2837
diff changeset
38 priv->width = 320;
5fb624943c90 default size 320x200
alex
parents: 2837
diff changeset
39 priv->height = 200;
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
40 return(1);
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
41 }
09d5c9834580 tv update
alex
parents: 2790
diff changeset
42
09d5c9834580 tv update
alex
parents: 2790
diff changeset
43 /* that's the real start, we'got the format parameters (checked with control) */
09d5c9834580 tv update
alex
parents: 2790
diff changeset
44 static int start(priv_t *priv)
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
45 {
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
46 return(1);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
47 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
48
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
49 static int uninit(priv_t *priv)
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
50 {
3815
622a9ade4517 updated
alex
parents: 3375
diff changeset
51 return(1);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
52 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
53
98769cea155c added tv subsystem
alex
parents:
diff changeset
54 static int control(priv_t *priv, int cmd, void *arg)
98769cea155c added tv subsystem
alex
parents:
diff changeset
55 {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
56 switch(cmd)
09d5c9834580 tv update
alex
parents: 2790
diff changeset
57 {
09d5c9834580 tv update
alex
parents: 2790
diff changeset
58 case TVI_CONTROL_IS_VIDEO:
09d5c9834580 tv update
alex
parents: 2790
diff changeset
59 return(TVI_CONTROL_TRUE);
09d5c9834580 tv update
alex
parents: 2790
diff changeset
60 case TVI_CONTROL_VID_GET_FORMAT:
12375
48a655d09522 and more and more stupidity
rfelker
parents: 9094
diff changeset
61 // *(int *)arg = IMGFMT_YV12;
7319
20acd78d1239 fixed get_format/set_format
alex
parents: 5572
diff changeset
62 *(int *)arg = IMGFMT_YV12;
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
63 return(TVI_CONTROL_TRUE);
2815
alex
parents: 2802
diff changeset
64 case TVI_CONTROL_VID_SET_FORMAT:
alex
parents: 2802
diff changeset
65 {
12375
48a655d09522 and more and more stupidity
rfelker
parents: 9094
diff changeset
66 // int req_fmt = *(int *)arg;
7319
20acd78d1239 fixed get_format/set_format
alex
parents: 5572
diff changeset
67 int req_fmt = *(int *)arg;
2815
alex
parents: 2802
diff changeset
68 if (req_fmt != IMGFMT_YV12)
alex
parents: 2802
diff changeset
69 return(TVI_CONTROL_FALSE);
alex
parents: 2802
diff changeset
70 return(TVI_CONTROL_TRUE);
alex
parents: 2802
diff changeset
71 }
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
72 case TVI_CONTROL_VID_SET_WIDTH:
12375
48a655d09522 and more and more stupidity
rfelker
parents: 9094
diff changeset
73 priv->width = *(int *)arg;
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
74 return(TVI_CONTROL_TRUE);
3375
5fb624943c90 default size 320x200
alex
parents: 2837
diff changeset
75 case TVI_CONTROL_VID_GET_WIDTH:
12375
48a655d09522 and more and more stupidity
rfelker
parents: 9094
diff changeset
76 *(int *)arg = priv->width;
3375
5fb624943c90 default size 320x200
alex
parents: 2837
diff changeset
77 return(TVI_CONTROL_TRUE);
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
78 case TVI_CONTROL_VID_SET_HEIGHT:
12375
48a655d09522 and more and more stupidity
rfelker
parents: 9094
diff changeset
79 priv->height = *(int *)arg;
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
80 return(TVI_CONTROL_TRUE);
3375
5fb624943c90 default size 320x200
alex
parents: 2837
diff changeset
81 case TVI_CONTROL_VID_GET_HEIGHT:
12375
48a655d09522 and more and more stupidity
rfelker
parents: 9094
diff changeset
82 *(int *)arg = priv->height;
3375
5fb624943c90 default size 320x200
alex
parents: 2837
diff changeset
83 return(TVI_CONTROL_TRUE);
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
84 case TVI_CONTROL_VID_CHK_WIDTH:
09d5c9834580 tv update
alex
parents: 2790
diff changeset
85 case TVI_CONTROL_VID_CHK_HEIGHT:
09d5c9834580 tv update
alex
parents: 2790
diff changeset
86 return(TVI_CONTROL_TRUE);
9094
84012782d313 added TVI_CONTROL_TUN_SET_NORM
gabucino
parents: 7319
diff changeset
87 case TVI_CONTROL_TUN_SET_NORM:
84012782d313 added TVI_CONTROL_TUN_SET_NORM
gabucino
parents: 7319
diff changeset
88 return(TVI_CONTROL_TRUE);
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
89 }
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
90 return(TVI_CONTROL_UNKNOWN);
98769cea155c added tv subsystem
alex
parents:
diff changeset
91 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
92
5572
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
93 #ifdef HAVE_TV_BSDBT848
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
94 static double grabimmediate_video_frame(priv_t *priv, char *buffer, int len)
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
95 {
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
96 memset(buffer, 0xCC, len);
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
97 return(1);
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
98 }
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
99 #endif
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
100
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
101 static double grab_video_frame(priv_t *priv, char *buffer, int len)
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
102 {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
103 memset(buffer, 0x42, len);
3815
622a9ade4517 updated
alex
parents: 3375
diff changeset
104 return(1);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
105 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
106
98769cea155c added tv subsystem
alex
parents:
diff changeset
107 static int get_video_framesize(priv_t *priv)
98769cea155c added tv subsystem
alex
parents:
diff changeset
108 {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
109 /* YV12 */
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
110 return(priv->width*priv->height*12/8);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
111 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
112
5572
8cd761968f35 BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents: 3815
diff changeset
113 static double grab_audio_frame(priv_t *priv, char *buffer, int len)
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
114 {
2802
09d5c9834580 tv update
alex
parents: 2790
diff changeset
115 memset(buffer, 0x42, len);
3815
622a9ade4517 updated
alex
parents: 3375
diff changeset
116 return(1);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
117 }
98769cea155c added tv subsystem
alex
parents:
diff changeset
118
98769cea155c added tv subsystem
alex
parents:
diff changeset
119 static int get_audio_framesize(priv_t *priv)
98769cea155c added tv subsystem
alex
parents:
diff changeset
120 {
2837
c63562f5f56f tuning worx (can set frequency)
alex
parents: 2830
diff changeset
121 return(1);
2790
98769cea155c added tv subsystem
alex
parents:
diff changeset
122 }