annotate libmpcodecs/vf_dvbscale.c @ 7854:d6c29d863f15

dvd chapter detect function from Gregory Kovriga
author pontscho
date Tue, 22 Oct 2002 22:45:30 +0000
parents ba14193cc935
children e9a2af584986
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6002
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
1 #include <stdio.h>
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
2 #include <stdlib.h>
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
3 #include <string.h>
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
4 #include <inttypes.h>
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
5
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
6 #include "../config.h"
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
7 #include "../mp_msg.h"
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
8
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
9 #include "img_format.h"
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
10 #include "mp_image.h"
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
11 #include "vf.h"
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
12
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
13 struct vf_priv_s {
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
14 int aspect;
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
15 };
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
16
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
17 //===========================================================================//
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
18
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
19 static int config(struct vf_instance_s* vf,
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
20 int width, int height, int d_width, int d_height,
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
21 unsigned int flags, unsigned int outfmt){
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
22
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
23 int scaled_y=vf->priv->aspect*d_height/d_width;
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
24
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
25 d_width=width; // do X-scaling by hardware
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
26 d_height=scaled_y;
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
27
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
28 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
29 }
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
30
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
31 static int open(vf_instance_t *vf, char* args){
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
32 vf->config=config;
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
33 vf->default_caps=0;
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
34 vf->priv=malloc(sizeof(struct vf_priv_s));
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
35 vf->priv->aspect=768;
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
36 if(args) vf->priv->aspect=atoi(args);
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
37 return 1;
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
38 }
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
39
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
40 vf_info_t vf_info_dvbscale = {
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
41 "calc Y scaling for DVB card",
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
42 "dvbscale",
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
43 "A'rpi",
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
44 "",
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
45 open
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
46 };
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
47
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
48 //===========================================================================//