2010-01-30 16:57:40 +00:00
|
|
|
/*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2002-04-09 14:01:53 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2005-11-18 14:39:25 +00:00
|
|
|
#include "config.h"
|
|
|
|
#include "mp_msg.h"
|
2002-04-09 14:01:53 +00:00
|
|
|
|
2002-04-13 19:14:34 +00:00
|
|
|
#include "img_format.h"
|
|
|
|
#include "mp_image.h"
|
2002-04-09 14:01:53 +00:00
|
|
|
#include "vf.h"
|
|
|
|
|
2003-03-15 20:51:35 +00:00
|
|
|
#include "m_option.h"
|
|
|
|
#include "m_struct.h"
|
|
|
|
|
|
|
|
static struct vf_priv_s {
|
2002-04-09 14:01:53 +00:00
|
|
|
unsigned int fmt;
|
2010-06-05 17:55:20 +00:00
|
|
|
unsigned int outfmt;
|
2007-01-28 16:48:01 +00:00
|
|
|
} const vf_priv_dflt = {
|
2010-06-05 17:55:20 +00:00
|
|
|
IMGFMT_YUY2,
|
|
|
|
0
|
2002-04-09 14:01:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//===========================================================================//
|
|
|
|
|
2010-05-29 14:15:55 +00:00
|
|
|
static int query_format(struct vf_instance *vf, unsigned int fmt){
|
2010-06-05 17:55:20 +00:00
|
|
|
if(fmt==vf->priv->fmt) {
|
|
|
|
if (vf->priv->outfmt)
|
|
|
|
fmt = vf->priv->outfmt;
|
2002-04-09 14:01:53 +00:00
|
|
|
return vf_next_query_format(vf,fmt);
|
2010-06-05 17:55:20 +00:00
|
|
|
}
|
2002-04-09 14:01:53 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-06-05 17:55:20 +00:00
|
|
|
static int config(struct vf_instance *vf, int width, int height,
|
|
|
|
int d_width, int d_height,
|
|
|
|
unsigned flags, unsigned outfmt){
|
|
|
|
return vf_next_config(vf, width, height, d_width, d_height, flags, vf->priv->outfmt);
|
|
|
|
}
|
|
|
|
|
2010-02-21 13:40:49 +00:00
|
|
|
static int vf_open(vf_instance_t *vf, char *args){
|
2002-04-09 14:01:53 +00:00
|
|
|
vf->query_format=query_format;
|
2010-06-05 17:45:35 +00:00
|
|
|
vf->draw_slice=vf_next_draw_slice;
|
2002-05-06 22:48:59 +00:00
|
|
|
vf->default_caps=0;
|
2010-06-05 17:55:20 +00:00
|
|
|
if (vf->priv->outfmt)
|
|
|
|
vf->config=config;
|
2002-04-09 14:01:53 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2003-03-15 20:51:35 +00:00
|
|
|
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
|
2008-04-26 13:35:40 +00:00
|
|
|
static const m_option_t vf_opts_fields[] = {
|
2003-03-15 20:51:35 +00:00
|
|
|
{"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
|
2010-06-05 17:55:20 +00:00
|
|
|
{"outfmt", ST_OFF(outfmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
|
2003-03-15 20:51:35 +00:00
|
|
|
{ NULL, NULL, 0, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
2008-04-26 13:35:40 +00:00
|
|
|
static const m_struct_t vf_opts = {
|
2003-03-15 20:51:35 +00:00
|
|
|
"format",
|
|
|
|
sizeof(struct vf_priv_s),
|
|
|
|
&vf_priv_dflt,
|
|
|
|
vf_opts_fields
|
|
|
|
};
|
|
|
|
|
2007-12-02 14:57:15 +00:00
|
|
|
const vf_info_t vf_info_format = {
|
2002-04-09 14:01:53 +00:00
|
|
|
"force output format",
|
|
|
|
"format",
|
|
|
|
"A'rpi",
|
2002-04-11 20:56:17 +00:00
|
|
|
"FIXME! get_image()/put_image()",
|
2010-02-21 13:40:49 +00:00
|
|
|
vf_open,
|
2003-03-15 20:51:35 +00:00
|
|
|
&vf_opts
|
2002-04-09 14:01:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//===========================================================================//
|