annotate libmpcodecs/vf_format.c @ 35070:ff4758e8cfba

Change geometry for corevideo vo to not take dock into account. It makes the % placements behave non-intuitively, particularly with an auto-hide dock where it would depend on whether the dock is visible right when MPlayer starts up.
author reimar
date Tue, 11 Sep 2012 20:03:52 +0000
parents 59f9bf345c0f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30421
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
1 /*
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
2 * This file is part of MPlayer.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
3 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
5 * it under the terms of the GNU General Public License as published by
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
7 * (at your option) any later version.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
8 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
12 * GNU General Public License for more details.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
13 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
14 * You should have received a copy of the GNU General Public License along
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
17 */
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29903
diff changeset
18
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
19 #include <stdio.h>
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
20 #include <stdlib.h>
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
21 #include <string.h>
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
22 #include <inttypes.h>
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
23
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 12999
diff changeset
24 #include "config.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 12999
diff changeset
25 #include "mp_msg.h"
18004
bcd805923554 Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents: 17012
diff changeset
26 #include "help_mp.h"
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
27
5607
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
28 #include "img_format.h"
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
29 #include "mp_image.h"
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
30 #include "vf.h"
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
31
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
32 #include "m_option.h"
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
33 #include "m_struct.h"
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
34
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
35 static struct vf_priv_s {
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
36 unsigned int fmt;
31265
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
37 unsigned int outfmt;
22027
0b262e00bc99 Mark m_struct_t defaults as const
reimar
parents: 18004
diff changeset
38 } const vf_priv_dflt = {
31265
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
39 IMGFMT_YUY2,
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
40 0
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
41 };
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
42
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
43 //===========================================================================//
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
44
30642
a972c1a4a012 cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents: 30638
diff changeset
45 static int query_format(struct vf_instance *vf, unsigned int fmt){
31265
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
46 if(fmt==vf->priv->fmt) {
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
47 if (vf->priv->outfmt)
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
48 fmt = vf->priv->outfmt;
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
49 return vf_next_query_format(vf,fmt);
31265
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
50 }
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
51 return 0;
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
52 }
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
53
31265
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
54 static int config(struct vf_instance *vf, int width, int height,
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
55 int d_width, int d_height,
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
56 unsigned flags, unsigned outfmt){
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
57 return vf_next_config(vf, width, height, d_width, d_height, flags, vf->priv->outfmt);
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
58 }
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
59
30638
a7b908875c14 Rename open() vf initialization function to vf_open().
diego
parents: 30421
diff changeset
60 static int vf_open(vf_instance_t *vf, char *args){
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
61 vf->query_format=query_format;
31264
f19d56a023db Fix -vf format and -vf noformat to work with slices.
reimar
parents: 30707
diff changeset
62 vf->draw_slice=vf_next_draw_slice;
6001
0263a3eabcd7 reset default caps
arpi
parents: 5607
diff changeset
63 vf->default_caps=0;
31265
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
64 if (vf->priv->outfmt)
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
65 vf->config=config;
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
66 return 1;
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
67 }
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
68
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
69 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
30707
4d15378da04a Mark vf_opts/vf_opts_fields structures as const.
diego
parents: 30642
diff changeset
70 static const m_option_t vf_opts_fields[] = {
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
71 {"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
31265
59f9bf345c0f Extend -vf format to allow substituting the format for a compatible one
reimar
parents: 31264
diff changeset
72 {"outfmt", ST_OFF(outfmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
73 { NULL, NULL, 0, 0, 0, 0, NULL }
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
74 };
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
75
30707
4d15378da04a Mark vf_opts/vf_opts_fields structures as const.
diego
parents: 30642
diff changeset
76 static const m_struct_t vf_opts = {
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
77 "format",
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
78 sizeof(struct vf_priv_s),
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
79 &vf_priv_dflt,
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
80 vf_opts_fields
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
81 };
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
82
25221
00fff9a3b735 Make all vf_info_t structs const
reimar
parents: 22027
diff changeset
83 const vf_info_t vf_info_format = {
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
84 "force output format",
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
85 "format",
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
86 "A'rpi",
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5539
diff changeset
87 "FIXME! get_image()/put_image()",
30638
a7b908875c14 Rename open() vf initialization function to vf_open().
diego
parents: 30421
diff changeset
88 vf_open,
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
89 &vf_opts
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
90 };
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
91
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
92 //===========================================================================//