annotate libmpcodecs/vf_dvbscale.c @ 25635:25f6dca4df74

add support for per protocol and per extension playback profile loading
author ben
date Thu, 10 Jan 2008 18:45:08 +0000
parents 00fff9a3b735
children 0f1b5b68af32
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
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 9593
diff changeset
6 #include "config.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 9593
diff changeset
7 #include "mp_msg.h"
6002
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
25221
00fff9a3b735 Make all vf_info_t structs const
reimar
parents: 17012
diff changeset
40 const vf_info_t vf_info_dvbscale = {
6002
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 "",
9593
e9a2af584986 Add the new -vf option wich is the same as vop in reverse order.
albeu
parents: 6002
diff changeset
45 open,
e9a2af584986 Add the new -vf option wich is the same as vop in reverse order.
albeu
parents: 6002
diff changeset
46 NULL
6002
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
ba14193cc935 dvbscale - setup scaling for the DVB card
arpi
parents:
diff changeset
49 //===========================================================================//