6002
|
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"
|
|
8
|
|
9 #include "img_format.h"
|
|
10 #include "mp_image.h"
|
|
11 #include "vf.h"
|
|
12
|
|
13 struct vf_priv_s {
|
|
14 int aspect;
|
|
15 };
|
|
16
|
|
17 //===========================================================================//
|
|
18
|
|
19 static int config(struct vf_instance_s* vf,
|
|
20 int width, int height, int d_width, int d_height,
|
|
21 unsigned int flags, unsigned int outfmt){
|
|
22
|
|
23 int scaled_y=vf->priv->aspect*d_height/d_width;
|
|
24
|
|
25 d_width=width; // do X-scaling by hardware
|
|
26 d_height=scaled_y;
|
|
27
|
|
28 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
|
|
29 }
|
|
30
|
|
31 static int open(vf_instance_t *vf, char* args){
|
|
32 vf->config=config;
|
|
33 vf->default_caps=0;
|
|
34 vf->priv=malloc(sizeof(struct vf_priv_s));
|
|
35 vf->priv->aspect=768;
|
|
36 if(args) vf->priv->aspect=atoi(args);
|
|
37 return 1;
|
|
38 }
|
|
39
|
|
40 vf_info_t vf_info_dvbscale = {
|
|
41 "calc Y scaling for DVB card",
|
|
42 "dvbscale",
|
|
43 "A'rpi",
|
|
44 "",
|
|
45 open
|
|
46 };
|
|
47
|
|
48 //===========================================================================//
|