30421
|
1 /*
|
|
2 * This file is part of MPlayer.
|
|
3 *
|
|
4 * MPlayer is free software; you can redistribute it and/or modify
|
|
5 * it under the terms of the GNU General Public License as published by
|
|
6 * the Free Software Foundation; either version 2 of the License, or
|
|
7 * (at your option) any later version.
|
|
8 *
|
|
9 * MPlayer is distributed in the hope that it will be useful,
|
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 * GNU General Public License for more details.
|
|
13 *
|
|
14 * You should have received a copy of the GNU General Public License along
|
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
17 */
|
|
18
|
5539
|
19 #include <stdio.h>
|
|
20 #include <stdlib.h>
|
|
21 #include <string.h>
|
|
22 #include <inttypes.h>
|
|
23
|
17012
|
24 #include "config.h"
|
|
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
diff
changeset
|
26 #include "help_mp.h"
|
5539
|
27
|
5607
|
28 #include "img_format.h"
|
|
29 #include "mp_image.h"
|
5539
|
30 #include "vf.h"
|
|
31
|
9601
|
32 #include "m_option.h"
|
|
33 #include "m_struct.h"
|
|
34
|
|
35 static struct vf_priv_s {
|
5539
|
36 unsigned int fmt;
|
31265
|
37 unsigned int outfmt;
|
22027
|
38 } const vf_priv_dflt = {
|
31265
|
39 IMGFMT_YUY2,
|
|
40 0
|
5539
|
41 };
|
|
42
|
|
43 //===========================================================================//
|
|
44
|
30642
|
45 static int query_format(struct vf_instance *vf, unsigned int fmt){
|
31265
|
46 if(fmt==vf->priv->fmt) {
|
|
47 if (vf->priv->outfmt)
|
|
48 fmt = vf->priv->outfmt;
|
5539
|
49 return vf_next_query_format(vf,fmt);
|
31265
|
50 }
|
5539
|
51 return 0;
|
|
52 }
|
|
53
|
31265
|
54 static int config(struct vf_instance *vf, int width, int height,
|
|
55 int d_width, int d_height,
|
|
56 unsigned flags, unsigned outfmt){
|
|
57 return vf_next_config(vf, width, height, d_width, d_height, flags, vf->priv->outfmt);
|
|
58 }
|
|
59
|
30638
|
60 static int vf_open(vf_instance_t *vf, char *args){
|
5539
|
61 vf->query_format=query_format;
|
31264
|
62 vf->draw_slice=vf_next_draw_slice;
|
6001
|
63 vf->default_caps=0;
|
31265
|
64 if (vf->priv->outfmt)
|
|
65 vf->config=config;
|
5539
|
66 return 1;
|
|
67 }
|
|
68
|
9601
|
69 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
|
30707
|
70 static const m_option_t vf_opts_fields[] = {
|
9601
|
71 {"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
|
31265
|
72 {"outfmt", ST_OFF(outfmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
|
9601
|
73 { NULL, NULL, 0, 0, 0, 0, NULL }
|
|
74 };
|
|
75
|
30707
|
76 static const m_struct_t vf_opts = {
|
9601
|
77 "format",
|
|
78 sizeof(struct vf_priv_s),
|
|
79 &vf_priv_dflt,
|
|
80 vf_opts_fields
|
|
81 };
|
|
82
|
25221
|
83 const vf_info_t vf_info_format = {
|
5539
|
84 "force output format",
|
|
85 "format",
|
|
86 "A'rpi",
|
5565
|
87 "FIXME! get_image()/put_image()",
|
30638
|
88 vf_open,
|
9601
|
89 &vf_opts
|
5539
|
90 };
|
|
91
|
|
92 //===========================================================================//
|