9 #include "img_format.h"
18 static int config(struct vf_instance_s
* vf
,
19 int width
, int height
, int d_width
, int d_height
,
20 unsigned int flags
, unsigned int outfmt
)
22 if (vf
->priv
->w
&& vf
->priv
->h
) {
23 d_width
= vf
->priv
->w
;
24 d_height
= vf
->priv
->h
;
26 if (vf
->priv
->aspect
* height
> width
) {
27 d_width
= height
* vf
->priv
->aspect
;
30 d_height
= width
/ vf
->priv
->aspect
;
34 return vf_next_config(vf
, width
, height
, d_width
, d_height
, flags
, outfmt
);
37 static int open(vf_instance_t
*vf
, char* args
)
40 vf
->draw_slice
= vf_next_draw_slice
;
41 //vf->default_caps = 0;
42 vf
->priv
= calloc(sizeof(struct vf_priv_s
), 1);
43 vf
->priv
->aspect
= 4.0/3.0;
45 if (strchr(args
, '/')) {
47 sscanf(args
, "%d/%d", &w
, &h
);
48 vf
->priv
->aspect
= (float)w
/h
;
49 } else if (strchr(args
, '.')) {
50 sscanf(args
, "%f", &vf
->priv
->aspect
);
52 sscanf(args
, "%d:%d", &vf
->priv
->w
, &vf
->priv
->h
);
58 vf_info_t vf_info_dsize
= {
59 "reset displaysize/aspect",