[Mplayer-cvslog] CVS: main/libmpcodecs Makefile,1.24,1.25 ad.c,1.6,1.7 dec_video.c,1.129,1.130 vf.h,1.2,1.3 vf_pp.c,1.4,1.5 vf_vo.c,1.3,1.4
Arpi of Ize
arpi at mplayer.dev.hu
Sun Apr 7 19:42:34 CEST 2002
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mplayer:/var/tmp.root/cvs-serv9149
Modified Files:
Makefile ad.c dec_video.c vf.h vf_pp.c vf_vo.c
Log Message:
vf control codes added, autoq support
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/Makefile,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Makefile 7 Apr 2002 03:20:41 -0000 1.24
+++ Makefile 7 Apr 2002 17:42:31 -0000 1.25
@@ -3,7 +3,7 @@
LIBNAME = libmpcodecs.a
-AUDIO_SRCS=dec_audio.c ad.c ad_a52.c ad_acm.c ad_alaw.c ad_dk3adpcm.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
+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
Index: ad.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ad.c 3 Apr 2002 20:14:18 -0000 1.6
+++ ad.c 7 Apr 2002 17:42:31 -0000 1.7
@@ -26,6 +26,7 @@
extern ad_functions_t mpcodecs_ad_imaadpcm;
extern ad_functions_t mpcodecs_ad_msadpcm;
extern ad_functions_t mpcodecs_ad_dk3adpcm;
+extern ad_functions_t mpcodecs_ad_dk4adpcm;
extern ad_functions_t mpcodecs_ad_roqaudio;
extern ad_functions_t mpcodecs_ad_dshow;
extern ad_functions_t mpcodecs_ad_acm;
Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -r1.129 -r1.130
--- dec_video.c 6 Apr 2002 22:05:01 -0000 1.129
+++ dec_video.c 7 Apr 2002 17:42:31 -0000 1.130
@@ -45,14 +45,31 @@
vd_functions_t* mpvdec=NULL;
int get_video_quality_max(sh_video_t *sh_video){
+ vf_instance_t* vf=sh_video->vfilter;
+ if(vf){
+ int ret=vf->control(vf,VFCTRL_QUERY_MAX_PP_LEVEL,NULL);
+ if(ret>0){
+ mp_msg(MSGT_DECVIDEO,MSGL_INFO,"[PP] Using external postprocessing filter, max q = %d\n",ret);
+ return ret;
+ }
+ }
if(mpvdec){
int ret=mpvdec->control(sh_video,VDCTRL_QUERY_MAX_PP_LEVEL,NULL);
- if(ret>=0) return ret;
+ if(ret>0){
+ mp_msg(MSGT_DECVIDEO,MSGL_INFO,"[PP] Using codec's postprocessing, max q = %d\n",ret);
+ return ret;
+ }
}
- return 0;
+ mp_msg(MSGT_DECVIDEO,MSGL_INFO,"[PP] Sorry, postprocessing is not available\n");
+ return 0;
}
void set_video_quality(sh_video_t *sh_video,int quality){
+ vf_instance_t* vf=sh_video->vfilter;
+ if(vf){
+ int ret=vf->control(vf,VFCTRL_SET_PP_LEVEL, (void*)(&quality));
+ if(ret==CONTROL_TRUE) return; // success
+ }
if(mpvdec)
mpvdec->control(sh_video,VDCTRL_SET_PP_LEVEL, (void*)(&quality));
}
Index: vf.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vf.h 6 Apr 2002 22:46:20 -0000 1.2
+++ vf.h 7 Apr 2002 17:42:31 -0000 1.3
@@ -40,6 +40,13 @@
struct vf_priv_s* priv;
} vf_instance_t;
+// control codes:
+#include "mpc_info.h"
+
+#define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
+#define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
+#define VFCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */
+
// functions:
mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h);
vf_instance_t* vf_open_filter(vf_instance_t* next, char *name, char *args);
Index: vf_pp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_pp.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vf_pp.c 7 Apr 2002 17:01:15 -0000 1.4
+++ vf_pp.c 7 Apr 2002 17:42:31 -0000 1.5
@@ -28,6 +28,17 @@
return 0;
}
+static int control(struct vf_instance_s* vf, int request, void* data){
+ switch(request){
+ case VFCTRL_QUERY_MAX_PP_LEVEL:
+ return GET_PP_QUALITY_MAX;
+ case VFCTRL_SET_PP_LEVEL:
+ vf->priv->pp=getPpModeForQuality(*((unsigned int*)data));
+ return CONTROL_TRUE;
+ }
+ return vf_next_control(vf,request,data);
+}
+
static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){
if(vf->priv->pp&0xFFFF) return; // non-local filters enabled
if((mpi->type==MP_IMGTYPE_IPB || vf->priv->pp) &&
@@ -74,6 +85,7 @@
static int open(vf_instance_t *vf, char* args){
char *endptr;
vf->query_format=query_format;
+ vf->control=control;
vf->get_image=get_image;
vf->put_image=put_image;
vf->priv=malloc(sizeof(struct vf_priv_s));
Index: vf_vo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_vo.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vf_vo.c 7 Apr 2002 02:12:15 -0000 1.3
+++ vf_vo.c 7 Apr 2002 17:42:31 -0000 1.4
@@ -26,7 +26,7 @@
static int control(struct vf_instance_s* vf,
int request, void* data){
// return video_out->control(request,data);
- return -3;
+ return CONTROL_UNKNOWN;
}
static int query_format(struct vf_instance_s* vf, unsigned int fmt){
More information about the MPlayer-cvslog
mailing list