diff options
author | ben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-31 17:39:17 +0000 |
---|---|---|
committer | ben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-31 17:39:17 +0000 |
commit | 49867bd432352d19172ab26cf873bd5651e69e25 (patch) | |
tree | c2d419bb4f81564036baa12832a44b8aac27c6d1 /stream/tvi_dummy.c | |
parent | d3b998da64927403879ad588287c178f86b7c849 (diff) | |
download | mpv-49867bd432352d19172ab26cf873bd5651e69e25.tar.bz2 mpv-49867bd432352d19172ab26cf873bd5651e69e25.tar.xz |
introduce new 'stream' directory for all stream layer related components and split them from libmpdemux
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19277 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/tvi_dummy.c')
-rw-r--r-- | stream/tvi_dummy.c | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/stream/tvi_dummy.c b/stream/tvi_dummy.c new file mode 100644 index 0000000000..152ce0938c --- /dev/null +++ b/stream/tvi_dummy.c @@ -0,0 +1,120 @@ +/* + Only a sample! +*/ + +#include "config.h" + +#include <stdio.h> +#include "libvo/img_format.h" +#include "tv.h" + +/* information about this file */ +static tvi_info_t info = { + "NULL-TV", + "dummy", + "alex", + NULL +}; + +/* private data's */ +typedef struct { + int width; + int height; +} priv_t; + +#include "tvi_def.h" + +/* handler creator - entry point ! */ +tvi_handle_t *tvi_init_dummy(char *device) +{ + return(new_handle()); +} + +/* initialisation */ +static int init(priv_t *priv) +{ + priv->width = 320; + priv->height = 200; + return(1); +} + +/* that's the real start, we'got the format parameters (checked with control) */ +static int start(priv_t *priv) +{ + return(1); +} + +static int uninit(priv_t *priv) +{ + return(1); +} + +static int control(priv_t *priv, int cmd, void *arg) +{ + switch(cmd) + { + case TVI_CONTROL_IS_VIDEO: + return(TVI_CONTROL_TRUE); + case TVI_CONTROL_VID_GET_FORMAT: +// *(int *)arg = IMGFMT_YV12; + *(int *)arg = IMGFMT_YV12; + return(TVI_CONTROL_TRUE); + case TVI_CONTROL_VID_SET_FORMAT: + { +// int req_fmt = *(int *)arg; + int req_fmt = *(int *)arg; + if (req_fmt != IMGFMT_YV12) + return(TVI_CONTROL_FALSE); + return(TVI_CONTROL_TRUE); + } + case TVI_CONTROL_VID_SET_WIDTH: + priv->width = *(int *)arg; + return(TVI_CONTROL_TRUE); + case TVI_CONTROL_VID_GET_WIDTH: + *(int *)arg = priv->width; + return(TVI_CONTROL_TRUE); + case TVI_CONTROL_VID_SET_HEIGHT: + priv->height = *(int *)arg; + return(TVI_CONTROL_TRUE); + case TVI_CONTROL_VID_GET_HEIGHT: + *(int *)arg = priv->height; + return(TVI_CONTROL_TRUE); + case TVI_CONTROL_VID_CHK_WIDTH: + case TVI_CONTROL_VID_CHK_HEIGHT: + return(TVI_CONTROL_TRUE); + case TVI_CONTROL_TUN_SET_NORM: + return(TVI_CONTROL_TRUE); + } + return(TVI_CONTROL_UNKNOWN); +} + +#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) +{ + memset(buffer, 0x42, len); + return(1); +} + +static int get_video_framesize(priv_t *priv) +{ + /* YV12 */ + return(priv->width*priv->height*12/8); +} + +static double grab_audio_frame(priv_t *priv, char *buffer, int len) +{ + memset(buffer, 0x42, len); + return(1); +} + +static int get_audio_framesize(priv_t *priv) +{ + return(1); +} |