~medibuntu-maintainers/mplayer/medibuntu.maverick

1 by Sebastian Dröge
Import upstream version 0.99+1.0pre7try2+cvs20051205
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <string.h>
4
#include <inttypes.h>
5
6
#include "config.h"
7
#include "mp_msg.h"
1.1.2 by Reinhard Tartler
Import upstream version 0.99+1.0pre8
8
#include "help_mp.h"
1 by Sebastian Dröge
Import upstream version 0.99+1.0pre7try2+cvs20051205
9
10
#include "img_format.h"
11
#include "mp_image.h"
12
#include "vf.h"
13
14
#include "m_option.h"
15
#include "m_struct.h"
16
17
static struct vf_priv_s {
18
    unsigned int fmt;
1.1.4 by Mario Limonciello
Import upstream version 1.0~rc2
19
} const vf_priv_dflt = {
1 by Sebastian Dröge
Import upstream version 0.99+1.0pre7try2+cvs20051205
20
  IMGFMT_YUY2
21
};
22
23
//===========================================================================//
24
25
static int query_format(struct vf_instance_s* vf, unsigned int fmt){
26
    if(fmt==vf->priv->fmt)
27
	return vf_next_query_format(vf,fmt);
28
    return 0;
29
}
30
31
static int open(vf_instance_t *vf, char* args){
32
    vf->query_format=query_format;
33
    vf->default_caps=0;
34
    if(!vf->priv) {
35
      vf->priv=malloc(sizeof(struct vf_priv_s));
36
      vf->priv->fmt=IMGFMT_YUY2;
37
    }
38
    if(args){
39
	if(!strcasecmp(args,"444p")) vf->priv->fmt=IMGFMT_444P; else
40
	if(!strcasecmp(args,"422p")) vf->priv->fmt=IMGFMT_422P; else
41
	if(!strcasecmp(args,"411p")) vf->priv->fmt=IMGFMT_411P; else
42
	if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else
43
	if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else
44
	if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else
45
	if(!strcasecmp(args,"yvu9")) vf->priv->fmt=IMGFMT_YVU9; else
46
	if(!strcasecmp(args,"if09")) vf->priv->fmt=IMGFMT_IF09; else
47
	if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else
48
	if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else
49
	if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
50
	if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
51
	if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
52
	if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
53
	if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else
54
	if(!strcasecmp(args,"bgr4")) vf->priv->fmt=IMGFMT_BGR4; else
55
	if(!strcasecmp(args,"bg4b")) vf->priv->fmt=IMGFMT_BG4B; else
56
	if(!strcasecmp(args,"bgr1")) vf->priv->fmt=IMGFMT_BGR1; else
57
	if(!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
58
	if(!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
59
	if(!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
60
	if(!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
61
	if(!strcasecmp(args,"rgb8")) vf->priv->fmt=IMGFMT_RGB8; else
62
	if(!strcasecmp(args,"rgb4")) vf->priv->fmt=IMGFMT_RGB4; else
63
	if(!strcasecmp(args,"rg4b")) vf->priv->fmt=IMGFMT_RG4B; else
64
	if(!strcasecmp(args,"rgb1")) vf->priv->fmt=IMGFMT_RGB1; else
65
	if(!strcasecmp(args,"rgba")) vf->priv->fmt=IMGFMT_RGBA; else
66
	if(!strcasecmp(args,"argb")) vf->priv->fmt=IMGFMT_ARGB; else
67
	if(!strcasecmp(args,"bgra")) vf->priv->fmt=IMGFMT_BGRA; else
68
	if(!strcasecmp(args,"abgr")) vf->priv->fmt=IMGFMT_ABGR; else
1.1.2 by Reinhard Tartler
Import upstream version 0.99+1.0pre8
69
	{ mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);return 0;}
1 by Sebastian Dröge
Import upstream version 0.99+1.0pre7try2+cvs20051205
70
    }
71
        
72
73
    return 1;
74
}
75
76
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
77
static m_option_t vf_opts_fields[] = {
78
  {"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
79
  { NULL, NULL, 0, 0, 0, 0,  NULL }
80
};
81
82
static m_struct_t vf_opts = {
83
  "format",
84
  sizeof(struct vf_priv_s),
85
  &vf_priv_dflt,
86
  vf_opts_fields
87
};
88
0.2.1 by Reinhard Tartler
Import upstream version 1.0~rc2+svn20090303
89
const vf_info_t vf_info_format = {
1 by Sebastian Dröge
Import upstream version 0.99+1.0pre7try2+cvs20051205
90
    "force output format",
91
    "format",
92
    "A'rpi",
93
    "FIXME! get_image()/put_image()",
94
    open,
95
    &vf_opts
96
};
97
98
//===========================================================================//