Thread: [Mplayerxp-cvslog] SF.net SVN: mplayerxp:[625] mplayerxp (Page 16)
Brought to you by:
olov
From: <nic...@us...> - 2012-12-29 12:10:50
|
Revision: 625 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=625&view=rev Author: nickols_k Date: 2012-12-29 12:10:43 +0000 (Sat, 29 Dec 2012) Log Message: ----------- segfault-- and attempt to defect environment! Note about illegal-patch: No comments: listing of gdb tells even more that i'm able to say. $gdb --args ./ffmpeg -ao alsa:hw:0 -vo x11 M/l.avi -vf menu=main GNU gdb (GDB) 7.5 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/ffmpeg...done. (gdb) break mplayerxp.cpp:2079 Breakpoint 1 at 0x4585cc: file mplayerxp.cpp, line 2079. (gdb) run Starting program: /Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/ffmpeg -ao alsa:hw:0 -vo x11 M/l.avi -vf menu=main warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1, main (argc=<optimized out>, args=<optimized out>, envp= 0x7fffffffdae0) at mplayerxp.cpp:2079 2079 envp[j+1] = NULL; (gdb) print args[argc] value has been optimized out (gdb) print envp[j+1] $1 = 0x21 <Address 0x21 out of bounds> (gdb) n 2082 rc=mp_mprotect((any_t*)antiviral_hole1,sizeof(antiviral_hole1),MP_DENY_ALL); (gdb) print envp[j+1] $2 = 0x21 <Address 0x21 out of bounds> (gdb) print envp[j+2] $3 = 0x7ffff7ffb000 "\177ELF\002\001\001" (gdb) print envp[j+3] $4 = 0x10 <Address 0x10 out of bounds> (gdb) print envp[j+4] $5 = 0x178bfbff <Address 0x178bfbff out of bounds> (gdb) print envp[j+5] $6 = 0x6 <Address 0x6 out of bounds> (gdb) print envp[j+6] $7 = 0x1000 <Address 0x1000 out of bounds> (gdb) print envp[j+7] $8 = 0x11 <Address 0x11 out of bounds> (gdb) print envp[j+8] $9 = 0x64 <Address 0x64 out of bounds> (gdb) print envp[j+9] $10 = 0x3 <Address 0x3 out of bounds> (gdb) print envp[j+10] $11 = 0x400040 "\006" (gdb) print envp[j+11] $12 = 0x4 <Address 0x4 out of bounds> (gdb) print envp[j+12] $13 = 0x38 <Address 0x38 out of bounds> (gdb) print envp[j+13] $14 = 0x5 <Address 0x5 out of bounds> (gdb) print envp[j+14] $15 = 0x8 <Address 0x8 out of bounds> (gdb) print envp[j+15] $16 = 0x7 <Address 0x7 out of bounds> Modified Paths: -------------- mplayerxp/libvo2/x11_system.cpp mplayerxp/mplayerxp.cpp mplayerxp/osdep/mplib.cpp mplayerxp/osdep/mplib.h Modified: mplayerxp/libvo2/x11_system.cpp =================================================================== --- mplayerxp/libvo2/x11_system.cpp 2012-12-29 10:39:06 UTC (rev 624) +++ mplayerxp/libvo2/x11_system.cpp 2012-12-29 12:10:43 UTC (rev 625) @@ -1021,8 +1021,10 @@ ::shmctl(Shminfo[idx].shmid, IPC_RMID, 0); } void Xv_System::freeMyXImage(unsigned idx) { - ::XShmDetach( get_display(),&Shminfo[idx]); - ::shmdt( Shminfo[idx].shmaddr ); + if(Shminfo[idx].shmid) { + ::XShmDetach( get_display(),&Shminfo[idx]); + ::shmdt( Shminfo[idx].shmaddr ); + } } void Xv_System::put_image(XvImage*image,const vo_rect_t& r) const { Modified: mplayerxp/mplayerxp.cpp =================================================================== --- mplayerxp/mplayerxp.cpp 2012-12-29 10:39:06 UTC (rev 624) +++ mplayerxp/mplayerxp.cpp 2012-12-29 12:10:43 UTC (rev 625) @@ -2064,6 +2064,7 @@ str=args[i]; argv.push_back(str); } + args[argc] = (char*)make_false_pointer((any_t*)antiviral_hole1); std::map<std::string,std::string> envm; unsigned j=0; size_t pos; @@ -2075,6 +2076,7 @@ str=str.substr(0,pos); envm[str]=stmp; } + envp[j+1] = NULL; /* init antiviral protection */ int rc; rc=mp_mprotect((any_t*)antiviral_hole1,sizeof(antiviral_hole1),MP_DENY_ALL); Modified: mplayerxp/osdep/mplib.cpp =================================================================== --- mplayerxp/osdep/mplib.cpp 2012-12-29 10:39:06 UTC (rev 624) +++ mplayerxp/osdep/mplib.cpp 2012-12-29 12:10:43 UTC (rev 625) @@ -27,16 +27,28 @@ return buffer; } +any_t* make_false_pointer(any_t* tmplt) { + long lo_mask=(sizeof(any_t*)*8/2)-1; + long hi_mask=~lo_mask; + long false_pointer; + false_pointer=::rand()&lo_mask; + false_pointer|=(reinterpret_cast<long>(tmplt)&hi_mask); + return reinterpret_cast<any_t*>(false_pointer); +} + +any_t* __FASTCALL__ make_false_pointer_to(any_t* tmplt,unsigned size) { + long false_pointer=reinterpret_cast<long>(tmplt); + false_pointer+=::rand()%size; + return reinterpret_cast<any_t*>(false_pointer); +} + any_t* fill_false_pointers(any_t* buffer,size_t size) { unsigned i,psize=(size/sizeof(any_t*))*sizeof(any_t*); - long lo_mask=(sizeof(any_t*)*8/2)-1; - long hi_mask=~lo_mask; - long filler; + any_t* filler; for(i=0;i<psize/sizeof(long);i++) { - filler=::rand()&lo_mask; - filler|=(reinterpret_cast<long>(buffer)&hi_mask); - ((long *)buffer)[i]=::rand()%2?filler:0; + filler=make_false_pointer(buffer); + ((long *)buffer)[i]=::rand()%2?reinterpret_cast<long>(filler):0; } ::memset(&((char *)buffer)[psize],0,size-psize); return buffer; Modified: mplayerxp/osdep/mplib.h =================================================================== --- mplayerxp/osdep/mplib.h 2012-12-29 10:39:06 UTC (rev 624) +++ mplayerxp/osdep/mplib.h 2012-12-29 12:10:43 UTC (rev 625) @@ -74,6 +74,8 @@ print_backtrace(why,stack,ncalls); } any_t* __FASTCALL__ rnd_fill(any_t* buffer,size_t size); + any_t* __FASTCALL__ make_false_pointer(any_t* tmplt); + any_t* __FASTCALL__ make_false_pointer_to(any_t* tmplt,unsigned size); any_t* __FASTCALL__ fill_false_pointers(any_t* buffer,size_t size); any_t* get_caller_address(unsigned num_caller=0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-04-30 17:28:15
|
Revision: 634 http://sourceforge.net/p/mplayerxp/code/634 Author: nickols_k Date: 2013-04-30 17:28:09 +0000 (Tue, 30 Apr 2013) Log Message: ----------- sync with beye Modified Paths: -------------- mplayerxp/configure mplayerxp/osdep/bswap.h Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2013-04-27 17:29:31 UTC (rev 633) +++ mplayerxp/configure 2013-04-30 17:28:09 UTC (rev 634) @@ -406,6 +406,12 @@ check_func2 execinfo.h backtrace print_config HAVE_ mpxp_config.h mpxp_config.mak backtrace +check_header endian.h +print_config HAVE_ mpxp_config.h mpxp_config.mak endian_h + +check_header byteswap.h +print_config HAVE_ mpxp_config.h mpxp_config.mak byteswap_h + disable inet_pton if enabled streaming ; then disable socklib Modified: mplayerxp/osdep/bswap.h =================================================================== --- mplayerxp/osdep/bswap.h 2013-04-27 17:29:31 UTC (rev 633) +++ mplayerxp/osdep/bswap.h 2013-04-30 17:28:09 UTC (rev 634) @@ -1,16 +1,18 @@ #ifndef __BSWAP_H__ #define __BSWAP_H__ +#include "mpxp_config.h" +#ifdef HAVE_ENDIAN_H +#include <endian.h> +#endif #ifdef HAVE_BYTESWAP_H #include <byteswap.h> -#else - +#endif #include <inttypes.h> /* for __WORDSIZE */ -#include "mpxp_config.h" namespace mpxp { -#ifdef WORDS_BIGENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN #define FOURCC_TAG(ch0,ch1,ch2,ch3) (((uint32_t)(ch3)|((uint32_t)ch2<<8)|(uint32_t)ch1<<16)|((uint32_t)ch0<<24)) #define TWOCC_TAG(ch0,ch1) ((uint16_t)ch0|((uint16_t)ch1)<<8) #else @@ -28,6 +30,7 @@ return (uint16_t)ch0|((uint16_t)ch1)<<8; } +#ifndef HAVE_BYTESWAP_H #if defined(__i386__) inline uint16_t bswap_16(uint16_t x) { __asm("xchgb %b0,%h0" : @@ -154,7 +157,7 @@ // be2me ... BigEndian to MachineEndian // le2me ... LittleEndian to MachineEndian -#ifdef WORDS_BIGENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN inline uint16_t be2me_16(uint16_t x) { return x; } inline uint32_t be2me_32(uint32_t x) { return x; } inline uint64_t be2me_64(uint64_t x) { return x; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-08 05:23:50
|
Revision: 635 http://sourceforge.net/p/mplayerxp/code/635 Author: nickols_k Date: 2013-05-08 05:23:43 +0000 (Wed, 08 May 2013) Log Message: ----------- sync with beye Modified Paths: -------------- mplayerxp/main.cpp mplayerxp/osdep/mplib.h Modified: mplayerxp/main.cpp =================================================================== --- mplayerxp/main.cpp 2013-04-30 17:28:09 UTC (rev 634) +++ mplayerxp/main.cpp 2013-05-08 05:23:43 UTC (rev 635) @@ -219,9 +219,13 @@ } static volatile char antiviral_hole2[__VM_PAGE_SIZE__] __PAGE_ALIGNED__; +static Opaque opaque1; static LocalPtr<MPXPContext> MPXPCtx(new(zeromem) MPXPContext); +static Opaque opaque2; static volatile char antiviral_hole3[__VM_PAGE_SIZE__] __PAGE_ALIGNED__; +static Opaque opaque3; volatile MPXPSecureKeys* secure_keys; +static Opaque opaque4; /************************************************************************** Decoding ahead **************************************************************************/ Modified: mplayerxp/osdep/mplib.h =================================================================== --- mplayerxp/osdep/mplib.h 2013-04-30 17:28:09 UTC (rev 634) +++ mplayerxp/osdep/mplib.h 2013-05-08 05:23:43 UTC (rev 635) @@ -18,8 +18,16 @@ #include "mp_malloc.h" namespace mpxp { + class Opaque { + public: + Opaque(); + virtual ~Opaque(); + + any_t* false_pointers[RND_CHAR0]; + any_t* unusable; + }; - template <typename T> class LocalPtr { + template <typename T> class LocalPtr : public Opaque { public: LocalPtr(T* value):ptr(value) {} virtual ~LocalPtr() { delete ptr; } @@ -30,16 +38,10 @@ LocalPtr<T>& operator=(LocalPtr<T> a) { return this; } LocalPtr<T>& operator=(LocalPtr<T>& a) { return this; } LocalPtr<T>& operator=(LocalPtr<T>* a) { return this; } + + Opaque opaque1; T* ptr; + Opaque opaque2; }; - - class Opaque { - public: - Opaque(); - virtual ~Opaque(); - - any_t* false_pointers[RND_CHAR0]; - any_t* unusable; - }; } // namespace mpxp #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-08 12:54:55
|
Revision: 636 http://sourceforge.net/p/mplayerxp/code/636 Author: nickols_k Date: 2013-05-08 12:54:26 +0000 (Wed, 08 May 2013) Log Message: ----------- sync with beye Modified Paths: -------------- mplayerxp/dump.cpp mplayerxp/dump.h mplayerxp/global_msg.h mplayerxp/input2/in_msg.h mplayerxp/input2/input.cpp mplayerxp/input2/input.h mplayerxp/input2/joystick.cpp mplayerxp/input2/joystick.h mplayerxp/input2/lirc.cpp mplayerxp/input2/lirc.h mplayerxp/input2/mouse.h mplayerxp/libao3/afmt.cpp mplayerxp/libao3/ao_alsa.cpp mplayerxp/libao3/ao_arts.cpp mplayerxp/libao3/ao_esd.cpp mplayerxp/libao3/ao_jack.cpp mplayerxp/libao3/ao_msg.h mplayerxp/libao3/ao_nas.cpp mplayerxp/libao3/ao_null.cpp mplayerxp/libao3/ao_openal.cpp mplayerxp/libao3/ao_oss.cpp mplayerxp/libao3/ao_sdl.cpp mplayerxp/libao3/ao_wav.cpp mplayerxp/libao3/audio_out.cpp mplayerxp/libao3/audio_out.h mplayerxp/libao3/audio_out_internal.h mplayerxp/libmpcodecs/ad.cpp mplayerxp/libmpcodecs/ad_a52.cpp mplayerxp/libmpcodecs/ad_acm.cpp mplayerxp/libmpcodecs/ad_dca.cpp mplayerxp/libmpcodecs/ad_dmo.cpp mplayerxp/libmpcodecs/ad_dshow.cpp mplayerxp/libmpcodecs/ad_dvdpcm.cpp mplayerxp/libmpcodecs/ad_faad.cpp mplayerxp/libmpcodecs/ad_hwac3.cpp mplayerxp/libmpcodecs/ad_lavc.cpp mplayerxp/libmpcodecs/ad_libdv.cpp mplayerxp/libmpcodecs/ad_mp3.cpp mplayerxp/libmpcodecs/ad_msg.h mplayerxp/libmpcodecs/ad_null.cpp mplayerxp/libmpcodecs/ad_pcm.cpp mplayerxp/libmpcodecs/ad_qtaudio.cpp mplayerxp/libmpcodecs/ad_real.cpp mplayerxp/libmpcodecs/ad_twin.cpp mplayerxp/libmpcodecs/ad_vorbis.cpp mplayerxp/libmpcodecs/codecs_ld.cpp mplayerxp/libmpcodecs/codecs_ld.h mplayerxp/libmpcodecs/dec_audio.cpp mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/dec_video.h mplayerxp/libmpcodecs/liba52/bit_allocate.cpp mplayerxp/libmpcodecs/liba52/bitstream.cpp mplayerxp/libmpcodecs/liba52/crc.cpp mplayerxp/libmpcodecs/liba52/downmix.cpp mplayerxp/libmpcodecs/liba52/imdct.cpp mplayerxp/libmpcodecs/liba52/parse.cpp mplayerxp/libmpcodecs/liba52/resample.cpp mplayerxp/libmpcodecs/libdca/bitstream.cpp mplayerxp/libmpcodecs/libdca/downmix.cpp mplayerxp/libmpcodecs/libdca/parse.cpp mplayerxp/libmpcodecs/libdca/resample.cpp mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp mplayerxp/libmpcodecs/vd.cpp mplayerxp/libmpcodecs/vd_divx4.cpp mplayerxp/libmpcodecs/vd_dmo.cpp mplayerxp/libmpcodecs/vd_dshow.cpp mplayerxp/libmpcodecs/vd_huffyuv.cpp mplayerxp/libmpcodecs/vd_lavc.cpp mplayerxp/libmpcodecs/vd_libdv.cpp mplayerxp/libmpcodecs/vd_libmpeg2.cpp mplayerxp/libmpcodecs/vd_mpegpes.cpp mplayerxp/libmpcodecs/vd_msg.h mplayerxp/libmpcodecs/vd_null.cpp mplayerxp/libmpcodecs/vd_nuv.cpp mplayerxp/libmpcodecs/vd_qtvideo.cpp mplayerxp/libmpcodecs/vd_raw.cpp mplayerxp/libmpcodecs/vd_real.cpp mplayerxp/libmpcodecs/vd_theora.cpp mplayerxp/libmpcodecs/vd_vfw.cpp mplayerxp/libmpcodecs/vd_xanim.cpp mplayerxp/libmpcodecs/vd_xvid.cpp mplayerxp/libmpconf/cfgparser.cpp mplayerxp/libmpconf/cfgparser.h mplayerxp/libmpconf/codec-cfg.cpp mplayerxp/libmpconf/m_option.cpp mplayerxp/libmpconf/m_property.cpp mplayerxp/libmpconf/m_struct.cpp mplayerxp/libmpconf/parser_msg.h mplayerxp/libmpdemux/aviprint.cpp mplayerxp/libmpdemux/demux_ac3.cpp mplayerxp/libmpdemux/demux_aiff.cpp mplayerxp/libmpdemux/demux_asf.cpp mplayerxp/libmpdemux/demux_avi.cpp mplayerxp/libmpdemux/demux_bmp.cpp mplayerxp/libmpdemux/demux_dca.cpp mplayerxp/libmpdemux/demux_demuxers.cpp mplayerxp/libmpdemux/demux_dv.cpp mplayerxp/libmpdemux/demux_film.cpp mplayerxp/libmpdemux/demux_flac.cpp mplayerxp/libmpdemux/demux_fli.cpp mplayerxp/libmpdemux/demux_lavf.cpp mplayerxp/libmpdemux/demux_mkv.cpp mplayerxp/libmpdemux/demux_mov.cpp mplayerxp/libmpdemux/demux_mp3.cpp mplayerxp/libmpdemux/demux_mpg.cpp mplayerxp/libmpdemux/demux_mpxp64.cpp mplayerxp/libmpdemux/demux_msg.h mplayerxp/libmpdemux/demux_musepack.cpp mplayerxp/libmpdemux/demux_nsv.cpp mplayerxp/libmpdemux/demux_null.cpp mplayerxp/libmpdemux/demux_nuv.cpp mplayerxp/libmpdemux/demux_ogg.cpp mplayerxp/libmpdemux/demux_pva.cpp mplayerxp/libmpdemux/demux_rawaudio.cpp mplayerxp/libmpdemux/demux_rawvideo.cpp mplayerxp/libmpdemux/demux_real.cpp mplayerxp/libmpdemux/demux_realaud.cpp mplayerxp/libmpdemux/demux_roq.cpp mplayerxp/libmpdemux/demux_smjpeg.cpp mplayerxp/libmpdemux/demux_snd_au.cpp mplayerxp/libmpdemux/demux_ts.cpp mplayerxp/libmpdemux/demux_ty.cpp mplayerxp/libmpdemux/demux_viv.cpp mplayerxp/libmpdemux/demux_voc.cpp mplayerxp/libmpdemux/demux_vqf.cpp mplayerxp/libmpdemux/demux_wav.cpp mplayerxp/libmpdemux/demux_y4m.cpp mplayerxp/libmpdemux/demuxer.cpp mplayerxp/libmpdemux/demuxer.h mplayerxp/libmpdemux/demuxer_info.cpp mplayerxp/libmpdemux/demuxer_info.h mplayerxp/libmpdemux/demuxer_packet.cpp mplayerxp/libmpdemux/demuxer_packet.h mplayerxp/libmpdemux/demuxer_r.cpp mplayerxp/libmpdemux/demuxer_stream.cpp mplayerxp/libmpdemux/demuxer_stream.h mplayerxp/libmpdemux/mp3_hdr.cpp mplayerxp/libmpdemux/mpdemux.cpp mplayerxp/libmpdemux/mpeg_hdr.cpp mplayerxp/libmpdemux/mux_lavf.cpp mplayerxp/libmpdemux/mux_mpxp64.cpp mplayerxp/libmpdemux/mux_raw.cpp mplayerxp/libmpdemux/muxer.cpp mplayerxp/libmpdemux/parse_es.cpp mplayerxp/libmpdemux/parse_mp4.cpp mplayerxp/libmpdemux/stheader.cpp mplayerxp/libmpdemux/stheader.h mplayerxp/libmpdemux/sub_cc.cpp mplayerxp/libmpdemux/sub_ty.cpp mplayerxp/libmpdemux/yuv4mpeg.cpp mplayerxp/libmpdemux/yuv4mpeg.h mplayerxp/libmpdemux/yuv4mpeg_ratio.cpp mplayerxp/libmpstream2/cache2.cpp mplayerxp/libmpstream2/cdd.h mplayerxp/libmpstream2/cdda.cpp mplayerxp/libmpstream2/cddb.cpp mplayerxp/libmpstream2/cookies.cpp mplayerxp/libmpstream2/freesdp/common.cpp mplayerxp/libmpstream2/freesdp/errorlist.cpp mplayerxp/libmpstream2/freesdp/parser.cpp mplayerxp/libmpstream2/http.cpp mplayerxp/libmpstream2/http.h mplayerxp/libmpstream2/librtsp/rtsp.cpp mplayerxp/libmpstream2/librtsp/rtsp.h mplayerxp/libmpstream2/librtsp/rtsp_rtp.cpp mplayerxp/libmpstream2/librtsp/rtsp_rtp.h mplayerxp/libmpstream2/librtsp/rtsp_session.cpp mplayerxp/libmpstream2/librtsp/rtsp_session.h mplayerxp/libmpstream2/mrl.cpp mplayerxp/libmpstream2/mrl.h mplayerxp/libmpstream2/network.cpp mplayerxp/libmpstream2/network.h mplayerxp/libmpstream2/network_asf.cpp mplayerxp/libmpstream2/network_asf.h mplayerxp/libmpstream2/network_asf_mmst.cpp mplayerxp/libmpstream2/network_asf_mmst.h mplayerxp/libmpstream2/network_nop.cpp mplayerxp/libmpstream2/network_nop.h mplayerxp/libmpstream2/network_pnm.cpp mplayerxp/libmpstream2/network_pnm.h mplayerxp/libmpstream2/network_real_rtsp.cpp mplayerxp/libmpstream2/network_real_rtsp.h mplayerxp/libmpstream2/network_rtp.cpp mplayerxp/libmpstream2/network_rtp.h mplayerxp/libmpstream2/network_rtsp.cpp mplayerxp/libmpstream2/network_rtsp.h mplayerxp/libmpstream2/pnm.cpp mplayerxp/libmpstream2/pnm.h mplayerxp/libmpstream2/realrtsp/asmrp.cpp mplayerxp/libmpstream2/realrtsp/real.cpp mplayerxp/libmpstream2/realrtsp/rmff.cpp mplayerxp/libmpstream2/realrtsp/sdpplin.cpp mplayerxp/libmpstream2/realrtsp/xbuffer.cpp mplayerxp/libmpstream2/rtp_cache.cpp mplayerxp/libmpstream2/rtp_cache.h mplayerxp/libmpstream2/s_cdd.cpp mplayerxp/libmpstream2/s_dvdnav.cpp mplayerxp/libmpstream2/s_dvdread.cpp mplayerxp/libmpstream2/s_file.cpp mplayerxp/libmpstream2/s_ftp.cpp mplayerxp/libmpstream2/s_lavc.cpp mplayerxp/libmpstream2/s_network.cpp mplayerxp/libmpstream2/s_null.cpp mplayerxp/libmpstream2/s_oss.cpp mplayerxp/libmpstream2/s_rtsp.cpp mplayerxp/libmpstream2/s_tv.cpp mplayerxp/libmpstream2/s_udp.cpp mplayerxp/libmpstream2/s_vcdnav.cpp mplayerxp/libmpstream2/stream.cpp mplayerxp/libmpstream2/stream.h mplayerxp/libmpstream2/stream_internal.h mplayerxp/libmpstream2/stream_msg.h mplayerxp/libmpstream2/tcp.cpp mplayerxp/libmpstream2/tcp.h mplayerxp/libmpstream2/tvi/frequencies.cpp mplayerxp/libmpstream2/tvi/frequencies.h mplayerxp/libmpstream2/tvi/tv.h mplayerxp/libmpstream2/tvi/tvi_bsdbt848.cpp mplayerxp/libmpstream2/tvi/tvi_def.h mplayerxp/libmpstream2/tvi/tvi_dummy.cpp mplayerxp/libmpstream2/tvi/tvi_v4l.cpp mplayerxp/libmpstream2/udp.cpp mplayerxp/libmpstream2/udp.h mplayerxp/libmpstream2/url.cpp mplayerxp/libmpstream2/url.h mplayerxp/libmpsub/find_sub.cpp mplayerxp/libmpsub/mpsub_msg.h mplayerxp/libmpsub/spudec.cpp mplayerxp/libmpsub/spudec.h mplayerxp/libmpsub/subreader.cpp mplayerxp/libmpsub/subreader.h mplayerxp/libmpsub/vobsub.cpp mplayerxp/libplaytree2/asxparser.cpp mplayerxp/libplaytree2/asxparser.h mplayerxp/libplaytree2/playtree.cpp mplayerxp/libplaytree2/playtree.h mplayerxp/libplaytree2/playtree_msg.h mplayerxp/libplaytree2/playtreeparser.cpp mplayerxp/libplaytree2/playtreeparser.h mplayerxp/libvo2/aspect.cpp mplayerxp/libvo2/aspect.h mplayerxp/libvo2/font_load.cpp mplayerxp/libvo2/img_format.cpp mplayerxp/libvo2/jpeg_enc.cpp mplayerxp/libvo2/osd_render.cpp mplayerxp/libvo2/osd_render.h mplayerxp/libvo2/screenshot.cpp mplayerxp/libvo2/sub.cpp mplayerxp/libvo2/sub.h mplayerxp/libvo2/video_out.cpp mplayerxp/libvo2/video_out.h mplayerxp/libvo2/video_out_internal.h mplayerxp/libvo2/vidix_system.cpp mplayerxp/libvo2/vidix_system.h mplayerxp/libvo2/vo_fbdev.cpp mplayerxp/libvo2/vo_msg.h mplayerxp/libvo2/vo_null.cpp mplayerxp/libvo2/vo_opengl.cpp mplayerxp/libvo2/vo_sdl.cpp mplayerxp/libvo2/vo_vesa.cpp mplayerxp/libvo2/vo_x11.cpp mplayerxp/libvo2/vo_xv.cpp mplayerxp/libvo2/x11_system.cpp mplayerxp/libvo2/x11_system.h mplayerxp/main.cpp mplayerxp/mplayerxp.h mplayerxp/mpxp_msg.cpp mplayerxp/mpxp_msg.h mplayerxp/nls/nls.h mplayerxp/nls/nls_msg.h mplayerxp/nls/recode.cpp mplayerxp/osdep/aclib.cpp mplayerxp/osdep/aclib_template.h mplayerxp/osdep/bswap.h mplayerxp/osdep/cpudetect.cpp mplayerxp/osdep/cpudetect.h mplayerxp/osdep/fastmemcpy.h mplayerxp/osdep/get_path.cpp mplayerxp/osdep/get_path.h mplayerxp/osdep/getch2.cpp mplayerxp/osdep/getch2.h mplayerxp/osdep/keycodes.h mplayerxp/osdep/lrmi.cpp mplayerxp/osdep/lrmi.h mplayerxp/osdep/mm_accel.h mplayerxp/osdep/mp_malloc.cpp mplayerxp/osdep/mp_malloc.h mplayerxp/osdep/mplib.cpp mplayerxp/osdep/mplib.h mplayerxp/osdep/osdep_msg.h mplayerxp/osdep/shmem.cpp mplayerxp/osdep/shmem.h mplayerxp/osdep/timer-lx.cpp mplayerxp/osdep/timer.cpp mplayerxp/osdep/timer.h mplayerxp/osdep/vbelib.cpp mplayerxp/osdep/vbelib.h mplayerxp/player_msg.h mplayerxp/postproc/af.cpp mplayerxp/postproc/af_ao3.cpp mplayerxp/postproc/af_channels.cpp mplayerxp/postproc/af_crystality.cpp mplayerxp/postproc/af_delay.cpp mplayerxp/postproc/af_dyn.cpp mplayerxp/postproc/af_echo3d.cpp mplayerxp/postproc/af_equalizer.cpp mplayerxp/postproc/af_export.cpp mplayerxp/postproc/af_extrastereo.cpp mplayerxp/postproc/af_ffenc.cpp mplayerxp/postproc/af_format.cpp mplayerxp/postproc/af_hrtf.cpp mplayerxp/postproc/af_karaoke.cpp mplayerxp/postproc/af_lp.cpp mplayerxp/postproc/af_null.cpp mplayerxp/postproc/af_pan.cpp mplayerxp/postproc/af_raw.cpp mplayerxp/postproc/af_resample.cpp mplayerxp/postproc/af_scaletempo.cpp mplayerxp/postproc/af_sinesuppress.cpp mplayerxp/postproc/af_sub.cpp mplayerxp/postproc/af_surround.cpp mplayerxp/postproc/af_tools.cpp mplayerxp/postproc/af_volnorm.cpp mplayerxp/postproc/af_volume.cpp mplayerxp/postproc/aflib.cpp mplayerxp/postproc/libmenu/menu.cpp mplayerxp/postproc/libmenu/menu.h mplayerxp/postproc/libmenu/menu_cmdlist.cpp mplayerxp/postproc/libmenu/menu_console.cpp mplayerxp/postproc/libmenu/menu_filesel.cpp mplayerxp/postproc/libmenu/menu_list.cpp mplayerxp/postproc/libmenu/menu_param.cpp mplayerxp/postproc/libmenu/menu_pt.cpp mplayerxp/postproc/libmenu/menu_txt.cpp mplayerxp/postproc/postprocess.cpp mplayerxp/postproc/pp_msg.h mplayerxp/postproc/swscale.cpp mplayerxp/postproc/vf.cpp mplayerxp/postproc/vf.h mplayerxp/postproc/vf_1bpp.cpp mplayerxp/postproc/vf_2xsai.cpp mplayerxp/postproc/vf_aspect.cpp mplayerxp/postproc/vf_delogo.cpp mplayerxp/postproc/vf_denoise3d.cpp mplayerxp/postproc/vf_dint.cpp mplayerxp/postproc/vf_down3dright.cpp mplayerxp/postproc/vf_eq.cpp mplayerxp/postproc/vf_expand.cpp mplayerxp/postproc/vf_flip.cpp mplayerxp/postproc/vf_format.cpp mplayerxp/postproc/vf_framestep.cpp mplayerxp/postproc/vf_il.cpp mplayerxp/postproc/vf_menu.cpp mplayerxp/postproc/vf_mirror.cpp mplayerxp/postproc/vf_noise.cpp mplayerxp/postproc/vf_null.cpp mplayerxp/postproc/vf_ow.cpp mplayerxp/postproc/vf_palette.cpp mplayerxp/postproc/vf_panscan.cpp mplayerxp/postproc/vf_perspective.cpp mplayerxp/postproc/vf_pp.cpp mplayerxp/postproc/vf_raw.cpp mplayerxp/postproc/vf_rectangle.cpp mplayerxp/postproc/vf_rgb2bgr.cpp mplayerxp/postproc/vf_rotate.cpp mplayerxp/postproc/vf_scale.cpp mplayerxp/postproc/vf_smartblur.cpp mplayerxp/postproc/vf_softpulldown.cpp mplayerxp/postproc/vf_swapuv.cpp mplayerxp/postproc/vf_test.cpp mplayerxp/postproc/vf_unsharp.cpp mplayerxp/postproc/vf_vo2.cpp mplayerxp/postproc/vf_yuvcsp.cpp mplayerxp/postproc/vf_yuy2.cpp mplayerxp/postproc/vf_yvu9.cpp mplayerxp/xmpcore/PointerProtector.h mplayerxp/xmpcore/sig_hand.cpp mplayerxp/xmpcore/sig_hand.h mplayerxp/xmpcore/xmp_adecoder.cpp mplayerxp/xmpcore/xmp_adecoder.h mplayerxp/xmpcore/xmp_aframe.cpp mplayerxp/xmpcore/xmp_aframe.h mplayerxp/xmpcore/xmp_aplayer.cpp mplayerxp/xmpcore/xmp_aplayer.h mplayerxp/xmpcore/xmp_context.cpp mplayerxp/xmpcore/xmp_context.h mplayerxp/xmpcore/xmp_core.cpp mplayerxp/xmpcore/xmp_core.h mplayerxp/xmpcore/xmp_enums.h mplayerxp/xmpcore/xmp_image.cpp mplayerxp/xmpcore/xmp_image.h mplayerxp/xmpcore/xmp_vdecoder.cpp mplayerxp/xmpcore/xmp_vdecoder.h mplayerxp/xmpcore/xmp_vplayer.cpp mplayerxp/xmpcore/xmp_vplayer.h Modified: mplayerxp/dump.cpp =================================================================== --- mplayerxp/dump.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/dump.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* dump.c - stream dumper */ @@ -20,7 +20,7 @@ #include "global_msg.h" #include "dump.h" -namespace mpxp { +namespace usr { static char *media=NULL,*port=NULL; @@ -464,4 +464,4 @@ ,priv->asize); } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/dump.h =================================================================== --- mplayerxp/dump.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/dump.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #ifndef DUMP_H_INCLUDED #define DUMP_H_INCLUDED 1 #include "libmpdemux/demuxer_r.h" -namespace mpxp { +namespace usr { int dump_parse(const char *param); void dump_stream(Stream *stream); void dump_mux_init(Demuxer *demuxer,libinput_t&libinput); Modified: mplayerxp/global_msg.h =================================================================== --- mplayerxp/global_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/global_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #define MSGT_CLASS MSGT_GLOBAL #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_GLOBAL); static mpxp_ostream_fatal mpxp_fatal(MSGT_GLOBAL); static mpxp_ostream_err mpxp_err(MSGT_GLOBAL); @@ -17,5 +17,5 @@ static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_GLOBAL); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_GLOBAL); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/in_msg.h =================================================================== --- mplayerxp/input2/in_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/in_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -3,7 +3,7 @@ #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_INPUT); static mpxp_ostream_fatal mpxp_fatal(MSGT_INPUT); static mpxp_ostream_err mpxp_err(MSGT_INPUT); @@ -15,6 +15,6 @@ static mpxp_ostream_dbg2 mpxp_dbg2(MSGT_INPUT); static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_INPUT); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_INPUT); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/input.cpp =================================================================== --- mplayerxp/input2/input.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/input.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <iomanip> #include <stdlib.h> @@ -37,7 +37,7 @@ #include "joystick.h" #include "osdep/getch2.h" -namespace mpxp { +namespace usr { static const int MP_MAX_KEY_FD=10; static const int MP_MAX_CMD_FD=10; @@ -1428,4 +1428,4 @@ return MPXP_False; } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/input2/input.h =================================================================== --- mplayerxp/input2/input.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/input.h 2013-05-08 12:54:26 UTC (rev 636) @@ -2,13 +2,13 @@ #define INPUT_H_INCLUDED 1 #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <map> #include "xmpcore/xmp_enums.h" -namespace mpxp { +namespace usr { // All commands id enum { MP_CMD_SEEK =0, @@ -166,5 +166,5 @@ extern void mp_input_print_binds(libinput_t& handle); // Interruptible usleep: (used by libmpdemux) extern MPXP_Rc mp_input_check_interrupt(libinput_t& handle,int time); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/joystick.cpp =================================================================== --- mplayerxp/input2/joystick.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/joystick.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #ifdef HAVE_JOYSTICK #include "joystick.h" @@ -27,7 +27,7 @@ #include "in_msg.h" -namespace mpxp { +namespace usr { typedef struct priv_s { int axis[10]; int btns; @@ -146,11 +146,11 @@ } return MP_INPUT_NOTHING; } -} // namespace mpxp +} // namespace usr #else -namespace mpxp { +namespace usr { any_t* mp_input_joystick_open(const char* dev) { UNUNSED(dev); return NULL; } void mp_input_joystick_close(any_t* ctx) { UNUSED(ctx); } int mp_input_joystick_read(any_t* ctx) { UNUSED(ctx); return MP_INPUT_NOTHING; } -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/joystick.h =================================================================== --- mplayerxp/input2/joystick.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/joystick.h 2013-05-08 12:54:26 UTC (rev 636) @@ -1,7 +1,7 @@ #ifndef JOYSTICK_H_INCLUDED #define JOYSTICK_H_INCLUDED 1 -namespace mpxp { +namespace usr { enum { JOY_BASE =(0x100+128), JOY_AXIS0_PLUS =(JOY_BASE+0), @@ -42,5 +42,5 @@ extern any_t* mp_input_joystick_open(const char* dev); extern void mp_input_joystick_close(any_t* ctx); extern int mp_input_joystick_read(any_t* ctx); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/lirc.cpp =================================================================== --- mplayerxp/input2/lirc.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/lirc.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #ifdef HAVE_LIRC @@ -17,7 +17,7 @@ #include "input.h" #include "in_msg.h" -namespace mpxp { +namespace usr { static struct lirc_config *lirc_config; char *lirc_configfile; @@ -114,5 +114,5 @@ lirc_deinit(); delete priv; } -}// namespace mpxp +}// namespace usr #endif Modified: mplayerxp/input2/lirc.h =================================================================== --- mplayerxp/input2/lirc.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/lirc.h 2013-05-08 12:54:26 UTC (rev 636) @@ -1,8 +1,8 @@ #ifndef __LIRC_H_INCLUDED #define __LIRC_H_INCLUDED 1 -namespace mpxp { +namespace usr { extern any_t* mp_input_lirc_open(void); extern int mp_input_lirc_read_cmd(any_t* ctx,char* dest, int s); extern void mp_input_lirc_close(any_t* ctx); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/mouse.h =================================================================== --- mplayerxp/input2/mouse.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/mouse.h 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #ifndef MOUSE_H_INCLUDED #define MOUSE_H_INCLUDED 1 -namespace mpxp { +namespace usr { enum { MOUSE_BASE=((0x100+256)|MP_NO_REPEAT_KEY), MOUSE_BTN0=(MOUSE_BASE+0), @@ -27,5 +27,5 @@ MOUSE_BTN8_DBL=(MOUSE_BASE_DBL+8), MOUSE_BTN9_DBL=(MOUSE_BASE_DBL+9) }; -} // namespace mpxp +} // namespace usr #endif \ No newline at end of file Modified: mplayerxp/libao3/afmt.cpp =================================================================== --- mplayerxp/libao3/afmt.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/afmt.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include "afmt.h" const char* afmt2str(unsigned fmt) { Modified: mplayerxp/libao3/ao_alsa.cpp =================================================================== --- mplayerxp/libao3/ao_alsa.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_alsa.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* ao_alsa9 - ALSA-0.9.x output plugin for MPlayer @@ -31,7 +31,7 @@ #include "ao_msg.h" #include "libmpstream2/mrl.h" -namespace mpxp { +namespace usr { typedef struct priv_conf_s { int mmap; int noblock; @@ -1004,5 +1004,5 @@ "under developement", query_interface }; -} //namespace mpxp +} //namespace usr Modified: mplayerxp/libao3/ao_arts.cpp =================================================================== --- mplayerxp/libao3/ao_arts.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_arts.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * aRts (KDE analogue Real-Time synthesizer) audio output driver for MPlayerXP * @@ -32,7 +32,7 @@ #include "afmt.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { /* Feel mp_free to experiment with the following values: */ static const int ARTS_PACKETS=10; /* Number of audio packets */ static const int ARTS_PACKET_SIZE_LOG2=11; /* Log2 of audio packet size */ @@ -205,4 +205,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_esd.cpp =================================================================== --- mplayerxp/libao3/ao_esd.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_esd.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * EsounD (Enlightened Sound Daemon) audio output driver for MPlayerXP * @@ -57,7 +57,7 @@ #include "ao_msg.h" -namespace mpxp { +namespace usr { static const int ESD_RESAMPLES=0; #define ESD_DEBUG 0 @@ -481,4 +481,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_jack.cpp =================================================================== --- mplayerxp/libao3/ao_jack.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_jack.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * JACK audio output driver for MPlayer * @@ -39,7 +39,7 @@ #include "mpxp_conf_lavc.h" #include <jack/jack.h> -namespace mpxp { +namespace usr { //! maximum number of channels supported, avoids lots of mallocs static const int MAX_CHANS=6; @@ -365,4 +365,4 @@ "based on ao_sdl.c", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_msg.h =================================================================== --- mplayerxp/libao3/ao_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -3,7 +3,7 @@ #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_AO); static mpxp_ostream_fatal mpxp_fatal(MSGT_AO); static mpxp_ostream_err mpxp_err(MSGT_AO); @@ -15,6 +15,6 @@ static mpxp_ostream_dbg2 mpxp_dbg2(MSGT_AO); static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_AO); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_AO); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libao3/ao_nas.cpp =================================================================== --- mplayerxp/libao3/ao_nas.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_nas.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * NAS audio output driver * @@ -62,7 +62,7 @@ #include "afmt.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { /* NAS_FRAG_SIZE must be a power-of-two value */ static const int NAS_FRAG_SIZE=4096; @@ -634,4 +634,4 @@ "", query_interface }; -} // namespace mpxp \ No newline at end of file +} // namespace usr \ No newline at end of file Modified: mplayerxp/libao3/ao_null.cpp =================================================================== --- mplayerxp/libao3/ao_null.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_null.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -18,7 +18,7 @@ #include "audio_out_internal.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { static const uint32_t WAV_ID_RIFF=FOURCC_TAG(0x46,0x46,0x49,0x52); /* "RIFF" */ static const uint32_t WAV_ID_WAVE=FOURCC_TAG(0x45,0x56,0x41,0x57); /* "WAVE" */ static const uint32_t WAV_ID_FMT =FOURCC_TAG(0x20,0x74,0x6d,0x66); /* "fmt " */ @@ -255,4 +255,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_openal.cpp =================================================================== --- mplayerxp/libao3/ao_openal.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_openal.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * OpenAL audio output driver for MPlayerXP * @@ -36,7 +36,7 @@ #include "osdep/timer.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { static const int MAX_CHANS=8; static const int NUM_BUF=128; static const int CHUNK_SIZE=512; @@ -273,4 +273,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_oss.cpp =================================================================== --- mplayerxp/libao3/ao_oss.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_oss.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> @@ -18,7 +18,7 @@ #include "audio_out_internal.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { const char *oss_mixer_device = PATH_DEV_MIXER; /* Support for >2 output channels added 2001-11-25 - Steve Davies <st...@da...> */ class Oss_AO_Interface : public AO_Interface { @@ -445,4 +445,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_sdl.cpp =================================================================== --- mplayerxp/libao3/ao_sdl.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_sdl.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * ao_sdl.c - libao3 SDLlib Audio Output Driver for MPlayer * @@ -26,7 +26,7 @@ #include "osdep/fastmemcpy.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { // Samplesize used by the SDLlib AudioSpec struct static const int SAMPLESIZE=1024; @@ -349,4 +349,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_wav.cpp =================================================================== --- mplayerxp/libao3/ao_wav.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_wav.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * PCM audio output driver * @@ -39,7 +39,7 @@ #include <windows.h> #endif -namespace mpxp { +namespace usr { static const uint32_t WAV_ID_RIFF=0x46464952; /* "RIFF" */ static const uint32_t WAV_ID_WAVE=0x45564157; /* "WAVE" */ static const uint32_t WAV_ID_FMT =0x20746d66; /* "fmt " */ Modified: mplayerxp/libao3/audio_out.cpp =================================================================== --- mplayerxp/libao3/audio_out.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/audio_out.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -10,7 +10,7 @@ #include "afmt.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { extern const ao_info_t audio_out_wav; extern const ao_info_t audio_out_null; #ifdef USE_OSS_AUDIO @@ -364,4 +364,4 @@ priv.muted=1; } } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/audio_out.h =================================================================== --- mplayerxp/libao3/audio_out.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/audio_out.h 2013-05-08 12:54:26 UTC (rev 636) @@ -5,7 +5,7 @@ #include <string> -namespace mpxp { +namespace usr { class AO_Interface; /** Text description of AO-driver */ @@ -73,5 +73,5 @@ /* prototypes */ extern const char * __FASTCALL__ ao_format_name(int format); extern int __FASTCALL__ ao_format_bits(int format); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libao3/audio_out_internal.h =================================================================== --- mplayerxp/libao3/audio_out_internal.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/audio_out_internal.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #include <string> -namespace mpxp { +namespace usr { /** AO-driver interface */ class AO_Interface : public Opaque { public: @@ -65,5 +65,5 @@ protected: std::string subdevice; }; -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libmpcodecs/ad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* ad.c - audio decoder interface */ Modified: mplayerxp/libmpcodecs/ad_a52.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_a52.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_a52.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #define __USE_XOPEN 1 Modified: mplayerxp/libmpcodecs/ad_acm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_acm.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_acm.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_dca.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dca.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_dca.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #define __USE_XOPEN 1 Modified: mplayerxp/libmpcodecs/ad_dmo.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dmo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_dmo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_dshow.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dshow.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_dshow.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_dvdpcm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dvdpcm.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_dvdpcm.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_faad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_faad.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_faad.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* ad_faad.c - MPlayer AAC decoder using libfaad2 * This file is part of MPlayer, see http://mplayerhq.hu/ for info. * (c)2002 by Felix Buenemann <atmosfear at users.sourceforge.net> Modified: mplayerxp/libmpcodecs/ad_hwac3.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_hwac3.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_hwac3.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #define __USE_XOPEN 1 Modified: mplayerxp/libmpcodecs/ad_lavc.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_lavc.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_lavc.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #define __USE_GNU 1 Modified: mplayerxp/libmpcodecs/ad_libdv.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_libdv.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_libdv.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <string.h> Modified: mplayerxp/libmpcodecs/ad_mp3.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_mp3.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_msg.h =================================================================== --- mplayerxp/libmpcodecs/ad_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #define MSGT_CLASS MSGT_DECAUDIO #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_DECAUDIO); static mpxp_ostream_fatal mpxp_fatal(MSGT_DECAUDIO); static mpxp_ostream_err mpxp_err(MSGT_DECAUDIO); @@ -16,6 +16,6 @@ static mpxp_ostream_dbg2 mpxp_dbg2(MSGT_DECAUDIO); static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_DECAUDIO); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_DECAUDIO); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libmpcodecs/ad_null.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_null.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_null.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_pcm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_pcm.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_pcm.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_qtaudio.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_qtaudio.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_qtaudio.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_real.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_real.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_real.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/ad_twin.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_twin.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_twin.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_vorbis.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_vorbis.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_vorbis.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/codecs_ld.cpp =================================================================== --- mplayerxp/libmpcodecs/codecs_ld.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/codecs_ld.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* codecs_ld - light interface to codec loader */ @@ -13,7 +13,7 @@ #include "mpxp_help.h" #include "global_msg.h" -namespace mpxp { +namespace usr { any_t* ld_codec(const std::string& name,const std::string& url_hint) { any_t*dll_handle; @@ -63,4 +63,4 @@ if(!rval) mpxp_err<<"[codec_ld] "<<MSGTR_CODEC_DLL_SYM_ERR<<":"<<sym_name<<std::endl; return rval; } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libmpcodecs/codecs_ld.h =================================================================== --- mplayerxp/libmpcodecs/codecs_ld.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/codecs_ld.h 2013-05-08 12:54:26 UTC (rev 636) @@ -6,10 +6,10 @@ #include "mpxp_config.h" #include <string> -namespace mpxp { +namespace usr { extern any_t* ld_codec(const std::string& name,const std::string& url_hint); /* extern char * codec_name( const char *name );*/ extern any_t* ld_sym(any_t*handle,const std::string& sym_name); extern any_t* ld_aliased_sym(any_t*handle,const std::string& sym_name,...); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libmpcodecs/dec_audio.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_audio.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/dec_audio.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <algorithm> #include <stdio.h> Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/dec_video.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #ifdef _OPENMP #include <omp.h> Modified: mplayerxp/libmpcodecs/dec_video.h =================================================================== --- mplayerxp/libmpcodecs/dec_video.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/dec_video.h 2013-05-08 12:54:26 UTC (rev 636) @@ -3,7 +3,7 @@ #include "xmpcore/xmp_enums.h" #include "libmpdemux/demuxer_r.h" -namespace mpxp { +namespace usr { struct libinput_t; } Modified: mplayerxp/libmpcodecs/liba52/bit_allocate.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/bit_allocate.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/bit_allocate.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * bit_allocate.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/bitstream.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/bitstream.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/bitstream.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * bitstream.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/crc.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/crc.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/crc.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * crc.c * Modified: mplayerxp/libmpcodecs/liba52/downmix.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/downmix.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/downmix.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * downmix.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/imdct.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/imdct.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/imdct.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * imdct.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/parse.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/parse.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/parse.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * parse.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/resample.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/resample.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/resample.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; // a52_resample_init should find the requested converter (from type flags -> // given number of channels) and set up some function pointers... Modified: mplayerxp/libmpcodecs/libdca/bitstream.cpp =================================================================== --- mplayerxp/libmpcodecs/libdca/bitstream.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libdca/bitstream.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * bitstream.c * Copyright (C) 2004 Gildas Bazin <gb...@vi...> Modified: mplayerxp/libmpcodecs/libdca/downmix.cpp =================================================================== --- mplayerxp/libmpcodecs/libdca/downmix.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libdca/downmix.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * downmix.c * Copyright (C) 2004 Gildas Bazin <gb...@vi...> Modified: mplayerxp/libmpcodecs/libdca/parse.cpp =================================================================== --- mplayerxp/libmpcodecs/libdca/parse.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libdca/parse.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * parse.c * Copyright (C) 2004 Gildas Bazin <gb...@vi...> Modified: mplayerxp/libmpcodecs/libdca/resample.cpp =================================================================== --- mplayerxp/libmpcodecs/libdca/resample.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libdca/resample.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; // dca_resample_init should find the requested converter (from type flags -> // given number of channels) and set up some function pointers... Modified: mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* RTjpeg (C) Justin Schoeman 1998 (ju...@su...) Modified: mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* minilzo.c -- mini subset of the LZO real-time data compression library This file is part of the LZO real-time data compression library. Modified: mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * NuppelVideo 0.05 file parser * for MPlayer Modified: mplayerxp/libmpcodecs/vd.cpp =================================================================== --- mplayerxp/libmpcodecs/vd.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <string.h> Modified: mplayerxp/libmpcodecs/vd_divx4.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_divx4.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_divx4.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* HACKING notes: first time it was OpenDivx project by Mayo (unsupported by mplayerxp) Modified: mplayerxp/libmpcodecs/vd_dmo.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_dmo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <stdarg.h> Modified: mplayerxp/libmpcodecs/vd_dshow.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_dshow.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_dshow.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <stdarg.h> Modified: mplayerxp/libmpcodecs/vd_huffyuv.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_huffyuv.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_huffyuv.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * * HuffYUV Decoder for Mplayer Modified: mplayerxp/libmpcodecs/vd_lavc.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_lavc.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_lavc.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <algorithm> #include <ctype.h> Modified: mplayerxp/libmpcodecs/vd_libdv.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_libdv.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_libdv.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <string.h> Modified: mplayerxp/libmpcodecs/vd_libmpeg2.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_libmpeg2.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_libmpeg2.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* we still need that: benchmarks: Modified: mplayerxp/libmpcodecs/vd_mpegpes.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_mpegpes.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_mpegpes.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/vd_msg.h =================================================================== --- mplayerxp/libmpcodecs/vd_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #define MSGT_CLASS MSGT_DECVIDEO #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_DECVIDEO); static mpxp_ostream_fatal mpxp_fatal(MSGT_DECVIDEO); static mpxp_ostream_err mpxp_err(MSGT_DECVIDEO); @@ -16,6 +16,6 @@ static mpxp_ostream_dbg2 mpxp_dbg2(MSGT_DECVIDEO); static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_DECVIDEO); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_DECVIDEO); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libmpcodecs/vd_null.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_null.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_null.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/vd_nuv.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_nuv.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_nuv.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include "libnuppelvideo/nuppelvideo.h" Modified: mplayerxp/libmpcodecs/vd_qtvideo.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_qtvideo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_qtvideo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #define __STDC_FORMAT_MACROS #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/vd_raw.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_raw.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_raw.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/vd_real.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_real.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_real.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <inttypes.h> Modified: mplayerxp/libmpcodecs/vd_theora.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_theora.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_theora.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <stdarg.h> Modified: mplayerxp/libmpcodecs/vd_vfw.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_vfw.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_vfw.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include "mplayerxp.h" #include <stdio.h> Modified: mplayerxp/libmpcodecs/vd_xanim.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_xanim.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_xanim.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* xacodec.c -- XAnim Video Codec DLL support Modified: mplayerxp/libmpcodecs/vd_xvid.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_xvid.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_xvid.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* Xvid codec - is successor of odivx */ Modified: mplayerxp/libmpconf/cfgparser.cpp =================================================================== --- mplayerxp/libmpconf/cfgparser.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpconf/cfgparser.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * command line and config file parser * by Szabolcs Berecz <sz...@in...> @@ -28,7 +28,7 @@ #include "parser_msg.h" #include "osdep/get_path.h" -namespace mpxp { +namespace usr { static const int MAX_RECURSION_DEPTH=8; typedef int (*cfg_func_arg_param_t)(const mpxp_option_t *,const std::string& ,const std::string& ); @@ -885,4 +885,4 @@ } } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libmpconf/cfgparser.h =================================================================== --- mplayerxp/libmpconf/cfgparser.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpconf/cfgparser.h 2013-05-08 12:54:26 UTC (rev 636) @@ -8,7 +8,7 @@ #include <string> #include <map> -namespace mpxp { +namespace usr { struct libinput_t; struct PlayTree; @@ -145,6 +145,6 @@ inline M_Config::flags_e operator|=(M_Config::flags_e& a, M_Config::flags_e b) { return (a=static_cast<M_Config::flags_e>(static_cast<unsigned>(a)|static_cast<unsigned>(b))); } inline M_Config::flags_e operator&=(M_Config::flags_e& a, M_Co... [truncated message content] |
From: <nic...@us...> - 2013-06-10 07:27:28
|
Revision: 650 http://sourceforge.net/p/mplayerxp/code/650 Author: nickols_k Date: 2013-06-10 07:27:20 +0000 (Mon, 10 Jun 2013) Log Message: ----------- remove support of win32 binary codecs as incompatible with GPL-licence Modified Paths: -------------- mplayerxp/Makefile mplayerxp/configure mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/ad.cpp mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/vd.cpp mplayerxp/libmpconf/Makefile mplayerxp/libmpconf/codec-cfg.h mplayerxp/libmpdemux/asf.h mplayerxp/libmpdemux/aviprint.h mplayerxp/libmpdemux/demux_mkv.cpp mplayerxp/libmpdemux/demux_mov.cpp mplayerxp/libmpdemux/demux_mpxp64.cpp mplayerxp/libmpdemux/mux_mpxp64.cpp mplayerxp/libmpdemux/mux_raw.cpp mplayerxp/libmpdemux/muxer.cpp mplayerxp/libmpdemux/stheader.h mplayerxp/libmpstream2/s_oss.cpp mplayerxp/main.cpp mplayerxp/postproc/af_format.cpp mplayerxp/xmpcore/xmp_aframe.cpp Added Paths: ----------- mplayerxp/win32sdk/ mplayerxp/win32sdk/avifmt.h mplayerxp/win32sdk/basetsd.h mplayerxp/win32sdk/debugtools.h mplayerxp/win32sdk/driver.h mplayerxp/win32sdk/elfdll.h mplayerxp/win32sdk/heap.h mplayerxp/win32sdk/ldt.h mplayerxp/win32sdk/mmreg.h mplayerxp/win32sdk/module.h mplayerxp/win32sdk/msacm.h mplayerxp/win32sdk/msacmdrv.h mplayerxp/win32sdk/ntdef.h mplayerxp/win32sdk/objbase.h mplayerxp/win32sdk/pe_image.h mplayerxp/win32sdk/poppack.h mplayerxp/win32sdk/pshpack1.h mplayerxp/win32sdk/pshpack2.h mplayerxp/win32sdk/pshpack4.h mplayerxp/win32sdk/pshpack8.h mplayerxp/win32sdk/qtxsdk/ mplayerxp/win32sdk/vfw.h mplayerxp/win32sdk/winbase.h mplayerxp/win32sdk/windef.h mplayerxp/win32sdk/windows.h mplayerxp/win32sdk/winerror.h mplayerxp/win32sdk/winestring.h mplayerxp/win32sdk/winnt.h mplayerxp/win32sdk/winreg.h mplayerxp/win32sdk/winuser.h Removed Paths: ------------- mplayerxp/libmpcodecs/ad_acm.cpp mplayerxp/libmpcodecs/ad_dmo.cpp mplayerxp/libmpcodecs/ad_dshow.cpp mplayerxp/libmpcodecs/ad_qtaudio.cpp mplayerxp/libmpcodecs/ad_twin.cpp mplayerxp/libmpcodecs/vd_dmo.cpp mplayerxp/libmpcodecs/vd_dshow.cpp mplayerxp/libmpcodecs/vd_qtvideo.cpp mplayerxp/libmpcodecs/vd_vfw.cpp mplayerxp/libmpconf/codec-cfg.cpp mplayerxp/win32loader/ Modified: mplayerxp/Makefile =================================================================== --- mplayerxp/Makefile 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/Makefile 2013-06-10 07:27:20 UTC (rev 650) @@ -12,9 +12,7 @@ TARGET_EXE = $(PROGNAME) # these subdirectories required installation due binaries within them SUBDIRS = libmpdemux libmpstream2 libmpsub libplaytree2 libmpcodecs libmpconf libao3 osdep postproc input2 nls libvo2 xmpcore -ifeq ($(ENABLE_WIN32LOADER),yes) -SUBDIRS+=win32loader -endif + DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done DO_MAKE_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done @@ -45,9 +43,6 @@ nls/libnls.a \ libmpconf/libmpconf.a \ xmpcore/libxmpcore.a -ifeq ($(ENABLE_WIN32LOADER),yes) - MP_LIBS += win32loader/libwin32loader.a -endif LIBS+= $(MP_LIBS) $(LAVC_LIBS) $(EXTRALIBS) -lm CXXFLAGS = $(OPTXXFLAGS) $(EXTRA_INC) Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/configure 2013-06-10 07:27:20 UTC (rev 650) @@ -87,7 +87,6 @@ "profile|compile profiling information into PROGRAM", "static|build static libraries", "dbg23|allow additional level of debug messages", - "win32loader|build support for Win32 codecs", "random_name|generates pseudo random suffix of target", "sdl|build with SDL video and audio output|http://www.libsdl.org", "sdl_image|build with SDL_image for screenshots|http://www.libsdl.org/projects/SDL_image", @@ -106,7 +105,6 @@ "libdir|object code libraries|\$exec_prefix/lib", "datadir|read-only architecture-independent data|\$prefix/share/mplayerxp", "confdir|read-only configuration files|\$prefix/share/mplayerxp", - "win32libdir|win32 .dll locations [/usr/lib/win32]" ) PROGNAME_LIST=( @@ -580,26 +578,6 @@ test -f nls/mpxp_help-$linguas.h || die "nls/mpxp_help-$linguas.h not found" echo "#define I18N_LANGUAGE \"$linguas\"" >>mpxp_config.h -enabled gpl_only && disable win32loader - -if win32 || ! x86_32 ; then -disable win32loader -fi -win32 && add_ldflags -lkernel32 -print_config ENABLE_ mpxp_config.h mpxp_config.mak win32loader - -echo -n "win32 dll's ... " -if test -z "$win32libdir" ; then - for I in /usr/local/lib/win32 /usr/lib/win32 ; do - if test -d "$I" ; then - win32libdir="$I" - break; - fi; - done -fi -echo "$win32libdir" -echo "#define WIN32_PATH \"$win32libdir\"" >>mpxp_config.h - ######### # VIDEO # ######### Modified: mplayerxp/libmpcodecs/Makefile =================================================================== --- mplayerxp/libmpcodecs/Makefile 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/Makefile 2013-06-10 07:27:20 UTC (rev 650) @@ -42,18 +42,6 @@ CXXSRCS+= ad_libdv.cpp vd_libdv.cpp endif -ifeq ($(ENABLE_WIN32LOADER),yes) -CXXSRCS+=vd_dshow.cpp \ - vd_vfw.cpp \ - vd_dmo.cpp \ - vd_qtvideo.cpp \ - ad_dshow.cpp \ - ad_acm.cpp \ - ad_dmo.cpp \ - ad_qtaudio.cpp \ - ad_twin.cpp -endif - OBJS=$(SRCS:.c=.o) CXXOBJS=$(CXXSRCS:.cpp=.o) Modified: mplayerxp/libmpcodecs/ad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -52,13 +52,6 @@ #ifndef ENABLE_GPL_ONLY &mpcodecs_ad_real, #endif -#ifdef ENABLE_WIN32LOADER - &mpcodecs_ad_dshow, - &mpcodecs_ad_twin, - &mpcodecs_ad_msacm, - &mpcodecs_ad_dmo, - &mpcodecs_ad_qtaudio, -#endif &mpcodecs_ad_lavc, &mpcodecs_ad_null, Deleted: mplayerxp/libmpcodecs/ad_acm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_acm.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_acm.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,268 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#define __AD_ACM -#include "ad_internal.h" -#include "codecs_ld.h" -#include "win32loader/wineacm.h" -#include "libmpdemux/aviprint.h" -#include "libao3/afmt.h" -#include "mpxp_help.h" - -static const ad_info_t info = { - "Win32/ACM decoders", - "acm", - "Nickols_K", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(msacm) - -struct acm_private_t : public Opaque { - acm_private_t(); - virtual ~acm_private_t(); - - float pts; - WAVEFORMATEX o_wf; // out format - HACMSTREAM srcstream; // handle - sh_audio_t* sh; -}; -acm_private_t::acm_private_t() {} -acm_private_t::~acm_private_t() {} - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -static int init_acm_audio_codec(acm_private_t& priv){ - sh_audio_t* sh_audio = priv.sh; - HRESULT ret; - WAVEFORMATEX *in_fmt=sh_audio->wf; - unsigned int srcsize=0; - - MSG_V("======= Win32 (ACM) AUDIO Codec init =======\n"); - - priv.srcstream=0; - - priv.o_wf.nChannels=sh_audio->nch; - priv.o_wf.nSamplesPerSec=sh_audio->rate; - priv.o_wf.nAvgBytesPerSec=2*priv.o_wf.nSamplesPerSec*priv.o_wf.nChannels; - priv.o_wf.wFormatTag=WAVE_FORMAT_PCM; - priv.o_wf.nBlockAlign=2*sh_audio->nch; - priv.o_wf.wBitsPerSample=sh_audio->afmt?afmt2bps(sh_audio->afmt)*8:16; - priv.o_wf.cbSize=0; - if(!in_fmt) { - in_fmt=sh_audio->wf=new(zeromem) WAVEFORMATEX; - memcpy(in_fmt,&priv.o_wf,sizeof(WAVEFORMATEX)); - in_fmt->wFormatTag=sh_audio->wtag; - } - - if(mp_conf.verbose) { - MSG_V("Output fmt:\n"); - print_wave_header(&priv.o_wf,sizeof(WAVEFORMATEX)); - } - MSACM_RegisterDriver((const char *)sh_audio->codec->dll_name, sh_audio->wtag, 0); - ret=acmStreamOpen(&priv.srcstream,(HACMDRIVER)NULL,in_fmt,&priv.o_wf,NULL,0,0,0); - if(ret){ - if(ret==ACMERR_NOTPOSSIBLE) - MSG_ERR("ACM_Decoder: Unappropriate audio format\n"); - else - MSG_ERR("ACM_Decoder: acmStreamOpen error: %d", (int)ret); - priv.srcstream=0; - return 0; - } - MSG_V("Audio codec opened OK! ;-)\n"); - - acmStreamSize(priv.srcstream, in_fmt->nBlockAlign, (LPDWORD)&srcsize, ACM_STREAMSIZEF_SOURCE); - srcsize*=2; - //if(srcsize<MAX_OUTBURST) srcsize=MAX_OUTBURST; - if(!srcsize){ - MSG_WARN("Warning! ACM codec reports srcsize=0\n"); - srcsize=16384; - } - // limit srcsize to 4-16kb - //while(srcsize && srcsize<4096) srcsize*=2; - //while(srcsize>16384) srcsize/=2; - sh_audio->audio_out_minsize=srcsize; // audio output min. size - MSG_V("Audio ACM output buffer min. size: %ld\n",srcsize); - - acmStreamSize(priv.srcstream, srcsize, (LPDWORD)&srcsize, ACM_STREAMSIZEF_DESTINATION); - if(srcsize<in_fmt->nBlockAlign) srcsize=2*in_fmt->nBlockAlign; - sh_audio->audio_in_minsize=srcsize; // audio input min. size - MSG_V("Audio ACM input buffer min. size: %ld\n",srcsize); - sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; - sh_audio->nch=priv.o_wf.nChannels; - sh_audio->rate=priv.o_wf.nSamplesPerSec; - sh_audio->afmt=bps2afmt((priv.o_wf.wBitsPerSample+7)/8); - sh_audio->a_in_buffer_size=2*sh_audio->audio_in_minsize; - sh_audio->a_in_buffer=new char [sh_audio->a_in_buffer_size]; - sh_audio->a_in_buffer_len=0; - - return 1; -} - -static int close_acm_audio_codec(acm_private_t& priv) -{ - HRESULT ret; - - ret = acmStreamClose(priv.srcstream, 0); - - if (ret) - switch(ret) - { - case ACMERR_BUSY: - case ACMERR_CANCELED: - MSG_DBG2( "ACM_Decoder: stream busy, waiting..\n"); - sleep(100); - return close_acm_audio_codec(priv); - case ACMERR_UNPREPARED: - case ACMERR_NOTPOSSIBLE: - return 0; - default: - MSG_WARN( "ACM_Decoder: unknown error occured: %d\n", ret); - return 0; - } -/* MSACM_UnregisterAllDrivers();*/ - return 1; -} - -MPXP_Rc init(Opaque& ctx) -{ - acm_private_t& priv=static_cast<acm_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - float pts; - int ret=decode(priv,reinterpret_cast<unsigned char*>(sh_audio->a_buffer),4096,sh_audio->a_buffer_size,pts); - if(ret<0){ - MSG_INFO("ACM decoding error: %d\n",ret); - return MPXP_False; - } - sh_audio->a_buffer_len=ret; - return MPXP_Ok; -} - -Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh_audio,audio_filter_info_t& afi) -{ - UNUSED(probe); - UNUSED(afi); - /* Win32 ACM audio codec: */ - acm_private_t *priv; - if(!(priv=new(zeromem) acm_private_t)) return NULL; - priv->sh = sh_audio; - if(!init_acm_audio_codec(*priv)){ - MSG_ERR(MSGTR_ACMiniterror); - delete priv; - return NULL; - } - MSG_V("INFO: Win32/ACM init OK!\n"); - return priv; -} - -void uninit(Opaque& ctx) -{ - acm_private_t& priv=static_cast<acm_private_t&>(ctx); - close_acm_audio_codec(priv); -} - -MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...) -{ - acm_private_t& priv=static_cast<acm_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - int skip; - UNUSED(arg); - switch(cmd) { -// case ADCTRL_RESYNC_STREAM: -// sh_audio->a_in_buffer_len=0;/* reset ACM/DShow audio buffer */ -// return MPXP_True; - case ADCTRL_SKIP_FRAME: { - float pts; - skip=sh_audio->wf->nBlockAlign; - if(skip<16){ - skip=(sh_audio->wf->nAvgBytesPerSec/16)&(~7); - if(skip<16) skip=16; - } - demux_read_data_r(*sh_audio->ds,NULL,skip,pts); - return MPXP_True; - } - default: - return MPXP_Unknown; - } - return MPXP_Unknown; -} - -unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) -{ - acm_private_t& priv=static_cast<acm_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - ACMSTREAMHEADER ash; - HRESULT hr; - DWORD srcsize=0; - DWORD len=minlen; - - acmStreamSize(priv.srcstream,len , &srcsize, ACM_STREAMSIZEF_DESTINATION); - MSG_V("acm says: srcsize=%ld (bufflen=%d size=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,len); - - if(srcsize<sh_audio->wf->nBlockAlign){ - srcsize=sh_audio->wf->nBlockAlign; - acmStreamSize(priv.srcstream, srcsize, &len, ACM_STREAMSIZEF_SOURCE); - MSG_V("acm says: srcsize=%ld (bufflen=%d size=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,len); - if(len>maxlen) len=maxlen; - } - //if(srcsize==0) srcsize=priv.o_wf.nBlockAlign; - if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! - if(sh_audio->a_in_buffer_len<srcsize){ - int l; - l = demux_read_data_r(*sh_audio->ds,reinterpret_cast<unsigned char*>(&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len]), - srcsize-sh_audio->a_in_buffer_len,pts); - pts=FIX_APTS(sh_audio,pts,-sh_audio->a_in_buffer_len); - sh_audio->a_in_buffer_len+=l; - priv.pts=pts; - } - else pts=priv.pts; - /* !!! NK: FINALY WE MUST KNOW size of output buffer after a_in_buffer_len modifying !!!! */ - acmStreamSize(priv.srcstream,sh_audio->a_in_buffer_len, &len, ACM_STREAMSIZEF_SOURCE); - MSG_DBG2("acm convert %d -> %d bytes\n",sh_audio->a_in_buffer_len,len); - - memset(&ash, 0, sizeof(ash)); - ash.cbStruct=sizeof(ash); - ash.fdwStatus=0; - ash.dwUser=0; - ash.pbSrc=reinterpret_cast<BYTE*>(sh_audio->a_in_buffer); - ash.cbSrcLength=sh_audio->a_in_buffer_len; - ash.pbDst=buf; - ash.cbDstLength=len; - hr=acmStreamPrepareHeader(priv.srcstream,&ash,0); - if(hr){ - MSG_V("ACM_Decoder: acmStreamPrepareHeader error %d\n",(int)hr); - return -1; - } - hr=acmStreamConvert(priv.srcstream,&ash,0); - if(hr){ - MSG_DBG2("ACM_Decoder: acmStreamConvert error %d\n",(int)hr); - switch(hr) - { - case ACMERR_NOTPOSSIBLE: - case ACMERR_UNPREPARED: - MSG_DBG2( "ACM_Decoder: acmStreamConvert error: probarly not initialized!\n"); - } - } - MSG_DBG2("acm converted %d -> %d\n",ash.cbSrcLengthUsed,ash.cbDstLengthUsed); - if(ash.cbSrcLengthUsed>=sh_audio->a_in_buffer_len){ - sh_audio->a_in_buffer_len=0; - } else { - sh_audio->a_in_buffer_len-=ash.cbSrcLengthUsed; - memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[ash.cbSrcLengthUsed],sh_audio->a_in_buffer_len); - priv.pts=FIX_APTS(sh_audio,priv.pts,ash.cbSrcLengthUsed); - } - len=ash.cbDstLengthUsed; - hr=acmStreamUnprepareHeader(priv.srcstream,&ash,0); - if(hr){ - MSG_V("ACM_Decoder: acmStreamUnprepareHeader error %d\n",(int)hr); - } - return len; -} Deleted: mplayerxp/libmpcodecs/ad_dmo.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dmo.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_dmo.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,133 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <dlfcn.h> - -#include "codecs_ld.h" - -#include "mplayerxp.h" -#include "mpxp_help.h" -#include "ad_internal.h" -#include "ad_msg.h" - -static const ad_info_t info = { - "Win32/DMO decoders", - "dmo", - "A'rpi", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(dmo) - -#include "win32loader/dmo/DMO_AudioDecoder.h" - -struct admo_private_t : public Opaque { - admo_private_t(); - virtual ~admo_private_t(); - - float pts; - DMO_AudioDecoder* ds_adec; - sh_audio_t* sh; -}; -admo_private_t::admo_private_t() {} -admo_private_t::~admo_private_t() { - DMO_AudioDecoder_Destroy(ds_adec); -} - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -static MPXP_Rc init(admo_private_t *p) -{ - UNUSED(p); - return MPXP_Ok; -} - -static Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh_audio,audio_filter_info_t& afi) -{ - UNUSED(probe); - UNUSED(afi); - admo_private_t*priv; - int chans=(mp_conf.ao_channels==sh_audio->wf->nChannels) ? - mp_conf.ao_channels : (sh_audio->wf->nChannels>=2 ? 2 : 1); - if(!(priv=new(zeromem) admo_private_t)) return NULL; - priv->sh=sh_audio; - if(!(priv->ds_adec=DMO_AudioDecoder_Open(sh_audio->codec->dll_name,&sh_audio->codec->guid,sh_audio->wf,chans))) { - MSG_ERR(MSGTR_MissingDLLcodec,sh_audio->codec->dll_name); - delete priv; - return NULL; - } - sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; - sh_audio->nch=chans; - sh_audio->rate=sh_audio->wf->nSamplesPerSec; - sh_audio->audio_in_minsize=4*sh_audio->wf->nBlockAlign; - if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192; - sh_audio->audio_out_minsize=4*16384; - MSG_V("INFO: Win32/DMO audio codec init OK!\n"); - return priv; -} - -static void uninit(Opaque& ctx) { UNUSED(ctx); } - -static MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...) -{ - admo_private_t& priv=static_cast<admo_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - int skip; - UNUSED(arg); - switch(cmd) { - case ADCTRL_SKIP_FRAME: { - float pts; - skip=sh_audio->wf->nBlockAlign; - if(skip<16){ - skip=(sh_audio->wf->nAvgBytesPerSec/16)&(~7); - if(skip<16) skip=16; - } - demux_read_data_r(*sh_audio->ds,NULL,skip,pts); - return MPXP_True; - } - } - return MPXP_Unknown; -} - -static unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) -{ - admo_private_t& priv=static_cast<admo_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - unsigned len=0; - UNUSED(minlen); - { - unsigned size_in=0; - unsigned size_out=0; - unsigned srcsize=DMO_AudioDecoder_GetSrcSize(priv.ds_adec, maxlen); - MSG_DBG2("DMO says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); - if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! - if((unsigned)sh_audio->a_in_buffer_len<srcsize){ - unsigned l; - l=demux_read_data_r(*sh_audio->ds,reinterpret_cast<unsigned char*>(&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len]), - srcsize-sh_audio->a_in_buffer_len,pts); - sh_audio->a_in_buffer_len+=l; - priv.pts=pts; - } - else pts=priv.pts; - DMO_AudioDecoder_Convert(priv.ds_adec, sh_audio->a_in_buffer,sh_audio->a_in_buffer_len, - buf,maxlen, &size_in,&size_out); - MSG_DBG2("DMO: audio %d -> %d converted (in_buf_len=%d of %d) %f\n" - ,size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,pts); - if(size_in>=(unsigned)sh_audio->a_in_buffer_len){ - sh_audio->a_in_buffer_len=0; - } else { - sh_audio->a_in_buffer_len-=size_in; - memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); - priv.pts=FIX_APTS(sh_audio,priv.pts,size_in); - } - len=size_out; - } - return len; -} Deleted: mplayerxp/libmpcodecs/ad_dshow.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dshow.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_dshow.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,131 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" -#include "mpxp_help.h" -#include "win32loader/dshow/DS_AudioDecoder.h" -#include "codecs_ld.h" - -static const ad_info_t info = { - "Win32/DirectShow decoders", - "dshow", - "Nickols_K", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(dshow) - -struct adshow_private_t : public Opaque { - adshow_private_t(); - virtual ~adshow_private_t(); - - float pts; - DS_AudioDecoder* ds_adec; - sh_audio_t* sh; -}; -adshow_private_t::adshow_private_t() {} -adshow_private_t::~adshow_private_t() { - DS_AudioDecoder_Destroy(ds_adec); -} - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -MPXP_Rc init(Opaque& ctx) -{ - UNUSED(ctx); - return MPXP_Ok; -} - -Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh_audio,audio_filter_info_t& afi) -{ - UNUSED(probe); - UNUSED(afi); - adshow_private_t *priv; - if(!(priv=new(zeromem) adshow_private_t)) return NULL; - priv->sh = sh_audio; - if(!(priv->ds_adec=DS_AudioDecoder_Open(sh_audio->codec->dll_name,&sh_audio->codec->guid,sh_audio->wf))) { - MSG_ERR(MSGTR_MissingDLLcodec,sh_audio->codec->dll_name); - delete priv; - return NULL; - } - sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; - sh_audio->nch=sh_audio->wf->nChannels; - sh_audio->rate=sh_audio->wf->nSamplesPerSec; - sh_audio->audio_in_minsize=2*sh_audio->wf->nBlockAlign; - if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192; - sh_audio->audio_out_minsize=16384; - MSG_V("INFO: Win32/DShow init OK!\n"); - return priv; -} - -void uninit(Opaque& ctx) { UNUSED(ctx); } - - -MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...) -{ - adshow_private_t& priv=static_cast<adshow_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - int skip; - UNUSED(arg); - switch(cmd) { - case ADCTRL_RESYNC_STREAM: - sh_audio->a_in_buffer_len=0; // reset ACM/DShow audio buffer - return MPXP_True; - case ADCTRL_SKIP_FRAME: { - float pts; - skip=sh_audio->wf->nBlockAlign; - if(skip<16){ - skip=(sh_audio->wf->nAvgBytesPerSec/16)&(~7); - if(skip<16) skip=16; - } - demux_read_data_r(*sh_audio->ds,NULL,skip,pts); - } - return MPXP_True; - default: - return MPXP_Unknown; - } - return MPXP_Unknown; -} - -unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) -{ - adshow_private_t& priv=static_cast<adshow_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - unsigned len=0; - UNUSED(minlen); - { unsigned size_in=0; - unsigned size_out=0; - unsigned srcsize=DS_AudioDecoder_GetSrcSize(priv.ds_adec, maxlen); - MSG_DBG3("DShow says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); - if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! - if((unsigned)sh_audio->a_in_buffer_len<srcsize){ - unsigned l; - l=demux_read_data_r(*sh_audio->ds,reinterpret_cast<unsigned char*>(&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len]), - srcsize-sh_audio->a_in_buffer_len,pts); - sh_audio->a_in_buffer_len+=l; - priv.pts=pts; - } - else pts=priv.pts; - DS_AudioDecoder_Convert(priv.ds_adec, reinterpret_cast<unsigned char*>(sh_audio->a_in_buffer),sh_audio->a_in_buffer_len, - buf,maxlen, &size_in,&size_out); - MSG_DBG2("DShow: audio %d -> %d converted (in_buf_len=%d of %d) %f\n" - ,size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,pts); - if(size_in>=(unsigned)sh_audio->a_in_buffer_len){ - sh_audio->a_in_buffer_len=0; - } else { - sh_audio->a_in_buffer_len-=size_in; - memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); - priv.pts=FIX_APTS(sh_audio,priv.pts,size_in); - } - len=size_out; - } - return len; -} Deleted: mplayerxp/libmpcodecs/ad_qtaudio.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_qtaudio.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_qtaudio.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,331 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <inttypes.h> -#include <dlfcn.h> - -#include "ad_internal.h" -#include "osdep/bswap.h" -#include "codecs_ld.h" -#include "mplayerxp.h" -#include "libao3/afmt.h" -#ifdef WIN32_LOADER -#include "win32loader/ldt_keeper.h" -#endif - -#ifdef MACOSX -#include <QuickTime/QuickTimeComponents.h> -#endif - -static const ad_info_t info = { - "QuickTime Audio Decoder", - "qtaudio", - "A'rpi & Sascha Sommer", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(qtaudio) - - -typedef struct OpaqueSoundConverter* SoundConverter; -typedef unsigned long OSType; -typedef unsigned long UnsignedFixed; -typedef uint8_t Byte; -typedef struct SoundComponentData { - long flags; - OSType format; - short numChannels; - short sampleSize; - UnsignedFixed sampleRate; - long sampleCount; - Byte* buffer; - long reserved; -}SoundComponentData; - -typedef int (__cdecl* LPFUNC1)(long flag); -typedef int (__cdecl* LPFUNC2)(const SoundComponentData *, const SoundComponentData *,SoundConverter *); -typedef int (__cdecl* LPFUNC3)(SoundConverter sc); -typedef int (__cdecl* LPFUNC4)(void); -typedef int (__cdecl* LPFUNC5)(SoundConverter sc, OSType selector,any_t* infoPtr); -typedef int (__cdecl* LPFUNC6)(SoundConverter sc, - unsigned long inputBytesTarget, - unsigned long *inputFrames, - unsigned long *inputBytes, - unsigned long *outputBytes ); -typedef int (__cdecl* LPFUNC7)(SoundConverter sc, - const any_t*inputPtr, - unsigned long inputFrames, - any_t*outputPtr, - unsigned long *outputFrames, - unsigned long *outputBytes ); -typedef int (__cdecl* LPFUNC8)(SoundConverter sc, - any_t*outputPtr, - unsigned long *outputFrames, - unsigned long *outputBytes); -typedef int (__cdecl* LPFUNC9)(SoundConverter sc); - -static HINSTANCE qtml_dll; -static LPFUNC1 InitializeQTML; -static LPFUNC2 SoundConverterOpen; -static LPFUNC3 SoundConverterClose; -static LPFUNC4 TerminateQTML; -static LPFUNC5 SoundConverterSetInfo; -static LPFUNC6 SoundConverterGetBufferSizes; -static LPFUNC7 SoundConverterConvertBuffer; -static LPFUNC8 SoundConverterEndConversion; -static LPFUNC9 SoundConverterBeginConversion; - -#define siDecompressionParams 2002876005 // siDecompressionParams = FOUR_CHAR_CODE('wave') - -HMODULE WINAPI LoadLibraryA(LPCSTR); -FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); -int WINAPI FreeLibrary(HMODULE); - -static int loader_init() -{ -#ifdef WIN32_LOADER - Setup_LDT_Keeper(); -#endif - qtml_dll = LoadLibraryA((LPCSTR)"qtmlClient.dll"); - if( !qtml_dll ) { - MSG_ERR("failed loading dll\n" ); - return 1; - } -#if 1 - InitializeQTML = (LPFUNC1)GetProcAddress(qtml_dll,(LPCSTR)"InitializeQTML"); - if ( InitializeQTML == NULL ) { - MSG_ERR("failed geting proc address InitializeQTML\n"); - return 1; - } - SoundConverterOpen = (LPFUNC2)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterOpen"); - if ( SoundConverterOpen == NULL ) { - MSG_ERR("failed getting proc address SoundConverterOpen\n"); - return 1; - } - SoundConverterClose = (LPFUNC3)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterClose"); - if ( SoundConverterClose == NULL ) { - MSG_ERR("failed getting proc address SoundConverterClose\n"); - return 1; - } - TerminateQTML = (LPFUNC4)GetProcAddress(qtml_dll,(LPCSTR)"TerminateQTML"); - if ( TerminateQTML == NULL ) { - MSG_ERR("failed getting proc address TerminateQTML\n"); - return 1; - } - SoundConverterSetInfo = (LPFUNC5)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterSetInfo"); - if ( SoundConverterSetInfo == NULL ) { - MSG_ERR("failed getting proc address SoundConverterSetInfo\n"); - return 1; - } - SoundConverterGetBufferSizes = (LPFUNC6)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterGetBufferSizes"); - if ( SoundConverterGetBufferSizes == NULL ) { - MSG_ERR("failed getting proc address SoundConverterGetBufferSizes\n"); - return 1; - } - SoundConverterConvertBuffer = (LPFUNC7)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterConvertBuffer"); - if ( SoundConverterConvertBuffer == NULL ) { - MSG_ERR("failed getting proc address SoundConverterConvertBuffer1\n"); - return 1; - } - SoundConverterEndConversion = (LPFUNC8)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterEndConversion"); - if ( SoundConverterEndConversion == NULL ) { - MSG_ERR("failed getting proc address SoundConverterEndConversion\n"); - return 1; - } - SoundConverterBeginConversion = (LPFUNC9)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterBeginConversion"); - if ( SoundConverterBeginConversion == NULL ) { - MSG_ERR("failed getting proc address SoundConverterBeginConversion\n"); - return 1; - } - MSG_V("Standard init done you may now call supported functions\n"); -#endif - MSG_V("loader_init DONE???\n"); - return 0; -} - -static SoundConverter myConverter = NULL; -static SoundComponentData InputFormatInfo,OutputFormatInfo; - -static int InFrameSize; -static int OutFrameSize; - -struct qta_private_t : public Opaque { - qta_private_t(); - virtual ~qta_private_t(); - - sh_audio_t* sh; -}; - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -static Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh,audio_filter_info_t& afi){ - UNUSED(probe); - UNUSED(afi); - int error; - unsigned long FramesToGet=0; //how many frames the demuxer has to get - unsigned long InputBufferSize=0; //size of the input buffer - unsigned long OutputBufferSize=0; //size of the output buffer - unsigned long WantedBufferSize=0; //the size you want your buffers to be - - if(mp_conf.s_cache_size) { - MSG_FATAL("Disabling sound:\nwin32 quicktime DLLs must be initialized in single-threaded mode! Try -nocache\n"); - return NULL; - } - MSG_INFO("win32 libquicktime loader (c) Sascha Sommer\n"); - -#ifdef MACOSX - EnterMovies(); -#else - if(loader_init()) return NULL; // failed to load DLL - - MSG_V("loader_init DONE!\n"); - - error = InitializeQTML(6+16); - MSG_ERR("InitializeQTML:%i\n",error); - if(error) return NULL; -#endif - -#if 1 - OutputFormatInfo.flags = InputFormatInfo.flags = 0; - OutputFormatInfo.sampleCount = InputFormatInfo.sampleCount = 0; - OutputFormatInfo.buffer = InputFormatInfo.buffer = NULL; - OutputFormatInfo.reserved = InputFormatInfo.reserved = 0; - OutputFormatInfo.numChannels = InputFormatInfo.numChannels = sh->wf->nChannels; - InputFormatInfo.sampleSize = sh->wf->wBitsPerSample; - OutputFormatInfo.sampleSize = 16; - OutputFormatInfo.sampleRate = InputFormatInfo.sampleRate = sh->wf->nSamplesPerSec; - InputFormatInfo.format = bswap_32(sh->wtag); //1363430706;///*1768775988;//*/1902406962;//qdm2//1768775988;//FOUR_CHAR_CODE('ima4'); - OutputFormatInfo.format = 1313820229;// FOUR_CHAR_CODE('NONE'); - - error = SoundConverterOpen(&InputFormatInfo, &OutputFormatInfo, &myConverter); - MSG_V("SoundConverterOpen:%i\n",error); - if(error) return NULL; - - if(sh->codecdata){ - error = SoundConverterSetInfo(myConverter,siDecompressionParams,sh->codecdata); - MSG_V("SoundConverterSetInfo:%i\n",error); -// if(error) return 0; - } - - WantedBufferSize=OutputFormatInfo.numChannels*OutputFormatInfo.sampleRate*2; - error = SoundConverterGetBufferSizes(myConverter, - WantedBufferSize,&FramesToGet,&InputBufferSize,&OutputBufferSize); - MSG_V("SoundConverterGetBufferSizes:%i\n",error); - MSG_V("WantedBufferSize = %li\n",WantedBufferSize); - MSG_V("InputBufferSize = %li\n",InputBufferSize); - MSG_V("OutputBufferSize = %li\n",OutputBufferSize); - MSG_V("FramesToGet = %li\n",FramesToGet); - - InFrameSize=(InputBufferSize+FramesToGet-1)/FramesToGet; - OutFrameSize=OutputBufferSize/FramesToGet; - - MSG_V("FrameSize: %i -> %i\n",InFrameSize,OutFrameSize); - - error = SoundConverterBeginConversion(myConverter); - MSG_V("SoundConverterBeginConversion:%i\n",error); - if(error) return NULL; - - sh->audio_out_minsize=OutputBufferSize; - sh->audio_in_minsize=InputBufferSize; - - sh->nch=sh->wf->nChannels; - sh->rate=sh->wf->nSamplesPerSec; - sh->afmt=bps2afmt(2); //(sh->wf->wBitsPerSample+7)/8; - - sh->i_bps=sh->wf->nAvgBytesPerSec; -//InputBufferSize*WantedBufferSize/OutputBufferSize; - -#endif - qta_private_t* priv = new(zeromem) qta_private_t; - priv->sh = sh; - return priv; // return values: 1=OK 0=ERROR -} - -static MPXP_Rc init(Opaque& ctx) -{ - UNUSED(ctx); - return MPXP_Ok; // return values: 1=OK 0=ERROR -} - -static void uninit(Opaque& ctx){ - qta_private_t& priv=static_cast<qta_private_t&>(ctx); - sh_audio_t* sh = priv.sh; - int error; - unsigned long ConvertedFrames=0; - unsigned long ConvertedBytes=0; - UNUSED(sh); - error=SoundConverterEndConversion(myConverter,NULL,&ConvertedFrames,&ConvertedBytes); - MSG_V("SoundConverterEndConversion:%i\n",error); - error = SoundConverterClose(myConverter); - MSG_V("SoundConverterClose:%i\n",error); -// error = TerminateQTML(); -// MSG_V("TerminateQTML:%i\n",error); -// FreeLibrary( qtml_dll ); -// qtml_dll = NULL; -// printf("qt dll loader uninit done\n"); -#ifdef MACOSX - ExitMovies(); -#endif -} - -static unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts){ - qta_private_t& priv=static_cast<qta_private_t&>(ctx); - sh_audio_t* sh = priv.sh; - int error; - unsigned long FramesToGet=0; //how many frames the demuxer has to get - unsigned long InputBufferSize=0; //size of the input buffer - unsigned long ConvertedFrames=0; - unsigned long ConvertedBytes=0; - - FramesToGet=minlen/OutFrameSize; - if(FramesToGet*OutFrameSize<minlen && - (FramesToGet+1)*OutFrameSize<=maxlen) ++FramesToGet; - if(FramesToGet*InFrameSize>sh->a_in_buffer_size) - FramesToGet=sh->a_in_buffer_size/InFrameSize; - - InputBufferSize=FramesToGet*InFrameSize; - -// printf("FramesToGet = %li (%li -> %li bytes)\n",FramesToGet, -// InputBufferSize, FramesToGet*OutFrameSize); - - if(InputBufferSize>(unsigned)sh->a_in_buffer_len){ - int x=demux_read_data_r(*sh->ds,reinterpret_cast<unsigned char*>(&sh->a_in_buffer[sh->a_in_buffer_len]), - InputBufferSize-sh->a_in_buffer_len,pts); - if(x>0) sh->a_in_buffer_len+=x; - if(InputBufferSize>(unsigned)sh->a_in_buffer_len) - FramesToGet=sh->a_in_buffer_len/InFrameSize; // not enough data! - } - -// printf("\nSoundConverterConvertBuffer(myConv=%p,inbuf=%p,frames=%d,outbuf=%p,&convframes=%p,&convbytes=%p)\n", -// myConverter,sh->a_in_buffer,FramesToGet,buf,&ConvertedFrames,&ConvertedBytes); - error = SoundConverterConvertBuffer(myConverter,sh->a_in_buffer, - FramesToGet,buf,&ConvertedFrames,&ConvertedBytes); -// printf("SoundConverterConvertBuffer:%i\n",error); -// printf("ConvertedFrames = %li\n",ConvertedFrames); -// printf("ConvertedBytes = %li\n",ConvertedBytes); - -// InputBufferSize=(ConvertedBytes/OutFrameSize)*InFrameSize; // FIXME!! - InputBufferSize=FramesToGet*InFrameSize; - sh->a_in_buffer_len-=InputBufferSize; - if(sh->a_in_buffer_len<0) sh->a_in_buffer_len=0; // should not happen... - else if(sh->a_in_buffer_len>0){ - memcpy(sh->a_in_buffer,&sh->a_in_buffer[InputBufferSize],sh->a_in_buffer_len); - } - - return ConvertedBytes; -} - -static MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...){ - // various optional functions you MAY implement: - UNUSED(ctx); - UNUSED(cmd); - UNUSED(arg); - return MPXP_Unknown; -} Deleted: mplayerxp/libmpcodecs/ad_twin.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_twin.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_twin.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,644 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdexcept> - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" -#include "codecs_ld.h" -#include "win32loader/ldt_keeper.h" -#include "win32loader/wine/windef.h" -#include "libao3/afmt.h" -#include "libmpdemux/aviprint.h" -#include "mpxp_help.h" - -static const ad_info_t info = { - "TWinVQ decoder", - "vqf", - "Nickols_K", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(twin) - - -/************************/ -/*** General settings ***/ -/************************/ -/* Initialization error code */ -enum INIT_ERROR_CODE { - TVQ_NO_ERROR = 0, // no error - TVQ_ERROR, // general - TVQ_ERROR_VERSION, // wrong version - TVQ_ERROR_CHANNEL, // channel setting error - TVQ_ERROR_MODE, // wrong coding mode - TVQ_ERROR_PARAM, // inner parameter setting error - TVQ_ERROR_N_CAN, // wrong number of VQ pre-selection candidates, used only in encoder -}; - -/* version ID */ -#define TVQ_UNKNOWN_VERSION -1 -#define V2 0 -#define V2PP 1 - -#define N_VERSIONS 2 - -/* window types */ -enum WINDOW_TYPE { - ONLY_LONG_WINDOW = 0, - LONG_SHORT_WINDOW, - ONLY_SHORT_WINDOW, - SHORT_LONG_WINDOW, - SHORT_MEDIUM_WINDOW, - MEDIUM_LONG_WINDOW, - LONG_MEDIUM_WINDOW, - MEDIUM_SHORT_WINDOW, - ONLY_MEDIUM_WINDOW, -}; - -/* block types */ -enum BLOCK_TYPE { - BLK_SHORT = 0, - BLK_MEDIUM, - BLK_LONG, - BLK_PPC, -}; -#define N_BTYPE 3 // number of block types -#define N_INTR_TYPE 4 // number of interleave types, enum BLOCK_TYPE is commonly used for detecting interleave types. - -/* maximum number of channels */ -#define N_CH_MAX 2 - -/* type definition of code information interface */ -typedef struct { - /* block type */ - int w_type; - int btype; - /* FBC info */ - int *segment_sw[ N_CH_MAX ]; - int *band_sw[ N_CH_MAX ]; - int *fg_intensity[ N_CH_MAX ]; - /* VQ info */ - int *wvq; - /* BSE info */ - int *fw; - int *fw_alf; - /* gain info */ - int *pow; - /* LSP info */ - int *lsp[ N_CH_MAX ]; - /* PPC info */ - int pit[ N_CH_MAX ]; - int *pls; - int pgain[ N_CH_MAX ]; - /* EBC info */ - int *bc[ N_CH_MAX ]; - any_t*manager; -} INDEX; - -/***********************************************/ -/*** Definitions about program configuration ***/ -/***********************************************/ -/* type definition of tvqConfInfoSubBlock */ -typedef struct { - int sf_sz; // subframe size - int nsf; // number of subframes - int ndiv; // number of division of weighted interleave vector quantization - int ncrb; // number of Bark-scale subbands - int fw_ndiv; // number of division of BSE VQ - int fw_nbit; // number of bits for BSE VQ - int nsubg; // number of sub-blocks for gain coding - int ppc_enable; // PPC switch - int ebc_enable; // EBC switch - int ebc_crb_base; // EBC base band - int ebc_bits; // EBC bits - int fbc_enable; // FBC switch - int fbc_n_segment; // FBC number of segments - int fbc_nband; // FBC number of subbands - int *fbc_crb_tbl; // FBC subband table -} tvqConfInfoSubBlock; - -/* type definition of tvqConfInfo */ -typedef struct { - /* frame configuration */ - int N_CH; - /* window type coding */ - int BITS_WTYPE; - /* LSP coding */ - int LSP_BIT0; - int LSP_BIT1; - int LSP_BIT2; - int LSP_SPLIT; - /* Bark-scale envelope coding */ - int FW_ARSW_BITS; - /* gain coding */ - int GAIN_BITS; - int SUB_GAIN_BITS; - /* pitch excitation */ - int N_DIV_P; - int BASF_BIT; - int PGAIN_BIT; - /* block type dependent parameters */ - tvqConfInfoSubBlock cfg[N_BTYPE]; -} tvqConfInfo; - -#define KEYWORD_BYTES 4 -#define VERSION_BYTES 8 -#define ELEM_BYTES sizeof(unsigned long) -/* - */ -typedef struct{ - char ID[KEYWORD_BYTES+VERSION_BYTES+1]; - int size; - /* Common Chunk */ - int channelMode; /* channel mode (mono:0/stereo:1) */ - int bitRate; /* bit rate (kbit/s) */ - int samplingRate; /* sampling rate (44.1 kHz -> 44) */ - int securityLevel; /* security level (always 0) */ - /* Text Chunk */ - char Name[BUFSIZ]; - char Comt[BUFSIZ]; - char Auth[BUFSIZ]; - char Cpyr[BUFSIZ]; - char File[BUFSIZ]; - char Extr[BUFSIZ]; // add by OKAMOTO 99.12.21 - /* Data size chunk*/ - int Dsiz; -} headerInfo; - -extern HMODULE WINAPI LoadLibraryA(LPCSTR); -extern FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); -extern int WINAPI FreeLibrary(HMODULE); - -static int (__cdecl* TvqInitialize_ptr)( headerInfo *setupInfo, INDEX *index, int dispErrorMessageBox ); -#define TvqInitialize(a,b,c) (*TvqInitialize_ptr)(a,b,c) -static void (__cdecl* TvqTerminate_ptr)( INDEX *index ); -#define TvqTerminate(a) (*TvqTerminate_ptr)(a) -static void (__cdecl* TvqGetVectorInfo_ptr)(int *bits0[], int *bits1[]); -#define TvqGetVectorInfo(a,b) (*TvqGetVectorInfo_ptr)(a,b) - -static void (__cdecl* TvqDecodeFrame_ptr)(INDEX *indexp, float out[]); -#define TvqDecodeFrame(a,b) (*TvqDecodeFrame_ptr)(a,b) -static int (__cdecl* TvqWtypeToBtype_ptr)( int w_type, int *btype ); -#define TvqWtypeToBtype(a,b) (*TvqWtypeToBtype_ptr)(a,b) -static void (__cdecl* TvqUpdateVectorInfo_ptr)(int varbits, int *ndiv, int bits0[], int bits1[]); -#define TvqUpdateVectorInfo(a,b,c,d) (*TvqUpdateVectorInfo_ptr)(a,b,c,d) - -static int (__cdecl* TvqCheckVersion_ptr)(char *versionID); -#define TvqCheckVersion(a) (*TvqCheckVersion_ptr)(a) -static void (__cdecl* TvqGetConfInfo_ptr)(tvqConfInfo *cf); -#define TvqGetConfInfo(a) (*TvqGetConfInfo_ptr)(a) -static int (__cdecl* TvqGetFrameSize_ptr)(); -#define TvqGetFrameSize() (*TvqGetFrameSize_ptr)() -static int (__cdecl* TvqGetNumFixedBitsPerFrame_ptr)(); -#define TvqGetNumFixedBitsPerFrame() (*TvqGetNumFixedBitsPerFrame_ptr)() - -#define BYTE_BIT 8 -#define BBUFSIZ 1024 /* Bit buffer size (bytes) */ -#define BBUFLEN (BBUFSIZ*BYTE_BIT) /* Bit buffer length (bits) */ -struct twin_private_t : public Opaque { - twin_private_t(); - virtual ~twin_private_t(); - - float pts; - WAVEFORMATEX o_wf; // out format - INDEX index; - tvqConfInfo cf; - headerInfo hi; - int *bits_0[N_INTR_TYPE], *bits_1[N_INTR_TYPE]; - unsigned framesize; - /* stream related */ - int readable; - int ptr; /* current point in the bit buffer */ - int nbuf; /* bit buffer size */ - char buf[BBUFSIZ]; /* the bit buffer */ - sh_audio_t* sh; -}; -twin_private_t::twin_private_t() {} -twin_private_t::~twin_private_t() {} - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -static HINSTANCE vqf_dll; - -static int load_dll( const char *libname ) -{ -#ifdef WIN32_LOADER - Setup_LDT_Keeper_ptr(); -#endif - vqf_dll = LoadLibraryA((LPCSTR)libname); - if( vqf_dll == NULL ) { - MSG_ERR("failed loading dll\n" ); - return 0; - } - TvqInitialize_ptr = (int (*)(headerInfo*,INDEX*,int))GetProcAddress(vqf_dll,(LPCSTR)"TvqInitialize"); - TvqTerminate_ptr = (void (*)(INDEX*))GetProcAddress(vqf_dll,(LPCSTR)"TvqTerminate"); - TvqGetVectorInfo_ptr = (void (*)(int**,int**))GetProcAddress(vqf_dll,(LPCSTR)"TvqGetVectorInfo"); - TvqDecodeFrame_ptr = (void (*)(INDEX*,float*))GetProcAddress(vqf_dll,(LPCSTR)"TvqDecodeFrame"); - TvqWtypeToBtype_ptr = (int (*)(int,int*))GetProcAddress(vqf_dll,(LPCSTR)"TvqWtypeToBtype"); - TvqUpdateVectorInfo_ptr = (void (*)(int,int*,int*,int*))GetProcAddress(vqf_dll,(LPCSTR)"TvqUpdateVectorInfo"); - TvqCheckVersion_ptr = (int (*)(char*))GetProcAddress(vqf_dll,(LPCSTR)"TvqCheckVersion"); - TvqGetConfInfo_ptr = (void (*)(tvqConfInfo*))GetProcAddress(vqf_dll,(LPCSTR)"TvqGetConfInfo"); - TvqGetFrameSize_ptr = (int (*)())GetProcAddress(vqf_dll,(LPCSTR)"TvqGetFrameSize"); - TvqGetNumFixedBitsPerFrame_ptr = (int (*)())GetProcAddress(vqf_dll,(LPCSTR)"TvqGetNumFixedBitsPerFrame"); - return TvqInitialize_ptr && TvqTerminate_ptr && TvqGetVectorInfo_ptr && - TvqDecodeFrame_ptr && TvqWtypeToBtype_ptr && TvqUpdateVectorInfo_ptr && - TvqCheckVersion_ptr && TvqGetConfInfo_ptr && TvqGetFrameSize_ptr && - TvqGetNumFixedBitsPerFrame_ptr; -} - -static int init_vqf_audio_codec(twin_private_t& priv){ - sh_audio_t* sh_audio = priv.sh; - WAVEFORMATEX *in_fmt=sh_audio->wf; - int ver; - MSG_V("======= Win32 (TWinVQ) AUDIO Codec init =======\n"); - - priv.o_wf.nChannels=in_fmt->nChannels; - priv.o_wf.nSamplesPerSec=in_fmt->nSamplesPerSec; - priv.o_wf.nAvgBytesPerSec=in_fmt->nSamplesPerSec; - priv.o_wf.wFormatTag=0x01; - priv.o_wf.nBlockAlign=4*in_fmt->nChannels; - priv.o_wf.wBitsPerSample=in_fmt->wBitsPerSample; - priv.o_wf.cbSize=0; - sh_audio->nch=in_fmt->nChannels; - sh_audio->rate=in_fmt->nSamplesPerSec; - sh_audio->afmt=AFMT_FLOAT32; - - if(mp_conf.verbose) { - MSG_V("Input format:\n"); - print_wave_header(in_fmt,sizeof(WAVEFORMATEX)); - MSG_V("Output fmt:\n"); - print_wave_header(&priv.o_wf,sizeof(WAVEFORMATEX)); - } - memcpy(&priv.hi,&in_fmt[1],sizeof(headerInfo)); - if((ver=TvqInitialize(&priv.hi,&priv.index,0))){ - const char *tvqe[]={ - "No errors", - "General error", - "Wrong version", - "Channel setting error", - "Wrong coding mode", - "Inner parameter setting error", - "Wrong number of VQ pre-selection candidates, used only in encoder" }; - MSG_ERR("Tvq initialization error: %s\n",ver>=0&&ver<7?tvqe[ver]:"Unknown"); - return 0; - } - ver=TvqCheckVersion(priv.hi.ID); - if(ver==TVQ_UNKNOWN_VERSION){ - MSG_ERR("Tvq unknown version of stream\n" ); - return 0; - } - TvqGetConfInfo(&priv.cf); - TvqGetVectorInfo(priv.bits_0,priv.bits_1); - priv.framesize=TvqGetFrameSize(); - sh_audio->audio_in_minsize=priv.framesize*in_fmt->nChannels; - sh_audio->a_in_buffer_size=4*sh_audio->audio_in_minsize; - sh_audio->a_in_buffer=new char [sh_audio->a_in_buffer_size]; - sh_audio->a_in_buffer_len=0; - - return 1; -} - -static int close_vqf_audio_codec(twin_private_t& priv) -{ - TvqTerminate(&priv.index); - return 1; -} - -MPXP_Rc init(Opaque& ctx) -{ - UNUSED(ctx); - return MPXP_Ok; -} - -Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh_audio,audio_filter_info_t& afi) -{ - UNUSED(afi); - /* Win32 VQF audio codec: */ - twin_private_t *priv; - if(!(priv=new(zeromem) twin_private_t)) return NULL; - priv->sh = sh_audio; - if(!load_dll(probe.codec_dll)) { - MSG_ERR("win32.dll looks broken :(\n"); - delete priv; - return NULL; - } - if(!init_vqf_audio_codec(*priv)){ - MSG_ERR("TWinVQ initialization fail\n"); - delete priv; - return NULL; - } - MSG_V("INFO: TWinVQ audio codec init OK!\n"); - return priv; -} - -void uninit(Opaque& ctx) -{ - twin_private_t& priv=static_cast<twin_private_t&>(ctx); - close_vqf_audio_codec(priv); - FreeLibrary(vqf_dll); -} - -MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...) -{ - twin_private_t& priv=static_cast<twin_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - int skip; - UNUSED(arg); - switch(cmd) { - case ADCTRL_SKIP_FRAME: { - float pts; - skip=sh_audio->wf->nBlockAlign; - if(skip<16){ - skip=(sh_audio->wf->nAvgBytesPerSec/16)&(~7); - if(skip<16) skip=16; - } - demux_read_data_r(*sh_audio->ds,NULL,skip,pts); - return MPXP_True; - } - default: - return MPXP_Unknown; - } - return MPXP_Unknown; -} - -static int bread(char *data, /* Output: Output data array */ - int size, /* Input: Length of each data */ - int nbits, /* Input: Number of bits to write */ - twin_private_t &priv, /* Input: File pointer */ - float &pts) -{ - /*--- Variables ---*/ - int ibits, iptr, idata, ibufadr, ibufbit, icl; - unsigned char mask, tmpdat; - int retval; - sh_audio_t* sh = priv.sh; - - /*--- Main operation ---*/ - retval = 0; - mask = 0x1; - for ( ibits=0; ibits<nbits; ibits++ ){ - if ( priv.readable == 0 ){ /* when the file data buffer is empty */ - priv.nbuf = demux_read_data_r(*sh->ds, reinterpret_cast<unsigned char*>(priv.buf), BBUFSIZ, priv.pts); - priv.nbuf *= 8; - priv.readable = 1; - } - pts=FIX_APTS(sh,priv.pts,priv.ptr); - iptr = priv.ptr; /* current file data buffer pointer */ - if ( iptr >= priv.nbuf ) /* If data file is empty then return */ - return retval; - ibufadr = iptr/BYTE_BIT; /* current file data buffer address */ - ibufbit = iptr%BYTE_BIT; /* current file data buffer bit */ - /* tmpdat = stream->buf[ibufadr] >> (BYTE_BIT-ibufbit-1); */ - tmpdat = (unsigned char)priv.buf[ibufadr]; - tmpdat >>= (BYTE_BIT-ibufbit-1); - /* current data bit */ - - idata = ibits*size; /* output data address */ - data[idata] = (char)(tmpdat & mask); /* set output data */ - for (icl=1; icl<size; icl++) - data[idata+icl] = 0; /* clear the rest output data buffer */ - priv.ptr += 1; /* update data buffer pointer */ - if (priv.ptr == BBUFLEN){ - priv.ptr = 0; - priv.readable = 0; - } - ++retval; - } - return retval; -} - -static const int BITS_INT=(sizeof(int)*8); - -static int get_bstm(int *data, /* Input: input data */ - unsigned nbits, /* Input: number of bits */ - twin_private_t& priv, /* Input: bit file pointer */ - float& pts) -{ - unsigned ibit; - unsigned mask; - unsigned work; - char tmpbit[BITS_INT]; - int retval; - - if ( nbits > BITS_INT ) throw std::runtime_error("get_bstm(): falied"); - - retval = bread(tmpbit, sizeof(*tmpbit), nbits, priv, pts ); - for (ibit=retval; ibit<nbits; ibit++){ - tmpbit[ibit] = 0; - } - mask = 0x1<<(nbits-1); - work=0; - for ( ibit=0; ibit<nbits; ibit++ ){ - work += mask*tmpbit[ibit]; - mask >>= 1; - } - *data = work; - return retval; -} - -static int GetVqInfo( tvqConfInfoSubBlock *cfg, - int bits0[], - int bits1[], - int variableBits, - INDEX *_index, - twin_private_t& priv) -{ - int idiv; - int bitcount = 0; - float pts; - if ( _index->btype == BLK_LONG ){ - TvqUpdateVectorInfo( variableBits, &cfg->ndiv, bits0, bits1 ); // re-calculate VQ bits - } - for ( idiv=0; idiv<cfg->ndiv; idiv++ ){ - bitcount += get_bstm(&_index->wvq[idiv],bits0[idiv],priv,pts); /* CB 0 */ - bitcount += get_bstm(&_index->wvq[idiv+cfg->ndiv],bits1[idiv],priv,pts); /* CB 1 */ - } - return bitcount; -} - -static int GetBseInfo( tvqConfInfo *cf, tvqConfInfoSubBlock *cfg, INDEX *_index, twin_private_t& priv) -{ - int i_sup, isf, itmp, idiv; - int bitcount = 0; - float pts; - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - for ( isf=0; isf<cfg->nsf; isf++ ){ - for ( idiv=0; idiv<cfg->fw_ndiv; idiv++ ){ - itmp = idiv + ( isf + i_sup * cfg->nsf ) * cfg->fw_ndiv; - bitcount += get_bstm(&_index->fw[itmp],cfg->fw_nbit,priv,pts); - } - } - } - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - for ( isf=0; isf<cfg->nsf; isf++ ){ - bitcount += get_bstm(&_index->fw_alf[i_sup * cfg->nsf + isf],cf->FW_ARSW_BITS,priv,pts); - } - } - return bitcount; -} - -static int GetGainInfo(tvqConfInfo *cf, tvqConfInfoSubBlock *cfg, INDEX *_index, twin_private_t& priv ) -{ - int i_sup, iptop, isf; - int bitcount = 0; - float pts; - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - iptop = ( cfg->nsubg + 1 ) * i_sup; - bitcount += get_bstm(&_index->pow[iptop], cf->GAIN_BITS,priv,pts); - for ( isf=0; isf<cfg->nsubg; isf++ ){ - bitcount += get_bstm(&_index->pow[iptop+isf+1], cf->SUB_GAIN_BITS,priv,pts); - } - } - return bitcount; -} - -static int GetLspInfo( tvqConfInfo *cf, INDEX *_index, twin_private_t& priv ) -{ - int i_sup, itmp; - int bitcount = 0; - float pts; - - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - bitcount += get_bstm(&_index->lsp[i_sup][0], cf->LSP_BIT0,priv,pts); /* pred. switch */ - bitcount += get_bstm(&_index->lsp[i_sup][1], cf->LSP_BIT1,priv,pts); /* first stage */ - for ( itmp=0; itmp<cf->LSP_SPLIT; itmp++ ){ /* second stage */ - bitcount += get_bstm(&_index->lsp[i_sup][itmp+2], cf->LSP_BIT2,priv,pts); - } - } - - return bitcount; -} - -static int GetPpcInfo( tvqConfInfo *cf, INDEX *_index, twin_private_t& priv) -{ - int idiv, i_sup; - int bitcount = 0; - float pts; - - for ( idiv=0; idiv<cf->N_DIV_P; idiv++ ){ - bitcount += get_bstm(&(_index->pls[idiv]), priv.bits_0[BLK_PPC][idiv],priv,pts); /*CB0*/ - bitcount += get_bstm(&(_index->pls[idiv+cf->N_DIV_P]), priv.bits_1[BLK_PPC][idiv],priv,pts);/*CB1*/ - } - for (i_sup=0; i_sup<cf->N_CH; i_sup++){ - bitcount += get_bstm(&(_index->pit[i_sup]), cf->BASF_BIT,priv,pts); - bitcount += get_bstm(&(_index->pgain[i_sup]), cf->PGAIN_BIT,priv,pts); - } - - return bitcount; -} - -static int GetEbcInfo( tvqConfInfo *cf, tvqConfInfoSubBlock *cfg, INDEX *_index, twin_private_t& priv) -{ - int i_sup, isf, itmp; - int bitcount = 0; - float pts; - - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - for ( isf=0; isf<cfg->nsf; isf++){ - int indexSfOffset = isf * ( cfg->ncrb - cfg->ebc_crb_base ) - cfg->ebc_crb_base; - for ( itmp=cfg->ebc_crb_base; itmp<cfg->ncrb; itmp++ ){ - bitcount += get_bstm(&_index->bc[i_sup][itmp+indexSfOffset], cfg->ebc_bits,priv,pts); - } - } - } - - return bitcount; -} - -static int vqf_read_frame(twin_private_t& priv,INDEX *_index,float& pts) -{ - /*--- Variables ---*/ - tvqConfInfoSubBlock *cfg; - int variableBits; - int bitcount; - int numFixedBitsPerFrame = TvqGetNumFixedBitsPerFrame(); - int btype; - - /*--- Initialization ---*/ - variableBits = 0; - bitcount = 0; - - /*--- read block independent factors ---*/ - /* Window type */ - bitcount += get_bstm( &_index->w_type, priv.cf.BITS_WTYPE,priv,pts); - if ( TvqWtypeToBtype( _index->w_type, &_index->btype ) ) { - MSG_ERR("Error: unknown window type: %d\n", _index->w_type); - return 0; - } - btype = _index->btype; - - /*--- read block dependent factors ---*/ - cfg = &priv.cf.cfg[btype]; // set the block dependent paremeters table - - bitcount += variableBits; - - /* Interleaved vector quantization */ - bitcount += GetVqInfo( cfg, priv.bits_0[btype], priv.bits_1[btype], variableBits, _index, priv); - - /* Bark-scale envelope */ - bitcount += GetBseInfo( &priv.cf, cfg, _index, priv); - /* Gain */ - bitcount += GetGainInfo( &priv.cf, cfg, _index, priv); - /* LSP */ - bitcount += GetLspInfo( &priv.cf, _index, priv ); - /* PPC */ - if ( cfg->ppc_enable ){ - bitcount += GetPpcInfo( &priv.cf, _index, priv); - } - /* Energy Balance Calibration */ - if ( cfg->ebc_enable ){ - bitcount += GetEbcInfo( &priv.cf, cfg, _index, priv); - } - - return bitcount == numFixedBitsPerFrame ? bitcount/8 : 0; -} - -static void frtobuf(float out[], /* Input --- input data frame */ - float bufout[], /* Output --- output data buffer array */ - unsigned frameSize, /* Input --- frame size */ - unsigned numChannels) /* Input --- number of channels */ -{ - /*--- Variables ---*/ - unsigned ismp, ich; - float *ptr; - register float dtmp; - - for ( ich=0; ich<numChannels; ich++ ){ - ptr = out+ich*frameSize; - for ( ismp=0; ismp<frameSize; ismp++ ){ - dtmp = ptr[ismp]; - if ( dtmp >= 0. ) - bufout[ismp*numChannels+ich] = (dtmp+0.5)/32767.; - else - bufout[ismp*numChannels+ich] = (dtmp-0.5)/32767.; - } - } -} - -unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) -{ - twin_private_t& priv=static_cast<twin_private_t&>(ctx); - unsigned l,len=0; - float null_pts; - sh_audio_t* sh_audio = priv.sh; - UNUSED(maxlen); - while(len<minlen) - { - float out[priv.framesize*sh_audio->nch]; - l=vqf_read_frame(priv,&priv.index,len?null_pts:pts); - if(!l) break; - TvqDecodeFrame(&priv.index, out); - frtobuf(out, (float *)buf, priv.framesize, sh_audio->nch); - len += priv.framesize*sh_audio->nch*4; - buf += priv.framesize*sh_audio->nch*4; - } - return len; -} Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/dec_video.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -221,44 +221,6 @@ } if(done) vf_showlist(priv->vfilter); -#ifdef ENABLE_WIN32LOADER - if(sh_video->codec) { - done=0; - MSG_DBG3("mpcv_init(%p, %s, %s, %i)\n",sh_video,codecname,vfm,status); - while((sh_video->codec=find_codec(sh_video->fourcc, - sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL, - sh_video->codec,0) )){ - // ok we found one codec - if(sh_video->codec->flags&CODECS_FLAG_SELECTED) { - MSG_DBG3("mpcv_init: %s already tried and failed\n",sh_video->codec->codec_name); - continue; - } - if(codecname && strcmp(sh_video->codec->codec_name,codecname)) { - MSG_DBG3("mpcv_init: %s != %s [-vc]\n",sh_video->codec->codec_name,codecname); - continue; - } - if(vfm && strcmp(sh_video->codec->driver_name,vfm)!=0) { - MSG_DBG3("mpcv_init: vfm doesn't match %s != %s\n",vfm,sh_video->codec->driver_name); - continue; // vfm doesn't match - } - if(sh_video->codec->status<status) { - MSG_DBG3("mpcv_init: %s too unstable\n",sh_video->codec->codec_name); - continue; - } - sh_video->codec->flags|=CODECS_FLAG_SELECTED; // tagging it - // ok, it matches all rules, let's find the driver! - if(!(priv->mpvdec=vfm_find_driver(sh_video->codec->driver_name))) continue; - else MSG_DBG3("mpcv_init: mpcodecs_vd_drivers[%s]->mpvdec==0\n",priv->mpvdec->info->driver_name); - // it's available, let's try to init! - if(priv->mpvdec->init(*priv->ctx,*handle)!=MPXP_Ok){ - MSG_ERR(MSGTR_CODEC_CANT_INITV); - continue; // try next... - } - done=1; - break; - } - } -#endif if(done) { mpcv_print_codec_info(*priv); // memory leak here Modified: mplayerxp/libmpcodecs/vd.cpp =================================================================== --- mplayerxp/libmpcodecs/vd.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/vd.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -43,13 +43,6 @@ extern const vd_functions_t mpcodecs_vd_theora; static const vd_functions_t* mpcodecs_vd_drivers[] = { -#ifdef ENABLE_WIN32LOADER - &mpcodecs_vd_dshow, - &mpcodecs_vd_vfw, - &mpcodecs_vd_vfwex, - &mpcodecs_vd_dmo, - &mpcodecs_vd_qtvideo, -#endif &mpcodecs_vd_raw, &mpcodecs_vd_nuv, &mpcodecs_vd_libmpeg2, Deleted: mplayerxp/libmpcodecs/vd_dmo.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/vd_dmo.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,131 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> - -#include "mpxp_help.h" - -#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ - -#include "vd_internal.h" -#include "codecs_ld.h" -#include "win32loader/dmo/DMO_VideoDecoder.h" -#include "vd_msg.h" - -static const vd_info_t info = { - "Win32/DMO video codecs", - "dmo", - "A'rpi", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBVD_EXTERN(dmo) - -struct vdmo_private_t : public Opaque { - vdmo_private_t(); - virtual ~vdmo_private_t(); - - DMO_VideoDecoder* dmo; - sh_video_t* sh; - video_decoder_t* parent; -}; -vdmo_private_t::vdmo_private_t() {} -vdmo_private_t::~vdmo_private_t() { - DMO_VideoDecoder_Destroy(dmo); -} - -static const video_probe_t* __FASTCALL__ probe(uint32_t fourcc) { return NULL; } - -// to set/get/query special features/parameters -static MPXP_Rc control_vd(Opaque& ctx,int cmd,any_t* arg,...){ - UNUSED(ctx); - switch(cmd){ - case VDCTRL_QUERY_FORMAT: - if (*((int*)arg) == IMGFMT_YV12 || - *((int*)arg) == IMGFMT_I420 || - *((int*)arg) == IMGFMT_IYUV || - *((int*)arg) == IMGFMT_YVU9 || - *((int*)arg) == IMGFMT_YUY2 || - *((int*)arg) == IMGFMT_UYVY) - return MPXP_True; - else return MPXP_False; - default: break; - } - return MPXP_Unknown; -} - -static Opaque* preinit(const video_probe_t& probe,sh_video_t *sh,put_slice_info_t& psi){ - UNUSED(probe); - UNUSED(psi); - vdmo_private_t* priv = new(zeromem) vdmo_private_t; - priv->sh=sh; - return priv; -} - -// init driver -static MPXP_Rc init(Opaque& ctx,video_decoder_t& opaque){ - unsigned int out_fmt; - vdmo_private_t& priv=static_cast<vdmo_private_t&>(ctx); - priv.parent = &opaque; - sh_video_t* sh = pr... [truncated message content] |
From: <nic...@us...> - 2013-06-11 17:36:47
|
Revision: 652 http://sourceforge.net/p/mplayerxp/code/652 Author: nickols_k Date: 2013-06-11 17:36:43 +0000 (Tue, 11 Jun 2013) Log Message: ----------- convert decaudio(video)_priv_t -> class A(V)D_Interface Modified Paths: -------------- mplayerxp/libmpcodecs/ad.cpp mplayerxp/libmpcodecs/ad.h mplayerxp/libmpcodecs/ad_a52.cpp mplayerxp/libmpcodecs/ad_dca.cpp mplayerxp/libmpcodecs/ad_dvdpcm.cpp mplayerxp/libmpcodecs/ad_faad.cpp mplayerxp/libmpcodecs/ad_lavc.cpp mplayerxp/libmpcodecs/ad_libdv.cpp mplayerxp/libmpcodecs/ad_mp3.cpp mplayerxp/libmpcodecs/ad_null.cpp mplayerxp/libmpcodecs/ad_pcm.cpp mplayerxp/libmpcodecs/ad_real.cpp mplayerxp/libmpcodecs/ad_vorbis.cpp mplayerxp/libmpcodecs/dec_audio.cpp mplayerxp/libmpcodecs/dec_audio.h mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/dec_video.h mplayerxp/libmpcodecs/vd.cpp mplayerxp/libmpcodecs/vd.h mplayerxp/libmpcodecs/vd_divx4.cpp mplayerxp/libmpcodecs/vd_huffyuv.cpp mplayerxp/libmpcodecs/vd_lavc.cpp mplayerxp/libmpcodecs/vd_libdv.cpp mplayerxp/libmpcodecs/vd_libmpeg2.cpp mplayerxp/libmpcodecs/vd_mpegpes.cpp mplayerxp/libmpcodecs/vd_null.cpp mplayerxp/libmpcodecs/vd_nuv.cpp mplayerxp/libmpcodecs/vd_raw.cpp mplayerxp/libmpcodecs/vd_real.cpp mplayerxp/libmpcodecs/vd_theora.cpp mplayerxp/libmpcodecs/vd_xanim.cpp mplayerxp/libmpcodecs/vd_xvid.cpp mplayerxp/main.cpp mplayerxp/mplayerxp.h mplayerxp/osdep/mplib.cpp mplayerxp/osdep/mplib.h mplayerxp/xmpcore/xmp_adecoder.cpp mplayerxp/xmpcore/xmp_aplayer.cpp mplayerxp/xmpcore/xmp_image.cpp mplayerxp/xmpcore/xmp_image.h mplayerxp/xmpcore/xmp_vdecoder.cpp Removed Paths: ------------- mplayerxp/libmpcodecs/ad_internal.h mplayerxp/libmpcodecs/vd_internal.h Modified: mplayerxp/libmpcodecs/ad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -12,6 +12,7 @@ #include "libmpstream2/stream.h" #include "libmpdemux/demuxer.h" #include "libmpdemux/stheader.h" +#include "dec_audio.h" #include "ad.h" #include "ad_msg.h" @@ -64,7 +65,7 @@ } } -const ad_info_t* afm_find_driver(const std::string& name) { +const ad_info_t* AD_Interface::find_driver(const std::string& name) const { unsigned i; for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { if(name==mpcodecs_ad_drivers[i]->driver_name) @@ -73,7 +74,7 @@ return NULL; } -Audio_Decoder* afm_probe_driver(sh_audio_t& sh,audio_filter_info_t& afi) { +Audio_Decoder* AD_Interface::probe_driver(sh_audio_t& sh,audio_filter_info_t& afi) const { unsigned i; Audio_Decoder* drv=NULL; for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { @@ -108,7 +109,7 @@ return drv; } -void afm_help() { +void AD_Interface::print_help() { unsigned i; mpxp_info<<"Available audio codec families/drivers:"<<std::endl; for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { Modified: mplayerxp/libmpcodecs/ad.h =================================================================== --- mplayerxp/libmpcodecs/ad.h 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad.h 2013-06-11 17:36:43 UTC (rev 652) @@ -58,8 +58,6 @@ const mpxp_option_t* options; }; - const ad_info_t* afm_find_driver(const std::string& name); - Audio_Decoder* afm_probe_driver(sh_audio_t& sh,audio_filter_info_t& afi); inline float FIX_APTS(sh_audio_t& sh_audio,float& pts,unsigned in_size) { return sh_audio.i_bps?(pts+float(in_size))/float(sh_audio.i_bps):pts; } } //namespace usr Modified: mplayerxp/libmpcodecs/ad_a52.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_a52.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_a52.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -3,11 +3,11 @@ using namespace usr; #include <stdio.h> #include <stdlib.h> +#include <stdint.h> #define __USE_XOPEN 1 #include <unistd.h> #include <assert.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" #include "liba52/a52.h" #include "codecs_ld.h" @@ -16,6 +16,10 @@ #include "osdep/cpudetect.h" #include "osdep/bswap.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + #include "osdep/mm_accel.h" #include "mplayerxp.h" #include "libao3/afmt.h" Modified: mplayerxp/libmpcodecs/ad_dca.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dca.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_dca.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -7,7 +7,6 @@ #include <unistd.h> #include <assert.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" #include "codecs_ld.h" #include "mplayerxp.h" @@ -22,6 +21,10 @@ #include "libao3/audio_out.h" #include "postproc/af.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class dca_decoder : public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_dvdpcm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dvdpcm.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_dvdpcm.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -4,10 +4,13 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include "ad_internal.h" #include "osdep/bswap.h" #include "libao3/afmt.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class dvdpcm_decoder : public Audio_Decoder { Modified: mplayerxp/libmpcodecs/ad_faad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_faad.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_faad.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -14,7 +14,6 @@ #include "mpxp_help.h" #include "osdep/bswap.h" #include "codecs_ld.h" -#include "ad_internal.h" #include "mplayerxp.h" #include "osdep/cpudetect.h" #include "osdep/mm_accel.h" @@ -22,6 +21,10 @@ #include "libao3/audio_out.h" #include "postproc/af.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { typedef any_t* NeAACDecHandle; typedef struct NeAACDecConfiguration { Deleted: mplayerxp/libmpcodecs/ad_internal.h =================================================================== --- mplayerxp/libmpcodecs/ad_internal.h 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_internal.h 2013-06-11 17:36:43 UTC (rev 652) @@ -1,12 +0,0 @@ -#ifdef __AD_ACM /* simply ugly hack */ -#include "win32loader/wine/msacm.h" -#endif -#include "libmpconf/codec-cfg.h" -#include "libmpdemux/demuxer_r.h" - -#include "ad.h" - -#include "ad_msg.h" - -namespace usr { -} // namespace usr \ No newline at end of file Modified: mplayerxp/libmpcodecs/ad_lavc.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_lavc.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_lavc.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -9,7 +9,6 @@ #include <assert.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ #include "libao3/afmt.h" -#include "ad_internal.h" #include "mpxp_help.h" #include "osdep/bswap.h" @@ -18,6 +17,10 @@ #include "mpxp_conf_lavc.h" #include "codecs_ld.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class alavc_decoder: public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_libdv.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_libdv.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_libdv.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -18,8 +18,11 @@ #include "libmpdemux/stheader.h" #include "libao3/afmt.h" #include "osdep/bswap.h" -#include "ad_internal.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class libadv_decoder : public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_mp3.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_mp3.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -5,7 +5,6 @@ #include <stdlib.h> #include <unistd.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" #include "mplayerxp.h" #include "osdep/cpudetect.h" #include "osdep/mm_accel.h" @@ -16,6 +15,10 @@ #include "libao3/audio_out.h" #include "postproc/af.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { /** Opaque structure for the libmpg123 decoder handle. */ struct mpg123_handle_struct; Modified: mplayerxp/libmpcodecs/ad_null.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_null.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_null.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -4,8 +4,11 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include "ad_internal.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class anull_decoder : public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_pcm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_pcm.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_pcm.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -4,10 +4,13 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include "ad_internal.h" #include "libao3/afmt.h" #include "osdep/bswap.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class pcm_decoder : public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_real.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_real.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_real.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -9,12 +9,16 @@ #include <stddef.h> #include <dlfcn.h> -#include "ad_internal.h" #include "codecs_ld.h" #include "ad_msg.h" #include "osdep/bswap.h" #include "libao3/afmt.h" +#include "libmpconf/codec-cfg.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { struct ra_init_t { int samplerate; Modified: mplayerxp/libmpcodecs/ad_vorbis.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_vorbis.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_vorbis.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -11,11 +11,14 @@ #include "osdep/bswap.h" #include "codecs_ld.h" -#include "ad_internal.h" #include "libao3/afmt.h" #include "libao3/audio_out.h" #include "postproc/af.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { // This struct is also defined in demux_ogg.c => common header ? class vorbis_decoder : public Audio_Decoder { Modified: mplayerxp/libmpcodecs/dec_audio.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_audio.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/dec_audio.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -32,159 +32,150 @@ struct decaudio_priv_t : public Opaque { public: - decaudio_priv_t(); + decaudio_priv_t(sh_audio_t& sh); virtual ~decaudio_priv_t(); - sh_audio_t* parent; + sh_audio_t& parent; Audio_Decoder* mpadec; - audio_filter_info_t* afi; + audio_filter_info_t& afi; }; -decaudio_priv_t::decaudio_priv_t() - :afi(new(zeromem) audio_filter_info_t) +decaudio_priv_t::decaudio_priv_t(sh_audio_t& sh) + :parent(sh) + ,afi(*new(zeromem) audio_filter_info_t) { } -decaudio_priv_t::~decaudio_priv_t() { delete afi; } +decaudio_priv_t::~decaudio_priv_t() { delete &afi; } -audio_decoder_t* mpca_init(sh_audio_t *sh_audio) +AD_Interface::AD_Interface(sh_audio_t& sh) + :ad_private(*new(zeromem) decaudio_priv_t(sh)) { + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); const char *afm=NULL,*ac=NULL; - audio_decoder_t* handle=new(zeromem) audio_decoder_t; - decaudio_priv_t* priv = new(zeromem) decaudio_priv_t; - priv->parent=sh_audio; - handle->ad_private=priv; if(mp_conf.audio_family) afm=mp_conf.audio_family; if(afm) { - const ad_info_t* ai=afm_find_driver(afm); + const ad_info_t* ai=find_driver(afm); try{ /* Set up some common usefull defaults. ad->preinit() can override these: */ #ifdef WORDS_BIGENDIAN - sh_audio->afmt=AFMT_S16_BE; + sh.afmt=AFMT_S16_BE; #else - sh_audio->afmt=AFMT_S16_LE; + sh.afmt=AFMT_S16_LE; #endif - sh_audio->rate=0; - sh_audio->o_bps=0; - priv->mpadec=ai->query_interface(*sh_audio,*priv->afi,sh_audio->wtag); + sh.rate=0; + sh.o_bps=0; + priv.mpadec=ai->query_interface(sh,priv.afi,sh.wtag); } catch(const bad_format_exception&) { MSG_ERR(MSGTR_CODEC_BAD_AFAMILY,ac, afm); goto bye; } } - else priv->mpadec = afm_probe_driver(*sh_audio,*priv->afi); - if(!priv->mpadec) { + else priv.mpadec = probe_driver(sh,priv.afi); + if(!priv.mpadec) { bye: - delete handle; - delete priv->mpadec; - delete priv; - return NULL; + delete priv.mpadec; + delete &priv; + throw missing_driver_exception(); } - audio_probe_t aprobe=priv->mpadec->get_probe_information(); + audio_probe_t aprobe=priv.mpadec->get_probe_information(); afm=aprobe.driver; ac=aprobe.codec_dll; /* fake struct codecs_st*/ - sh_audio->codec=new(zeromem) struct codecs_st; - strcpy(sh_audio->codec->dll_name,aprobe.codec_dll); - strcpy(sh_audio->codec->driver_name,aprobe.driver); - strcpy(sh_audio->codec->codec_name,sh_audio->codec->dll_name); - memcpy(sh_audio->codec->outfmt,aprobe.sample_fmt,sizeof(aprobe.sample_fmt)); + sh.codec=new(zeromem) struct codecs_st; + strcpy(sh.codec->dll_name,aprobe.codec_dll); + strcpy(sh.codec->driver_name,aprobe.driver); + strcpy(sh.codec->codec_name,sh.codec->dll_name); + memcpy(sh.codec->outfmt,aprobe.sample_fmt,sizeof(aprobe.sample_fmt)); /* reset in/out buffer size/pointer: */ - sh_audio->a_buffer_size=0; - sh_audio->a_buffer=NULL; - sh_audio->a_in_buffer_size=0; - sh_audio->a_in_buffer=NULL; + sh.a_buffer_size=0; + sh.a_buffer=NULL; + sh.a_in_buffer_size=0; + sh.a_in_buffer=NULL; - if(sh_audio->wf) /* NK: We need to know i_bps before its detection by codecs param */ - sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; + if(sh.wf) /* NK: We need to know i_bps before its detection by codecs param */ + sh.i_bps=sh.wf->nAvgBytesPerSec; - sh_audio->audio_out_minsize=8192;/* default size, maybe not enough for Win32/ACM*/ - sh_audio->audio_in_minsize=0; + sh.audio_out_minsize=8192;/* default size, maybe not enough for Win32/ACM*/ + sh.audio_in_minsize=0; /* allocate audio in buffer: */ - if(sh_audio->audio_in_minsize>0){ - sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize; - mpxp_v<<"dec_audio: Allocating "<<sh_audio->a_in_buffer_size<<" bytes for input buffer"<<std::endl; - sh_audio->a_in_buffer=new char [sh_audio->a_in_buffer_size]; - sh_audio->a_in_buffer_len=0; + if(sh.audio_in_minsize>0){ + sh.a_in_buffer_size=sh.audio_in_minsize; + mpxp_v<<"dec_audio: Allocating "<<sh.a_in_buffer_size<<" bytes for input buffer"<<std::endl; + sh.a_in_buffer=new char [sh.a_in_buffer_size]; + sh.a_in_buffer_len=0; } /* allocate audio out buffer: */ - sh_audio->a_buffer_size=sh_audio->audio_out_minsize+MAX_OUTBURST; /* worst case calc.*/ + sh.a_buffer_size=sh.audio_out_minsize+MAX_OUTBURST; /* worst case calc.*/ - mpxp_v<<"dec_audio: Allocating "<<sh_audio->audio_out_minsize<<" + "<<MAX_OUTBURST - <<" = "<<sh_audio->a_buffer_size<<" bytes for output buffer"<<std::endl; + mpxp_v<<"dec_audio: Allocating "<<sh.audio_out_minsize<<" + "<<MAX_OUTBURST + <<" = "<<sh.a_buffer_size<<" bytes for output buffer"<<std::endl; - sh_audio->a_buffer=new char [sh_audio->a_buffer_size]; - if(!sh_audio->a_buffer) { + sh.a_buffer=new char [sh.a_buffer_size]; + if(!sh.a_buffer) { MSG_ERR(MSGTR_CantAllocAudioBuf); - delete priv; - delete handle; - return NULL; + goto bye; } - sh_audio->a_buffer_len=0; - sh_audio->inited=1; + sh.a_buffer_len=0; + sh.inited=1; - if(!sh_audio->nch || !sh_audio->rate) { - mpxp_v<<"audio format wrong: nch="<<sh_audio->nch<<" rate="<<sh_audio->rate<<std::endl; + if(!sh.nch || !sh.rate) { + mpxp_v<<"audio format wrong: nch="<<sh.nch<<" rate="<<sh.rate<<std::endl; MSG_WARN(MSGTR_UnknownAudio); - mpca_uninit(*handle); /* mp_free buffers */ - return NULL; + goto bye; } - if(!sh_audio->o_bps) - sh_audio->o_bps=sh_audio->nch*sh_audio->rate*afmt2bps(sh_audio->afmt); - if(!sh_audio->i_bps) { + if(!sh.o_bps) + sh.o_bps=sh.nch*sh.rate*afmt2bps(sh.afmt); + if(!sh.i_bps) { static int warned=0; if(!warned) { warned=1; MSG_WARN(MSGTR_CODEC_INITAL_AV_RESYNC); } } else if(mpxp_context().engine().xp_core->initial_apts_corr.need_correction==1) { - mpxp_context().engine().xp_core->initial_apts += ((float)(mpxp_context().engine().xp_core->initial_apts_corr.pts_bytes-mpxp_context().engine().xp_core->initial_apts_corr.nbytes))/(float)sh_audio->i_bps; + mpxp_context().engine().xp_core->initial_apts += ((float)(mpxp_context().engine().xp_core->initial_apts_corr.pts_bytes-mpxp_context().engine().xp_core->initial_apts_corr.nbytes))/(float)sh.i_bps; mpxp_context().engine().xp_core->initial_apts_corr.need_correction=0; } - mpxp_ok<<"[AC] "<<(mp_conf.audio_codec?"Forcing":"Selecting")<<" drv:"<<aprobe.driver<<"."<<ac<<" ratio "<<sh_audio->i_bps<<"->"<<sh_audio->o_bps<<std::endl; - if(sh_audio->codec) { delete sh_audio->codec; sh_audio->codec=NULL; } - return handle; + mpxp_ok<<"[AC] "<<(mp_conf.audio_codec?"Forcing":"Selecting")<<" drv:"<<aprobe.driver<<"."<<ac<<" ratio "<<sh.i_bps<<"->"<<sh.o_bps<<std::endl; + if(sh.codec) { delete sh.codec; sh.codec=NULL; } } -void mpca_uninit(audio_decoder_t& opaque) +AD_Interface::~AD_Interface() { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* parent = priv->parent; - if(!parent) { delete &opaque; delete priv; return; } - if(priv->afi->afilter){ + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; + if(priv.afi.afilter){ mpxp_v<<"Uninit audio filters..."<<std::endl; - af_uninit(priv->afi->afilter); - delete priv->afi->afilter; - priv->afi->afilter=NULL; + af_uninit(priv.afi.afilter); + delete priv.afi.afilter; + priv.afi.afilter=NULL; } - if(parent->a_buffer) delete parent->a_buffer; - parent->a_buffer=NULL; - if(parent->a_in_buffer) delete parent->a_in_buffer; - parent->a_in_buffer=NULL; - if(!parent->inited) { delete &opaque; delete priv; return; } + if(sh.a_buffer) delete sh.a_buffer; + sh.a_buffer=NULL; + if(sh.a_in_buffer) delete sh.a_in_buffer; + sh.a_in_buffer=NULL; + if(!sh.inited) { delete &priv; return; } mpxp_v<<"uninit audio: ..."<<std::endl; - if(parent->a_buffer) delete parent->a_buffer; - parent->a_buffer=NULL; - parent->inited=0; - delete priv; - delete &opaque; + if(sh.a_buffer) delete sh.a_buffer; + sh.a_buffer=NULL; + sh.inited=0; + delete &priv; } /* Init audio filters */ -MPXP_Rc mpca_preinit_filters(audio_decoder_t& opaque, - unsigned in_samplerate, unsigned in_channels, unsigned in_format, - unsigned& out_samplerate, unsigned& out_channels, unsigned& out_format){ - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; +MPXP_Rc AD_Interface::preinit_filters(unsigned in_samplerate, unsigned in_channels, unsigned in_format, + unsigned& out_samplerate, unsigned& out_channels, unsigned& out_format) const { + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; char strbuf[200]; - af_stream_t* afs=af_new(sh_audio); + af_stream_t* afs=af_new(&sh); // input format: same as codec's output format: afs->input.rate = in_samplerate; @@ -213,25 +204,24 @@ out_channels=afs->output.nch; out_format=mpaf2afmt(afs->output.format); - sh_audio->af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); + sh.af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); mpxp_v<<"AF_pre: af format: "<<afs->output.nch<<" ch, "<<afs->output.rate<<" hz, "<<mpaf_fmt2str(afs->output.format,strbuf,200) - <<" af_bps="<<sh_audio->af_bps<<std::endl; + <<" af_bps="<<sh.af_bps<<std::endl; - priv->afi->afilter=afs; + priv.afi.afilter=afs; return MPXP_Ok; } /* Init audio filters */ -MPXP_Rc mpca_init_filters(audio_decoder_t& opaque, - unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, +MPXP_Rc AD_Interface::init_filters(unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, unsigned out_samplerate, unsigned out_channels, mpaf_format_e out_format, - unsigned out_minsize, unsigned out_maxsize){ - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; + unsigned out_minsize, unsigned out_maxsize) const { + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; char strbuf[200]; - af_stream_t* afs=priv->afi->afilter; - if(!afs) afs = af_new(sh_audio); + af_stream_t* afs=priv.afi.afilter; + if(!afs) afs = af_new(&sh); // input format: same as codec's output format: afs->input.rate = in_samplerate; @@ -252,7 +242,7 @@ // let's autoprobe it! if(MPXP_Ok != af_init(afs,1)){ - priv->afi->afilter=NULL; + priv.afi.afilter=NULL; delete afs; return MPXP_False; // failed :( } @@ -261,80 +251,79 @@ if(out_maxsize<out_minsize) out_maxsize=out_minsize; if(out_maxsize<8192) out_maxsize=MAX_OUTBURST; // not sure this is ok - sh_audio->af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); + sh.af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); mpxp_v<<"AF_init: af format: "<<afs->output.nch<<" ch, "<<afs->output.rate - <<" hz, "<<mpaf_fmt2str(afs->output.format,strbuf,200)<<" af_bps="<<sh_audio->af_bps<<std::endl; + <<" hz, "<<mpaf_fmt2str(afs->output.format,strbuf,200)<<" af_bps="<<sh.af_bps<<std::endl; - sh_audio->a_buffer_size=out_maxsize; - sh_audio->a_buffer=new char [sh_audio->a_buffer_size]; - sh_audio->a_buffer_len=0; + sh.a_buffer_size=out_maxsize; + sh.a_buffer=new char [sh.a_buffer_size]; + sh.a_buffer_len=0; af_showconf(afs->first); - priv->afi->afilter=afs; - priv->afi->afilter_inited=1; + priv.afi.afilter=afs; + priv.afi.afilter_inited=1; return MPXP_Ok; } /* Init audio filters */ -MPXP_Rc mpca_reinit_filters(audio_decoder_t& opaque, - unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, +MPXP_Rc AD_Interface::reinit_filters(unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, unsigned out_samplerate, unsigned out_channels, mpaf_format_e out_format, - unsigned out_minsize, unsigned out_maxsize) + unsigned out_minsize, unsigned out_maxsize) const { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - if(priv->afi->afilter){ + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + if(priv.afi.afilter){ mpxp_v<<"Uninit audio filters..."<<std::endl; - af_uninit(priv->afi->afilter); - delete priv->afi->afilter; - priv->afi->afilter=NULL; + af_uninit(priv.afi.afilter); + delete priv.afi.afilter; + priv.afi.afilter=NULL; } - return mpca_init_filters(opaque,in_samplerate,in_channels, - in_format,out_samplerate, - out_channels,out_format, - out_minsize,out_maxsize); + return init_filters(in_samplerate,in_channels, + in_format,out_samplerate, + out_channels,out_format, + out_minsize,out_maxsize); } -unsigned mpca_decode(audio_decoder_t& opaque,unsigned char *buf,unsigned minlen,unsigned maxlen,unsigned buflen,float& pts) +unsigned AD_Interface::run(unsigned char *buf,unsigned minlen,unsigned maxlen,unsigned buflen,float& pts) const { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; unsigned len; unsigned cp_size,cp_tile; - if(!sh_audio->inited) return 0; // no codec + if(!sh.inited) return 0; // no codec if(minlen>maxlen) MSG_WARN(MSGTR_CODEC_XP_INT_ERR,minlen,maxlen); - if(sh_audio->af_buffer_len) { - cp_size=std::min(buflen,sh_audio->af_buffer_len); - memcpy(buf,sh_audio->af_buffer,cp_size); - pts = sh_audio->af_pts; - cp_tile=sh_audio->af_buffer_len-cp_size; - mpxp_dbg2<<"cache->buf "<<cp_size<<" bytes "<<pts<<" pts <PREDICTED PTS "<<(pts+(float)cp_tile/(float)sh_audio->af_bps)<<">"<<std::endl; + if(sh.af_buffer_len) { + cp_size=std::min(buflen,sh.af_buffer_len); + memcpy(buf,sh.af_buffer,cp_size); + pts = sh.af_pts; + cp_tile=sh.af_buffer_len-cp_size; + mpxp_dbg2<<"cache->buf "<<cp_size<<" bytes "<<pts<<" pts <PREDICTED PTS "<<(pts+(float)cp_tile/(float)sh.af_bps)<<">"<<std::endl; if(cp_tile) { - sh_audio->af_buffer=&sh_audio->af_buffer[cp_size]; - sh_audio->af_buffer_len=cp_tile; - sh_audio->af_pts += (float)cp_size/(float)sh_audio->af_bps; + sh.af_buffer=&sh.af_buffer[cp_size]; + sh.af_buffer_len=cp_tile; + sh.af_pts += (float)cp_size/(float)sh.af_bps; } - else sh_audio->af_buffer_len=0; + else sh.af_buffer_len=0; return cp_size; } - if(sh_audio->af_bps>sh_audio->o_bps) - maxlen=std::min(maxlen,buflen*sh_audio->o_bps/sh_audio->af_bps); - len=priv->mpadec->run(buf, minlen, maxlen,pts); - if(len>buflen) MSG_WARN(MSGTR_CODEC_BUF_OVERFLOW,sh_audio->codec->driver_name,len,buflen); - mpxp_dbg2<<"decaudio: "<<len<<" bytes "<<pts<<" pts min "<<minlen<<" max "<<maxlen<<" buflen "<<buflen<<" o_bps="<<sh_audio->o_bps<<" f_bps="<<sh_audio->af_bps<<std::endl; - if(len==0 || !priv->afi->afilter) return 0; // EOF? + if(sh.af_bps>sh.o_bps) + maxlen=std::min(maxlen,buflen*sh.o_bps/sh.af_bps); + len=priv.mpadec->run(buf, minlen, maxlen,pts); + if(len>buflen) MSG_WARN(MSGTR_CODEC_BUF_OVERFLOW,sh.codec->driver_name,len,buflen); + mpxp_dbg2<<"decaudio: "<<len<<" bytes "<<pts<<" pts min "<<minlen<<" max "<<maxlen<<" buflen "<<buflen<<" o_bps="<<sh.o_bps<<" f_bps="<<sh.af_bps<<std::endl; + if(len==0 || !priv.afi.afilter) return 0; // EOF? // run the filters: mp_aframe_t* afd; // filter input mp_aframe_t* pafd; // filter output - afd=new_mp_aframe( sh_audio->rate, - sh_audio->nch, - afmt2mpaf(sh_audio->afmt) + afd=new_mp_aframe( sh.rate, + sh.nch, + afmt2mpaf(sh.afmt) ,0); // xp_idx afd->audio=buf; afd->len=len; - pafd=af_play(priv->afi->afilter,afd); + pafd=af_play(priv.afi.afilter,afd); afd->audio=NULL; // fake no buffer if(!pafd) { @@ -349,36 +338,33 @@ memcpy(buf,pafd->audio,cp_size); cp_tile=pafd->len-cp_size; if(cp_tile) { - sh_audio->af_buffer=&((char *)pafd->audio)[cp_size]; - sh_audio->af_buffer_len=cp_tile; - sh_audio->af_pts = pts+(float)cp_size/(float)sh_audio->af_bps; + sh.af_buffer=&((char *)pafd->audio)[cp_size]; + sh.af_buffer_len=cp_tile; + sh.af_pts = pts+(float)cp_size/(float)sh.af_bps; mpxp_dbg2<<"decaudio: afilter->cache "<<cp_tile<<" bytes "<<pts<<" pts"<<std::endl; - } else sh_audio->af_buffer_len=0; + } else sh.af_buffer_len=0; if(pafd!=afd) free_mp_aframe(pafd); free_mp_aframe(afd); return cp_size; } /* Note: it is called once after seeking, to resync. */ -void mpca_resync_stream(audio_decoder_t& opaque) +void AD_Interface::resync_stream() const { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; - if(sh_audio) { - sh_audio->a_in_buffer_len=0; /* workaround */ - if(sh_audio->inited && priv->mpadec) priv->mpadec->ctrl(ADCTRL_RESYNC_STREAM,NULL); - } + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; + sh.a_in_buffer_len=0; /* workaround */ + if(sh.inited && priv.mpadec) priv.mpadec->ctrl(ADCTRL_RESYNC_STREAM,NULL); } /* Note: it is called to skip (jump over) small amount (1/10 sec or 1 frame) of audio data - used to sync audio to video after seeking */ -void mpca_skip_frame(audio_decoder_t& opaque) +void AD_Interface::skip_frame() const { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; MPXP_Rc rc=MPXP_True; - if(sh_audio) - if(sh_audio->inited && priv->mpadec) rc=priv->mpadec->ctrl(ADCTRL_SKIP_FRAME,NULL); - if(rc!=MPXP_True) sh_audio->ds->fill_buffer(); + if(sh.inited && priv.mpadec) rc=priv.mpadec->ctrl(ADCTRL_SKIP_FRAME,NULL); + if(rc!=MPXP_True) sh.ds->fill_buffer(); } } // namespace usr \ No newline at end of file Modified: mplayerxp/libmpcodecs/dec_audio.h =================================================================== --- mplayerxp/libmpcodecs/dec_audio.h 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/dec_audio.h 2013-06-11 17:36:43 UTC (rev 652) @@ -6,28 +6,29 @@ struct codecs_st; namespace usr { - struct audio_decoder_t { - Opaque* ad_private; - }; + class AD_Interface : public Opaque { + public: + AD_Interface(sh_audio_t& sh_audio); + virtual ~AD_Interface(); - // dec_audio.c: - audio_decoder_t* __FASTCALL__ mpca_init(sh_audio_t *sh_audio); - void __FASTCALL__ mpca_uninit(audio_decoder_t& handle); - unsigned __FASTCALL__ mpca_decode(audio_decoder_t& handle,unsigned char *buf,unsigned minlen,unsigned maxlen,unsigned buflen,float& pts); - void __FASTCALL__ mpca_resync_stream(audio_decoder_t& handle); - void __FASTCALL__ mpca_skip_frame(audio_decoder_t& handle); + virtual unsigned run(unsigned char *buf,unsigned minlen,unsigned maxlen,unsigned buflen,float& pts) const; + virtual void resync_stream() const; + virtual void skip_frame() const; - MPXP_Rc mpca_init_filters(audio_decoder_t& sh_audio, - unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, - unsigned out_samplerate, unsigned out_channels,mpaf_format_e out_format, - unsigned out_minsize, unsigned out_maxsize); - MPXP_Rc mpca_preinit_filters(audio_decoder_t& sh_audio, - unsigned in_samplerate, unsigned in_channels, unsigned in_format, - unsigned& out_samplerate, unsigned& out_channels, unsigned& out_format); - MPXP_Rc mpca_reinit_filters(audio_decoder_t& sh_audio, - unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, - unsigned out_samplerate, unsigned out_channels, mpaf_format_e out_format, - unsigned out_minsize, unsigned out_maxsize); - void afm_help(void); + virtual MPXP_Rc init_filters(unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, + unsigned out_samplerate, unsigned out_channels,mpaf_format_e out_format, + unsigned out_minsize, unsigned out_maxsize) const; + virtual MPXP_Rc preinit_filters(unsigned in_samplerate, unsigned in_channels, unsigned in_format, + unsigned& out_samplerate, unsigned& out_channels, unsigned& out_format) const; + virtual MPXP_Rc reinit_filters(unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, + unsigned out_samplerate, unsigned out_channels, mpaf_format_e out_format, + unsigned out_minsize, unsigned out_maxsize) const; + static void print_help(); + private: + const ad_info_t* find_driver(const std::string& name) const; + Audio_Decoder* probe_driver(sh_audio_t& sh,audio_filter_info_t& afi) const; + + Opaque& ad_private; + }; } //namespace usr #endif Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/dec_video.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -37,6 +37,7 @@ #include "osdep/cpudetect.h" #include "vd_msg.h" +#include "libvo2/video_out.h" // =================================================================== namespace usr { vf_cfg_t vf_cfg; // Configuration for audio filters @@ -48,162 +49,160 @@ struct decvideo_priv_t : public Opaque { public: - decvideo_priv_t(libinput_t&); + decvideo_priv_t(libinput_t&,sh_video_t&); virtual ~decvideo_priv_t(); - sh_video_t* parent; + sh_video_t& parent; + libinput_t& libinput; + put_slice_info_t& psi; Video_Decoder* mpvdec; - libinput_t& libinput; vf_stream_t* vfilter; int vfilter_inited; - put_slice_info_t* psi; + unsigned smp_num_cpus; + unsigned use_vf_threads; + float sub_last_pts; }; -decvideo_priv_t::decvideo_priv_t(libinput_t& _libinput) - :libinput(_libinput), - psi(new(zeromem) put_slice_info_t) +decvideo_priv_t::decvideo_priv_t(libinput_t& _libinput,sh_video_t& p) + :parent(p) + ,libinput(_libinput) + ,psi(*new(zeromem) put_slice_info_t) + ,smp_num_cpus(1) + ,sub_last_pts(-303) { } -decvideo_priv_t::~decvideo_priv_t() { delete psi; } +decvideo_priv_t::~decvideo_priv_t() { delete ψ } -MPXP_Rc mpcv_get_quality_max(video_decoder_t& opaque,unsigned& quality){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - if(priv->mpvdec){ - MPXP_Rc ret=priv->mpvdec->ctrl(VDCTRL_QUERY_MAX_PP_LEVEL,&quality); +MPXP_Rc VD_Interface::get_quality_max(unsigned& quality) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + if(priv.mpvdec){ + MPXP_Rc ret=priv.mpvdec->ctrl(VDCTRL_QUERY_MAX_PP_LEVEL,&quality); if(ret>=MPXP_Ok) return ret; } return MPXP_False; } -MPXP_Rc mpcv_set_quality(video_decoder_t& opaque,int quality){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - if(priv->mpvdec) - return priv->mpvdec->ctrl(VDCTRL_SET_PP_LEVEL, (any_t*)(&quality)); +MPXP_Rc VD_Interface::set_quality(int quality) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + if(priv.mpvdec) return priv.mpvdec->ctrl(VDCTRL_SET_PP_LEVEL, (any_t*)(&quality)); return MPXP_False; } -MPXP_Rc mpcv_set_colors(video_decoder_t& opaque,const std::string& item,int value) +MPXP_Rc VD_Interface::set_colors(const std::string& item,int value) const { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - vf_stream_t* vs=priv->vfilter; + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + vf_stream_t* vs=priv.vfilter; vf_equalizer_t eq; eq.item=item.c_str(); eq.value=value*10; if(vf_control(vs,VFCTRL_SET_EQUALIZER,&eq)!=MPXP_True) { - if(priv->mpvdec) return priv->mpvdec->ctrl(VDCTRL_SET_EQUALIZER,(any_t*)item.c_str(),value); + if(priv.mpvdec) return priv.mpvdec->ctrl(VDCTRL_SET_EQUALIZER,(any_t*)item.c_str(),value); } return MPXP_False; } -void mpcv_uninit(video_decoder_t& opaque){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh_video = priv->parent; - if(!sh_video->inited) { delete priv; delete &opaque; return; } +VD_Interface::~VD_Interface(){ + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh_video = priv.parent; + if(!sh_video.inited) { delete &priv; return; } mpxp_v<<"uninit video ..."<<std::endl; - if(priv->vfilter && priv->vfilter_inited==1) vf_uninit(priv->vfilter); - delete priv->mpvdec; - sh_video->inited=0; - delete priv; - delete &opaque; + if(priv.vfilter && priv.vfilter_inited==1) vf_uninit(priv.vfilter); + delete priv.mpvdec; + sh_video.inited=0; + delete &priv; } -#include "libvo2/video_out.h" #define MPDEC_THREAD_COND (VF_FLAGS_THREADS|VF_FLAGS_SLICES) -static unsigned smp_num_cpus=1; -static unsigned use_vf_threads=0; -static void mpcv_print_codec_info(decvideo_priv_t& priv) { - sh_video_t* sh_video = priv.parent; - mpxp_ok<<"[VC] "<<(mp_conf.video_codec?"Forcing":"Selected")<<" decoder: ["<<sh_video->codec->codec_name - <<"] drv:"<<priv.mpvdec->get_probe_information().driver<<"."<<sh_video->codec->dll_name - <<" ("<<sh_video->src_w<<"x"<<sh_video->src_h<<" (aspect "<<sh_video->aspect<<") "<<sh_video->fps<<"fps"<<std::endl; +void VD_Interface::print_codec_info() const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; + mpxp_ok<<"[VC] "<<(mp_conf.video_codec?"Forcing":"Selected")<<" decoder: ["<<sh.codec->codec_name + <<"] drv:"<<priv.mpvdec->get_probe_information().driver<<"."<<sh.codec->dll_name + <<" ("<<sh.src_w<<"x"<<sh.src_h<<" (aspect "<<sh.aspect<<") "<<sh.fps<<"fps"<<std::endl; // Yeah! We got it! - sh_video->inited=1; - priv.psi->vf_flags=vf_query_flags(priv.vfilter); + sh.inited=1; + priv.psi.vf_flags=vf_query_flags(priv.vfilter); #ifdef _OPENMP if(mp_conf.gomp) { - smp_num_cpus=omp_get_num_procs(); - use_vf_threads=0; - if(((priv.psi->vf_flags&MPDEC_THREAD_COND)==MPDEC_THREAD_COND) && (smp_num_cpus>1)) use_vf_threads=1; - if(use_vf_threads) - mpxp_status<<"[mpdec] will perform parallel video-filter on "<<smp_num_cpus<<" CPUs"<<std::endl; + priv.smp_num_cpus=omp_get_num_procs(); + priv.use_vf_threads=0; + if(((priv.psi.vf_flags&MPDEC_THREAD_COND)==MPDEC_THREAD_COND) && (priv.smp_num_cpus>1)) priv.use_vf_threads=1; + if(priv.use_vf_threads) + mpxp_status<<"[mpdec] will perform parallel video-filter on "<<priv.smp_num_cpus<<" CPUs"<<std::endl; } #else mpxp_v<<"[mpdec] GOMP was not compiled-in! Using single threaded video filtering!"<<std::endl; #endif } -video_decoder_t* mpcv_init(sh_video_t *sh_video,const std::string& codecname,const std::string& family,int status,libinput_t&libinput){ +VD_Interface::VD_Interface(sh_video_t& sh,const std::string& codecname,const std::string& family,int status,libinput_t&libinput) + :vd_private(*new(zeromem) decvideo_priv_t(libinput,sh)) +{ + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); UNUSED(codecname); UNUSED(status); - sh_video->codec=NULL; - video_decoder_t* handle=new(zeromem) video_decoder_t; - decvideo_priv_t* priv = new(zeromem) decvideo_priv_t(libinput); - priv->parent=sh_video; - handle->vd_private=priv; + sh.codec=NULL; std::string vfm=family; MP_UNIT("init_video_filters"); - if(priv->vfilter_inited<=0) { + if(priv.vfilter_inited<=0) { vf_conf_t conf; - conf.w=sh_video->src_w; - conf.h=sh_video->src_h; - conf.fourcc=sh_video->fourcc; // may be NULL ??? - priv->vfilter=vf_init(libinput,&conf); - priv->vfilter_inited=1; + conf.w=sh.src_w; + conf.h=sh.src_h; + conf.fourcc=sh.fourcc; // may be NULL ??? + priv.vfilter=vf_init(libinput,&conf); + priv.vfilter_inited=1; } if(!vfm.empty()) { - const vd_info_t* vi=vfm_find_driver(vfm); + const vd_info_t* vi=find_driver(vfm); try{ - priv->mpvdec=vi->query_interface(*handle,*sh_video,*priv->psi,sh_video->fourcc); + priv.mpvdec=vi->query_interface(*this,sh,priv.psi,sh.fourcc); } catch(const bad_format_exception&) { MSG_ERR(MSGTR_CODEC_CANT_INITV); - delete priv->mpvdec; + delete priv.mpvdec; goto bye; } } - else priv->mpvdec = vfm_probe_driver(*handle,*sh_video,*priv->psi); - if(!priv->mpvdec) { + else priv.mpvdec = probe_driver(sh,priv.psi); + if(!priv.mpvdec) { bye: - delete handle; - delete priv; - return NULL; + throw missing_driver_exception(); } - video_probe_t probe = priv->mpvdec->get_probe_information(); + video_probe_t probe = priv.mpvdec->get_probe_information(); vfm=probe.driver; /* fake struct codecs_st*/ - sh_video->codec=new(zeromem) struct codecs_st; - strcpy(sh_video->codec->dll_name,probe.codec_dll); - strcpy(sh_video->codec->driver_name,probe.driver); - strcpy(sh_video->codec->codec_name,sh_video->codec->dll_name); - memcpy(sh_video->codec->outfmt,probe.pix_fmt,sizeof(probe.pix_fmt)); + sh.codec=new(zeromem) struct codecs_st; + strcpy(sh.codec->dll_name,probe.codec_dll); + strcpy(sh.codec->driver_name,probe.driver); + strcpy(sh.codec->codec_name,sh.codec->dll_name); + memcpy(sh.codec->outfmt,probe.pix_fmt,sizeof(probe.pix_fmt)); - vf_showlist(priv->vfilter); + vf_showlist(priv.vfilter); - mpcv_print_codec_info(*priv); - return handle; + print_codec_info(); } -void mpcodecs_draw_image(video_decoder_t& opaque,mp_image_t *mpi) +void VD_Interface::draw_image(const mp_image_t* mpi) const { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); vf_stream_t* s; const unsigned h_step=16; unsigned num_slices = mpi->h/h_step; - s=priv->vfilter; + s=priv.vfilter; if(!(mpi->flags&(MP_IMGFLAG_DRAW_CALLBACK))){ if(mpi->h%h_step) num_slices++; - if(priv->psi->vf_flags&VF_FLAGS_SLICES) + if(priv.psi.vf_flags&VF_FLAGS_SLICES) { unsigned j,i,y; mp_image_t *ampi[num_slices]; static int hello_printed=0; if(!hello_printed) { - mpxp_ok<<"[VC] using "<<smp_num_cpus<<" threads for video filters"<<std::endl; + mpxp_ok<<"[VC] using "<<priv.smp_num_cpus<<" threads for video filters"<<std::endl; hello_printed=1; } y=0; @@ -213,10 +212,10 @@ y+=h_step; } #ifdef _OPENMP - if(use_vf_threads && (num_slices>smp_num_cpus)) { - for(j=0;j<num_slices;j+=smp_num_cpus) { + if(priv.use_vf_threads && (num_slices>priv.smp_num_cpus)) { + for(j=0;j<num_slices;j+=priv.smp_num_cpus) { #pragma omp parallel for shared(s) private(i) - for(i=j;i<smp_num_cpus;i++) { + for(i=j;i<priv.smp_num_cpus;i++) { mpxp_dbg2<<"parallel: dec_video.put_slice["<<ampi[i]->width<<"x"<<ampi[i]->height <<"] "<<ampi[i]->x<<" "<<ampi[i]->y<<" "<<ampi[i]->w<<" "<<ampi[i]->h<<std::endl; vf_put_slice(s,ampi[i]); @@ -241,34 +240,34 @@ for(i=0;i<num_slices;i++) free_mp_image(ampi[i]); } else { mpxp_dbg2<<"Put whole frame["<<mpi->width<<"x"<<mpi->height<<"]"<<std::endl; - vf_put_slice(s,mpi); + mp_image_t dmpi=*mpi; + vf_put_slice(s,&dmpi); } free_mp_image(mpi); } } -static void update_subtitle(video_decoder_t& opaque,float v_pts,unsigned idx); -int mpcv_decode(video_decoder_t& opaque,const enc_frame_t& frame){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); +int VD_Interface::run(const enc_frame_t& frame) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); vf_stream_t* s; mp_image_t *mpi=NULL; unsigned int t; unsigned int t2; double tt; - s=priv->vfilter; + s=priv.vfilter; t=GetTimer(); vf_control(s,VFCTRL_START_FRAME,NULL); - priv->psi->active_slices=0; - mpi=priv->mpvdec->run(frame); + priv.psi.active_slices=0; + mpi=priv.mpvdec->run(frame); mpxp_dbg2<<"decvideo: decoding video "<<frame.len<<" bytes"<<std::endl; - while(priv->psi->active_slices!=0) yield_timeslice(); + while(priv.psi.active_slices!=0) yield_timeslice(); /* ------------------------ frame decoded. -------------------- */ if(!mpi) return 0; // error / skipped frame - mpcodecs_draw_image(opaque,mpi); + draw_image(mpi); t2=GetTimer();t=t2-t; tt = t*0.000001f; @@ -280,7 +279,7 @@ } if(frame.flags) return 0; - update_subtitle(opaque,frame.pts,mpi->xp_idx); + update_subtitle(frame.pts,mpi->xp_idx); mpxp_context().video().output->flush_page(dae_curr_vdecoded(mpxp_context().engine().xp_core)); t2=GetTimer()-t2; @@ -296,31 +295,27 @@ return 1; } -void mpcv_resync_stream(video_decoder_t& opaque) +void VD_Interface::resync_stream() const { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh_video = priv->parent; - if(sh_video) - if(sh_video->inited && priv->mpvdec) priv->mpvdec->ctrl(VDCTRL_RESYNC_STREAM,NULL); + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; + if(sh.inited && priv.mpvdec) priv.mpvdec->ctrl(VDCTRL_RESYNC_STREAM,NULL); } -#ifdef USE_SUB -static float sub_last_pts = -303; -#endif -static void update_subtitle(video_decoder_t& opaque,float v_pts,unsigned xp_idx) +void VD_Interface::update_subtitle(float v_pts,unsigned xp_idx) const { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh_video = priv->parent; - Demuxer_Stream *d_dvdsub=sh_video->ds->demuxer->sub; + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; + Demuxer_Stream *d_dvdsub=sh.ds->demuxer->sub; #ifdef USE_SUB // find sub if(mpxp_context().subtitles && v_pts>0){ float pts=v_pts; - if(mp_conf.sub_fps==0) mp_conf.sub_fps=sh_video->fps; + if(mp_conf.sub_fps==0) mp_conf.sub_fps=sh.fps; MP_UNIT("find_sub"); - if (pts > sub_last_pts || pts < sub_last_pts-1.0 ) { + if (pts > priv.sub_last_pts || pts < priv.sub_last_pts-1.0 ) { find_sub(mpxp_context().subtitles,sub_uses_time?(100*pts):(pts*mp_conf.sub_fps),mpxp_context().video().output); // FIXME! frame counter... - sub_last_pts = pts; + priv.sub_last_pts = pts; } MP_UNIT(NULL); } @@ -356,36 +351,34 @@ } } -#include "libvo2/video_out.h" - -MPXP_Rc mpcodecs_config_vf(video_decoder_t& opaque, int w, int h){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh = priv->parent; +MPXP_Rc VD_Interface::config_vf(int w, int h) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; int i,j; unsigned int out_fmt=0; int screen_size_x=0;//SCREEN_SIZE_X; int screen_size_y=0;//SCREEN_SIZE_Y; - vf_stream_t* s=priv->vfilter; + vf_stream_t* s=priv.vfilter; vf_conf_t conf; int palette=0; - if(!(sh->src_w && sh->src_h)) - mpxp_warn<<"VDec: driver "<<sh->codec->codec_name<<" didn't set sh->src_w and sh->src_h, trying to workaround!"<<std::endl; - /* XXX: HACK, if sh->disp_* aren't set, + if(!(sh.src_w && sh.src_h)) + mpxp_warn<<"VDec: driver "<<sh.codec->codec_name<<" didn't set sh.src_w and sh.src_h, trying to workaround!"<<std::endl; + /* XXX: HACK, if sh.disp_* aren't set, * but we have w and h, set them :: atmos */ - if(!sh->src_w && w) - sh->src_w=w; - if(!sh->src_h && h) - sh->src_h=h; + if(!sh.src_w && w) + sh.src_w=w; + if(!sh.src_h && h) + sh.src_h=h; mpxp_v<<"VDec: vo config request - "<<w<<" x "<<h<<std::endl; - if(vf_config(s,sh->src_w,sh->src_h, - sh->src_w,sh->src_h, + if(vf_config(s,sh.src_w,sh.src_h, + sh.src_w,sh.src_h, mpxp_context().video().output->flags, out_fmt)==0){ MSG_WARN(MSGTR_CannotInitVO); - priv->vfilter_inited=-1; + priv.vfilter_inited=-1; return MPXP_False; } @@ -394,16 +387,16 @@ j=-1; for(i=0;i<CODECS_MAX_OUTFMT;i++){ int flags; - out_fmt=sh->codec->outfmt[i]; + out_fmt=sh.codec->outfmt[i]; if(out_fmt==0xFFFFFFFF||out_fmt==0x0) continue; flags=vf_query_format(s,out_fmt,w,h); mpxp_dbg2<<"vo_debug[step i="<<i<<"]: query("<<vo_format_name(out_fmt)<<" "<<w<<"x"<<h<<") returned 0x"<<std::hex<<flags<<" for:"<<std::endl; if(mp_conf.verbose>1) vf_showlist(s); if((flags&VFCAP_CSP_SUPPORTED_BY_HW) || ((flags&VFCAP_CSP_SUPPORTED) && j<0)){ // check (query) if codec really support this outfmt... - sh->outfmtidx=j; // pass index to the control() function this way - if(priv->mpvdec->ctrl(VDCTRL_QUERY_FORMAT,&out_fmt)==MPXP_False) { - mpxp_dbg2<<"vo_debug: codec["<<priv->mpvdec->get_probe_information().driver<<"] query_format("<<vo_format_name(out_fmt)<<") returned FALSE"<<std::endl; + sh.outfmtidx=j; // pass index to the control() function this way + if(priv.mpvdec->ctrl(VDCTRL_QUERY_FORMAT,&out_fmt)==MPXP_False) { + mpxp_dbg2<<"vo_debug: codec["<<priv.mpvdec->get_probe_information().driver<<"] query_format("<<vo_format_name(out_fmt)<<") returned FALSE"<<std::endl; continue; } j=i; @@ -411,8 +404,8 @@ if(flags&VFCAP_CSP_SUPPORTED_BY_HW) break; } else if(!palette && !(mpxp_context().video().output->flags&3) && (out_fmt==IMGFMT_RGB8||out_fmt==IMGFMT_BGR8)){ - sh->outfmtidx=j; // pass index to the control() function this way - if(priv->mpvdec->ctrl(VDCTRL_QUERY_FORMAT,&out_fmt)!=MPXP_False) + sh.outfmtidx=j; // pass index to the control() function this way + if(priv.mpvdec->ctrl(VDCTRL_QUERY_FORMAT,&out_fmt)!=MPXP_False) palette=1; } } @@ -422,23 +415,23 @@ int ind; mpxp_warn<<"Can't find colorspace for: "; for(ind=0;ind<CODECS_MAX_OUTFMT;ind++) { - if(sh->codec->outfmt[ind]==0xFFFFFFFF|| - sh->codec->outfmt[ind]==0x0) break; - mpxp_warn<<"'"<<vo_format_name(sh->codec->outfmt[ind])<<"' "<<std::endl; + if(sh.codec->outfmt[ind]==0xFFFFFFFF|| + sh.codec->outfmt[ind]==0x0) break; + mpxp_warn<<"'"<<vo_format_name(sh.codec->outfmt[ind])<<"' "<<std::endl; } mpxp_warn<<"Trying -vf fmtcvt..."<<std::endl; - conf.w=sh->src_w; - conf.h=sh->src_h; - conf.fourcc=sh->codec->outfmt[sh->outfmtidx]; + conf.w=sh.src_w; + conf.h=sh.src_h; + conf.fourcc=sh.codec->outfmt[sh.outfmtidx]; vf_prepend_filter(s,"fmtcvt",&conf); goto csp_again; } else if(palette==1){ mpxp_v<<"vd: Trying -vf palette..."<<std::endl; palette=-1; - conf.w=sh->src_w; - conf.h=sh->src_h; - conf.fourcc=sh->codec->outfmt[sh->outfmtidx]; + conf.w=sh.src_w; + conf.h=sh.src_h; + conf.fourcc=sh.codec->outfmt[sh.outfmtidx]; vf_prepend_filter(s,"palette",&conf); goto csp_again; } else { @@ -447,45 +440,45 @@ if(strcmp(vf_get_first_name(s),"fmtcvt")==0) vf_remove_first(s); } MSG_WARN(MSGTR_VOincompCodec); - priv->vfilter_inited=-1; + priv.vfilter_inited=-1; return MPXP_False; // failed } - out_fmt=sh->codec->outfmt[j]; - sh->outfmtidx=j; + out_fmt=sh.codec->outfmt[j]; + sh.outfmtidx=j; // autodetect flipping if(vo_conf.flip==0){ mpxp_context().video().output->FLIP_UNSET(); - if(sh->codec->outflags[j]&CODECS_FLAG_FLIP) - if(!(sh->codec->outflags[j]&CODECS_FLAG_NOFLIP)) + if(sh.codec->outflags[j]&CODECS_FLAG_FLIP) + if(!(sh.codec->outflags[j]&CODECS_FLAG_NOFLIP)) mpxp_context().video().output->FLIP_SET(); } if(mpxp_context().video().output->flags&VFCAP_FLIPPED) mpxp_context().video().output->FLIP_REVERT(); if(mpxp_context().video().output->FLIP() && !(mpxp_context().video().output->flags&VFCAP_FLIP)){ // we need to flip, but no flipping filter avail. - conf.w=sh->src_w; - conf.h=sh->src_h; + conf.w=sh.src_w; + conf.h=sh.src_h; conf.fourcc=out_fmt; vf_prepend_filter(s,"flip",&conf); } // time to do aspect ratio corrections... - if(vo_conf.movie_aspect>-1.0) sh->aspect = vo_conf.movie_aspect; // cmdline overrides autodetect + if(vo_conf.movie_aspect>-1.0) sh.aspect = vo_conf.movie_aspect; // cmdline overrides autodetect if(vo_conf.image_width||vo_conf.image_height){ screen_size_x = vo_conf.image_width; screen_size_y = vo_conf.image_height; if(!vo_conf.vidmode){ if(!screen_size_x) screen_size_x=1; if(!screen_size_y) screen_size_y=1; - if(screen_size_x<=8) screen_size_x*=sh->src_w; - if(screen_size_y<=8) screen_size_y*=sh->src_h; + if(screen_size_x<=8) screen_size_x*=sh.src_w; + if(screen_size_y<=8) screen_size_y*=sh.src_h; } } else { // check source format aspect, calculate prescale ::atmos - screen_size_x=sh->src_w; - screen_size_y=sh->src_h; + screen_size_x=sh.src_w; + screen_size_y=sh.src_h; if(vo_conf.image_zoom>=0.001){ if(vo_conf.image_zoom<=8){ // -xy means x+y scale @@ -494,37 +487,37 @@ } else { // -xy means forced width while keeping correct aspect screen_size_x=vo_conf.image_zoom; - screen_size_y=vo_conf.image_zoom*sh->src_h/sh->src_w; + screen_size_y=vo_conf.image_zoom*sh.src_h/sh.src_w; } } - if(sh->aspect>0.01){ + if(sh.aspect>0.01){ int _w; - mpxp_v<<"Movie-Aspect is "<<sh->aspect<<":1 - prescaling to correct movie aspect."<<std::endl; - _w=(int)((float)screen_size_y*sh->aspect); _w+=_w%2; // round + mpxp_v<<"Movie-Aspect is "<<sh.aspect<<":1 - prescaling to correct movie aspect."<<std::endl; + _w=(int)((float)screen_size_y*sh.aspect); _w+=_w%2; // round // we don't like horizontal downscale || user forced width: if(_w<screen_size_x || vo_conf.image_zoom>8){ - screen_size_y=(int)((float)screen_size_x*(1.0/sh->aspect)); + screen_size_y=(int)((float)screen_size_x*(1.0/sh.aspect)); screen_size_y+=screen_size_y%2; // round - if(unsigned(screen_size_y)<sh->src_h) // Do not downscale verticaly - screen_size_y=sh->src_h; + if(unsigned(screen_size_y)<sh.src_h) // Do not downscale verticaly + screen_size_y=sh.src_h; } else screen_size_x=_w; // keep new width } else { mpxp_v<<"Movie-Aspect is undefined - no prescaling applied."<<std::endl; } } - mpxp_v<<"vf->config("<<sh->src_w<<"x"<<sh->src_h<<"->"<<screen_size_x<<"x"<<screen_size_y<<",flags=0x"<<std::hex + mpxp_v<<"vf->config("<<sh.src_w<<"x"<<sh.src_h<<"->"<<screen_size_x<<"x"<<screen_size_y<<",flags=0x"<<std::hex <<mpxp_context().video().output->flags<<",'"<<"MPlayerXP"<<"',"<<vo_format_name(out_fmt)<<std::endl; - if(vf_config(s,sh->src_w,sh->src_h, + if(vf_config(s,sh.src_w,sh.src_h, screen_size_x,screen_size_y, mpxp_context().video().output->flags, out_fmt)==0){ MSG_WARN(MSGTR_CannotInitVO); - priv->vfilter_inited=-1; + priv.vfilter_inited=-1; return MPXP_False; } - mpxp_dbg2<<"vf->config("<<sh->src_w<<"x"<<sh->src_h<<"->"<<screen_size_x<<"x"<<screen_size_y + mpxp_dbg2<<"vf->config("<<sh.src_w<<"x"<<sh.src_h<<"->"<<screen_size_x<<"x"<<screen_size_y <<",flags="<<mpxp_context().video().output->flags<<",'"<<vo_format_name(out_fmt)<<"')"<<std::endl; return MPXP_True; } @@ -533,20 +526,21 @@ // mp_imgflag: buffer requirements (read/write, preserve, stride limits), see xmp_image.h // returns NULL or allocated mp_image_t* // Note: buffer allocation may be moved to mpcodecs_config_vf() later... -mp_image_t* mpcodecs_get_image(video_decoder_t& opaque, int mp_imgtype, int mp_imgflag,int w, int h){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh = priv->parent; - vf_stream_t* s = priv->vfilter; - mp_image_t* mpi=vf_get_new_image(s,sh->codec->outfmt[sh->outfmtidx],mp_imgtype,mp_imgflag,w,h,dae_curr_vdecoded(mpxp_context().engine().xp_core)); +mp_image_t* VD_Interface::get_image(int mp_imgtype, int mp_imgflag,int w, int h) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; + vf_stream_t* s = priv.vfilter; + mp_image_t* mpi=vf_get_new_image(s,sh.codec->outfmt[sh.outfmtidx],mp_imgtype,mp_imgflag,w,h,dae_curr_vdecoded(mpxp_context().engine().xp_core)); mpi->x=mpi->y=0; if(mpi->xp_idx==XP_IDX_INVALID) mpxp_v<<"[mpcodecs_get_image] Incorrect mpi->xp_idx. Be ready for segfault!"<<std::endl; return mpi; } -void mpcodecs_draw_slice(video_decoder_t& opaque, mp_image_t*mpi) { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - vf_stream_t* vf = priv->vfilter; - vf_put_slice(vf,mpi); +void VD_Interface::draw_slice(const mp_image_t* mpi) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + vf_stream_t* vf = priv.vfilter; + mp_image_t dmpi = *mpi; + vf_put_slice(vf,&dmpi); } } // namespace usr \ No newline at end of file Modified: mplayerxp/libmpcodecs/dec_video.h =================================================================== --- mplayerxp/libmpcodecs/dec_video.h 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/dec_video.h 2013-06-11 17:36:43 UTC (rev 652) @@ -5,21 +5,34 @@ namespace usr { struct libinput_t; + class Video_Decoder; + struct vd_info_t; + struct put_slice_info_t; - struct video_decoder_t { - Opaque* vd_private; - }; + class VD_Interface : public Opaque { + public: + VD_Interface(sh_video_t& sh_video, const std::string& codec_name,const std::string& family,int status,libinput_t&libinput); + virtual ~VD_Interface(); -// dec_video.c: - video_decoder_t* __FASTCALL__ mpcv_init(sh_video_t *sh_video, const std::string& codec_name,const std::string& family,int status,libinput_t&libinput); - void __FASTCALL__ mpcv_uninit(video_decoder_t& handle); - int __FASTCALL__ mpcv_decode(video_decoder_t& handle,const enc_frame_t& frame); + virtual int run(const enc_frame_t& frame) const; - MPXP_Rc __FASTCALL__ mpcv_get_quality_max(video_decoder_t& handle,unsigned& quality); - MPXP_Rc __FASTCALL__ mpcv_set_quality(video_decoder_t& handle,int quality); - MPXP_Rc __FASTCALL__ mpcv_set_colors(video_decoder_t& handle,const std::string& item,int value); - void __FASTCALL__ mpcv_resync_stream(video_decoder_t& handle); + virtual MPXP_Rc get_quality_max(unsigned& quality) const; + virtual MPXP_Rc set_quality(int quality) const; + virtual MPXP_Rc set_colors(const std::string& item,int value) const; + virtual void resync_stream() const; - void vfm_help(void); + virtual MPXP_Rc config_vf(int w, int h) const; + virtual mp_image_t* get_image(int mp_imgtype, int mp_imgflag,int w, int h) const; + virtual void draw_slice(const mp_image_t*) const; + virtual void draw_image(const mp_image_t*) const; + static void print_help(); + private: + void print_codec_info() const; + void update_subtitle(float v_pts,unsigned idx) const; + const vd_info_t* find_driver(const std::string& name); + Video_Decoder* probe_driver(sh_video_t& sh,put_slice_info_t& psi); + + Opaque& vd_private; + }; } // namepsace usr #endif Modified: mplayerxp/libmpcodecs/vd.cpp =================================================================== --- mplayerxp/libmpcodecs/vd.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/vd.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -73,7 +73,7 @@ cfg.register_options(mpcodecs_vd_drivers[i]->options); } -const vd_info_t* vfm_find_driver(const std::string& name) { +const vd_info_t* VD_Interface::find_driver(const std::string& name) { unsigned i; for (i=0; mpcodecs_vd_drivers[i] != &vd_null_info; i++) if(name==mpcodecs_vd_drivers[i]->driver_name) { @@ -82,13 +82,13 @@ return NULL; } -Video_Decoder* vfm_probe_driver(video_decoder_t& handle,sh_video_t& sh,put_slice_info_t& psi) { +Video_Decoder* VD_Interface::probe_driver(sh_video_t& sh,put_slice_info_t& psi) { unsigned i; Video_Decoder* drv=NULL; for (i=0; mpcodecs_vd_drivers[i] != &vd_null_info; i++) { mpxp_v<<"Probing: "<<mpcodecs_vd_drivers[i]->driver_name<<std::endl; try { - drv = mpcodecs_vd_drivers[i]->query_interface(handle,sh,psi,sh.fourcc); + drv = mpcodecs_vd_drivers[i]->query_interface(*this,sh,psi,sh.fourcc); mpxp_v<<"ok"<<std::endl; mpxp_v<<"Driver: "<<mpcodecs_vd_drivers[i]->driver_name<<" supports these outfmt for "; fourcc(mpxp_v,sh.fourcc); @@ -110,7 +110,7 @@ return drv; } -void vfm_help() { +void VD_Interface::print_help() { unsigned i; mpxp_info<<"Available video codec families/drivers:"<<st... [truncated message content] |
From: <nic...@us...> - 2013-06-14 21:51:07
|
Revision: 655 http://sourceforge.net/p/mplayerxp/code/655 Author: nickols_k Date: 2013-06-14 21:51:03 +0000 (Fri, 14 Jun 2013) Log Message: ----------- remove exit_player() + escape_player() and fix segfault in cfgparser.cpp Modified Paths: -------------- mplayerxp/input2/input.cpp mplayerxp/libmpconf/cfgparser.cpp mplayerxp/libvo2/x11_system.cpp mplayerxp/main.cpp mplayerxp/mplayerxp.h mplayerxp/osdep/mplib.cpp mplayerxp/osdep/mplib.h mplayerxp/postproc/postprocess.cpp mplayerxp/xmpcore/xmp_vdecoder.cpp Modified: mplayerxp/input2/input.cpp =================================================================== --- mplayerxp/input2/input.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/input2/input.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -1361,7 +1361,7 @@ static int mp_input_print_key_list(libinput_t& handle) { mp_input_print_keys(handle); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } void mp_input_print_binds(libinput_t& handle) { @@ -1407,7 +1407,7 @@ static int mp_input_print_cmd_list(libinput_t& handle) { mp_input_print_cmds(handle); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } MPXP_Rc mp_input_check_interrupt(libinput_t& handle,int tim) { Modified: mplayerxp/libmpconf/cfgparser.cpp =================================================================== --- mplayerxp/libmpconf/cfgparser.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/libmpconf/cfgparser.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -12,6 +12,7 @@ #include <limits> #include <iostream> #include <fstream> +#include <sstream> #include <stdexcept> #include <stdlib.h> @@ -268,7 +269,7 @@ break; case CONF_TYPE_PRINT: mpxp_info<<(char *)conf[i].p; - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); default: mpxp_err<<"read_option: Unknown config type specified in conf-mplayerxp.h!"<<std::endl; break; @@ -531,11 +532,11 @@ opt = argv[i]; if(opt=="--help") { show_help(); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } if(opt=="--long-help") { show_long_help(*this,envm); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } /* check for -- (no more options id.) except --help! */ if (opt[0] == '-' && opt[1] == '-') { @@ -774,19 +775,18 @@ for(n=0;n<ntabs;n++) mpxp_info<<" "; mpxp_info<<opts[i].help<<":"<<std::endl; pfxlen=strlen(opts[i].name)+1; - if(!pfx.empty()) pfxlen+=pfx.length(); - if(!pfx.empty()) newpfx=pfx; + if(!pfx.empty()) { pfxlen+=pfx.length(); newpfx=pfx; } else newpfx=""; newpfx+=opts[i].name; newpfx+="."; __show_options(ntabs+2,newpfx,(const mpxp_option_t *)opts[i].p); - } - else - if(opts[i].type<=CONF_TYPE_PRINT) { + } else if(opts[i].type<=CONF_TYPE_PRINT) { + std::ostringstream os; for(n=0;n<ntabs;n++) mpxp_info<<" "; - if(!pfx.empty()) mpxp_info<<std::left<<pfx<<std::endl; - else mpxp_info<<" "<<std::endl; - mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; + if(!pfx.empty()) os<<std::left<<pfx; + else os<<" "; + os<<opts[i].name; + mpxp_info<<std::left<<std::setw(25)<<os.str()<<" "<<opts[i].help; if((opts[i].flags&CONF_NOCFG)==0) { mpxp_info<<" {"<< (opts[i].type==CONF_TYPE_FLAG?"flg": @@ -803,7 +803,7 @@ break; case CONF_TYPE_STRING: { const char **defv = (const char**)(opts[i].p); - if(defv) mpxp_info<<"\""<<*defv<<"\""; + if(defv && *defv) mpxp_info<<"\""<<*defv<<"\""; } break; case CONF_TYPE_INT: { Modified: mplayerxp/libvo2/x11_system.cpp =================================================================== --- mplayerxp/libvo2/x11_system.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/libvo2/x11_system.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -41,7 +41,8 @@ mpxp_err<<"X11_System: "<<msg<<std::endl; mpxp_v<<"Type: "<<std::hex<<event->type<<", display: "<<std::hex<<event->display<<", resourceid: "<<std::hex<<event->resourceid<<", serial: "<<event->serial<<std::endl; mpxp_v<<"Error code: "<<std::hex<<event->error_code<<", request code: "<<std::hex<<event->request_code<<", minor code: "<<event->minor_code<<std::endl; - escape_player("X11_System error",mp_conf.max_trace); + show_backtrace("X11_System error",mp_conf.max_trace); + throw std::runtime_error("X11_System error"); return 0; } Modified: mplayerxp/main.cpp =================================================================== --- mplayerxp/main.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/main.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -362,26 +362,6 @@ MP_UNIT(NULL); } -class soft_exit_exception : public std::exception { - public: - soft_exit_exception(const std::string& why) throw(); - virtual ~soft_exit_exception() throw(); - - virtual const char* what() const throw(); - private: - std::string why; -}; - -soft_exit_exception::soft_exit_exception(const std::string& _why) throw() { why=_why; } -soft_exit_exception::~soft_exit_exception() throw() {} -const char* soft_exit_exception::what() const throw() { return why.c_str(); } - -void exit_player(const std::string& why) -{ - if(!why.empty()) throw soft_exit_exception(why); - throw std::exception(); -} - void __exit_sighandler() { static int sig_count=0; @@ -393,14 +373,14 @@ kill(getpid(),SIGKILL); return; } - exit_player(""); + throw std::exception(); } void exit_sighandler(void) { - xmp_killall_threads(pthread_self()); - __exit_sighandler(); + xmp_killall_threads(pthread_self()); + __exit_sighandler(); } // When libmpdemux perform a blocking operation (network connection or cache filling) @@ -413,7 +393,7 @@ switch(cmd->id) { case MP_CMD_QUIT: case MP_CMD_SOFT_QUIT: // should never happen - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); case MP_CMD_PLAY_TREE_STEP: { eof = (cmd->args[0].v.i > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY; } break; @@ -1310,9 +1290,9 @@ osd_function=OSD_PAUSE; break; case MP_CMD_SOFT_QUIT : - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); case MP_CMD_QUIT : - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); case MP_CMD_PLAY_TREE_STEP : { int n = cmd->args[0].v.i > 0 ? 1 : -1; PlayTree_Iter* it = new PlayTree_Iter(*playtree_iter); @@ -1568,7 +1548,7 @@ if(filename.empty()){ show_help(); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } // Many users forget to include command line in bugreports... Modified: mplayerxp/mplayerxp.h =================================================================== --- mplayerxp/mplayerxp.h 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/mplayerxp.h 2013-06-14 21:51:03 UTC (rev 655) @@ -205,21 +205,15 @@ extern pthread_mutex_t audio_timer_mutex; - void exit_player(const std::string& why); - /* 10 ms or 10'000 microsecs is optimal time for thread sleeping */ inline int yield_timeslice() { return ::usleep(10000); } - inline void escape_player(const std::string& why,unsigned num_calls) { - show_backtrace(why,num_calls); - throw std::runtime_error(why); - } - inline MPXP_Rc check_pin(const std::string& module,unsigned pin1,unsigned pin2) { if(pin1!=pin2) { std::string msg; msg=std::string("Found incorrect PIN in module: ")+module; - escape_player(msg,mp_conf.max_trace); + show_backtrace(msg,mp_conf.max_trace); + throw std::runtime_error(msg); } return MPXP_Ok; } Modified: mplayerxp/osdep/mplib.cpp =================================================================== --- mplayerxp/osdep/mplib.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/osdep/mplib.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -74,4 +74,8 @@ missing_driver_exception::missing_driver_exception() throw() {} missing_driver_exception::~missing_driver_exception() throw() {} const char* missing_driver_exception::what() const throw() { return "missing driver"; } + +soft_exit_exception::soft_exit_exception(const std::string& _why) throw() { why=_why; } +soft_exit_exception::~soft_exit_exception() throw() {} +const char* soft_exit_exception::what() const throw() { return why.c_str(); } } // namespace usr Modified: mplayerxp/osdep/mplib.h =================================================================== --- mplayerxp/osdep/mplib.h 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/osdep/mplib.h 2013-06-14 21:51:03 UTC (rev 655) @@ -65,5 +65,15 @@ virtual const char* what() const throw(); }; + + class soft_exit_exception : public std::exception { + public: + soft_exit_exception(const std::string& why) throw(); + virtual ~soft_exit_exception() throw(); + + virtual const char* what() const throw(); + private: + std::string why; + }; } // namespace usr #endif Modified: mplayerxp/postproc/postprocess.cpp =================================================================== --- mplayerxp/postproc/postprocess.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/postproc/postprocess.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -30,7 +30,7 @@ { if(strcmp(mp_conf.npp_options,"help")==0) { mpxp_info<<pp_help<<std::endl; - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } return 1; } Modified: mplayerxp/xmpcore/xmp_vdecoder.cpp =================================================================== --- mplayerxp/xmpcore/xmp_vdecoder.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/xmpcore/xmp_vdecoder.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -192,7 +192,10 @@ if(cur_time - mpxp_context().seek_time > (mpxp_context().engine().xp_core->num_v_buffs/sh_video->fps)*100) xp_n_frame_to_drop=compute_frame_dropping(sh_video,frame->pts,drop_barrier); } /* if( mp_conf.frame_dropping ) */ if(!finite(frame->pts)) mpxp_warn<<"Bug of demuxer! Value of video pts="<<frame->pts<<std::endl; - if(frame->type!=VideoFrame) escape_player("VideoDecoder doesn't parse non video frames",mp_conf.max_trace); + if(frame->type!=VideoFrame) { + show_backtrace("VideoDecoder doesn't parse non video frames",mp_conf.max_trace); + throw std::runtime_error("VideoDecoder doesn't parse non video frames"); + } #if 0 /* We can't seriously examine question of too slow machines This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |