2001-11-10 23:32:10 +00:00
|
|
|
/*
|
|
|
|
Only a sample!
|
|
|
|
*/
|
2001-11-09 23:46:06 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#ifdef USE_TV
|
2001-11-10 23:32:10 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
2001-11-11 13:47:42 +00:00
|
|
|
#include "../libvo/img_format.h"
|
2001-11-09 23:46:06 +00:00
|
|
|
#include "tv.h"
|
|
|
|
|
2001-11-10 23:32:10 +00:00
|
|
|
/* information about this file */
|
2001-11-09 23:46:06 +00:00
|
|
|
static tvi_info_t info = {
|
|
|
|
"NULL-TV",
|
|
|
|
"dummy",
|
|
|
|
"alex",
|
2001-11-10 23:32:10 +00:00
|
|
|
NULL
|
2001-11-09 23:46:06 +00:00
|
|
|
};
|
|
|
|
|
2001-11-10 23:32:10 +00:00
|
|
|
/* private data's */
|
2001-11-09 23:46:06 +00:00
|
|
|
typedef struct {
|
2001-11-10 23:32:10 +00:00
|
|
|
int width;
|
|
|
|
int height;
|
2001-11-09 23:46:06 +00:00
|
|
|
} priv_t;
|
|
|
|
|
|
|
|
#include "tvi_def.h"
|
|
|
|
|
2001-11-10 23:32:10 +00:00
|
|
|
/* handler creator - entry point ! */
|
2001-11-09 23:46:06 +00:00
|
|
|
tvi_handle_t *tvi_init_dummy(char *device)
|
|
|
|
{
|
2001-11-11 15:45:23 +00:00
|
|
|
return(new_handle());
|
2001-11-09 23:46:06 +00:00
|
|
|
}
|
|
|
|
|
2001-11-10 23:32:10 +00:00
|
|
|
/* initialisation */
|
|
|
|
static int init(priv_t *priv, tvi_param_t *params)
|
|
|
|
{
|
2001-11-11 15:45:23 +00:00
|
|
|
return(1);
|
2001-11-10 23:32:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* that's the real start, we'got the format parameters (checked with control) */
|
|
|
|
static int start(priv_t *priv)
|
2001-11-09 23:46:06 +00:00
|
|
|
{
|
2001-11-11 15:45:23 +00:00
|
|
|
return(1);
|
2001-11-09 23:46:06 +00:00
|
|
|
}
|
|
|
|
|
2001-11-10 23:32:10 +00:00
|
|
|
static int uninit(priv_t *priv)
|
2001-11-09 23:46:06 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static int control(priv_t *priv, int cmd, void *arg)
|
|
|
|
{
|
2001-11-10 23:32:10 +00:00
|
|
|
switch(cmd)
|
|
|
|
{
|
|
|
|
case TVI_CONTROL_IS_VIDEO:
|
|
|
|
return(TVI_CONTROL_TRUE);
|
|
|
|
case TVI_CONTROL_VID_GET_FORMAT:
|
|
|
|
(int)*(void **)arg = IMGFMT_YV12;
|
|
|
|
return(TVI_CONTROL_TRUE);
|
2001-11-11 02:20:57 +00:00
|
|
|
case TVI_CONTROL_VID_SET_FORMAT:
|
|
|
|
{
|
|
|
|
int req_fmt = (int)*(void **)arg;
|
|
|
|
if (req_fmt != IMGFMT_YV12)
|
|
|
|
return(TVI_CONTROL_FALSE);
|
|
|
|
return(TVI_CONTROL_TRUE);
|
|
|
|
}
|
2001-11-10 23:32:10 +00:00
|
|
|
case TVI_CONTROL_VID_SET_WIDTH:
|
|
|
|
priv->width = (int)*(void **)arg;
|
|
|
|
return(TVI_CONTROL_TRUE);
|
|
|
|
case TVI_CONTROL_VID_SET_HEIGHT:
|
|
|
|
priv->height = (int)*(void **)arg;
|
|
|
|
return(TVI_CONTROL_TRUE);
|
|
|
|
case TVI_CONTROL_VID_CHK_WIDTH:
|
|
|
|
case TVI_CONTROL_VID_CHK_HEIGHT:
|
|
|
|
return(TVI_CONTROL_TRUE);
|
|
|
|
}
|
2001-11-09 23:46:06 +00:00
|
|
|
return(TVI_CONTROL_UNKNOWN);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int grab_video_frame(priv_t *priv, char *buffer, int len)
|
|
|
|
{
|
2001-11-10 23:32:10 +00:00
|
|
|
memset(buffer, 0x42, len);
|
2001-11-09 23:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int get_video_framesize(priv_t *priv)
|
|
|
|
{
|
2001-11-10 23:32:10 +00:00
|
|
|
/* YV12 */
|
2001-11-11 15:45:23 +00:00
|
|
|
return(priv->width*priv->height*12/8);
|
2001-11-09 23:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int grab_audio_frame(priv_t *priv, char *buffer, int len)
|
|
|
|
{
|
2001-11-10 23:32:10 +00:00
|
|
|
memset(buffer, 0x42, len);
|
2001-11-09 23:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int get_audio_framesize(priv_t *priv)
|
|
|
|
{
|
2001-11-11 15:45:23 +00:00
|
|
|
return(1);
|
2001-11-09 23:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* USE_TV */
|