Mercurial > mplayer.hg
annotate stream/tvi_dummy.c @ 34204:c1b5018b5edb
Use new API avformat_new_stream() instead of the deprecated
av_new_stream().
Patch by Naoya OYAMA, naoya D oyama gmail
author | cehoyos |
---|---|
date | Thu, 03 Nov 2011 18:45:59 +0000 |
parents | 2802b8095bf7 |
children |
rev | line source |
---|---|
2802 | 1 /* |
30426
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
2 * Only a sample! |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
3 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
4 * This file is part of MPlayer. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
5 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
6 * MPlayer is free software; you can redistribute it and/or modify |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
7 * it under the terms of the GNU General Public License as published by |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
8 * the Free Software Foundation; either version 2 of the License, or |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
9 * (at your option) any later version. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
10 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
11 * MPlayer is distributed in the hope that it will be useful, |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
14 * GNU General Public License for more details. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
15 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
16 * You should have received a copy of the GNU General Public License along |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
26756
diff
changeset
|
19 */ |
2790 | 20 |
21 #include "config.h" | |
22 | |
2802 | 23 #include <stdio.h> |
19431
ac69ba536915
Explicitly include libmpcodecs/img_format.h and libvo/fastmemcpy.h.
diego
parents:
19271
diff
changeset
|
24 #include "libmpcodecs/img_format.h" |
2790 | 25 #include "tv.h" |
26 | |
23883 | 27 static tvi_handle_t *tvi_init_dummy(tv_param_t* tv_param); |
2802 | 28 /* information about this file */ |
25689 | 29 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
|
30 tvi_init_dummy, |
2790 | 31 "NULL-TV", |
32 "dummy", | |
33 "alex", | |
2802 | 34 NULL |
2790 | 35 }; |
36 | |
2802 | 37 /* private data's */ |
31322
016194f71de3
Fix function pointer types in tvi_functions struct
reimar
parents:
30426
diff
changeset
|
38 typedef struct priv { |
2802 | 39 int width; |
40 int height; | |
2790 | 41 } priv_t; |
42 | |
43 #include "tvi_def.h" | |
44 | |
2802 | 45 /* handler creator - entry point ! */ |
23883 | 46 static tvi_handle_t *tvi_init_dummy(tv_param_t* tv_param) |
2790 | 47 { |
32141
2802b8095bf7
Move TV input new_handle static function to tv.c and make it non-static.
diego
parents:
31322
diff
changeset
|
48 return tv_new_handle(sizeof(priv_t), &functions); |
2790 | 49 } |
50 | |
2802 | 51 /* initialisation */ |
3815 | 52 static int init(priv_t *priv) |
2802 | 53 { |
3375 | 54 priv->width = 320; |
55 priv->height = 200; | |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
56 return 1; |
2802 | 57 } |
58 | |
59 /* that's the real start, we'got the format parameters (checked with control) */ | |
60 static int start(priv_t *priv) | |
2790 | 61 { |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
62 return 1; |
2790 | 63 } |
64 | |
2802 | 65 static int uninit(priv_t *priv) |
2790 | 66 { |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
67 return 1; |
2790 | 68 } |
69 | |
70 static int control(priv_t *priv, int cmd, void *arg) | |
71 { | |
2802 | 72 switch(cmd) |
73 { | |
74 case TVI_CONTROL_IS_VIDEO: | |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
75 return TVI_CONTROL_TRUE; |
2802 | 76 case TVI_CONTROL_VID_GET_FORMAT: |
12375 | 77 // *(int *)arg = IMGFMT_YV12; |
7319 | 78 *(int *)arg = IMGFMT_YV12; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
79 return TVI_CONTROL_TRUE; |
2815 | 80 case TVI_CONTROL_VID_SET_FORMAT: |
81 { | |
12375 | 82 // int req_fmt = *(int *)arg; |
7319 | 83 int req_fmt = *(int *)arg; |
2815 | 84 if (req_fmt != IMGFMT_YV12) |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
85 return TVI_CONTROL_FALSE; |
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
86 return TVI_CONTROL_TRUE; |
2815 | 87 } |
2802 | 88 case TVI_CONTROL_VID_SET_WIDTH: |
12375 | 89 priv->width = *(int *)arg; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
90 return TVI_CONTROL_TRUE; |
3375 | 91 case TVI_CONTROL_VID_GET_WIDTH: |
12375 | 92 *(int *)arg = priv->width; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
93 return TVI_CONTROL_TRUE; |
2802 | 94 case TVI_CONTROL_VID_SET_HEIGHT: |
12375 | 95 priv->height = *(int *)arg; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
96 return TVI_CONTROL_TRUE; |
3375 | 97 case TVI_CONTROL_VID_GET_HEIGHT: |
12375 | 98 *(int *)arg = priv->height; |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
99 return TVI_CONTROL_TRUE; |
2802 | 100 case TVI_CONTROL_VID_CHK_WIDTH: |
101 case TVI_CONTROL_VID_CHK_HEIGHT: | |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
102 return TVI_CONTROL_TRUE; |
9094 | 103 case TVI_CONTROL_TUN_SET_NORM: |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
104 return TVI_CONTROL_TRUE; |
2802 | 105 } |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
106 return TVI_CONTROL_UNKNOWN; |
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_video_frame(priv_t *priv, char *buffer, int len) |
2790 | 110 { |
2802 | 111 memset(buffer, 0x42, len); |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
112 return 1; |
2790 | 113 } |
114 | |
115 static int get_video_framesize(priv_t *priv) | |
116 { | |
2802 | 117 /* YV12 */ |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
118 return priv->width * priv->height * 12 / 8; |
2790 | 119 } |
120 | |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
121 static double grab_audio_frame(priv_t *priv, char *buffer, int len) |
2790 | 122 { |
2802 | 123 memset(buffer, 0x42, len); |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
124 return 1; |
2790 | 125 } |
126 | |
127 static int get_audio_framesize(priv_t *priv) | |
128 { | |
26756
c43ce7268677
cosmetics: Remove useless parentheses from return statements.
diego
parents:
25689
diff
changeset
|
129 return 1; |
2790 | 130 } |