2001-11-11 00:32:10 +01:00
|
|
|
/*
|
|
|
|
Only a sample!
|
|
|
|
*/
|
2001-11-10 00:46:06 +01:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2001-11-11 00:32:10 +01:00
|
|
|
#include <stdio.h>
|
2006-08-18 15:58:03 +02:00
|
|
|
#include "libmpcodecs/img_format.h"
|
2001-11-10 00:46:06 +01:00
|
|
|
#include "tv.h"
|
|
|
|
|
2007-03-01 19:38:00 +01:00
|
|
|
static tvi_handle_t *tvi_init_dummy(char *device,char *adevice);
|
2001-11-11 00:32:10 +01:00
|
|
|
/* information about this file */
|
2007-03-01 19:38:00 +01:00
|
|
|
tvi_info_t tvi_info_dummy = {
|
|
|
|
tvi_init_dummy,
|
2001-11-10 00:46:06 +01:00
|
|
|
"NULL-TV",
|
|
|
|
"dummy",
|
|
|
|
"alex",
|
2001-11-11 00:32:10 +01:00
|
|
|
NULL
|
2001-11-10 00:46:06 +01:00
|
|
|
};
|
|
|
|
|
2001-11-11 00:32:10 +01:00
|
|
|
/* private data's */
|
2001-11-10 00:46:06 +01:00
|
|
|
typedef struct {
|
2001-11-11 00:32:10 +01:00
|
|
|
int width;
|
|
|
|
int height;
|
2001-11-10 00:46:06 +01:00
|
|
|
} priv_t;
|
|
|
|
|
|
|
|
#include "tvi_def.h"
|
|
|
|
|
2001-11-11 00:32:10 +01:00
|
|
|
/* handler creator - entry point ! */
|
2007-03-01 19:38:00 +01:00
|
|
|
static tvi_handle_t *tvi_init_dummy(char *device,char *adevice)
|
2001-11-10 00:46:06 +01:00
|
|
|
{
|
2001-11-11 16:45:23 +01:00
|
|
|
return(new_handle());
|
2001-11-10 00:46:06 +01:00
|
|
|
}
|
|
|
|
|
2001-11-11 00:32:10 +01:00
|
|
|
/* initialisation */
|
2001-12-28 00:52:48 +01:00
|
|
|
static int init(priv_t *priv)
|
2001-11-11 00:32:10 +01:00
|
|
|
{
|
2001-12-08 02:22:03 +01:00
|
|
|
priv->width = 320;
|
|
|
|
priv->height = 200;
|
2001-11-11 16:45:23 +01:00
|
|
|
return(1);
|
2001-11-11 00:32:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* that's the real start, we'got the format parameters (checked with control) */
|
|
|
|
static int start(priv_t *priv)
|
2001-11-10 00:46:06 +01:00
|
|
|
{
|
2001-11-11 16:45:23 +01:00
|
|
|
return(1);
|
2001-11-10 00:46:06 +01:00
|
|
|
}
|
|
|
|
|
2001-11-11 00:32:10 +01:00
|
|
|
static int uninit(priv_t *priv)
|
2001-11-10 00:46:06 +01:00
|
|
|
{
|
2001-12-28 00:52:48 +01:00
|
|
|
return(1);
|
2001-11-10 00:46:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int control(priv_t *priv, int cmd, void *arg)
|
|
|
|
{
|
2001-11-11 00:32:10 +01:00
|
|
|
switch(cmd)
|
|
|
|
{
|
|
|
|
case TVI_CONTROL_IS_VIDEO:
|
|
|
|
return(TVI_CONTROL_TRUE);
|
|
|
|
case TVI_CONTROL_VID_GET_FORMAT:
|
2004-05-01 20:30:38 +02:00
|
|
|
// *(int *)arg = IMGFMT_YV12;
|
2002-09-08 18:05:59 +02:00
|
|
|
*(int *)arg = IMGFMT_YV12;
|
2001-11-11 00:32:10 +01:00
|
|
|
return(TVI_CONTROL_TRUE);
|
2001-11-11 03:20:57 +01:00
|
|
|
case TVI_CONTROL_VID_SET_FORMAT:
|
|
|
|
{
|
2004-05-01 20:30:38 +02:00
|
|
|
// int req_fmt = *(int *)arg;
|
2002-09-08 18:05:59 +02:00
|
|
|
int req_fmt = *(int *)arg;
|
2001-11-11 03:20:57 +01:00
|
|
|
if (req_fmt != IMGFMT_YV12)
|
|
|
|
return(TVI_CONTROL_FALSE);
|
|
|
|
return(TVI_CONTROL_TRUE);
|
|
|
|
}
|
2001-11-11 00:32:10 +01:00
|
|
|
case TVI_CONTROL_VID_SET_WIDTH:
|
2004-05-01 20:30:38 +02:00
|
|
|
priv->width = *(int *)arg;
|
2001-11-11 00:32:10 +01:00
|
|
|
return(TVI_CONTROL_TRUE);
|
2001-12-08 02:22:03 +01:00
|
|
|
case TVI_CONTROL_VID_GET_WIDTH:
|
2004-05-01 20:30:38 +02:00
|
|
|
*(int *)arg = priv->width;
|
2001-12-08 02:22:03 +01:00
|
|
|
return(TVI_CONTROL_TRUE);
|
2001-11-11 00:32:10 +01:00
|
|
|
case TVI_CONTROL_VID_SET_HEIGHT:
|
2004-05-01 20:30:38 +02:00
|
|
|
priv->height = *(int *)arg;
|
2001-11-11 00:32:10 +01:00
|
|
|
return(TVI_CONTROL_TRUE);
|
2001-12-08 02:22:03 +01:00
|
|
|
case TVI_CONTROL_VID_GET_HEIGHT:
|
2004-05-01 20:30:38 +02:00
|
|
|
*(int *)arg = priv->height;
|
2001-12-08 02:22:03 +01:00
|
|
|
return(TVI_CONTROL_TRUE);
|
2001-11-11 00:32:10 +01:00
|
|
|
case TVI_CONTROL_VID_CHK_WIDTH:
|
|
|
|
case TVI_CONTROL_VID_CHK_HEIGHT:
|
|
|
|
return(TVI_CONTROL_TRUE);
|
2003-01-26 11:53:34 +01:00
|
|
|
case TVI_CONTROL_TUN_SET_NORM:
|
|
|
|
return(TVI_CONTROL_TRUE);
|
2001-11-11 00:32:10 +01:00
|
|
|
}
|
2001-11-10 00:46:06 +01:00
|
|
|
return(TVI_CONTROL_UNKNOWN);
|
|
|
|
}
|
|
|
|
|
2002-04-12 12:40:38 +02:00
|
|
|
#ifdef HAVE_TV_BSDBT848
|
|
|
|
static double grabimmediate_video_frame(priv_t *priv, char *buffer, int len)
|
|
|
|
{
|
|
|
|
memset(buffer, 0xCC, len);
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static double grab_video_frame(priv_t *priv, char *buffer, int len)
|
2001-11-10 00:46:06 +01:00
|
|
|
{
|
2001-11-11 00:32:10 +01:00
|
|
|
memset(buffer, 0x42, len);
|
2001-12-28 00:52:48 +01:00
|
|
|
return(1);
|
2001-11-10 00:46:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int get_video_framesize(priv_t *priv)
|
|
|
|
{
|
2001-11-11 00:32:10 +01:00
|
|
|
/* YV12 */
|
2001-11-11 16:45:23 +01:00
|
|
|
return(priv->width*priv->height*12/8);
|
2001-11-10 00:46:06 +01:00
|
|
|
}
|
|
|
|
|
2002-04-12 12:40:38 +02:00
|
|
|
static double grab_audio_frame(priv_t *priv, char *buffer, int len)
|
2001-11-10 00:46:06 +01:00
|
|
|
{
|
2001-11-11 00:32:10 +01:00
|
|
|
memset(buffer, 0x42, len);
|
2001-12-28 00:52:48 +01:00
|
|
|
return(1);
|
2001-11-10 00:46:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int get_audio_framesize(priv_t *priv)
|
|
|
|
{
|
2001-11-11 16:45:23 +01:00
|
|
|
return(1);
|
2001-11-10 00:46:06 +01:00
|
|
|
}
|