dvbscale - setup scaling for the DVB card
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 6 May 2002 22:49:31 +0000 (22:49 +0000)
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 6 May 2002 22:49:31 +0000 (22:49 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@6003 b3059339-0415-0410-9bf9-f77b7e298cf2

libmpcodecs/Makefile
libmpcodecs/vf_dvbscale.c [new file with mode: 0644]

index 7b80eb8..b8325a4 100644 (file)
@@ -6,7 +6,7 @@ LIBNAME2 = libmpencoders.a
 
 AUDIO_SRCS=dec_audio.c ad.c ad_a52.c ad_acm.c ad_alaw.c ad_dk3adpcm.c ad_dk4adpcm.c ad_dshow.c ad_dvdpcm.c ad_ffmpeg.c ad_hwac3.c ad_imaadpcm.c ad_mp3.c ad_msadpcm.c ad_pcm.c ad_roqaudio.c ad_msgsm.c ad_faad.c ad_vorbis.c ad_libmad.c
 VIDEO_SRCS=dec_video.c vd.c vd_null.c vd_cinepak.c vd_qtrpza.c vd_ffmpeg.c vd_dshow.c vd_vfw.c vd_odivx.c vd_divx4.c vd_raw.c vd_xanim.c vd_msvidc.c vd_fli.c vd_qtrle.c vd_qtsmc.c vd_roqvideo.c vd_cyuv.c vd_nuv.c vd_libmpeg2.c vd_msrle.c vd_huffyuv.c vd_zlib.c vd_mpegpes.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
+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
 ENCODER_SRCS=ve.c ve_divx4.c ve_lavc.c ve_vfw.c ve_rawrgb.c ve_libdv.c
 NATIVE_SRCS=native/RTjpegN.c native/cinepak.c native/cyuv.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
 
diff --git a/libmpcodecs/vf_dvbscale.c b/libmpcodecs/vf_dvbscale.c
new file mode 100644 (file)
index 0000000..987482e
--- /dev/null
@@ -0,0 +1,48 @@
+#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 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){
+
+    int scaled_y=vf->priv->aspect*d_height/d_width;
+    
+    d_width=width; // do X-scaling by hardware
+    d_height=scaled_y;
+
+    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->default_caps=0;
+    vf->priv=malloc(sizeof(struct vf_priv_s));
+    vf->priv->aspect=768;
+    if(args) vf->priv->aspect=atoi(args);
+    return 1;
+}
+
+vf_info_t vf_info_dvbscale = {
+    "calc Y scaling for DVB card",
+    "dvbscale",
+    "A'rpi",
+    "",
+    open
+};
+
+//===========================================================================//