4 * This file is part of MPlayer.
6 * MPlayer is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * MPlayer is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include "libmpcodecs/img_format.h"
27 static tvi_handle_t
*tvi_init_dummy(tv_param_t
* tv_param
);
28 /* information about this file */
29 const tvi_info_t tvi_info_dummy
= {
45 /* handler creator - entry point ! */
46 static tvi_handle_t
*tvi_init_dummy(tv_param_t
* tv_param
)
52 static int init(priv_t
*priv
)
59 /* that's the real start, we'got the format parameters (checked with control) */
60 static int start(priv_t
*priv
)
65 static int uninit(priv_t
*priv
)
70 static int control(priv_t
*priv
, int cmd
, void *arg
)
74 case TVI_CONTROL_IS_VIDEO
:
75 return TVI_CONTROL_TRUE
;
76 case TVI_CONTROL_VID_GET_FORMAT
:
77 // *(int *)arg = IMGFMT_YV12;
78 *(int *)arg
= IMGFMT_YV12
;
79 return TVI_CONTROL_TRUE
;
80 case TVI_CONTROL_VID_SET_FORMAT
:
82 // int req_fmt = *(int *)arg;
83 int req_fmt
= *(int *)arg
;
84 if (req_fmt
!= IMGFMT_YV12
)
85 return TVI_CONTROL_FALSE
;
86 return TVI_CONTROL_TRUE
;
88 case TVI_CONTROL_VID_SET_WIDTH
:
89 priv
->width
= *(int *)arg
;
90 return TVI_CONTROL_TRUE
;
91 case TVI_CONTROL_VID_GET_WIDTH
:
92 *(int *)arg
= priv
->width
;
93 return TVI_CONTROL_TRUE
;
94 case TVI_CONTROL_VID_SET_HEIGHT
:
95 priv
->height
= *(int *)arg
;
96 return TVI_CONTROL_TRUE
;
97 case TVI_CONTROL_VID_GET_HEIGHT
:
98 *(int *)arg
= priv
->height
;
99 return TVI_CONTROL_TRUE
;
100 case TVI_CONTROL_VID_CHK_WIDTH
:
101 case TVI_CONTROL_VID_CHK_HEIGHT
:
102 return TVI_CONTROL_TRUE
;
103 case TVI_CONTROL_TUN_SET_NORM
:
104 return TVI_CONTROL_TRUE
;
106 return TVI_CONTROL_UNKNOWN
;
109 static double grab_video_frame(priv_t
*priv
, char *buffer
, int len
)
111 memset(buffer
, 0x42, len
);
115 static int get_video_framesize(priv_t
*priv
)
118 return priv
->width
* priv
->height
* 12 / 8;
121 static double grab_audio_frame(priv_t
*priv
, char *buffer
, int len
)
123 memset(buffer
, 0x42, len
);
127 static int get_audio_framesize(priv_t
*priv
)