Mercurial > mplayer.hg
annotate stream/tvi_dummy.c @ 29795:72e11974c9c3
Use an early return instead of a {} block over the whole function in reinit_audio_chain
author | reimar |
---|---|
date | Fri, 06 Nov 2009 15:59:42 +0000 |
parents | c43ce7268677 |
children | ce0122361a39 |
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 | |
23883 | 11 static tvi_handle_t *tvi_init_dummy(tv_param_t* tv_param); |
2802 | 12 /* information about this file */ |
25689 | 13 const tvi_info_t tvi_info_dummy = { |
22381
6cabac4d35b5
tv driver loading rework. As a side effect "-tv driver=help" option is
voroshil
parents:
19431
diff
changeset
|
14 tvi_init_dummy, |
2790 | 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 ! */ |
23883 | 30 static tvi_handle_t *tvi_init_dummy(tv_param_t* tv_param) |
2790 | 31 { |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
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; | |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
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 { |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
46 return 1; |
2790 | 47 } |
48 | |
2802 | 49 static int uninit(priv_t *priv) |
2790 | 50 { |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
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: | |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
59 return TVI_CONTROL_TRUE; |
2802 | 60 case TVI_CONTROL_VID_GET_FORMAT: |
12375 | 61 // *(int *)arg = IMGFMT_YV12; |
7319 | 62 *(int *)arg = IMGFMT_YV12; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
63 return TVI_CONTROL_TRUE; |
2815 | 64 case TVI_CONTROL_VID_SET_FORMAT: |
65 { | |
12375 | 66 // int req_fmt = *(int *)arg; |
7319 | 67 int req_fmt = *(int *)arg; |
2815 | 68 if (req_fmt != IMGFMT_YV12) |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
69 return TVI_CONTROL_FALSE; |
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
70 return TVI_CONTROL_TRUE; |
2815 | 71 } |
2802 | 72 case TVI_CONTROL_VID_SET_WIDTH: |
12375 | 73 priv->width = *(int *)arg; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
74 return TVI_CONTROL_TRUE; |
3375 | 75 case TVI_CONTROL_VID_GET_WIDTH: |
12375 | 76 *(int *)arg = priv->width; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
77 return TVI_CONTROL_TRUE; |
2802 | 78 case TVI_CONTROL_VID_SET_HEIGHT: |
12375 | 79 priv->height = *(int *)arg; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
80 return TVI_CONTROL_TRUE; |
3375 | 81 case TVI_CONTROL_VID_GET_HEIGHT: |
12375 | 82 *(int *)arg = priv->height; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
83 return TVI_CONTROL_TRUE; |
2802 | 84 case TVI_CONTROL_VID_CHK_WIDTH: |
85 case TVI_CONTROL_VID_CHK_HEIGHT: | |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
86 return TVI_CONTROL_TRUE; |
9094 | 87 case TVI_CONTROL_TUN_SET_NORM: |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
88 return TVI_CONTROL_TRUE; |
2802 | 89 } |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
90 return TVI_CONTROL_UNKNOWN; |
2790 | 91 } |
92 | |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
93 static double grab_video_frame(priv_t *priv, char *buffer, int len) |
2790 | 94 { |
2802 | 95 memset(buffer, 0x42, len); |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
96 return 1; |
2790 | 97 } |
98 | |
99 static int get_video_framesize(priv_t *priv) | |
100 { | |
2802 | 101 /* YV12 */ |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
102 return priv->width * priv->height * 12 / 8; |
2790 | 103 } |
104 | |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
105 static double grab_audio_frame(priv_t *priv, char *buffer, int len) |
2790 | 106 { |
2802 | 107 memset(buffer, 0x42, len); |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
108 return 1; |
2790 | 109 } |
110 | |
111 static int get_audio_framesize(priv_t *priv) | |
112 { | |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
113 return 1; |
2790 | 114 } |