Mercurial > mplayer.hg
annotate stream/tvi_dummy.c @ 22125:49e60723af41
synced with r22104
author | gpoirier |
---|---|
date | Mon, 05 Feb 2007 13:14:41 +0000 |
parents | ac69ba536915 |
children | 6cabac4d35b5 |
rev | line source |
---|---|
2802 | 1 /* |
2 Only a sample! | |
3 */ | |
2790 | 4 |
5 #include "config.h" | |
6 | |
2802 | 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 | 9 #include "tv.h" |
10 | |
2802 | 11 /* information about this file */ |
2790 | 12 static tvi_info_t info = { |
13 "NULL-TV", | |
14 "dummy", | |
15 "alex", | |
2802 | 16 NULL |
2790 | 17 }; |
18 | |
2802 | 19 /* private data's */ |
2790 | 20 typedef struct { |
2802 | 21 int width; |
22 int height; | |
2790 | 23 } priv_t; |
24 | |
25 #include "tvi_def.h" | |
26 | |
2802 | 27 /* handler creator - entry point ! */ |
2790 | 28 tvi_handle_t *tvi_init_dummy(char *device) |
29 { | |
2837 | 30 return(new_handle()); |
2790 | 31 } |
32 | |
2802 | 33 /* initialisation */ |
3815 | 34 static int init(priv_t *priv) |
2802 | 35 { |
3375 | 36 priv->width = 320; |
37 priv->height = 200; | |
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 { |
3815 | 49 return(1); |
2790 | 50 } |
51 | |
52 static int control(priv_t *priv, int cmd, void *arg) | |
53 { | |
2802 | 54 switch(cmd) |
55 { | |
56 case TVI_CONTROL_IS_VIDEO: | |
57 return(TVI_CONTROL_TRUE); | |
58 case TVI_CONTROL_VID_GET_FORMAT: | |
12375 | 59 // *(int *)arg = IMGFMT_YV12; |
7319 | 60 *(int *)arg = IMGFMT_YV12; |
2802 | 61 return(TVI_CONTROL_TRUE); |
2815 | 62 case TVI_CONTROL_VID_SET_FORMAT: |
63 { | |
12375 | 64 // int req_fmt = *(int *)arg; |
7319 | 65 int req_fmt = *(int *)arg; |
2815 | 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: |
12375 | 71 priv->width = *(int *)arg; |
2802 | 72 return(TVI_CONTROL_TRUE); |
3375 | 73 case TVI_CONTROL_VID_GET_WIDTH: |
12375 | 74 *(int *)arg = priv->width; |
3375 | 75 return(TVI_CONTROL_TRUE); |
2802 | 76 case TVI_CONTROL_VID_SET_HEIGHT: |
12375 | 77 priv->height = *(int *)arg; |
2802 | 78 return(TVI_CONTROL_TRUE); |
3375 | 79 case TVI_CONTROL_VID_GET_HEIGHT: |
12375 | 80 *(int *)arg = priv->height; |
3375 | 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); | |
9094 | 85 case TVI_CONTROL_TUN_SET_NORM: |
86 return(TVI_CONTROL_TRUE); | |
2802 | 87 } |
2790 | 88 return(TVI_CONTROL_UNKNOWN); |
89 } | |
90 | |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
91 #ifdef HAVE_TV_BSDBT848 |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
92 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
|
93 { |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
94 memset(buffer, 0xCC, len); |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
95 return(1); |
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 #endif |
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 static double grab_video_frame(priv_t *priv, char *buffer, int len) |
2790 | 100 { |
2802 | 101 memset(buffer, 0x42, len); |
3815 | 102 return(1); |
2790 | 103 } |
104 | |
105 static int get_video_framesize(priv_t *priv) | |
106 { | |
2802 | 107 /* YV12 */ |
2837 | 108 return(priv->width*priv->height*12/8); |
2790 | 109 } |
110 | |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
111 static double grab_audio_frame(priv_t *priv, char *buffer, int len) |
2790 | 112 { |
2802 | 113 memset(buffer, 0x42, len); |
3815 | 114 return(1); |
2790 | 115 } |
116 | |
117 static int get_audio_framesize(priv_t *priv) | |
118 { | |
2837 | 119 return(1); |
2790 | 120 } |