Mercurial > mplayer.hg
annotate libmpdemux/tvi_dummy.c @ 6356:b54d7fd6471a
This script has no bash specific stuff, it's all standard bourne shell, so execute with sh.
Also see mail from Michaela.
author | atmos4 |
---|---|
date | Sun, 09 Jun 2002 14:48:16 +0000 |
parents | 8cd761968f35 |
children | 20acd78d1239 |
rev | line source |
---|---|
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 */ |
3815 | 36 static int init(priv_t *priv) |
2802 | 37 { |
3375 | 38 priv->width = 320; |
39 priv->height = 200; | |
2837 | 40 return(1); |
2802 | 41 } |
42 | |
43 /* that's the real start, we'got the format parameters (checked with control) */ | |
44 static int start(priv_t *priv) | |
2790 | 45 { |
2837 | 46 return(1); |
2790 | 47 } |
48 | |
2802 | 49 static int uninit(priv_t *priv) |
2790 | 50 { |
3815 | 51 return(1); |
2790 | 52 } |
53 | |
54 static int control(priv_t *priv, int cmd, void *arg) | |
55 { | |
2802 | 56 switch(cmd) |
57 { | |
58 case TVI_CONTROL_IS_VIDEO: | |
59 return(TVI_CONTROL_TRUE); | |
60 case TVI_CONTROL_VID_GET_FORMAT: | |
61 (int)*(void **)arg = IMGFMT_YV12; | |
62 return(TVI_CONTROL_TRUE); | |
2815 | 63 case TVI_CONTROL_VID_SET_FORMAT: |
64 { | |
65 int req_fmt = (int)*(void **)arg; | |
66 if (req_fmt != IMGFMT_YV12) | |
67 return(TVI_CONTROL_FALSE); | |
68 return(TVI_CONTROL_TRUE); | |
69 } | |
2802 | 70 case TVI_CONTROL_VID_SET_WIDTH: |
71 priv->width = (int)*(void **)arg; | |
72 return(TVI_CONTROL_TRUE); | |
3375 | 73 case TVI_CONTROL_VID_GET_WIDTH: |
74 (int)*(void **)arg = priv->width; | |
75 return(TVI_CONTROL_TRUE); | |
2802 | 76 case TVI_CONTROL_VID_SET_HEIGHT: |
77 priv->height = (int)*(void **)arg; | |
78 return(TVI_CONTROL_TRUE); | |
3375 | 79 case TVI_CONTROL_VID_GET_HEIGHT: |
80 (int)*(void **)arg = priv->height; | |
81 return(TVI_CONTROL_TRUE); | |
2802 | 82 case TVI_CONTROL_VID_CHK_WIDTH: |
83 case TVI_CONTROL_VID_CHK_HEIGHT: | |
84 return(TVI_CONTROL_TRUE); | |
85 } | |
2790 | 86 return(TVI_CONTROL_UNKNOWN); |
87 } | |
88 | |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
89 #ifdef HAVE_TV_BSDBT848 |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
90 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
|
91 { |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
92 memset(buffer, 0xCC, len); |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
93 return(1); |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
94 } |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
95 #endif |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
96 |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
97 static double grab_video_frame(priv_t *priv, char *buffer, int len) |
2790 | 98 { |
2802 | 99 memset(buffer, 0x42, len); |
3815 | 100 return(1); |
2790 | 101 } |
102 | |
103 static int get_video_framesize(priv_t *priv) | |
104 { | |
2802 | 105 /* YV12 */ |
2837 | 106 return(priv->width*priv->height*12/8); |
2790 | 107 } |
108 | |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
109 static double grab_audio_frame(priv_t *priv, char *buffer, int len) |
2790 | 110 { |
2802 | 111 memset(buffer, 0x42, len); |
3815 | 112 return(1); |
2790 | 113 } |
114 | |
115 static int get_audio_framesize(priv_t *priv) | |
116 { | |
2837 | 117 return(1); |
2790 | 118 } |
119 | |
120 #endif /* USE_TV */ |