Use MSGT_DECVIDEO in a video decoder.
[mplayer/glamo.git] / libmpcodecs / vf_format.c
blobfa511e9e79c7b1fae2701fd76e43be3c05badd21
1 /*
2 * This file is part of MPlayer.
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.
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.
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.
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include <inttypes.h>
24 #include "config.h"
25 #include "mp_msg.h"
26 #include "help_mp.h"
28 #include "img_format.h"
29 #include "mp_image.h"
30 #include "vf.h"
32 #include "m_option.h"
33 #include "m_struct.h"
35 static struct vf_priv_s {
36 unsigned int fmt;
37 } const vf_priv_dflt = {
38 IMGFMT_YUY2
41 //===========================================================================//
43 static int query_format(struct vf_instance *vf, unsigned int fmt){
44 if(fmt==vf->priv->fmt)
45 return vf_next_query_format(vf,fmt);
46 return 0;
49 static int vf_open(vf_instance_t *vf, char *args){
50 vf->query_format=query_format;
51 vf->default_caps=0;
52 return 1;
55 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
56 static const m_option_t vf_opts_fields[] = {
57 {"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
58 { NULL, NULL, 0, 0, 0, 0, NULL }
61 static const m_struct_t vf_opts = {
62 "format",
63 sizeof(struct vf_priv_s),
64 &vf_priv_dflt,
65 vf_opts_fields
68 const vf_info_t vf_info_format = {
69 "force output format",
70 "format",
71 "A'rpi",
72 "FIXME! get_image()/put_image()",
73 vf_open,
74 &vf_opts
77 //===========================================================================//