[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[429] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-22 10:20:01
|
Revision: 429 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=429&view=rev Author: nickols_k Date: 2012-11-22 10:19:50 +0000 (Thu, 22 Nov 2012) Log Message: ----------- switch to vidix v1.5 Modified Paths: -------------- NEWS functions mplayerxp/configure mplayerxp/libvo/vo_null.cpp mplayerxp/libvo/vo_x11.cpp mplayerxp/libvo/vosub_vidix.cpp Modified: NEWS =================================================================== --- NEWS 2012-11-21 17:19:17 UTC (rev 428) +++ NEWS 2012-11-22 10:19:50 UTC (rev 429) @@ -13,6 +13,8 @@ libefence but with extended functionality. * Upgrade ffmpeg upto ffmpeg-1.0.0. Now MPlayerXP finds codecs within of libavcodec even they are unlisted in codecs.conf +* Project was rewritten in C++ +* Use vidix v1.5 with C++ support Version 0.7.96 Modified: functions =================================================================== --- functions 2012-11-21 17:19:17 UTC (rev 428) +++ functions 2012-11-22 10:19:50 UTC (rev 429) @@ -290,6 +290,10 @@ append CFLAGS "$@" } +add_cxxflags(){ + append CXXFLAGS "$@" +} + add_asflags(){ append ASFLAGS "$@" } @@ -298,6 +302,10 @@ append LDFLAGS "$@" } +add_ldxxflags(){ + append LDXXFLAGS "$@" +} + add_extralibs(){ append extralibs "$@" } @@ -314,6 +322,13 @@ check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC } +check_cxx(){ + log check_cxx "$@" + cat >$TMPC + log_file $TMPC + check_cmd $cxx $CXXFLAGS "$@" -c -o $TMPO $TMPC +} + check_cpp(){ log check_cpp "$@" cat >$TMPC @@ -344,6 +359,12 @@ check_cmd $cc $LDFLAGS -o $TMPE $TMPO $extralibs "$@" } +check_ldxx(){ + log check_ld "$@" + check_cxx || return + check_cmd $cxx $LDFLAGS $LDXXFLAGS -o $TMPE $TMPO $extralibs "$@" +} + test_cflags(){ log check_cflags "$@" check_cc "$@" <<EOF && return 0 || return 1 @@ -351,10 +372,21 @@ EOF } +test_cxxflags(){ + log check_cxxflags "$@" + check_cxx "$@" <<EOF && return 0 || return 1 +int x; +EOF +} + check_cflags(){ test_cflags "$@" && add_cflags "$@" } +check_cxxflags(){ + test_cxxflags "$@" && add_cxxflags "$@" +} + is_in_cflags(){ value=$1 shift @@ -365,6 +397,16 @@ return 1 } +is_in_cxxflags(){ + value=$1 + shift + for var in $CXXFLAGS; do + tmp=$(trim `echo $var | cut -d '=' -f 1`) + [ $tmp = $value ] && return 0 + done + return 1 +} + test_ldflags(){ log check_ldflags "$@" check_ld "$@" <<EOF && return 0 || return 1 @@ -378,6 +420,10 @@ test_ldflags "$@" && add_ldflags "$@" } +check_ldxxflags(){ + test_ldxxflags "$@" && add_ldxxflags "$@" +} + check_header(){ log check_header "$@" header=$1 @@ -509,6 +555,30 @@ enabled $func && return 0 || return 1 } +check_class2(){ + echocheck "$2" + log check_class2 "$@" + headers=$1 + class=$2 + shift 2 + disable $class + incs="" + for hdr in $headers; do + incs="$incs +#include <$hdr>" + done + check_ldxx "$@" <<EOF && enable $class +$incs +class $class; +int main(void){ + return 0; +} +EOF + enabled $class && answer="yes" || answer="no" + echores $answer + enabled $class && return 0 || return 1 +} + check_lfunc2(){ echocheck "$2" log check_lfunc2 "$@" @@ -603,6 +673,18 @@ return $err } +check_libxx2(){ + log check_libxx2 "$@" + headers="$1" + class="$2" + shift 2 + temp_extralibs "$@" + check_class2 "$headers" $class && add_extralibs "$@" + err=$? + restore_flags + return $err +} + check_llib(){ log check_lib "$@" header="$1" @@ -811,6 +893,19 @@ echores $answer } +xxrequire2(){ + echocheck "$1" + name="$1" + headers="$2" + class="$3" + shift 3 + disable $name + check_libxx2 "$headers" $class "$@" && enable $name + answer="no" + enabled $name && answer="yes" + echores $answer +} + lrequire(){ echocheck "$1" name="$1" @@ -889,6 +984,19 @@ return "$TMP" } +cxx_check() { + echo >> "$TMPLOG" + cat "$TMPC" >> "$TMPLOG" + echo >> "$TMPLOG" + ( check_cmd $cxx $CXXFLAGS $inc_extra $ld_static $ld_extra "$TMPC" -o "$TMPO" "$@" ) >> "$TMPLOG" 2>&1 + TMP="$?" + echo >> "$TMPLOG" + echo "ldd $TMPO" >> "$TMPLOG" + ( ldd "$TMPO" ) >> "$TMPLOG" 2>&1 + echo >> "$TMPLOG" + return "$TMP" +} + # Display error message, flushes tempfile, exit warning() { log "Warning: $@" Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2012-11-21 17:19:17 UTC (rev 428) +++ mplayerxp/configure 2012-11-22 10:19:50 UTC (rev 429) @@ -769,7 +769,7 @@ enabled dbg23 def_debug='#define MP_DEBUG 1' || def_debug='#undef MP_DEBUG' # Checking for VIDIX -enabled vidix && require2 vidix vidix/vidixlib.h vdlAllocFourccS -lvidix +enabled vidix && xxrequire2 vidix "vidix/vidix.h vidix/vidixlibxx.h" Vidix -lvidixxx print_config CONFIG_ mp_config.h mp_config.mak vidix enabled x11 && enabled vidix && vomodules="vidix $vomodules" || novomodules="vidix $novomodules" Modified: mplayerxp/libvo/vo_null.cpp =================================================================== --- mplayerxp/libvo/vo_null.cpp 2012-11-21 17:19:17 UTC (rev 428) +++ mplayerxp/libvo/vo_null.cpp 2012-11-22 10:19:50 UTC (rev 429) @@ -34,7 +34,7 @@ #include "video_out_internal.h" #include "dri_vo.h" #ifdef CONFIG_VIDIX -#include <vidix/vidixlib.h> +#include <vidix/vidix.h> #endif #include "vo_msg.h" Modified: mplayerxp/libvo/vo_x11.cpp =================================================================== --- mplayerxp/libvo/vo_x11.cpp 2012-11-21 17:19:17 UTC (rev 428) +++ mplayerxp/libvo/vo_x11.cpp 2012-11-22 10:19:50 UTC (rev 429) @@ -47,7 +47,7 @@ #include "video_out.h" #ifdef CONFIG_VIDIX #include "vosub_vidix.h" -#include <vidix/vidixlib.h> +#include <vidix/vidix.h> #endif #include "dri_vo.h" #include "xmpcore/mp_image.h" @@ -310,16 +310,14 @@ } else MSG_V("vo_vesa: Using VIDIX\n"); if(vidix_start(vo)!=0) return MPXP_False; if (vidix_grkey_support(vo)) { - vidix_grkey_t *gr_key; - gr_key = vdlAllocGrKeyS(); - vidix_grkey_get(vo,gr_key); - gr_key->key_op = KEYS_PUT; - gr_key->ckey.op = CKEY_TRUE; - gr_key->ckey.red = 255; - gr_key->ckey.green = 0; - gr_key->ckey.blue = 255; - vidix_grkey_set(vo,gr_key); - vdlFreeGrKeyS(gr_key); + vidix_grkey_t gr_key; + vidix_grkey_get(vo,&gr_key); + gr_key.key_op = KEYS_PUT; + gr_key.ckey.op = CKEY_TRUE; + gr_key.ckey.red = 255; + gr_key.ckey.green = 0; + gr_key.ckey.blue = 255; + vidix_grkey_set(vo,&gr_key); } } #endif @@ -411,8 +409,9 @@ flags = 0; #ifdef CONFIG_VIDIX if(memcmp(sd,"vidix",5) == 0) priv->vidix_name = &sd[5]; /* priv->vidix_name will be valid within init() */ + else #endif - else { MSG_ERR("vo_vesa: Unknown subdevice: '%s'\n", sd); return 0xFFFFFFFFUL; } + { MSG_ERR("vo_vesa: Unknown subdevice: '%s'\n", sd); return 0xFFFFFFFFUL; } return flags; } Modified: mplayerxp/libvo/vosub_vidix.cpp =================================================================== --- mplayerxp/libvo/vosub_vidix.cpp 2012-11-21 17:19:17 UTC (rev 428) +++ mplayerxp/libvo/vosub_vidix.cpp 2012-11-22 10:19:50 UTC (rev 429) @@ -24,7 +24,8 @@ #include "mplayerxp.h" #include "osdep/mplib.h" -#include <vidix/vidixlib.h> +#include <vidix/vidix.h> +#include <vidix/vidixlibxx.h> #include "video_out.h" #include "vosub_vidix.h" @@ -36,32 +37,28 @@ #include "xmpcore/mp_image.h" #include "vo_msg.h" +using namespace vidix; + #define NUM_FRAMES MAX_DRI_BUFFERS /* Temporary: driver will overwrite it */ typedef struct priv_s { + priv_s(Vidix& it) : vidix(it) {} + virtual ~priv_s() {} + unsigned image_Bpp,image_height,image_width,src_format,forced_fourcc; - VDL_HANDLE handler; + Vidix& vidix; uint8_t * mem; int video_on; - vidix_capability_t* cap; - vidix_playback_t* play; - vidix_fourcc_t* fourcc; - vidix_yuv_t* dstrides; - const vo_functions_t*vo_server; int inited; - vidix_video_eq_t eq; /* bus mastering */ int bm_locked; /* requires root privelegies */ uint8_t * bm_buffs[NUM_FRAMES]; unsigned bm_total_frames,bm_slow_frames; - - vidix_dma_t vdma; - MPXP_Rc (* __FASTCALL__ server_control)(vo_data_t*,uint32_t request, any_t*data); }priv_t; static int __FASTCALL__ vidix_get_video_eq(const vo_data_t* vo,vo_videq_t *info); @@ -73,14 +70,14 @@ int vidix_start(vo_data_t* vo) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); int err; - if((err=vdlPlaybackOn(priv->handler))!=0) { + if((err=priv.vidix.playback_on())!=0) { MSG_FATAL("Can't start playback: %s\n",strerror(err)); return -1; } - priv->video_on=1; - if (priv->cap->flags & FLAG_EQUALIZER) { + priv.video_on=1; + if (priv.vidix.cap.flags & FLAG_EQUALIZER) { MSG_V("vo_gamma_brightness=%i\n" "vo_gamma_saturation=%i\n" "vo_gamma_contrast=%i\n" @@ -95,17 +92,17 @@ ,vo_conf.gamma.red_intensity ,vo_conf.gamma.green_intensity ,vo_conf.gamma.blue_intensity); - /* To use full set of priv->eq.cap */ - if(vdlPlaybackGetEq(priv->handler,&priv->eq) == 0) { - priv->eq.brightness = vo_conf.gamma.brightness; - priv->eq.saturation = vo_conf.gamma.saturation; - priv->eq.contrast = vo_conf.gamma.contrast; - priv->eq.hue = vo_conf.gamma.hue; - priv->eq.red_intensity = vo_conf.gamma.red_intensity; - priv->eq.green_intensity = vo_conf.gamma.green_intensity; - priv->eq.blue_intensity = vo_conf.gamma.blue_intensity; - priv->eq.flags = VEQ_FLG_ITU_R_BT_601; - vdlPlaybackSetEq(priv->handler,&priv->eq); + /* To use full set of priv.video_eq.cap */ + if(priv.vidix.get_eq() == 0) { + priv.vidix.video_eq.brightness = vo_conf.gamma.brightness; + priv.vidix.video_eq.saturation = vo_conf.gamma.saturation; + priv.vidix.video_eq.contrast = vo_conf.gamma.contrast; + priv.vidix.video_eq.hue = vo_conf.gamma.hue; + priv.vidix.video_eq.red_intensity = vo_conf.gamma.red_intensity; + priv.vidix.video_eq.green_intensity = vo_conf.gamma.green_intensity; + priv.vidix.video_eq.blue_intensity = vo_conf.gamma.blue_intensity; + priv.vidix.video_eq.flags = VEQ_FLG_ITU_R_BT_601; + priv.vidix.set_eq(); } } return 0; @@ -113,64 +110,63 @@ int vidix_stop(vo_data_t* vo) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); int err; - if((err=vdlPlaybackOff(priv->handler))!=0) { + if((err=priv.vidix.playback_off())!=0) { MSG_ERR("Can't stop playback: %s\n",strerror(err)); return -1; } - priv->video_on=0; + priv.video_on=0; return 0; } void vidix_term(vo_data_t* vo) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); size_t i; - priv->inited=0; + priv.inited=0; MSG_DBG2("vidix_term() was called\n"); vidix_stop(vo); - vdlClose(priv->handler); if(vo_conf.use_bm) { for(i=0;i<vo_conf.xp_buffs;i++) { - if(priv->bm_locked) munlock(priv->bm_buffs[i],priv->play->frame_size); - mp_free(priv->bm_buffs[i]); - priv->bm_buffs[i]=NULL; + if(priv.bm_locked) munlock(priv.bm_buffs[i],priv.vidix.playback.frame_size); + delete priv.bm_buffs[i]; + priv.bm_buffs[i]=NULL; } - if(priv->bm_slow_frames) + if(priv.bm_slow_frames) MSG_WARN("from %u frames %u were copied through memcpy()\n" - ,priv->bm_total_frames,priv->bm_slow_frames); + ,priv.bm_total_frames,priv.bm_slow_frames); } - vdlFreeCapabilityS(priv->cap); priv->cap=NULL; - vdlFreePlaybackS(priv->play); priv->play=NULL; - vdlFreeFourccS(priv->fourcc); priv->fourcc=NULL; - vdlFreeYUVS(priv->dstrides); priv->dstrides=NULL; } static void __FASTCALL__ vidix_copy_dma(const vo_data_t* vo,unsigned idx,int sync_mode) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); int err,i; int dma_busy; MSG_DBG2("vidix_copy_dma(%u,%i) was called\n",idx,sync_mode); - priv->bm_total_frames++; - if(idx > priv->play->num_frames-1 && priv->play->num_frames>1) { + priv.bm_total_frames++; + if(idx > priv.vidix.playback.num_frames-1 && priv.vidix.playback.num_frames>1) { MSG_FATAL("\nDetected internal error!\n" - "Request to copy %u frame into %u array\n",idx,priv->play->num_frames); + "Request to copy %u frame into %u array\n",idx,priv.vidix.playback.num_frames); return; } - dma_busy = vdlQueryDMAStatus(priv->handler); + dma_busy = priv.vidix.dma_status(); i=5; if(!sync_mode) - while(dma_busy && i) { usleep(0); dma_busy = vdlQueryDMAStatus(priv->handler); i--; } + while(dma_busy && i) { + usleep(0); + dma_busy = priv.vidix.dma_status(); + i--; + } if(!dma_busy || sync_mode) { - priv->vdma.src = priv->bm_buffs[idx]; - priv->vdma.dest_offset = priv->play->offsets[priv->play->num_frames>1?idx:0]; - priv->vdma.size = priv->play->frame_size; - priv->vdma.flags = sync_mode?BM_DMA_SYNC:BM_DMA_ASYNC; - if(priv->bm_locked) priv->vdma.flags = priv->vdma.flags | BM_DMA_FIXED_BUFFS; - priv->vdma.idx = idx; - err=vdlPlaybackCopyFrame(priv->handler,&priv->vdma); + priv.vidix.dma.src = priv.bm_buffs[idx]; + priv.vidix.dma.dest_offset = priv.vidix.playback.offsets[priv.vidix.playback.num_frames>1?idx:0]; + priv.vidix.dma.size = priv.vidix.playback.frame_size; + priv.vidix.dma.flags = sync_mode?BM_DMA_SYNC:BM_DMA_ASYNC; + if(priv.bm_locked) priv.vidix.dma.flags |= BM_DMA_FIXED_BUFFS; + priv.vidix.dma.idx = idx; + err=priv.vidix.dma_copy_frame(); if(err) { /* We can switch back to DR here but for now exit */ MSG_FATAL("\nerror '%s' occured during DMA transfer\n" @@ -181,131 +177,138 @@ printf("frame is DMA copied\n"); #endif } else { - memcpy(reinterpret_cast<any_t*>(reinterpret_cast<long>(priv->play->dga_addr)+priv->play->offsets[0]),priv->bm_buffs[idx],priv->play->frame_size); + memcpy(reinterpret_cast<any_t*>(reinterpret_cast<long>(priv.vidix.playback.dga_addr)+priv.vidix.playback.offsets[0]),priv.bm_buffs[idx],priv.vidix.playback.frame_size); MSG_WARN("DMA frame is memcpy() copied\n"); - priv->bm_slow_frames++; + priv.bm_slow_frames++; } } static void __FASTCALL__ vidix_select_frame(vo_data_t* vo,unsigned idx) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); MSG_DBG2("vidix_select_frame() was called\n"); if(vo_conf.use_bm == 1) vidix_copy_dma(vo,idx,0); - else vdlPlaybackFrameSelect(priv->handler,idx); + else priv.vidix.frame_select(idx); } static MPXP_Rc __FASTCALL__ vidix_query_fourcc(const vo_data_t* vo,vo_query_fourcc_t* format) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); MSG_DBG2("query_format was called: %x (%s)\n",format->fourcc,vo_format_name(format->fourcc)); - priv->fourcc->fourcc = format->fourcc; - priv->fourcc->srcw = format->w; - priv->fourcc->srch = format->h; - vdlQueryFourcc(priv->handler,priv->fourcc); - format->flags = (priv->fourcc->depth==VID_DEPTH_NONE)? VOCAP_NA : VOCAP_SUPPORTED|VOCAP_HWSCALER; + priv.vidix.fourcc.fourcc = format->fourcc; + priv.vidix.fourcc.srcw = format->w; + priv.vidix.fourcc.srch = format->h; + priv.vidix.query_fourcc(); + format->flags = (priv.vidix.fourcc.depth==VID_DEPTH_NONE)? VOCAP_NA : VOCAP_SUPPORTED|VOCAP_HWSCALER; return MPXP_Ok; } int __FASTCALL__ vidix_grkey_support(const vo_data_t* vo) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); - int retval = priv->fourcc->flags & VID_CAP_COLORKEY; + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); + int retval = priv.vidix.fourcc.flags & VID_CAP_COLORKEY; MSG_DBG2("query_grkey_support: %i\n",retval); return retval; } int __FASTCALL__ vidix_grkey_get(const vo_data_t* vo,vidix_grkey_t *gr_key) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); - return vdlGetGrKeys(priv->handler, gr_key); + int rc; + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); + rc=priv.vidix.get_gr_keys(); + *gr_key=priv.vidix.grkey; + return rc; } int __FASTCALL__ vidix_grkey_set(const vo_data_t* vo,const vidix_grkey_t *gr_key) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); - return vdlSetGrKeys(priv->handler, gr_key); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); + priv.vidix.grkey=*gr_key; + return priv.vidix.set_gr_keys(); } static int __FASTCALL__ vidix_get_video_eq(const vo_data_t* vo,vo_videq_t *info) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); int rval; - vidix_video_eq_t eq; - if(!priv->video_on) return EPERM; - rval = vdlPlaybackGetEq(priv->handler, &eq); + if(!priv.video_on) return EPERM; + rval = priv.vidix.get_eq(); if(!rval) { - if(!strcmp(info->name,VO_EC_BRIGHTNESS) && eq.cap&VEQ_CAP_BRIGHTNESS) - info->value=eq.brightness; - else if(!strcmp(info->name,VO_EC_SATURATION) && eq.cap&VEQ_CAP_SATURATION) - info->value=eq.saturation; - else if(!strcmp(info->name,VO_EC_CONTRAST) && eq.cap&VEQ_CAP_CONTRAST) - info->value=eq.contrast; - else if(!strcmp(info->name,VO_EC_HUE) && eq.cap&VEQ_CAP_HUE) - info->value=eq.hue; - else if(!strcmp(info->name,VO_EC_RED_INTENSITY) && eq.cap&VEQ_CAP_RGB_INTENSITY) - info->value=eq.red_intensity; - else if(!strcmp(info->name,VO_EC_GREEN_INTENSITY) && eq.cap&VEQ_CAP_RGB_INTENSITY) - info->value=eq.green_intensity; - else if(!strcmp(info->name,VO_EC_BLUE_INTENSITY) && eq.cap&VEQ_CAP_RGB_INTENSITY) - info->value=eq.blue_intensity; + if(!strcmp(info->name,VO_EC_BRIGHTNESS) && priv.vidix.video_eq.cap&VEQ_CAP_BRIGHTNESS) + info->value=priv.vidix.video_eq.brightness; + else if(!strcmp(info->name,VO_EC_SATURATION) && priv.vidix.video_eq.cap&VEQ_CAP_SATURATION) + info->value=priv.vidix.video_eq.saturation; + else if(!strcmp(info->name,VO_EC_CONTRAST) && priv.vidix.video_eq.cap&VEQ_CAP_CONTRAST) + info->value=priv.vidix.video_eq.contrast; + else if(!strcmp(info->name,VO_EC_HUE) && priv.vidix.video_eq.cap&VEQ_CAP_HUE) + info->value=priv.vidix.video_eq.hue; + else if(!strcmp(info->name,VO_EC_RED_INTENSITY) && priv.vidix.video_eq.cap&VEQ_CAP_RGB_INTENSITY) + info->value=priv.vidix.video_eq.red_intensity; + else if(!strcmp(info->name,VO_EC_GREEN_INTENSITY) && priv.vidix.video_eq.cap&VEQ_CAP_RGB_INTENSITY) + info->value=priv.vidix.video_eq.green_intensity; + else if(!strcmp(info->name,VO_EC_BLUE_INTENSITY) && priv.vidix.video_eq.cap&VEQ_CAP_RGB_INTENSITY) + info->value=priv.vidix.video_eq.blue_intensity; } return rval; } static int __FASTCALL__ vidix_set_video_eq(const vo_data_t* vo,const vo_videq_t *info) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); int rval; - vidix_video_eq_t eq; - if(!priv->video_on) return EPERM; - rval= vdlPlaybackGetEq(priv->handler, &eq); + if(!priv.video_on) return EPERM; + rval = priv.vidix.get_eq(); if(!rval) { - if(!strcmp(info->name,VO_EC_BRIGHTNESS) && eq.cap&VEQ_CAP_BRIGHTNESS) - eq.brightness=info->value; - else if(!strcmp(info->name,VO_EC_SATURATION) && eq.cap&VEQ_CAP_SATURATION) - eq.saturation=info->value; - else if(!strcmp(info->name,VO_EC_CONTRAST) && eq.cap&VEQ_CAP_CONTRAST) - eq.contrast=info->value; - else if(!strcmp(info->name,VO_EC_HUE) && eq.cap&VEQ_CAP_HUE) - eq.hue=info->value; - else if(!strcmp(info->name,VO_EC_RED_INTENSITY) && eq.cap&VEQ_CAP_RGB_INTENSITY) - eq.red_intensity=info->value; - else if(!strcmp(info->name,VO_EC_GREEN_INTENSITY) && eq.cap&VEQ_CAP_RGB_INTENSITY) - eq.green_intensity=info->value; - else if(!strcmp(info->name,VO_EC_BLUE_INTENSITY) && eq.cap&VEQ_CAP_RGB_INTENSITY) - eq.blue_intensity=info->value; - rval= vdlPlaybackSetEq(priv->handler, &eq); + if(!strcmp(info->name,VO_EC_BRIGHTNESS) && priv.vidix.video_eq.cap&VEQ_CAP_BRIGHTNESS) + priv.vidix.video_eq.brightness=info->value; + else if(!strcmp(info->name,VO_EC_SATURATION) && priv.vidix.video_eq.cap&VEQ_CAP_SATURATION) + priv.vidix.video_eq.saturation=info->value; + else if(!strcmp(info->name,VO_EC_CONTRAST) && priv.vidix.video_eq.cap&VEQ_CAP_CONTRAST) + priv.vidix.video_eq.contrast=info->value; + else if(!strcmp(info->name,VO_EC_HUE) && priv.vidix.video_eq.cap&VEQ_CAP_HUE) + priv.vidix.video_eq.hue=info->value; + else if(!strcmp(info->name,VO_EC_RED_INTENSITY) && priv.vidix.video_eq.cap&VEQ_CAP_RGB_INTENSITY) + priv.vidix.video_eq.red_intensity=info->value; + else if(!strcmp(info->name,VO_EC_GREEN_INTENSITY) && priv.vidix.video_eq.cap&VEQ_CAP_RGB_INTENSITY) + priv.vidix.video_eq.green_intensity=info->value; + else if(!strcmp(info->name,VO_EC_BLUE_INTENSITY) && priv.vidix.video_eq.cap&VEQ_CAP_RGB_INTENSITY) + priv.vidix.video_eq.blue_intensity=info->value; + rval= priv.vidix.set_eq(); } return rval; } static int __FASTCALL__ vidix_get_num_fx(const vo_data_t* vo,unsigned *info) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); - if(!priv->video_on) return EPERM; - return vdlQueryNumOemEffects(priv->handler, info); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); + if(!priv.video_on) return EPERM; + return priv.vidix.num_oemfx(*info); } static int __FASTCALL__ vidix_get_oem_fx(const vo_data_t* vo,vidix_oem_fx_t *info) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); - if(!priv->video_on) return EPERM; - return vdlGetOemEffect(priv->handler, info); + int rc; + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); + if(!priv.video_on) return EPERM; + rc=priv.vidix.get_oemfx(); + *info = priv.vidix.oemfx; + return rc; } static int __FASTCALL__ vidix_set_oem_fx(const vo_data_t* vo,const vidix_oem_fx_t *info) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); - if(!priv->video_on) return EPERM; - return vdlSetOemEffect(priv->handler, info); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); + if(!priv.video_on) return EPERM; + priv.vidix.oemfx=*info; + return priv.vidix.set_oemfx(); } static int __FASTCALL__ vidix_set_deint(const vo_data_t* vo,const vidix_deinterlace_t *info) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); - if(!priv->video_on) return EPERM; - return vdlPlaybackSetDeint(priv->handler, info); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); + if(!priv.video_on) return EPERM; + priv.vidix.deint=*info; + return priv.vidix.set_deint(); } #ifndef HAVE_MLOCK @@ -314,25 +317,12 @@ int munlock(const any_t*addr,size_t len) { return ENOSYS; } #endif -static MPXP_Rc alloc_vidix_structs(any_t* ctx) { - priv_t* priv=reinterpret_cast<priv_t*>(ctx); - if(!priv->cap) priv->cap = vdlAllocCapabilityS(); - if(!priv->play) priv->play = vdlAllocPlaybackS(); - if(!priv->fourcc) priv->fourcc = vdlAllocFourccS(); - if(!priv->dstrides) priv->dstrides = vdlAllocYUVS(); - if(!(priv->cap && priv->play && priv->fourcc && priv->dstrides)) { - MSG_FATAL("Can not alloc certain structures\n"); - return MPXP_False; - } - return MPXP_Ok; -} - MPXP_Rc __FASTCALL__ vidix_init(vo_data_t* vo,unsigned src_width,unsigned src_height, unsigned x_org,unsigned y_org,unsigned dst_width, unsigned dst_height,unsigned format,unsigned dest_bpp, unsigned vid_w,unsigned vid_h) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); size_t i; int err; static int video_clean=0; @@ -342,91 +332,90 @@ "format=%s dest_bpp=%u vid_w=%u vid_h=%u\n" ,src_width,src_height,x_org,y_org,dst_width,dst_height ,vo_format_name(format),dest_bpp,vid_w,vid_h); - if(((priv->cap->maxwidth != -1) && (vid_w > (unsigned)priv->cap->maxwidth)) || - ((priv->cap->minwidth != -1) && (vid_w < (unsigned)priv->cap->minwidth)) || - ((priv->cap->maxheight != -1) && (vid_h > (unsigned)priv->cap->maxheight)) || - ((priv->cap->minwidth != -1 ) && (vid_h < (unsigned)priv->cap->minheight))) { + if(((priv.vidix.cap.maxwidth != -1) && (vid_w > (unsigned)priv.vidix.cap.maxwidth)) || + ((priv.vidix.cap.minwidth != -1) && (vid_w < (unsigned)priv.vidix.cap.minwidth)) || + ((priv.vidix.cap.maxheight != -1) && (vid_h > (unsigned)priv.vidix.cap.maxheight)) || + ((priv.vidix.cap.minwidth != -1 ) && (vid_h < (unsigned)priv.vidix.cap.minheight))) { MSG_FATAL("video server has unsupported resolution (%dx%d), supported: %dx%d-%dx%d\n", - vid_w, vid_h, priv->cap->minwidth, priv->cap->minheight, - priv->cap->maxwidth, priv->cap->maxheight); + vid_w, vid_h, priv.vidix.cap.minwidth, priv.vidix.cap.minheight, + priv.vidix.cap.maxwidth, priv.vidix.cap.maxheight); return MPXP_False; } - priv->fourcc->fourcc = format; - vdlQueryFourcc(priv->handler,priv->fourcc); + priv.vidix.fourcc.fourcc = format; + priv.vidix.query_fourcc(); err = 0; switch(dest_bpp) { - case 1: err = ((priv->fourcc->depth & VID_DEPTH_1BPP) != VID_DEPTH_1BPP); break; - case 2: err = ((priv->fourcc->depth & VID_DEPTH_2BPP) != VID_DEPTH_2BPP); break; - case 4: err = ((priv->fourcc->depth & VID_DEPTH_4BPP) != VID_DEPTH_4BPP); break; - case 8: err = ((priv->fourcc->depth & VID_DEPTH_8BPP) != VID_DEPTH_8BPP); break; - case 12:err = ((priv->fourcc->depth & VID_DEPTH_12BPP) != VID_DEPTH_12BPP); break; - case 15:err = ((priv->fourcc->depth & VID_DEPTH_15BPP) != VID_DEPTH_15BPP); break; - case 16:err = ((priv->fourcc->depth & VID_DEPTH_16BPP) != VID_DEPTH_16BPP); break; - case 24:err = ((priv->fourcc->depth & VID_DEPTH_24BPP) != VID_DEPTH_24BPP); break; - case 32:err = ((priv->fourcc->depth & VID_DEPTH_32BPP) != VID_DEPTH_32BPP); break; + case 1: err = ((priv.vidix.fourcc.depth & VID_DEPTH_1BPP) != VID_DEPTH_1BPP); break; + case 2: err = ((priv.vidix.fourcc.depth & VID_DEPTH_2BPP) != VID_DEPTH_2BPP); break; + case 4: err = ((priv.vidix.fourcc.depth & VID_DEPTH_4BPP) != VID_DEPTH_4BPP); break; + case 8: err = ((priv.vidix.fourcc.depth & VID_DEPTH_8BPP) != VID_DEPTH_8BPP); break; + case 12:err = ((priv.vidix.fourcc.depth & VID_DEPTH_12BPP) != VID_DEPTH_12BPP); break; + case 15:err = ((priv.vidix.fourcc.depth & VID_DEPTH_15BPP) != VID_DEPTH_15BPP); break; + case 16:err = ((priv.vidix.fourcc.depth & VID_DEPTH_16BPP) != VID_DEPTH_16BPP); break; + case 24:err = ((priv.vidix.fourcc.depth & VID_DEPTH_24BPP) != VID_DEPTH_24BPP); break; + case 32:err = ((priv.vidix.fourcc.depth & VID_DEPTH_32BPP) != VID_DEPTH_32BPP); break; default: err=1; break; } if(err) { MSG_FATAL("video server has unsupported color depth by vidix (%d)\n" - ,priv->fourcc->depth); + ,priv.vidix.fourcc.depth); return MPXP_False; } - if((dst_width > src_width || dst_height > src_height) && (priv->cap->flags & FLAG_UPSCALER) != FLAG_UPSCALER) { + if((dst_width > src_width || dst_height > src_height) && (priv.vidix.cap.flags & FLAG_UPSCALER) != FLAG_UPSCALER) { MSG_FATAL("vidix driver can't upscale image (%d%d -> %d%d)\n", src_width, src_height, dst_width, dst_height); return MPXP_False; } - if((dst_width > src_width || dst_height > src_height) && (priv->cap->flags & FLAG_DOWNSCALER) != FLAG_DOWNSCALER) { + if((dst_width > src_width || dst_height > src_height) && (priv.vidix.cap.flags & FLAG_DOWNSCALER) != FLAG_DOWNSCALER) { MSG_FATAL("vidix driver can't downscale image (%d%d -> %d%d)\n", src_width, src_height, dst_width, dst_height); return MPXP_False; } - priv->image_width = src_width; - priv->image_height = src_height; - priv->src_format = format; - if(priv->forced_fourcc) format = priv->forced_fourcc; - memset(priv->play,0,sizeof(vidix_playback_t)); - priv->play->fourcc = format; - priv->play->capability = priv->cap->flags; /* every ;) */ - priv->play->blend_factor = 0; /* for now */ + priv.image_width = src_width; + priv.image_height = src_height; + priv.src_format = format; + if(priv.forced_fourcc) format = priv.forced_fourcc; + priv.vidix.playback.fourcc = format; + priv.vidix.playback.capability = priv.vidix.cap.flags; /* every ;) */ + priv.vidix.playback.blend_factor = 0; /* for now */ /* display the full picture. Nick: we could implement here zooming to a specified area -- alex */ - priv->play->src.x = priv->play->src.y = 0; - priv->play->src.w = src_width; - priv->play->src.h = src_height; - priv->play->dest.x = x_org; - priv->play->dest.y = y_org; - priv->play->dest.w = dst_width; - priv->play->dest.h = dst_height; - priv->play->num_frames=(vo_conf.use_bm!=1)?NUM_FRAMES-1:1; - if(priv->play->num_frames > vo_conf.xp_buffs) priv->play->num_frames = vo_conf.xp_buffs; - priv->play->src.pitch.y = priv->play->src.pitch.u = priv->play->src.pitch.v = 0; - if((err=vdlConfigPlayback(priv->handler,priv->play))!=0) { + priv.vidix.playback.src.x = priv.vidix.playback.src.y = 0; + priv.vidix.playback.src.w = src_width; + priv.vidix.playback.src.h = src_height; + priv.vidix.playback.dest.x = x_org; + priv.vidix.playback.dest.y = y_org; + priv.vidix.playback.dest.w = dst_width; + priv.vidix.playback.dest.h = dst_height; + priv.vidix.playback.num_frames=(vo_conf.use_bm!=1)?NUM_FRAMES-1:1; + if(priv.vidix.playback.num_frames > vo_conf.xp_buffs) priv.vidix.playback.num_frames = vo_conf.xp_buffs; + priv.vidix.playback.src.pitch.y = priv.vidix.playback.src.pitch.u = priv.vidix.playback.src.pitch.v = 0; + if((err=priv.vidix.config_playback())!=0) { MSG_FATAL("Can't configure playback: %s\n",strerror(err)); return MPXP_False; } - MSG_V("using %d buffers\n", priv->play->num_frames); + MSG_V("using %d buffers\n", priv.vidix.playback.num_frames); /* configure busmastering */ if(vo_conf.use_bm) { #ifdef HAVE_MEMALIGN - if(priv->cap->flags & FLAG_DMA) { + if(priv.vidix.cap.flags & FLAG_DMA) { int psize = getpagesize(); - priv->bm_locked=1; + priv.bm_locked=1; for(i=0;i<vo_conf.xp_buffs;i++) { - if(!priv->bm_buffs[i]) priv->bm_buffs[i] = new(alignmem,psize) uint8_t[priv->play->frame_size]; - if(!(priv->bm_buffs[i])) { + if(!priv.bm_buffs[i]) priv.bm_buffs[i] = new(alignmem,psize) uint8_t[priv.vidix.playback.frame_size]; + if(!(priv.bm_buffs[i])) { MSG_ERR("Can't allocate memory for busmastering\n"); return MPXP_False; } - if(mlock(priv->bm_buffs[i],priv->play->frame_size) != 0) { + if(mlock(priv.bm_buffs[i],priv.vidix.playback.frame_size) != 0) { unsigned j; MSG_WARN("Can't lock memory for busmastering\n"); - for(j=0;j<i;j++) munlock(priv->bm_buffs[i],priv->play->frame_size); - priv->bm_locked=0; + for(j=0;j<i;j++) munlock(priv.bm_buffs[i],priv.vidix.playback.frame_size); + priv.bm_locked=0; } } - memset(&priv->vdma,0,sizeof(vidix_dma_t)); - priv->bm_total_frames=priv->bm_slow_frames=0; + memset(&priv.vidix.dma,0,sizeof(vidix_dma_t)); + priv.bm_total_frames=priv.bm_slow_frames=0; } else #else @@ -436,16 +425,16 @@ vo_conf.use_bm = 0; } if(vo_conf.use_bm) MSG_OK("using BUSMASTERING\n"); - priv->mem = reinterpret_cast<uint8_t*>(priv->play->dga_addr); + priv.mem = reinterpret_cast<uint8_t*>(priv.vidix.playback.dga_addr); if(!video_clean) { /* clear every frame with correct address and frame_size only once per session */ - for (i = 0; i < priv->play->num_frames; i++) - memset(priv->mem + priv->play->offsets[i], 0x80, priv->play->frame_size); + for (i = 0; i < priv.vidix.playback.num_frames; i++) + memset(priv.mem + priv.vidix.playback.offsets[i], 0x80, priv.vidix.playback.frame_size); video_clean=1; } - MSG_DBG2("vidix returns pitches %u %u %u\n",priv->play->dest.pitch.y,priv->play->dest.pitch.u,priv->play->dest.pitch.v); + MSG_DBG2("vidix returns pitches %u %u %u\n",priv.vidix.playback.dest.pitch.y,priv.vidix.playback.dest.pitch.u,priv.vidix.playback.dest.pitch.v); switch(format) { case IMGFMT_Y800: case IMGFMT_YVU9: @@ -453,46 +442,46 @@ case IMGFMT_I420: case IMGFMT_IYUV: case IMGFMT_YV12: - apitch = priv->play->dest.pitch.y-1; - priv->dstrides->y = (priv->image_width + apitch) & ~apitch; - apitch = priv->play->dest.pitch.v-1; - priv->dstrides->v = (priv->image_width + apitch) & ~apitch; - apitch = priv->play->dest.pitch.u-1; - priv->dstrides->u = (priv->image_width + apitch) & ~apitch; - priv->image_Bpp=1; + apitch = priv.vidix.playback.dest.pitch.y-1; + priv.vidix.playback.offset.y = (priv.image_width + apitch) & ~apitch; + apitch = priv.vidix.playback.dest.pitch.v-1; + priv.vidix.playback.offset.v = (priv.image_width + apitch) & ~apitch; + apitch = priv.vidix.playback.dest.pitch.u-1; + priv.vidix.playback.offset.u = (priv.image_width + apitch) & ~apitch; + priv.image_Bpp=1; break; case IMGFMT_RGB32: case IMGFMT_BGR32: - apitch = priv->play->dest.pitch.y-1; - priv->dstrides->y = (priv->image_width*4 + apitch) & ~apitch; - priv->dstrides->u = priv->dstrides->v = 0; - priv->image_Bpp=4; + apitch = priv.vidix.playback.dest.pitch.y-1; + priv.vidix.playback.offset.y = (priv.image_width*4 + apitch) & ~apitch; + priv.vidix.playback.offset.u = priv.vidix.playback.offset.v = 0; + priv.image_Bpp=4; break; case IMGFMT_RGB24: case IMGFMT_BGR24: - apitch = priv->play->dest.pitch.y-1; - priv->dstrides->y = (priv->image_width*3 + apitch) & ~apitch; - priv->dstrides->u = priv->dstrides->v = 0; - priv->image_Bpp=3; + apitch = priv.vidix.playback.dest.pitch.y-1; + priv.vidix.playback.offset.y = (priv.image_width*3 + apitch) & ~apitch; + priv.vidix.playback.offset.u = priv.vidix.playback.offset.v = 0; + priv.image_Bpp=3; break; default: - apitch = priv->play->dest.pitch.y-1; - priv->dstrides->y = (priv->image_width*2 + apitch) & ~apitch; - priv->dstrides->u = priv->dstrides->v = 0; - priv->image_Bpp=2; + apitch = priv.vidix.playback.dest.pitch.y-1; + priv.vidix.playback.offset.y = (priv.image_width*2 + apitch) & ~apitch; + priv.vidix.playback.offset.u = priv.vidix.playback.offset.v = 0; + priv.image_Bpp=2; break; } switch(format) { case IMGFMT_YVU9: case IMGFMT_IF09: - priv->dstrides->u /= 4; - priv->dstrides->v /= 4; + priv.vidix.playback.offset.u /= 4; + priv.vidix.playback.offset.v /= 4; break; case IMGFMT_I420: case IMGFMT_IYUV: case IMGFMT_YV12: - priv->dstrides->u /= 2; - priv->dstrides->v /= 2; + priv.vidix.playback.offset.u /= 2; + priv.vidix.playback.offset.v /= 2; break; } return MPXP_Ok; @@ -500,55 +489,49 @@ static void __FASTCALL__ vidix_dri_get_surface_caps(const vo_data_t* vo,dri_surface_cap_t *caps) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); caps->caps = vo_conf.use_bm ? DRI_CAP_TEMP_VIDEO|DRI_CAP_BUSMASTERING : DRI_CAP_VIDEO_MMAPED; caps->caps |= DRI_CAP_HORZSCALER | DRI_CAP_VERTSCALER; - if((priv->cap->flags & FLAG_DOWNSCALER) == FLAG_DOWNSCALER) + if((priv.vidix.cap.flags & FLAG_DOWNSCALER) == FLAG_DOWNSCALER) caps->caps |= DRI_CAP_DOWNSCALER; - if((priv->cap->flags & FLAG_UPSCALER) == FLAG_UPSCALER) + if((priv.vidix.cap.flags & FLAG_UPSCALER) == FLAG_UPSCALER) caps->caps |= DRI_CAP_UPSCALER; - caps->fourcc = priv->play->fourcc; - caps->width=priv->play->src.w; - caps->height=priv->play->src.h; + caps->fourcc = priv.vidix.playback.fourcc; + caps->width=priv.vidix.playback.src.w; + caps->height=priv.vidix.playback.src.h; /* in case of vidix movie fit surface */ caps->x = caps->y=0; caps->w=caps->width; caps->h=caps->height; - if(priv->dstrides) { - caps->strides[0] = priv->dstrides->y; - caps->strides[1] = priv->dstrides->v; - caps->strides[2] = priv->dstrides->u; - caps->strides[3] = 0; - } + caps->strides[0] = priv.vidix.playback.offset.y; + caps->strides[1] = priv.vidix.playback.offset.v; + caps->strides[2] = priv.vidix.playback.offset.u; + caps->strides[3] = 0; } static void __FASTCALL__ vidix_dri_get_surface(const vo_data_t* vo,dri_surface_t *surf) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); if(vo_conf.use_bm) { - surf->planes[0] = priv->bm_buffs[surf->idx] + priv->play->offset.y; - surf->planes[1] = priv->bm_buffs[surf->idx] + priv->play->offset.v; - surf->planes[2] = priv->bm_buffs[surf->idx] + priv->play->offset.u; + surf->planes[0] = priv.bm_buffs[surf->idx] + priv.vidix.playback.offset.y; + surf->planes[1] = priv.bm_buffs[surf->idx] + priv.vidix.playback.offset.v; + surf->planes[2] = priv.bm_buffs[surf->idx] + priv.vidix.playback.offset.u; } else { - surf->planes[0] = priv->mem + priv->play->offsets[surf->idx] + priv->play->offset.y; - surf->planes[1] = priv->mem + priv->play->offsets[surf->idx] + priv->play->offset.v; - surf->planes[2] = priv->mem + priv->play->offsets[surf->idx] + priv->play->offset.u; + surf->planes[0] = priv.mem + priv.vidix.playback.offsets[surf->idx] + priv.vidix.playback.offset.y; + surf->planes[1] = priv.mem + priv.vidix.playback.offsets[surf->idx] + priv.vidix.playback.offset.v; + surf->planes[2] = priv.mem + priv.vidix.playback.offsets[surf->idx] + priv.vidix.playback.offset.u; } surf->planes[3] = 0; } MPXP_Rc __FASTCALL__ vidix_control(vo_data_t* vo,uint32_t request, any_t*data) { - priv_t*priv=reinterpret_cast<priv_t*>(vo->priv3); + priv_t& priv=*reinterpret_cast<priv_t*>(vo->priv3); switch (request) { case VOCTRL_QUERY_FORMAT: return vidix_query_fourcc(vo,reinterpret_cast<vo_query_fourcc_t*>(data)); - case VOCTRL_FULLSCREEN: - case VOCTRL_CHECK_EVENTS: - if(priv->inited) return (*priv->server_control)(vo,request,data); - break; case VOCTRL_GET_NUM_FRAMES: - *(uint32_t *)data = (vo_conf.use_bm == 1) ? vo_conf.xp_buffs : priv->play->num_frames; + *(uint32_t *)data = (vo_conf.use_bm == 1) ? vo_conf.xp_buffs : priv.vidix.playback.num_frames; return MPXP_True; case DRI_GET_SURFACE_CAPS: vidix_dri_get_surface_caps(vo,reinterpret_cast<dri_surface_cap_t*>(data)); @@ -575,36 +558,33 @@ int err; static int reent=0; MSG_DBG2("vidix_preinit(%s) was called\n",drvname); - priv_t* priv=new(zeromem) priv_t; - vo->priv3=priv; - if(alloc_vidix_structs(priv)!=MPXP_Ok) return NULL; - if(vdlGetVersion() != VIDIX_VERSION) { + Vidix& _vidix = *new Vidix(drvname ? drvname[0] == ':' ? &drvname[1] : drvname[0] ? drvname : NULL : NULL, + TYPE_OUTPUT, + mp_conf.verbose); + priv_t& priv=*new(zeromem) priv_t(_vidix); + vo->priv3=&priv; + if(priv.vidix.version() != VIDIX_VERSION) { MSG_FATAL("You have wrong version of VIDIX library\n"); - mp_free(priv); + delete &priv; return NULL; } - priv->handler = vdlOpen(VIDIX_PATH, - drvname ? drvname[0] == ':' ? &drvname[1] : drvname[0] ? drvname : NULL : NULL, - TYPE_OUTPUT, - mp_conf.verbose); - if(priv->handler == NULL) { + if(priv.vidix.is_error()) { MSG_FATAL("Couldn't find working VIDIX driver\n"); - mp_free(priv); + delete &priv; return NULL; } - if((err=vdlGetCapability(priv->handler,priv->cap)) != 0) { + if((err=priv.vidix.get_capabilities()) != 0) { MSG_FATAL("Couldn't get capability: %s\n",strerror(err)); - mp_free(priv); + delete &priv; return NULL; } - else MSG_V("Driver capability: %X\n",priv->cap->flags); - MSG_V("Using: %s by %s\n",priv->cap->name,priv->cap->author); + else MSG_V("Driver capability: %X\n",priv.vidix.cap.flags); + MSG_V("Using: %s by %s\n",priv.vidix.cap.name,priv.vidix.cap.author); if(!reent) { - priv->server_control = server->control; reent=1; } - priv->vo_server = reinterpret_cast<const vo_functions_t*>(server); - priv->inited=1; + priv.vo_server = reinterpret_cast<const vo_functions_t*>(server); + priv.inited=1; /* we are able to tune up this stuff depend on fourcc format */ vidix_server_t* rs = new vidix_server_t; rs->control=vidix_control; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |