[Mplayer-cvslog] CVS: main/libmpcodecs vf_dsize.c,NONE,1.1 Makefile,1.94,1.95 vf.c,1.78,1.79
Richard Felker CVS
rfelker at mplayerhq.hu
Sun Apr 27 20:55:38 CEST 2003
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv442/libmpcodecs
Modified Files:
Makefile vf.c
Added Files:
vf_dsize.c
Log Message:
display size/aspect adjusting filter
--- NEW FILE ---
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "../config.h"
#include "../mp_msg.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
struct vf_priv_s {
int w, h;
float aspect;
};
static int config(struct vf_instance_s* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt)
{
if (vf->priv->w && vf->priv->h) {
d_width = vf->priv->w;
d_height = vf->priv->h;
} else {
if (vf->priv->aspect * height > width) {
d_width = height * vf->priv->aspect;
d_height = height;
} else {
d_height = width / vf->priv->aspect;
d_width = width;
}
}
return vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
}
static int open(vf_instance_t *vf, char* args)
{
vf->config = config;
vf->draw_slice = vf_next_draw_slice;
//vf->default_caps = 0;
vf->priv = calloc(sizeof(struct vf_priv_s), 1);
vf->priv->aspect = 4.0/3.0;
if (args) {
if (strchr(args, '/')) {
int w, h;
sscanf(args, "%d/%d", &w, &h);
vf->priv->aspect = (float)w/h;
} else if (strchr(args, '.')) {
sscanf(args, "%f", &vf->priv->aspect);
} else {
sscanf(args, "%d:%d", &vf->priv->w, &vf->priv->h);
}
}
return 1;
}
vf_info_t vf_info_dsize = {
"reset displaysize/aspect",
"dsize",
"Rich Felker",
"",
open,
NULL
};
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/Makefile,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- Makefile 19 Apr 2003 01:39:37 -0000 1.94
+++ Makefile 27 Apr 2003 18:55:04 -0000 1.95
@@ -14,7 +14,7 @@
VIDEO_SRCS_OPT=vd_realvid.c vd_ffmpeg.c vd_dshow.c vd_dmo.c vd_vfw.c vd_vfwex.c vd_odivx.c vd_divx4.c vd_xanim.c vd_xvid.c vd_libdv.c vd_qtvideo.c
VIDEO_SRCS=dec_video.c vd.c $(VIDEO_SRCS_NAT) $(VIDEO_SRCS_LIB) $(VIDEO_SRCS_OPT)
-VFILTER_SRCS=vf.c vf_vo.c vf_crop.c vf_expand.c vf_pp.c vf_scale.c vf_format.c vf_yuy2.c vf_flip.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_lavc.c vf_dvbscale.c vf_cropdetect.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_lavcdeint.c vf_eq.c vf_eq2.c vf_halfpack.c vf_dint.c vf_1bpp.c vf_bmovl.c vf_2xsai.c vf_unsharp.c vf_swapuv.c vf_il.c vf_boxblur.c vf_sab.c vf_smartblur.c vf_perspective.c vf_down3dright.c vf_field.c vf_denoise3d.c vf_hqdn3d.c vf_detc.c vf_telecine.c vf_tfields.c vf_ivtc.c vf_ilpack.c
+VFILTER_SRCS=vf.c vf_vo.c vf_crop.c vf_expand.c vf_pp.c vf_scale.c vf_format.c vf_yuy2.c vf_flip.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_lavc.c vf_dvbscale.c vf_cropdetect.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_lavcdeint.c vf_eq.c vf_eq2.c vf_halfpack.c vf_dint.c vf_1bpp.c vf_bmovl.c vf_2xsai.c vf_unsharp.c vf_swapuv.c vf_il.c vf_boxblur.c vf_sab.c vf_smartblur.c vf_perspective.c vf_down3dright.c vf_field.c vf_denoise3d.c vf_hqdn3d.c vf_detc.c vf_telecine.c vf_tfields.c vf_ivtc.c vf_ilpack.c vf_dsize.c
ENCODER_SRCS=ve.c ve_divx4.c ve_lavc.c ve_vfw.c ve_rawrgb.c ve_libdv.c ve_xvid.c ve_qtvideo.c ve_nuv.c
NATIVE_SRCS=native/RTjpegN.c native/cinepak.c native/fli.c native/minilzo.c native/msvidc.c native/nuppelvideo.c native/qtrle.c native/qtrpza.c native/qtsmc.c native/roqav.c native/xa_gsm.c native/svq1.c
Index: vf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- vf.c 19 Apr 2003 02:48:53 -0000 1.78
+++ vf.c 27 Apr 2003 18:55:04 -0000 1.79
@@ -65,6 +65,7 @@
extern vf_info_t vf_info_tfields;
extern vf_info_t vf_info_ivtc;
extern vf_info_t vf_info_ilpack;
+extern vf_info_t vf_info_dsize;
// list of available filters:
static vf_info_t* filter_list[]={
@@ -121,6 +122,7 @@
&vf_info_tfields,
&vf_info_ivtc,
&vf_info_ilpack,
+ &vf_info_dsize,
NULL
};
More information about the MPlayer-cvslog
mailing list