[MPlayer-dev-eng] [PATCH]:targa output with snapshot and index files

Arpi arpi at thot.banki.hu
Fri Aug 22 12:17:48 CEST 2003


Hi,

> this patch put an output driver in targa (.tga) format with some addition use: 
> you can create big .tga files with the miniature (1/4 of the original size) 
> of every frame of a video (for example a 5x5 tile for every second of a 25 

hmm, would be more interesting to do this with a video filter.
at least in g2...

> fps movie) and / or you can output tga file only when the frames change of a 
> certain amount of data, to get something similar of the output of only the 
> keyframe(s) of the video.

there is already a filter to skip similar frames, it's called decimate.

> +#ifdef HAVE_TGA
> +/* declared in vo_tga.c (with some comments too!) */
> +extern int     tga_xtile;
> +extern int     tga_ytile;
> +extern int     tga_xytile;
> +extern float   tga_snap_chg;
> +extern float   tga_snap_cpy;
> +extern int     tga_write_on;
> +extern int     tga_snap_on;
> +extern int     tga_snap_idx;
> +extern int     tga_snap_min;
> +extern int     tga_index_on;
> +extern int     tga_snap_use_last;
> +#endif
> +
>  /* from libvo/aspect.c */
>  extern float monitor_aspect;
>  
> @@ -151,6 +166,31 @@
>  };
>  #endif
>  
> +#ifdef HAVE_TGA
> +m_option_t tga_conf[]={
> +	{"xtile",    &tga_xtile,      CONF_TYPE_INT,   CONF_RANGE,   1,    16, NULL},
> +	{"ytile",    &tga_ytile,      CONF_TYPE_INT,   CONF_RANGE,   1,    16, NULL},
> +        {"xytile",   &tga_xytile,     CONF_TYPE_INT,   CONF_RANGE,   1,   255, NULL},
> +        {"min",      &tga_snap_min,   CONF_TYPE_INT,   CONF_RANGE,   0,999999, NULL},
> +	{"snap_chg", &tga_snap_chg,   CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 100.0, NULL},
> +	{"snap_cpy", &tga_snap_cpy,   CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 100.0, NULL},
> +        {"write",    &tga_write_on,   CONF_TYPE_FLAG,           0,   0,     1, NULL},
> +        {"nowrite",  &tga_write_on,   CONF_TYPE_FLAG,           0,   0,     0, NULL},
> +        {"snap",     &tga_snap_on,    CONF_TYPE_FLAG,           0,   0,     1, NULL},
> +        {"nosnap",   &tga_snap_on,    CONF_TYPE_FLAG,           0,   0,     0, NULL},
> +        {"index",    &tga_index_on,   CONF_TYPE_FLAG,           0,   0,     1, NULL},
> +        {"noindex",  &tga_index_on,   CONF_TYPE_FLAG,           0,   0,     0, NULL},
> +
> +        {"snapinfo",   &tga_snap_idx, CONF_TYPE_FLAG,           0,   0,     1, NULL},
> +        {"nosnapinfo", &tga_snap_idx, CONF_TYPE_FLAG,           0,   0,     0, NULL},
> +        {"snaponly",   &tga_snap_idx, CONF_TYPE_FLAG,           0,   0,     2, NULL},
> +
> +        {"idxlast",    &tga_snap_use_last,    CONF_TYPE_FLAG,           0,   0,     1, NULL},
> +        {"noidxlast",  &tga_snap_use_last,    CONF_TYPE_FLAG,           0,   0,     0, NULL},
> +        {NULL, NULL, 0, 0, 0, 0, NULL}
> +};
> +#endif
> +

this part should be in vo_tga, not in config files.
only export the pointer to the subconfig structure (tga_conf).

> +/* statics */
> +    /* the font (ASCII character 0 - 127) for tag_put_string(...) */
> +    static uint8_t font08x08[] = {
> +        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +        0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e,
> +        0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e,
> +        0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00,

WTF ?

- we have nice OSD rendering code if you really want to add text
- i remember copyright problems with various 8x8 pixel fonts, this is why
  every VGA card has slightly different charset. dunno if it's still an
  issue, since the linux kernel fbdev code also includes some 8x8 font...


A'rpi / Astral & ESP-team

--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list