Thread: [Mplayerxp-cvslog] SF.net SVN: mplayerxp:[1] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2009-12-03 18:23:37
|
Revision: 1 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=1&view=rev Author: nickols_k Date: 2009-12-03 18:23:02 +0000 (Thu, 03 Dec 2009) Log Message: ----------- initial import after CVS Added Paths: ----------- AUTHORS COPYING DOCS/ DOCS/Makefile DOCS/README DOCS/configure DOCS/mplayerxp.1 DOCS/tech/ DOCS/tech/mpxpav64.txt Dependencies INSTALL Makefile NEWS README TODO TOOLS/ TOOLS/GL-test/ TOOLS/GL-test/compile.sh TOOLS/GL-test/gltest.c TOOLS/Makefile TOOLS/alaw-gen.c TOOLS/asfinfo.c TOOLS/asmopt.c TOOLS/asmopt.sh TOOLS/asmopt_template.h TOOLS/audio-block.c TOOLS/audio-block2.c TOOLS/audio-select.c TOOLS/benchmark/ TOOLS/benchmark/test-all.sh TOOLS/benchmark/test.sh TOOLS/benchmark/test1.sh TOOLS/bios2dump.c TOOLS/blocking.c TOOLS/buffer.c TOOLS/cache.c TOOLS/cache2.c TOOLS/cpuinfo.c TOOLS/cygwin_inttypes.h TOOLS/dlrun.c TOOLS/fastmem.sh TOOLS/fastmemcpybench.c TOOLS/mem2dump.c TOOLS/menc2pass TOOLS/mmx2c.c TOOLS/movinfo.c TOOLS/mp.pl TOOLS/mpconsole TOOLS/mpfc/ TOOLS/mpfc/Makefile TOOLS/mpfc/mpfc-ce.c TOOLS/mpfc/mpfc-kr.c TOOLS/perlbench.pl TOOLS/png2raw.c TOOLS/subfont-c/ TOOLS/subfont-c/Makefile TOOLS/subfont-c/README TOOLS/subfont-c/encodings/ TOOLS/subfont-c/encodings/charmap2enc TOOLS/subfont-c/encodings/osd-mplayer TOOLS/subfont-c/encodings/runme-kr TOOLS/subfont-c/font.desc.tail TOOLS/subfont-c/fontgen TOOLS/subfont-c/osd/ TOOLS/subfont-c/osd/README TOOLS/subfont-c/osd/gen.py TOOLS/subfont-c/osd/osd.pfb TOOLS/subfont-c/osd/runme TOOLS/subfont-c/runme TOOLS/subfont-c/subfont.c TOOLS/subfont-gimp/ TOOLS/subfont-gimp/Makefile TOOLS/subfont-gimp/mplayer_subfont TOOLS/usleep-test.c TOOLS/vivodump.c TOOLS/x2mpsub.sh TVout/ TVout/Mon-640x400 TVout/Mon-640x480 TVout/TV-640x512 TVout/TV-640x528 TVout/TV-704x528 TVout/TV-704x576 TVout/TV-720x576 TVout/TV-720x576-old TVout/cloning TVout/con2fb/ TVout/con2fb/con2fb.c TVout/fbset/ TVout/fbset/INSTALL TVout/fbset/Makefile TVout/fbset/fb.h TVout/fbset/fb.modes.5 TVout/fbset/fbset.8 TVout/fbset/fbset.c TVout/fbset/fbset.h TVout/fbset/modeline2fb TVout/fbset.db TVout/independ TVout/matroxfbtune TVout/matroxset/ TVout/matroxset/Makefile TVout/matroxset/fb.h TVout/matroxset/matroxset.c TVout/matroxset/normal TVout/matroxset/swapit TVout/matroxset/swapped TVout/matroxtv TVout/modules codecs/ codecs/Makefile codecs/RTjpegN.c codecs/RTjpegN.h codecs/bswap.h codecs/common.mak codecs/configure codecs/img_format.h codecs/liba52/ codecs/liba52/Makefile codecs/liba52/a52.h codecs/liba52/a52_internal.h codecs/liba52/bit_allocate.c codecs/liba52/bitstream.c codecs/liba52/bitstream.h codecs/liba52/crc.c codecs/liba52/downmix.c codecs/liba52/downmix_mmx.h codecs/liba52/imdct.c codecs/liba52/imdct_mmx.h codecs/liba52/liba52.txt codecs/liba52/mangle.h codecs/liba52/parse.c codecs/liba52/resample.c codecs/liba52/resample_c.c codecs/liba52/resample_mmx.c codecs/liba52/tables.h codecs/libavcodec.diff codecs/libavformat.diff codecs/libavutil.diff codecs/libdca/ codecs/libdca/Makefile codecs/libdca/bitstream.c codecs/libdca/bitstream.h codecs/libdca/dca.h codecs/libdca/dca_internal.h codecs/libdca/downmix.c codecs/libdca/downmix_mmx.h codecs/libdca/libdca.txt codecs/libdca/mangle.h codecs/libdca/parse.c codecs/libdca/resample.c codecs/libdca/resample_c.c codecs/libdca/resample_mmx.c codecs/libdca/tables.h codecs/libdca/tables_adpcm.h codecs/libdca/tables_fir.h codecs/libdca/tables_huffman.h codecs/libdca/tables_quantization.h codecs/libdca/tables_vq.h codecs/libfaad2/ codecs/libfaad2/Makefile codecs/libfaad2/README codecs/libfaad2/analysis.h codecs/libfaad2/bits.c codecs/libfaad2/bits.h codecs/libfaad2/cfft.c codecs/libfaad2/cfft.h codecs/libfaad2/cfft_tab.h codecs/libfaad2/codebook/ codecs/libfaad2/codebook/hcb.h codecs/libfaad2/codebook/hcb_1.h codecs/libfaad2/codebook/hcb_10.h codecs/libfaad2/codebook/hcb_11.h codecs/libfaad2/codebook/hcb_2.h codecs/libfaad2/codebook/hcb_3.h codecs/libfaad2/codebook/hcb_4.h codecs/libfaad2/codebook/hcb_5.h codecs/libfaad2/codebook/hcb_6.h codecs/libfaad2/codebook/hcb_7.h codecs/libfaad2/codebook/hcb_8.h codecs/libfaad2/codebook/hcb_9.h codecs/libfaad2/codebook/hcb_sf.h codecs/libfaad2/common.c codecs/libfaad2/common.h codecs/libfaad2/decoder.c codecs/libfaad2/decoder.h codecs/libfaad2/drc.c codecs/libfaad2/drc.h codecs/libfaad2/error.c codecs/libfaad2/error.h codecs/libfaad2/faad.h codecs/libfaad2/filtbank.c codecs/libfaad2/filtbank.h codecs/libfaad2/fixed.h codecs/libfaad2/hcr.c codecs/libfaad2/huffman.c codecs/libfaad2/huffman.h codecs/libfaad2/i386/ codecs/libfaad2/i386/cfft.h codecs/libfaad2/i386/filtbank.h codecs/libfaad2/i386/mdct.h codecs/libfaad2/i386/output.h codecs/libfaad2/i386/sbr_qmf.h codecs/libfaad2/i386/specrec.h codecs/libfaad2/ic_predict.c codecs/libfaad2/ic_predict.h codecs/libfaad2/iq_table.h codecs/libfaad2/is.c codecs/libfaad2/is.h codecs/libfaad2/kbd_win.h codecs/libfaad2/lt_predict.c codecs/libfaad2/lt_predict.h codecs/libfaad2/mdct.c codecs/libfaad2/mdct.h codecs/libfaad2/mp4.c codecs/libfaad2/mp4.h codecs/libfaad2/ms.c codecs/libfaad2/ms.h codecs/libfaad2/output.c codecs/libfaad2/output.h codecs/libfaad2/pns.c codecs/libfaad2/pns.h codecs/libfaad2/pulse.c codecs/libfaad2/pulse.h codecs/libfaad2/rvlc.c codecs/libfaad2/rvlc.h codecs/libfaad2/sbr_dct.c codecs/libfaad2/sbr_dct.h codecs/libfaad2/sbr_dec.c codecs/libfaad2/sbr_dec.h codecs/libfaad2/sbr_e_nf.c codecs/libfaad2/sbr_e_nf.h codecs/libfaad2/sbr_fbt.c codecs/libfaad2/sbr_fbt.h codecs/libfaad2/sbr_hfadj.c codecs/libfaad2/sbr_hfadj.h codecs/libfaad2/sbr_hfgen.c codecs/libfaad2/sbr_hfgen.h codecs/libfaad2/sbr_huff.c codecs/libfaad2/sbr_huff.h codecs/libfaad2/sbr_noise.h codecs/libfaad2/sbr_qmf.c codecs/libfaad2/sbr_qmf.h codecs/libfaad2/sbr_qmf_c.h codecs/libfaad2/sbr_syntax.c codecs/libfaad2/sbr_syntax.h codecs/libfaad2/sbr_tf_grid.c codecs/libfaad2/sbr_tf_grid.h codecs/libfaad2/sine_win.h codecs/libfaad2/specrec.c codecs/libfaad2/specrec.h codecs/libfaad2/ssr.c codecs/libfaad2/ssr.h codecs/libfaad2/ssr_fb.c codecs/libfaad2/ssr_fb.h codecs/libfaad2/ssr_ipqf.c codecs/libfaad2/ssr_ipqf.h codecs/libfaad2/ssr_win.h codecs/libfaad2/structs.h codecs/libfaad2/syntax.c codecs/libfaad2/syntax.h codecs/libfaad2/tns.c codecs/libfaad2/tns.h codecs/libmpeg2/ codecs/libmpeg2/Makefile codecs/libmpeg2/alloc.c codecs/libmpeg2/alpha_asm.h codecs/libmpeg2/attributes.h codecs/libmpeg2/cpu_state.c codecs/libmpeg2/decode.c codecs/libmpeg2/header.c codecs/libmpeg2/idct.c codecs/libmpeg2/idct_alpha.c codecs/libmpeg2/idct_altivec.c codecs/libmpeg2/idct_mmx.c codecs/libmpeg2/mm_accel.h codecs/libmpeg2/mmx.h codecs/libmpeg2/motion_comp.c codecs/libmpeg2/motion_comp_alpha.c codecs/libmpeg2/motion_comp_altivec.c codecs/libmpeg2/motion_comp_mmx.c codecs/libmpeg2/motion_comp_vis.c codecs/libmpeg2/mpeg2.h codecs/libmpeg2/mpeg2_internal.h codecs/libmpeg2/mpeg2convert.h codecs/libmpeg2/slice.c codecs/libmpeg2/tendra.h codecs/libmpeg2/vis.h codecs/libmpeg2/vlc.h codecs/libpostproc.diff codecs/lzoconf.h codecs/mangle.h codecs/minilzo.c codecs/minilzo.h codecs/mm_accel.h codecs/mmfourcc.h codecs/mmx.h codecs/mp3lib/ codecs/mp3lib/Makefile codecs/mp3lib/bswap.h codecs/mp3lib/cpudetect.c codecs/mp3lib/dct12.c codecs/mp3lib/dct36.c codecs/mp3lib/dct36_3dnow.c codecs/mp3lib/dct64.c codecs/mp3lib/dct64_k7.c codecs/mp3lib/decod386.c codecs/mp3lib/decode_3dnow.c codecs/mp3lib/decode_3dnow.h codecs/mp3lib/equalizer.c codecs/mp3lib/huffman.h codecs/mp3lib/l2tables.h codecs/mp3lib/layer1.c codecs/mp3lib/layer2.c codecs/mp3lib/layer3.c codecs/mp3lib/mp3.h codecs/mp3lib/mp3lib_objfix.sh codecs/mp3lib/mpg123.h codecs/mp3lib/sr1.c codecs/mp3lib/tabinit.c codecs/mp3lib/test.c codecs/mp3lib/test2.c codecs/mp_image.h codecs/nuppelvideo.c codecs/nuppelvideo.h codecs/subdir.mak config.guess config.sub configure debian/ debian/README.debian debian/TODO.Debian debian/changelog debian/config debian/control debian/copyright debian/dirs debian/menu debian/postinst debian/postinst.templates debian/rules debian/templates etc/ etc/Makefile etc/codec_diff.sh etc/codecs.conf etc/configure etc/cygwin_inttypes.h etc/eqbands etc/example.conf etc/input.conf etc/inttypes.h etc/menu.conf functions linux.drivers/ linux.drivers/3dfx.h linux.drivers/Makefile linux.drivers/README linux.drivers/mga_vid.c linux.drivers/mga_vid.h linux.drivers/mga_vid_test.c linux.drivers/radeon/ linux.drivers/radeon/Makefile linux.drivers/radeon/README linux.drivers/radeon/Rage128.readme linux.drivers/radeon/generic_math.h linux.drivers/radeon/hacking linux.drivers/radeon/radeon.h linux.drivers/radeon/radeon_vid.c linux.drivers/radeon/radeon_vid.h linux.drivers/radeon/radeonfb.c linux.drivers/sis_vid.c linux.drivers/sis_vid.h linux.drivers/syncfb/ linux.drivers/syncfb/Makefile linux.drivers/syncfb/README linux.drivers/syncfb/fb.modes linux.drivers/syncfb/syncfb.h linux.drivers/syncfb/syncfb_base.c linux.drivers/syncfb/syncfb_generic.c linux.drivers/syncfb/syncfb_matrox.c linux.drivers/syncfb/syncfb_matrox.h linux.drivers/syncfb/syncfb_off.c linux.drivers/syncfb/syncfb_test.c loader/ loader/Makefile loader/afl.c loader/com.h loader/configure loader/cpudetect.c loader/cpudetect.h loader/dmo/ loader/dmo/DMO_AudioDecoder.c loader/dmo/DMO_AudioDecoder.h loader/dmo/DMO_Filter.h loader/dmo/DMO_VideoDecoder.c loader/dmo/DMO_VideoDecoder.h loader/dmo/Makefile loader/dmo/buffer.c loader/dmo/dmo.c loader/dmo/dmo.h loader/dmo/dmo_guids.c loader/dmo/dmo_guids.h loader/dmo/dmo_interfaces.h loader/driver.c loader/driver.h loader/dshow/ loader/dshow/DS_AudioDecoder.c loader/dshow/DS_AudioDecoder.h loader/dshow/DS_Filter.c loader/dshow/DS_Filter.h loader/dshow/DS_VideoDecoder.c loader/dshow/DS_VideoDecoder.h loader/dshow/Makefile loader/dshow/allocator.c loader/dshow/allocator.h loader/dshow/aviprint.c loader/dshow/cmediasample.c loader/dshow/cmediasample.h loader/dshow/guids.c loader/dshow/guids.h loader/dshow/inputpin.c loader/dshow/inputpin.h loader/dshow/interfaces.h loader/dshow/iunk.h loader/dshow/libwin32.h loader/dshow/mediatype.c loader/dshow/mediatype.h loader/dshow/outputpin.c loader/dshow/outputpin.h loader/dshow/test.c loader/dshow/test.divx loader/elfdll.c loader/ext.c loader/ext.h loader/get_path.c loader/ldt_keeper.c loader/ldt_keeper.h loader/loader.h loader/mangle.h loader/module.c loader/pe_image.c loader/pe_resource.c loader/qt_comp.h loader/qt_fv.h loader/qtx/ loader/qtx/qtxsdk/ loader/qtx/qtxsdk/components.h loader/qtx/qtxsdk/select.h loader/registry.c loader/registry.h loader/resource.c loader/vfl.c loader/win32.c loader/win32.h loader/wine/ loader/wine/avifmt.h loader/wine/basetsd.h loader/wine/debugtools.h loader/wine/driver.h loader/wine/elfdll.h loader/wine/heap.h loader/wine/ldt.h loader/wine/mmreg.h loader/wine/module.h loader/wine/msacm.h loader/wine/msacmdrv.h loader/wine/ntdef.h loader/wine/objbase.h loader/wine/pe_image.h loader/wine/poppack.h loader/wine/pshpack1.h loader/wine/pshpack2.h loader/wine/pshpack4.h loader/wine/pshpack8.h loader/wine/vfw.h loader/wine/winbase.h loader/wine/windef.h loader/wine/windows.h loader/wine/winerror.h loader/wine/winestring.h loader/wine/winnt.h loader/wine/winreg.h loader/wine/winuser.h loader/wineacm.h loader/wrapper.S loader/wrapper.h mplayerxp/ mplayerxp/Makefile mplayerxp/__mp_msg.h mplayerxp/asxparser.c mplayerxp/asxparser.h mplayerxp/bswap.h mplayerxp/cfg-common.h mplayerxp/cfg-mplayer-def.h mplayerxp/cfg-mplayer.h mplayerxp/cfgparser.c mplayerxp/cfgparser.h mplayerxp/codec-cfg.c mplayerxp/codec-cfg.h mplayerxp/configure mplayerxp/cpudetect.c mplayerxp/cpudetect.h mplayerxp/cpuinfo.c mplayerxp/cputable.h mplayerxp/dec_ahead.c mplayerxp/dec_ahead.h mplayerxp/dump.c mplayerxp/dump.h mplayerxp/fibmap_mplayer.c mplayerxp/fifo.c mplayerxp/fifo.h mplayerxp/find_sub.c mplayerxp/input/ mplayerxp/input/Makefile mplayerxp/input/in_msg.h mplayerxp/input/input.c mplayerxp/input/input.h mplayerxp/input/joystick.c mplayerxp/input/joystick.h mplayerxp/input/lirc.c mplayerxp/input/lirc.h mplayerxp/input/mouse.h mplayerxp/libao2/ mplayerxp/libao2/Makefile mplayerxp/libao2/afmt.h mplayerxp/libao2/ao_alsa9.c mplayerxp/libao2/ao_arts.c mplayerxp/libao2/ao_esd.c mplayerxp/libao2/ao_jack.c mplayerxp/libao2/ao_msg.h mplayerxp/libao2/ao_nas.c mplayerxp/libao2/ao_null.c mplayerxp/libao2/ao_openal.c mplayerxp/libao2/ao_oss.c mplayerxp/libao2/ao_sdl.c mplayerxp/libao2/audio_out.c mplayerxp/libao2/audio_out.h mplayerxp/libao2/audio_out_internal.h mplayerxp/libmpcodecs/ mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/ad.c mplayerxp/libmpcodecs/ad.h mplayerxp/libmpcodecs/ad_a52.c mplayerxp/libmpcodecs/ad_a52.h mplayerxp/libmpcodecs/ad_acm.c mplayerxp/libmpcodecs/ad_dca.c mplayerxp/libmpcodecs/ad_dmo.c mplayerxp/libmpcodecs/ad_dshow.c mplayerxp/libmpcodecs/ad_dvdpcm.c mplayerxp/libmpcodecs/ad_faad.c mplayerxp/libmpcodecs/ad_ffmp3.c mplayerxp/libmpcodecs/ad_hwac3.c mplayerxp/libmpcodecs/ad_internal.h mplayerxp/libmpcodecs/ad_mp3.c mplayerxp/libmpcodecs/ad_msg.h mplayerxp/libmpcodecs/ad_null.c mplayerxp/libmpcodecs/ad_pcm.c mplayerxp/libmpcodecs/ad_qtaudio.c mplayerxp/libmpcodecs/ad_real.c mplayerxp/libmpcodecs/ad_twin.c mplayerxp/libmpcodecs/ad_vorbis.c mplayerxp/libmpcodecs/codecs_ld.c mplayerxp/libmpcodecs/codecs_ld.h mplayerxp/libmpcodecs/dec_audio.c mplayerxp/libmpcodecs/dec_audio.h mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/dec_video.h mplayerxp/libmpcodecs/interface/ mplayerxp/libmpcodecs/interface/a52.h mplayerxp/libmpcodecs/interface/adpcm.h mplayerxp/libmpcodecs/interface/dca.h mplayerxp/libmpcodecs/interface/divx4linux.h mplayerxp/libmpcodecs/interface/dshow/ mplayerxp/libmpcodecs/interface/dshow/DS_AudioDecoder.h mplayerxp/libmpcodecs/interface/dshow/DS_VideoDecoder.h mplayerxp/libmpcodecs/interface/ffmpeg/ mplayerxp/libmpcodecs/interface/ffmpeg/avcodec.h mplayerxp/libmpcodecs/interface/ffmpeg/common.h mplayerxp/libmpcodecs/interface/mp3.h mplayerxp/libmpcodecs/interface/mpeg2.h mplayerxp/libmpcodecs/interface/mpeg2_internal.h mplayerxp/libmpcodecs/interface/roqav.h mplayerxp/libmpcodecs/interface/vorbis/ mplayerxp/libmpcodecs/interface/vorbis/codec.h mplayerxp/libmpcodecs/interface/vorbis/config_types.h mplayerxp/libmpcodecs/interface/vorbis/ogg.h mplayerxp/libmpcodecs/interface/vorbis/os_types.h mplayerxp/libmpcodecs/interface/vorbis/theora.h mplayerxp/libmpcodecs/interface/vqf.h mplayerxp/libmpcodecs/interface/xvid.h mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd.h mplayerxp/libmpcodecs/vd_divx4.c mplayerxp/libmpcodecs/vd_dmo.c mplayerxp/libmpcodecs/vd_dshow.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpcodecs/vd_huffyuv.c mplayerxp/libmpcodecs/vd_internal.h mplayerxp/libmpcodecs/vd_libmpeg2.c mplayerxp/libmpcodecs/vd_mpegpes.c mplayerxp/libmpcodecs/vd_msg.h mplayerxp/libmpcodecs/vd_null.c mplayerxp/libmpcodecs/vd_nuv.c mplayerxp/libmpcodecs/vd_qtvideo.c mplayerxp/libmpcodecs/vd_raw.c mplayerxp/libmpcodecs/vd_real.c mplayerxp/libmpcodecs/vd_theora.c mplayerxp/libmpcodecs/vd_vfw.c mplayerxp/libmpcodecs/vd_xanim.c mplayerxp/libmpcodecs/vd_xvid.c mplayerxp/libmpdemux/ mplayerxp/libmpdemux/Makefile mplayerxp/libmpdemux/README mplayerxp/libmpdemux/asf.h mplayerxp/libmpdemux/asf_mmst_streaming.c mplayerxp/libmpdemux/asf_streaming.c mplayerxp/libmpdemux/aviheader.h mplayerxp/libmpdemux/aviprint.c mplayerxp/libmpdemux/aviprint.h mplayerxp/libmpdemux/bswap.h mplayerxp/libmpdemux/cache2.c mplayerxp/libmpdemux/cdd.h mplayerxp/libmpdemux/cdda.c mplayerxp/libmpdemux/cddb.c mplayerxp/libmpdemux/config.h mplayerxp/libmpdemux/cookies.c mplayerxp/libmpdemux/cookies.h mplayerxp/libmpdemux/demux_aiff.c mplayerxp/libmpdemux/demux_asf.c mplayerxp/libmpdemux/demux_audio.c mplayerxp/libmpdemux/demux_avi.c mplayerxp/libmpdemux/demux_bmp.c mplayerxp/libmpdemux/demux_demuxers.c mplayerxp/libmpdemux/demux_film.c mplayerxp/libmpdemux/demux_fli.c mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demux_mkv.c mplayerxp/libmpdemux/demux_mov.c mplayerxp/libmpdemux/demux_mpg.c mplayerxp/libmpdemux/demux_mpxp64.c mplayerxp/libmpdemux/demux_msg.h mplayerxp/libmpdemux/demux_nsv.c mplayerxp/libmpdemux/demux_nuv.c mplayerxp/libmpdemux/demux_ogg.c mplayerxp/libmpdemux/demux_pva.c mplayerxp/libmpdemux/demux_ra.c mplayerxp/libmpdemux/demux_rawaudio.c mplayerxp/libmpdemux/demux_rawvideo.c mplayerxp/libmpdemux/demux_real.c mplayerxp/libmpdemux/demux_roq.c mplayerxp/libmpdemux/demux_smjpeg.c mplayerxp/libmpdemux/demux_ts.c mplayerxp/libmpdemux/demux_ty.c mplayerxp/libmpdemux/demux_viv.c mplayerxp/libmpdemux/demux_vqf.c mplayerxp/libmpdemux/demux_y4m.c mplayerxp/libmpdemux/demuxer.c mplayerxp/libmpdemux/demuxer.h mplayerxp/libmpdemux/demuxer_r.c mplayerxp/libmpdemux/demuxer_r.h mplayerxp/libmpdemux/dvdauth.c mplayerxp/libmpdemux/dvdauth.h mplayerxp/libmpdemux/freesdp/ mplayerxp/libmpdemux/freesdp/Makefile mplayerxp/libmpdemux/freesdp/common.c mplayerxp/libmpdemux/freesdp/common.h mplayerxp/libmpdemux/freesdp/errorlist.c mplayerxp/libmpdemux/freesdp/parser.c mplayerxp/libmpdemux/freesdp/parser.h mplayerxp/libmpdemux/freesdp/parserpriv.h mplayerxp/libmpdemux/freesdp/priv.h mplayerxp/libmpdemux/frequencies.c mplayerxp/libmpdemux/frequencies.h mplayerxp/libmpdemux/genres.h mplayerxp/libmpdemux/help_mp.h mplayerxp/libmpdemux/http.c mplayerxp/libmpdemux/http.h mplayerxp/libmpdemux/librtsp/ mplayerxp/libmpdemux/librtsp/Makefile mplayerxp/libmpdemux/librtsp/rtsp.c mplayerxp/libmpdemux/librtsp/rtsp.h mplayerxp/libmpdemux/librtsp/rtsp_rtp.c mplayerxp/libmpdemux/librtsp/rtsp_rtp.h mplayerxp/libmpdemux/librtsp/rtsp_session.c mplayerxp/libmpdemux/librtsp/rtsp_session.h mplayerxp/libmpdemux/matroska.h mplayerxp/libmpdemux/mp3_hdr.c mplayerxp/libmpdemux/mp3_hdr.h mplayerxp/libmpdemux/mpdemux.c mplayerxp/libmpdemux/mpdemux.h mplayerxp/libmpdemux/mpeg_hdr.c mplayerxp/libmpdemux/mpeg_hdr.h mplayerxp/libmpdemux/mpxpav64.h mplayerxp/libmpdemux/mrl.c mplayerxp/libmpdemux/mrl.h mplayerxp/libmpdemux/mux_lavf.c mplayerxp/libmpdemux/mux_mpxp64.c mplayerxp/libmpdemux/mux_raw.c mplayerxp/libmpdemux/muxer.c mplayerxp/libmpdemux/muxer.h mplayerxp/libmpdemux/network.c mplayerxp/libmpdemux/network.h mplayerxp/libmpdemux/nuppelvideo.h mplayerxp/libmpdemux/parse_es.c mplayerxp/libmpdemux/parse_es.h mplayerxp/libmpdemux/parse_mp4.c mplayerxp/libmpdemux/parse_mp4.h mplayerxp/libmpdemux/pnm.c mplayerxp/libmpdemux/pnm.h mplayerxp/libmpdemux/qtpalette.h mplayerxp/libmpdemux/realrtsp/ mplayerxp/libmpdemux/realrtsp/Makefile mplayerxp/libmpdemux/realrtsp/asmrp.c mplayerxp/libmpdemux/realrtsp/asmrp.h mplayerxp/libmpdemux/realrtsp/md5.c mplayerxp/libmpdemux/realrtsp/md5.h mplayerxp/libmpdemux/realrtsp/real.c mplayerxp/libmpdemux/realrtsp/real.h mplayerxp/libmpdemux/realrtsp/rmff.c mplayerxp/libmpdemux/realrtsp/rmff.h mplayerxp/libmpdemux/realrtsp/sdpplin.c mplayerxp/libmpdemux/realrtsp/sdpplin.h mplayerxp/libmpdemux/realrtsp/xbuffer.c mplayerxp/libmpdemux/realrtsp/xbuffer.h mplayerxp/libmpdemux/rtp.c mplayerxp/libmpdemux/rtp.h mplayerxp/libmpdemux/s_cdd.c mplayerxp/libmpdemux/s_dvdnav.c mplayerxp/libmpdemux/s_dvdplay.c mplayerxp/libmpdemux/s_dvdread.c mplayerxp/libmpdemux/s_file.c mplayerxp/libmpdemux/s_ftp.c mplayerxp/libmpdemux/s_network.c mplayerxp/libmpdemux/s_oss.c mplayerxp/libmpdemux/s_rtsp.c mplayerxp/libmpdemux/s_tv.c mplayerxp/libmpdemux/s_udp.c mplayerxp/libmpdemux/s_vcd.c mplayerxp/libmpdemux/s_vcdnav.c mplayerxp/libmpdemux/stheader.h mplayerxp/libmpdemux/stream.c mplayerxp/libmpdemux/stream.h mplayerxp/libmpdemux/sub_cc.c mplayerxp/libmpdemux/sub_cc.h mplayerxp/libmpdemux/sub_ty.c mplayerxp/libmpdemux/tcp.c mplayerxp/libmpdemux/tcp.h mplayerxp/libmpdemux/test.c mplayerxp/libmpdemux/tv.h mplayerxp/libmpdemux/tvi_bsdbt848.c mplayerxp/libmpdemux/tvi_def.h mplayerxp/libmpdemux/tvi_dummy.c mplayerxp/libmpdemux/tvi_v4l.c mplayerxp/libmpdemux/udp.c mplayerxp/libmpdemux/udp.h mplayerxp/libmpdemux/url.c mplayerxp/libmpdemux/url.h mplayerxp/libmpdemux/vcd_read.h mplayerxp/libmpdemux/vcd_read_fbsd.h mplayerxp/libmpdemux/vcd_read_nbsd.h mplayerxp/libmpdemux/video.c mplayerxp/libmpdemux/wine/ mplayerxp/libmpdemux/wine/avifmt.h mplayerxp/libmpdemux/wine/basetsd.h mplayerxp/libmpdemux/wine/debugtools.h mplayerxp/libmpdemux/wine/driver.h mplayerxp/libmpdemux/wine/elfdll.h mplayerxp/libmpdemux/wine/heap.h mplayerxp/libmpdemux/wine/ldt.h mplayerxp/libmpdemux/wine/mmreg.h mplayerxp/libmpdemux/wine/module.h mplayerxp/libmpdemux/wine/msacm.h mplayerxp/libmpdemux/wine/msacmdrv.h mplayerxp/libmpdemux/wine/ntdef.h mplayerxp/libmpdemux/wine/pe_image.h mplayerxp/libmpdemux/wine/poppack.h mplayerxp/libmpdemux/wine/pshpack1.h mplayerxp/libmpdemux/wine/pshpack2.h mplayerxp/libmpdemux/wine/pshpack4.h mplayerxp/libmpdemux/wine/pshpack8.h mplayerxp/libmpdemux/wine/vfw.h mplayerxp/libmpdemux/wine/winbase.h mplayerxp/libmpdemux/wine/windef.h mplayerxp/libmpdemux/wine/windows.h mplayerxp/libmpdemux/wine/winerror.h mplayerxp/libmpdemux/wine/winestring.h mplayerxp/libmpdemux/wine/winnt.h mplayerxp/libmpdemux/wine/winreg.h mplayerxp/libmpdemux/wine/winuser.h mplayerxp/libmpdemux/yuv4mpeg.c mplayerxp/libmpdemux/yuv4mpeg.h mplayerxp/libmpdemux/yuv4mpeg_intern.h mplayerxp/libmpdemux/yuv4mpeg_ratio.c mplayerxp/libvo/ mplayerxp/libvo/Makefile mplayerxp/libvo/aclib.c mplayerxp/libvo/aclib_template.c mplayerxp/libvo/aclib_x86_64.h mplayerxp/libvo/aspect.c mplayerxp/libvo/aspect.h mplayerxp/libvo/dri_vo.h mplayerxp/libvo/fastmemcpy.h mplayerxp/libvo/font_load.c mplayerxp/libvo/font_load.h mplayerxp/libvo/img_format.c mplayerxp/libvo/img_format.h mplayerxp/libvo/jpeg_enc.c mplayerxp/libvo/jpeg_enc.h mplayerxp/libvo/osd.c mplayerxp/libvo/osd.h mplayerxp/libvo/osd_template.c mplayerxp/libvo/screenshot.c mplayerxp/libvo/screenshot.h mplayerxp/libvo/sub.c mplayerxp/libvo/sub.h mplayerxp/libvo/video_out.c mplayerxp/libvo/video_out.h mplayerxp/libvo/video_out_internal.h mplayerxp/libvo/videodev_mjpeg.h mplayerxp/libvo/vo_dga.c mplayerxp/libvo/vo_fbdev.c mplayerxp/libvo/vo_msg.h mplayerxp/libvo/vo_null.c mplayerxp/libvo/vo_sdl.c mplayerxp/libvo/vo_vesa.c mplayerxp/libvo/vo_x11.c mplayerxp/libvo/vo_xv.c mplayerxp/libvo/vo_xvidix.c mplayerxp/libvo/vosub_vidix.c mplayerxp/libvo/vosub_vidix.h mplayerxp/libvo/wskeys.h mplayerxp/libvo/x11_common.c mplayerxp/libvo/x11_common.h mplayerxp/m_option.c mplayerxp/m_option.h mplayerxp/m_property.c mplayerxp/m_property.h mplayerxp/m_struct.c mplayerxp/m_struct.h mplayerxp/mangle.h mplayerxp/mixer.c mplayerxp/mixer.h mplayerxp/mm_accel.h mplayerxp/mmx.h mplayerxp/mmx_defs.h mplayerxp/mp-opt-reg.c mplayerxp/mp_image.c mplayerxp/mp_image.h mplayerxp/mp_msg.c mplayerxp/mp_msg.h mplayerxp/mplayer.c mplayerxp/mplayer.h mplayerxp/my_malloc.c mplayerxp/my_malloc.h mplayerxp/my_profile.c mplayerxp/my_profile.h mplayerxp/nls/ mplayerxp/nls/Makefile mplayerxp/nls/help_diff.sh mplayerxp/nls/help_mp-bg.h mplayerxp/nls/help_mp-cz.h mplayerxp/nls/help_mp-de.h mplayerxp/nls/help_mp-dk.h mplayerxp/nls/help_mp-el.h mplayerxp/nls/help_mp-en.h mplayerxp/nls/help_mp-es.h mplayerxp/nls/help_mp-fr.h mplayerxp/nls/help_mp-hu.h mplayerxp/nls/help_mp-it.h mplayerxp/nls/help_mp-ja.h mplayerxp/nls/help_mp-ko.h mplayerxp/nls/help_mp-mk.h mplayerxp/nls/help_mp-nb.h mplayerxp/nls/help_mp-nl.h mplayerxp/nls/help_mp-no.h mplayerxp/nls/help_mp-pl.h mplayerxp/nls/help_mp-pt.h mplayerxp/nls/help_mp-ro.h mplayerxp/nls/help_mp-ru.h mplayerxp/nls/help_mp-sk.h mplayerxp/nls/help_mp-sv.h mplayerxp/nls/help_mp-tr.h mplayerxp/nls/help_mp-uk.h mplayerxp/nls/help_mp-zh.h mplayerxp/nls/nls.h mplayerxp/nls/nls_msg.h mplayerxp/nls/recode.c mplayerxp/osdep/ mplayerxp/osdep/Makefile mplayerxp/osdep/get_path.c mplayerxp/osdep/get_path.h mplayerxp/osdep/getch2.c mplayerxp/osdep/getch2.h mplayerxp/osdep/keycodes.h mplayerxp/osdep/lrmi.c mplayerxp/osdep/lrmi.h mplayerxp/osdep/osdep_msg.h mplayerxp/osdep/shmem.c mplayerxp/osdep/shmem.h mplayerxp/osdep/timer-lx.c mplayerxp/osdep/timer.c mplayerxp/osdep/timer.h mplayerxp/osdep/vbelib.c mplayerxp/osdep/vbelib.h mplayerxp/playtree.c mplayerxp/playtree.h mplayerxp/playtreeparser.c mplayerxp/playtreeparser.h mplayerxp/postproc/ mplayerxp/postproc/Makefile mplayerxp/postproc/af.c mplayerxp/postproc/af.h mplayerxp/postproc/af_ao2.c mplayerxp/postproc/af_center.c mplayerxp/postproc/af_channels.c mplayerxp/postproc/af_comp.c mplayerxp/postproc/af_control.h mplayerxp/postproc/af_crystality.c mplayerxp/postproc/af_delay.c mplayerxp/postproc/af_dummy.c mplayerxp/postproc/af_dyn.c mplayerxp/postproc/af_echo3d.c mplayerxp/postproc/af_equalizer.c mplayerxp/postproc/af_export.c mplayerxp/postproc/af_extrastereo.c mplayerxp/postproc/af_ffenc.c mplayerxp/postproc/af_format.c mplayerxp/postproc/af_format.h mplayerxp/postproc/af_format_alaw.c mplayerxp/postproc/af_format_ulaw.c mplayerxp/postproc/af_gate.c mplayerxp/postproc/af_hrtf.c mplayerxp/postproc/af_hrtf.h mplayerxp/postproc/af_karaoke.c mplayerxp/postproc/af_lp.c mplayerxp/postproc/af_mp.c mplayerxp/postproc/af_mp.h mplayerxp/postproc/af_pan.c mplayerxp/postproc/af_raw.c mplayerxp/postproc/af_resample.c mplayerxp/postproc/af_resample.h mplayerxp/postproc/af_scaletempo.c mplayerxp/postproc/af_sinesuppress.c mplayerxp/postproc/af_sub.c mplayerxp/postproc/af_surround.c mplayerxp/postproc/af_tools.c mplayerxp/postproc/af_volnorm.c mplayerxp/postproc/af_volume.c mplayerxp/postproc/dsp.c mplayerxp/postproc/dsp.h mplayerxp/postproc/dsp_accel.h mplayerxp/postproc/libmenu/ mplayerxp/postproc/libmenu/Makefile mplayerxp/postproc/libmenu/menu.c mplayerxp/postproc/libmenu/menu.h mplayerxp/postproc/libmenu/menu_cmdlist.c mplayerxp/postproc/libmenu/menu_console.c mplayerxp/postproc/libmenu/menu_filesel.c mplayerxp/postproc/libmenu/menu_list.c mplayerxp/postproc/libmenu/menu_list.h mplayerxp/postproc/libmenu/menu_param.c mplayerxp/postproc/libmenu/menu_pt.c mplayerxp/postproc/libmenu/menu_txt.c mplayerxp/postproc/mpc_info.h mplayerxp/postproc/postprocess.c mplayerxp/postproc/postprocess.h mplayerxp/postproc/pp_msg.h mplayerxp/postproc/rgb2rgb.c mplayerxp/postproc/rgb2rgb.h mplayerxp/postproc/rgb2rgb_template.c mplayerxp/postproc/swscale.c mplayerxp/postproc/swscale.h mplayerxp/postproc/swscale_altivec_template.c mplayerxp/postproc/swscale_internal.h mplayerxp/postproc/swscale_template.c mplayerxp/postproc/vf.c mplayerxp/postproc/vf.h mplayerxp/postproc/vf_1bpp.c mplayerxp/postproc/vf_2xsai.c mplayerxp/postproc/vf_aspect.c mplayerxp/postproc/vf_delogo.c mplayerxp/postproc/vf_denoise3d.c mplayerxp/postproc/vf_dint.c mplayerxp/postproc/vf_down3dright.c mplayerxp/postproc/vf_eq.c mplayerxp/postproc/vf_expand.c mplayerxp/postproc/vf_format.c mplayerxp/postproc/vf_framestep.c mplayerxp/postproc/vf_il.c mplayerxp/postproc/vf_menu.c mplayerxp/postproc/vf_mirror.c mplayerxp/postproc/vf_noise.c mplayerxp/postproc/vf_ow.c mplayerxp/postproc/vf_palette.c mplayerxp/postproc/vf_panscan.c mplayerxp/postproc/vf_perspective.c mplayerxp/postproc/vf_pp.c mplayerxp/postproc/vf_raw.c mplayerxp/postproc/vf_rectangle.c mplayerxp/postproc/vf_rgb2bgr.c mplayerxp/postproc/vf_rotate.c mplayerxp/postproc/vf_scale.c mplayerxp/postproc/vf_scale.h mplayerxp/postproc/vf_smartblur.c mplayerxp/postproc/vf_softpulldown.c mplayerxp/postproc/vf_swapuv.c mplayerxp/postproc/vf_test.c mplayerxp/postproc/vf_unsharp.c mplayerxp/postproc/vf_vo.c mplayerxp/postproc/vf_yuvcsp.c mplayerxp/postproc/vf_yuy2.c mplayerxp/postproc/vf_yvu9.c mplayerxp/postproc/vfcap.h mplayerxp/postproc/yuv2rgb.c mplayerxp/postproc/yuv2rgb_altivec.c mplayerxp/postproc/yuv2rgb_mlib.c mplayerxp/postproc/yuv2rgb_template.c mplayerxp/pvector/ mplayerxp/pvector/mmx2c.h mplayerxp/pvector/pvector.h mplayerxp/pvector/pvector_int_x86.h mplayerxp/sig_hand.c mplayerxp/sig_hand.h mplayerxp/spudec.c mplayerxp/spudec.h mplayerxp/subreader.c mplayerxp/subreader.h mplayerxp/version.sh mplayerxp/vobsub.c mplayerxp/vobsub.h Added: AUTHORS =================================================================== --- AUTHORS (rev 0) +++ AUTHORS 2009-12-03 18:23:02 UTC (rev 1) @@ -0,0 +1,73 @@ +Since 2002 the mplayerxp is maintained by Nickols_K <nic...@ma...> + +The people who participate with mplayerxp: +- Mans Rullgard <mr...@us...> + (ALPHA-related porting, testing, GLINT R3 vidix driver, RISC optimization) +- Zdenek Kabelac <ka...@in...> + (vidix related improvements) +- Olov Gustavsson <ol...@al...> + (core-developer: thread and core related improvements and new features) + +The people who did original mplayer: +- Arpad Gereoffy <mpl...@mp...> +- Zolt\xE1n Ponekker (Pontscho/Fresh!) <pon...@ma...> +- G\xE1bor L\xE9n\xE1rt <lg...@lg...> +- G\xE1bor B\xE9rczi (Gabucino) <gab...@mp...> +- Szabolcs Berecz (Szabi) <sz...@in...> +- L\xE1szl\xF3 Megyer (Lez, Laaz) le...@sc... +- Gyula L\xE1szl\xF3 (Chass, T\xE9gla) <ch...@fr...> +- Zolt\xE1n M\xE1rk Vici\xE1n (Se7en) <se...@sc...> +- Alex Beregszaszi (al3x) <al...@na...> +- Andreas Ackermann (Acki) <asa...@st...> +- Felix B\xFCnemann (Atmos) <atm...@us...> +- TeLeNiEkO <tel...@te...> +- Michael Graffam <mgr...@id...> +- Jens Hoffmann <hof...@gm...> +- Nickols_K <nic...@ma...> +- German Gomez Garcia <ge...@pi...> +- Dariusz Pietrzak (Eyck) <ey...@in...> +- Marcus Comstedt <ma...@id...> +- J\xFCrgen Keil <jk...@to...> +- Vladimir Kushnir <vku...@Al...> +- Bertrand BAUDET <ber...@ya...> +- Alban Bedel <al...@fr...> +- Derek J Witt <dj...@fl...> +- Artur Zaprzala <zy...@fa...> +- la...@la... +- Adam Tla/lka <at...@pg...> +- Folke Ashberg <fo...@as...> +- Kamil Toman <kt...@em...> +- Ivan Kalvatchev <ii...@ya...> +- pl <p_...@gm...> +- Michael Niedermayer <mic...@gm...> +- Sven Goethel <sgo...@ja...> +- joy_ping <jo...@pi...> +- Eric Anholt <ea...@gl...> +- Jiri Svoboda <Jir...@se...> +- Oliver Schoenbrunner <oli...@jk...> +- Jeroen Dobbelaere <jer...@ac...> +- David Holm <dh...@te...> +- Panagiotis Issaris <ta...@lu...> +- Mike Melanson <mel...@pc...> +- Tobias Diedrich <ra...@gm...> +- Kilian A. Foth <fo...@in...> +- Tim Ferguson <ti...@ma...> +- Sam Lin <it...@so...> +- Johannes Feigl <joh...@mc...> +- Kim Minh Kaplan <kmk...@se...> +- Brian Kuschak <bku...@ya...> +- Stephen Davies <st...@da...> +- Rik Snel <rs...@cu...> +- Anders Johansson <aj...@at...> +- Roberto Togni <rt...@fr...> +- Wojtek Kaniewski <woj...@by...> + +Main testers: + +Tibor Bal\xE1zs (Tibcu) +P\xE9ter Sasi (SaPe) +Christoph H. Lampert +Attila Kinali +Dirk Vornheder +Bohdan Horst (Nexus) + Added: COPYING =================================================================== --- COPYING (rev 0) +++ COPYING 2009-12-03 18:23:02 UTC (rev 1) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Added: DOCS/Makefile =================================================================== --- DOCS/Makefile (rev 0) +++ DOCS/Makefile 2009-12-03 18:23:02 UTC (rev 1) @@ -0,0 +1,17 @@ +# a BSD compatible 'install' program +INSTALL = install + +include config.mak + +MANDIR = ${prefix}/man + +all: +clean: +distclean: + rm -f config.mak +install: + $(INSTALL) -D -c -m 644 mplayerxp.1 $(DESTDIR)$(MANDIR)/man1/$(PROGNAME).1 +uninstall: + rm -f $(MANDIR)/man1/mplayerxp.1 + rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(MANDIR)/man1 +dep: Added: DOCS/README =================================================================== --- DOCS/README (rev 0) +++ DOCS/README 2009-12-03 18:23:02 UTC (rev 1) @@ -0,0 +1 @@ +The full package of documentation can be obtained at http://mplayerhq.hu \ No newline at end of file Added: DOCS/configure =================================================================== --- DOCS/configure (rev 0) +++ DOCS/configure 2009-12-03 18:23:02 UTC (rev 1) @@ -0,0 +1,85 @@ +#!/bin/sh +# The simplest configure for win loader + +for parm in "$@" ; do + if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then + cat << EOF + +Usage: $0 [OPTIONS]... + +Configuration: + -h, --help display this help and exit + +Installation directories: + --prefix=DIR use this prefix for installing mplayer [/usr/local] + +Fine tuning of the installation directories: + --datadir=DIR use this prefix for installing machine independent + data files (fonts, skins) [PREFIX/share/mplayer] + --confdir=DIR use this prefix for installing configuration files + [same as datadir] +Program names: + --program-suffix=SUFX append SUFX to installed program names + +Environment variables: + DESTDIR specifies base of installation + +EOF + exit 0 + fi +done # for parm in ... + + +# LGB: temporary files +for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do + test "$I" && break +done + +TMPLOG="configure.log" +rm -f "$TMPLOG" +TMPC="$I/mplayerxp-conf-$RANDOM-$$.c" +TMPCPP="$I/mplayerxp-conf-$RANDOM-$$.cpp" +TMPO="$I/mplayerxp-conf-$RANDOM-$$.o" +TMPS="$I/mplayerxp-conf-$RANDOM-$$.S" + +_prefix="/usr/local" +_psuffix= +for ac_option do + case "$ac_option" in + --prefix=*) + _prefix=`echo $ac_option | cut -d '=' -f 2` + ;; + --datadir=*) + _datadir=`echo $ac_option | cut -d '=' -f 2` + ;; + --confdir=*) + _confdir=`echo $ac_option | cut -d '=' -f 2` + ;; + --program-suffix=*) + _psuffix=`echo $ac_option | cut -d '=' -f 2` + ;; + *) + ;; + esac +done + +_prog_alias="mplayerxp$_psuffix" + +# Atmos: moved this here, to be correct, if --prefix is specified +test -z "$_datadir" && _datadir="$_prefix/share/$_prog_alias" +test -z "$_confdir" && _confdir="$_datadir" + +############################################################################# +echo "Creating config.mak" +cat > config.mak << EOF +# -------- Generated by configure ----------- +PROGNAME = $_prog_alias +prefix = $_prefix +DATADIR = $_datadir +CONFDIR = $_confdir +DESTDIR = $DESTDIR + +EOF + +# Last move: +rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP" Property changes on: DOCS/configure ___________________________________________________________________ Added: svn:executable + Added: DOCS/mplayerxp.1 =================================================================== --- DOCS/mplayerxp.1 (rev 0) +++ DOCS/mplayerxp.1 2009-12-03 18:23:02 UTC (rev 1) @@ -0,0 +1,2185 @@ +.\" +.TH MPlayerXP 1 +.SH NAME +MPlayerXP \- mplayer with extra performance +.SH SYNOPSIS +.B mplayerxp <-options> streamname +.PP +.SH DESCRIPTION +.I mplayerxp +MPlayerXP is a branch of well known mplayer (http://mplayerhq.hu) +(runs on many Unices, and non-x86 CPUs, see section 6). It plays most +MPEG, AVI, MOV/QT and ASF/WMV files, supported by many native and Win32 +DLL codecs. You can watch VideoCD, SVCD, DVD, and even DivX movies too. + +Unique big features of mplayer(xp) are +.I VIDIX +technology which provides direct access +to BES of video cards. Due this feature MPlayerXP is first player under *nix +.B BUSMASTERING +- the case when decoded frames are transfered into videomemory without +CPU usage. +.I VESA +Provides movie playback on every VESA compatible card, even without X!, +and enables TV-out no many cards. + +Main difference of +.I MPlayerXP +from +.I MPlayer +is new thread-based core. This core was designed for +.B DECODING AHEAD +feature which provides EXTRA performance of movie playback. + +Several subtitles types are supported (curently 9 !) and the fonts are +rendered with nice big antialiased shaded fonts ! Of course there is support +for european/ISO 8859-1,2 (hungarian, english, czech, etc), cyrillic, korean +fonts. + +.LP +.SH "XP OPTIONS" +.TP +.B \-xp\ <0-4> +start MPlayerXP in XP mode. You should get smoothness (fixed FPS on the screen) +with UP systems and decoding speedup with SMP. + 0 : XP mode off + 1 : Decode video in separate thread + 2 : Decode audio and video in the same separate thread + 3 : As 2 plus audio playing in separate thread +.B [default] + 4 : Decode video and audio and play audio in three different threads +.TP +.B \-da_buffs +Allows you specify number of buffers for decoding ahead. +You can set it from 5 upto 64. 64 is default. (I recommend to use +10 buffers as minimum to avoid screen juddering and other negative factors). +.I NOTE: +.B (For both - UP and SMP) +drivers which provide direct BES access will change it automatically +but you may force this number to decrease number of buffers. From +other side - than more buffers you are using than less number of delays +you will have during decoding and you will be able to watch frame +which take longer time to be decoded just in time. +.IP +.SH "AUDIO-VIDEO SYNCHRONIZATION" +.I Introduction: +Almost all movies consist from two independed streams (audio and video) at least. +These streams have different bitrate and number of total frames per movie. +To play them synchronously we need to have some control points when both audio +and video should be presented simultaneously at the same moment of time. +From historical reasons, mplayerxp had two methods of A-V synchronizations: +so-called +.B dapsync +and so-called +.B Arpi's +method. But version +.I 0.5 +of mplayerxp introduces new +.B PTS-based +method of A-V synchronization. +.SS PTS-based method. +From point of player PTS-based synchronization is the best choise since player +knows PTS of every audio and video packet and knows when they should be present. +But there are some negative sides - movies which were produced with violating of +all laws of video industry. For example, simplest merging of independed files +into single one or dumping DVDs without PTS fixing :( +But even in case of such movies there are chances to reach A-V synchronization +within of short time. (Of course, if player won't sleep in case when audio PTS +is already 0 but video PTS still much large than 0). +Main positive side of this method is +.B auto-convergence +from point of synchronization. +.SS DAP and Arpi's methods. +Both methods are based of frame duration instead of PTS and that even worse - +both methods handle PTS info for video part of movie only ignoring audio PTS. +They assume that audio stream has constan... [truncated message content] |
From: <nic...@us...> - 2009-12-05 14:06:52
|
Revision: 7 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=7&view=rev Author: nickols_k Date: 2009-12-05 14:06:45 +0000 (Sat, 05 Dec 2009) Log Message: ----------- use MACROS which are incompatible with inline asm Modified Paths: -------------- mplayerxp/libvo/osd.c mplayerxp/pvector/pvector.h mplayerxp/pvector/pvector_int_x86.h Modified: mplayerxp/libvo/osd.c =================================================================== --- mplayerxp/libvo/osd.c 2009-12-04 19:12:13 UTC (rev 6) +++ mplayerxp/libvo/osd.c 2009-12-05 14:06:45 UTC (rev 7) @@ -16,100 +16,58 @@ #include "../mplayer.h" #include "osd.h" -#if defined(CAN_COMPILE_MMX) +#if defined(__MMX__) static const uint64_t bFF __attribute__((used)) __attribute__((aligned(8))) = 0xFFFFFFFFFFFFFFFFULL; static const unsigned long long mask24lh __attribute__((used)) __attribute__((aligned(8))) = 0xFFFF000000000000ULL; static const unsigned long long mask24hl __attribute__((used)) __attribute__((aligned(8))) = 0x0000FFFFFFFFFFFFULL; +#endif -/*Note: we have C, X86-nommx, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one - Plain C versions*/ - -/*MMX versions*/ -#ifdef CAN_COMPILE_MMX -#undef RENAME -#define HAVE_MMX -#undef HAVE_MMX2 -#undef HAVE_3DNOW -#define RENAME(a) a ## _MMX +/* generic version */ +#undef OPTIMIZE_AVX +#undef OPTIMIZE_SSE4 +#undef OPTIMIZE_SSSE3 +#undef OPTIMIZE_SSE3 +#undef OPTIMIZE_SSE2 +#undef OPTIMIZE_SSE +#undef OPTIMIZE_MMX2 +#undef OPTIMIZE_MMX +#define RENAME(a) a ## _C #include "osd_template.c" -#endif -/*MMX2 versions*/ -#ifdef CAN_COMPILE_MMX2 +#ifndef __x86_64__ +#ifdef __MMX2__ +#define OPTIMIZE_MMX2 #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#undef HAVE_3DNOW #define RENAME(a) a ## _MMX2 #include "osd_template.c" #endif - -/*SSE2 versions*/ -#ifdef CAN_COMPILE_SSE2 +#endif // __x86_64__ +#ifdef __SSE2__ +#define OPTIMIZE_SSE2 #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#define HAVE_SSE -#define HAVE_SSE2 -#undef HAVE_3DNOW #define RENAME(a) a ## _SSE2 #include "osd_template.c" #endif - -/*SSE3 versions*/ -#ifdef CAN_COMPILE_SSE3 +#ifdef __SSE3__ +#define OPTIMIZE_SSE3 #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#define HAVE_SSE -#define HAVE_SSE2 -#define HAVE_SSE3 -#undef HAVE_3DNOW #define RENAME(a) a ## _SSE3 #include "osd_template.c" #endif - -/*SSSE3 versions*/ -#ifdef CAN_COMPILE_SSSE3 +#ifdef __SSSE3__ +#define OPTIMIZE_SSSE3 #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#define HAVE_SSE -#define HAVE_SSE2 -#define HAVE_SSE3 -#define HAVE_SSSE3 -#undef HAVE_3DNOW #define RENAME(a) a ## _SSSE3 #include "osd_template.c" #endif - -/*SSE4 versions*/ -#ifdef CAN_COMPILE_SSE4 +#ifdef __SSE4_1__ +#define OPTIMIZE_SSE4 #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#define HAVE_SSE -#define HAVE_SSE2 -#define HAVE_SSE3 -#define HAVE_SSSE3 -#define HAVE_SSE4 -#undef HAVE_3DNOW #define RENAME(a) a ## _SSE4 #include "osd_template.c" #endif -#endif /*CAN_COMPILE_X86_ASM*/ -/* generic version */ -#undef RENAME -#undef ARCH_X86 -#undef ARCH_X86_64 -#undef HAVE_MMX -#undef HAVE_MMX2 -#undef HAVE_3DNOW -#define RENAME(a) a ## _C -#include "osd_template.c" - #ifdef FAST_OSD_TABLE static unsigned short fast_osd_15bpp_table[256]; static unsigned short fast_osd_16bpp_table[256]; @@ -200,7 +158,7 @@ #endif /*FIXME the optimized stuff is a lie for 15/16bpp as they arent optimized yet*/ // ordered per speed fasterst first -#ifdef CAN_COMPILE_SSE4 +#ifdef __SSE4_1__ if(gCpuCaps.hasSSE41) { MSG_V("Using SSE4 Optimized OnScreenDisplay\n"); @@ -211,7 +169,7 @@ } else #endif -#ifdef CAN_COMPILE_SSSE3 +#ifdef __SSSE3__ if(gCpuCaps.hasSSSE3) { MSG_V("Using SSSE3 Optimized OnScreenDisplay\n"); @@ -222,7 +180,7 @@ } else #endif -#ifdef CAN_COMPILE_SSE3 +#ifdef __SSE3__ if(gCpuCaps.hasSSE3) { MSG_V("Using SSE3 Optimized OnScreenDisplay\n"); @@ -233,7 +191,7 @@ } else #endif -#ifdef CAN_COMPILE_SSE2 +#ifdef __SSE2__ if(gCpuCaps.hasSSE2) { MSG_V("Using SSE2 Optimized OnScreenDisplay\n"); @@ -244,7 +202,8 @@ } else #endif -#ifdef CAN_COMPILE_MMX2 +#ifndef __x86_64__ +#ifdef __MMX2__ if(gCpuCaps.hasMMX2) { MSG_V("Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n"); @@ -255,16 +214,6 @@ } else #endif -#ifdef CAN_COMPILE_MMX -if(gCpuCaps.hasMMX) -{ - MSG_V("Using MMX Optimized OnScreenDisplay\n"); - vo_draw_alpha_yv12_ptr=vo_draw_alpha_yv12_MMX; - vo_draw_alpha_yuy2_ptr=vo_draw_alpha_yuy2_MMX; - vo_draw_alpha_rgb24_ptr=vo_draw_alpha_rgb24_MMX; - vo_draw_alpha_rgb32_ptr=vo_draw_alpha_rgb32_MMX; -} -else #endif { MSG_V("Using generic OnScreenDisplay\n"); Modified: mplayerxp/pvector/pvector.h =================================================================== --- mplayerxp/pvector/pvector.h 2009-12-04 19:12:13 UTC (rev 6) +++ mplayerxp/pvector/pvector.h 2009-12-05 14:06:45 UTC (rev 7) @@ -3,7 +3,30 @@ */ #define HAVE_INT_PVECTOR 1 -#if defined( HAVE_MMX ) +#ifdef OPTIMIZE_AVX +#define OPTIMIZE_AES +#endif +#ifdef OPTIMIZE_AES +#define OPTIMIZE_SSE4 +#endif +#ifdef OPTIMIZE_SSE4 +#define OPTIMIZE_SSSE3 +#endif +#ifdef OPTIMIZE_SSSE3 +#define OPTIMIZE_SSE3 +#endif +#ifdef OPTIMIZE_SSE3 +#define OPTIMIZE_SSE2 +#endif +#ifdef OPTIMIZE_SSE2 +#define OPTIMIZE_SSE +#define OPTIMIZE_MMX2 +#endif +#ifdef OPTIMIZE_MMX2 +#define OPTIMIZE_MMX +#endif + +#if defined( OPTIMIZE_MMX ) #include "pvector_int_x86.h" #else //#warning "pvector's generic version isn't yet ready" Modified: mplayerxp/pvector/pvector_int_x86.h =================================================================== --- mplayerxp/pvector/pvector_int_x86.h 2009-12-04 19:12:13 UTC (rev 6) +++ mplayerxp/pvector/pvector_int_x86.h 2009-12-05 14:06:45 UTC (rev 7) @@ -2,25 +2,25 @@ pvector_int_x86.h */ #undef _VEC -#if defined( HAVE_AVX ) +#if defined( OPTIMIZE_AVX ) #define _VEC(a) a ## _AVX #include <avxintrin.h> -#elif defined(HAVE_AES) || defined (HAVE_PCLMUL) +#elif defined(OPTIMIZE_AES) #define _VEC(a) a ## _AES #include <wmmintrin.h> -#elif defined (HAVE_SSE4) +#elif defined (OPTIMIZE_SSE4) #define _VEC(a) a ## _SSE4 #include <smmintrin.h> -#elif defined(HAVE_SSSE3) +#elif defined(OPTIMIZE_SSSE3) #define _VEC(a) a ## _SSSE3 #include <tmmintrin.h> -#elif defined(HAVE_SSE3) +#elif defined(OPTIMIZE_SSE3) #define _VEC(a) a ## _SSE3 #include <pmmintrin.h> -#elif defined(HAVE_SSE2) +#elif defined(OPTIMIZE_SSE2) #define _VEC(a) a ## _SSE2 #include <emmintrin.h> -#elif defined(HAVE_MMX2) +#elif defined(OPTIMIZE_MMX2) #define _VEC(a) a ## _MMX2 #include <xmmintrin.h> #else @@ -30,7 +30,7 @@ #undef __IVEC_SIZE #undef __ivec -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 #define __IVEC_SIZE 16 #define __ivec __m128i #else @@ -41,7 +41,7 @@ extern __inline void __attribute__((__gnu_inline__, __always_inline__)) _VEC(empty)(void) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 #else _mm_empty(); #endif @@ -52,7 +52,7 @@ extern __inline void __attribute__((__gnu_inline__, __always_inline__)) _VEC(sfence)(void) { -#ifdef HAVE_MMX2 +#ifdef OPTIMIZE_MMX2 _mm_sfence(); #endif } @@ -62,7 +62,7 @@ extern __inline void __attribute__((__gnu_inline__, __always_inline__)) _VEC(prefetch)(void const *__P) { -#ifdef HAVE_MMX2 +#ifdef OPTIMIZE_MMX2 _mm_prefetch(__P, _MM_HINT_T0); #endif } @@ -72,7 +72,7 @@ extern __inline void __attribute__((__gnu_inline__, __always_inline__)) _VEC(prefetchw)(void const *__P) { -#ifdef HAVE_MMX2 +#ifdef OPTIMIZE_MMX2 _mm_prefetch(__P, _MM_HINT_NTA); #endif } @@ -82,9 +82,9 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(loadu)(void const *__P) { -#ifdef HAVE_SSE3 +#ifdef OPTIMIZE_SSE3 return _mm_lddqu_si128(__P); -#elif defined HAVE_SSE2 +#elif defined OPTIMIZE_SSE2 return (__ivec)_mm_loadu_si128(__P); #else return *(__ivec const *)__P; @@ -96,7 +96,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(loada)(void const *__P) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return (__ivec)_mm_load_si128(__P); #else return *(__ivec const *)__P; @@ -108,7 +108,7 @@ extern __inline void __attribute__((__gnu_inline__, __always_inline__)) _VEC(storeu)(void *__P, __ivec src) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 _mm_storeu_si128(__P,src); #else *(__ivec *)__P = src; @@ -120,7 +120,7 @@ extern __inline void __attribute__((__gnu_inline__, __always_inline__)) _VEC(storea)(void *__P, __ivec src) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 _mm_store_si128(__P,src); #else *(__ivec *)__P = src; @@ -132,9 +132,9 @@ extern __inline void __attribute__((__gnu_inline__, __always_inline__)) _VEC(stream)(void *__P, __ivec src) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 _mm_stream_si128(__P,src); -#elif defined( HAVE_MMX2 ) +#elif defined( OPTIMIZE_MMX2 ) _mm_stream_pi(__P,src); #else *(__ivec *)__P = src; @@ -146,7 +146,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(setzero)(void) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return (__ivec)_mm_setzero_si128(); #else return _mm_setzero_si64(); @@ -158,7 +158,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(setff)(void) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_set1_epi8(0xFF); #else return _mm_set1_pi8(0xFF); @@ -170,7 +170,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(broadcast_u8)(unsigned char u8) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_set1_epi8(u8); #else return _mm_set1_pi8(u8); @@ -182,7 +182,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(broadcast_u16)(unsigned short u16) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_set1_epi16(u16); #else return _mm_set1_pi16(u16); @@ -194,7 +194,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(broadcast_u32)(unsigned int u32) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_set1_epi16(u32); #else return _mm_set1_pi16(u32); @@ -206,7 +206,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(or)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_or_si128(__m1,__m2); #else return _mm_or_si64(__m1,__m2); @@ -218,7 +218,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(and)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_and_si128(__m1,__m2); #else return _mm_and_si64(__m1,__m2); @@ -230,7 +230,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(andnot)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_andnot_si128(__m1,__m2); #else return _mm_andnot_si64(__m1,__m2); @@ -242,7 +242,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(xor)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_xor_si128(__m1,__m2); #else return _mm_xor_si64(__m1,__m2); @@ -262,7 +262,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(cmpgt_s8)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_cmpgt_epi8(__m1,__m2); #else return _mm_cmpgt_pi8(__m1,__m2); @@ -274,7 +274,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(cmpeq_s8)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_cmpeq_epi8(__m1,__m2); #else return _mm_cmpeq_pi8(__m1,__m2); @@ -286,7 +286,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(cmpgt_s16)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_cmpgt_epi16(__m1,__m2); #else return _mm_cmpgt_pi16(__m1,__m2); @@ -298,7 +298,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(cmpeq_s16)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_cmpeq_epi16(__m1,__m2); #else return _mm_cmpeq_pi16(__m1,__m2); @@ -310,7 +310,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(cmpgt_s32)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_cmpgt_epi32(__m1,__m2); #else return _mm_cmpgt_pi32(__m1,__m2); @@ -322,7 +322,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(cmpeq_s32)(__ivec __m1, __ivec __m2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_cmpeq_epi32(__m1,__m2); #else return _mm_cmpeq_pi32(__m1,__m2); @@ -334,16 +334,16 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(blend_u8)(__ivec src1,__ivec src2,__ivec mask) { -#ifdef HAVE_SSE4 +#ifdef OPTIMIZE_SSE4 return _mm_blendv_epi8(src1,src2,mask); #else /* Note: maskmovq is slowest instruction on both: mmx and sse engines. The programs coded with emulation of this instruction runs faster in 13-15 times! (Tested on AMD K10 cpu) Nickols_K. -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 _mm_maskmoveu_si128(src,mask,dest); -#elif defined(HAVE_MMX2) +#elif defined(OPTIMIZE_MMX2) _mm_maskmove_si64(src,mask,dest); #else */ @@ -356,7 +356,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(interleave_lo_u8)(__ivec s1, __ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_unpacklo_epi8(s1,s2); #else return _mm_unpacklo_pi8(s1,s2); @@ -367,7 +367,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(interleave_hi_u8)(__ivec s1, __ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_unpackhi_epi8(s1,s2); #else return _mm_unpackhi_pi8(s1,s2); @@ -378,7 +378,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(interleave_lo_u16)(__ivec s1, __ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_unpacklo_epi16(s1,s2); #else return _mm_unpacklo_pi16(s1,s2); @@ -389,7 +389,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(interleave_hi_u16)(__ivec s1, __ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_unpackhi_epi16(s1,s2); #else return _mm_unpackhi_pi16(s1,s2); @@ -400,7 +400,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(interleave_lo_u32)(__ivec s1, __ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_unpacklo_epi32(s1,s2); #else return _mm_unpacklo_pi32(s1,s2); @@ -411,7 +411,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(interleave_hi_u32)(__ivec s1, __ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_unpackhi_epi32(s1,s2); #else return _mm_unpackhi_pi32(s1,s2); @@ -451,7 +451,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(s16_from_s32)(__ivec s1, __ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_packs_epi32(s1,s2); #else return _mm_packs_pi32(s1,s2); @@ -462,7 +462,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(s8_from_s16)(__ivec s1, __ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_packs_epi16(s1,s2); #else return _mm_packs_pi16(s1,s2); @@ -473,7 +473,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(u8_from_u16)(__ivec s1, __ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_packus_epi16(s1,s2); #else return _mm_packs_pu16(s1,s2); @@ -485,7 +485,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(add_s8)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_add_epi8(s1,s2); #else return _mm_add_pi8(s1,s2); @@ -496,7 +496,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(add_s16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_add_epi16(s1,s2); #else return _mm_add_pi16(s1,s2); @@ -507,7 +507,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(add_s32)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_add_epi32(s1,s2); #else return _mm_add_pi32(s1,s2); @@ -518,7 +518,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sadd_s8)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_adds_epi8(s1,s2); #else return _mm_adds_pi8(s1,s2); @@ -529,7 +529,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sadd_s16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_adds_epi16(s1,s2); #else return _mm_adds_pi16(s1,s2); @@ -540,7 +540,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sadd_u8)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_adds_epu8(s1,s2); #else return _mm_adds_pu8(s1,s2); @@ -551,7 +551,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sadd_u16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_adds_epu16(s1,s2); #else return _mm_adds_pu16(s1,s2); @@ -562,7 +562,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sub_s8)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_sub_epi8(s1,s2); #else return _mm_sub_pi8(s1,s2); @@ -573,7 +573,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sub_s16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_sub_epi16(s1,s2); #else return _mm_sub_pi16(s1,s2); @@ -584,7 +584,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sub_s32)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_sub_epi32(s1,s2); #else return _mm_sub_pi32(s1,s2); @@ -595,7 +595,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(ssub_s8)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_subs_epi8(s1,s2); #else return _mm_subs_pi8(s1,s2); @@ -606,7 +606,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(ssub_s16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_subs_epi16(s1,s2); #else return _mm_subs_pi16(s1,s2); @@ -617,7 +617,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(ssub_u8)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_subs_epu8(s1,s2); #else return _mm_subs_pu8(s1,s2); @@ -628,7 +628,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(ssub_u16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_subs_epu16(s1,s2); #else return _mm_subs_pu16(s1,s2); @@ -639,7 +639,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(mullo_s16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_mullo_epi16(s1,s2); #else return _mm_mullo_pi16(s1,s2); @@ -650,7 +650,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(mulhi_s16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_mulhi_epi16(s1,s2); #else return _mm_mulhi_pi16(s1,s2); @@ -662,7 +662,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sll_s16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_sll_epi16(s1,s2); #else return _mm_sll_pi16(s1,s2); @@ -673,7 +673,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sll_s16_imm)(__ivec s1,int c) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_slli_epi16(s1,c); #else return _mm_slli_pi16(s1,c); @@ -684,7 +684,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sll_s32)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_sll_epi32(s1,s2); #else return _mm_sll_pi32(s1,s2); @@ -695,7 +695,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sll_s32_imm)(__ivec s1,int c) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_slli_epi32(s1,c); #else return _mm_slli_pi32(s1,c); @@ -706,7 +706,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sll_s64)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_sll_epi64(s1,s2); #else return _mm_sll_si64(s1,s2); @@ -717,7 +717,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sll_s64_imm)(__ivec s1,int c) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_slli_epi64(s1,c); #else return _mm_slli_si64(s1,c); @@ -728,7 +728,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sra_s16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_sra_epi16(s1,s2); #else return _mm_sra_pi16(s1,s2); @@ -739,7 +739,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sra_s16_imm)(__ivec s1,int c) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_srai_epi16(s1,c); #else return _mm_srai_pi16(s1,c); @@ -750,7 +750,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sra_s32)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_sra_epi32(s1,s2); #else return _mm_sra_pi32(s1,s2); @@ -761,7 +761,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(sra_s32_imm)(__ivec s1,int c) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_srai_epi32(s1,c); #else return _mm_srai_pi32(s1,c); @@ -772,7 +772,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(srl_s16)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_srl_epi16(s1,s2); #else return _mm_srl_pi16(s1,s2); @@ -783,7 +783,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(srl_s16_imm)(__ivec s1,int c) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_srli_epi16(s1,c); #else return _mm_srli_pi16(s1,c); @@ -794,7 +794,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(srl_s32)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_srl_epi32(s1,s2); #else return _mm_srl_pi32(s1,s2); @@ -805,7 +805,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(srl_s32_imm)(__ivec s1,int c) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_srli_epi32(s1,c); #else return _mm_srli_pi32(s1,c); @@ -816,7 +816,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(srl_s64)(__ivec s1,__ivec s2) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_srl_epi64(s1,s2); #else return _mm_srl_si64(s1,s2); @@ -827,7 +827,7 @@ extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) _VEC(srl_s64_imm)(__ivec s1,int c) { -#ifdef HAVE_SSE2 +#ifdef OPTIMIZE_SSE2 return _mm_srli_epi64(s1,c); #else return _mm_srli_si64(s1,c); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2009-12-07 16:07:43
|
Revision: 28 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=28&view=rev Author: nickols_k Date: 2009-12-07 16:07:36 +0000 (Mon, 07 Dec 2009) Log Message: ----------- fixes Modified Paths: -------------- DOCS/mplayerxp.1 mplayerxp/__mp_msg.h mplayerxp/configure mplayerxp/input/in_msg.h mplayerxp/libao2/ao_msg.h mplayerxp/libmpcodecs/ad_msg.h mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd_msg.h mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demux_msg.h mplayerxp/libvo/video_out.c mplayerxp/libvo/video_out_internal.h mplayerxp/libvo/vo_msg.h mplayerxp/mp_msg.h mplayerxp/mplayer.c mplayerxp/nls/nls_msg.h mplayerxp/osdep/osdep_msg.h mplayerxp/postproc/pp_msg.h mplayerxp/postproc/swscale.c mplayerxp/postproc/vf_scale.c Modified: DOCS/mplayerxp.1 =================================================================== --- DOCS/mplayerxp.1 2009-12-06 18:43:36 UTC (rev 27) +++ DOCS/mplayerxp.1 2009-12-07 16:07:36 UTC (rev 28) @@ -281,6 +281,31 @@ .B \-v enable verbose output (more -v means more verbosity) .TP +.B \-msgfilter +enable filtering of verbosed messages. The value is combination of these fields: + MSGT_GLOBAL 0x00000001 + MSGT_CPLAYER 0x00000002 + MSGT_VO 0x00000004 + MSGT_AO 0x00000008 + MSGT_DEMUXER 0x00000010 + MSGT_CFGPARSER 0x00000020 + MSGT_DECAUDIO 0x00000040 + MSGT_DECVIDEO 0x00000080 + MSGT_VOBSUB 0x00000100 + MSGT_OSDEP 0x00000200 + MSGT_SPUDEC 0x00000400 + MSGT_PLAYTREE 0x00000800 + MSGT_INPUT 0x00001000 + MSGT_OSD 0x00002000 + MSGT_CPUDETECT 0x00004000 + MSGT_CODECCFG 0x00008000 + MSGT_SWS 0x00010000 + MSGT_FINDSUB 0x00020000 + MSGT_SUBREADER 0x00040000 + MSGT_PP 0x00080000 + MSGT_NLS 0x00100000 + +.TP .B \-benchmark Performs benchmarking. Currently it displays 3 characteristics of movie playback: MIN benchmark, AVE benchmark and MAX benchmark. You can estimate possibility of Modified: mplayerxp/__mp_msg.h =================================================================== --- mplayerxp/__mp_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/__mp_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -17,8 +17,13 @@ #define MSG_ERR(args...) mp_msg(MSGT_CLASS,MSGL_ERR,__FILE__,__LINE__,##args ) #define MSG_V(args...) mp_msg(MSGT_CLASS,MSGL_V,__FILE__,__LINE__,##args ) #define MSG_OK(args...) mp_msg(MSGT_CLASS,MSGL_OK,__FILE__,__LINE__,##args ) +#define MSG_HINT(args...) mp_msg(MSGT_CLASS,MSGL_HINT,__FILE__,__LINE__,##args ) +#define MSG_STATUS(args...) mp_msg(MSGT_CLASS,MSGL_STATUS,__FILE__,__LINE__,##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_CLASS,MSGL_DBG2,__FILE__,__LINE__,##args ) #define MSG_DBG3(args...) mp_msg(MSGT_CLASS,MSGL_DBG3,__FILE__,__LINE__,##args ) -#define MSG_HINT(args...) mp_msg(MSGT_CLASS,MSGL_HINT,__FILE__,__LINE__,##args ) -#define MSG_STATUS(args...) mp_msg(MSGT_CLASS,MSGL_STATUS,__FILE__,__LINE__,##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/configure 2009-12-07 16:07:36 UTC (rev 28) @@ -1204,6 +1204,9 @@ #endif #endif +/* Removes warning about unused arguments */ +# define UNUSED(x) ((void)(x)) + #endif /* MPXP_CONFIG_H */ EOF Modified: mplayerxp/input/in_msg.h =================================================================== --- mplayerxp/input/in_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/input/in_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -17,7 +17,12 @@ #define MSG_ERR(args...) mp_msg(MSGT_INPUT,MSGL_ERR,__FILE__,__LINE__, ##args ) #define MSG_V(args...) mp_msg(MSGT_INPUT,MSGL_V,__FILE__,__LINE__, ##args ) #define MSG_OK(args...) mp_msg(MSGT_INPUT,MSGL_OK,__FILE__,__LINE__, ##args ) +#define MSG_HINT(args...) mp_msg(MSGT_INPUT,MSGL_HINT,__FILE__,__LINE__, ##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_INPUT,MSGL_DBG2,__FILE__,__LINE__, ##args ) #define MSG_DBG3(args...) mp_msg(MSGT_INPUT,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_INPUT,MSGL_HINT,__FILE__,__LINE__, ##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/libao2/ao_msg.h =================================================================== --- mplayerxp/libao2/ao_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libao2/ao_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -17,7 +17,12 @@ #define MSG_ERR(args...) mp_msg(MSGT_AO,MSGL_ERR,__FILE__,__LINE__, ##args ) #define MSG_V(args...) mp_msg(MSGT_AO,MSGL_V,__FILE__,__LINE__, ##args ) #define MSG_OK(args...) mp_msg(MSGT_AO,MSGL_OK,__FILE__,__LINE__, ##args ) +#define MSG_HINT(args...) mp_msg(MSGT_AO,MSGL_HINT,__FILE__,__LINE__, ##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_AO,MSGL_DBG2,__FILE__,__LINE__, ##args ) #define MSG_DBG3(args...) mp_msg(MSGT_AO,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_AO,MSGL_HINT,__FILE__,__LINE__, ##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/libmpcodecs/ad_msg.h =================================================================== --- mplayerxp/libmpcodecs/ad_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libmpcodecs/ad_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -15,7 +15,12 @@ #define MSG_ERR(args...) mp_msg(MSGT_DECAUDIO,MSGL_ERR,__FILE__,__LINE__, ##args ) #define MSG_V(args...) mp_msg(MSGT_DECAUDIO,MSGL_V,__FILE__,__LINE__, ##args ) #define MSG_OK(args...) mp_msg(MSGT_DECAUDIO,MSGL_OK,__FILE__,__LINE__, ##args ) +#define MSG_HINT(args...) mp_msg(MSGT_DECAUDIO,MSGL_HINT,__FILE__,__LINE__, ##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_DECAUDIO,MSGL_DBG2,__FILE__,__LINE__, ##args ) #define MSG_DBG3(args...) mp_msg(MSGT_DECAUDIO,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_DECAUDIO,MSGL_HINT,__FILE__,__LINE__, ##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libmpcodecs/dec_video.c 2009-12-07 16:07:36 UTC (rev 28) @@ -83,21 +83,37 @@ int init_video(sh_video_t *sh_video,const char* codecname,const char * vfm,int status){ unsigned o_bps,bpp; sh_video->codec=NULL; + MSG_DBG3("init_video(%p, %s, %s, %i)\n",sh_video,codecname,vfm,status); while((sh_video->codec=find_codec(sh_video->format, sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL, sh_video->codec,0) )){ // ok we found one codec int i; - if(sh_video->codec->flags&CODECS_FLAG_SELECTED) continue; // already tried & failed - if(codecname && strcmp(sh_video->codec->codec_name,codecname)) continue; // -vc - if(vfm && strcmp(sh_video->codec->driver_name,vfm)!=0) continue; // vfm doesn't match - if(sh_video->codec->status<status) continue; // too unstable + if(sh_video->codec->flags&CODECS_FLAG_SELECTED) { + MSG_DBG3("init_video: %s already tried and failed\n",sh_video->codec->codec_name); + continue; + } + if(codecname && strcmp(sh_video->codec->codec_name,codecname)) { + MSG_DBG3("init_video: %s != %s [-vc]\n",sh_video->codec->codec_name,codecname); + continue; + } + if(vfm && strcmp(sh_video->codec->driver_name,vfm)!=0) { + MSG_DBG3("init_video: 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("init_video: %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! for (i=0; mpcodecs_vd_drivers[i] != NULL; i++) if(strcmp(mpcodecs_vd_drivers[i]->info->driver_name,sh_video->codec->driver_name)==0) break; mpvdec=mpcodecs_vd_drivers[i]; - if(!mpvdec) continue; + if(!mpvdec) { + MSG_DBG3("init_video: mpcodecs_vd_drivers[%s]->mpvdec==0\n",mpcodecs_vd_drivers[i]->info->driver_name); + continue; + } // it's available, let's try to init! if(!mpvdec->init(sh_video)){ MSG_ERR(MSGTR_CODEC_CANT_INITV); Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libmpcodecs/vd.c 2009-12-07 16:07:36 UTC (rev 28) @@ -223,6 +223,7 @@ fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3), "MPlayerXP",vo_format_name(out_fmt)); + MSG_DBG2("vf configuring: %s\n",vf->info->name); if(vf->config(vf,sh->disp_w,sh->disp_h, screen_size_x,screen_size_y, fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3), @@ -231,6 +232,11 @@ sh->vfilter_inited=-1; return 0; } + MSG_DBG2("vf->config(%dx%d->%dx%d,flags=%d,'%s',%p)\n", + sh->disp_w,sh->disp_h, + screen_size_x,screen_size_y, + fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3), + vo_format_name(out_fmt),tune); return 1; } Modified: mplayerxp/libmpcodecs/vd_msg.h =================================================================== --- mplayerxp/libmpcodecs/vd_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libmpcodecs/vd_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -15,7 +15,12 @@ #define MSG_ERR(args...) mp_msg(MSGT_DECVIDEO,MSGL_ERR,__FILE__,__LINE__, ##args ) #define MSG_V(args...) mp_msg(MSGT_DECVIDEO,MSGL_V,__FILE__,__LINE__, ##args ) #define MSG_OK(args...) mp_msg(MSGT_DECVIDEO,MSGL_OK,__FILE__,__LINE__, ##args ) +#define MSG_HINT(args...) mp_msg(MSGT_DECVIDEO,MSGL_HINT,__FILE__,__LINE__, ##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_DECVIDEO,MSGL_DBG2,__FILE__,__LINE__, ##args ) #define MSG_DBG3(args...) mp_msg(MSGT_DECVIDEO,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_DECVIDEO,MSGL_HINT,__FILE__,__LINE__, ##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/libmpdemux/demux_lavf.c =================================================================== --- mplayerxp/libmpdemux/demux_lavf.c 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libmpdemux/demux_lavf.c 2009-12-07 16:07:36 UTC (rev 28) @@ -129,16 +129,16 @@ #define av_seek_frame(a,b,c,d) (*av_seek_frame_ptr)(a,b,c,d) static void (*av_close_input_file_ptr)(AVFormatContext *s); #define av_close_input_file(a) (*av_close_input_file_ptr)(a) -static unsigned int (*codec_get_tag_ptr)(const void *tags,int id); -#define codec_get_tag(a,b) (*codec_get_tag_ptr)(a,b) +static unsigned int (*ff_codec_get_tag_ptr)(const void *tags,int id); +#define ff_codec_get_tag(a,b) (*ff_codec_get_tag_ptr)(a,b) static AVInputFormat* (*av_iformat_next_ptr)(AVInputFormat *f); #define av_iformat_next(a) (*av_iformat_next_ptr)(a) static void (*av_free_packet_ptr)(AVPacket *pkt); #define av_free_packet(a) (*av_free_packet_ptr)(a) -static void **codec_bmp_tags_ptr; -static void **codec_wav_tags_ptr; +static void **ff_codec_bmp_tags_ptr; +static void **ff_codec_wav_tags_ptr; static void *dll_handle; @@ -156,14 +156,14 @@ av_seek_frame_ptr = ld_sym(dll_handle,"av_seek_frame"); av_iformat_next_ptr = ld_sym(dll_handle,"av_iformat_next"); av_close_input_file_ptr = ld_sym(dll_handle,"av_close_input_file"); - codec_get_tag_ptr = ld_sym(dll_handle,"codec_get_tag"); - codec_bmp_tags_ptr = ld_sym(dll_handle,"codec_bmp_tags"); - codec_wav_tags_ptr = ld_sym(dll_handle,"codec_wav_tags"); + ff_codec_get_tag_ptr = ld_sym(dll_handle,"ff_codec_get_tag"); + ff_codec_bmp_tags_ptr = ld_sym(dll_handle,"ff_codec_bmp_tags"); + ff_codec_wav_tags_ptr = ld_sym(dll_handle,"ff_codec_wav_tags"); return av_register_all_ptr && av_probe_input_format_ptr && register_protocol_ptr && url_fopen_ptr && av_open_input_stream_ptr && av_find_stream_info_ptr && av_read_frame_ptr && av_seek_frame_ptr && - av_close_input_file_ptr && codec_get_tag_ptr && codec_bmp_tags_ptr && - codec_wav_tags_ptr && av_find_input_format_ptr && av_iformat_next_ptr; + av_close_input_file_ptr && ff_codec_get_tag_ptr && ff_codec_bmp_tags_ptr && + ff_codec_wav_tags_ptr && av_find_input_format_ptr && av_iformat_next_ptr; } static int mpxp_open(URLContext *h, const char *filename, int flags){ @@ -219,6 +219,7 @@ NULL, NULL, /*int (*url_read_pause)(URLContext *h);*/ NULL, /*int (*url_read_seek)(URLContext *h,*/ + NULL /*int (*url_get_file_handle)(URLContext *h);*/ }; static void list_formats(void) { @@ -364,7 +365,7 @@ sh_audio_t* sh_audio=new_sh_audio(demuxer, i); priv->audio_streams++; if(!codec->codec_tag) - codec->codec_tag= codec_get_tag(codec_wav_tags_ptr,codec->codec_id); + codec->codec_tag= ff_codec_get_tag(ff_codec_wav_tags_ptr,codec->codec_id); if(!codec->codec_tag) codec->codec_tag= mpxp_codec_get_tag(mp_wav_tags, codec->codec_id); wf->wFormatTag= codec->codec_tag; @@ -432,7 +433,7 @@ priv->video_streams++; if(!codec->codec_tag) - codec->codec_tag= codec_get_tag(codec_bmp_tags_ptr,codec->codec_id); + codec->codec_tag= ff_codec_get_tag(ff_codec_bmp_tags_ptr,codec->codec_id); if(!codec->codec_tag) codec->codec_tag= mpxp_codec_get_tag(mp_bmp_tags, codec->codec_id); bih->biSize= sizeof(BITMAPINFOHEADER) + codec->extradata_size; Modified: mplayerxp/libmpdemux/demux_msg.h =================================================================== --- mplayerxp/libmpdemux/demux_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libmpdemux/demux_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -17,8 +17,13 @@ #define MSG_ERR(args...) mp_msg(MSGT_DEMUXER,MSGL_ERR,__FILE__,__LINE__,##args ) #define MSG_V(args...) mp_msg(MSGT_DEMUXER,MSGL_V,__FILE__,__LINE__,##args ) #define MSG_OK(args...) mp_msg(MSGT_DEMUXER,MSGL_OK,__FILE__,__LINE__,##args ) +#define MSG_HINT(args...) mp_msg(MSGT_DEMUXER,MSGL_HINT,__FILE__,__LINE__,##args ) +#define MSG_STATUS(args...) mp_msg(MSGT_DEMUXER,MSGL_STATUS,__FILE__,__LINE__,##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_DEMUXER,MSGL_DBG2,__FILE__,__LINE__,##args ) #define MSG_DBG3(args...) mp_msg(MSGT_DEMUXER,MSGL_DBG3,__FILE__,__LINE__,##args ) -#define MSG_HINT(args...) mp_msg(MSGT_DEMUXER,MSGL_HINT,__FILE__,__LINE__,##args ) -#define MSG_STATUS(args...) mp_msg(MSGT_DEMUXER,MSGL_STATUS,__FILE__,__LINE__,##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/libvo/video_out.c =================================================================== --- mplayerxp/libvo/video_out.c 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libvo/video_out.c 2009-12-07 16:07:36 UTC (rev 28) @@ -481,7 +481,7 @@ { uint32_t retval,dri_forced_fourcc; vo_query_fourcc_t qfourcc; - MSG_DBG3("dri_vo_dbg: vo_query_format(%08lX)\n",fourcc); + MSG_DBG3("dri_vo_dbg: vo_query_format(%08lX)\n",*fourcc); qfourcc.fourcc = *fourcc; qfourcc.w = src_w; qfourcc.h = src_h; @@ -921,6 +921,8 @@ uint32_t __FASTCALL__ vo_control(uint32_t request, void *data) { - MSG_DBG3("dri_vo_dbg: vo_control %u\n",request); - return video_out->control(request,data); + uint32_t rval; + rval=video_out->control(request,data); + MSG_DBG3("dri_vo_dbg: %u=vo_control( %u, %p )\n",rval,request,data); + return rval; } Modified: mplayerxp/libvo/video_out_internal.h =================================================================== --- mplayerxp/libvo/video_out_internal.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libvo/video_out_internal.h 2009-12-07 16:07:36 UTC (rev 28) @@ -44,6 +44,4 @@ #include "osd.h" -#define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */ - #endif Modified: mplayerxp/libvo/vo_msg.h =================================================================== --- mplayerxp/libvo/vo_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/libvo/vo_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -17,7 +17,12 @@ #define MSG_ERR(args...) mp_msg(MSGT_VO,MSGL_ERR,__FILE__,__LINE__, ##args ) #define MSG_V(args...) mp_msg(MSGT_VO,MSGL_V,__FILE__,__LINE__, ##args ) #define MSG_OK(args...) mp_msg(MSGT_VO,MSGL_OK,__FILE__,__LINE__, ##args ) +#define MSG_HINT(args...) mp_msg(MSGT_VO,MSGL_HINT,__FILE__,__LINE__, ##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_VO,MSGL_DBG2,__FILE__,__LINE__, ##args ) #define MSG_DBG3(args...) mp_msg(MSGT_VO,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_VO,MSGL_HINT,__FILE__,__LINE__, ##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/mp_msg.h =================================================================== --- mplayerxp/mp_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/mp_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -9,17 +9,17 @@ // stuff from level MSGL_FATAL-MSGL_HINT should be translated. /* TODO: more highlighted levels */ -#define MSGL_FATAL 0U /* will exit/abort LightRed */ +#define MSGL_FATAL 0U /* will exit/abort LightRed */ #define MSGL_ERR 1U /* continues Red */ -#define MSGL_WARN 2U /* only warning Yellow */ +#define MSGL_WARN 2U /* only warning Yellow */ #define MSGL_OK 3U /* checkpoint was passed OK. LightGreen */ #define MSGL_HINT 4U /* short help message LightCyan */ -#define MSGL_INFO 5U /* -quiet LightGray */ -#define MSGL_STATUS 6U /* v=0 (old status line) LightBlue */ -#define MSGL_V 7U /* v=1 Cyan */ -#define MSGL_DBG2 8U /* v=2 LightGray */ -#define MSGL_DBG3 9U /* v=3 LightGray */ -#define MSGL_DBG4 10U /* v=4 LightGray */ +#define MSGL_INFO 5U /* -quiet LightGray */ +#define MSGL_STATUS 6U /* v=0 (old status line) LightBlue */ +#define MSGL_V 7U /* v=1 Cyan */ +#define MSGL_DBG2 8U /* v=2 LightGray */ +#define MSGL_DBG3 9U /* v=3 LightGray */ +#define MSGL_DBG4 10U /* v=4 LightGray */ // code/module: Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/mplayer.c 2009-12-07 16:07:36 UTC (rev 28) @@ -140,9 +140,6 @@ /************************************************************************** Config file **************************************************************************/ -#ifndef UNUSED -#define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */ -#endif static int cfg_inc_verbose(struct config *conf){ UNUSED(conf); ++verbose; return 0;} static int cfg_include(struct config *conf, char *filename){ Modified: mplayerxp/nls/nls_msg.h =================================================================== --- mplayerxp/nls/nls_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/nls/nls_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -17,8 +17,13 @@ #define MSG_ERR(args...) mp_msg(MSGT_NLS,MSGL_ERR,__FILE__,__LINE__,##args ) #define MSG_V(args...) mp_msg(MSGT_NLS,MSGL_V,__FILE__,__LINE__,##args ) #define MSG_OK(args...) mp_msg(MSGT_NLS,MSGL_OK,__FILE__,__LINE__,##args ) +#define MSG_HINT(args...) mp_msg(MSGT_NLS,MSGL_HINT,__FILE__,__LINE__,##args ) +#define MSG_STATUS(args...) mp_msg(MSGT_NLS,MSGL_STATUS,__FILE__,__LINE__,##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_NLS,MSGL_DBG2,__FILE__,__LINE__,##args ) #define MSG_DBG3(args...) mp_msg(MSGT_NLS,MSGL_DBG3,__FILE__,__LINE__,##args ) -#define MSG_HINT(args...) mp_msg(MSGT_NLS,MSGL_HINT,__FILE__,__LINE__,##args ) -#define MSG_STATUS(args...) mp_msg(MSGT_NLS,MSGL_STATUS,__FILE__,__LINE__,##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/osdep/osdep_msg.h =================================================================== --- mplayerxp/osdep/osdep_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/osdep/osdep_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -17,7 +17,12 @@ #define MSG_ERR(args...) mp_msg(MSGT_OSDEP,MSGL_ERR,__FILE__,__LINE__, ##args ) #define MSG_V(args...) mp_msg(MSGT_OSDEP,MSGL_V,__FILE__,__LINE__, ##args ) #define MSG_OK(args...) mp_msg(MSGT_OSDEP,MSGL_OK,__FILE__,__LINE__, ##args ) +#define MSG_HINT(args...) mp_msg(MSGT_OSDEP,MSGL_HINT,__FILE__,__LINE__, ##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_OSDEP,MSGL_DBG2,__FILE__,__LINE__, ##args ) #define MSG_DBG3(args...) mp_msg(MSGT_OSDEP,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_OSDEP,MSGL_HINT,__FILE__,__LINE__, ##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/postproc/pp_msg.h =================================================================== --- mplayerxp/postproc/pp_msg.h 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/postproc/pp_msg.h 2009-12-07 16:07:36 UTC (rev 28) @@ -17,7 +17,12 @@ #define MSG_ERR(args...) mp_msg(MSGT_PP,MSGL_ERR,__FILE__,__LINE__, ##args ) #define MSG_V(args...) mp_msg(MSGT_PP,MSGL_V,__FILE__,__LINE__, ##args ) #define MSG_OK(args...) mp_msg(MSGT_PP,MSGL_OK,__FILE__,__LINE__, ##args ) +#define MSG_HINT(args...) mp_msg(MSGT_PP,MSGL_HINT,__FILE__,__LINE__, ##args ) +#ifndef NDEBUG #define MSG_DBG2(args...) mp_msg(MSGT_PP,MSGL_DBG2,__FILE__,__LINE__, ##args ) #define MSG_DBG3(args...) mp_msg(MSGT_PP,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_PP,MSGL_HINT,__FILE__,__LINE__, ##args ) +#else +#define MSG_DBG2(args...) +#define MSG_DBG3(args...) #endif +#endif Modified: mplayerxp/postproc/swscale.c =================================================================== --- mplayerxp/postproc/swscale.c 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/postproc/swscale.c 2009-12-07 16:07:36 UTC (rev 28) @@ -91,19 +91,19 @@ struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param) { - return (*sws_getContext)(srcW,srcH,srcFormat,dstW,dstH,dstFormat,flags,srcFilter,dstFilter,param); + return (*sws_getContext_ptr)(srcW,srcH,srcFormat,dstW,dstH,dstFormat,flags,srcFilter,dstFilter,param); } int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]) { - return (*sws_scale)(context,src,srcStride,srcSliceY,srcSliceH,dst,dstStride); + return (*sws_scale_ptr)(context,src,srcStride,srcSliceY,srcSliceH,dst,dstStride); } int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]) { - return (*sws_scale_ordered)(context,src,srcStride,srcSliceY,srcSliceH,dst,dstStride); + return (*sws_scale_ordered_ptr)(context,src,srcStride,srcSliceY,srcSliceH,dst,dstStride); } int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation) Modified: mplayerxp/postproc/vf_scale.c =================================================================== --- mplayerxp/postproc/vf_scale.c 2009-12-06 18:43:36 UTC (rev 27) +++ mplayerxp/postproc/vf_scale.c 2009-12-07 16:07:36 UTC (rev 28) @@ -127,7 +127,8 @@ } vo_flags=vf_next_query_format(vf,best,d_width,d_height); - + MSG_DBG2("vf_scale: %i=vf_next_query_format(%p,%X,%u,%u);\n" + ,vo_flags,vf,best,d_width,d_height); // scaling to dwidth*d_height, if all these TRUE: // - option -zoom // - no other sw/hw up/down scaling avail. @@ -193,13 +194,21 @@ // new swscaler: sws_getFlagsAndFilterFromCmdLine(&int_sws_flags, &srcFilter, &dstFilter); + MSG_DBG2("vf_scale: sws_getFlagsAndFilterFromCmdLine(...);\n"); int_sws_flags|= vf->priv->v_chr_drop << SWS_SRC_V_CHR_DROP_SHIFT; + MSG_DBG2("vf_scale: sws_getContext(%u, %u, %s, %u, %u, %s, %X);\n" + ,width,height >> vf->priv->interlaced + ,vo_format_name(outfmt),vf->priv->w + ,vf->priv->h >> vf->priv->interlaced + ,vo_format_name(best),int_sws_flags | get_sws_cpuflags() | SWS_PRINT_INFO); vf->priv->ctx=sws_getContext(width, height >> vf->priv->interlaced, pixfmt_from_fourcc(outfmt), vf->priv->w, vf->priv->h >> vf->priv->interlaced, pixfmt_from_fourcc(best), - int_sws_flags | get_sws_cpuflags() | SWS_PRINT_INFO, srcFilter, dstFilter, vf->priv->param); + int_sws_flags | get_sws_cpuflags() | SWS_PRINT_INFO, + srcFilter, dstFilter, vf->priv->param); + MSG_DBG2("vf_scale: %p=sws_getContext\n",vf->priv->ctx); if(vf->priv->interlaced){ vf->priv->ctx2=sws_getContext(width, height >> 1, pixfmt_from_fourcc(outfmt), @@ -212,6 +221,7 @@ MSG_WARN("Couldn't init SwScaler for this setup %p\n",vf->priv->ctx); return 0; } + MSG_DBG2("vf_scale: SwScaler for was inited\n"); vf->priv->fmt=best; if(vf->priv->palette){ @@ -393,6 +403,7 @@ // supported Input formats: YV12, I420, IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8, Y800 static int __FASTCALL__ query_format(struct vf_instance_s* vf, unsigned int fmt,unsigned w,unsigned h){ + MSG_DBG3("vf_scale: query_format(%p, %X, %u, %u\n",vf,fmt,w,h); switch(fmt){ case IMGFMT_YV12: case IMGFMT_I420: @@ -500,17 +511,6 @@ { *flags=0; -#ifdef CAN_COMPILE_MMX - if(gCpuCaps.hasMMX) - asm volatile("emms\n\t":::"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); //FIXME this shouldnt be required but it IS (even for non mmx versions) -#endif if(firstTime) { firstTime=0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2009-12-07 19:04:44
|
Revision: 32 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=32&view=rev Author: nickols_k Date: 2009-12-07 19:04:38 +0000 (Mon, 07 Dec 2009) Log Message: ----------- minor fixes Modified Paths: -------------- mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd.c mplayerxp/libmpdemux/test.c mplayerxp/mp_msg.c mplayerxp/mp_msg.h mplayerxp/postproc/pp_msg.h mplayerxp/postproc/vf.c mplayerxp/postproc/vf_scale.c Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2009-12-07 19:02:11 UTC (rev 31) +++ mplayerxp/libmpcodecs/dec_video.c 2009-12-07 19:04:38 UTC (rev 32) @@ -25,8 +25,7 @@ #include "vd.h" #include "dec_video.h" -#define MSGT_CLASS MSGT_DECVIDEO -#include "../__mp_msg.h" +#include "vd_msg.h" // =================================================================== Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2009-12-07 19:02:11 UTC (rev 31) +++ mplayerxp/libmpcodecs/vd.c 2009-12-07 19:04:38 UTC (rev 32) @@ -16,7 +16,6 @@ #include "stream.h" #include "demuxer.h" #include "stheader.h" - #include "vd.h" #include "../postproc/vf.h" #include "vd_msg.h" @@ -110,16 +109,17 @@ out_fmt=sh->codec->outfmt[i]; if(out_fmt==(signed int)0xFFFFFFFF) continue; flags=vf_query_format(vf,out_fmt,w,h); - MSG_DBG2("vo_debug[step i=%d]: query(%s %ix%i) returned 0x%X for:\n",i,vo_format_name(out_fmt),w,h,vo_flags); + MSG_DBG2("vo_debug[step i=%d]: query(%s %ix%i) returned 0x%X for:\n",i,vo_format_name(out_fmt),w,h,flags); if(verbose>1) if(verbose) vf_showlist(vf); 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(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)==CONTROL_FALSE) { - MSG_DBG2("vo_debug: codec query_format(%s) returned FALSE\n",vo_format_name(out_fmt)); + MSG_DBG2("vo_debug: codec[%s] query_format(%s) returned FALSE\n",mpvdec->info->driver_name,vo_format_name(out_fmt)); continue; } - j=i; vo_flags=flags; if(flags&VFCAP_CSP_SUPPORTED_BY_HW) break; + j=i; vo_flags=flags; + if(flags&VFCAP_CSP_SUPPORTED_BY_HW) break; } else if(!palette && !(vo_flags&3) && (out_fmt==IMGFMT_RGB8||out_fmt==IMGFMT_BGR8)){ sh->outfmtidx=j; // pass index to the control() function this way @@ -130,7 +130,13 @@ if(j<0){ // TODO: no match - we should use conversion... if(strcmp(vf->info->name,"fmtcvt") && palette!=1){ - MSG_INFO("Can't find colorspace! Trying -vf fmtcvt\n"); + int ind; + MSG_WARN("Can't find colorspace for: "); + for(ind=0;ind<CODECS_MAX_OUTFMT;ind++) { + if(sh->codec->outfmt[ind]==(signed int)0xFFFFFFFF) break; + MSG_WARN("'%s' ",vo_format_name(sh->codec->outfmt[ind])); + } + MSG_WARN("Trying -vf fmtcvt\n"); sc=vf=vf_open_filter(vf,sh,"fmtcvt",NULL); goto csp_again; } else Modified: mplayerxp/libmpdemux/test.c =================================================================== --- mplayerxp/libmpdemux/test.c 2009-12-07 19:02:11 UTC (rev 31) +++ mplayerxp/libmpdemux/test.c 2009-12-07 19:04:38 UTC (rev 32) @@ -3,7 +3,7 @@ #include <stdlib.h> #include <string.h> -#include "mp_config.h" +#include "../mp_config.h" #include "demux_msg.h" #include "stream.h" Modified: mplayerxp/mp_msg.c =================================================================== --- mplayerxp/mp_msg.c 2009-12-07 19:02:11 UTC (rev 31) +++ mplayerxp/mp_msg.c 2009-12-07 19:04:38 UTC (rev 32) @@ -80,10 +80,12 @@ if(verbose>1 && was_eol) { unsigned mod_name; + const char *smod=NULL; mod_name = 0; while((mod&0x1)==0) { mod_name++; mod>>=1; } if(mod_name < sizeof(msg_prefix)/sizeof(msg_prefix[0])) - fprintf(stderr,"%s.%s(%u): ",msg_prefix[mod_name],srcfile,linenum); + smod = msg_prefix[mod_name]; + fprintf(stderr,"%s.%s(%u): ",smod?smod:"UNKNOWN",srcfile,linenum); } ssize=vsprintf(sbuf,format, va); if(strcmp(nls_get_screen_cp(),"UTF-8")!=0) { Modified: mplayerxp/mp_msg.h =================================================================== --- mplayerxp/mp_msg.h 2009-12-07 19:02:11 UTC (rev 31) +++ mplayerxp/mp_msg.h 2009-12-07 19:04:38 UTC (rev 32) @@ -56,7 +56,7 @@ #ifdef __GNUC__ static inline void mp_msg_dummy(void) {} -#define mp_msg(mod,lev, file, args... ) (lev<verbose+MSGL_V?(mp_msg_c(((lev&0xF)<<28)|(mod&0x0FFFFFFF),file,## args)):(mp_msg_dummy())) +#define mp_msg(mod,lev, file, args... ) ((lev<(verbose+MSGL_V))?(mp_msg_c(((lev&0xF)<<28)|(mod&0x0FFFFFFF),file,## args)):(mp_msg_dummy())) #else #define mp_msg(mod,lev, file, ... ) mp_msg_c(((lev&0xF)<<28)|(mod&0x0FFFFFFF),file,__VA_ARGS__) #endif Modified: mplayerxp/postproc/pp_msg.h =================================================================== --- mplayerxp/postproc/pp_msg.h 2009-12-07 19:02:11 UTC (rev 31) +++ mplayerxp/postproc/pp_msg.h 2009-12-07 19:04:38 UTC (rev 32) @@ -1,5 +1,5 @@ -#ifndef AO_MSG_H -#define AO_MSG_H +#ifndef PP_MSG_H +#define PP_MSG_H #include "../mp_msg.h" #undef MSG_INFO @@ -8,9 +8,9 @@ #undef MSG_ERR #undef MSG_V #undef MSG_OK +#undef MSG_HINT #undef MSG_DBG2 #undef MSG_DBG3 -#undef MSG_HINT #define MSG_INFO(args...) mp_msg(MSGT_PP,MSGL_INFO,__FILE__,__LINE__, ##args ) #define MSG_FATAL(args...) mp_msg(MSGT_PP,MSGL_FATAL,__FILE__,__LINE__, ##args ) #define MSG_WARN(args...) mp_msg(MSGT_PP,MSGL_WARN,__FILE__,__LINE__, ##args ) Modified: mplayerxp/postproc/vf.c =================================================================== --- mplayerxp/postproc/vf.c 2009-12-07 19:02:11 UTC (rev 31) +++ mplayerxp/postproc/vf.c 2009-12-07 19:04:38 UTC (rev 32) @@ -7,7 +7,6 @@ #include <malloc.h> #endif #include "../mplayer.h" -#include "pp_msg.h" #include "../help_mp.h" #include "../libvo/img_format.h" @@ -17,6 +16,7 @@ #include "../libvo/fastmemcpy.h" #include "codec-cfg.h" +#include "pp_msg.h" extern const vf_info_t vf_info_1bpp; extern const vf_info_t vf_info_2xsai; Modified: mplayerxp/postproc/vf_scale.c =================================================================== --- mplayerxp/postproc/vf_scale.c 2009-12-07 19:02:11 UTC (rev 31) +++ mplayerxp/postproc/vf_scale.c 2009-12-07 19:04:38 UTC (rev 32) @@ -4,7 +4,6 @@ #include <inttypes.h> #include "../mp_config.h" -#include "pp_msg.h" #include "../cpudetect.h" #include "../libvo/img_format.h" @@ -14,6 +13,7 @@ #include "../libvo/fastmemcpy.h" #include "swscale.h" #include "vf_scale.h" +#include "pp_msg.h" struct vf_priv_s { int w,h,ofmt; @@ -99,7 +99,7 @@ if(ret&VFCAP_CSP_SUPPORTED_BY_HW){ best=format; // no conversion -> bingo! break; - } + } if(ret&VFCAP_CSP_SUPPORTED && !best) best=format; // best with conversion } @@ -394,7 +394,7 @@ default: break; } - + return vf_next_control(vf,request,data); } @@ -403,7 +403,7 @@ // supported Input formats: YV12, I420, IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8, Y800 static int __FASTCALL__ query_format(struct vf_instance_s* vf, unsigned int fmt,unsigned w,unsigned h){ - MSG_DBG3("vf_scale: query_format(%p, %X, %u, %u\n",vf,fmt,w,h); + MSG_DBG3("vf_scale: query_format(%p, %X(%s), %u, %u\n",vf,fmt,vo_format_name(fmt),w,h); switch(fmt){ case IMGFMT_YV12: case IMGFMT_I420: @@ -416,13 +416,13 @@ case IMGFMT_BGR15: case IMGFMT_RGB32: case IMGFMT_RGB24: - case IMGFMT_Y800: - case IMGFMT_Y8: - case IMGFMT_YVU9: - case IMGFMT_IF09: - case IMGFMT_444P: - case IMGFMT_422P: - case IMGFMT_411P: + case IMGFMT_Y800: + case IMGFMT_Y8: + case IMGFMT_YVU9: + case IMGFMT_IF09: + case IMGFMT_444P: + case IMGFMT_422P: + case IMGFMT_411P: { unsigned int best=find_best_out(vf,w,h); int flags; @@ -435,9 +435,11 @@ MSG_DBG2("[sw_scale] Can't find HW support for %s on %s\n",vo_format_name(best),vf->next->info->name); return 0; // huh? } + MSG_DBG3("[sw_scale] %s supported on %s like %u\n",vo_format_name(best),vf->next->info->name,flags); if(fmt!=best) flags&=~VFCAP_CSP_SUPPORTED_BY_HW; // do not allow scaling, if we are before the PP fliter! if(!(flags&VFCAP_POSTPROC)) flags|=VFCAP_SWSCALE; + MSG_DBG3("[sw_scale] returning: %u\n",flags); return flags; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2009-12-08 13:00:55
|
Revision: 33 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=33&view=rev Author: nickols_k Date: 2009-12-08 13:00:44 +0000 (Tue, 08 Dec 2009) Log Message: ----------- minor fixes and cleanups Modified Paths: -------------- Makefile mplayerxp/asxparser.c mplayerxp/cfgparser.c mplayerxp/codec-cfg.c mplayerxp/cpudetect.c mplayerxp/dump.c mplayerxp/find_sub.c mplayerxp/libao2/ao_alsa9.c mplayerxp/libao2/ao_jack.c mplayerxp/libao2/ao_nas.c mplayerxp/libao2/ao_null.c mplayerxp/libao2/ao_openal.c mplayerxp/libao2/ao_oss.c mplayerxp/libao2/ao_sdl.c mplayerxp/libao2/ao_wav.c mplayerxp/libmpcodecs/ad_dmo.c mplayerxp/libmpcodecs/ad_mp3.c mplayerxp/libmpcodecs/ad_real.c mplayerxp/libmpcodecs/dec_audio.c mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd_dmo.c mplayerxp/libmpcodecs/vd_qtvideo.c mplayerxp/libmpcodecs/vd_theora.c mplayerxp/libmpdemux/asf_mmst_streaming.c mplayerxp/libmpdemux/cache2.c mplayerxp/libmpdemux/demux_asf.c mplayerxp/libmpdemux/demux_audio.c mplayerxp/libmpdemux/demux_avi.c mplayerxp/libmpdemux/demux_film.c mplayerxp/libmpdemux/demux_fli.c mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demux_mkv.c mplayerxp/libmpdemux/demux_mov.c mplayerxp/libmpdemux/demux_mpg.c mplayerxp/libmpdemux/demux_mpxp64.c mplayerxp/libmpdemux/demux_nsv.c mplayerxp/libmpdemux/demux_nuv.c mplayerxp/libmpdemux/demux_ogg.c mplayerxp/libmpdemux/demux_pva.c mplayerxp/libmpdemux/demux_ra.c mplayerxp/libmpdemux/demux_rawvideo.c mplayerxp/libmpdemux/demux_real.c mplayerxp/libmpdemux/demux_roq.c mplayerxp/libmpdemux/demux_smjpeg.c mplayerxp/libmpdemux/demux_ts.c mplayerxp/libmpdemux/demux_ty.c mplayerxp/libmpdemux/demux_viv.c mplayerxp/libmpdemux/demux_y4m.c mplayerxp/libmpdemux/demuxer.c mplayerxp/libmpdemux/librtsp/rtsp.c mplayerxp/libmpdemux/librtsp/rtsp_rtp.c mplayerxp/libmpdemux/librtsp/rtsp_session.c mplayerxp/libmpdemux/mux_lavf.c mplayerxp/libmpdemux/mux_mpxp64.c mplayerxp/libmpdemux/network.c mplayerxp/libmpdemux/parse_mp4.c mplayerxp/libmpdemux/realrtsp/asmrp.c mplayerxp/libmpdemux/rtp.c mplayerxp/libmpdemux/s_dvdnav.c mplayerxp/libmpdemux/s_dvdplay.c mplayerxp/libmpdemux/s_dvdread.c mplayerxp/libmpdemux/s_ftp.c mplayerxp/libmpdemux/s_network.c mplayerxp/libmpdemux/s_rtsp.c mplayerxp/libmpdemux/s_udp.c mplayerxp/libmpdemux/s_vcd.c mplayerxp/libmpdemux/s_vcdnav.c mplayerxp/libmpdemux/stream.c mplayerxp/libmpdemux/sub_ty.c mplayerxp/libmpdemux/tcp.c mplayerxp/libmpdemux/test.c mplayerxp/libmpdemux/tvi_v4l.c mplayerxp/libmpdemux/udp.c mplayerxp/libmpdemux/url.c mplayerxp/libmpdemux/video.c mplayerxp/libvo/font_load.c mplayerxp/libvo/jpeg_enc.c mplayerxp/libvo/osd.c mplayerxp/libvo/screenshot.c mplayerxp/libvo/sub.c mplayerxp/libvo/vo_null.c mplayerxp/libvo/vo_xvidix.c mplayerxp/libvo/vosub_vidix.c mplayerxp/libvo/x11_common.c mplayerxp/m_option.c mplayerxp/m_property.c mplayerxp/mp_image.c mplayerxp/mp_msg.c mplayerxp/nls/recode.c mplayerxp/osdep/lrmi.c mplayerxp/osdep/shmem.c mplayerxp/osdep/vbelib.c mplayerxp/postproc/libmenu/menu.c mplayerxp/postproc/libmenu/menu_cmdlist.c mplayerxp/postproc/libmenu/menu_console.c mplayerxp/postproc/libmenu/menu_filesel.c mplayerxp/postproc/libmenu/menu_param.c mplayerxp/postproc/libmenu/menu_pt.c mplayerxp/postproc/libmenu/menu_txt.c mplayerxp/postproc/vf_1bpp.c mplayerxp/postproc/vf_2xsai.c mplayerxp/postproc/vf_aspect.c mplayerxp/postproc/vf_delogo.c mplayerxp/postproc/vf_denoise3d.c mplayerxp/postproc/vf_dint.c mplayerxp/postproc/vf_down3dright.c mplayerxp/postproc/vf_eq.c mplayerxp/postproc/vf_expand.c mplayerxp/postproc/vf_format.c mplayerxp/postproc/vf_framestep.c mplayerxp/postproc/vf_il.c mplayerxp/postproc/vf_menu.c mplayerxp/postproc/vf_mirror.c mplayerxp/postproc/vf_noise.c mplayerxp/postproc/vf_ow.c mplayerxp/postproc/vf_palette.c mplayerxp/postproc/vf_panscan.c mplayerxp/postproc/vf_perspective.c mplayerxp/postproc/vf_pp.c mplayerxp/postproc/vf_raw.c mplayerxp/postproc/vf_rectangle.c mplayerxp/postproc/vf_rgb2bgr.c mplayerxp/postproc/vf_rotate.c mplayerxp/postproc/vf_smartblur.c mplayerxp/postproc/vf_softpulldown.c mplayerxp/postproc/vf_swapuv.c mplayerxp/postproc/vf_test.c mplayerxp/postproc/vf_unsharp.c mplayerxp/postproc/vf_vo.c mplayerxp/postproc/vf_yuvcsp.c mplayerxp/postproc/vf_yuy2.c mplayerxp/postproc/vf_yvu9.c mplayerxp/sig_hand.c mplayerxp/spudec.c mplayerxp/subreader.c Modified: Makefile =================================================================== --- Makefile 2009-12-07 19:04:38 UTC (rev 32) +++ Makefile 2009-12-08 13:00:44 UTC (rev 33) @@ -4,11 +4,17 @@ all: $(SUBDIRS) + .PHONY: subdirs $(SUBDIRS) + subdirs: $(SUBDIRS) $(SUBDIRS): +ifeq ($(filter 3.81,$(firstword $(sort $(MAKE_VERSION) \ 3.81))),) +$(error 'make' utility is too old. Required version is 3.81) +@exit 1 +endif $(MAKE) -C $@ install: Modified: mplayerxp/asxparser.c =================================================================== --- mplayerxp/asxparser.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/asxparser.c 2009-12-08 13:00:44 UTC (rev 33) @@ -8,10 +8,10 @@ #include "libmpdemux/stream.h" #include "playtreeparser.h" #include "asxparser.h" +#include "cfgparser.h" +#include "../mplayer.h" #define MSGT_CLASS MSGT_PLAYTREE #include "__mp_msg.h" -#include "cfgparser.h" -#include "../mplayer.h" ////// List utils Modified: mplayerxp/cfgparser.c =================================================================== --- mplayerxp/cfgparser.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/cfgparser.c 2009-12-08 13:00:44 UTC (rev 33) @@ -16,8 +16,6 @@ #include <string.h> #include <errno.h> #include "mp_config.h" -#define MSGT_CLASS MSGT_CFGPARSER -#include "__mp_msg.h" #define COMMAND_LINE 0 #define CONFIG_FILE 1 @@ -39,6 +37,8 @@ #include "libmpdemux/stream.h" #include "cfgparser.h" +#define MSGT_CLASS MSGT_CFGPARSER +#include "__mp_msg.h" typedef int (*cfg_func_arg_param_t)(config_t *,const char *,const char *); typedef int (*cfg_func_param_t)(config_t *,const char *); Modified: mplayerxp/codec-cfg.c =================================================================== --- mplayerxp/codec-cfg.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/codec-cfg.c 2009-12-08 13:00:44 UTC (rev 33) @@ -25,10 +25,10 @@ // for mmioFOURCC: #include "wine/avifmt.h" +#include "libvo/img_format.h" +#include "codec-cfg.h" #define MSGT_CLASS MSGT_CODECCFG #include "__mp_msg.h" -#include "libvo/img_format.h" -#include "codec-cfg.h" #define MAX_NR_TOKEN 16 Modified: mplayerxp/cpudetect.c =================================================================== --- mplayerxp/cpudetect.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/cpudetect.c 2009-12-08 13:00:44 UTC (rev 33) @@ -1,8 +1,8 @@ #include "mp_config.h" #include "cpudetect.h" +#include "help_mp.h" #define MSGT_CLASS MSGT_CPUDETECT #include "__mp_msg.h" -#include "help_mp.h" CpuCaps gCpuCaps; #ifdef HAVE_MALLOC Modified: mplayerxp/dump.c =================================================================== --- mplayerxp/dump.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/dump.c 2009-12-08 13:00:44 UTC (rev 33) @@ -10,14 +10,14 @@ #include "mp_config.h" #include "dump.h" -#define MSGT_CLASS MSGT_GLOBAL -#include "__mp_msg.h" #include "sig_hand.h" #include "help_mp.h" #include "input/input.h" #include "../mplayer.h" #include "libmpdemux/muxer.h" #include "libmpdemux/mrl.h" +#define MSGT_CLASS MSGT_GLOBAL +#include "__mp_msg.h" static char *media=NULL,*port=NULL; Modified: mplayerxp/find_sub.c =================================================================== --- mplayerxp/find_sub.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/find_sub.c 2009-12-08 13:00:44 UTC (rev 33) @@ -8,11 +8,11 @@ #include <stdio.h> #include <limits.h> -#define MSGT_CLASS MSGT_FINDSUB -#include "__mp_msg.h" #include "libvo/video_out.h" #include "libvo/sub.h" #include "subreader.h" +#define MSGT_CLASS MSGT_FINDSUB +#include "__mp_msg.h" static int current_sub=0; Modified: mplayerxp/libao2/ao_alsa9.c =================================================================== --- mplayerxp/libao2/ao_alsa9.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libao2/ao_alsa9.c 2009-12-08 13:00:44 UTC (rev 33) @@ -26,8 +26,8 @@ #include "audio_out.h" #include "audio_out_internal.h" #include "afmt.h" +#include "../libmpdemux/mrl.h" #include "ao_msg.h" -#include "../libmpdemux/mrl.h" static ao_info_t info = { Modified: mplayerxp/libao2/ao_jack.c =================================================================== --- mplayerxp/libao2/ao_jack.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libao2/ao_jack.c 2009-12-08 13:00:44 UTC (rev 33) @@ -27,7 +27,6 @@ #include <unistd.h> #include "mp_config.h" -#include "ao_msg.h" #include "audio_out.h" #include "audio_out_internal.h" @@ -36,8 +35,8 @@ #include "osdep/timer.h" #include "../fifo.h" - #include <jack/jack.h> +#include "ao_msg.h" static const ao_info_t info = { Modified: mplayerxp/libao2/ao_nas.c =================================================================== --- mplayerxp/libao2/ao_nas.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libao2/ao_nas.c 2009-12-08 13:00:44 UTC (rev 33) @@ -54,12 +54,12 @@ #include <audio/audiolib.h> #include "mp_config.h" -#include "ao_msg.h" #include "audio_out.h" #include "audio_out_internal.h" #include "postproc/af_format.h" #include "afmt.h" +#include "ao_msg.h" /* NAS_FRAG_SIZE must be a power-of-two value */ #define NAS_FRAG_SIZE 4096 Modified: mplayerxp/libao2/ao_null.c =================================================================== --- mplayerxp/libao2/ao_null.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libao2/ao_null.c 2009-12-08 13:00:44 UTC (rev 33) @@ -8,11 +8,11 @@ #include "mp_config.h" #include "../bswap.h" -#include "ao_msg.h" #include "../libmpdemux/mrl.h" #include "afmt.h" #include "audio_out.h" #include "audio_out_internal.h" +#include "ao_msg.h" static ao_info_t info = { Modified: mplayerxp/libao2/ao_openal.c =================================================================== --- mplayerxp/libao2/ao_openal.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libao2/ao_openal.c 2009-12-08 13:00:44 UTC (rev 33) @@ -28,14 +28,13 @@ #include <AL/alc.h> #include <AL/al.h> -#include "ao_msg.h" - #include "audio_out.h" #include "audio_out_internal.h" #include "postproc/af_format.h" #include "afmt.h" #include "osdep/timer.h" //#include "subopt-helper.h" +#include "ao_msg.h" static const ao_info_t info = { Modified: mplayerxp/libao2/ao_oss.c =================================================================== --- mplayerxp/libao2/ao_oss.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libao2/ao_oss.c 2009-12-08 13:00:44 UTC (rev 33) @@ -14,9 +14,9 @@ #include "../mixer.h" #include "afmt.h" -#include "ao_msg.h" #include "audio_out.h" #include "audio_out_internal.h" +#include "ao_msg.h" static ao_info_t info = { Modified: mplayerxp/libao2/ao_sdl.c =================================================================== --- mplayerxp/libao2/ao_sdl.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libao2/ao_sdl.c 2009-12-08 13:00:44 UTC (rev 33) @@ -17,8 +17,8 @@ #include "audio_out_internal.h" #include "afmt.h" #include <SDL/SDL.h> +#include "../libvo/fastmemcpy.h" #include "ao_msg.h" -#include "../libvo/fastmemcpy.h" static ao_info_t info = { Modified: mplayerxp/libao2/ao_wav.c =================================================================== --- mplayerxp/libao2/ao_wav.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libao2/ao_wav.c 2009-12-08 13:00:44 UTC (rev 33) @@ -29,8 +29,8 @@ #include "afmt.h" #include "audio_out.h" #include "audio_out_internal.h" +#include "help_mp.h" #include "ao_msg.h" -#include "help_mp.h" #ifdef __MINGW32__ // for GetFileType to detect pipes Modified: mplayerxp/libmpcodecs/ad_dmo.c =================================================================== --- mplayerxp/libmpcodecs/ad_dmo.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpcodecs/ad_dmo.c 2009-12-08 13:00:44 UTC (rev 33) @@ -6,10 +6,9 @@ #include "codecs_ld.h" #include "mp_config.h" -#include "mp_msg.h" #include "help_mp.h" - #include "ad_internal.h" +#include "ad_msg.h" static const ad_info_t info = { Modified: mplayerxp/libmpcodecs/ad_mp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpcodecs/ad_mp3.c 2009-12-08 13:00:44 UTC (rev 33) @@ -66,7 +66,7 @@ static void *dll_handle; static int load_dll(const char *libname) { - if(!(dll_handle=ld_codec(libname,NULL))) return 0; + if(!(dll_handle=ld_codec(libname,"http://www.mpg123.de"))) return 0; mpg123_init_ptr = ld_sym(dll_handle,"mpg123_init"); mpg123_exit_ptr = ld_sym(dll_handle,"mpg123_exit"); mpg123_new_ptr = ld_sym(dll_handle,"mpg123_new"); Modified: mplayerxp/libmpcodecs/ad_real.c =================================================================== --- mplayerxp/libmpcodecs/ad_real.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpcodecs/ad_real.c 2009-12-08 13:00:44 UTC (rev 33) @@ -9,8 +9,8 @@ #include <dlfcn.h> #include "ad_internal.h" +#include "codecs_ld.h" #include "ad_msg.h" -#include "codecs_ld.h" static const ad_info_t info = { "RealAudio decoder", "realaud", Modified: mplayerxp/libmpcodecs/dec_audio.c =================================================================== --- mplayerxp/libmpcodecs/dec_audio.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpcodecs/dec_audio.c 2009-12-08 13:00:44 UTC (rev 33) @@ -20,9 +20,8 @@ #include "../mplayer.h" #include "../libmpdemux/demuxer_r.h" #include "../postproc/af.h" -#define MSGT_CLASS MSGT_DECAUDIO -#include "../__mp_msg.h" #include "../libvo/fastmemcpy.h" +#include "ad_msg.h" #ifdef USE_FAKE_MONO int fakemono=0; Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpcodecs/dec_video.c 2009-12-08 13:00:44 UTC (rev 33) @@ -25,15 +25,13 @@ #include "vd.h" #include "dec_video.h" -#include "vd_msg.h" - // =================================================================== - vf_cfg_t vf_cfg; // Configuration for audio filters #include "postproc/postprocess.h" #include "cpudetect.h" +#include "vd_msg.h" extern int v_bright; extern int v_cont; Modified: mplayerxp/libmpcodecs/vd_dmo.c =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpcodecs/vd_dmo.c 2009-12-08 13:00:44 UTC (rev 33) @@ -4,7 +4,6 @@ #include "mp_config.h" -#include "mp_msg.h" #include "help_mp.h" #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ @@ -13,6 +12,7 @@ #include "codecs_ld.h" #include "../../loader/dmo/DMO_VideoDecoder.h" +#include "vd_msg.h" static const vd_info_t info = { "DMO video codecs", Modified: mplayerxp/libmpcodecs/vd_qtvideo.c =================================================================== --- mplayerxp/libmpcodecs/vd_qtvideo.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpcodecs/vd_qtvideo.c 2009-12-08 13:00:44 UTC (rev 33) @@ -3,7 +3,6 @@ #include "mp_config.h" #include "../mplayer.h" -#include "mp_msg.h" #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ @@ -14,6 +13,7 @@ #include "../../loader/ldt_keeper.h" #endif #include "codecs_ld.h" +#include "vd_msg.h" static const vd_info_t info = { "Quicktime Video decoder", Modified: mplayerxp/libmpcodecs/vd_theora.c =================================================================== --- mplayerxp/libmpcodecs/vd_theora.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpcodecs/vd_theora.c 2009-12-08 13:00:44 UTC (rev 33) @@ -5,11 +5,11 @@ #include <dlfcn.h> #include "mp_config.h" -#include "vd_msg.h" #include "help_mp.h" #include "codecs_ld.h" #include "vd_internal.h" +#include "vd_msg.h" static const vd_info_t info = { "Theora/VP3", Modified: mplayerxp/libmpdemux/asf_mmst_streaming.c =================================================================== --- mplayerxp/libmpdemux/asf_mmst_streaming.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/asf_mmst_streaming.c 2009-12-08 13:00:44 UTC (rev 33) @@ -19,7 +19,6 @@ #include "tcp.h" #include "url.h" #include "asf.h" -#include "demux_msg.h" #include "stream.h" #include "network.h" @@ -43,6 +42,7 @@ #include <langinfo.h> #endif #endif +#include "demux_msg.h" extern int audio_id; extern int video_id; Modified: mplayerxp/libmpdemux/cache2.c =================================================================== --- mplayerxp/libmpdemux/cache2.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/cache2.c 2009-12-08 13:00:44 UTC (rev 33) @@ -13,7 +13,6 @@ #include <unistd.h> #include <pthread.h> -#include "demux_msg.h" #include "stream.h" #include "../sig_hand.h" #include "../osdep/timer.h" @@ -22,6 +21,7 @@ #include "../help_mp.h" #include "mpdemux.h" #include "../mplayer.h" +#include "demux_msg.h" #ifndef min #define min(a,b) ((a)<(b)?(a):(b)) Modified: mplayerxp/libmpdemux/demux_asf.c =================================================================== --- mplayerxp/libmpdemux/demux_asf.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_asf.c 2009-12-08 13:00:44 UTC (rev 33) @@ -5,7 +5,6 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "bswap.h" @@ -15,6 +14,7 @@ #include "stheader.h" #include "../libmpcodecs/dec_audio.h" #include "aviprint.h" +#include "demux_msg.h" /* * Load 16/32-bit values in little endian byte order * from an unaligned address Modified: mplayerxp/libmpdemux/demux_audio.c =================================================================== --- mplayerxp/libmpdemux/demux_audio.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_audio.c 2009-12-08 13:00:44 UTC (rev 33) @@ -1,5 +1,4 @@ #include "../mp_config.h" -#include "demux_msg.h" #include <stdlib.h> #include <stdio.h> @@ -16,6 +15,7 @@ #ifdef MP_DEBUG #include <assert.h> #endif +#include "demux_msg.h" #define RAW_MP1 1 #define RAW_MP2 2 Modified: mplayerxp/libmpdemux/demux_avi.c =================================================================== --- mplayerxp/libmpdemux/demux_avi.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_avi.c 2009-12-08 13:00:44 UTC (rev 33) @@ -5,7 +5,6 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" @@ -16,6 +15,7 @@ #include "aviheader.h" #include "../libmpcodecs/dec_audio.h" #include "aviprint.h" +#include "demux_msg.h" typedef struct { Modified: mplayerxp/libmpdemux/demux_film.c =================================================================== --- mplayerxp/libmpdemux/demux_film.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_film.c 2009-12-08 13:00:44 UTC (rev 33) @@ -17,13 +17,13 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "bswap.h" #include "stream.h" #include "demuxer.h" #include "stheader.h" +#include "demux_msg.h" // chunk types found in a FILM file #define CHUNK_FILM mmioFOURCC('F', 'I', 'L', 'M') Modified: mplayerxp/libmpdemux/demux_fli.c =================================================================== --- mplayerxp/libmpdemux/demux_fli.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_fli.c 2009-12-08 13:00:44 UTC (rev 33) @@ -11,12 +11,12 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" #include "demuxer.h" #include "stheader.h" +#include "demux_msg.h" typedef struct _fli_frames_t { int num_frames; Modified: mplayerxp/libmpdemux/demux_lavf.c =================================================================== --- mplayerxp/libmpdemux/demux_lavf.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_lavf.c 2009-12-08 13:00:44 UTC (rev 33) @@ -23,12 +23,12 @@ #include "stream.h" #include "demuxer.h" #include "stheader.h" -#include "demux_msg.h" #include "help_mp.h" #ifdef HAVE_LOCAL_FFMPEG #include "../../codecs/ffmpeg/libavformat/avformat.h" #include "../libmpcodecs/codecs_ld.h" +#include "demux_msg.h" #define PROBE_BUF_SIZE 2048 Modified: mplayerxp/libmpdemux/demux_mkv.c =================================================================== --- mplayerxp/libmpdemux/demux_mkv.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_mkv.c 2009-12-08 13:00:44 UTC (rev 33) @@ -18,7 +18,6 @@ #include "stheader.h" #include "matroska.h" -#include "demux_msg.h" #include "help_mp.h" #include <dlfcn.h> @@ -32,6 +31,7 @@ #ifdef USE_QTX_CODECS #include "../../loader/qtx/qtxsdk/components.h" #endif +#include "demux_msg.h" #ifdef HAVE_ZLIB #include <zlib.h> Modified: mplayerxp/libmpdemux/demux_mov.c =================================================================== --- mplayerxp/libmpdemux/demux_mov.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_mov.c 2009-12-08 13:00:44 UTC (rev 33) @@ -22,7 +22,6 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" @@ -35,6 +34,7 @@ #include "parse_mp4.h" // .MP4 specific stuff #include "../../loader/qtx/qtxsdk/components.h" +#include "demux_msg.h" #ifdef HAVE_ZLIB #include <zlib.h> Modified: mplayerxp/libmpdemux/demux_mpg.c =================================================================== --- mplayerxp/libmpdemux/demux_mpg.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_mpg.c 2009-12-08 13:00:44 UTC (rev 33) @@ -12,7 +12,6 @@ #include "bswap.h" #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" @@ -23,6 +22,7 @@ #include "dvdauth.h" #include "../libmpcodecs/dec_audio.h" +#include "demux_msg.h" //#define MAX_PS_PACKETSIZE 2048 #define MAX_PS_PACKETSIZE (224*1024) Modified: mplayerxp/libmpdemux/demux_mpxp64.c =================================================================== --- mplayerxp/libmpdemux/demux_mpxp64.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_mpxp64.c 2009-12-08 13:00:44 UTC (rev 33) @@ -10,7 +10,6 @@ #include <math.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" @@ -25,6 +24,7 @@ #include "../libmpcodecs/dec_audio.h" #include "aviprint.h" #include "mpxpav64.h" +#include "demux_msg.h" #define MAX_AV_STREAMS MAX_V_STREAMS+MAX_A_STREAMS+MAX_S_STREAMS Modified: mplayerxp/libmpdemux/demux_nsv.c =================================================================== --- mplayerxp/libmpdemux/demux_nsv.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_nsv.c 2009-12-08 13:00:44 UTC (rev 33) @@ -16,11 +16,11 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" #include "demuxer.h" #include "stheader.h" +#include "demux_msg.h" typedef struct { float v_pts; Modified: mplayerxp/libmpdemux/demux_nuv.c =================================================================== --- mplayerxp/libmpdemux/demux_nuv.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_nuv.c 2009-12-08 13:00:44 UTC (rev 33) @@ -15,12 +15,12 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" #include "demuxer.h" #include "stheader.h" #include "nuppelvideo.h" +#include "demux_msg.h" struct nuv_signature Modified: mplayerxp/libmpdemux/demux_ogg.c =================================================================== --- mplayerxp/libmpdemux/demux_ogg.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_ogg.c 2009-12-08 13:00:44 UTC (rev 33) @@ -9,7 +9,6 @@ #include "../mplayer.h" #include "bswap.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" #include "demuxer.h" @@ -21,6 +20,7 @@ #include "../libmpcodecs/codecs_ld.h" #include "../libmpcodecs/dec_audio.h" #include "../libvo/sub.h" +#include "demux_msg.h" #define BLOCK_SIZE 4096 #define FOURCC_VORBIS mmioFOURCC('v', 'r', 'b', 's') Modified: mplayerxp/libmpdemux/demux_pva.c =================================================================== --- mplayerxp/libmpdemux/demux_pva.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_pva.c 2009-12-08 13:00:44 UTC (rev 33) @@ -27,7 +27,6 @@ #include <string.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" @@ -35,6 +34,7 @@ #include "stheader.h" #include "bswap.h" +#include "demux_msg.h" /* * #defines below taken from PVA spec (see URL above) Modified: mplayerxp/libmpdemux/demux_ra.c =================================================================== --- mplayerxp/libmpdemux/demux_ra.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_ra.c 2009-12-08 13:00:44 UTC (rev 33) @@ -9,7 +9,6 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" @@ -17,6 +16,7 @@ #include "stheader.h" #include "bswap.h" #include "aviprint.h" +#include "demux_msg.h" #define FOURCC_DOTRA mmioFOURCC('.','r','a', 0xfd) #define FOURCC_144 mmioFOURCC('1','4','_','4') Modified: mplayerxp/libmpdemux/demux_rawvideo.c =================================================================== --- mplayerxp/libmpdemux/demux_rawvideo.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_rawvideo.c 2009-12-08 13:00:44 UTC (rev 33) @@ -5,7 +5,6 @@ #include <unistd.h> #include <string.h> -#include "demux_msg.h" #include "stream.h" #include "demuxer.h" @@ -13,6 +12,7 @@ #include "../cfgparser.h" #include "../libvo/img_format.h" +#include "demux_msg.h" int use_rawvideo = 0; static int format = IMGFMT_I420; Modified: mplayerxp/libmpdemux/demux_real.c =================================================================== --- mplayerxp/libmpdemux/demux_real.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_real.c 2009-12-08 13:00:44 UTC (rev 33) @@ -24,7 +24,6 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" @@ -33,6 +32,7 @@ #include "bswap.h" #include "aviprint.h" #include "../libmpcodecs/dec_audio.h" +#include "demux_msg.h" #define MKTAG(a, b, c, d) (a | (b << 8) | (c << 16) | (d << 24)) Modified: mplayerxp/libmpdemux/demux_roq.c =================================================================== --- mplayerxp/libmpdemux/demux_roq.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_roq.c 2009-12-08 13:00:44 UTC (rev 33) @@ -13,12 +13,12 @@ #include <unistd.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" #include "demuxer.h" #include "stheader.h" +#include "demux_msg.h" #define RoQ_INFO 0x1001 #define RoQ_QUAD_CODEBOOK 0x1002 Modified: mplayerxp/libmpdemux/demux_smjpeg.c =================================================================== --- mplayerxp/libmpdemux/demux_smjpeg.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_smjpeg.c 2009-12-08 13:00:44 UTC (rev 33) @@ -17,13 +17,13 @@ #include <string.h> /* strtok */ #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" #include "demuxer.h" #include "stheader.h" #include "bswap.h" +#include "demux_msg.h" static int smjpeg_probe(demuxer_t* demuxer){ int orig_pos = stream_tell(demuxer->stream); Modified: mplayerxp/libmpdemux/demux_ts.c =================================================================== --- mplayerxp/libmpdemux/demux_ts.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_ts.c 2009-12-08 13:00:44 UTC (rev 33) @@ -29,7 +29,6 @@ #include "../mp_config.h" #include "../mplayer.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" #include "demuxer.h" @@ -39,6 +38,7 @@ #include "bswap.h" #include "mpeg_hdr.h" +#include "demux_msg.h" #define TS_PH_PACKET_SIZE 192 #define TS_FEC_PACKET_SIZE 204 Modified: mplayerxp/libmpdemux/demux_ty.c =================================================================== --- mplayerxp/libmpdemux/demux_ty.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_ty.c 2009-12-08 13:00:44 UTC (rev 33) @@ -37,7 +37,6 @@ #include "../mp_config.h" #include "bswap.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" @@ -45,6 +44,7 @@ #include "parse_es.h" #include "stheader.h" #include "sub_cc.h" +#include "demux_msg.h" #define AV_RB24(x) ((((uint8_t*)(x))[0] << 16) | \ Modified: mplayerxp/libmpdemux/demux_viv.c =================================================================== --- mplayerxp/libmpdemux/demux_viv.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_viv.c 2009-12-08 13:00:44 UTC (rev 33) @@ -11,13 +11,13 @@ #include <string.h> /* strtok */ #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" #include "demuxer.h" #include "stheader.h" #include "bswap.h" +#include "demux_msg.h" /* parameters ! */ static int vivo_param_version = -1; Modified: mplayerxp/libmpdemux/demux_y4m.c =================================================================== --- mplayerxp/libmpdemux/demux_y4m.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demux_y4m.c 2009-12-08 13:00:44 UTC (rev 33) @@ -11,7 +11,6 @@ #include <string.h> /* strtok */ #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "yuv4mpeg.h" @@ -19,6 +18,7 @@ #include "demuxer.h" #include "stheader.h" #include "bswap.h" +#include "demux_msg.h" typedef struct { int framenum; Modified: mplayerxp/libmpdemux/demuxer.c =================================================================== --- mplayerxp/libmpdemux/demuxer.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/demuxer.c 2009-12-08 13:00:44 UTC (rev 33) @@ -11,7 +11,6 @@ #include "stream.h" #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "../mplayer.h" #include "../subreader.h" @@ -22,6 +21,7 @@ #include "stheader.h" #include "../libvo/fastmemcpy.h" +#include "demux_msg.h" extern demuxer_driver_t demux_aiff; extern demuxer_driver_t demux_rawaudio; Modified: mplayerxp/libmpdemux/librtsp/rtsp.c =================================================================== --- mplayerxp/libmpdemux/librtsp/rtsp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/librtsp/rtsp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -51,10 +51,10 @@ #include <sys/types.h> #include <inttypes.h> -#include "../demux_msg.h" #include "rtsp.h" #include "rtsp_session.h" #include "osdep/timer.h" +#include "../demux_msg.h" /* #define LOG Modified: mplayerxp/libmpdemux/librtsp/rtsp_rtp.c =================================================================== --- mplayerxp/libmpdemux/librtsp/rtsp_rtp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/librtsp/rtsp_rtp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -38,12 +38,12 @@ #include <ws2tcpip.h> #endif -#include "../demux_msg.h" #include "rtsp.h" #include "rtsp_rtp.h" #include "rtsp_session.h" #include "../freesdp/common.h" #include "../freesdp/parser.h" +#include "../demux_msg.h" #define RTSP_DEFAULT_PORT 31336 #define MAX_LENGTH 256 Modified: mplayerxp/libmpdemux/librtsp/rtsp_session.c =================================================================== --- mplayerxp/libmpdemux/librtsp/rtsp_session.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/librtsp/rtsp_session.c 2009-12-08 13:00:44 UTC (rev 33) @@ -44,7 +44,6 @@ #include <string.h> #include <inttypes.h> -#include "../demux_msg.h" #include "../url.h" #include "../rtp.h" #include "rtsp.h" @@ -54,6 +53,7 @@ #include "../realrtsp/rmff.h" #include "../realrtsp/asmrp.h" #include "../realrtsp/xbuffer.h" +#include "../demux_msg.h" /* #define LOG Modified: mplayerxp/libmpdemux/mux_lavf.c =================================================================== --- mplayerxp/libmpdemux/mux_lavf.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/mux_lavf.c 2009-12-08 13:00:44 UTC (rev 33) @@ -6,7 +6,6 @@ #include <inttypes.h> #include <limits.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "bswap.h" @@ -19,6 +18,7 @@ #ifdef HAVE_LOCAL_FFMPEG #include "../../codecs/ffmpeg/libavformat/avformat.h" #include "../libmpcodecs/codecs_ld.h" +#include "demux_msg.h" extern unsigned int codec_get_wav_tag(int id); extern enum CodecID codec_get_bmp_id(unsigned int tag); Modified: mplayerxp/libmpdemux/mux_mpxp64.c =================================================================== --- mplayerxp/libmpdemux/mux_mpxp64.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/mux_mpxp64.c 2009-12-08 13:00:44 UTC (rev 33) @@ -28,10 +28,9 @@ #include "muxer.h" #include "aviheader.h" +#include "mpxpav64.h" #include "demux_msg.h" -#include "mpxpav64.h" - typedef struct priv_mpxpav64_stream_s { /* statistics */ Modified: mplayerxp/libmpdemux/network.c =================================================================== --- mplayerxp/libmpdemux/network.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/network.c 2009-12-08 13:00:44 UTC (rev 33) @@ -41,8 +41,8 @@ #ifndef STREAMING_LIVE_DOT_COM #include "rtp.h" #endif +#include "../version.h" #include "demux_msg.h" -#include "../version.h" /* Variables for the command line option -user, -passwd & -bandwidth */ char *network_username=NULL; Modified: mplayerxp/libmpdemux/parse_mp4.c =================================================================== --- mplayerxp/libmpdemux/parse_mp4.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/parse_mp4.c 2009-12-08 13:00:44 UTC (rev 33) @@ -12,8 +12,8 @@ #endif #include <stdlib.h> #include "parse_mp4.h" +#include "stream.h" #include "demux_msg.h" -#include "stream.h" //#define MP4_DUMPATOM Modified: mplayerxp/libmpdemux/realrtsp/asmrp.c =================================================================== --- mplayerxp/libmpdemux/realrtsp/asmrp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/realrtsp/asmrp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -40,8 +40,8 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#include "asmrp.h" #include "../demux_msg.h" -#include "asmrp.h" /* #define LOG Modified: mplayerxp/libmpdemux/rtp.c =================================================================== --- mplayerxp/libmpdemux/rtp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/rtp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -28,8 +28,8 @@ /* MPEG-2 TS RTP stack */ #define DEBUG 1 +#include "rtp.h" #include "demux_msg.h" -#include "rtp.h" // RTP reorder routines // Also handling of repeated UDP packets (a bug of ExtremeNetworks switches firmware) Modified: mplayerxp/libmpdemux/s_dvdnav.c =================================================================== --- mplayerxp/libmpdemux/s_dvdnav.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/s_dvdnav.c 2009-12-08 13:00:44 UTC (rev 33) @@ -6,13 +6,13 @@ #include <string.h> #include <math.h> #include "stream.h" -#include "demux_msg.h" #include "help_mp.h" #include "demuxer.h" #include "../spudec.h" #include "../libvo/sub.h" #include "../input/input.h" #include "../mplayer.h" +#include "demux_msg.h" #ifdef USE_DVDNAV #include <dvdnav/dvdnav.h> Modified: mplayerxp/libmpdemux/s_dvdplay.c =================================================================== --- mplayerxp/libmpdemux/s_dvdplay.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/s_dvdplay.c 2009-12-08 13:00:44 UTC (rev 33) @@ -9,8 +9,8 @@ #include <stdlib.h> #include <string.h> #include "stream.h" +#include "help_mp.h" #include "demux_msg.h" -#include "help_mp.h" #ifdef USE_DVDPLAY typedef unsigned char byte_t; Modified: mplayerxp/libmpdemux/s_dvdread.c =================================================================== --- mplayerxp/libmpdemux/s_dvdread.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/s_dvdread.c 2009-12-08 13:00:44 UTC (rev 33) @@ -7,8 +7,8 @@ #include <string.h> #include <ctype.h> #include "stream.h" +#include "help_mp.h" #include "demux_msg.h" -#include "help_mp.h" #ifdef USE_DVDREAD Modified: mplayerxp/libmpdemux/s_ftp.c =================================================================== --- mplayerxp/libmpdemux/s_ftp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/s_ftp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -15,11 +15,11 @@ #include <winsock2.h> #endif -#include "demux_msg.h" #include "stream.h" #include "help_mp.h" #include "tcp.h" #include "url.h" +#include "demux_msg.h" struct stream_priv_s { Modified: mplayerxp/libmpdemux/s_network.c =================================================================== --- mplayerxp/libmpdemux/s_network.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/s_network.c 2009-12-08 13:00:44 UTC (rev 33) @@ -8,8 +8,8 @@ #include <unistd.h> #include "../mp_config.h" #include "stream.h" +#include "help_mp.h" #include "demux_msg.h" -#include "help_mp.h" #ifdef HAVE_STREAMING Modified: mplayerxp/libmpdemux/s_rtsp.c =================================================================== --- mplayerxp/libmpdemux/s_rtsp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/s_rtsp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -15,13 +15,13 @@ #include <winsock2.h> #endif -#include "demux_msg.h" #include "stream.h" #include "help_mp.h" #include "url.h" #include "tcp.h" #include "librtsp/rtsp.h" #include "librtsp/rtsp_session.h" +#include "demux_msg.h" #define RTSP_DEFAULT_PORT 554 Modified: mplayerxp/libmpdemux/s_udp.c =================================================================== --- mplayerxp/libmpdemux/s_udp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/s_udp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -15,11 +15,11 @@ #include <winsock2.h> #endif -#include "demux_msg.h" #include "stream.h" #include "help_mp.h" #include "udp.h" #include "url.h" +#include "demux_msg.h" static int __FASTCALL__ udp_read(stream_t *s,stream_packet_t*sp) { Modified: mplayerxp/libmpdemux/s_vcd.c =================================================================== --- mplayerxp/libmpdemux/s_vcd.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/s_vcd.c 2009-12-08 13:00:44 UTC (rev 33) @@ -6,7 +6,6 @@ #include <string.h> #include <stdio.h> #include "stream.h" -#include "demux_msg.h" #ifdef HAVE_VCD @@ -27,6 +26,7 @@ #endif #include "help_mp.h" #include "mrl.h" +#include "demux_msg.h" typedef struct vcd_priv_s { Modified: mplayerxp/libmpdemux/s_vcdnav.c =================================================================== --- mplayerxp/libmpdemux/s_vcdnav.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/s_vcdnav.c 2009-12-08 13:00:44 UTC (rev 33) @@ -11,8 +11,8 @@ #ifdef USE_LIBVCD #include <libvcd/info.h> #include <libvcd/logging.h> +#include "mrl.h" #include "help_mp.h" -#include "mrl.h" typedef struct { uint8_t subheader [CDIO_CD_SUBHEADER_SIZE]; Modified: mplayerxp/libmpdemux/stream.c =================================================================== --- mplayerxp/libmpdemux/stream.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/stream.c 2009-12-08 13:00:44 UTC (rev 33) @@ -12,11 +12,11 @@ #include "../mp_config.h" #include "../mplayer.h" -#include "demux_msg.h" #include "help_mp.h" #include "stream.h" #include "demuxer.h" +#include "demux_msg.h" #ifndef min #define min(a,b) ((a)<(b)?(a):(b)) Modified: mplayerxp/libmpdemux/sub_ty.c =================================================================== --- mplayerxp/libmpdemux/sub_ty.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/sub_ty.c 2009-12-08 13:00:44 UTC (rev 33) @@ -14,11 +14,11 @@ #include <string.h> #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "sub_cc.h" #include "../libvo/sub.h" +#include "demux_msg.h" extern int sub_justify; Modified: mplayerxp/libmpdemux/tcp.c =================================================================== --- mplayerxp/libmpdemux/tcp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/tcp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -17,7 +17,6 @@ #include "../mp_config.h" -#include "demux_msg.h" #include "help_mp.h" #include "../input/input.h" @@ -33,6 +32,7 @@ #endif #include "tcp.h" +#include "demux_msg.h" /* IPv6 options */ extern int network_prefer_ipv4; Modified: mplayerxp/libmpdemux/test.c =================================================================== --- mplayerxp/libmpdemux/test.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/test.c 2009-12-08 13:00:44 UTC (rev 33) @@ -4,11 +4,11 @@ #include <string.h> #include "../mp_config.h" -#include "demux_msg.h" #include "stream.h" #include "demuxer.h" #include "stheader.h" +#include "demux_msg.h" //-------------------------- Modified: mplayerxp/libmpdemux/tvi_v4l.c =================================================================== --- mplayerxp/libmpdemux/tvi_v4l.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/tvi_v4l.c 2009-12-08 13:00:44 UTC (rev 33) @@ -27,13 +27,13 @@ #include <stdlib.h> #include <string.h> -#include "demux_msg.h" #include "../libao2/afmt.h" #include "../libao2/audio_out.h" #include "../libvo/img_format.h" #include "../libvo/fastmemcpy.h" #include "tv.h" +#include "demux_msg.h" static tvi_info_t info = { "Video 4 Linux input", Modified: mplayerxp/libmpdemux/udp.c =================================================================== --- mplayerxp/libmpdemux/udp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/udp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -39,9 +39,9 @@ #include <ws2tcpip.h> #endif -#include "demux_msg.h" #include "url.h" #include "udp.h" +#include "demux_msg.h" int reuse_socket=0; Modified: mplayerxp/libmpdemux/url.c =================================================================== --- mplayerxp/libmpdemux/url.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/url.c 2009-12-08 13:00:44 UTC (rev 33) @@ -12,8 +12,8 @@ #include <inttypes.h> #include "url.h" +#include "help_mp.h" #include "demux_msg.h" -#include "help_mp.h" #ifndef SIZE_MAX #define SIZE_MAX ((size_t)-1) Modified: mplayerxp/libmpdemux/video.c =================================================================== --- mplayerxp/libmpdemux/video.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libmpdemux/video.c 2009-12-08 13:00:44 UTC (rev 33) @@ -9,7 +9,6 @@ #include <string.h> #include <unistd.h> -#include "demux_msg.h" #include "help_mp.h" #include "sub_cc.h" @@ -19,6 +18,7 @@ #include "parse_es.h" #include "mpeg_hdr.h" #include "../mplayer.h" +#include "demux_msg.h" /* biCompression constant */ #define BI_RGB 0L Modified: mplayerxp/libvo/font_load.c =================================================================== --- mplayerxp/libvo/font_load.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libvo/font_load.c 2009-12-08 13:00:44 UTC (rev 33) @@ -5,11 +5,11 @@ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> -#include "vo_msg.h" #include "../mp_config.h" #include "font_load.h" #include "sub.h" #include "../osdep/get_path.h" +#include "vo_msg.h" raw_file* load_raw(char *name,int verbose){ int bpp; Modified: mplayerxp/libvo/jpeg_enc.c =================================================================== --- mplayerxp/libvo/jpeg_enc.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libvo/jpeg_enc.c 2009-12-08 13:00:44 UTC (rev 33) @@ -31,7 +31,6 @@ #ifdef USE_FASTMEMCPY #include "fastmemcpy.h" #endif -#include "vo_msg.h" /* We need this #define because we need ../libavcodec/common.h to #define * be2me_32, otherwise the linker will complain that it doesn't exist */ #define HAVE_AV_CONFIG_H @@ -40,6 +39,7 @@ //#include "../libavcodec/mpegvideo.h" #include "jpeg_enc.h" +#include "vo_msg.h" /* zr_mjpeg_encode_mb needs access to these tables for the black & white * option */ Modified: mplayerxp/libvo/osd.c =================================================================== --- mplayerxp/libvo/osd.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libvo/osd.c 2009-12-08 13:00:44 UTC (rev 33) @@ -12,9 +12,9 @@ #include <inttypes.h> #include "../cpudetect.h" #include "../mangle.h" -#include "vo_msg.h" #include "../mplayer.h" #include "osd.h" +#include "vo_msg.h" #if defined(__MMX__) static const uint64_t bFF __attribute__((used)) __attribute__((aligned(8))) = 0xFFFFFFFFFFFFFFFFULL; Modified: mplayerxp/libvo/screenshot.c =================================================================== --- mplayerxp/libvo/screenshot.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libvo/screenshot.c 2009-12-08 13:00:44 UTC (rev 33) @@ -25,9 +25,9 @@ #include "screenshot.h" #include "img_format.h" -#include "vo_msg.h" #include "../postproc/swscale.h" #include "../postproc/vf_scale.h" +#include "vo_msg.h" #define RGB 0 #define BGR 1 Modified: mplayerxp/libvo/sub.c =================================================================== --- mplayerxp/libvo/sub.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libvo/sub.c 2009-12-08 13:00:44 UTC (rev 33) @@ -8,8 +8,6 @@ #endif #include "../mplayer.h" -#define MSGT_CLASS MSGT_OSD -#include "../__mp_msg.h" #include "video_out.h" #include "font_load.h" #include "sub.h" @@ -17,6 +15,8 @@ #include "../spudec.h" #include "../vobsub.h" #include "../libmpdemux/stream.h" +#define MSGT_CLASS MSGT_OSD +#include "../__mp_msg.h" #define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */ char * __sub_osd_names[]={ Modified: mplayerxp/libvo/vo_null.c =================================================================== --- mplayerxp/libvo/vo_null.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libvo/vo_null.c 2009-12-08 13:00:44 UTC (rev 33) @@ -34,10 +34,10 @@ #include "video_out.h" #include "video_out_internal.h" #include "dri_vo.h" -#include "vo_msg.h" #ifdef CONFIG_VIDIX #include <vidix/vidixlib.h> #endif +#include "vo_msg.h" LIBVO_EXTERN(null) Modified: mplayerxp/libvo/vo_xvidix.c =================================================================== --- mplayerxp/libvo/vo_xvidix.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libvo/vo_xvidix.c 2009-12-08 13:00:44 UTC (rev 33) @@ -30,10 +30,10 @@ #include "x11_common.h" #include "aspect.h" -#include "vo_msg.h" #include "vosub_vidix.h" #include <vidix/vidixlib.h> +#include "vo_msg.h" LIBVO_EXTERN(xvidix) Modified: mplayerxp/libvo/vosub_vidix.c =================================================================== --- mplayerxp/libvo/vosub_vidix.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libvo/vosub_vidix.c 2009-12-08 13:00:44 UTC (rev 33) @@ -30,13 +30,13 @@ #include "video_out.h" #include "vosub_vidix.h" -#include "vo_msg.h" #include "fastmemcpy.h" #include "osd.h" #include "sub.h" #include "video_out.h" #include "dri_vo.h" #include "../mp_image.h" +#include "vo_msg.h" #ifndef min #define min(a,b) ((a)<(b)?(a):(b)) Modified: mplayerxp/libvo/x11_common.c =================================================================== --- mplayerxp/libvo/x11_common.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/libvo/x11_common.c 2009-12-08 13:00:44 UTC (rev 33) @@ -11,7 +11,6 @@ #include <sys/mman.h> #include "video_out.h" -#include "vo_msg.h" #include "x11_common.h" #include <X11/Xmd.h> #include <X11/Xlib.h> @@ -33,6 +32,7 @@ #include "../input/input.h" #include "../input/mouse.h" +#include "vo_msg.h" /* * If SCAN_VISUALS is defined, vo_x11_init() scans all available TrueColor Modified: mplayerxp/m_option.c =================================================================== --- mplayerxp/m_option.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/m_option.c 2009-12-08 13:00:44 UTC (rev 33) @@ -15,9 +15,9 @@ #include "libmpdemux/stream.h" #include "cfgparser.h" #include "m_option.h" +#include "libmpdemux/url.h" #define MSGT_CLASS MSGT_CPLAYER #include "__mp_msg.h" -#include "libmpdemux/url.h" // Don't free for 'production' atm #ifndef MP_DEBUG Modified: mplayerxp/m_property.c =================================================================== --- mplayerxp/m_property.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/m_property.c 2009-12-08 13:00:44 UTC (rev 33) @@ -12,9 +12,9 @@ #include "m_option.h" #include "m_property.h" +#include "help_mp.h" #define MSGT_CLASS MSGT_CPLAYER #include "__mp_msg.h" -#include "help_mp.h" #define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5)) Modified: mplayerxp/mp_image.c =================================================================== --- mplayerxp/mp_image.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/mp_image.c 2009-12-08 13:00:44 UTC (rev 33) @@ -9,11 +9,11 @@ #include <malloc.h> #endif -#define MSGT_CLASS MSGT_CPLAYER -#include "__mp_msg.h" #include "libvo/img_format.h" #include "mp_image.h" #include "libvo/fastmemcpy.h" +#define MSGT_CLASS MSGT_CPLAYER +#include "__mp_msg.h" void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){ mpi->flags&=~(MP_IMGFLAG_PLANAR|MP_IMGFLAG_YUV|MP_IMGFLAG_SWAPPED); Modified: mplayerxp/mp_msg.c =================================================================== --- mplayerxp/mp_msg.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/mp_msg.c 2009-12-08 13:00:44 UTC (rev 33) @@ -6,8 +6,8 @@ #include <inttypes.h> #include <pthread.h> #include "mp_config.h" +#include "nls/nls.h" #include "mp_msg.h" -#include "nls/nls.h" #define _bg(x) ((x) >> 4) #define _fg(x) ((x) & 0x0f) Modified: mplayerxp/nls/recode.c =================================================================== --- mplayerxp/nls/recode.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/nls/recode.c 2009-12-08 13:00:44 UTC (rev 33) @@ -10,8 +10,8 @@ #include <iconv.h> #endif #endif +#include "./nls.h" #include "nls_msg.h" -#include "./nls.h" /* *We have to proceed with the POSIX methods of looking to `LANG'. Modified: mplayerxp/osdep/lrmi.c =================================================================== --- mplayerxp/osdep/lrmi.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/osdep/lrmi.c 2009-12-08 13:00:44 UTC (rev 33) @@ -25,9 +25,9 @@ #include <sys/mman.h> #include <unistd.h> #include <fcntl.h> -#include "osdep_msg.h" #include "lrmi.h" #include "../cpudetect.h" +#include "osdep_msg.h" #define REAL_MEM_BASE ((void *)0x10000) #define REAL_MEM_SIZE 0x10000 Modified: mplayerxp/osdep/shmem.c =================================================================== --- mplayerxp/osdep/shmem.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/osdep/shmem.c 2009-12-08 13:00:44 UTC (rev 33) @@ -20,8 +20,6 @@ #include <sys/socket.h> #include <fcntl.h> -#include "osdep_msg.h" - #ifdef AIX #include <sys/select.h> #endif @@ -32,6 +30,7 @@ #endif #include "../help_mp.h" +#include "osdep_msg.h" #if defined(MAP_ANONYMOUS) && !defined(MAP_ANON) #define MAP_ANON MAP_ANONYMOUS Modified: mplayerxp/osdep/vbelib.c =================================================================== --- mplayerxp/osdep/vbelib.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/osdep/vbelib.c 2009-12-08 13:00:44 UTC (rev 33) @@ -19,9 +19,9 @@ #include <ctype.h> #include <unistd.h> #include <fcntl.h> -#include "osdep_msg.h" #include "../mplayer.h" #include "../cpudetect.h" +#include "osdep_msg.h" static struct VesaProtModeInterface vbe_pm_info; Modified: mplayerxp/postproc/libmenu/menu.c =================================================================== --- mplayerxp/postproc/libmenu/menu.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/libmenu/menu.c 2009-12-08 13:00:44 UTC (rev 33) @@ -1,6 +1,5 @@ #include "../../mp_config.h" -#include "../pp_msg.h" #include "help_mp.h" #include <stdlib.h> @@ -22,6 +21,7 @@ #include "m_option.h" #include "m_struct.h" #include "menu.h" +#include "../pp_msg.h" extern menu_info_t menu_info_cmdlist; extern menu_info_t menu_info_pt; Modified: mplayerxp/postproc/libmenu/menu_cmdlist.c =================================================================== --- mplayerxp/postproc/libmenu/menu_cmdlist.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/libmenu/menu_cmdlist.c 2009-12-08 13:00:44 UTC (rev 33) @@ -1,6 +1,5 @@ #include "mp_config.h" -#include "../pp_msg.h" #include "help_mp.h" #include <stdlib.h> @@ -22,9 +21,8 @@ #include "input/input.h" #include "version.h" +#include "../pp_msg.h" - - struct list_entry_s { struct list_entry p; Modified: mplayerxp/postproc/libmenu/menu_console.c =================================================================== --- mplayerxp/postproc/libmenu/menu_console.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/libmenu/menu_console.c 2009-12-08 13:00:44 UTC (rev 33) @@ -1,6 +1,5 @@ #include "mp_config.h" -#include "../pp_msg.h" #include "help_mp.h" #include <stdlib.h> @@ -28,6 +27,7 @@ #include "osdep/keycodes.h" #include "input/input.h" #include "osdep/timer.h" +#include "../pp_msg.h" typedef struct history_st history_t; Modified: mplayerxp/postproc/libmenu/menu_filesel.c =================================================================== --- mplayerxp/postproc/libmenu/menu_filesel.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/libmenu/menu_filesel.c 2009-12-08 13:00:44 UTC (rev 33) @@ -13,7 +13,6 @@ #include "mp_config.h" -#include "../pp_msg.h" #include "help_mp.h" #include "libmpdemux/stream.h" @@ -28,6 +27,7 @@ #include "menu_list.h" #include "input/input.h" #include "osdep/keycodes.h" +#include "../pp_msg.h" #define MENU_KEEP_PATH "/tmp/mp_current_path" Modified: mplayerxp/postproc/libmenu/menu_param.c =================================================================== --- mplayerxp/postproc/libmenu/menu_param.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/libmenu/menu_param.c 2009-12-08 13:00:44 UTC (rev 33) @@ -10,7 +10,6 @@ #include <sys/stat.h> #include <ctype.h> -#include "../pp_msg.h" #include "help_mp.h" #include "libmpdemux/stream.h" @@ -28,6 +27,7 @@ #include "input/input.h" #include "osdep/keycodes.h" //#include "command.h" +#include "../pp_msg.h" struct list_entry_s { struct list_entry p; Modified: mplayerxp/postproc/libmenu/menu_pt.c =================================================================== --- mplayerxp/postproc/libmenu/menu_pt.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/libmenu/menu_pt.c 2009-12-08 13:00:44 UTC (rev 33) @@ -4,7 +4,6 @@ #include <string.h> #include "mp_config.h" -#include "../pp_msg.h" #include "help_mp.h" #include "libvo/img_format.h" @@ -18,6 +17,7 @@ #include "libmpdemux/stream.h" #include "playtree.h" #include "input/input.h" +#include "../pp_msg.h" #define mp_basename(s) (strrchr((s),'/')==NULL?(char*)(s):(strrchr((s),'/')+1)) Modified: mplayerxp/postproc/libmenu/menu_txt.c =================================================================== --- mplayerxp/postproc/libmenu/menu_txt.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/libmenu/menu_txt.c 2009-12-08 13:00:44 UTC (rev 33) @@ -1,6 +1,5 @@ #include "mp_config.h" -#include "../pp_msg.h" #include "help_mp.h" #include <stdlib.h> @@ -19,6 +18,7 @@ #include "libvo/font_load.h" #include "osdep/keycodes.h" +#include "../pp_msg.h" struct menu_priv_s { char** lines; Modified: mplayerxp/postproc/vf_1bpp.c =================================================================== --- mplayerxp/postproc/vf_1bpp.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/vf_1bpp.c 2009-12-08 13:00:44 UTC (rev 33) @@ -4,13 +4,13 @@ #include <inttypes.h> #include "../mp_config.h" -#include "pp_msg.h" #include "../libvo/img_format.h" #include "mp_image.h" #include "vf.h" #include "../postproc/swscale.h" +#include "pp_msg.h" //===========================================================================// Modified: mplayerxp/postproc/vf_2xsai.c =================================================================== --- mplayerxp/postproc/vf_2xsai.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/vf_2xsai.c 2009-12-08 13:00:44 UTC (rev 33) @@ -4,11 +4,11 @@ #include <inttypes.h> #include "mp_config.h" -#include "pp_msg.h" #include "../libvo/img_format.h" #include "../mp_image.h" #include "vf.h" +#include "pp_msg.h" //===========================================================================// Modified: mplayerxp/postproc/vf_aspect.c =================================================================== --- mplayerxp/postproc/vf_aspect.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/vf_aspect.c 2009-12-08 13:00:44 UTC (rev 33) @@ -4,11 +4,11 @@ #include <inttypes.h> #include "../mp_config.h" -#include "pp_msg.h" #include "../libvo/img_format.h" #include "mp_image.h" #include "vf.h" +#include "pp_msg.h" struct vf_priv_s { int w, h; Modified: mplayerxp/postproc/vf_delogo.c =================================================================== --- mplayerxp/postproc/vf_delogo.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/vf_delogo.c 2009-12-08 13:00:44 UTC (rev 33) @@ -25,7 +25,6 @@ #include <math.h> #include "../mp_config.h" -#include "pp_msg.h" #include "../cpudetect.h" #ifdef HAVE_MALLOC @@ -36,6 +35,7 @@ #include "mp_image.h" #include "vf.h" #include "../libvo/fastmemcpy.h" +#include "pp_msg.h" //===========================================================================// Modified: mplayerxp/postproc/vf_denoise3d.c =================================================================== --- mplayerxp/postproc/vf_denoise3d.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/vf_denoise3d.c 2009-12-08 13:00:44 UTC (rev 33) @@ -23,7 +23,6 @@ #include <math.h> #include "../mp_config.h" -#include "pp_msg.h" #ifdef HAVE_MALLOC #include <malloc.h> @@ -33,6 +32,7 @@ #include "mp_image.h" #include "vf.h" #include "../libvo/fastmemcpy.h" +#include "pp_msg.h" #define PARAM1_DEFAULT 4.0 #define PARAM2_DEFAULT 3.0 Modified: mplayerxp/postproc/vf_dint.c =================================================================== --- mplayerxp/postproc/vf_dint.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/vf_dint.c 2009-12-08 13:00:44 UTC (rev 33) @@ -4,12 +4,12 @@ #include <inttypes.h> #include "../mp_config.h" -#include "pp_msg.h" #include "../libvo/fastmemcpy.h" #include "mp_image.h" #include "../libvo/img_format.h" #include "vf.h" +#include "pp_msg.h" struct vf_priv_s { float sense; // first parameter Modified: mplayerxp/postproc/vf_down3dright.c =================================================================== --- mplayerxp/postproc/vf_down3dright.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/vf_down3dright.c 2009-12-08 13:00:44 UTC (rev 33) @@ -4,7 +4,6 @@ #include <inttypes.h> #include "../mp_config.h" -#include "pp_msg.h" #include "../cpudetect.h" #include "../libvo/img_format.h" @@ -13,6 +12,7 @@ #include "../libvo/fastmemcpy.h" #include "../postproc/swscale.h" +#include "pp_msg.h" struct vf_priv_s { int skipline; Modified: mplayerxp/postproc/vf_eq.c =================================================================== --- mplayerxp/postproc/vf_eq.c 2009-12-07 19:04:38 UTC (rev 32) +++ mplayerxp/postproc/vf_eq.c 2009-12-08 13:00:44 UTC (rev 33) @@ -16,7 +16,6 @@ #include <inttypes.h> #include "mp_config.h" -#include "pp_msg.h" #include "cpudetect.h" #include "../libvo/img_format.h" @@ -27,6 +26,7 @@ #ifdef USE_SETLOCALE #include <locale.h> #endif +#include "pp_msg.h" ... [truncated message content] |
From: <nic...@us...> - 2009-12-08 14:40:30
|
Revision: 34 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=34&view=rev Author: nickols_k Date: 2009-12-08 14:40:21 +0000 (Tue, 08 Dec 2009) Log Message: ----------- minor redesign stream drivers architecture and print list of available ones Modified Paths: -------------- mplayerxp/configure mplayerxp/libmpdemux/Makefile mplayerxp/libmpdemux/cache2.c mplayerxp/libmpdemux/cddb.c mplayerxp/libmpdemux/network.c mplayerxp/libmpdemux/s_cdd.c mplayerxp/libmpdemux/s_dvdnav.c mplayerxp/libmpdemux/s_dvdread.c mplayerxp/libmpdemux/s_file.c mplayerxp/libmpdemux/s_ftp.c mplayerxp/libmpdemux/s_network.c mplayerxp/libmpdemux/s_oss.c mplayerxp/libmpdemux/s_rtsp.c mplayerxp/libmpdemux/s_tv.c mplayerxp/libmpdemux/s_udp.c mplayerxp/libmpdemux/s_vcd.c mplayerxp/libmpdemux/s_vcdnav.c mplayerxp/libmpdemux/stream.c mplayerxp/libmpdemux/stream.h mplayerxp/mplayer.c Removed Paths: ------------- mplayerxp/libmpdemux/s_dvdplay.c Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/configure 2009-12-08 14:40:21 UTC (rev 34) @@ -80,7 +80,6 @@ --disable-libcss Disable libcss support [autodetect] --disable-libdvdread Disable libdvdread support [autodetect] --disable-libdvdnav Disable libdvdnav support [autodetect] - --disable-libdvdplay Disable libdvdplay support [autodetect] --disable-vcd Disable VCD support [autodetect] Video: --enable-dga build with DGA1 or DGA2 support [autodetect] @@ -362,7 +361,6 @@ libcss libdvdread libdvdnav - libdvdplay png sdl sdl_image @@ -383,7 +381,6 @@ enable $AUTOCONF_LIST _dvdnavdir=/usr -_dvdplaydir=/usr _language=en _linux_devfs=no _bad_options= @@ -441,8 +438,6 @@ --disable-libdvdread) libdvdread=no ;; --enable-libdvdnav) libdvdnav=yes ;; --disable-libdvdnav) libdvdnav=no ;; - --enable-libdvdplay) libdvdplay=yes ;; - --disable-libdvdplay) libdvdplay=no ;; --enable-xinerama) xinerama=yes ;; --disable-xinerama) xinerama=no ;; --enable-alsa) alsa=yes ;; @@ -955,11 +950,6 @@ print_config USE_ mp_config.h mp_config.mak dvdnav enabled libdvdnav && _inputmodules="dvdnav $_inputmodules" || _noinputmodules="dvdnav $_noinputmodules" -enabled libdvdplay && require2 libdvdplay dvdplay/dvdplay.h dvdplay_open -ldvdplay -dvdplay=$libdvdplay -print_config USE_ mp_config.h mp_config.mak dvdplay -enabled libdvdplay && _inputmodules="dvdplay $_inputmodules" || _noinputmodules="dvdplay $_noinputmodules" - enabled libvcd && require2 libvcd libvcd/info.h vcdinfo_open -lvcdinfo print_config USE_ mp_config.h mp_config.mak libvcd enabled libvcd && _inputmodules="libvcd $_inputmodules" || _noinputmodules="libvcd $_noinputmodules" @@ -968,10 +958,10 @@ print_config USE_ mp_config.h mp_config.mak fastmemcpy test linux -o bsdos -o freebsd -o sunos && enable vcd || disable vcd -print_config HAVE_ mp_config.h mp_config.mak tv +print_config HAVE_ mp_config.h mp_config.mak vcd enabled vcd && _inputmodules="vcd $_inputmodules" || _noinputmodules="vcd $_noinputmodules" -print_config USE_ mp_config.h mp_config.mak tv +enabled tv && print_config USE_ mp_config.h mp_config.mak tv enabled tv && _inputmodules="tv $_inputmodules" || _noinputmodules="tv $_noinputmodules" enabled tv_v4l && require2 tv_v4l "stdlib.h linux/videodev.h" video_devdata Modified: mplayerxp/libmpdemux/Makefile =================================================================== --- mplayerxp/libmpdemux/Makefile 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/Makefile 2009-12-08 14:40:21 UTC (rev 34) @@ -5,11 +5,27 @@ DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done -SRCS = s_cdd.c s_dvdplay.c s_dvdnav.c s_dvdread.c s_file.c s_tv.c url.c +SRCS = s_file.c +ifeq ($(HAVE_CDDA),yes) +SRCS += s_cdd.c +endif +ifeq ($(USE_DVDNAV),yes) +SRCS += s_dvdnav.c +endif +ifeq ($(USE_DVDREAD),yes) +SRCS += s_dvdread.c +endif +SRCS += s_tv.c url.c ifeq ($(USE_OSS_AUDIO),yes) SRCS += s_oss.c endif -SRCS += s_vcd.c s_vcdnav.c cache2.c dvdauth.c stream.c tvi_dummy.c tvi_v4l.c +ifeq ($(USE_LIBVCD),yes) +SRCS += s_vcdnav.c +endif +ifeq ($(HAVE_VCD),yes) +SRCS += s_vcd.c +endif +SRCS += cache2.c dvdauth.c stream.c tvi_dummy.c tvi_v4l.c SRCS += tvi_bsdbt848.c frequencies.c cdda.c cddb.c mrl.c SRCS += demuxer_r.c mp3_hdr.c video.c mpeg_hdr.c aviprint.c demux_asf.c Modified: mplayerxp/libmpdemux/cache2.c =================================================================== --- mplayerxp/libmpdemux/cache2.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/cache2.c 2009-12-08 14:40:21 UTC (rev 34) @@ -116,7 +116,7 @@ ,new_start,in_cache,START_FILEPOS(c),readpos,END_FILEPOS(c)); if(c->stream->eof || c->eof) nc_stream_reset(c->stream); c->stream->driver->seek(c->stream,new_start); - if(c->stream->_Errno) { MSG_WARN("c2_seek(drv:%s) error: %s\n",c->stream->driver->name,strerror(c->stream->_Errno)); c->stream->_Errno=0; } + if(c->stream->_Errno) { MSG_WARN("c2_seek(drv:%s) error: %s\n",c->stream->driver->mrl,strerror(c->stream->_Errno)); c->stream->_Errno=0; } if((c->packets[c->first].filepos=c->stream->driver->tell(c->stream))<0) seek_eof=1; c->last=c->first; if(c->packets[c->first].filepos < new_start-(off_t)c->stream->sector_size) @@ -172,7 +172,7 @@ c->eof=1; c->packets[cidx].state&=~CPF_EMPTY; c->packets[cidx].state&=~CPF_DONE; - if(c->stream->_Errno) { MSG_WARN("c2_fill_buffer(drv:%s) error: %s\n",c->stream->driver->name,strerror(c->stream->_Errno)); c->stream->_Errno=0; } + if(c->stream->_Errno) { MSG_WARN("c2_fill_buffer(drv:%s) error: %s\n",c->stream->driver->mrl,strerror(c->stream->_Errno)); c->stream->_Errno=0; } CACHE2_PACKET_TUNLOCK(cidx); break; } Modified: mplayerxp/libmpdemux/cddb.c =================================================================== --- mplayerxp/libmpdemux/cddb.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/cddb.c 2009-12-08 14:40:21 UTC (rev 34) @@ -488,7 +488,7 @@ } user_name = getenv("LOGNAME"); } - sprintf( cddb_data->cddb_hello, "&hello=%s+%s+%s+%s", user_name, host_name, "MPlayer", VERSION ); + sprintf( cddb_data->cddb_hello, "&hello=%s+%s+%s+%s", user_name, host_name, "MPlayerXP", VERSION ); } int __FASTCALL__ cddb_retrieve(cddb_data_t *cddb_data) { Modified: mplayerxp/libmpdemux/network.c =================================================================== --- mplayerxp/libmpdemux/network.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/network.c 2009-12-08 14:40:21 UTC (rev 34) @@ -816,7 +816,7 @@ fd = stream->fd; if( fd<0 ) { - fd = udp_open_socket( (streaming_ctrl->url) ); + fd = udp_open_socket( (streaming_ctrl->url) ); if( fd<0 ) return -1; stream->fd = fd; } @@ -827,7 +827,7 @@ streaming_ctrl->streaming_read = rtp_streaming_read; streaming_ctrl->streaming_read = rtp_streaming_read; streaming_ctrl->streaming_seek = nop_streaming_seek; - streaming_ctrl->prebuffer_size = 64*1024; // KBytes + streaming_ctrl->prebuffer_size = 64*1024; // KBytes streaming_ctrl->buffering = 0; streaming_ctrl->status = streaming_playing_e; return 0; Modified: mplayerxp/libmpdemux/s_cdd.c =================================================================== --- mplayerxp/libmpdemux/s_cdd.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_cdd.c 2009-12-08 14:40:21 UTC (rev 34) @@ -11,27 +11,44 @@ #include "mrl.h" static int track_idx=-1; -static int __FASTCALL__ cdd_open(stream_t *stream,const char *filename,unsigned flags) +static int __FASTCALL__ _cdda_open(stream_t *stream,const char *filename,unsigned flags) { const char *param; char *device; int retval; + UNUSED(flags); stream->type=STREAMTYPE_RAWAUDIO|STREAMTYPE_SEEKABLE; stream->sector_size=CD_FRAMESIZE_RAW; - if(!(strncmp(filename,"cdda://",7)==0 || strncmp(filename,"cddb://",7)==0)) return 0; - if(strcmp(&filename[7],"help") == 0) + if(strcmp(filename,"help") == 0) { - MSG_HINT("Usage: cdda://<@device><#trackno> or cddb://<@device><#trackno>\n"); + MSG_HINT("Usage: cdda://<@device><#trackno>\n"); return 0; } - param=mrl_parse_line(&filename[7],NULL,NULL,&device,NULL); - retval = - strncmp(filename,"cdda://",7)==0?open_cdda(stream,device ? device : DEFAULT_CDROM_DEVICE,param): - open_cddb(stream,device ? device : DEFAULT_CDROM_DEVICE,param); + param=mrl_parse_line(filename,NULL,NULL,&device,NULL); + retval = open_cdda(stream,device ? device : DEFAULT_CDROM_DEVICE,param); if(device) free(device); return retval; } +static int __FASTCALL__ _cddb_open(stream_t *stream,const char *filename,unsigned flags) +{ + const char *param; + char *device; + int retval; + UNUSED(flags); + stream->type=STREAMTYPE_RAWAUDIO|STREAMTYPE_SEEKABLE; + stream->sector_size=CD_FRAMESIZE_RAW; + if(strcmp(filename,"help") == 0) + { + MSG_HINT("Usage: cddb://<@device><#trackno>\n"); + return 0; + } + param=mrl_parse_line(filename,NULL,NULL,&device,NULL); + retval = open_cddb(stream,device ? device : DEFAULT_CDROM_DEVICE,param); + if(device) free(device); + return retval; +} + static int __FASTCALL__ cdd_read(stream_t*stream,stream_packet_t*sp) { sp->type=0; @@ -88,133 +105,28 @@ } return SCTRL_FALSE; } -#elif defined( HAVE_SDL ) -#include <SDL/SDL.h> -static SDL_CD* sdlcd; -static int __FASTCALL__ cdd_open(stream_t *stream,const char *filename,unsigned flags) -{ - int start_track = 0; - int end_track = 0; - const char *track; - char* end; - stream->type=STREAMTYPE_RAWAUDIO|STREAMTYPE_SEEKABLE; - stream->sector_size=2352; - if(!(strncmp(filename,"cdda://",7)==0 || strncmp(filename,"cddb://",7)==0)) return 0; - if(strcmp(&filename[7],"help") == 0) - { - MSG_HINT("Usage: cdda://<trackno> or cddb://<trackno>\n"); - return 0; - } - track=&filename[7]; - end = strchr(track,'-'); - if(!end) start_track = end_track = atoi(track); - else { - int st_len = end - track; - int ed_len = strlen(track) - 1 - st_len; - if(st_len) { - char st[st_len + 1]; - strncpy(st,track,st_len); - st[st_len] = '\0'; - start_track = atoi(st); - } - if(ed_len) { - char ed[ed_len + 1]; - strncpy(ed,end+1,ed_len); - ed[ed_len] = '\0'; - end_track = atoi(ed); - } - } - if (!SDL_WasInit(SDL_INIT_CDROM)) { - if (SDL_Init (SDL_INIT_CDROM)) { - MSG_ERR("SDL: Initializing of SDL failed: %s.\n", SDL_GetError()); - return -1; - } - } - /* TODO: selectable cd number */ - sdlcd = SDL_CDOpen(0); - if(CD_INDRIVE(SDL_CDStatus(sdlcd))) - SDL_CDPlayTracks(sdlcd,start_track,0,end_track-start_track,0); - return 1; -} - -static int __FASTCALL__ cdd_read(stream_t*stream,stream_packet_t*sp) +const stream_driver_t cdda_stream= { - return 0; -} + "cdda://", + "reads multimedia stream directly from Compact Disc Digital Audio system, or CD-DA", + _cdda_open, + cdd_read, + cdd_seek, + cdd_tell, + cdd_close, + cdd_ctrl +}; -static off_t __FASTCALL__ cdd_seek(stream_t*stream,off_t pos) +const stream_driver_t cddb_stream= { - return 0; -} - -static off_t __FASTCALL__ cdd_tell(stream_t*stream) -{ - return 0; -} -static void __FASTCALL__ cdd_close(stream_t*stream) -{ - SDL_CDStop(sdlcd); - SDL_CDClose(sdlcd); - if (SDL_WasInit(SDL_INIT_CDROM)); - SDL_QuitSubSystem(SDL_INIT_CDROM); -} - -static int __FASTCALL__ cdd_ctrl(stream_t *s,unsigned cmd,void *args) -{ - switch(cmd) - { - case SCTRL_AUD_GET_CHANNELS: - *(int *)args=2; - return SCTRL_OK; - case SCTRL_AUD_GET_SAMPLERATE: - *(int *)args = 44100; - return SCTRL_OK; - case SCTRL_AUD_GET_SAMPLESIZE: - *(int *)args=2; - return SCTRL_OK; - case SCTRL_AUD_GET_FORMAT: - *(int *)args=0x01; /* Raw PCM */ - return SCTRL_OK; - default: break; - } - return SCTRL_UNKNOWN; -} -#else -#include "demux_msg.h" -static int __FASTCALL__ cdd_open(stream_t *stream,const char *filename,unsigned flags) -{ - if(strncmp(filename,"cdda://",7)==0 || strncmp(filename,"cddb://",7)==0) - MSG_ERR("MplayerXP has been compiled without CDDA(B) support\n"); - return 0; -} - -static int __FASTCALL__ cdd_read(stream_t*stream,char *buf,unsigned size) -{ - return 0; -} - -static off_t __FASTCALL__ cdd_seek(stream_t*stream,off_t pos) -{ - return 0; -} - -static off_t __FASTCALL__ cdd_tell(stream_t*stream) -{ - return 0; -} -static void __FASTCALL__ cdd_close(stream_t*stream) {} - -static int __FASTCALL__ cdd_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } -#endif - -const stream_driver_t cdd_stream= -{ - "cdd", - cdd_open, + "cddb://", + "reads multimedia stream from Compact Disc Database or CD-DB", + _cddb_open, cdd_read, cdd_seek, cdd_tell, cdd_close, cdd_ctrl }; +#endif Modified: mplayerxp/libmpdemux/s_dvdnav.c =================================================================== --- mplayerxp/libmpdemux/s_dvdnav.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_dvdnav.c 2009-12-08 14:40:21 UTC (rev 34) @@ -2,6 +2,7 @@ s_dvdnav - DVDNAV's stream interface */ #include "../mp_config.h" +#ifdef USE_DVDNAV #include <stdlib.h> #include <string.h> #include <math.h> @@ -14,7 +15,6 @@ #include "../mplayer.h" #include "demux_msg.h" -#ifdef USE_DVDNAV #include <dvdnav/dvdnav.h> #include <stdio.h> #include <unistd.h> @@ -171,6 +171,8 @@ return NULL; } return dvdnav_priv->dvdnav->vm->state.pgc->palette; +#else + UNUSED(stream); #endif return 0; } @@ -191,10 +193,9 @@ const char *param; char *dvd_device; int ntitles; - - if(strncmp(filename,"dvdnav://",9)!=0) return 0; + UNUSED(flags); stream->type = STREAMTYPE_SEEKABLE|STREAMTYPE_PROGRAM; - param=mrl_parse_line(&filename[9],NULL,NULL,&dvd_device,NULL); + param=mrl_parse_line(filename,NULL,NULL,&dvd_device,NULL); if(strcmp(param,"help") == 0) { MSG_HINT("Usage: dvdnav://<title>,<chapter>\n"); @@ -467,7 +468,7 @@ for (btnum = 0; btnum < pnavpci->hli.hl_gi.btn_ns; btnum++) { btni_t *btni = &(pnavpci->hli.btnit[btnum]); - if (priv->hlev.buttonN == btnum + 1) { + if (priv->hlev.buttonN == (unsigned)btnum + 1) { priv->hlev.sx = min (btni->x_start, btni->x_end); priv->hlev.ex = max (btni->x_start, btni->x_end); priv->hlev.sy = min (btni->y_start, btni->y_end); @@ -649,35 +650,11 @@ } return SCTRL_FALSE; } -#else -static int __FASTCALL__ __dvdnav_open(stream_t *stream,const char *filename,unsigned flags) -{ - if(strncmp(filename,"dvdnav://",9)==0) - MSG_ERR("MPlayerXP has been compiled without DVDNAV support\n"); - return 0; -} -static int __FASTCALL__ __dvdnav_read(stream_t *stream,stream_packet_t * sp) -{ - return 0; -} -static off_t __FASTCALL__ __dvdnav_seek(stream_t *stream,off_t pos) -{ - return 0; -} -static off_t __FASTCALL__ __dvdnav_tell(stream_t *stream) -{ - return 0; -} -static void __FASTCALL__ __dvdnav_close(stream_t *stream) -{ -} -static int __FASTCALL__ __dvdnav_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } -#endif - const stream_driver_t dvdnav_stream= { - "dvdnav", + "dvdnav://", + "reads multimedia stream with using of libdvdnav library", __dvdnav_open, __dvdnav_read, __dvdnav_seek, @@ -685,3 +662,4 @@ __dvdnav_close, __dvdnav_ctrl }; +#endif Deleted: mplayerxp/libmpdemux/s_dvdplay.c =================================================================== --- mplayerxp/libmpdemux/s_dvdplay.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_dvdplay.c 2009-12-08 14:40:21 UTC (rev 34) @@ -1,144 +0,0 @@ -/* - s_dvdplay - DVDPlay's stream interface - can be found at: - http://developers.videolan.org/libdvdplay/ - Note: Please use it with '-nocache' option. - Requires PTS fixing :( -*/ -#include "../mp_config.h" -#include <stdlib.h> -#include <string.h> -#include "stream.h" -#include "help_mp.h" -#include "demux_msg.h" - -#ifdef USE_DVDPLAY -typedef unsigned char byte_t; -#include <dvdread/ifo_types.h> -#include <dvdplay/dvdplay.h> -#include <dvdplay/info.h> -#include <dvdplay/nav.h> -#include <dvdplay/state.h> -#define DVD_BLOCK_SIZE 2048 -#include "mrl.h" - -/* Logical block size for DVD-VIDEO */ -#define LB2OFF(x) ((off_t)(x) * (off_t)(DVD_BLOCK_SIZE)) -#define OFF2LB(x) ((x) >> 11) - -typedef struct dvdplay_priv_s -{ - dvdplay_ptr dvdplay; - off_t cur_pos; -}dvdplay_priv_t; - -static void my_callback(void *s,dvdplay_event_t event) -{ - stream_t *stream=s; - dvdplay_priv_t *priv = stream->priv; - MSG_DBG2("dvdplay: callback with event %i\n",event); -} - -static int __FASTCALL__ __dvdplay_open(stream_t *stream,const char *filename,unsigned flags) -{ - const char *param; - char *dvd_device; - - if(strncmp(filename,"dvdplay://",10)!=0) return 0; - stream->type = STREAMTYPE_SEEKABLE|STREAMTYPE_PROGRAM; - - if(!(stream->priv=malloc(sizeof(dvdplay_priv_t)))) - { - MSG_ERR(MSGTR_OutOfMemory); - return 0; - } - param=mrl_parse_line(&filename[10],NULL,NULL,&dvd_device,NULL); - if (!(((dvdplay_priv_t *)stream->priv)->dvdplay=dvdplay_open(dvd_device?dvd_device:DEFAULT_DVD_DEVICE,my_callback,stream))) { - MSG_ERR(MSGTR_CantOpenDVD,dvd_device); - if(!dvd_device) - { - if (!(((dvdplay_priv_t *)stream->priv)->dvdplay=dvdplay_open(DEFAULT_CDROM_DEVICE,my_callback,stream))) - MSG_ERR(MSGTR_CantOpenDVD,dvd_device); - else - goto dvd_ok; - } - free(stream->priv); - if(dvd_device) free(dvd_device); - return 0; - } - dvd_ok: - if(dvd_device) free(dvd_device); - /* libdvdplay can read blocks of any size (unlike libdvdnav) so - increasing block size in 10 times speedups cache */ - stream->sector_size=DVD_BLOCK_SIZE*10; - ((dvdplay_priv_t *)stream->priv)->cur_pos=0; - dvdplay_start(((dvdplay_priv_t *)stream->priv)->dvdplay,0); - return 1; -} - -static int __FASTCALL__ __dvdplay_read(stream_t *stream,stream_packet_t *sp) -{ - dvdplay_priv_t *priv = stream->priv; - sp->type=0; - sp->len = LB2OFF(dvdplay_read(priv->dvdplay,sp->buf,OFF2LB(sp->len))); - priv->cur_pos += sp->len; - return sp->len; -} - - -static off_t __FASTCALL__ __dvdplay_tell(stream_t *stream) -{ - dvdplay_priv_t *priv = stream->priv; -/* return LB2OFF(dvdplay_position(priv->dvdplay));*/ - return priv->cur_pos; -} - -static off_t __FASTCALL__ __dvdplay_seek(stream_t *stream,off_t pos) -{ - dvdplay_priv_t *priv = stream->priv; - dvdplay_seek(priv->dvdplay,OFF2LB(pos)); - priv->cur_pos=LB2OFF(dvdplay_position(priv->dvdplay)); - return priv->cur_pos; -} - -static void __FASTCALL__ __dvdplay_close(stream_t *stream) -{ - dvdplay_priv_t *priv = stream->priv; - dvdplay_close(priv->dvdplay); - free(stream->priv); -} -#else -static int __FASTCALL__ __dvdplay_open(stream_t *stream,const char *filename,unsigned flags) -{ - if(strncmp(filename,"dvdplay://",10)==0) - MSG_ERR("MplayerXP has been compiled without DVDPlay support\n"); - return 0; -} -static int __FASTCALL__ __dvdplay_read(stream_t *stream,stream_packet_t *sp) -{ - return 0; -} -static off_t __FASTCALL__ __dvdplay_seek(stream_t *stream,off_t pos) -{ - return 0; -} -static off_t __FASTCALL__ __dvdplay_tell(stream_t *stream) -{ - return 0; -} -static void __FASTCALL__ __dvdplay_close(stream_t *stream) -{ -} -#endif -static int __FASTCALL__ __dvdplay_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } - -const stream_driver_t dvdplay_stream= -{ - "dvdplay", - __dvdplay_open, - __dvdplay_read, - __dvdplay_seek, - __dvdplay_tell, - __dvdplay_close, - __dvdplay_ctrl -}; Modified: mplayerxp/libmpdemux/s_dvdread.c =================================================================== --- mplayerxp/libmpdemux/s_dvdread.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_dvdread.c 2009-12-08 14:40:21 UTC (rev 34) @@ -3,6 +3,7 @@ */ #include "../mp_config.h" +#ifdef USE_DVDREAD #include <stdlib.h> #include <string.h> #include <ctype.h> @@ -10,7 +11,6 @@ #include "help_mp.h" #include "demux_msg.h" -#ifdef USE_DVDREAD #include <dvdread/dvd_reader.h> #include <dvdread/ifo_types.h> @@ -610,13 +610,12 @@ ifo_handle_t *vmg_file; tt_srpt_t *tt_srpt; - if(strncmp(filename,"dvdread://",10)!=0) return 0; - if(strcmp(&filename[10],"help") == 0 || strlen(filename)==10) + if(strcmp(filename,"help") == 0 || strlen(filename)==10) { MSG_HINT("Usage: dvdread://<@device>#<titleno>-<lasttitle>,<chapter>-<lastchapter>,<angle>\n"); return 0; } - args=mrl_parse_line(&filename[10],NULL,NULL,&dvd_device,NULL); + args=mrl_parse_line(filename,NULL,NULL,&dvd_device,NULL); strncpy(param,args,sizeof(param)); comma=strchr(param,','); tilde=strchr(param,'-'); @@ -818,38 +817,11 @@ } return SCTRL_FALSE; } -#else -static int __FASTCALL__ __dvdread_open(stream_t *stream,const char *filename,unsigned flags) -{ - if(strncmp(filename,"dvdread://",10)==0) - MSG_ERR("MplayerXP has been compiled without DVDREAD support\n"); - return 0; -} -static int __FASTCALL__ __dvdread_read(stream_t *stream,stream_packet_t *sp) -{ - return 0; -} -static off_t __FASTCALL__ __dvdread_seek(stream_t *stream,off_t newpos) -{ - return 0; -} -static off_t __FASTCALL__ __dvdread_tell(stream_t *stream) -{ - return 0; -} -static void __FASTCALL__ __dvdread_close(stream_t *stream) {} -unsigned int * __FASTCALL__ dvdread_stream_get_palette(stream_t *stream) -{ - return 0; -} - -static int __FASTCALL__ __dvdread_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } -#endif - const stream_driver_t dvdread_stream = { - "dvdread", + "dvdread://", + "reads multimedia stream using low-level libdvdread access", __dvdread_open, __dvdread_read, __dvdread_seek, @@ -857,3 +829,5 @@ __dvdread_close, __dvdread_ctrl }; +#endif + Modified: mplayerxp/libmpdemux/s_file.c =================================================================== --- mplayerxp/libmpdemux/s_file.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_file.c 2009-12-08 14:40:21 UTC (rev 34) @@ -5,7 +5,9 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#ifndef __USE_GNU #define __USE_GNU +#endif #include <unistd.h> #include <fcntl.h> @@ -19,11 +21,11 @@ off_t spos; }file_priv_t; + static int __FASTCALL__ file_open(stream_t *stream,const char *filename,unsigned flags) { + UNUSED(flags); if(!(stream->priv = malloc(sizeof(file_priv_t)))) return 0; - if(strncmp(filename,"stdin://",8)==0) filename="-"; - if(strncmp(filename,"file://",7)==0) filename = &filename[7]; if(strcmp(filename,"-")==0) stream->fd=0; else stream->fd=open(filename,O_RDONLY); if(stream->fd<0) { free(stream->priv); return 0; } @@ -40,6 +42,11 @@ return 1; } +static int __FASTCALL__ stdin_open(stream_t *stream,const char *filename,unsigned flags) { + UNUSED(filename); + return file_open(stream,"-",flags); +} + #ifndef TEMP_FAILURE_RETRY #define TEMP_FAILURE_RETRY(x) (x) #endif @@ -85,11 +92,29 @@ free(stream->priv); } -static int __FASTCALL__ file_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } +static int __FASTCALL__ file_ctrl(stream_t *s,unsigned cmd,void *args) { + UNUSED(s); + UNUSED(cmd); + UNUSED(args); + return SCTRL_UNKNOWN; +} +const stream_driver_t stdin_stream = +{ + "stdin://", + "reads multimedia stream from standard input", + stdin_open, + file_read, + file_seek, + file_tell, + file_close, + file_ctrl +}; + const stream_driver_t file_stream = { - "file", + "file://", + "reads multimedia stream from regular file", file_open, file_read, file_seek, Modified: mplayerxp/libmpdemux/s_ftp.c =================================================================== --- mplayerxp/libmpdemux/s_ftp.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_ftp.c 2009-12-08 14:40:21 UTC (rev 34) @@ -355,11 +355,16 @@ { int len = 0,resp; struct stream_priv_s* p; - URL_t* url,*rurl; + URL_t* url; char str[256],rsp_txt[256]; + char *uname; - if(strncmp(filename,"ftp://",6)!=0) return 0; - if(!(url=url_new(filename))) goto bad_url; + UNUSED(flags); + if(!(uname=malloc(strlen(filename)+7))) return 0; + strcpy(uname,"ftp://"); + strcat(uname,filename); + if(!(url=url_new(uname))) goto bad_url; + free(uname); // url = check4proxies (rurl); if(!(url->hostname && url->file)) { bad_url: @@ -374,10 +379,10 @@ p->port=url->port?url->port:21; p->filename=url->file; MSG_V("FTP: Opening ~%s :%s @%s :%i %s\n",p->user,p->pass,p->host,p->port,p->filename); - + // Open the control connection p->handle = tcp_connect2Server(p->host,p->port,1); - + if(p->handle < 0) { url_free(url); free(stream->priv); @@ -414,7 +419,7 @@ return 0; } - + // Set the transfer type resp = FtpSendCmd("TYPE I",p,rsp_txt); if(resp != 2) { @@ -470,12 +475,18 @@ return 1; } -static int __FASTCALL__ ftp_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } +static int __FASTCALL__ ftp_ctrl(stream_t *s,unsigned cmd,void *args) { + UNUSED(s); + UNUSED(cmd); + UNUSED(args); + return SCTRL_UNKNOWN; +} /* "reuse a bit of code from ftplib written by Thomas Pfau", */ const stream_driver_t ftp_stream = { - "ftp", + "ftp://", + "reads multimedia stream from File Transfer Protocol (FTP)", ftp_open, ftp_read, ftp_seek, Modified: mplayerxp/libmpdemux/s_network.c =================================================================== --- mplayerxp/libmpdemux/s_network.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_network.c 2009-12-08 14:40:21 UTC (rev 34) @@ -1,17 +1,19 @@ /* s_network - network stream inetrface */ +#include "../mp_config.h" +#ifdef HAVE_STREAMING #include <errno.h> #include <stdlib.h> +#ifndef __USE_GNU #define __USE_GNU +#endif #include <unistd.h> -#include "../mp_config.h" #include "stream.h" #include "help_mp.h" #include "demux_msg.h" -#ifdef HAVE_STREAMING #include "url.h" #include "network.h" @@ -28,6 +30,7 @@ static int __FASTCALL__ network_open(stream_t *stream,const char *filename,unsigned flags) { URL_t* url; + UNUSED(flags); url = url_new(filename); if(url) { if(streaming_start(stream, &stream->file_format, url)<0){ @@ -88,30 +91,17 @@ if(stream->fd>0) close(stream->fd); } -#else -static int __FASTCALL__ network_open(stream_t *stream,const char *filename,unsigned flags) -{ - return 0; +static int __FASTCALL__ network_ctrl(stream_t *s,unsigned cmd,void *args) { + UNUSED(s); + UNUSED(cmd); + UNUSED(args); + return SCTRL_UNKNOWN; } -static int __FASTCALL__ network_read(stream_t *stream,stream_packet_t *sp) -{ - return 0; -} -static off_t __FASTCALL__ network_seek(stream_t *stream,off_t pos) -{ - return 0; -} -static off_t __FASTCALL__ network_tell(stream_t *stream) -{ - return 0; -} -static void __FASTCALL__ network_close(stream_t *stream) {} -#endif -static int __FASTCALL__ network_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } const stream_driver_t network_stream = { - "network", + "inet:", + "reads multimedia stream from any known network protocol. Example: inet:http://myserver.com", network_open, network_read, network_seek, @@ -119,3 +109,4 @@ network_close, network_ctrl }; +#endif Modified: mplayerxp/libmpdemux/s_oss.c =================================================================== --- mplayerxp/libmpdemux/s_oss.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_oss.c 2009-12-08 14:40:21 UTC (rev 34) @@ -41,15 +41,15 @@ oss_priv_t *oss_priv; unsigned tmp,param; int err; - if(strncmp(filename,"oss://",6)!=0) return 0; + UNUSED(flags); if(!(stream->priv = malloc(sizeof(oss_priv_t)))) return 0; oss_priv=stream->priv; - if(strcmp(&filename[6],"help") == 0) + if(strcmp(filename,"help") == 0) { MSG_HINT("Usage: oss://<@device>#<channels>,<samplerate>,<sampleformat>\n"); return 0; } - args=mrl_parse_line(&filename[6],NULL,NULL,&oss_device,NULL); + args=mrl_parse_line(filename,NULL,NULL,&oss_device,NULL); comma=strchr(args,','); if(comma) *comma=0; oss_priv->nchannels=args[0]?atoi(args):2; @@ -150,6 +150,7 @@ static off_t __FASTCALL__ oss_seek(stream_t*stream,off_t pos) { + UNUSED(pos); oss_priv_t *p=stream->priv; stream->_Errno=ENOSYS; return p->spos; @@ -180,7 +181,7 @@ rval = oss_priv->nchannels; if (rval > 2) { if ( ioctl(s->fd, SNDCTL_DSP_CHANNELS, &rval) == -1 || - rval != oss_priv->nchannels ) return SCTRL_FALSE; + (unsigned)rval != oss_priv->nchannels ) return SCTRL_FALSE; *(int *)args=rval; return SCTRL_OK; } @@ -276,7 +277,8 @@ const stream_driver_t oss_stream = { - "oss", + "oss://", + "reads multimedia stream from OSS audio capturing interface", oss_open, oss_read, oss_seek, Modified: mplayerxp/libmpdemux/s_rtsp.c =================================================================== --- mplayerxp/libmpdemux/s_rtsp.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_rtsp.c 2009-12-08 14:40:21 UTC (rev 34) @@ -32,16 +32,21 @@ static off_t __FASTCALL__ rtsp_seek(stream_t *s,off_t newpos) { + UNUSED(s); return newpos; } static off_t __FASTCALL__ rtsp_tell(stream_t *stream) { + UNUSED(stream); return 0; } static int __FASTCALL__ rtsp_ctrl(stream_t *s,unsigned cmd,void *args) { + UNUSED(s); + UNUSED(cmd); + UNUSED(args); return SCTRL_UNKNOWN; } @@ -132,9 +137,9 @@ static int __FASTCALL__ rtsp_open (stream_t *stream,const char *filename,unsigned flags) { URL_t *url; - + UNUSED(flags); if(strncmp(filename,"rtsp://",7)!=0) return 0; - + MSG_V("STREAM_RTSP, URL: %s\n", filename); stream->streaming_ctrl = streaming_ctrl_new (); if (!stream->streaming_ctrl) @@ -163,6 +168,7 @@ const stream_driver_t rtsp_stream = { "rtsp", + "reads multimedia stream from Real Time Streaming Protocol (RTSP)", rtsp_open, rtsp_stream_read, rtsp_seek, Modified: mplayerxp/libmpdemux/s_tv.c =================================================================== --- mplayerxp/libmpdemux/s_tv.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_tv.c 2009-12-08 14:40:21 UTC (rev 34) @@ -12,6 +12,7 @@ */ #include "../mp_config.h" +#ifdef USE_TV #include <stdlib.h> #include <string.h> #include "stream.h" @@ -51,7 +52,6 @@ {NULL, NULL, 0, 0, 0 } }; -#ifdef USE_TV #include "tv.h" #include "demux_msg.h" #include "help_mp.h" @@ -119,7 +119,7 @@ int i; tvi_functions_t *funcs = tvh->functions; int picture_format = 0; - + UNUSED(stream); if (funcs->control(tvh->priv, TVI_CONTROL_IS_VIDEO, 0) != TVI_CONTROL_TRUE) { MSG_ERR( "Error: no video input present!\n"); @@ -548,18 +548,20 @@ int __FASTCALL__ tv_step_norm(tvi_handle_t *tvh) { + UNUSED(tvh); return 0; } int __FASTCALL__ tv_step_chanlist(tvi_handle_t *tvh) { + UNUSED(tvh); return 0; } static int __FASTCALL__ _tv_open(stream_t*stream,const char *filename,unsigned flags) { - if(strncmp(filename,"tv://",4)!=0) return 0; - mrl_parse_params(&filename[5],tvopts_conf); + UNUSED(flags); + mrl_parse_params(filename,tvopts_conf); /* create tvi handler */ if(!(stream->priv = tv_begin())) goto tv_err; @@ -581,16 +583,20 @@ static int __FASTCALL__ _tv_read(stream_t *stream,stream_packet_t*sp) { + UNUSED(stream); + UNUSED(sp); return 0; } static off_t __FASTCALL__ _tv_seek(stream_t *stream,off_t pos) { + UNUSED(stream); return pos; } static off_t __FASTCALL__ _tv_tell(stream_t *stream) { + UNUSED(stream); return 0; } @@ -630,33 +636,11 @@ } return SCTRL_UNKNOWN; } -#else -static int __FASTCALL__ _tv_open(stream_t*stream,const char *filename,unsigned flags) -{ - if(strncmp(filename,"tv://",5)==0) - MSG_ERR("MplayerXP has been compiled without TV support\n"); - return 0; -} -static int __FASTCALL__ _tv_read(stream_t *stream,stream_packet_t*sp) -{ - sp->type=sp->len=0; - return sp->len; -} -static off_t __FASTCALL__ _tv_seek(stream_t *stream,off_t pos) -{ - return 0; -} -static off_t __FASTCALL__ _tv_tell(stream_t *stream) -{ - return 0; -} -static void __FASTCALL__ _tv_close(stream_t*stream) {} -static int __FASTCALL__ _tv_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } -#endif const stream_driver_t tv_stream= { - "tv", + "tv://", + "reads multimedia stream directly from TV tunner", _tv_open, _tv_read, _tv_seek, @@ -664,3 +648,5 @@ _tv_close, _tv_ctrl }; +#endif + Modified: mplayerxp/libmpdemux/s_udp.c =================================================================== --- mplayerxp/libmpdemux/s_udp.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_udp.c 2009-12-08 14:40:21 UTC (rev 34) @@ -28,16 +28,21 @@ static off_t __FASTCALL__ udp_seek(stream_t *s,off_t newpos) { + UNUSED(s); return newpos; } static off_t __FASTCALL__ udp_tell(stream_t *stream) { + UNUSED(stream); return 0; } static int __FASTCALL__ udp_ctrl(stream_t *s,unsigned cmd,void *args) { + UNUSED(s); + UNUSED(cmd); + UNUSED(args); return SCTRL_UNKNOWN; } @@ -57,7 +62,7 @@ streaming_ctrl = stream->streaming_ctrl; fd = stream->fd; - + if (fd < 0) { fd = udp_open_socket (streaming_ctrl->url); @@ -71,7 +76,7 @@ streaming_ctrl->prebuffer_size = 64 * 1024; /* 64 KBytes */ streaming_ctrl->buffering = 0; streaming_ctrl->status = streaming_playing_e; - + return 0; } @@ -79,8 +84,7 @@ static int __FASTCALL__ udp_open (stream_t *stream,const char *filename,unsigned flags) { URL_t *url; - - if(strncmp(filename,"udp://",6)!=0) return 0; + UNUSED(flags); MSG_V("STREAM_UDP, URL: %s\n", filename); stream->streaming_ctrl = streaming_ctrl_new (); if (!stream->streaming_ctrl) @@ -95,7 +99,7 @@ MSG_ERR("You must enter a port number for UDP streams!\n"); streaming_ctrl_free (stream->streaming_ctrl); stream->streaming_ctrl = NULL; - + return 0; } @@ -104,20 +108,21 @@ MSG_ERR("udp_streaming_start failed\n"); streaming_ctrl_free (stream->streaming_ctrl); stream->streaming_ctrl = NULL; - + return 0; } stream->type = STREAMTYPE_STREAM; fixup_network_stream_cache (stream); - + return 1; } /* "reuse a bit of code from ftplib written by Thomas Pfau", */ const stream_driver_t udp_stream = { - "udp", + "udp://", + "reads multimedia stream directly from User Datagram Protocol (UDP)", udp_open, udp_read, udp_seek, Modified: mplayerxp/libmpdemux/s_vcd.c =================================================================== --- mplayerxp/libmpdemux/s_vcd.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_vcd.c 2009-12-08 14:40:21 UTC (rev 34) @@ -2,12 +2,12 @@ s_vcd - VCD's stream interface */ #include "../mp_config.h" +#ifdef HAVE_VCD #include <stdlib.h> #include <string.h> #include <stdio.h> #include "stream.h" -#ifdef HAVE_VCD #ifdef __FreeBSD__ #include <sys/cdrio.h> @@ -18,9 +18,9 @@ #include <unistd.h> #include <fcntl.h> #ifdef __FreeBSD__ -#include "vcd_read_fbsd.h" +#include "vcd_read_fbsd.h" #elif defined(__NetBSD__) -#include "vcd_read_nbsd.h" +#include "vcd_read_nbsd.h" #else #include "vcd_read.h" #endif @@ -44,16 +44,14 @@ #ifdef __FreeBSD__ int bsize=VCD_SECTOR_SIZE; #endif - - + UNUSED(flags); /* originally was vcd:// but playtree parser replaced it */ - if(strncmp(filename,"vcd://",6)!=0) return 0; - if(strcmp(&filename[6],"help") == 0) + if(strcmp(filename,"help") == 0) { MSG_HINT("Usage: vcd://<@device><#trackno>\n"); return 0; } - param=mrl_parse_line(&filename[6],NULL,NULL,&device,NULL); + param=mrl_parse_line(filename,NULL,NULL,&device,NULL); vcd_track=atoi(param); if(!device) device=DEFAULT_CDROM_DEVICE; stream->fd=open(device,O_RDONLY); @@ -100,7 +98,7 @@ static off_t __FASTCALL__ _vcd_seek(stream_t *stream,off_t pos) { vcd_priv_t *p=stream->priv; - off_t newpos; + off_t newpos=pos; if(newpos<stream->start_pos) newpos=stream->start_pos; if(newpos>stream->end_pos) newpos=stream->end_pos; newpos=pos/VCD_SECTOR_DATA; @@ -122,32 +120,17 @@ free(stream->priv); close(stream->fd); } -#else -static int __FASTCALL__ _vcd_open(stream_t *stream,const char *filename,unsigned flags) -{ - if(strncmp(filename,"vcd://",6)==0) - MSG_ERR("MPlayerXP has been compiled without VCD support\n"); - return 0; +static int __FASTCALL__ _vcd_ctrl(stream_t *s,unsigned cmd,void *args) { + UNUSED(s); + UNUSED(cmd); + UNUSED(args); + return SCTRL_UNKNOWN; } -static int __FASTCALL__ _vcd_read(stream_t *stream,stream_packet_t *sp) -{ - return 0; -} -static off_t __FASTCALL__ _vcd_seek(stream_t *stream,off_t pos) -{ - return 0; -} -static off_t __FASTCALL__ _vcd_tell(stream_t *stream) -{ - return 0; -} -static void __FASTCALL__ _vcd_close(stream_t*stream) {} -#endif -static int __FASTCALL__ _vcd_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } const stream_driver_t vcd_stream= { - "vcd", + "vcd://", + "reads multimedia stream using low-level Video-CD access", _vcd_open, _vcd_read, _vcd_seek, @@ -155,3 +138,4 @@ _vcd_close, _vcd_ctrl }; +#endif Modified: mplayerxp/libmpdemux/s_vcdnav.c =================================================================== --- mplayerxp/libmpdemux/s_vcdnav.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/s_vcdnav.c 2009-12-08 14:40:21 UTC (rev 34) @@ -2,13 +2,13 @@ s_vcdnav - libVCD's stream interface (based on xine's input plugin) */ #include "../mp_config.h" +#ifdef USE_LIBVCD #include <stdlib.h> #include <string.h> #include <stdio.h> #include "stream.h" #include "demux_msg.h" -#ifdef USE_LIBVCD #include <libvcd/info.h> #include <libvcd/logging.h> #include "mrl.h" @@ -64,13 +64,13 @@ unsigned i; int vcd_track=-1; vcdinfo_open_return_t open_rc; - if(strncmp(filename,"vcdnav://",9)!=0) return 0; - if(strcmp(&filename[9],"help") == 0) + UNUSED(flags); + if(strcmp(filename,"help") == 0) { MSG_HINT("Usage: vcdnav://<@device><#trackno>\n"); return 0; } - param=mrl_parse_line(&filename[9],NULL,NULL,&device,NULL); + param=mrl_parse_line(filename,NULL,NULL,&device,NULL); if(param) vcd_track=atoi(param); priv=stream->priv=calloc(1,sizeof(vcd_priv_t)); // vcdinfo_init(priv->fd); @@ -232,7 +232,6 @@ static off_t __FASTCALL__ _vcdnav_seek(stream_t *stream,off_t pos) { vcd_priv_t *p=stream->priv; - off_t newpos; lsn_t oldlsn=p->lsn; CdIo *img = vcdinfo_get_cd_image(p->fd); p->lsn=pos/sizeof(vcdsector_t); @@ -262,32 +261,17 @@ if(priv->segment) free(priv->segment); free(stream->priv); } -#else -static int __FASTCALL__ _vcdnav_open(stream_t *stream,const char *filename,unsigned flags) -{ - if(strncmp(filename,"vcdnav://",9)==0) - MSG_ERR("MPlayerXP has been compiled without libVCD support\n"); - return 0; +static int __FASTCALL__ _vcdnav_ctrl(stream_t *s,unsigned cmd,void *args) { + UNUSED(s); + UNUSED(cmd); + UNUSED(args); + return SCTRL_UNKNOWN; } -static int __FASTCALL__ _vcdnav_read(stream_t *stream,stream_packet_t *sp) -{ - return 0; -} -static off_t __FASTCALL__ _vcdnav_seek(stream_t *stream,off_t pos) -{ - return 0; -} -static off_t __FASTCALL__ _vcdnav_tell(stream_t *stream) -{ - return 0; -} -static void __FASTCALL__ _vcdnav_close(stream_t*stream) {} -#endif -static int __FASTCALL__ _vcdnav_ctrl(stream_t *s,unsigned cmd,void *args) { return SCTRL_UNKNOWN; } const stream_driver_t vcdnav_stream= { - "vcdnav", + "vcdnav://", + "reads multimedia stream from libVCD's interface", _vcdnav_open, _vcdnav_read, _vcdnav_seek, @@ -295,3 +279,4 @@ _vcdnav_close, _vcdnav_ctrl }; +#endif Modified: mplayerxp/libmpdemux/stream.c =================================================================== --- mplayerxp/libmpdemux/stream.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/stream.c 2009-12-08 14:40:21 UTC (rev 34) @@ -22,29 +22,57 @@ #define min(a,b) ((a)<(b)?(a):(b)) #endif -extern const stream_driver_t cdd_stream; +#ifdef HAVE_CDDA +extern const stream_driver_t cdda_stream; +extern const stream_driver_t cddb_stream; +#endif +#ifdef USE_DVDNAV extern const stream_driver_t dvdnav_stream; -extern const stream_driver_t dvdplay_stream; +#endif +#ifdef USE_DVDREAD extern const stream_driver_t dvdread_stream; -extern const stream_driver_t file_stream; +#endif +#ifdef USE_TV +extern const stream_driver_t tv_stream; +#endif +#ifdef HAVE_STREAMING extern const stream_driver_t ftp_stream; extern const stream_driver_t network_stream; +#endif #ifdef USE_OSS_AUDIO extern const stream_driver_t oss_stream; #endif -extern const stream_driver_t tv_stream; +#ifdef HAVE_VCD extern const stream_driver_t vcd_stream; +#endif +#ifdef USE_LIBVCD extern const stream_driver_t vcdnav_stream; +#endif +extern const stream_driver_t stdin_stream; +extern const stream_driver_t file_stream; + static const stream_driver_t *sdrivers[] = { - &cdd_stream, +#ifdef HAVE_CDDA + &cdda_stream, + &cddb_stream, +#endif +#ifdef USE_DVDNAV &dvdnav_stream, - &dvdplay_stream, +#endif +#ifdef USE_DVDREAD &dvdread_stream, +#endif +#ifdef USE_TV + &tv_stream, +#endif +#ifdef HAVE_VCD &vcd_stream, +#endif +#ifdef USE_LIBVCD &vcdnav_stream, - &tv_stream, +#endif #ifdef USE_OSS_AUDIO &oss_stream, #endif @@ -52,6 +80,7 @@ &ftp_stream, &network_stream, #endif + &stdin_stream, &file_stream, }; @@ -59,28 +88,49 @@ stream_t* __FASTCALL__ open_stream(const char* filename,int* file_format,stream_callback event_handler) { - unsigned i; + unsigned i,done; + unsigned mrl_len; stream_t* stream=new_stream(STREAMTYPE_STREAM); /* No flags here */ stream->file_format=*file_format; + done=0; for(i=0;i<nsdrivers;i++) { - MSG_V("Probing %s ... ",sdrivers[i]->name); - if(sdrivers[i]->open(stream,filename,0)) - { - MSG_V("OK\n"); - *file_format = stream->file_format; - stream->driver=sdrivers[i]; - stream->event_handler=event_handler; - stream->buffer=realloc(stream->buffer,stream->sector_size); - return stream; + mrl_len=strlen(sdrivers[i]->mrl); + if(strncmp(filename,sdrivers[i]->mrl,mrl_len)==0) { + MSG_V("Opening %s ... ",sdrivers[i]->mrl); + if(sdrivers[i]->open(stream,&filename[mrl_len],0)) { + MSG_V("OK\n"); + *file_format = stream->file_format; + stream->driver=sdrivers[i]; + stream->event_handler=event_handler; + stream->buffer=realloc(stream->buffer,stream->sector_size); + return stream; + } + MSG_V("False\n"); } - MSG_V("False\n"); } + /* Last hope */ + if(file_stream.open(stream,filename,0)) { + *file_format = stream->file_format; + stream->driver=&file_stream; + stream->event_handler=event_handler; + stream->buffer=realloc(stream->buffer,stream->sector_size); + return stream; + } free(stream->buffer); free(stream); return NULL; } +void print_stream_drivers( void ) +{ + unsigned i; + MSG_INFO("Available stream drivers:\n"); + for(i=0;i<nsdrivers;i++) { + MSG_INFO(" %-10s %s\n",sdrivers[i]->mrl,sdrivers[i]->descr); + } +} + #define FILE_POS(s) (s->pos-s->buf_len) //=================== STREAMER ========================= @@ -111,8 +161,8 @@ MSG_DBG3("nc_stream_read_cbuffer: Guess EOF\n"); s->eof=1; s->buf_pos=s->buf_len=0; - if(s->_Errno) { MSG_WARN("nc_stream_read_cbuffer(drv:%s) error: %s\n",s->driver->name,strerror(s->_Errno)); s->_Errno=0; } - return 0; + if(s->_Errno) { MSG_WARN("nc_stream_read_cbuffer(drv:%s) error: %s\n",s->driver->mrl,strerror(s->_Errno)); s->_Errno=0; } + return 0; } break; } @@ -138,7 +188,7 @@ { if(!s->driver) { s->eof=1; return 0; } s->pos = s->driver->seek(s,newpos); - if(s->_Errno) { MSG_WARN("nc_stream_seek(drv:%s) error: %s\n",s->driver->name,strerror(s->_Errno)); s->_Errno=0; } + if(s->_Errno) { MSG_WARN("nc_stream_seek(drv:%s) error: %s\n",s->driver->mrl,strerror(s->_Errno)); s->_Errno=0; } } MSG_DBG3("nc_stream_seek_long after: %llu\n",s->pos); @@ -203,7 +253,7 @@ } void __FASTCALL__ free_stream(stream_t *s){ - MSG_INFO("\n*** free_stream(drv:%s) called [errno: %s]***\n",s->driver->name,s->_Errno); + MSG_INFO("\n*** free_stream(drv:%s) called [errno: %s]***\n",s->driver->mrl,s->_Errno); if(s->cache_data) stream_disable_cache(s); if(s->driver) s->driver->close(s); free(s->buffer); Modified: mplayerxp/libmpdemux/stream.h =================================================================== --- mplayerxp/libmpdemux/stream.h 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/libmpdemux/stream.h 2009-12-08 14:40:21 UTC (rev 34) @@ -159,8 +159,8 @@ /** Stream-driver interface */ typedef struct stream_driver_s { - const char *name; /**< short name of stream driver (often - MRL) */ - + const char *mrl; /**< MRL of stream driver */ + const char *descr; /**< description of the driver */ /** Opens stream with given name * @param _this points structure to be filled by driver * @param filename points MRL of stream (vcdnav://, file://, http://, ...) @@ -203,6 +203,8 @@ int (* __FASTCALL__ control)(stream_t *_this,unsigned cmd,void *param); }stream_driver_t; +void print_stream_drivers(void); + #define MAX_STREAM_PROTOCOLS 10 typedef struct stream_info_st { const char *info; Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2009-12-08 13:00:44 UTC (rev 33) +++ mplayerxp/mplayer.c 2009-12-08 14:40:21 UTC (rev 34) @@ -2091,6 +2091,7 @@ if(!filename){ // no file/vcd/dvd -> show HELP: MSG_INFO("%s",help_text); + print_stream_drivers(); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2009-12-08 18:18:31
|
Revision: 37 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=37&view=rev Author: nickols_k Date: 2009-12-08 18:18:23 +0000 (Tue, 08 Dec 2009) Log Message: ----------- make ffmpeg stuff mandatory required by mplayerxp Modified Paths: -------------- codecs/configure configure mplayerxp/configure mplayerxp/libmpcodecs/ad_ffmp3.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/postproc/af_ffenc.c mplayerxp/postproc/postprocess.h Removed Paths: ------------- mplayerxp/libmpcodecs/interface/ffmpeg/ Modified: codecs/configure =================================================================== --- codecs/configure 2009-12-08 16:17:44 UTC (rev 36) +++ codecs/configure 2009-12-08 18:18:23 UTC (rev 37) @@ -108,9 +108,6 @@ --enable-profile compile profiling information into mplayer [disable] --disable-fastcall disable regparm method on x86 systems [autodetect] -Expert options: - --disable-builtin-ffmpeg disable builtin support for ffmpeg codecs - Environment variables: MAKE Make command (example: "make -j") AS Assembler command @@ -146,7 +143,6 @@ mlib=yes gomp=yes _prefix="/usr/local" -_ffmpeg=yes _fastcall=auto _psuffix= _as=auto @@ -211,7 +207,6 @@ --disable-mlib) mlib=no ;; --enable-gomp) gomp=yes ;; --disable-gomp) gomp=no ;; - --disable-builtin-ffmpeg) _ffmpeg=no ;; --enable-fastcall) _fastcall=yes ;; --disable-fastcall) _fastcall=no ;; *) @@ -239,16 +234,8 @@ fi test -z "$_mlibdir" && _mlibdir="$MLIBHOME" -# Fix libavcodec -if test "$_ffmpeg" = yes ; then -cd ffmpeg -if ! test -f configure ; then -echo "**WARNING**: local copy of libavcodec doesn't exist! Please copy libavcodec" -echo "from ffmpeg distro into mplayerxp/codecs/libavcodec subfolder." -echo "Otherwise support of builtin ffmpeg's codecs will be disabled" -echo "Press any key" -read _answer -_ffmpeg=no +if ! test -f ffmpeg/configure ; then +die "*** local copy of ffmpeg was not found ***" fi _ffmpeg_args="--prefix=$_codecdir/ffmpeg --libdir=$_codecdir --shlibdir=$_codecdir --enable-shared --disable-static --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-pic --enable-postproc --enable-gpl --enable-pthreads" if test -n $_host ; then @@ -258,10 +245,11 @@ _ffmpeg_args="--arch=$_arch $_ffmpeg_args" fi echocheck "configuring ffmpeg stuff: --cc=\"$_cc\" $_ffmpeg_args" +cd ffmpeg $(LC_ALL=C ./configure --cc="$_cc" $_ffmpeg_args) cd .. echores "done" -fi + _subdirs="mp3lib liba52 libdca libmpeg2" if test "$_ffmpeg" = yes ; then _subdirs="$_subdirs ffmpeg" Modified: configure =================================================================== --- configure 2009-12-08 16:17:44 UTC (rev 36) +++ configure 2009-12-08 18:18:23 UTC (rev 37) @@ -9,7 +9,7 @@ fi done # for parm in ... -for _i in codecs loader mplayerxp etc DOCS; do +for _i in codecs loader etc DOCS mplayerxp ; do echo Entering \'"$_i"\' directory cd $_i ./configure "$@" Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2009-12-08 16:17:44 UTC (rev 36) +++ mplayerxp/configure 2009-12-08 18:18:23 UTC (rev 37) @@ -563,6 +563,14 @@ _pkg_config=pkg-config test $($_pkg_config --version 2>/dev/null) || die "no pkg-config found" +disable ffmpeg +# Checking for FFMPEG +test -f "../codecs/ffmpeg/libavcodec/avcodec.h" && enable ffmpeg +disabled ffmpeg && die "**FATAL**: local copy of libavcodec doesn't exist! Please use latest svn to checkout external repository in mplayerxp source tree." + +print_config HAVE_ mp_config.h mp_config.mak ffmpeg + + # Checking kernel version... if x86 && linux ; then _k_verc_problem=no @@ -1003,21 +1011,6 @@ print_config CONFIG_ mp_config.h mp_config.mak vidix enabled x11 && enabled vidix && _vomodules="xvidix $_vomodules" || _novomodules="xvidix $_novomodules" -_def_ffmpeg= -disable _ffmpeg -# Checking for FFMPEG -test -f "../codecs/ffmpeg/libavcodec/avcodec.h" && enable _ffmpeg -if enabled _ffmpeg ; then -_def_ffmpeg='#define HAVE_LOCAL_FFMPEG 1' -add_cflags "-I$_srcdir/../codecs/ffmpeg" -_codecmodules="$_codecmodules builtin-ffmpeg" -else -_nocodecmodules="$_nocodecmodules builtin-ffmpeg" -check_sheader _ffmpeg "ffmpeg/avcodec.h" -if enabled _ffmpeg ; then -_def_ffmpeg='#define HAVE_GLOBAL_FFMPEG 1' -fi -fi enabled joystick && test linux || disable joystick print_config HAVE_ mp_config.h mp_config.mak joystick @@ -1158,8 +1151,6 @@ #define USE_MMX_IDCT 1 #endif -$_def_ffmpeg - /* libvo options */ #define SCREEN_SIZE_X 1 #define SCREEN_SIZE_Y 1 Modified: mplayerxp/libmpcodecs/ad_ffmp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_ffmp3.c 2009-12-08 16:17:44 UTC (rev 36) +++ mplayerxp/libmpcodecs/ad_ffmp3.c 2009-12-08 18:18:23 UTC (rev 37) @@ -11,7 +11,7 @@ #include "help_mp.h" #include "bswap.h" -#include "interface/ffmpeg/avcodec.h" +#include "../../codecs/ffmpeg/libavcodec/avcodec.h" #include "codecs_ld.h" #ifndef FF_INPUT_BUFFER_PADDING_SIZE Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2009-12-08 16:17:44 UTC (rev 36) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2009-12-08 18:18:23 UTC (rev 37) @@ -59,7 +59,7 @@ LIBVD_EXTERN(ffmpeg) -#include "interface/ffmpeg/avcodec.h" +#include "../../codecs/ffmpeg/libavcodec/avcodec.h" #include "libvo/video_out.h" extern char *npp_options; Modified: mplayerxp/postproc/af_ffenc.c =================================================================== --- mplayerxp/postproc/af_ffenc.c 2009-12-08 16:17:44 UTC (rev 36) +++ mplayerxp/postproc/af_ffenc.c 2009-12-08 18:18:23 UTC (rev 37) @@ -3,7 +3,7 @@ #include <string.h> #include <dlfcn.h> #include "mp_config.h" -#include "../libmpcodecs/interface/ffmpeg/avcodec.h" +#include "../../codecs/ffmpeg/libavcodec/avcodec.h" #include "../libmpcodecs/codecs_ld.h" #include "../libvo/fastmemcpy.h" #include "af.h" Modified: mplayerxp/postproc/postprocess.h =================================================================== --- mplayerxp/postproc/postprocess.h 2009-12-08 16:17:44 UTC (rev 36) +++ mplayerxp/postproc/postprocess.h 2009-12-08 18:18:23 UTC (rev 37) @@ -1,99 +1,5 @@ #ifndef HAVE_PP_H #define HAVE_PP_H 1 -#ifdef HAVE_LOCAL_FFMPEG #include "../../codecs/ffmpeg/libpostproc/postprocess.h" -#else -/* - Copyright (C) 2001-2003 Michael Niedermayer (mic...@gm...) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef NEWPOSTPROCESS_H -#define NEWPOSTPROCESS_H - -/** - * @file postprocess.h - * @brief - * external api for the pp stuff - */ - -#ifdef __cplusplus -extern "C" { #endif - -#define PP_QUALITY_MAX 6 - -#define QP_STORE_T int8_t - -typedef void pp_context_t; -typedef void pp_mode_t; - -extern char *pp_help; ///< a simple help text - -void pp_postprocess(uint8_t * src[3], int srcStride[3], - uint8_t * dst[3], int dstStride[3], - int horizontalSize, int verticalSize, - QP_STORE_T *QP_store, int QP_stride, - pp_mode_t *mode, pp_context_t *ppContext, int pict_type); - - -/** - * returns a pp_mode_t or NULL if an error occured - * name is the string after "-pp" on the command line - * quality is a number from 0 to PP_QUALITY_MAX - */ -pp_mode_t *pp_get_mode_by_name_and_quality(char *name, int quality); -void pp_free_mode(pp_mode_t *mode); - -pp_context_t *pp_get_context(int width, int height, int flags); -void pp_free_context(pp_context_t *ppContext); - -#define PP_CPU_CAPS_MMX 0x80000000 -#define PP_CPU_CAPS_MMX2 0x20000000 -#define PP_CPU_CAPS_3DNOW 0x40000000 -#define PP_CPU_CAPS_ALTIVEC 0x10000000 - -#define PP_FORMAT 0x00000008 -#define PP_FORMAT_420 (0x00000011|PP_FORMAT) -#define PP_FORMAT_422 (0x00000001|PP_FORMAT) -#define PP_FORMAT_411 (0x00000002|PP_FORMAT) -#define PP_FORMAT_444 (0x00000000|PP_FORMAT) - -#define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale - -#ifdef __cplusplus -} -#endif - -#endif - -#endif - -/* Our stuff */ -extern pp_context_t *pp2_get_context(int width, int height, int flags); -extern void pp2_free_context(pp_context_t *ppContext); -extern void pp2_postprocess(uint8_t * src[3], int srcStride[3], - uint8_t * dst[3], int dstStride[3], - int horizontalSize, int verticalSize, - QP_STORE_T *QP_store, int QP_stride, - pp_mode_t *mode, pp_context_t *ppContext, int pict_type); -extern pp_mode_t *pp2_get_mode_by_quality(int quality); -extern pp_mode_t *pp2_get_mode_by_name_and_quality(char *opts,int quality); -extern void pp2_free_mode(pp_mode_t *mode); -extern int pp2_init(void); -extern void pp2_uninit(void); -#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2009-12-09 15:56:59
|
Revision: 40 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=40&view=rev Author: nickols_k Date: 2009-12-09 15:56:45 +0000 (Wed, 09 Dec 2009) Log Message: ----------- minor fixes and cleanups Modified Paths: -------------- codecs/Makefile codecs/configure mplayerxp/configure mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/ad_ffmp3.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpdemux/Makefile mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/freesdp/Makefile mplayerxp/libmpdemux/librtsp/Makefile mplayerxp/libmpdemux/mux_lavf.c mplayerxp/libmpdemux/realrtsp/Makefile mplayerxp/libmpdemux/s_ffmpeg.c mplayerxp/libvo/Makefile mplayerxp/osdep/Makefile mplayerxp/postproc/Makefile mplayerxp/postproc/libmenu/Makefile mplayerxp/postproc/postprocess.h mplayerxp/postproc/swscale.h Modified: codecs/Makefile =================================================================== --- codecs/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ codecs/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -28,7 +28,7 @@ subdirs: $(SUBDIRS) $(SUBDIRS): - export SUBDIR=liba52 libdca libmpeg2 mp3lib + export SUBDIR=ffmpeg liba52 libdca libmpeg2 mp3lib $(MAKE) -C $@ $(LIB_NUPPELVIDEO): $(OBJ_NUPPELVIDEO) Modified: codecs/configure =================================================================== --- codecs/configure 2009-12-08 19:06:08 UTC (rev 39) +++ codecs/configure 2009-12-09 15:56:45 UTC (rev 40) @@ -199,9 +199,11 @@ ;; --enable-debug) _debug='-g' + _debug_level=1 ;; --enable-debug=*) _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2` + _debug_level=`echo $_echo_n echo $ac_option | cut -d '=' -f 2` ;; --enable-mlib) mlib=yes ;; --disable-mlib) mlib=no ;; @@ -244,16 +246,14 @@ x86_64 && _arch="x86_64" _ffmpeg_args="--arch=$_arch $_ffmpeg_args" fi +test -n $_debug_level && _ffmpeg_args="$_ffmpeg_args --enable-debug=$_debug_level" echocheck "configuring ffmpeg stuff: --cc=\"$_cc\" $_ffmpeg_args" cd ffmpeg $(LC_ALL=C ./configure --cc="$_cc" $_ffmpeg_args) cd .. echores "done" -_subdirs="mp3lib liba52 libdca libmpeg2" -if test "$_ffmpeg" = yes ; then -_subdirs="$_subdirs ffmpeg" -fi +_subdirs="ffmpeg mp3lib liba52 libdca libmpeg2" cc_version=`$_cc -dumpversion` if test "$_fastcall" = auto ; then Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/configure 2009-12-09 15:56:45 UTC (rev 40) @@ -563,14 +563,6 @@ _pkg_config=pkg-config test $($_pkg_config --version 2>/dev/null) || die "no pkg-config found" -disable ffmpeg -# Checking for FFMPEG -test -f "../codecs/ffmpeg/libavcodec/avcodec.h" && enable ffmpeg -disabled ffmpeg && die "**FATAL**: local copy of libavcodec doesn't exist! Please use latest svn to checkout external repository in mplayerxp source tree." - -print_config HAVE_ mp_config.h mp_config.mak ffmpeg - - # Checking kernel version... if x86 && linux ; then _k_verc_problem=no @@ -652,6 +644,13 @@ # MAIN TESTS GO HERE # ###################### +disable ffmpeg +# Checking for FFMPEG +test -f "../codecs/ffmpeg/libavcodec/avcodec.h" && enable ffmpeg +disabled ffmpeg && die "**FATAL**: local copy of libavcodec doesn't exist! Please use latest svn to checkout external repository in mplayerxp source tree." +add_cflags "-I$_srcdir/../codecs/ffmpeg" +print_config HAVE_ mp_config.h mp_config.mak ffmpeg + check_header inttypes.h || die "cannot find header inttypes.h (see in DOC/faq.html)" require2 libdl dlfcn.h dlsym -ldl || die "dynamic loader was not found" Modified: mplayerxp/libmpcodecs/Makefile =================================================================== --- mplayerxp/libmpcodecs/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpcodecs/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -9,7 +9,7 @@ OBJS=$(SRCS:.c=.o) -CFLAGS = $(OPTFLAGS) -I. -I.. -I../libmpdemux -I../../codecs -I../../codecs/libavutil -I../loader -Wall +CFLAGS = $(OPTFLAGS) -I. -I.. -I../libmpdemux -I../loader -Wall .SUFFIXES: .c .o Modified: mplayerxp/libmpcodecs/ad_ffmp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_ffmp3.c 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpcodecs/ad_ffmp3.c 2009-12-09 15:56:45 UTC (rev 40) @@ -11,7 +11,7 @@ #include "help_mp.h" #include "bswap.h" -#include "../../codecs/ffmpeg/libavcodec/avcodec.h" +#include "libavcodec/avcodec.h" #include "codecs_ld.h" #ifndef FF_INPUT_BUFFER_PADDING_SIZE Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2009-12-09 15:56:45 UTC (rev 40) @@ -59,7 +59,7 @@ LIBVD_EXTERN(ffmpeg) -#include "../../codecs/ffmpeg/libavcodec/avcodec.h" +#include "libavcodec/avcodec.h" #include "libvo/video_out.h" extern char *npp_options; Modified: mplayerxp/libmpdemux/Makefile =================================================================== --- mplayerxp/libmpdemux/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpdemux/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -45,7 +45,7 @@ endif OBJS = $(SRCS:.c=.o) -INCLUDE = -I../loader -I../../codecs/ -I../../codecs/libavcodec -I../../codecs/libavutil +INCLUDE = -I../loader CFLAGS = $(OPTFLAGS) $(INCLUDE) -W -Wall .SUFFIXES: .c .o Modified: mplayerxp/libmpdemux/demux_lavf.c =================================================================== --- mplayerxp/libmpdemux/demux_lavf.c 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpdemux/demux_lavf.c 2009-12-09 15:56:45 UTC (rev 40) @@ -25,7 +25,7 @@ #include "stheader.h" #include "help_mp.h" -#include "../../codecs/ffmpeg/libavformat/avformat.h" +#include "libavformat/avformat.h" #include "../libmpcodecs/codecs_ld.h" #include "demux_msg.h" Modified: mplayerxp/libmpdemux/freesdp/Makefile =================================================================== --- mplayerxp/libmpdemux/freesdp/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpdemux/freesdp/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -8,7 +8,6 @@ OBJS=$(SRCS:.c=.o) CFLAGS = $(OPTFLAGS) -I. -I../.. $(EXTRA_INC) -Wall -# -I/usr/X11R6/include/ .SUFFIXES: .c .o Modified: mplayerxp/libmpdemux/librtsp/Makefile =================================================================== --- mplayerxp/libmpdemux/librtsp/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpdemux/librtsp/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -8,7 +8,6 @@ OBJS=$(SRCS:.c=.o) CFLAGS = $(OPTFLAGS) -I. -I../.. $(EXTRA_INC) -Wall -# -I/usr/X11R6/include/ .SUFFIXES: .c .o Modified: mplayerxp/libmpdemux/mux_lavf.c =================================================================== --- mplayerxp/libmpdemux/mux_lavf.c 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpdemux/mux_lavf.c 2009-12-09 15:56:45 UTC (rev 40) @@ -15,7 +15,7 @@ #include "stream.h" #include "demuxer.h" #include "stheader.h" -#include "../../codecs/ffmpeg/libavformat/avformat.h" +#include "libavformat/avformat.h" #include "../libmpcodecs/codecs_ld.h" #include "demux_msg.h" Modified: mplayerxp/libmpdemux/realrtsp/Makefile =================================================================== --- mplayerxp/libmpdemux/realrtsp/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpdemux/realrtsp/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -11,7 +11,6 @@ OBJS=$(SRCS:.c=.o) CFLAGS = $(OPTFLAGS) -I. -I../.. $(EXTRA_INC) -Wall -# -I/usr/X11R6/include/ .SUFFIXES: .c .o Modified: mplayerxp/libmpdemux/s_ffmpeg.c =================================================================== --- mplayerxp/libmpdemux/s_ffmpeg.c 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libmpdemux/s_ffmpeg.c 2009-12-09 15:56:45 UTC (rev 40) @@ -1,7 +1,9 @@ -#include "config.h" +#include "../mp_config.h" -#include "../../codecs/ffmpeg/libavformat/avformat.h" -#include "../../codecs/ffmpeg/libavformat/avio.h" +#include <dlfcn.h> +#include "libavformat/avformat.h" +#include "libavformat/avio.h" +#include "../libmpcodecs/codecs_ld.h" #include "stream.h" #include "demux_msg.h" @@ -104,6 +106,7 @@ if (size >= 0) stream->end_pos = size; stream->type = STREAMTYPE_SEEKABLE; + stream->priv = p; if (ctx->is_streamed) stream->type = STREAMTYPE_STREAM; return 1; } Modified: mplayerxp/libvo/Makefile =================================================================== --- mplayerxp/libvo/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/libvo/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -29,13 +29,12 @@ SRCS += vosub_vidix.c endif -CFLAGS = $(OPTFLAGS) -I. -I.. -I../../codecs/libavutil -DMPG12PLAY -Wall -W +CFLAGS = $(OPTFLAGS) -I. -I.. -DMPG12PLAY -Wall -W ifeq ($(CONFIG_VIDIX),yes) CFLAGS += -DVIDIX_PATH='"$(LIBDIR)/vidix/"' endif OBJS=$(SRCS:.c=.o) -# -I/usr/X11R6/include/ .SUFFIXES: .c .o Modified: mplayerxp/osdep/Makefile =================================================================== --- mplayerxp/osdep/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/osdep/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -17,7 +17,6 @@ CFLAGS = $(OPTFLAGS) -I. -I.. -Wall -# -I/usr/X11R6/include/ .SUFFIXES: .c .o Modified: mplayerxp/postproc/Makefile =================================================================== --- mplayerxp/postproc/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/postproc/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -11,8 +11,7 @@ SRCS+=dsp.c SRCS+=vf.c vf_vo.c vf_expand.c vf_format.c vf_yuy2.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_eq.c vf_dint.c vf_1bpp.c vf_unsharp.c vf_swapuv.c vf_il.c vf_smartblur.c vf_perspective.c vf_down3dright.c vf_denoise3d.c vf_aspect.c vf_softpulldown.c vf_delogo.c vf_yuvcsp.c vf_pp.c vf_scale.c vf_panscan.c vf_raw.c vf_ow.c vf_2xsai.c vf_framestep.c vf_menu.c OBJS=$(SRCS:.c=.o) -CFLAGS = $(OPTFLAGS) -I. -I.. -I../../codecs -I../../codecs/libavutil -Wall -# -I/usr/X11R6/include/ +CFLAGS = $(OPTFLAGS) -I. -I.. -Wall .SUFFIXES: .c .o Modified: mplayerxp/postproc/libmenu/Makefile =================================================================== --- mplayerxp/postproc/libmenu/Makefile 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/postproc/libmenu/Makefile 2009-12-09 15:56:45 UTC (rev 40) @@ -13,7 +13,6 @@ OBJS=$(SRCS:.c=.o) CFLAGS = $(OPTFLAGS) -I. -I../.. $(EXTRA_INC) -Wall -# -I/usr/X11R6/include/ .SUFFIXES: .c .o Modified: mplayerxp/postproc/postprocess.h =================================================================== --- mplayerxp/postproc/postprocess.h 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/postproc/postprocess.h 2009-12-09 15:56:45 UTC (rev 40) @@ -1,5 +1,5 @@ #ifndef HAVE_PP_H #define HAVE_PP_H 1 -#include "../../codecs/ffmpeg/libpostproc/postprocess.h" +#include "libpostproc/postprocess.h" #endif Modified: mplayerxp/postproc/swscale.h =================================================================== --- mplayerxp/postproc/swscale.h 2009-12-08 19:06:08 UTC (rev 39) +++ mplayerxp/postproc/swscale.h 2009-12-09 15:56:45 UTC (rev 40) @@ -22,7 +22,7 @@ #ifndef SWSCALE_H #define SWSCALE_H -#include "../../codecs/ffmpeg/libswscale/rgb2rgb.h" +#include "libswscale/rgb2rgb.h" #define MODE_RGB 0x1 #define MODE_BGR 0x2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2009-12-09 16:26:14
|
Revision: 41 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=41&view=rev Author: nickols_k Date: 2009-12-09 16:26:03 +0000 (Wed, 09 Dec 2009) Log Message: ----------- treat implicit function declarations as error Modified Paths: -------------- codecs/configure codecs/nuppelvideo.c loader/configure mplayerxp/configure mplayerxp/mplayer.c mplayerxp/postproc/postprocess.h mplayerxp/postproc/swscale.h Modified: codecs/configure =================================================================== --- codecs/configure 2009-12-09 15:56:45 UTC (rev 40) +++ codecs/configure 2009-12-09 16:26:03 UTC (rev 41) @@ -255,6 +255,7 @@ _subdirs="ffmpeg mp3lib liba52 libdca libmpeg2" + cc_version=`$_cc -dumpversion` if test "$_fastcall" = auto ; then echocheck "__fastcall optimization abilities" @@ -308,6 +309,8 @@ enabled gomp && check_cflags -fopenmp || disable gomp #enabled gomp && check_cflags -ftree-parallelize-loops=4 +add_cflags "-Werror-implicit-function-declaration" + check_func2 malloc.h malloc print_config HAVE_ config.h config.mak malloc Modified: codecs/nuppelvideo.c =================================================================== --- codecs/nuppelvideo.c 2009-12-09 15:56:45 UTC (rev 40) +++ codecs/nuppelvideo.c 2009-12-09 16:26:03 UTC (rev 41) @@ -8,6 +8,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <unistd.h> #include "config.h" Modified: loader/configure =================================================================== --- loader/configure 2009-12-09 15:56:45 UTC (rev 40) +++ loader/configure 2009-12-09 16:26:03 UTC (rev 41) @@ -209,10 +209,15 @@ CFLAGS="-O2" fi +require2 vsscanf "stdio.h stdarg.h" vsscanf +print_config HAVE_ config.h config.mak vsscanf + check_func2 "sys/types.h sys/mman.h" mmap mman_h=$mmap print_config HAVE_SYS_ config.h config.mak mman_h +add_cflags "-Werror-implicit-function-declaration" + ############################################################################# echo "Creating config.mak" cat >> config.mak << EOF Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2009-12-09 15:56:45 UTC (rev 40) +++ mplayerxp/configure 2009-12-09 16:26:03 UTC (rev 41) @@ -644,6 +644,8 @@ # MAIN TESTS GO HERE # ###################### +add_cflags "-Werror-implicit-function-declaration" + disable ffmpeg # Checking for FFMPEG test -f "../codecs/ffmpeg/libavcodec/avcodec.h" && enable ffmpeg Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2009-12-09 15:56:45 UTC (rev 40) +++ mplayerxp/mplayer.c 2009-12-09 16:26:03 UTC (rev 41) @@ -25,6 +25,7 @@ #include "mp_config.h" #include "sig_hand.h" #include "mplayer.h" +#include "postproc/swscale.h" #define HELP_MP_DEFINE_STATIC #include "help_mp.h" Modified: mplayerxp/postproc/postprocess.h =================================================================== --- mplayerxp/postproc/postprocess.h 2009-12-09 15:56:45 UTC (rev 40) +++ mplayerxp/postproc/postprocess.h 2009-12-09 16:26:03 UTC (rev 41) @@ -2,4 +2,16 @@ #define HAVE_PP_H 1 #include "libpostproc/postprocess.h" +extern int pp2_init(void); +extern void pp2_uninit(void); + +extern pp_context_t *pp2_get_context(int width, int height, int flags); +extern void pp2_free_context(pp_context_t *ppContext); +extern void pp2_free_mode(pp_mode_t *mode); +extern void pp2_postprocess(uint8_t * src[3], int srcStride[3], + uint8_t * dst[3], int dstStride[3], + int horizontalSize, int verticalSize, + QP_STORE_T *QP_store, int QP_stride, + pp_mode_t *mode, pp_context_t *ppContext, int pict_type); +extern pp_mode_t *pp2_get_mode_by_name_and_quality(char *opts,int quality); #endif Modified: mplayerxp/postproc/swscale.h =================================================================== --- mplayerxp/postproc/swscale.h 2009-12-09 15:56:45 UTC (rev 40) +++ mplayerxp/postproc/swscale.h 2009-12-09 16:26:03 UTC (rev 41) @@ -156,4 +156,9 @@ extern int sws_init(void); extern void sws_uninit(void); +extern void palette8tobgr32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); +extern void palette8tobgr24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); +extern void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); +extern void palette8torgb24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2009-12-15 18:08:57
|
Revision: 42 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=42&view=rev Author: nickols_k Date: 2009-12-15 18:08:49 +0000 (Tue, 15 Dec 2009) Log Message: ----------- import opengl from mphq Modified Paths: -------------- mplayerxp/configure mplayerxp/libvo/Makefile mplayerxp/libvo/img_format.h mplayerxp/libvo/video_out.c mplayerxp/libvo/video_out_internal.h mplayerxp/libvo/vo_xv.c Added Paths: ----------- mplayerxp/libvo/gl_common.c mplayerxp/libvo/gl_common.h mplayerxp/libvo/vo_opengl.c Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2009-12-09 16:26:03 UTC (rev 41) +++ mplayerxp/configure 2009-12-15 18:08:49 UTC (rev 42) @@ -91,6 +91,7 @@ --enable-xinerama build with Xinerama support for X11 [autodetect] --enable-xf86vm build with Xf86vm support for X11 [autodetect] --enable-xv build with Xv render support for X 4.x [autodetect] + --enable-opengl build with OpenGL render support [autodetect] --enable-fbdev build with FBDev render support [autodetect] --enable-fbdev=nocopy yuv12 converts directly into framebuffer --enable-mlib build with MLIB support (Solaris only) [autodetect] @@ -372,6 +373,7 @@ xv xinerama xf86vm + opengl dga vesa vidix @@ -411,6 +413,8 @@ --disable-xdpms) xdpms=no ;; --enable-xv) xv=yes ;; --disable-xv) xv=no ;; + --enable-opengl) opengl=yes ;; + --disable-opengl) opengl=no ;; --enable-sdl) sdl=yes ;; --disable-sdl) sdl=no ;; --enable-sdl-image) sdl_image=yes ;; @@ -836,6 +840,14 @@ enabled xinerama && require2 xinerama "X11/Xlib.h X11/extensions/Xinerama.h" XineramaIsActive -lXinerama print_config HAVE_ mp_config.h mp_config.mak xv +if win32 ; then +enabled opengl && require2 opengl "windows.h GL/gl.h" wglCreateContext -lopengl32 -lgdi32 +else +enabled opengl && require2 opengl "GL/gl.h GL/glx.h GL/glut.h" glutInitWindowSize -lglut -lGL +fi +print_config HAVE_ mp_config.h mp_config.mak opengl +enabled opengl && _vomodules="opengl $_vomodules" || _novomodules="opengl $_novomodules" + # Note: the -lXxf86vm library is the VideoMode extension and though it's not # needed for DGA, AFAIK every distribution packages together with DGA stuffs # named 'X extensions' or something similar. Modified: mplayerxp/libvo/Makefile =================================================================== --- mplayerxp/libvo/Makefile 2009-12-09 16:26:03 UTC (rev 41) +++ mplayerxp/libvo/Makefile 2009-12-15 18:08:49 UTC (rev 42) @@ -7,6 +7,9 @@ ifeq ($(HAVE_SDL),yes) SRCS+=vo_sdl.c endif +ifeq ($(HAVE_OPENGL),yes) +SRCS+=gl_common.c vo_opengl.c +endif ifeq ($(HAVE_X11),yes) SRCS+=vo_x11.c x11_common.c ifeq ($(CONFIG_VIDIX),yes) Added: mplayerxp/libvo/gl_common.c =================================================================== --- mplayerxp/libvo/gl_common.c (rev 0) +++ mplayerxp/libvo/gl_common.c 2009-12-15 18:08:49 UTC (rev 42) @@ -0,0 +1,1696 @@ +/* + * common OpenGL routines + * + * copyleft (C) 2005 Reimar Döffinger <Rei...@st...> + * Special thanks go to the xine team and Matthias Hopf, whose video_out_opengl.c + * gave me lots of good ideas. + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file gl_common.c + * \brief OpenGL helper functions used by vo_gl.c and vo_gl2.c + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <math.h> +#include "gl_common.h" +#include "img_format.h" +#include "vo_msg.h" +#include "libavutil/common.h" + +/** + * \defgroup glextfunctions OpenGL extension functions + * + * the pointers to these functions are acquired when the OpenGL + * context is created + * \{ + */ +void (APIENTRY *GenBuffers)(GLsizei, GLuint *); +void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *); +void (APIENTRY *BindBuffer)(GLenum, GLuint); +GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); +GLboolean (APIENTRY *UnmapBuffer)(GLenum); +void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum); +void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *); +void (APIENTRY *CombinerParameteri)(GLenum, GLint); +void (APIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum, + GLenum); +void (APIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum, + GLenum, GLenum, GLboolean, GLboolean, + GLboolean); +void (APIENTRY *BeginFragmentShader)(void); +void (APIENTRY *EndFragmentShader)(void); +void (APIENTRY *SampleMap)(GLuint, GLuint, GLenum); +void (APIENTRY *ColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint, + GLuint, GLuint, GLuint, GLuint, GLuint); +void (APIENTRY *ColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint, + GLuint, GLuint, GLuint, GLuint, GLuint, + GLuint, GLuint, GLuint); +void (APIENTRY *SetFragmentShaderConstant)(GLuint, const GLfloat *); +void (APIENTRY *ActiveTexture)(GLenum); +void (APIENTRY *BindTexture)(GLenum, GLuint); +void (APIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat); +void (APIENTRY *GenPrograms)(GLsizei, GLuint *); +void (APIENTRY *DeletePrograms)(GLsizei, const GLuint *); +void (APIENTRY *BindProgram)(GLenum, GLuint); +void (APIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *); +void (APIENTRY *GetProgramiv)(GLenum, GLenum, GLint *); +void (APIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat, + GLfloat, GLfloat); +int (APIENTRY *SwapInterval)(int); +void (APIENTRY *TexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, + GLint, GLenum, GLenum, const GLvoid *); +void* (APIENTRY *AllocateMemoryMESA)(void *, int, size_t, float, float, float); +void (APIENTRY *FreeMemoryMESA)(void *, int, void *); +/** \} */ // end of glextfunctions group + +//! \defgroup glgeneral OpenGL general helper functions + +//! \defgroup glcontext OpenGL context management helper functions + +//! \defgroup gltexture OpenGL texture handling helper functions + +//! \defgroup glconversion OpenGL conversion helper functions + +static GLint hqtexfmt; + +/** + * \brief adjusts the GL_UNPACK_ALIGNMENT to fit the stride. + * \param stride number of bytes per line for which alignment should fit. + * \ingroup glgeneral + */ +void glAdjustAlignment(int stride) { + GLint gl_alignment; + if (stride % 8 == 0) + gl_alignment=8; + else if (stride % 4 == 0) + gl_alignment=4; + else if (stride % 2 == 0) + gl_alignment=2; + else + gl_alignment=1; + glPixelStorei (GL_UNPACK_ALIGNMENT, gl_alignment); +} + +struct gl_name_map_struct { + GLint value; + const char *name; +}; + +#undef MAP +#define MAP(a) {a, #a} +//! mapping table for the glValName function +static const struct gl_name_map_struct gl_name_map[] = { + // internal format + MAP(GL_R3_G3_B2), MAP(GL_RGB4), MAP(GL_RGB5), MAP(GL_RGB8), + MAP(GL_RGB10), MAP(GL_RGB12), MAP(GL_RGB16), MAP(GL_RGBA2), + MAP(GL_RGBA4), MAP(GL_RGB5_A1), MAP(GL_RGBA8), MAP(GL_RGB10_A2), + MAP(GL_RGBA12), MAP(GL_RGBA16), MAP(GL_LUMINANCE8), + + // format + MAP(GL_RGB), MAP(GL_RGBA), MAP(GL_RED), MAP(GL_GREEN), MAP(GL_BLUE), + MAP(GL_ALPHA), MAP(GL_LUMINANCE), MAP(GL_LUMINANCE_ALPHA), + MAP(GL_COLOR_INDEX), + // rest 1.2 only + MAP(GL_BGR), MAP(GL_BGRA), + + //type + MAP(GL_BYTE), MAP(GL_UNSIGNED_BYTE), MAP(GL_SHORT), MAP(GL_UNSIGNED_SHORT), + MAP(GL_INT), MAP(GL_UNSIGNED_INT), MAP(GL_FLOAT), MAP(GL_DOUBLE), + MAP(GL_2_BYTES), MAP(GL_3_BYTES), MAP(GL_4_BYTES), + // rest 1.2 only + MAP(GL_UNSIGNED_BYTE_3_3_2), MAP(GL_UNSIGNED_BYTE_2_3_3_REV), + MAP(GL_UNSIGNED_SHORT_5_6_5), MAP(GL_UNSIGNED_SHORT_5_6_5_REV), + MAP(GL_UNSIGNED_SHORT_4_4_4_4), MAP(GL_UNSIGNED_SHORT_4_4_4_4_REV), + MAP(GL_UNSIGNED_SHORT_5_5_5_1), MAP(GL_UNSIGNED_SHORT_1_5_5_5_REV), + MAP(GL_UNSIGNED_INT_8_8_8_8), MAP(GL_UNSIGNED_INT_8_8_8_8_REV), + MAP(GL_UNSIGNED_INT_10_10_10_2), MAP(GL_UNSIGNED_INT_2_10_10_10_REV), + {0, 0} +}; +#undef MAP + +/** + * \brief return the name of an OpenGL constant + * \param value the constant + * \return name of the constant or "Unknown format!" + * \ingroup glgeneral + */ +const char *glValName(GLint value) +{ + int i = 0; + + while (gl_name_map[i].name) { + if (gl_name_map[i].value == value) + return gl_name_map[i].name; + i++; + } + return "Unknown format!"; +} + +//! always return this format as internal texture format in glFindFormat +#define TEXTUREFORMAT_ALWAYS GL_RGB8 +#undef TEXTUREFORMAT_ALWAYS + +/** + * \brief find the OpenGL settings coresponding to format. + * + * All parameters may be NULL. + * \param fmt MPlayer format to analyze. + * \param bpp [OUT] bits per pixel of that format. + * \param gl_texfmt [OUT] internal texture format that fits the + * image format, not necessarily the best for performance. + * \param gl_format [OUT] OpenGL format for this image format. + * \param gl_type [OUT] OpenGL type for this image format. + * \return 1 if format is supported by OpenGL, 0 if not. + * \ingroup gltexture + */ +int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt, + GLenum *gl_format, GLenum *gl_type) +{ + int supported = 1; + int dummy1; + GLenum dummy2; + GLint dummy3; + if (!bpp) bpp = &dummy1; + if (!gl_texfmt) gl_texfmt = &dummy3; + if (!gl_format) gl_format = &dummy2; + if (!gl_type) gl_type = &dummy2; + + *bpp = IMGFMT_IS_BGR(fmt)?IMGFMT_BGR_DEPTH(fmt):IMGFMT_RGB_DEPTH(fmt); + *gl_texfmt = 3; + switch (fmt) { + case IMGFMT_RGB48NE: + *gl_format = GL_RGB; + *gl_type = GL_UNSIGNED_SHORT; + break; + case IMGFMT_RGB24: + *gl_format = GL_RGB; + *gl_type = GL_UNSIGNED_BYTE; + break; + case IMGFMT_RGBA: + *gl_texfmt = 4; + *gl_format = GL_RGBA; + *gl_type = GL_UNSIGNED_BYTE; + break; + case IMGFMT_YV12: + supported = 0; // no native YV12 support + case IMGFMT_Y800: + case IMGFMT_Y8: + *gl_texfmt = 1; + *bpp = 8; + *gl_format = GL_LUMINANCE; + *gl_type = GL_UNSIGNED_BYTE; + break; + case IMGFMT_UYVY: + case IMGFMT_YUY2: + *gl_texfmt = GL_YCBCR_MESA; + *bpp = 16; + *gl_format = GL_YCBCR_MESA; + *gl_type = fmt == IMGFMT_UYVY ? GL_UNSIGNED_SHORT_8_8 : GL_UNSIGNED_SHORT_8_8_REV; + break; +#if 0 + // we do not support palettized formats, although the format the + // swscale produces works + case IMGFMT_RGB8: + gl_format = GL_RGB; + gl_type = GL_UNSIGNED_BYTE_2_3_3_REV; + break; +#endif + case IMGFMT_RGB15: + *gl_format = GL_RGBA; + *gl_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; + break; + case IMGFMT_RGB16: + *gl_format = GL_RGB; + *gl_type = GL_UNSIGNED_SHORT_5_6_5_REV; + break; +#if 0 + case IMGFMT_BGR8: + // special case as red and blue have a differen number of bits. + // GL_BGR and GL_UNSIGNED_BYTE_3_3_2 isn't supported at least + // by nVidia drivers, and in addition would give more bits to + // blue than to red, which isn't wanted + gl_format = GL_RGB; + gl_type = GL_UNSIGNED_BYTE_3_3_2; + break; +#endif + case IMGFMT_BGR15: + *gl_format = GL_BGRA; + *gl_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; + break; + case IMGFMT_BGR16: + *gl_format = GL_RGB; + *gl_type = GL_UNSIGNED_SHORT_5_6_5; + break; + case IMGFMT_BGR24: + *gl_format = GL_BGR; + *gl_type = GL_UNSIGNED_BYTE; + break; + case IMGFMT_BGRA: + *gl_texfmt = 4; + *gl_format = GL_BGRA; + *gl_type = GL_UNSIGNED_BYTE; + break; + default: + *gl_texfmt = 4; + *gl_format = GL_RGBA; + *gl_type = GL_UNSIGNED_BYTE; + supported = 0; + } +#ifdef TEXTUREFORMAT_ALWAYS + *gl_texfmt = TEXTUREFORMAT_ALWAYS; +#endif + return supported; +} + +static void *setNull(const GLubyte *s) { + return NULL; +} + +typedef struct { + void *funcptr; + const char *extstr; + const char *funcnames[7]; +} extfunc_desc_t; + +static const extfunc_desc_t extfuncs[] = { + {&GenBuffers, NULL, {"glGenBuffers", "glGenBuffersARB", NULL}}, + {&DeleteBuffers, NULL, {"glDeleteBuffers", "glDeleteBuffersARB", NULL}}, + {&BindBuffer, NULL, {"glBindBuffer", "glBindBufferARB", NULL}}, + {&MapBuffer, NULL, {"glMapBuffer", "glMapBufferARB", NULL}}, + {&UnmapBuffer, NULL, {"glUnmapBuffer", "glUnmapBufferARB", NULL}}, + {&BufferData, NULL, {"glBufferData", "glBufferDataARB", NULL}}, + {&CombinerParameterfv, "NV_register_combiners", {"glCombinerParameterfv", "glCombinerParameterfvNV", NULL}}, + {&CombinerParameteri, "NV_register_combiners", {"glCombinerParameteri", "glCombinerParameteriNV", NULL}}, + {&CombinerInput, "NV_register_combiners", {"glCombinerInput", "glCombinerInputNV", NULL}}, + {&CombinerOutput, "NV_register_combiners", {"glCombinerOutput", "glCombinerOutputNV", NULL}}, + {&BeginFragmentShader, "ATI_fragment_shader", {"glBeginFragmentShaderATI", NULL}}, + {&EndFragmentShader, "ATI_fragment_shader", {"glEndFragmentShaderATI", NULL}}, + {&SampleMap, "ATI_fragment_shader", {"glSampleMapATI", NULL}}, + {&ColorFragmentOp2, "ATI_fragment_shader", {"glColorFragmentOp2ATI", NULL}}, + {&ColorFragmentOp3, "ATI_fragment_shader", {"glColorFragmentOp3ATI", NULL}}, + {&SetFragmentShaderConstant, "ATI_fragment_shader", {"glSetFragmentShaderConstantATI", NULL}}, + {&ActiveTexture, NULL, {"glActiveTexture", "glActiveTextureARB", NULL}}, + {&BindTexture, NULL, {"glBindTexture", "glBindTextureARB", "glBindTextureEXT", NULL}}, + {&MultiTexCoord2f, NULL, {"glMultiTexCoord2f", "glMultiTexCoord2fARB", NULL}}, + {&GenPrograms, "_program", {"glGenProgramsARB", NULL}}, + {&DeletePrograms, "_program", {"glDeleteProgramsARB", NULL}}, + {&BindProgram, "_program", {"glBindProgramARB", NULL}}, + {&ProgramString, "_program", {"glProgramStringARB", NULL}}, + {&GetProgramiv, "_program", {"glGetProgramivARB", NULL}}, + {&ProgramEnvParameter4f, "_program", {"glProgramEnvParameter4fARB", NULL}}, + {&SwapInterval, "_swap_control", {"glXSwapInterval", "glXSwapIntervalEXT", "glXSwapIntervalSGI", "wglSwapInterval", "wglSwapIntervalEXT", "wglSwapIntervalSGI", NULL}}, + {&TexImage3D, NULL, {"glTexImage3D", NULL}}, + {&AllocateMemoryMESA, "GLX_MESA_allocate_memory", {"glXAllocateMemoryMESA", NULL}}, + {&FreeMemoryMESA, "GLX_MESA_allocate_memory", {"glXFreeMemoryMESA", NULL}}, + {NULL} +}; + +/** + * \brief find the function pointers of some useful OpenGL extensions + * \param getProcAddress function to resolve function names, may be NULL + * \param ext2 an extra extension string + */ +static void getFunctions(void *(*getProcAddress)(const GLubyte *), + const char *ext2) { + const extfunc_desc_t *dsc; + const char *extensions = (const char *)glGetString(GL_EXTENSIONS); + char *allexts; + if (!extensions) extensions = ""; + if (!ext2) ext2 = ""; + allexts = malloc(strlen(extensions) + strlen(ext2) + 2); + strcpy(allexts, extensions); + strcat(allexts, " "); + strcat(allexts, ext2); + MSG_DBG2("OpenGL extensions string:\n%s\n", allexts); + if (!getProcAddress) + getProcAddress = setNull; + for (dsc = extfuncs; dsc->funcptr; dsc++) { + void *ptr = NULL; + int i; + if (!dsc->extstr || strstr(allexts, dsc->extstr)) { + for (i = 0; !ptr && dsc->funcnames[i]; i++) + ptr = getProcAddress((const GLubyte *)dsc->funcnames[i]); + } + *(void **)dsc->funcptr = ptr; + } + if (strstr(allexts, "_texture_float")) + hqtexfmt = GL_RGB32F; + else if (strstr(allexts, "NV_float_buffer")) + hqtexfmt = GL_FLOAT_RGB32_NV; + else + hqtexfmt = GL_RGB16; + free(allexts); +} + +/** + * \brief create a texture and set some defaults + * \param target texture taget, usually GL_TEXTURE_2D + * \param fmt internal texture format + * \param format texture host data format + * \param type texture host data type + * \param filter filter used for scaling, e.g. GL_LINEAR + * \param w texture width + * \param h texture height + * \param val luminance value to fill texture with + * \ingroup gltexture + */ +void glCreateClearTex(GLenum target, GLenum fmt, GLenum format, GLenum type, GLint filter, + int w, int h, unsigned char val) { + GLfloat fval = (GLfloat)val / 255.0; + GLfloat border[4] = {fval, fval, fval, fval}; + int stride = w * glFmt2bpp(format, type); + char *init; + if (!stride) return; + init = malloc(stride * h); + memset(init, val, stride * h); + glAdjustAlignment(stride); + glPixelStorei(GL_UNPACK_ROW_LENGTH, w); + glTexImage2D(target, 0, fmt, w, h, 0, format, type, init); + glTexParameterf(target, GL_TEXTURE_PRIORITY, 1.0); + glTexParameteri(target, GL_TEXTURE_MIN_FILTER, filter); + glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filter); + glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + // Border texels should not be used with CLAMP_TO_EDGE + // We set a sane default anyway. + glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border); + free(init); +} + +/** + * \brief skips whitespace and comments + * \param f file to read from + */ +static void ppm_skip(FILE *f) { + int c, comment = 0; + do { + c = fgetc(f); + if (c == '#') + comment = 1; + if (c == '\n') + comment = 0; + } while (c != EOF && (isspace(c) || comment)); + if (c != EOF) + ungetc(c, f); +} + +#define MAXDIM (16 * 1024) + +/** + * \brief creates a texture from a PPM file + * \param target texture taget, usually GL_TEXTURE_2D + * \param fmt internal texture format, 0 for default + * \param filter filter used for scaling, e.g. GL_LINEAR + * \param f file to read PPM from + * \param width [out] width of texture + * \param height [out] height of texture + * \param maxval [out] maxval value from PPM file + * \return 0 on error, 1 otherwise + * \ingroup gltexture + */ +int glCreatePPMTex(GLenum target, GLenum fmt, GLint filter, + FILE *f, int *width, int *height, int *maxval) { + unsigned w, h, m, val, bpp; + char *data; + GLenum type; + ppm_skip(f); + if (fgetc(f) != 'P' || fgetc(f) != '6') + return 0; + ppm_skip(f); + if (fscanf(f, "%u", &w) != 1) + return 0; + ppm_skip(f); + if (fscanf(f, "%u", &h) != 1) + return 0; + ppm_skip(f); + if (fscanf(f, "%u", &m) != 1) + return 0; + val = fgetc(f); + if (!isspace(val)) + return 0; + if (w > MAXDIM || h > MAXDIM) + return 0; + bpp = (m > 255) ? 6 : 3; + data = malloc(w * h * bpp); + if (fread(data, w * bpp, h, f) != h) + return 0; + if (!fmt) { + fmt = (m > 255) ? hqtexfmt : 3; + if (fmt == GL_FLOAT_RGB32_NV && target != GL_TEXTURE_RECTANGLE) + fmt = GL_RGB16; + } + type = m > 255 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE; + glCreateClearTex(target, fmt, GL_RGB, type, filter, w, h, 0); + glUploadTex(target, GL_RGB, type, + data, w * bpp, 0, 0, w, h, 0); + free(data); + if (width) *width = w; + if (height) *height = h; + if (maxval) *maxval = m; + return 1; +} + +/** + * \brief return the number of bytes per pixel for the given format + * \param format OpenGL format + * \param type OpenGL type + * \return bytes per pixel + * \ingroup glgeneral + * + * Does not handle all possible variants, just those used by MPlayer + */ +int glFmt2bpp(GLenum format, GLenum type) { + int component_size = 0; + switch (type) { + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + return 1; + case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + return 2; + case GL_UNSIGNED_BYTE: + component_size = 1; + break; + case GL_UNSIGNED_SHORT: + component_size = 2; + break; + } + switch (format) { + case GL_LUMINANCE: + case GL_ALPHA: + return component_size; + case GL_YCBCR_MESA: + return 2; + case GL_RGB: + case GL_BGR: + return 3 * component_size; + case GL_RGBA: + case GL_BGRA: + return 4 * component_size; + } + return 0; // unknown +} + +/** + * \brief upload a texture, handling things like stride and slices + * \param target texture target, usually GL_TEXTURE_2D + * \param format OpenGL format of data + * \param type OpenGL type of data + * \param dataptr data to upload + * \param stride data stride + * \param x x offset in texture + * \param y y offset in texture + * \param w width of the texture part to upload + * \param h height of the texture part to upload + * \param slice height of an upload slice, 0 for all at once + * \ingroup gltexture + */ +void glUploadTex(GLenum target, GLenum format, GLenum type, + const void *dataptr, int stride, + int x, int y, int w, int h, int slice) { + const uint8_t *data = dataptr; + int y_max = y + h; + if (w <= 0 || h <= 0) return; + if (slice <= 0) + slice = h; + if (stride < 0) { + data += (h - 1) * stride; + stride = -stride; + } + // this is not always correct, but should work for MPlayer + glAdjustAlignment(stride); + glPixelStorei(GL_UNPACK_ROW_LENGTH, stride / glFmt2bpp(format, type)); + for (; y + slice <= y_max; y += slice) { + glTexSubImage2D(target, 0, x, y, w, slice, format, type, data); + data += stride * slice; + } + if (y < y_max) + glTexSubImage2D(target, 0, x, y, w, y_max - y, format, type, data); +} + +static void fillUVcoeff(GLfloat *ucoef, GLfloat *vcoef, + float uvcos, float uvsin) { + int i; + ucoef[0] = 0 * uvcos + 1.403 * uvsin; + vcoef[0] = 0 * uvsin + 1.403 * uvcos; + ucoef[1] = -0.344 * uvcos + -0.714 * uvsin; + vcoef[1] = -0.344 * uvsin + -0.714 * uvcos; + ucoef[2] = 1.770 * uvcos + 0 * uvsin; + vcoef[2] = 1.770 * uvsin + 0 * uvcos; + ucoef[3] = 0; + vcoef[3] = 0; + // Coefficients (probably) must be in [0, 1] range, whereas they originally + // are in [-2, 2] range, so here comes the trick: + // First put them in the [-0.5, 0.5] range, then add 0.5. + // This can be undone with the HALF_BIAS and SCALE_BY_FOUR arguments + // for CombinerInput and CombinerOutput (or the respective ATI variants) + for (i = 0; i < 4; i++) { + ucoef[i] = ucoef[i] * 0.25 + 0.5; + vcoef[i] = vcoef[i] * 0.25 + 0.5; + } +} + +/** + * \brief Setup register combiners for YUV to RGB conversion. + * \param uvcos used for saturation and hue adjustment + * \param uvsin used for saturation and hue adjustment + */ +static void glSetupYUVCombiners(float uvcos, float uvsin) { + GLfloat ucoef[4]; + GLfloat vcoef[4]; + GLint i; + if (!CombinerInput || !CombinerOutput || + !CombinerParameterfv || !CombinerParameteri) { + MSG_FATAL("[gl] Combiner functions missing!\n"); + return; + } + glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &i); + if (i < 2) + MSG_ERR( + "[gl] 2 general combiners needed for YUV combiner support (found %i)\n", i); + glGetIntegerv(GL_MAX_TEXTURE_UNITS, &i); + if (i < 3) + MSG_ERR( + "[gl] 3 texture units needed for YUV combiner support (found %i)\n", i); + fillUVcoeff(ucoef, vcoef, uvcos, uvsin); + CombinerParameterfv(GL_CONSTANT_COLOR0_NV, ucoef); + CombinerParameterfv(GL_CONSTANT_COLOR1_NV, vcoef); + + // UV first, like this green component cannot overflow + CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV, + GL_TEXTURE1, GL_HALF_BIAS_NORMAL_NV, GL_RGB); + CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV, + GL_CONSTANT_COLOR0_NV, GL_HALF_BIAS_NORMAL_NV, GL_RGB); + CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV, + GL_TEXTURE2, GL_HALF_BIAS_NORMAL_NV, GL_RGB); + CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_D_NV, + GL_CONSTANT_COLOR1_NV, GL_HALF_BIAS_NORMAL_NV, GL_RGB); + CombinerOutput(GL_COMBINER0_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, + GL_SPARE0_NV, GL_SCALE_BY_FOUR_NV, GL_NONE, GL_FALSE, + GL_FALSE, GL_FALSE); + + // stage 2 + CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_A_NV, GL_SPARE0_NV, + GL_SIGNED_IDENTITY_NV, GL_RGB); + CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, + GL_UNSIGNED_INVERT_NV, GL_RGB); + CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_C_NV, + GL_TEXTURE0, GL_SIGNED_IDENTITY_NV, GL_RGB); + CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, + GL_UNSIGNED_INVERT_NV, GL_RGB); + CombinerOutput(GL_COMBINER1_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, + GL_SPARE0_NV, GL_NONE, GL_NONE, GL_FALSE, + GL_FALSE, GL_FALSE); + + // leave final combiner stage in default mode + CombinerParameteri(GL_NUM_GENERAL_COMBINERS_NV, 2); +} + +/** + * \brief Setup ATI version of register combiners for YUV to RGB conversion. + * \param uvcos used for saturation and hue adjustment + * \param uvsin used for saturation and hue adjustment + * + * ATI called this fragment shader, but the name is confusing in the + * light of a very different OpenGL 2.0 extension with the same name + */ +static void glSetupYUVCombinersATI(float uvcos, float uvsin) { + GLfloat ucoef[4]; + GLfloat vcoef[4]; + GLint i; + if (!BeginFragmentShader || !EndFragmentShader || + !SetFragmentShaderConstant || !SampleMap || + !ColorFragmentOp2 || !ColorFragmentOp3) { + MSG_FATAL("[gl] Combiner (ATI) functions missing!\n"); + return; + } + glGetIntegerv(GL_NUM_FRAGMENT_REGISTERS_ATI, &i); + if (i < 3) + MSG_ERR( + "[gl] 3 registers needed for YUV combiner (ATI) support (found %i)\n", i); + glGetIntegerv (GL_MAX_TEXTURE_UNITS, &i); + if (i < 3) + MSG_ERR( + "[gl] 3 texture units needed for YUV combiner (ATI) support (found %i)\n", i); + fillUVcoeff(ucoef, vcoef, uvcos, uvsin); + BeginFragmentShader(); + SetFragmentShaderConstant(GL_CON_0_ATI, ucoef); + SetFragmentShaderConstant(GL_CON_1_ATI, vcoef); + SampleMap(GL_REG_0_ATI, GL_TEXTURE0, GL_SWIZZLE_STR_ATI); + SampleMap(GL_REG_1_ATI, GL_TEXTURE1, GL_SWIZZLE_STR_ATI); + SampleMap(GL_REG_2_ATI, GL_TEXTURE2, GL_SWIZZLE_STR_ATI); + // UV first, like this green component cannot overflow + ColorFragmentOp2(GL_MUL_ATI, GL_REG_1_ATI, GL_NONE, GL_NONE, + GL_REG_1_ATI, GL_NONE, GL_BIAS_BIT_ATI, + GL_CON_0_ATI, GL_NONE, GL_BIAS_BIT_ATI); + ColorFragmentOp3(GL_MAD_ATI, GL_REG_2_ATI, GL_NONE, GL_4X_BIT_ATI, + GL_REG_2_ATI, GL_NONE, GL_BIAS_BIT_ATI, + GL_CON_1_ATI, GL_NONE, GL_BIAS_BIT_ATI, + GL_REG_1_ATI, GL_NONE, GL_NONE); + ColorFragmentOp2(GL_ADD_ATI, GL_REG_0_ATI, GL_NONE, GL_NONE, + GL_REG_0_ATI, GL_NONE, GL_NONE, + GL_REG_2_ATI, GL_NONE, GL_NONE); + EndFragmentShader(); +} + +/** + * \brief helper function for gen_spline_lookup_tex + * \param x subpixel-position ((0,1) range) to calculate weights for + * \param dst where to store transformed weights, must provide space for 4 GLfloats + * + * calculates the weights and stores them after appropriate transformation + * for the scaler fragment program. + */ +static void store_weights(float x, GLfloat *dst) { + float w0 = (((-1 * x + 3) * x - 3) * x + 1) / 6; + float w1 = ((( 3 * x - 6) * x + 0) * x + 4) / 6; + float w2 = (((-3 * x + 3) * x + 3) * x + 1) / 6; + float w3 = ((( 1 * x + 0) * x + 0) * x + 0) / 6; + *dst++ = 1 + x - w1 / (w0 + w1); + *dst++ = 1 - x + w3 / (w2 + w3); + *dst++ = w0 + w1; + *dst++ = 0; +} + +//! to avoid artefacts this should be rather large +#define LOOKUP_BSPLINE_RES (2 * 1024) +/** + * \brief creates the 1D lookup texture needed for fast higher-order filtering + * \param unit texture unit to attach texture to + */ +static void gen_spline_lookup_tex(GLenum unit) { + GLfloat *tex = calloc(4 * LOOKUP_BSPLINE_RES, sizeof(*tex)); + GLfloat *tp = tex; + int i; + for (i = 0; i < LOOKUP_BSPLINE_RES; i++) { + float x = (float)(i + 0.5) / LOOKUP_BSPLINE_RES; + store_weights(x, tp); + tp += 4; + } + store_weights(0, tex); + store_weights(1, &tex[4 * (LOOKUP_BSPLINE_RES - 1)]); + ActiveTexture(unit); + glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16, LOOKUP_BSPLINE_RES, 0, GL_RGBA, GL_FLOAT, tex); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_PRIORITY, 1.0); + glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT); + ActiveTexture(GL_TEXTURE0); + free(tex); +} + +static const char *bilin_filt_template = + "TEX yuv.%c, fragment.texcoord[%c], texture[%c], %s;"; + +#define BICUB_FILT_MAIN(textype) \ + /* first y-interpolation */ \ + "ADD coord, fragment.texcoord[%c].xyxy, cdelta.xyxw;" \ + "ADD coord2, fragment.texcoord[%c].xyxy, cdelta.zyzw;" \ + "TEX a.r, coord.xyxy, texture[%c], "textype";" \ + "TEX a.g, coord.zwzw, texture[%c], "textype";" \ + /* second y-interpolation */ \ + "TEX b.r, coord2.xyxy, texture[%c], "textype";" \ + "TEX b.g, coord2.zwzw, texture[%c], "textype";" \ + "LRP a.b, parmy.b, a.rrrr, a.gggg;" \ + "LRP a.a, parmy.b, b.rrrr, b.gggg;" \ + /* x-interpolation */ \ + "LRP yuv.%c, parmx.b, a.bbbb, a.aaaa;" + +static const char *bicub_filt_template_2D = + "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};" + "TEX parmx, coord.x, texture[%c], 1D;" + "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};" + "TEX parmy, coord.y, texture[%c], 1D;" + "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};" + BICUB_FILT_MAIN("2D"); + +static const char *bicub_filt_template_RECT = + "ADD coord, fragment.texcoord[%c], {0.5, 0.5};" + "TEX parmx, coord.x, texture[%c], 1D;" + "MUL cdelta.xz, parmx.rrgg, {-1, 0, 1, 0};" + "TEX parmy, coord.y, texture[%c], 1D;" + "MUL cdelta.yw, parmy.rrgg, {0, -1, 0, 1};" + BICUB_FILT_MAIN("RECT"); + +#define CALCWEIGHTS(t, s) \ + "MAD "t", {-0.5, 0.1666, 0.3333, -0.3333}, "s", {1, 0, -0.5, 0.5};" \ + "MAD "t", "t", "s", {0, 0, -0.5, 0.5};" \ + "MAD "t", "t", "s", {-0.6666, 0, 0.8333, 0.1666};" \ + "RCP a.x, "t".z;" \ + "RCP a.y, "t".w;" \ + "MAD "t".xy, "t".xyxy, a.xyxy, {1, 1, 0, 0};" \ + "ADD "t".x, "t".xxxx, "s";" \ + "SUB "t".y, "t".yyyy, "s";" + +static const char *bicub_notex_filt_template_2D = + "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};" + "FRC coord.xy, coord.xyxy;" + CALCWEIGHTS("parmx", "coord.xxxx") + "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};" + CALCWEIGHTS("parmy", "coord.yyyy") + "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};" + BICUB_FILT_MAIN("2D"); + +static const char *bicub_notex_filt_template_RECT = + "ADD coord, fragment.texcoord[%c], {0.5, 0.5};" + "FRC coord.xy, coord.xyxy;" + CALCWEIGHTS("parmx", "coord.xxxx") + "MUL cdelta.xz, parmx.rrgg, {-1, 0, 1, 0};" + CALCWEIGHTS("parmy", "coord.yyyy") + "MUL cdelta.yw, parmy.rrgg, {0, -1, 0, 1};" + BICUB_FILT_MAIN("RECT"); + +#define BICUB_X_FILT_MAIN(textype) \ + "ADD coord.xy, fragment.texcoord[%c].xyxy, cdelta.xyxy;" \ + "ADD coord2.xy, fragment.texcoord[%c].xyxy, cdelta.zyzy;" \ + "TEX a.r, coord, texture[%c], "textype";" \ + "TEX b.r, coord2, texture[%c], "textype";" \ + /* x-interpolation */ \ + "LRP yuv.%c, parmx.b, a.rrrr, b.rrrr;" + +static const char *bicub_x_filt_template_2D = + "MAD coord.x, fragment.texcoord[%c], {%f}, {0.5};" + "TEX parmx, coord, texture[%c], 1D;" + "MUL cdelta.xyz, parmx.rrgg, {-%f, 0, %f};" + BICUB_X_FILT_MAIN("2D"); + +static const char *bicub_x_filt_template_RECT = + "ADD coord.x, fragment.texcoord[%c], {0.5};" + "TEX parmx, coord, texture[%c], 1D;" + "MUL cdelta.xyz, parmx.rrgg, {-1, 0, 1};" + BICUB_X_FILT_MAIN("RECT"); + +static const char *unsharp_filt_template = + "PARAM dcoord%c = {%f, %f, %f, %f};" + "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" + "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" + "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" + "TEX b.r, coord.xyxy, texture[%c], %s;" + "TEX b.g, coord.zwzw, texture[%c], %s;" + "ADD b.r, b.r, b.g;" + "TEX b.b, coord2.xyxy, texture[%c], %s;" + "TEX b.g, coord2.zwzw, texture[%c], %s;" + "DP3 b, b, {0.25, 0.25, 0.25};" + "SUB b.r, a.r, b.r;" + "MAD yuv.%c, b.r, {%f}, a.r;"; + +static const char *unsharp_filt_template2 = + "PARAM dcoord%c = {%f, %f, %f, %f};" + "PARAM dcoord2%c = {%f, 0, 0, %f};" + "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" + "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" + "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" + "TEX b.r, coord.xyxy, texture[%c], %s;" + "TEX b.g, coord.zwzw, texture[%c], %s;" + "ADD b.r, b.r, b.g;" + "TEX b.b, coord2.xyxy, texture[%c], %s;" + "TEX b.g, coord2.zwzw, texture[%c], %s;" + "ADD b.r, b.r, b.b;" + "ADD b.a, b.r, b.g;" + "ADD coord, fragment.texcoord[%c].xyxy, dcoord2%c;" + "SUB coord2, fragment.texcoord[%c].xyxy, dcoord2%c;" + "TEX b.r, coord.xyxy, texture[%c], %s;" + "TEX b.g, coord.zwzw, texture[%c], %s;" + "ADD b.r, b.r, b.g;" + "TEX b.b, coord2.xyxy, texture[%c], %s;" + "TEX b.g, coord2.zwzw, texture[%c], %s;" + "DP4 b.r, b, {-0.1171875, -0.1171875, -0.1171875, -0.09765625};" + "MAD b.r, a.r, {0.859375}, b.r;" + "MAD yuv.%c, b.r, {%f}, a.r;"; + +static const char *yuv_prog_template = + "PARAM ycoef = {%.4f, %.4f, %.4f};" + "PARAM ucoef = {%.4f, %.4f, %.4f};" + "PARAM vcoef = {%.4f, %.4f, %.4f};" + "PARAM offsets = {%.4f, %.4f, %.4f};" + "TEMP res;" + "MAD res.rgb, yuv.rrrr, ycoef, offsets;" + "MAD res.rgb, yuv.gggg, ucoef, res;" + "MAD result.color.rgb, yuv.bbbb, vcoef, res;" + "END"; + +static const char *yuv_pow_prog_template = + "PARAM ycoef = {%.4f, %.4f, %.4f};" + "PARAM ucoef = {%.4f, %.4f, %.4f};" + "PARAM vcoef = {%.4f, %.4f, %.4f};" + "PARAM offsets = {%.4f, %.4f, %.4f};" + "PARAM gamma = {%.4f, %.4f, %.4f};" + "TEMP res;" + "MAD res.rgb, yuv.rrrr, ycoef, offsets;" + "MAD res.rgb, yuv.gggg, ucoef, res;" + "MAD_SAT res.rgb, yuv.bbbb, vcoef, res;" + "POW result.color.r, res.r, gamma.r;" + "POW result.color.g, res.g, gamma.g;" + "POW result.color.b, res.b, gamma.b;" + "END"; + +static const char *yuv_lookup_prog_template = + "PARAM ycoef = {%.4f, %.4f, %.4f, 0};" + "PARAM ucoef = {%.4f, %.4f, %.4f, 0};" + "PARAM vcoef = {%.4f, %.4f, %.4f, 0};" + "PARAM offsets = {%.4f, %.4f, %.4f, 0.125};" + "TEMP res;" + "MAD res, yuv.rrrr, ycoef, offsets;" + "MAD res.rgb, yuv.gggg, ucoef, res;" + "MAD res.rgb, yuv.bbbb, vcoef, res;" + "TEX result.color.r, res.raaa, texture[%c], 2D;" + "ADD res.a, res.a, 0.25;" + "TEX result.color.g, res.gaaa, texture[%c], 2D;" + "ADD res.a, res.a, 0.25;" + "TEX result.color.b, res.baaa, texture[%c], 2D;" + "END"; + +static const char *yuv_lookup3d_prog_template = + "TEX result.color, yuv, texture[%c], 3D;" + "END"; + +/** + * \brief creates and initializes helper textures needed for scaling texture read + * \param scaler scaler type to create texture for + * \param texu contains next free texture unit number + * \param texs texture unit ids for the scaler are stored in this array + */ +static void create_scaler_textures(int scaler, int *texu, char *texs) { + switch (scaler) { + case YUV_SCALER_BILIN: + case YUV_SCALER_BICUB_NOTEX: + case YUV_SCALER_UNSHARP: + case YUV_SCALER_UNSHARP2: + break; + case YUV_SCALER_BICUB: + case YUV_SCALER_BICUB_X: + texs[0] = (*texu)++; + gen_spline_lookup_tex(GL_TEXTURE0 + texs[0]); + texs[0] += '0'; + break; + default: + MSG_ERR("[gl] unknown scaler type %i\n", scaler); + } +} + +static void gen_gamma_map(unsigned char *map, int size, float gamma); + +#define ROW_R 0 +#define ROW_G 1 +#define ROW_B 2 +#define COL_Y 0 +#define COL_U 1 +#define COL_V 2 +#define COL_C 3 + +static void get_yuv2rgb_coeffs(gl_conversion_params_t *params, float yuv2rgb[3][4]) { + float uvcos = params->saturation * cos(params->hue); + float uvsin = params->saturation * sin(params->hue); + int i; + float uv_coeffs[3][2] = { + { 0.000, 1.596}, + {-0.391, -0.813}, + { 2.018, 0.000} + }; + for (i = 0; i < 3; i++) { + yuv2rgb[i][COL_C] = params->brightness; + yuv2rgb[i][COL_Y] = 1.164 * params->contrast; + yuv2rgb[i][COL_C] += (-16 / 255.0) * yuv2rgb[i][COL_Y]; + yuv2rgb[i][COL_U] = uv_coeffs[i][0] * uvcos + uv_coeffs[i][1] * uvsin; + yuv2rgb[i][COL_C] += (-128 / 255.0) * yuv2rgb[i][COL_U]; + yuv2rgb[i][COL_V] = uv_coeffs[i][0] * uvsin + uv_coeffs[i][1] * uvcos; + yuv2rgb[i][COL_C] += (-128 / 255.0) * yuv2rgb[i][COL_V]; + // this "centers" contrast control so that e.g. a contrast of 0 + // leads to a grey image, not a black one + yuv2rgb[i][COL_C] += 0.5 - params->contrast / 2.0; + } +} + +//! size of gamma map use to avoid slow exp function in gen_yuv2rgb_map +#define GMAP_SIZE (1024) +/** + * \brief generate a 3D YUV -> RGB map + * \param params struct containing parameters like brightness, gamma, ... + * \param map where to store map. Must provide space for (size + 2)^3 elements + * \param size size of the map, excluding border + */ +static void gen_yuv2rgb_map(gl_conversion_params_t *params, unsigned char *map, int size) { + int i, j, k, l; + float step = 1.0 / size; + float y, u, v; + float yuv2rgb[3][4]; + unsigned char gmaps[3][GMAP_SIZE]; + gen_gamma_map(gmaps[0], GMAP_SIZE, params->rgamma); + gen_gamma_map(gmaps[1], GMAP_SIZE, params->ggamma); + gen_gamma_map(gmaps[2], GMAP_SIZE, params->bgamma); + get_yuv2rgb_coeffs(params, yuv2rgb); + for (i = 0; i < 3; i++) + for (j = 0; j < 4; j++) + yuv2rgb[i][j] *= GMAP_SIZE - 1; + v = 0; + for (i = -1; i <= size; i++) { + u = 0; + for (j = -1; j <= size; j++) { + y = 0; + for (k = -1; k <= size; k++) { + for (l = 0; l < 3; l++) { + float rgb = yuv2rgb[l][COL_Y] * y + yuv2rgb[l][COL_U] * u + yuv2rgb[l][COL_V] * v + yuv2rgb[l][COL_C]; + *map++ = gmaps[l][av_clip(rgb, 0, GMAP_SIZE - 1)]; + } + y += (k == -1 || k == size - 1) ? step / 2 : step; + } + u += (j == -1 || j == size - 1) ? step / 2 : step; + } + v += (i == -1 || i == size - 1) ? step / 2 : step; + } +} + +//! resolution of texture for gamma lookup table +#define LOOKUP_RES 512 +//! resolution for 3D yuv->rgb conversion lookup table +#define LOOKUP_3DRES 32 +/** + * \brief creates and initializes helper textures needed for yuv conversion + * \param params struct containing parameters like brightness, gamma, ... + * \param texu contains next free texture unit number + * \param texs texture unit ids for the conversion are stored in this array + */ +static void create_conv_textures(gl_conversion_params_t *params, int *texu, char *texs) { + unsigned char *lookup_data = NULL; + int conv = YUV_CONVERSION(params->type); + switch (conv) { + case YUV_CONVERSION_FRAGMENT: + case YUV_CONVERSION_FRAGMENT_POW: + break; + case YUV_CONVERSION_FRAGMENT_LOOKUP: + texs[0] = (*texu)++; + ActiveTexture(GL_TEXTURE0 + texs[0]); + lookup_data = malloc(4 * LOOKUP_RES); + gen_gamma_map(lookup_data, LOOKUP_RES, params->rgamma); + gen_gamma_map(&lookup_data[LOOKUP_RES], LOOKUP_RES, params->ggamma); + gen_gamma_map(&lookup_data[2 * LOOKUP_RES], LOOKUP_RES, params->bgamma); + glCreateClearTex(GL_TEXTURE_2D, GL_LUMINANCE8, GL_LUMINANCE, GL_UNSIGNED_BYTE, GL_LINEAR, + LOOKUP_RES, 4, 0); + glUploadTex(GL_TEXTURE_2D, GL_LUMINANCE, GL_UNSIGNED_BYTE, lookup_data, + LOOKUP_RES, 0, 0, LOOKUP_RES, 4, 0); + ActiveTexture(GL_TEXTURE0); + texs[0] += '0'; + break; + case YUV_CONVERSION_FRAGMENT_LOOKUP3D: + { + int sz = LOOKUP_3DRES + 2; // texture size including borders + if (!TexImage3D) { + MSG_ERR("[gl] Missing 3D texture function!\n"); + break; + } + texs[0] = (*texu)++; + ActiveTexture(GL_TEXTURE0 + texs[0]); + lookup_data = malloc(3 * sz * sz * sz); + gen_yuv2rgb_map(params, lookup_data, LOOKUP_3DRES); + glAdjustAlignment(sz); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + TexImage3D(GL_TEXTURE_3D, 0, 3, sz, sz, sz, 1, + GL_RGB, GL_UNSIGNED_BYTE, lookup_data); + glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_PRIORITY, 1.0); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP); + ActiveTexture(GL_TEXTURE0); + texs[0] += '0'; + } + break; + default: + MSG_ERR("[gl] unknown conversion type %i\n", conv); + } + if (lookup_data) + free(lookup_data); +} + +/** + * \brief adds a scaling texture read at the current fragment program position + * \param scaler type of scaler to insert + * \param prog_pos current position in fragment program + * \param remain how many bytes remain in the buffer given by prog_pos + * \param texs array containing the texture unit identifiers for this scaler + * \param in_tex texture unit the scaler should read from + * \param out_comp component of the yuv variable the scaler stores the result in + * \param rect if rectangular (pixel) adressing should be used for in_tex + * \param texw width of the in_tex texture + * \param texh height of the in_tex texture + * \param strength strength of filter effect if the scaler does some kind of filtering + */ +static void add_scaler(int scaler, char **prog_pos, int *remain, char *texs, + char in_tex, char out_comp, int rect, int texw, int texh, + double strength) { + const char *ttype = rect ? "RECT" : "2D"; + const float ptw = rect ? 1.0 : 1.0 / texw; + const float pth = rect ? 1.0 : 1.0 / texh; + switch (scaler) { + case YUV_SCALER_BILIN: + snprintf(*prog_pos, *remain, bilin_filt_template, out_comp, in_tex, + in_tex, ttype); + break; + case YUV_SCALER_BICUB: + if (rect) + snprintf(*prog_pos, *remain, bicub_filt_template_RECT, + in_tex, texs[0], texs[0], + in_tex, in_tex, in_tex, in_tex, in_tex, in_tex, out_comp); + else + snprintf(*prog_pos, *remain, bicub_filt_template_2D, + in_tex, (float)texw, (float)texh, + texs[0], ptw, ptw, texs[0], pth, pth, + in_tex, in_tex, in_tex, in_tex, in_tex, in_tex, out_comp); + break; + case YUV_SCALER_BICUB_X: + if (rect) + snprintf(*prog_pos, *remain, bicub_x_filt_template_RECT, + in_tex, texs[0], + in_tex, in_tex, in_tex, in_tex, out_comp); + else + snprintf(*prog_pos, *remain, bicub_x_filt_template_2D, + in_tex, (float)texw, + texs[0], ptw, ptw, + in_tex, in_tex, in_tex, in_tex, out_comp); + break; + case YUV_SCALER_BICUB_NOTEX: + if (rect) + snprintf(*prog_pos, *remain, bicub_notex_filt_template_RECT, + in_tex, + in_tex, in_tex, in_tex, in_tex, in_tex, in_tex, out_comp); + else + snprintf(*prog_pos, *remain, bicub_notex_filt_template_2D, + in_tex, (float)texw, (float)texh, ptw, ptw, pth, pth, + in_tex, in_tex, in_tex, in_tex, in_tex, in_tex, out_comp); + break; + case YUV_SCALER_UNSHARP: + snprintf(*prog_pos, *remain, unsharp_filt_template, + out_comp, 0.5 * ptw, 0.5 * pth, 0.5 * ptw, -0.5 * pth, + in_tex, out_comp, in_tex, out_comp, in_tex, + in_tex, ttype, in_tex, ttype, in_tex, ttype, in_tex, ttype, + in_tex, ttype, out_comp, strength); + break; + case YUV_SCALER_UNSHARP2: + snprintf(*prog_pos, *remain, unsharp_filt_template2, + out_comp, 1.2 * ptw, 1.2 * pth, 1.2 * ptw, -1.2 * pth, + out_comp, 1.5 * ptw, 1.5 * pth, + in_tex, out_comp, in_tex, out_comp, in_tex, + in_tex, ttype, in_tex, ttype, in_tex, ttype, in_tex, ttype, + in_tex, ttype, in_tex, out_comp, in_tex, out_comp, + in_tex, ttype, in_tex, ttype, in_tex, ttype, + in_tex, ttype, out_comp, strength); + break; + } + *remain -= strlen(*prog_pos); + *prog_pos += strlen(*prog_pos); +} + +static const struct { + const char *name; + GLenum cur; + GLenum max; +} progstats[] = { + {"instructions", 0x88A0, 0x88A1}, + {"native instructions", 0x88A2, 0x88A3}, + {"temporaries", 0x88A4, 0x88A5}, + {"native temporaries", 0x88A6, 0x88A7}, + {"parameters", 0x88A8, 0x88A9}, + {"native parameters", 0x88AA, 0x88AB}, + {"attribs", 0x88AC, 0x88AD}, + {"native attribs", 0x88AE, 0x88AF}, + {"ALU instructions", 0x8805, 0x880B}, + {"TEX instructions", 0x8806, 0x880C}, + {"TEX indirections", 0x8807, 0x880D}, + {"native ALU instructions", 0x8808, 0x880E}, + {"native TEX instructions", 0x8809, 0x880F}, + {"native TEX indirections", 0x880A, 0x8810}, + {NULL, 0, 0} +}; + +/** + * \brief load the specified GPU Program + * \param target program target to load into, only GL_FRAGMENT_PROGRAM is tested + * \param prog program string + * \return 1 on success, 0 otherwise + */ +int loadGPUProgram(GLenum target, char *prog) { + int i; + GLint cur = 0, max = 0, err = 0; + if (!ProgramString) { + MSG_ERR("[gl] Missing GPU program function\n"); + return 0; + } + ProgramString(target, GL_PROGRAM_FORMAT_ASCII, strlen(prog), prog); + glGetIntegerv(GL_PROGRAM_ERROR_POSITION, &err); + if (err != -1) { + MSG_ERR( + "[gl] Error compiling fragment program, make sure your card supports\n" + "[gl] GL_ARB_fragment_program (use glxinfo to check).\n" + "[gl] Error message:\n %s at %.10s\n", + glGetString(GL_PROGRAM_ERROR_STRING), &prog[err]); + return 0; + } + if (!GetProgramiv) + return 1; + MSG_V("[gl] Program statistics:\n"); + for (i = 0; progstats[i].name; i++) { + GetProgramiv(target, progstats[i].cur, &cur); + GetProgramiv(target, progstats[i].max, &max); + MSG_V( "[gl] %s: %i/%i\n", progstats[i].name, cur, max); + } + return 1; +} + +#define MAX_PROGSZ (1024*1024) + +/** + * \brief setup a fragment program that will do YUV->RGB conversion + * \param parms struct containing parameters like conversion and scaler type, + * brightness, ... + */ +static void glSetupYUVFragprog(gl_conversion_params_t *params) { + int type = params->type; + int texw = params->texw; + int texh = params->texh; + int rect = params->target == GL_TEXTURE_RECTANGLE; + static const char prog_hdr[] = + "!!ARBfp1.0\n" + "OPTION ARB_precision_hint_fastest;" + // all scaler variables must go here so they aren't defined + // multiple times when the same scaler is used more than once + "TEMP coord, coord2, cdelta, parmx, parmy, a, b, yuv;"; + int prog_remain; + char *yuv_prog, *prog_pos; + int cur_texu = 3; + char lum_scale_texs[1]; + char chrom_scale_texs[1]; + char conv_texs[1]; + GLint i; + // this is the conversion matrix, with y, u, v factors + // for red, green, blue and the constant offsets + float yuv2rgb[3][4]; + create_conv_textures(params, &cur_texu, conv_texs); + create_scaler_textures(YUV_LUM_SCALER(type), &cur_texu, lum_scale_texs); + if (YUV_CHROM_SCALER(type) == YUV_LUM_SCALER(type)) + memcpy(chrom_scale_texs, lum_scale_texs, sizeof(chrom_scale_texs)); + else + create_scaler_textures(YUV_CHROM_SCALER(type), &cur_texu, chrom_scale_texs); + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &i); + if (i < cur_texu) + MSG_ERR( + "[gl] %i texture units needed for this type of YUV fragment support (found %i)\n", + cur_texu, i); + if (!ProgramString) { + MSG_FATAL("[gl] ProgramString function missing!\n"); + return; + } + yuv_prog = malloc(MAX_PROGSZ); + strcpy(yuv_prog, prog_hdr); + prog_pos = yuv_prog + sizeof(prog_hdr) - 1; + prog_remain = MAX_PROGSZ - sizeof(prog_hdr); + add_scaler(YUV_LUM_SCALER(type), &prog_pos, &prog_remain, lum_scale_texs, + '0', 'r', rect, texw, texh, params->filter_strength); + add_scaler(YUV_CHROM_SCALER(type), &prog_pos, &prog_remain, chrom_scale_texs, + '1', 'g', rect, texw / 2, texh / 2, params->filter_strength); + add_scaler(YUV_CHROM_SCALER(type), &prog_pos, &prog_remain, chrom_scale_texs, + '2', 'b', rect, texw / 2, texh / 2, params->filter_strength); + get_yuv2rgb_coeffs(params, yuv2rgb); + switch (YUV_CONVERSION(type)) { + case YUV_CONVERSION_FRAGMENT: + snprintf(prog_pos, prog_remain, yuv_prog_template, + yuv2rgb[ROW_R][COL_Y], yuv2rgb[ROW_G][COL_Y], yuv2rgb[ROW_B][COL_Y], + yuv2rgb[ROW_R][COL_U], yuv2rgb[ROW_G][COL_U], yuv2rgb[ROW_B][COL_U], + yuv2rgb[ROW_R][COL_V], yuv2rgb[ROW_G][COL_V], yuv2rgb[ROW_B][COL_V], + yuv2rgb[ROW_R][COL_C], yuv2rgb[ROW_G][COL_C], yuv2rgb[ROW_B][COL_C]); + break; + case YUV_CONVERSION_FRAGMENT_POW: + snprintf(prog_pos, prog_remain, yuv_pow_prog_template, + yuv2rgb[ROW_R][COL_Y], yuv2rgb[ROW_G][COL_Y], yuv2rgb[ROW_B][COL_Y], + yuv2rgb[ROW_R][COL_U], yuv2rgb[ROW_G][COL_U], yuv2rgb[ROW_B][COL_U], + yuv2rgb[ROW_R][COL_V], yuv2rgb[ROW_G][COL_V], yuv2rgb[ROW_B][COL_V], + yuv2rgb[ROW_R][COL_C], yuv2rgb[ROW_G][COL_C], yuv2rgb[ROW_B][COL_C], + (float)1.0 / params->rgamma, (float)1.0 / params->bgamma, (float)1.0 / params->bgamma); + break; + case YUV_CONVERSION_FRAGMENT_LOOKUP: + snprintf(prog_pos, prog_remain, yuv_lookup_prog_template, + yuv2rgb[ROW_R][COL_Y], yuv2rgb[ROW_G][COL_Y], yuv2rgb[ROW_B][COL_Y], + yuv2rgb[ROW_R][COL_U], yuv2rgb[ROW_G][COL_U], yuv2rgb[ROW_B][COL_U], + yuv2rgb[ROW_R][COL_V], yuv2rgb[ROW_G][COL_V], yuv2rgb[ROW_B][COL_V], + yuv2rgb[ROW_R][COL_C], yuv2rgb[ROW_G][COL_C], yuv2rgb[ROW_B][COL_C], + conv_texs[0], conv_texs[0], conv_texs[0]); + break; + case YUV_CONVERSION_FRAGMENT_LOOKUP3D: + snprintf(prog_pos, prog_remain, yuv_lookup3d_prog_template, conv_texs[0]); + break; + default: + MSG_ERR("[gl] unknown conversion type %i\n", YUV_CONVERSION(type)); + break; + } + MSG_DBG2("[gl] generated fragment program:\n%s\n", yuv_prog); + loadGPUProgram(GL_FRAGMENT_PROGRAM, yuv_prog); + free(yuv_prog); +} + +/** + * \brief little helper function to create a lookup table for gamma + * \param map buffer to create map into + * \param size size of buffer + * \param gamma gamma value + */ +static void gen_gamma_map(unsigned char *map, int size, float gamma) { + int i; + if (gamma == 1.0) { + for (i = 0; i < size; i++) + map[i] = 255 * i / (size - 1); + return; + } + gamma = 1.0 / gamma; + for (i = 0; i < size; i++) { + float tmp = (float)i / (size - 1.0); + tmp = pow(tmp, gamma); + if (tmp > 1.0) tmp = 1.0; + if (tmp < 0.0) tmp = 0.0; + map[i] = 255 * tmp; + } +} + +/** + * \brief setup YUV->RGB conversion + * \param parms struct containing parameters like conversion and scaler type, + * brightness, ... + * \ingroup glconversion + */ +void glSetupYUVConversion(gl_conversion_params_t *params) { + float uvcos = params->saturation * cos(params->hue); + float uvsin = params->saturation * sin(params->hue); + switch (YUV_CONVERSION(params->type)) { + case YUV_CONVERSION_COMBINERS: + glSetupYUVCombiners(uvcos, uvsin); + break; + case YUV_CONVERSION_COMBINERS_ATI: + glSetupYUVCombinersATI(uvcos, uvsin); + break; + case YUV_CONVERSION_FRAGMENT_LOOKUP: + case YUV_CONVERSION_FRAGMENT_LOOKUP3D: + case YUV_CONVERSION_FRAGMENT: + case YUV_CONVERSION_FRAGMENT_POW: + glSetupYUVFragprog(params); + break; + default: + MSG_ERR("[gl] unknown conversion type %i\n", YUV_CONVERSION(params->type)); + } +} + +/** + * \brief enable the specified YUV conversion + * \param target texture target for Y, U and V textures (e.g. GL_TEXTURE_2D) + * \param type type of YUV conversion + * \ingroup glconversion + */ +void glEnableYUVConversion(GLenum target, int type) { + if (type <= 0) return; + switch (YUV_CONVERSION(type)) { + case YUV_CONVERSION_COMBINERS: + ActiveTexture(GL_TEXTURE1); + glEnable(target); + ActiveTexture(GL_TEXTURE2); + glEnable(target); + ActiveTexture(GL_TEXTURE0); + glEnable(GL_REGISTER_COMBINERS_NV); + break; + case YUV_CONVERSION_COMBINERS_ATI: + ActiveTexture(GL_TEXTURE1); + glEnable(target); + ActiveTexture(GL_TEXTURE2); + glEnable(target); + ActiveTexture(GL_TEXTURE0); + glEnable(GL_FRAGMENT_SHADER_ATI); + break; + case YUV_CONVERSION_FRAGMENT_LOOKUP3D: + case YUV_CONVERSION_FRAGMENT_LOOKUP: + case YUV_CONVERSION_FRAGMENT_POW: + case YUV_CONVERSION_FRAGMENT: + glEnable(GL_FRAGMENT_PROGRAM); + break; + } +} + +/** + * \brief disable the specified YUV conversion + * \param target texture target for Y, U and V textures (e.g. GL_TEXTURE_2D) + * \param type type of YUV conversion + * \ingroup glconversion + */ +void glDisableYUVConversion(GLenum target, int type) { + if (type <= 0) return; + switch (YUV_CONVERSION(type)) { + case YUV_CONVERSION_COMBINERS: + ActiveTexture(GL_TEXTURE1); + glDisable(target); + ActiveTexture(GL_TEXTURE2); + glDisable(target); + ActiveTexture(GL_TEXTURE0); + glDisable(GL_REGISTER_COMBINERS_NV); + break; + case YUV_CONVERSION_COMBINERS_ATI: + ActiveTexture(GL_TEXTURE1); + glDisable(target); + ActiveTexture(GL_TEXTURE2); + glDisable(target); + ActiveTexture(GL_TEXTURE0); + glDisable(GL_FRAGMENT_SHADER_ATI); + break; + case YUV_CONVERSION_FRAGMENT_LOOKUP3D: + case YUV_CONVERSION_FRAGMENT_LOOKUP: + case YUV_CONVERSION_FRAGMENT_POW: + case YUV_CONVERSION_FRAGMENT: + glDisable(GL_FRAGMENT_PROGRAM); + break; + } +} + +/** + * \brief draw a texture part at given 2D coordinates + * \param x screen top coordinate + * \param y screen left coordinate + * \param w screen width coordinate + * \param h screen height coordinate + * \param tx texture top coordinate in pixels + * \param ty texture left coordinate in pixels + * \param tw texture part width in pixels + * \param th texture part height in pixels + * \param sx width of texture in pixels + * \param sy height of texture in pixels + * \param rect_tex whether this texture uses texture_rectangle extension + * \param is_yv12 if set, also draw the textures from units 1 and 2 + * \param flip flip the texture upside down + * \ingroup gltexture + */ +void glDrawTex(GLfloat x, GLfloat y, GLfloat w, GLfloat h, + GLfloat tx, GLfloat ty, GLfloat tw, GLfloat th, + int sx, int sy, int rect_tex, int is_yv12, int flip) { + GLfloat tx2 = tx / 2, ty2 = ty / 2, tw2 = tw / 2, th2 = th / 2; + if (!rect_tex) { + tx /= sx; ty /= sy; tw /= sx; th /= sy; + tx2 = tx, ty2 = ty, tw2 = tw, th2 = th; + } + if (flip) { + y += h; + h = -h; + } + glBegin(GL_QUADS); + glTexCoord2f(tx, ty); + if (is_yv12) { + MultiTexCoord2f(GL_TEXTURE1, tx2, ty2); + MultiTexCoord2f(GL_TEXTURE2, tx2, ty2); + } + glVertex2f(x, y); + glTexCoord2f(tx, ty + th); + if (is_yv12) { + MultiTexCoord2f(GL_TEXTURE1, tx2, ty2 + th2); + MultiTexCoord2f(GL_TEXTURE2, tx2, ty2 + th2); + } + glVertex2f(x, y + h); + glTexCoord2f(tx + tw, ty + th); + if (is_yv12) { + MultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2 + th2); + MultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2 + th2); + } + glVertex2f(x + w, y + h); + glTexCoord2f(tx + tw, ty); + if (is_yv12) { + MultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2); + MultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2); + } + glVertex2f(x + w, y); + glEnd(); +} + +#ifdef GL_WIN32 +#include "w32_common.h" +/** + * \brief little helper since wglGetProcAddress definition does not fit our + * getProcAddress + * \param procName name of function to look up + * \return function pointer returned by wglGetProcAddress + */ +static void *w32gpa(const GLubyte *procName) { + HMODULE oglmod; + void *res = wglGetProcAddress(procName); + if (res) return res; + oglmod = GetModuleHandle("opengl32.dll"); + return GetProcAddress(oglmod, procName); +} + +int setGlWindow(int *vinfo, HGLRC *context, HWND win) +{ + int new_vinfo; + HDC windc = vo_w32_get_dc(win); + HGLRC new_context = 0; + int keep_context = 0; + int res = SET_WINDOW_FAILED; + + // should only be needed when keeping context, but not doing glFinish + // can cause flickering even when we do not keep it. + if (*context) + glFinish(); + new_vinfo = GetPixelFormat(windc); + if (*context && *vinfo && new_vinfo && *vinfo == new_vinfo) { + // we can keep the wglContext + new_context = *context; + keep_context = 1; + } else { + // create a context + new_context = wglCreateContext(windc); + if (!new_context) { + MSG_FATAL("[gl] Could not create GL context!\n"); + goto out; + } + } + + // set context + if (!wglMakeCurrent(windc, new_context)) { + MSG_FATAL("[gl] Could not set GL context!\n"); + if (!keep_context) { + wglDeleteContext(new_context); + } + goto out; + } + + // set new values + vo_w32_window = win; + { + RECT rect; + GetClientRect(win, &rect); + vo_dwidth = rect.right; + vo_dheight = rect.bottom; + } + if (!keep_context) { + if (*context) + wglDeleteContext(*context); + *context = new_context; + *vinfo = new_vinfo; + getFunctions(w32gpa, NULL); + + // and inform that reinit is neccessary + res = SET_WINDOW_REINIT; + } else + res = SET_WINDOW_OK; + +out: + vo_w32_release_dc(win, windc); + return res; +} + +void releaseGlContext(int *vinfo, HGLRC *context) { + *vinfo = 0; + if (*context) { + wglMakeCurrent(0, 0); + wglDeleteContext(*context); + } + *context = 0; +} + +void swapGlBuffers(void) { + HDC vo_hdc = vo_w32_get_dc(vo_w32_window); + SwapBuffers(vo_hdc); + vo_w32_release_dc(vo_w32_window, vo_hdc); +} +#else +#ifdef HAVE_LIBDL +#include <dlfcn.h> +#endif +#include "x11_common.h" +/** + * \brief find address of a linked function + * \param s name of function to find + * \return address of function or NULL if not found + */ +static void *getdladdr(const char *s) { + void *ret = NULL; +#ifdef HAVE_LIBDL + void *handle = dlopen(NULL, RTLD_LAZY); + if (!handle) + return NULL; + ret = dlsym(handle, s); + dlclose(handle); +#endif + return ret; +} + +/** + * \brief Returns the XVisualInfo associated with Window win. + * \param win Window whose XVisualInfo is returne. + * \return XVisualInfo of the window. Caller must use XFree to free it. + */ +static XVisualInfo *getWindowVisualInfo(Window win) { + XWindowAttributes xw_attr; + XVisualInfo vinfo_template; + int tmp; + XGetWindowAttributes(mDisplay, win, &xw_attr); + vinfo_template.visualid = XVisualIDFromVisual(xw_attr.visual); + return XGetVisualInfo(mDisplay, VisualIDMask, &vinfo_template, &tmp); +} + +static void appendstr(char **dst, const char *str) +{ + int newsize; + char *newstr; + if (!str) + return; + newsize = strlen(*dst) + 1 + strlen(str) + 1; + newstr = realloc(*dst, newsize); + if (!newstr) + return; + *dst = newstr; + strcat(*dst, " "); + strcat(*dst, str); +} + +/** + * \brief Changes the window in which video is displayed. + * If possible only transfers the context to the new window, otherwise + * creates a new one, which must be initialized ... [truncated message content] |
From: <nic...@us...> - 2009-12-16 17:30:28
|
Revision: 44 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=44&view=rev Author: nickols_k Date: 2009-12-16 17:30:20 +0000 (Wed, 16 Dec 2009) Log Message: ----------- cppcheck: fixed some out-of-bounds and memory,resources leak Modified Paths: -------------- mplayerxp/libmpdemux/cookies.c mplayerxp/libmpdemux/demux_audio.c mplayerxp/libmpdemux/demux_film.c mplayerxp/libmpdemux/demux_fli.c mplayerxp/libmpdemux/http.c mplayerxp/libmpdemux/mux_lavf.c mplayerxp/libmpdemux/sub_ty.c mplayerxp/libvo/font_load.c mplayerxp/libvo/gl_common.c mplayerxp/libvo/vo_vdpau.c mplayerxp/m_option.c mplayerxp/playtree.c mplayerxp/postproc/af.c mplayerxp/subreader.c mplayerxp/vobsub.c Modified: mplayerxp/libmpdemux/cookies.c =================================================================== --- mplayerxp/libmpdemux/cookies.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libmpdemux/cookies.c 2009-12-16 17:30:20 UTC (rev 44) @@ -109,11 +109,13 @@ if (*length < 0) { MSG_V("Could not find EOF"); + close(fd); return NULL; } if (*length > SIZE_MAX - 1) { MSG_V("File too big, could not malloc."); + close(fd); return NULL; } @@ -121,11 +123,14 @@ if (!(buffer = malloc(*length + 1))) { MSG_V("Could not malloc."); + close(fd); return NULL; } if (read(fd, buffer, *length) != *length) { + free(buffer); MSG_V("Read is behaving funny."); + close(fd); return NULL; } close(fd); Modified: mplayerxp/libmpdemux/demux_audio.c =================================================================== --- mplayerxp/libmpdemux/demux_audio.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libmpdemux/demux_audio.c 2009-12-16 17:30:20 UTC (rev 44) @@ -958,7 +958,7 @@ else { int fmt; - char b[12]; + char b[21]; MSG_DBG2("initial mp3_header: 0x%08X at %lu\n",*(uint32_t *)hdr,st_pos); if((n = mp_decode_mp3_header(hdr,&fmt,&mp3_brate,&mp3_samplerate,&mp3_channels)) > 0) { Modified: mplayerxp/libmpdemux/demux_film.c =================================================================== --- mplayerxp/libmpdemux/demux_film.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libmpdemux/demux_film.c 2009-12-16 17:30:20 UTC (rev 44) @@ -225,6 +225,7 @@ if (chunk_type != CHUNK_FILM) { MSG_ERR( "Not a FILM file\n"); + free(film_data); return NULL; } Modified: mplayerxp/libmpdemux/demux_fli.c =================================================================== --- mplayerxp/libmpdemux/demux_fli.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libmpdemux/demux_fli.c 2009-12-16 17:30:20 UTC (rev 44) @@ -94,12 +94,14 @@ demuxer->movi_end = stream_read_dword_le(demuxer->stream); magic_number = stream_read_word_le(demuxer->stream); - + if ((magic_number != 0xAF11) && (magic_number != 0xAF12)) { MSG_ERR("Bad/unknown magic number (%04x)\n", magic_number); - return(NULL); + free(header); + free(frames); + return(NULL); } // fetch the number of frames Modified: mplayerxp/libmpdemux/http.c =================================================================== --- mplayerxp/libmpdemux/http.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libmpdemux/http.c 2009-12-16 17:30:20 UTC (rev 44) @@ -288,6 +288,7 @@ new_field->field_name = (char*)malloc(strlen(field_name)+1); if( new_field->field_name==NULL ) { MSG_FATAL("Memory allocation failed\n"); + free(new_field); return; } strcpy( new_field->field_name, field_name ); Modified: mplayerxp/libmpdemux/mux_lavf.c =================================================================== --- mplayerxp/libmpdemux/mux_lavf.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libmpdemux/mux_lavf.c 2009-12-16 17:30:20 UTC (rev 44) @@ -429,6 +429,7 @@ if(!load_dll(codec_name("libavformat"SLIBSUFFIX))) /* try local copy first */ { MSG_ERR("Detected error during loading libavformat.so! Try to upgrade this library\n"); + free(priv); return 0; } av_register_all(); Modified: mplayerxp/libmpdemux/sub_ty.c =================================================================== --- mplayerxp/libmpdemux/sub_ty.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libmpdemux/sub_ty.c 2009-12-16 17:30:20 UTC (rev 44) @@ -590,7 +590,7 @@ { char line[ 80 ]; - if ( b1 < 0x0F ) + if ( b1 < 0x0F ) { // start packet TY_XDS_length = 0; TY_XDS_mode = b1 >> 1; // every other mode is a resume @@ -600,7 +600,7 @@ } TY_XDS_checksum += b1 + b2; - + // eof (next byte is checksum) if ( b1 == 0x0F ) { @@ -609,10 +609,10 @@ { if ( TY_OSD_debug > 3 && !TY_XDS_length ) { - MSG_DBG3( + MSG_DBG3( "%% TY_XDS CHECKSUM ERROR (ignoring)\n" ); - } - else + } + else { TY_XDS_mode = 0; TY_XDS_type = 0; @@ -655,14 +655,14 @@ case 0x0301: // future { char *mon[] = - { + { "0", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "13", "14", "15" }; ty_AddXDSToDisplay( "AIR DATE: %s %2d %d:%02d:00", mon[ TY_XDS_ptr[ 3 ] & 0x0f ], TY_XDS_ptr[ 2 ] & 0x1f, - TY_XDS_ptr[ 1 ] & 0x1f, + TY_XDS_ptr[ 1 ] & 0x1f, TY_XDS_ptr[ 0 ] & 0x3f ); @@ -713,19 +713,19 @@ sprintf( line, "%sRATING: %s", line, TY_XDS_CHIP[ ( TY_XDS_ptr[ 0 ] & 0x08 ) >> 3 ] [ TY_XDS_ptr[ 1 ] & 0x07 ] ); - if ( TY_XDS_ptr[ 0 ] & 0x20 ) + if ( TY_XDS_ptr[ 0 ] & 0x20 ) sprintf( line, "%s DIALOGUE", line ); - if ( TY_XDS_ptr[ 1 ] & 0x08 ) + if ( TY_XDS_ptr[ 1 ] & 0x08 ) sprintf( line, "%s LANGUAGE", line ); - if ( TY_XDS_ptr[ 1 ] & 0x10 ) + if ( TY_XDS_ptr[ 1 ] & 0x10 ) sprintf( line, "%s SEXUAL", line ); - if ( TY_XDS_ptr[ 1 ] & 0x20 ) + if ( TY_XDS_ptr[ 1 ] & 0x20 ) sprintf( line, "%s VIOLENCE", line ); ty_AddXDSToDisplay( line ); // raw output for verification. if ( TY_OSD_debug > 1 ) - MSG_DBG3( " (%02x %02x)", + MSG_DBG3( " (%02x %02x)", TY_XDS_ptr[ 0 ], TY_XDS_ptr[ 1 ] ); break; } @@ -734,7 +734,7 @@ case 0x0306: // future { // requires table, never actually seen it used either - ty_AddXDSToDisplay( "AUDIO: %02x %02x", TY_XDS_ptr[ 0 ], + ty_AddXDSToDisplay( "AUDIO: %02x %02x", TY_XDS_ptr[ 0 ], TY_XDS_ptr[ 1 ] ); break; } @@ -743,7 +743,7 @@ case 0x0309: // future { // requires table, rare - ty_AddXDSToDisplay( "ASPECT: %02x %02x", + ty_AddXDSToDisplay( "ASPECT: %02x %02x", TY_XDS_ptr[ 0 ], TY_XDS_ptr[ 1 ] ); break; } @@ -763,13 +763,13 @@ case 0x0501: // channel network name { - ty_AddXDSToDisplay( "NETWORK: %s", TY_XDS_ptr ); + ty_AddXDSToDisplay( "NETWORK: %s", TY_XDS_ptr ); break; } case 0x0502: // channel network call letters { - ty_AddXDSToDisplay( "CALLSIGN: %s", TY_XDS_ptr ); + ty_AddXDSToDisplay( "CALLSIGN: %s", TY_XDS_ptr ); break; } @@ -792,11 +792,11 @@ time_t time_t = mktime( &tm ); char *timestr; - + time_t -= ( ( TIMEZONE - DST ) * 60 * 60 ); timestr = ctime( &time_t ); timestr[ strlen( timestr ) - 1 ] = 0; - + sprintf( line, "%sCUR.TIME: %s ", line, timestr ); if ( TY_XDS[ 3 ][ 4 ][ 0 ] ) { @@ -813,7 +813,7 @@ case 0x0704: //misc. local time zone { - sprintf( line, "%sTIMEZONE: UTC-%d", + sprintf( line, "%sTIMEZONE: UTC-%d", line, TY_XDS_ptr[ 0 ] & 0x1f ); if ( TY_XDS_ptr[ 0 ] & 0x20 ) sprintf( line, "%s DST", line ); ty_AddXDSToDisplay( line ); @@ -822,26 +822,26 @@ default: { - MSG_DBG3( "UNKNOWN CLASS %d TYPE %d", + MSG_DBG3( "UNKNOWN CLASS %d TYPE %d", ( TY_XDS_mode << 1 ) + 1, TY_XDS_type ); - if ( TY_OSD_debug > 1 ) + if ( TY_OSD_debug > 1 ) { int x; MSG_DBG3( "\nDUMP:\n" ); for ( x = 0 ; x < TY_XDS_length ; x++ ) - MSG_DBG3( " %02x %c", + MSG_DBG3( " %02x %c", TY_XDS_ptr[ x ], TY_XDS_ptr[ x ] ); MSG_DBG3( "\n" ); - } + } } } - if ( TY_OSD_debug > 1 ) + if ( TY_OSD_debug > 1 ) MSG_DBG3( " (%d)", TY_XDS_length ); } TY_XDS_mode = 0; TY_XDS_type = 0; } - else if ( TY_XDS_length < 34 ) + else if ( TY_XDS_length < 34 ) { TY_XDS_new[ TY_XDS_mode ][ TY_XDS_type ][ TY_XDS_length++ ] = b1; TY_XDS_new[ TY_XDS_mode ][ TY_XDS_type ][ TY_XDS_length++ ] = b2; @@ -895,7 +895,7 @@ // printf( "OSD:%d:%s\n", index, ty_OSD1.text[ index ] ); // } vo_sub = &ty_OSD1; - vo_osd_changed( OSDTYPE_SUBTITLE ); + vo_osd_changed( OSDTYPE_SUBTITLE ); tyOSDUpdate = 0; } } Modified: mplayerxp/libvo/font_load.c =================================================================== --- mplayerxp/libvo/font_load.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libvo/font_load.c 2009-12-16 17:30:20 UTC (rev 44) @@ -16,15 +16,15 @@ raw_file* raw=malloc(sizeof(raw_file)); unsigned char head[32]; FILE *f=fopen(name,"rb"); - if(!f) return NULL; // can't open - if(fread(head,32,1,f)<1) return NULL; // too small - if(memcmp(head,"mhwanh",6)) return NULL; // not raw file + if(!f) { free(raw); return NULL; } // can't open + if(fread(head,32,1,f)<1) { free(raw); fclose(f); return NULL; } // too small + if(memcmp(head,"mhwanh",6)) { free(raw); fclose(f); return NULL; } // not raw file raw->w=head[8]*256+head[9]; raw->h=head[10]*256+head[11]; raw->c=head[12]*256+head[13]; if(raw->w == 0) /* 2 bytes were not enough for the width... read 4 bytes from the end of the header */ raw->w = ((head[28]*0x100 + head[29])*0x100 + head[30])*0x100 + head[31]; - if(raw->c>256) return NULL; // too many colors!? + if(raw->c>256) { free(raw); fclose(f); return NULL; } // too many colors!? MSG_V("RAW: %s %d x %d, %d colors\n",name,raw->w,raw->h,raw->c); if(raw->c){ raw->pal=malloc(raw->c*3); @@ -55,7 +55,7 @@ desc=malloc(sizeof(font_desc_t));if(!desc) return NULL; memset(desc,0,sizeof(font_desc_t)); -f=fopen(fname,"rt");if(!f){ MSG_ERR("font: can't open file: %s\n",fname); return NULL;} +f=fopen(fname,"rt");if(!f){ MSG_ERR("font: can't open file: %s\n",fname); free(desc); return NULL;} i = strlen (fname) - 9; if ((dn = malloc(i+1))){ Modified: mplayerxp/libvo/gl_common.c =================================================================== --- mplayerxp/libvo/gl_common.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libvo/gl_common.c 2009-12-16 17:30:20 UTC (rev 44) @@ -452,8 +452,10 @@ return 0; bpp = (m > 255) ? 6 : 3; data = malloc(w * h * bpp); - if (fread(data, w * bpp, h, f) != h) + if (fread(data, w * bpp, h, f) != h) { + free(data); return 0; + } if (!fmt) { fmt = (m > 255) ? hqtexfmt : 3; if (fmt == GL_FLOAT_RGB32_NV && target != GL_TEXTURE_RECTANGLE) Modified: mplayerxp/libvo/vo_vdpau.c =================================================================== --- mplayerxp/libvo/vo_vdpau.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/libvo/vo_vdpau.c 2009-12-16 17:30:20 UTC (rev 44) @@ -146,7 +146,7 @@ #define osd_surface output_surfaces[NUM_OUTPUT_SURFACES] static VdpOutputSurface output_surfaces[NUM_OUTPUT_SURFACES + 1]; static VdpVideoSurface deint_surfaces[3]; -static mp_image_t *deint_mpi[2]; +static mp_image_t *deint_mpi[3]; static uint32_t output_surface_width, output_surface_height; static VdpVideoMixer video_mixer; Modified: mplayerxp/m_option.c =================================================================== --- mplayerxp/m_option.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/m_option.c 2009-12-16 17:30:20 UTC (rev 44) @@ -1470,11 +1470,12 @@ m_obj_params_t* p = opt->priv; const m_struct_t* desc; char* cpy = strdup(param); - + // We need the object desc - if(!p) + if(!p) { + free(cpy); return M_OPT_INVALID; - + } desc = p->desc; r = get_obj_params(name,desc->name,cpy,desc,p->separator,dst ? &opts : NULL); free(cpy); Modified: mplayerxp/playtree.c =================================================================== --- mplayerxp/playtree.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/playtree.c 2009-12-16 17:30:20 UTC (rev 44) @@ -816,6 +816,7 @@ strncpy(s,entry,val-e); s[val-e] = '\0'; } + free(val); return playtree_ret_filename; } else { if(iter->config) Modified: mplayerxp/postproc/af.c =================================================================== --- mplayerxp/postproc/af.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/postproc/af.c 2009-12-16 17:30:20 UTC (rev 44) @@ -117,16 +117,17 @@ if(!_new){ MSG_ERR(MSGTR_OutOfMemory); return NULL; - } + } memset(_new,0,sizeof(af_instance_t)); _new->parent=s; // Check for commandline parameters strsep(&cmdline, "="); // Find filter from name - if(NULL == (_new->info=af_find(name))) + if(NULL == (_new->info=af_find(name))) { + free(_new); return NULL; - + } /* Make sure that the filter is not already in the list if it is non-reentrant */ if(_new->info->flags & AF_FLAGS_NOT_REENTRANT){ @@ -137,9 +138,9 @@ return NULL; } } - + MSG_V("[libaf] Adding filter %s \n",name); - + // Initialize the new filter if(AF_OK == _new->info->open(_new) && AF_ERROR < _new->control(_new,AF_CONTROL_POST_CREATE,&s->cfg)){ @@ -148,12 +149,11 @@ return _new; } else - return _new; + return _new; } - + free(_new); - MSG_ERR("[libaf] Couldn't create or open audio filter '%s'\n", - name); + MSG_ERR("[libaf] Couldn't create or open audio filter '%s'\n", name); return NULL; } Modified: mplayerxp/subreader.c =================================================================== --- mplayerxp/subreader.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/subreader.c 2009-12-16 17:30:20 UTC (rev 44) @@ -659,9 +659,9 @@ fd=fopen (filename, "r"); if (!fd) return NULL; sub_format=sub_autodetect (fd); - if (sub_format==SUB_INVALID) { MSG_ERR ("SUB: Could not determine file format\n");return NULL;} + if (sub_format==SUB_INVALID) { MSG_ERR ("SUB: Could not determine file format\n"); fclose(fd); return NULL;} MSG_INFO ("SUB: Detected subtitle file format: %s\n", fmtname[sub_format]); - + rewind (fd); #ifdef USE_ICONV @@ -670,8 +670,8 @@ sub_num=0;n_max=32; first=(subtitle *)malloc(n_max*sizeof(subtitle)); - if(!first) return NULL; - + if(!first) { fclose(fd); return NULL; } + while(1){ subtitle *sub; if(sub_num>=n_max){ @@ -749,11 +749,11 @@ if ( fname == NULL ) return NULL; - + sub_name1=strrchr(fname,'.'); if (!sub_name1) return NULL; pos=sub_name1-fname; - + sub_name1=malloc(strlen(fname)+8); strcpy(sub_name1,fname); @@ -762,17 +762,17 @@ sprintf (sub_name2, "%s%s", path, tmp+1); else sprintf (sub_name2, "%s%s", path, fname); - + aviptr1=strrchr(sub_name1,'.'); aviptr2=strrchr(sub_name2,'.'); - + for(j=0;j<=1;j++){ char* sub_name=j?sub_name1:sub_name2; #ifdef USE_ICONV for ( i=(sub_cp?2:0);i<(sizeof(sub_exts)/sizeof(char*));i++ ) { #else for ( i=0;i<(sizeof(sub_exts)/sizeof(char*));i++ ) { -#endif +#endif strcpy(j?aviptr1:aviptr2,sub_exts[i]); if((f=fopen( sub_name,"rt" ))) { fclose( f ); @@ -782,7 +782,8 @@ } } } - + free(sub_name1); + free(sub_name2); return NULL; } Modified: mplayerxp/vobsub.c =================================================================== --- mplayerxp/vobsub.c 2009-12-16 15:56:00 UTC (rev 43) +++ mplayerxp/vobsub.c 2009-12-16 17:30:20 UTC (rev 44) @@ -100,8 +100,10 @@ if (err) close(fd); } - if (err) + else { free(res); + close(fd); + } } return err ? NULL : res; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2009-12-17 17:49:51
|
Revision: 47 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=47&view=rev Author: nickols_k Date: 2009-12-17 17:49:43 +0000 (Thu, 17 Dec 2009) Log Message: ----------- simplify configure scripts and increase static linkage Modified Paths: -------------- DOCS/configure codecs/Makefile codecs/configure configure etc/configure functions loader/configure mplayerxp/Makefile mplayerxp/configure mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/vd_nuv.c mplayerxp/libmpdemux/demux_mkv.c mplayerxp/libmpdemux/nuppelvideo.h Added Paths: ----------- mplayerxp/libmpcodecs/libnuppelvideo/ mplayerxp/libmpcodecs/libnuppelvideo/Makefile mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.c mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.h mplayerxp/libmpcodecs/libnuppelvideo/lzoconf.h mplayerxp/libmpcodecs/libnuppelvideo/minilzo.c mplayerxp/libmpcodecs/libnuppelvideo/minilzo.h mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.c mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.h Removed Paths: ------------- codecs/RTjpegN.c codecs/RTjpegN.h codecs/lzoconf.h codecs/minilzo.c codecs/minilzo.h codecs/nuppelvideo.c codecs/nuppelvideo.h Modified: DOCS/configure =================================================================== --- DOCS/configure 2009-12-16 17:46:25 UTC (rev 46) +++ DOCS/configure 2009-12-17 17:49:43 UTC (rev 47) @@ -42,41 +42,41 @@ TMPO="$I/mplayerxp-conf-$RANDOM-$$.o" TMPS="$I/mplayerxp-conf-$RANDOM-$$.S" -_prefix="/usr/local" -_psuffix= +prefix="/usr/local" +psuffix= for ac_option do case "$ac_option" in --prefix=*) - _prefix=`echo $ac_option | cut -d '=' -f 2` + prefix=`echo $ac_option | cut -d '=' -f 2` ;; --datadir=*) - _datadir=`echo $ac_option | cut -d '=' -f 2` + datadir=`echo $ac_option | cut -d '=' -f 2` ;; --confdir=*) - _confdir=`echo $ac_option | cut -d '=' -f 2` + confdir=`echo $ac_option | cut -d '=' -f 2` ;; --program-suffix=*) - _psuffix=`echo $ac_option | cut -d '=' -f 2` + psuffix=`echo $ac_option | cut -d '=' -f 2` ;; *) ;; esac done -_prog_alias="mplayerxp$_psuffix" +prog_alias="mplayerxp$psuffix" # Atmos: moved this here, to be correct, if --prefix is specified -test -z "$_datadir" && _datadir="$_prefix/share/$_prog_alias" -test -z "$_confdir" && _confdir="$_datadir" +test -z "$_datadir" && datadir="$prefix/share/$prog_alias" +test -z "$_confdir" && confdir="$datadir" ############################################################################# echo "Creating config.mak" cat > config.mak << EOF # -------- Generated by configure ----------- -PROGNAME = $_prog_alias -prefix = $_prefix -DATADIR = $_datadir -CONFDIR = $_confdir +PROGNAME = $prog_alias +prefix = $prefix +DATADIR = $datadir +CONFDIR = $confdir DESTDIR = $DESTDIR EOF Modified: codecs/Makefile =================================================================== --- codecs/Makefile 2009-12-16 17:46:25 UTC (rev 46) +++ codecs/Makefile 2009-12-17 17:49:43 UTC (rev 47) @@ -8,11 +8,6 @@ INSTALL = install DO_MAKE = @ for i in $(SUBDIRS); do SUBDIR=$@ && $(MAKE) -C $$i $@ || exit; done -LIB_NUPPELVIDEO=libnuppelvideo$(SLIBSUF) -SRC_NUPPELVIDEO=nuppelvideo.c RTjpegN.c minilzo.c -OBJ_NUPPELVIDEO=$(SRC_NUPPELVIDEO:.c=.o) -# just for: make dep -SRCS=$(SRC_NUPPELVIDEO) CFLAGS = $(MLIB_INC) $(OPTFLAGS) ifneq ($(TARGET_ARCH_X86),yes) @@ -21,7 +16,7 @@ .SUFFIXES: .c .o -all: $(SUBDIRS) $(LIB_NUPPELVIDEO) +all: $(SUBDIRS) .PHONY: subdirs $(SUBDIRS) @@ -31,8 +26,6 @@ export SUBDIR=ffmpeg liba52 libdca libmpeg2 mp3lib $(MAKE) -C $@ -$(LIB_NUPPELVIDEO): $(OBJ_NUPPELVIDEO) - $(CC) --shared $(LDFLAGS) -o $@ $(OBJ_NUPPELVIDEO) -lc .c.o: $(CC) -c $(CFLAGS) -o $@ $< @@ -40,7 +33,6 @@ install: rm -f $(DESTDIR)$(BINDIR)/*$(SLIBSUF) $(DO_MAKE) - $(INSTALL) -m 755 -s -p *$(DESTDIR)$(SLIBSUF) $(BINDIR) clean: rm -f *.o *$(SLIBSUF) @@ -59,7 +51,7 @@ dep: depend depend: - $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend + $(DO_MAKE) # # include dependency files if they exist Deleted: codecs/RTjpegN.c =================================================================== --- codecs/RTjpegN.c 2009-12-16 17:46:25 UTC (rev 46) +++ codecs/RTjpegN.c 2009-12-17 17:49:43 UTC (rev 47) @@ -1,3796 +0,0 @@ -/* - RTjpeg (C) Justin Schoeman 1998 (ju...@su...) - - With modifications by: - (c) 1998, 1999 by Joerg Walter <tr...@mo...> - and - (c) 1999 by Wim Taymans <wim...@tv...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "config.h" -#include "RTjpegN.h" - -#ifdef CAN_COMPILE_MMX -#include "mmx.h" -#endif - -//#define SHOWBLOCK 1 -#define BETTERCOMPRESSION 1 - -static const unsigned char RTjpeg_ZZ[64]={ -0, -8, 1, -2, 9, 16, -24, 17, 10, 3, -4, 11, 18, 25, 32, -40, 33, 26, 19, 12, 5, -6, 13, 20, 27, 34, 41, 48, -56, 49, 42, 35, 28, 21, 14, 7, -15, 22, 29, 36, 43, 50, 57, -58, 51, 44, 37, 30, 23, -31, 38, 45, 52, 59, -60, 53, 46, 39, -47, 54, 61, -62, 55, -63 }; - -static const __u64 RTjpeg_aan_tab[64]={ -4294967296ULL, 5957222912ULL, 5611718144ULL, 5050464768ULL, 4294967296ULL, 3374581504ULL, 2324432128ULL, 1184891264ULL, -5957222912ULL, 8263040512ULL, 7783580160ULL, 7005009920ULL, 5957222912ULL, 4680582144ULL, 3224107520ULL, 1643641088ULL, -5611718144ULL, 7783580160ULL, 7331904512ULL, 6598688768ULL, 5611718144ULL, 4408998912ULL, 3036936960ULL, 1548224000ULL, -5050464768ULL, 7005009920ULL, 6598688768ULL, 5938608128ULL, 5050464768ULL, 3968072960ULL, 2733115392ULL, 1393296000ULL, -4294967296ULL, 5957222912ULL, 5611718144ULL, 5050464768ULL, 4294967296ULL, 3374581504ULL, 2324432128ULL, 1184891264ULL, -3374581504ULL, 4680582144ULL, 4408998912ULL, 3968072960ULL, 3374581504ULL, 2651326208ULL, 1826357504ULL, 931136000ULL, -2324432128ULL, 3224107520ULL, 3036936960ULL, 2733115392ULL, 2324432128ULL, 1826357504ULL, 1258030336ULL, 641204288ULL, -1184891264ULL, 1643641088ULL, 1548224000ULL, 1393296000ULL, 1184891264ULL, 931136000ULL, 641204288ULL, 326894240ULL, -}; - -#ifndef MMX -static __s32 RTjpeg_ws[64+31]; -#endif -__u8 RTjpeg_alldata[2*64+4*64+4*64+4*64+4*64+32]; - -static __s16 *block; // rh -static __s16 *RTjpeg_block; -static __s32 *RTjpeg_lqt; -static __s32 *RTjpeg_cqt; -static __u32 *RTjpeg_liqt; -static __u32 *RTjpeg_ciqt; - -static unsigned char RTjpeg_lb8; -static unsigned char RTjpeg_cb8; -static int RTjpeg_width, RTjpeg_height; -static int RTjpeg_Ywidth, RTjpeg_Cwidth; -static int RTjpeg_Ysize, RTjpeg_Csize; - -static __s16 *RTjpeg_old=NULL; - -#ifdef MMX -mmx_t RTjpeg_lmask; -mmx_t RTjpeg_cmask; -#else -__u16 RTjpeg_lmask; -__u16 RTjpeg_cmask; -#endif -int RTjpeg_mtest=0; - -static const unsigned char RTjpeg_lum_quant_tbl[64] = { - 16, 11, 10, 16, 24, 40, 51, 61, - 12, 12, 14, 19, 26, 58, 60, 55, - 14, 13, 16, 24, 40, 57, 69, 56, - 14, 17, 22, 29, 51, 87, 80, 62, - 18, 22, 37, 56, 68, 109, 103, 77, - 24, 35, 55, 64, 81, 104, 113, 92, - 49, 64, 78, 87, 103, 121, 120, 101, - 72, 92, 95, 98, 112, 100, 103, 99 - }; - -static const unsigned char RTjpeg_chrom_quant_tbl[64] = { - 17, 18, 24, 47, 99, 99, 99, 99, - 18, 21, 26, 66, 99, 99, 99, 99, - 24, 26, 56, 99, 99, 99, 99, 99, - 47, 66, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99 - }; - -#ifdef BETTERCOMPRESSION - -/*--------------------------------------------------*/ -/* better encoding, but needs a lot more cpu time */ -/* seems to be more effective than old method +lzo */ -/* with this encoding lzo isn't efficient anymore */ -/* there is still more potential for better */ -/* encoding but that would need even more cputime */ -/* anyway your mileage may vary */ -/* */ -/* written by Martin BIELY and Roman HOCHLEITNER */ -/*--------------------------------------------------*/ - -/* +++++++++++++++++++++++++++++++++++++++++++++++++++*/ -/* Block to Stream (encoding) */ -/* */ - -int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) -{ - register int ci, co=1; - register __s16 ZZvalue; - register unsigned char bitten; - register unsigned char bitoff; - -#ifdef SHOWBLOCK - - int ii; - for (ii=0; ii < 64; ii++) { - fprintf(stdout, "%d ", data[RTjpeg_ZZ[ii]]); - } - fprintf(stdout, "\n\n"); - -#endif - -// *strm++ = 0x10; -// *strm = 0x00; -// -// return 2; - - // first byte allways written - strm[0]= - (__u8)(data[RTjpeg_ZZ[0]]>254) ? 254:((data[RTjpeg_ZZ[0]]<0)?0:data[RTjpeg_ZZ[0]]); - - - ci=63; - while (data[RTjpeg_ZZ[ci]]==0 && ci>0) ci--; - - bitten = ((unsigned char)ci) << 2; - - if (ci==0) { - strm[1]= bitten; - co = 2; - return (int)co; - } - - /* bitoff=0 because the high 6bit contain first non zero position */ - bitoff = 0; - co = 1; - - for(; ci>0; ci--) { - - ZZvalue = data[RTjpeg_ZZ[ci]]; - - switch(ZZvalue) { - case 0: - break; - case 1: - bitten |= (0x01<<bitoff); - break; - case -1: - bitten |= (0x03<<bitoff); - break; - default: - bitten |= (0x02<<bitoff); - goto HERZWEH; - break; - } - - if( bitoff == 0 ) { - strm[co]= bitten; - bitten = 0; - bitoff = 8; - co++; - } /* "fall through" */ - bitoff-=2; - - } - - /* ci must be 0 */ - if(bitoff != 6) { - - strm[co]= bitten; - co++; - - } - goto BAUCHWEH; - -HERZWEH: -/* ci cannot be 0 */ -/* correct bitoff to nibble boundaries */ - - switch(bitoff){ - case 4: - case 6: - bitoff = 0; - break; - case 2: - case 0: - strm[co]= bitten; - bitoff = 4; - co++; - bitten = 0; // clear half nibble values in bitten - break; - default: - break; - } - - for(; ci>0; ci--) { - - ZZvalue = data[RTjpeg_ZZ[ci]]; - - if( (ZZvalue > 7) || (ZZvalue < -7) ) { - bitten |= (0x08<<bitoff); - goto HIRNWEH; - } - - bitten |= (ZZvalue&0xf)<<bitoff; - - if( bitoff == 0 ) { - strm[co]= bitten; - bitten = 0; - bitoff = 8; - co++; - } /* "fall thru" */ - bitoff-=4; - } - - /* ci must be 0 */ - if( bitoff == 0 ) { - strm[co]= bitten; - co++; - } - goto BAUCHWEH; - -HIRNWEH: - - strm[co]= bitten; - co++; - - - /* bitting is over now we bite */ - for(; ci>0; ci--) { - - ZZvalue = data[RTjpeg_ZZ[ci]]; - - if(ZZvalue>0) - { - strm[co++]=(__s8)(ZZvalue>127)?127:ZZvalue; - } - else - { - strm[co++]=(__s8)(ZZvalue<-128)?-128:ZZvalue; - } - - } - - -BAUCHWEH: - /* we gotoo much now we are ill */ -#ifdef SHOWBLOCK -{ -int i; -fprintf(stdout, "\nco = '%d'\n", co); - for (i=0; i < co+2; i++) { - fprintf(stdout, "%d ", strm[i]); - } -fprintf(stdout, "\n\n"); -} -#endif - - return (int)co; -} - -/* +++++++++++++++++++++++++++++++++++++++++++++++++++*/ -/* Stream to Block (decoding) */ -/* */ - -int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) -{ - int ci; - register int co; - register int i; - register unsigned char bitten; - register unsigned char bitoff; - - /* first byte always read */ - i=RTjpeg_ZZ[0]; - data[i]=((__u8)strm[0])*qtbl[i]; - - /* we start at the behind */ - - bitten = ((unsigned char)strm[1]) >> 2; - co = 63; - for(; co > bitten; co--) { - - data[RTjpeg_ZZ[co]] = 0; - - } - - if (co==0) { - ci = 2; - goto AUTOBAHN; - } - - /* we have to read the last 2 bits of the second byte */ - ci=1; - bitoff = 0; - - for(; co>0; co--) { - - bitten = ((unsigned char)strm[ci]) >> bitoff; - bitten &= 0x03; - - i=RTjpeg_ZZ[co]; - - switch( bitten ) { - case 0x03: - data[i]= -qtbl[i]; - break; - case 0x02: - goto FUSSWEG; - break; - case 0x01: - data[i]= qtbl[i]; - break; - case 0x00: - data[i]= 0; - break; - default: - break; - } - - if( bitoff == 0 ) { - bitoff = 8; - ci++; - } - bitoff -= 2; - } - /* co is 0 now */ - /* data is written properly */ - - /* if bitoff!=6 then ci is the index, but should be the byte count, so we increment by 1 */ - if (bitoff!=6) ci++; - - goto AUTOBAHN; - - -FUSSWEG: -/* correct bitoff to nibble */ - switch(bitoff){ - case 4: - case 6: - bitoff = 0; - break; - case 2: - case 0: - /* we have to read from the next byte */ - ci++; - bitoff = 4; - break; - default: - break; - } - - for(; co>0; co--) { - - bitten = ((unsigned char)strm[ci]) >> bitoff; - bitten &= 0x0f; - - i=RTjpeg_ZZ[co]; - - if( bitten == 0x08 ) { - goto STRASSE; - } - - /* the compiler cannot do sign extension for signed nibbles */ - if( bitten & 0x08 ) { - bitten |= 0xf0; - } - /* the unsigned char bitten now is a valid signed char */ - - data[i]=((signed char)bitten)*qtbl[i]; - - if( bitoff == 0 ) { - bitoff = 8; - ci++; - } - bitoff -= 4; - } - /* co is 0 */ - - /* if bitoff!=4 then ci is the index, but should be the byte count, so we increment by 1 */ - if (bitoff!=4) ci++; - - goto AUTOBAHN; - -STRASSE: - ci++; - - for(; co>0; co--) { - i=RTjpeg_ZZ[co]; - data[i]=strm[ci++]*qtbl[i]; - } - - /* ci now is the count, because it points to next element => no incrementing */ - -AUTOBAHN: - -#ifdef SHOWBLOCK -fprintf(stdout, "\nci = '%d'\n", ci); - for (i=0; i < 64; i++) { - fprintf(stdout, "%d ", data[RTjpeg_ZZ[i]]); - } -fprintf(stdout, "\n\n"); -#endif - - return ci; -} - -#else - -int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) -{ - register int ci, co=1, tmp; - register __s16 ZZvalue; - -#ifdef SHOWBLOCK - - int ii; - for (ii=0; ii < 64; ii++) { - fprintf(stdout, "%d ", data[RTjpeg_ZZ[ii]]); - } - fprintf(stdout, "\n\n"); - -#endif - - (__u8)strm[0]=(__u8)(data[RTjpeg_ZZ[0]]>254) ? 254:((data[RTjpeg_ZZ[0]]<0)?0:data[RTjpeg_ZZ[0]]); - - for(ci=1; ci<=bt8; ci++) - { - ZZvalue = data[RTjpeg_ZZ[ci]]; - - if(ZZvalue>0) - { - strm[co++]=(__s8)(ZZvalue>127)?127:ZZvalue; - } - else - { - strm[co++]=(__s8)(ZZvalue<-128)?-128:ZZvalue; - } - } - - for(; ci<64; ci++) - { - ZZvalue = data[RTjpeg_ZZ[ci]]; - - if(ZZvalue>0) - { - strm[co++]=(__s8)(ZZvalue>63)?63:ZZvalue; - } - else if(ZZvalue<0) - { - strm[co++]=(__s8)(ZZvalue<-64)?-64:ZZvalue; - } - else /* compress zeros */ - { - tmp=ci; - do - { - ci++; - } - while((ci<64)&&(data[RTjpeg_ZZ[ci]]==0)); - - strm[co++]=(__s8)(63+(ci-tmp)); - ci--; - } - } - return (int)co; -} - -int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) -{ - int ci=1, co=1, tmp; - register int i; - - i=RTjpeg_ZZ[0]; - data[i]=((__u8)strm[0])*qtbl[i]; - - for(co=1; co<=bt8; co++) - { - i=RTjpeg_ZZ[co]; - data[i]=strm[ci++]*qtbl[i]; - } - - for(; co<64; co++) - { - if(strm[ci]>63) - { - tmp=co+strm[ci]-63; - for(; co<tmp; co++)data[RTjpeg_ZZ[co]]=0; - co--; - } else - { - i=RTjpeg_ZZ[co]; - data[i]=strm[ci]*qtbl[i]; - } - ci++; - } - return (int)ci; -} -#endif - -#if defined(MMX) -void RTjpeg_quant_init(void) -{ - int i; - __s16 *qtbl; - - qtbl=(__s16 *)RTjpeg_lqt; - for(i=0; i<64; i++)qtbl[i]=(__s16)RTjpeg_lqt[i]; - - qtbl=(__s16 *)RTjpeg_cqt; - for(i=0; i<64; i++)qtbl[i]=(__s16)RTjpeg_cqt[i]; -} - -static mmx_t RTjpeg_ones=(mmx_t)(long long)0x0001000100010001LL; -static mmx_t RTjpeg_half=(mmx_t)(long long)0x7fff7fff7fff7fffLL; - -void RTjpeg_quant(__s16 *block, __s32 *qtbl) -{ - int i; - mmx_t *bl, *ql; - - ql=(mmx_t *)qtbl; - bl=(mmx_t *)block; - - movq_m2r(RTjpeg_ones, mm6); - movq_m2r(RTjpeg_half, mm7); - - for(i=16; i; i--) - { - movq_m2r(*(ql++), mm0); /* quant vals (4) */ - movq_m2r(*bl, mm2); /* block vals (4) */ - movq_r2r(mm0, mm1); - movq_r2r(mm2, mm3); - - punpcklwd_r2r(mm6, mm0); /* 1 qb 1 qa */ - punpckhwd_r2r(mm6, mm1); /* 1 qd 1 qc */ - - punpcklwd_r2r(mm7, mm2); /* 32767 bb 32767 ba */ - punpckhwd_r2r(mm7, mm3); /* 32767 bd 32767 bc */ - - pmaddwd_r2r(mm2, mm0); /* 32767+bb*qb 32767+ba*qa */ - pmaddwd_r2r(mm3, mm1); /* 32767+bd*qd 32767+bc*qc */ - - psrad_i2r(16, mm0); - psrad_i2r(16, mm1); - - packssdw_r2r(mm1, mm0); - - movq_r2m(mm0, *(bl++)); - - } -} -#else -void RTjpeg_quant_init(void) -{ -} - -void RTjpeg_quant(__s16 *block, __s32 *qtbl) -{ - int i; - - for(i=0; i<64; i++) - block[i]=(__s16)((block[i]*qtbl[i]+32767)>>16); -} -#endif - -/* - * Perform the forward DCT on one block of samples. - */ -#ifdef MMX -static mmx_t RTjpeg_C4 =(mmx_t)(long long)0x2D412D412D412D41LL; -static mmx_t RTjpeg_C6 =(mmx_t)(long long)0x187E187E187E187ELL; -static mmx_t RTjpeg_C2mC6=(mmx_t)(long long)0x22A322A322A322A3LL; -static mmx_t RTjpeg_C2pC6=(mmx_t)(long long)0x539F539F539F539FLL; -static mmx_t RTjpeg_zero =(mmx_t)(long long)0x0000000000000000LL; - -#else - -#define FIX_0_382683433 ((__s32) 98) /* FIX(0.382683433) */ -#define FIX_0_541196100 ((__s32) 139) /* FIX(0.541196100) */ -#define FIX_0_707106781 ((__s32) 181) /* FIX(0.707106781) */ -#define FIX_1_306562965 ((__s32) 334) /* FIX(1.306562965) */ - -#define DESCALE10(x) (__s16)( ((x)+128) >> 8) -#define DESCALE20(x) (__s16)(((x)+32768) >> 16) -#define D_MULTIPLY(var,const) ((__s32) ((var) * (const))) -#endif - -void RTjpeg_dct_init(void) -{ - int i; - - for(i=0; i<64; i++) - { - RTjpeg_lqt[i]=(((__u64)RTjpeg_lqt[i]<<32)/RTjpeg_aan_tab[i]); - RTjpeg_cqt[i]=(((__u64)RTjpeg_cqt[i]<<32)/RTjpeg_aan_tab[i]); - } -} - -void RTjpeg_dctY(__u8 *idata, __s16 *odata, int rskip) -{ -#ifndef MMX - __s32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - __s32 tmp10, tmp11, tmp12, tmp13; - __s32 z1, z2, z3, z4, z5, z11, z13; - __u8 *idataptr; - __s16 *odataptr; - __s32 *wsptr; - int ctr; - - idataptr = idata; - wsptr = RTjpeg_ws; - for (ctr = 7; ctr >= 0; ctr--) { - tmp0 = idataptr[0] + idataptr[7]; - tmp7 = idataptr[0] - idataptr[7]; - tmp1 = idataptr[1] + idataptr[6]; - tmp6 = idataptr[1] - idataptr[6]; - tmp2 = idataptr[2] + idataptr[5]; - tmp5 = idataptr[2] - idataptr[5]; - tmp3 = idataptr[3] + idataptr[4]; - tmp4 = idataptr[3] - idataptr[4]; - - tmp10 = (tmp0 + tmp3); /* phase 2 */ - tmp13 = tmp0 - tmp3; - tmp11 = (tmp1 + tmp2); - tmp12 = tmp1 - tmp2; - - wsptr[0] = (tmp10 + tmp11)<<8; /* phase 3 */ - wsptr[4] = (tmp10 - tmp11)<<8; - - z1 = D_MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ - wsptr[2] = (tmp13<<8) + z1; /* phase 5 */ - wsptr[6] = (tmp13<<8) - z1; - - tmp10 = tmp4 + tmp5; /* phase 2 */ - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - - z5 = D_MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ - z2 = D_MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ - z4 = D_MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ - z3 = D_MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ - - z11 = (tmp7<<8) + z3; /* phase 5 */ - z13 = (tmp7<<8) - z3; - - wsptr[5] = z13 + z2; /* phase 6 */ - wsptr[3] = z13 - z2; - wsptr[1] = z11 + z4; - wsptr[7] = z11 - z4; - - idataptr += rskip<<3; /* advance pointer to next row */ - wsptr += 8; - } - - wsptr = RTjpeg_ws; - odataptr=odata; - for (ctr = 7; ctr >= 0; ctr--) { - tmp0 = wsptr[0] + wsptr[56]; - tmp7 = wsptr[0] - wsptr[56]; - tmp1 = wsptr[8] + wsptr[48]; - tmp6 = wsptr[8] - wsptr[48]; - tmp2 = wsptr[16] + wsptr[40]; - tmp5 = wsptr[16] - wsptr[40]; - tmp3 = wsptr[24] + wsptr[32]; - tmp4 = wsptr[24] - wsptr[32]; - - tmp10 = tmp0 + tmp3; /* phase 2 */ - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - odataptr[0] = DESCALE10(tmp10 + tmp11); /* phase 3 */ - odataptr[32] = DESCALE10(tmp10 - tmp11); - - z1 = D_MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ - odataptr[16] = DESCALE20((tmp13<<8) + z1); /* phase 5 */ - odataptr[48] = DESCALE20((tmp13<<8) - z1); - - tmp10 = tmp4 + tmp5; /* phase 2 */ - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - - z5 = D_MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ - z2 = D_MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ - z4 = D_MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ - z3 = D_MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ - - z11 = (tmp7<<8) + z3; /* phase 5 */ - z13 = (tmp7<<8) - z3; - - odataptr[40] = DESCALE20(z13 + z2); /* phase 6 */ - odataptr[24] = DESCALE20(z13 - z2); - odataptr[8] = DESCALE20(z11 + z4); - odataptr[56] = DESCALE20(z11 - z4); - - odataptr++; /* advance pointer to next column */ - wsptr++; - } -#else - volatile mmx_t tmp6, tmp7; - register mmx_t *dataptr = (mmx_t *)odata; - mmx_t *idata2 = (mmx_t *)idata; - - // first copy the input 8 bit to the destination 16 bits - - movq_m2r(RTjpeg_zero, mm2); - - - movq_m2r(*idata2, mm0); - movq_r2r(mm0, mm1); - - punpcklbw_r2r(mm2, mm0); - movq_r2m(mm0, *(dataptr)); - - punpckhbw_r2r(mm2, mm1); - movq_r2m(mm1, *(dataptr+1)); - - idata2 += rskip; - - movq_m2r(*idata2, mm0); - movq_r2r(mm0, mm1); - - punpcklbw_r2r(mm2, mm0); - movq_r2m(mm0, *(dataptr+2)); - - punpckhbw_r2r(mm2, mm1); - movq_r2m(mm1, *(dataptr+3)); - - idata2 += rskip; - - movq_m2r(*idata2, mm0); - movq_r2r(mm0, mm1); - - punpcklbw_r2r(mm2, mm0); - movq_r2m(mm0, *(dataptr+4)); - - punpckhbw_r2r(mm2, mm1); - movq_r2m(mm1, *(dataptr+5)); - - idata2 += rskip; - - movq_m2r(*idata2, mm0); - movq_r2r(mm0, mm1); - - punpcklbw_r2r(mm2, mm0); - movq_r2m(mm0, *(dataptr+6)); - - punpckhbw_r2r(mm2, mm1); - movq_r2m(mm1, *(dataptr+7)); - - idata2 += rskip; - - movq_m2r(*idata2, mm0); - movq_r2r(mm0, mm1); - - punpcklbw_r2r(mm2, mm0); - movq_r2m(mm0, *(dataptr+8)); - - punpckhbw_r2r(mm2, mm1); - movq_r2m(mm1, *(dataptr+9)); - - idata2 += rskip; - - movq_m2r(*idata2, mm0); - movq_r2r(mm0, mm1); - - punpcklbw_r2r(mm2, mm0); - movq_r2m(mm0, *(dataptr+10)); - - punpckhbw_r2r(mm2, mm1); - movq_r2m(mm1, *(dataptr+11)); - - idata2 += rskip; - - movq_m2r(*idata2, mm0); - movq_r2r(mm0, mm1); - - punpcklbw_r2r(mm2, mm0); - movq_r2m(mm0, *(dataptr+12)); - - punpckhbw_r2r(mm2, mm1); - movq_r2m(mm1, *(dataptr+13)); - - idata2 += rskip; - - movq_m2r(*idata2, mm0); - movq_r2r(mm0, mm1); - - punpcklbw_r2r(mm2, mm0); - movq_r2m(mm0, *(dataptr+14)); - - punpckhbw_r2r(mm2, mm1); - movq_r2m(mm1, *(dataptr+15)); - -/* Start Transpose to do calculations on rows */ - - movq_m2r(*(dataptr+9), mm7); // m03:m02|m01:m00 - first line (line 4)and copy into m5 - - movq_m2r(*(dataptr+13), mm6); // m23:m22|m21:m20 - third line (line 6)and copy into m2 - movq_r2r(mm7, mm5); - - punpcklwd_m2r(*(dataptr+11), mm7); // m11:m01|m10:m00 - interleave first and second lines - movq_r2r(mm6, mm2); - - punpcklwd_m2r(*(dataptr+15), mm6); // m31:m21|m30:m20 - interleave third and fourth lines - movq_r2r(mm7, mm1); - - movq_m2r(*(dataptr+11), mm3); // m13:m13|m11:m10 - second line - punpckldq_r2r(mm6, mm7); // m30:m20|m10:m00 - interleave to produce result 1 - - movq_m2r(*(dataptr+15), mm0); // m13:m13|m11:m10 - fourth line - punpckhdq_r2r(mm6, mm1); // m31:m21|m11:m01 - interleave to produce result 2 - - movq_r2m(mm7,*(dataptr+9)); // write result 1 - punpckhwd_r2r(mm3, mm5); // m13:m03|m12:m02 - interleave first and second lines - - movq_r2m(mm1,*(dataptr+11)); // write result 2 - punpckhwd_r2r(mm0, mm2); // m33:m23|m32:m22 - interleave third and fourth lines - - movq_r2r(mm5, mm1); - punpckldq_r2r(mm2, mm5); // m32:m22|m12:m02 - interleave to produce result 3 - - movq_m2r(*(dataptr+1), mm0); // m03:m02|m01:m00 - first line, 4x4 - punpckhdq_r2r(mm2, mm1); // m33:m23|m13:m03 - interleave to produce result 4 - - movq_r2m(mm5,*(dataptr+13)); // write result 3 - - // last 4x4 done - - movq_r2m(mm1, *(dataptr+15)); // write result 4, last 4x4 - - movq_m2r(*(dataptr+5), mm2); // m23:m22|m21:m20 - third line - movq_r2r(mm0, mm6); - - punpcklwd_m2r(*(dataptr+3), mm0); // m11:m01|m10:m00 - interleave first and second lines - movq_r2r(mm2, mm7); - - punpcklwd_m2r(*(dataptr+7), mm2); // m31:m21|m30:m20 - interleave third and fourth lines - movq_r2r(mm0, mm4); - - // - movq_m2r(*(dataptr+8), mm1); // n03:n02|n01:n00 - first line - punpckldq_r2r(mm2, mm0); // m30:m20|m10:m00 - interleave to produce first result - - movq_m2r(*(dataptr+12), mm3); // n23:n22|n21:n20 - third line - punpckhdq_r2r(mm2, mm4); // m31:m21|m11:m01 - interleave to produce second result - - punpckhwd_m2r(*(dataptr+3), mm6); // m13:m03|m12:m02 - interleave first and second lines - movq_r2r(mm1, mm2); // copy first line - - punpckhwd_m2r(*(dataptr+7), mm7); // m33:m23|m32:m22 - interleave third and fourth lines - movq_r2r(mm6, mm5); // copy first intermediate result - - movq_r2m(mm0, *(dataptr+8)); // write result 1 - punpckhdq_r2r(mm7, mm5); // m33:m23|m13:m03 - produce third result - - punpcklwd_m2r(*(dataptr+10), mm1); // n11:n01|n10:n00 - interleave first and second lines - movq_r2r(mm3, mm0); // copy third line - - punpckhwd_m2r(*(dataptr+10), mm2); // n13:n03|n12:n02 - interleave first and second lines - - movq_r2m(mm4, *(dataptr+10)); // write result 2 out - punpckldq_r2r(mm7, mm6); // m32:m22|m12:m02 - produce fourth result - - punpcklwd_m2r(*(dataptr+14), mm3); // n31:n21|n30:n20 - interleave third and fourth lines - movq_r2r(mm1, mm4); - - movq_r2m(mm6, *(dataptr+12)); // write result 3 out - punpckldq_r2r(mm3, mm1); // n30:n20|n10:n00 - produce first result - - punpckhwd_m2r(*(dataptr+14), mm0); // n33:n23|n32:n22 - interleave third and fourth lines - movq_r2r(mm2, mm6); - - movq_r2m(mm5, *(dataptr+14)); // write result 4 out - punpckhdq_r2r(mm3, mm4); // n31:n21|n11:n01- produce second result - - movq_r2m(mm1, *(dataptr+1)); // write result 5 out - (first result for other 4 x 4 block) - punpckldq_r2r(mm0, mm2); // n32:n22|n12:n02- produce third result - - movq_r2m(mm4, *(dataptr+3)); // write result 6 out - punpckhdq_r2r(mm0, mm6); // n33:n23|n13:n03 - produce fourth result - - movq_r2m(mm2, *(dataptr+5)); // write result 7 out - - movq_m2r(*dataptr, mm0); // m03:m02|m01:m00 - first line, first 4x4 - - movq_r2m(mm6, *(dataptr+7)); // write result 8 out - - -// Do first 4x4 quadrant, which is used in the beginning of the DCT: - - movq_m2r(*(dataptr+4), mm7); // m23:m22|m21:m20 - third line - movq_r2r(mm0, mm2); - - punpcklwd_m2r(*(dataptr+2), mm0); // m11:m01|m10:m00 - interleave first and second lines - movq_r2r(mm7, mm4); - - punpcklwd_m2r(*(dataptr+6), mm7); // m31:m21|m30:m20 - interleave third and fourth lines - movq_r2r(mm0, mm1); - - movq_m2r(*(dataptr+2), mm6); // m13:m12|m11:m10 - second line - punpckldq_r2r(mm7, mm0); // m30:m20|m10:m00 - interleave to produce result 1 - - movq_m2r(*(dataptr+6), mm5); // m33:m32|m31:m30 - fourth line - punpckhdq_r2r(mm7, mm1); // m31:m21|m11:m01 - interleave to produce result 2 - - movq_r2r(mm0, mm7); // write result 1 - punpckhwd_r2r(mm6, mm2); // m13:m03|m12:m02 - interleave first and second lines - - psubw_m2r(*(dataptr+14), mm7); // tmp07=x0-x7 /* Stage 1 */ - movq_r2r(mm1, mm6); // write result 2 - - paddw_m2r(*(dataptr+14), mm0); // tmp00=x0+x7 /* Stage 1 */ - punpckhwd_r2r(mm5, mm4); // m33:m23|m32:m22 - interleave third and fourth lines - - paddw_m2r(*(dataptr+12), mm1); // tmp01=x1+x6 /* Stage 1 */ - movq_r2r(mm2, mm3); // copy first intermediate result - - psubw_m2r(*(dataptr+12), mm6); // tmp06=x1-x6 /* Stage 1 */ - punpckldq_r2r(mm4, mm2); // m32:m22|m12:m02 - interleave to produce result 3 - - movq_r2m(mm7, tmp7); - movq_r2r(mm2, mm5); // write result 3 - - movq_r2m(mm6, tmp6); - punpckhdq_r2r(mm4, mm3); // m33:m23|m13:m03 - interleave to produce result 4 - - paddw_m2r(*(dataptr+10), mm2); // tmp02=x2+5 /* Stage 1 */ - movq_r2r(mm3, mm4); // write result 4 - -/************************************************************************************************ - End of Transpose -************************************************************************************************/ - - - paddw_m2r(*(dataptr+8), mm3); // tmp03=x3+x4 /* stage 1*/ - movq_r2r(mm0, mm7); - - psubw_m2r(*(dataptr+8), mm4); // tmp04=x3-x4 /* stage 1*/ - movq_r2r(mm1, mm6); - - paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03 /* even 2 */ - psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03 /* even 2 */ - - psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02 /* even 2 */ - paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02 /* even 2 */ - - psubw_m2r(*(dataptr+10), mm5); // tmp05=x2-x5 /* stage 1*/ - paddw_r2r(mm7, mm6); // tmp12 + tmp13 - - /* stage 3 */ - - movq_m2r(tmp6, mm2); - movq_r2r(mm0, mm3); - - psllw_i2r(2, mm6); // m8 * 2^2 - paddw_r2r(mm1, mm0); - - pmulhw_m2r(RTjpeg_C4, mm6); // z1 - psubw_r2r(mm1, mm3); - - movq_r2m(mm0, *dataptr); - movq_r2r(mm7, mm0); - - /* Odd part */ - movq_r2m(mm3, *(dataptr+8)); - paddw_r2r(mm5, mm4); // tmp10 - - movq_m2r(tmp7, mm3); - paddw_r2r(mm6, mm0); // tmp32 - - paddw_r2r(mm2, mm5); // tmp11 - psubw_r2r(mm6, mm7); // tmp33 - - movq_r2m(mm0, *(dataptr+4)); - paddw_r2r(mm3, mm2); // tmp12 - - /* stage 4 */ - - movq_r2m(mm7, *(dataptr+12)); - movq_r2r(mm4, mm1); // copy of tmp10 - - psubw_r2r(mm2, mm1); // tmp10 - tmp12 - psllw_i2r(2, mm4); // m8 * 2^2 - - movq_m2r(RTjpeg_C2mC6, mm0); - psllw_i2r(2, mm1); - - pmulhw_m2r(RTjpeg_C6, mm1); // z5 - psllw_i2r(2, mm2); - - pmulhw_r2r(mm0, mm4); // z5 - - /* stage 5 */ - - pmulhw_m2r(RTjpeg_C2pC6, mm2); - psllw_i2r(2, mm5); - - pmulhw_m2r(RTjpeg_C4, mm5); // z3 - movq_r2r(mm3, mm0); // copy tmp7 - - movq_m2r(*(dataptr+1), mm7); - paddw_r2r(mm1, mm4); // z2 - - paddw_r2r(mm1, mm2); // z4 - - paddw_r2r(mm5, mm0); // z11 - psubw_r2r(mm5, mm3); // z13 - - /* stage 6 */ - - movq_r2r(mm3, mm5); // copy z13 - psubw_r2r(mm4, mm3); // y3=z13 - z2 - - paddw_r2r(mm4, mm5); // y5=z13 + z2 - movq_r2r(mm0, mm6); // copy z11 - - movq_r2m(mm3, *(dataptr+6)); //save y3 - psubw_r2r(mm2, mm0); // y7=z11 - z4 - - movq_r2m(mm5, *(dataptr+10)); //save y5 - paddw_r2r(mm2, mm6); // y1=z11 + z4 - - movq_r2m(mm0, *(dataptr+14)); //save y7 - - /************************************************ - * End of 1st 4 rows - ************************************************/ - - movq_m2r(*(dataptr+3), mm1); // load x1 /* stage 1 */ - movq_r2r(mm7, mm0); // copy x0 - - movq_r2m(mm6, *(dataptr+2)); //save y1 - - movq_m2r(*(dataptr+5), mm2); // load x2 /* stage 1 */ - movq_r2r(mm1, mm6); // copy x1 - - paddw_m2r(*(dataptr+15), mm0); // tmp00 = x0 + x7 - - movq_m2r(*(dataptr+7), mm3); // load x3 /* stage 1 */ - movq_r2r(mm2, mm5); // copy x2 - - psubw_m2r(*(dataptr+15), mm7); // tmp07 = x0 - x7 - movq_r2r(mm3, mm4); // copy x3 - - paddw_m2r(*(dataptr+13), mm1); // tmp01 = x1 + x6 - - movq_r2m(mm7, tmp7); // save tmp07 - movq_r2r(mm0, mm7); // copy tmp00 - - psubw_m2r(*(dataptr+13), mm6); // tmp06 = x1 - x6 - - /* stage 2, Even Part */ - - paddw_m2r(*(dataptr+9), mm3); // tmp03 = x3 + x4 - - movq_r2m(mm6, tmp6); // save tmp07 - movq_r2r(mm1, mm6); // copy tmp01 - - paddw_m2r(*(dataptr+11), mm2); // tmp02 = x2 + x5 - paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03 - - psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03 - - psubw_m2r(*(dataptr+9), mm4); // tmp04 = x3 - x4 - psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02 - - paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02 - - psubw_m2r(*(dataptr+11), mm5); // tmp05 = x2 - x5 - paddw_r2r(mm7, mm6); // tmp12 + tmp13 - - /* stage 3, Even and stage 4 & 5 even */ - - movq_m2r(tmp6, mm2); // load tmp6 - movq_r2r(mm0, mm3); // copy tmp10 - - psllw_i2r(2, mm6); // shift z1 - paddw_r2r(mm1, mm0); // y0=tmp10 + tmp11 - - pmulhw_m2r(RTjpeg_C4, mm6); // z1 - psubw_r2r(mm1, mm3); // y4=tmp10 - tmp11 - - movq_r2m(mm0, *(dataptr+1)); //save y0 - movq_r2r(mm7, mm0); // copy tmp13 - - /* odd part */ - - movq_r2m(mm3, *(dataptr+9)); //save y4 - paddw_r2r(mm5, mm4); // tmp10 = tmp4 + tmp5 - - movq_m2r(tmp7, mm3); // load tmp7 - paddw_r2r(mm6, mm0); // tmp32 = tmp13 + z1 - - paddw_r2r(mm2, mm5); // tmp11 = tmp5 + tmp6 - psubw_r2r(mm6, mm7); // tmp33 = tmp13 - z1 - - movq_r2m(mm0, *(dataptr+5)); //save y2 - paddw_r2r(mm3, mm2); // tmp12 = tmp6 + tmp7 - - /* stage 4 */ - - movq_r2m(mm7, *(dataptr+13)); //save y6 - movq_r2r(mm4, mm1); // copy tmp10 - - psubw_r2r(mm2, mm1); // tmp10 - tmp12 - psllw_i2r(2, mm4); // shift tmp10 - - movq_m2r(RTjpeg_C2mC6, mm0); // load C2mC6 - psllw_i2r(2, mm1); // shift (tmp10-tmp12) - - pmulhw_m2r(RTjpeg_C6, mm1); // z5 - psllw_i2r(2, mm5); // prepare for multiply - - pmulhw_r2r(mm0, mm4); // multiply by converted real - - /* stage 5 */ - - pmulhw_m2r(RTjpeg_C4, mm5); // z3 - psllw_i2r(2, mm2); // prepare for multiply - - pmulhw_m2r(RTjpeg_C2pC6, mm2); // multiply - movq_r2r(mm3, mm0); // copy tmp7 - - movq_m2r(*(dataptr+9), mm7); // m03:m02|m01:m00 - first line (line 4)and copy into mm7 - paddw_r2r(mm1, mm4); // z2 - - paddw_r2r(mm5, mm0); // z11 - psubw_r2r(mm5, mm3); // z13 - - /* stage 6 */ - - movq_r2r(mm3, mm5); // copy z13 - paddw_r2r(mm1, mm2); // z4 - - movq_r2r(mm0, mm6); // copy z11 - psubw_r2r(mm4, mm5); // y3 - - paddw_r2r(mm2, mm6); // y1 - paddw_r2r(mm4, mm3); // y5 - - movq_r2m(mm5, *(dataptr+7)); //save y3 - - movq_r2m(mm6, *(dataptr+3)); //save y1 - psubw_r2r(mm2, mm0); // y7 - -/************************************************************************************************ - Start of Transpose -************************************************************************************************/ - - movq_m2r(*(dataptr+13), mm6); // m23:m22|m21:m20 - third line (line 6)and copy into m2 - movq_r2r(mm7, mm5); // copy first line - - punpcklwd_r2r(mm3, mm7); // m11:m01|m10:m00 - interleave first and second lines - movq_r2r(mm6, mm2); // copy third line - - punpcklwd_r2r(mm0, mm6); // m31:m21|m30:m20 - interleave third and fourth lines - movq_r2r(mm7, mm1); // copy first intermediate result - - punpckldq_r2r(mm6, mm7); // m30:m20|m10:m00 - interleave to produce result 1 - - punpckhdq_r2r(mm6, mm1); // m31:m21|m11:m01 - interleave to produce result 2 - - movq_r2m(mm7, *(dataptr+9)); // write result 1 - punpckhwd_r2r(mm3, mm5); // m13:m03|m12:m02 - interleave first and second lines - - movq_r2m(mm1, *(dataptr+11)); // write result 2 - punpckhwd_r2r(mm0, mm2); // m33:m23|m32:m22 - interleave third and fourth lines - - movq_r2r(mm5, mm1); // copy first intermediate result - punpckldq_r2r(mm2, mm5); // m32:m22|m12:m02 - interleave to produce result 3 - - movq_m2r(*(dataptr+1), mm0); // m03:m02|m01:m00 - first line, 4x4 - punpckhdq_r2r(mm2, mm1); // m33:m23|m13:m03 - interleave to produce result 4 - - movq_r2m(mm5, *(dataptr+13)); // write result 3 - - /****** last 4x4 done */ - - movq_r2m(mm1, *(dataptr+15)); // write result 4, last 4x4 - - movq_m2r(*(dataptr+5), mm2); // m23:m22|m21:m20 - third line - movq_r2r(mm0, mm6); // copy first line - - punpcklwd_m2r(*(dataptr+3), mm0); // m11:m01|m10:m00 - interleave first and second lines - movq_r2r(mm2, mm7); // copy third line - - punpcklwd_m2r(*(dataptr+7), mm2); // m31:m21|m30:m20 - interleave third and fourth lines - movq_r2r(mm0, mm4); // copy first intermediate result - - - - movq_m2r(*(dataptr+8), mm1); // n03:n02|n01:n00 - first line - punpckldq_r2r(mm2, mm0); // m30:m20|m10:m00 - interleave to produce first result - - movq_m2r(*(dataptr+12), mm3); // n23:n22|n21:n20 - third line - punpckhdq_r2r(mm2, mm4); // m31:m21|m11:m01 - interleave to produce second result - - punpckhwd_m2r(*(dataptr+3), mm6); // m13:m03|m12:m02 - interleave first and second lines - movq_r2r(mm1, mm2); // copy first line - - punpckhwd_m2r(*(dataptr+7), mm7); // m33:m23|m32:m22 - interleave third and fourth lines - movq_r2r(mm6, mm5); // copy first intermediate result - - movq_r2m(mm0, *(dataptr+8)); // write result 1 - punpckhdq_r2r(mm7, mm5); // m33:m23|m13:m03 - produce third result - - punpcklwd_m2r(*(dataptr+10), mm1); // n11:n01|n10:n00 - interleave first and second lines - movq_r2r(mm3, mm0); // copy third line - - punpckhwd_m2r(*(dataptr+10), mm2); // n13:n03|n12:n02 - interleave first and second lines - - movq_r2m(mm4, *(dataptr+10)); // write result 2 out - punpckldq_r2r(mm7, mm6); // m32:m22|m12:m02 - produce fourth result - - punpcklwd_m2r(*(dataptr+14), mm3); // n33:n23|n32:n22 - interleave third and fourth lines - movq_r2r(mm1, mm4); // copy second intermediate result - - movq_r2m(mm6, *(dataptr+12)); // write result 3 out - punpckldq_r2r(mm3, mm1); // - - punpckhwd_m2r(*(dataptr+14), mm0); // n33:n23|n32:n22 - interleave third and fourth lines - movq_r2r(mm2, mm6); // copy second intermediate result - - movq_r2m(mm5, *(dataptr+14)); // write result 4 out - punpckhdq_r2r(mm3, mm4); // n31:n21|n11:n01- produce second result - - movq_r2m(mm1, *(dataptr+1)); // write result 5 out - (first result for other 4 x 4 block) - punpckldq_r2r(mm0, mm2); // n32:n22|n12:n02- produce third result - - movq_r2m(mm4, *(dataptr+3)); // write result 6 out - punpckhdq_r2r(mm0, mm6); // n33:n23|n13:n03 - produce fourth result - - movq_r2m(mm2, *(dataptr+5)); // write result 7 out - - movq_m2r(*dataptr, mm0); // m03:m02|m01:m00 - first line, first 4x4 - - movq_r2m(mm6, *(dataptr+7)); // write result 8 out - -// Do first 4x4 quadrant, which is used in the beginning of the DCT: - - movq_m2r(*(dataptr+4), mm7); // m23:m22|m21:m20 - third line - movq_r2r(mm0, mm2); // copy first line - - punpcklwd_m2r(*(dataptr+2), mm0); // m11:m01|m10:m00 - interleave first and second lines - movq_r2r(mm7, mm4); // copy third line - - punpcklwd_m2r(*(dataptr+6), mm7); // m31:m21|m30:m20 - interleave third and fourth lines - movq_r2r(mm0, mm1); // copy first intermediate result - - movq_m2r(*(dataptr+2), mm6); // m13:m12|m11:m10 - second line - punpckldq_r2r(mm7, mm0); // m30:m20|m10:m00 - interleave to produce result 1 - - movq_m2r(*(dataptr+6), mm5); // m33:m32|m31:m30 - fourth line - punpckhdq_r2r(mm7, mm1); // m31:m21|m11:m01 - interleave to produce result 2 - - movq_r2r(mm0, mm7); // write result 1 - punpckhwd_r2r(mm6, mm2); // m13:m03|m12:m02 - interleave first and second lines - - psubw_m2r(*(dataptr+14), mm7); // tmp07=x0-x7 /* Stage 1 */ - movq_r2r(mm1, mm6); // write result 2 - - paddw_m2r(*(dataptr+14), mm0); // tmp00=x0+x7 /* Stage 1 */ - punpckhwd_r2r(mm5, mm4); // m33:m23|m32:m22 - interleave third and fourth lines - - paddw_m2r(*(dataptr+12), mm1); // tmp01=x1+x6 /* Stage 1 */ - movq_r2r(mm2, mm3); // copy first intermediate result - - psubw_m2r(*(dataptr+12), mm6); // tmp06=x1-x6 /* Stage 1 */ - punpckldq_r2r(mm4, mm2); // m32:m22|m12:m02 - interleave to produce result 3 - - movq_r2m(mm7, tmp7); // save tmp07 - movq_r2r(mm2, mm5); // write result 3 - - movq_r2m(mm6, tmp6); // save tmp06 - - punpckhdq_r2r(mm4, mm3); // m33:m23|m13:m03 - interleave to produce result 4 - - paddw_m2r(*(dataptr+10), mm2); // tmp02=x2+x5 /* stage 1 */ - movq_r2r(mm3, mm4); // write result 4 - -/************************************************************************************************ - End of Transpose 2 -************************************************************************************************/ - - paddw_m2r(*(dataptr+8), mm3); // tmp03=x3+x4 /* stage 1*/ - movq_r2r(mm0, mm7); - - psubw_m2r(*(dataptr+8), mm4); // tmp04=x3-x4 /* stage 1*/ - movq_r2r(mm1, mm6); - - paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03 /* even 2 */ - psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03 /* even 2 */ - - psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02 /* even 2 */ - paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02 /* even 2 */ - - psubw_m2r(*(dataptr+10), mm5); // tmp05=x2-x5 /* stage 1*/ - paddw_r2r(mm7, mm6); // tmp12 + tmp13 - - /* stage 3 */ - - movq_m2r(tmp6, mm2); - movq_r2r(mm0, mm3); - - psllw_i2r(2, mm6); // m8 * 2^2 - paddw_r2r(mm1, mm0); - - pmulhw_m2r(RTjpeg_C4, mm6); // z1 - psubw_r2r(mm1, mm3); - - movq_r2m(mm0, *dataptr); - movq_r2r(mm7, mm0); - - /* Odd part */ - movq_r2m(mm3, *(dataptr+8)); - paddw_r2r(mm5, mm4); // tmp10 - - movq_m2r(tmp7, mm3); - paddw_r2r(mm6, mm0); // tmp32 - - paddw_r2r(mm2, mm5); // tmp11 - psubw_r2r(mm6, mm7); // tmp33 - - movq_r2m(mm0, *(dataptr+4)); - paddw_r2r(mm3, mm2); // tmp12 - - /* stage 4 */ - movq_r2m(mm7, *(dataptr+12)); - movq_r2r(mm4, mm1); // copy of tmp10 - - psubw_r2r(mm2, mm1); // tmp10 - tmp12 - psllw_i2r(2, mm4); // m8 * 2^2 - - movq_m2r(RTjpeg_C2mC6, mm0); - psllw_i2r(2, mm1); - - pmulhw_m2r(RTjpeg_C6, mm1); // z5 - psllw_i2r(2, mm2); - - pmulhw_r2r(mm0, mm4); // z5 - - /* stage 5 */ - - pmulhw_m2r(RTjpeg_C2pC6, mm2); - psllw_i2r(2, mm5); - - pmulhw_m2r(RTjpeg_C4, mm5); // z3 - movq_r2r(mm3, mm0); // copy tmp7 - - movq_m2r(*(dataptr+1), mm7); - paddw_r2r(mm1, mm4); // z2 - - paddw_r2r(mm1, mm2); // z4 - - paddw_r2r(mm5, mm0); // z11 - psubw_r2r(mm5, mm3); // z13 - - /* stage 6 */ - - movq_r2r(mm3, mm5); // copy z13 - psubw_r2r(mm4, mm3); // y3=z13 - z2 - - paddw_r2r(mm4, mm5); // y5=z13 + z2 - movq_r2r(mm0, mm6); // copy z11 - - movq_r2m(mm3, *(dataptr+6)); //save y3 - psubw_r2r(mm2, mm0); // y7=z11 - z4 - - movq_r2m(mm5, *(dataptr+10)); //save y5 - paddw_r2r(mm2, mm6); // y1=z11 + z4 - - movq_r2m(mm0, *(dataptr+14)); //save y7 - - /************************************************ - * End of 1st 4 rows - ************************************************/ - - movq_m2r(*(dataptr+3), mm1); // load x1 /* stage 1 */ - movq_r2r(mm7, mm0); // copy x0 - - movq_r2m(mm6, *(dataptr+2)); //save y1 - - movq_m2r(*(dataptr+5), mm2); // load x2 /* stage 1 */ - movq_r2r(mm1, mm6); // copy x1 - - paddw_m2r(*(dataptr+15), mm0); // tmp00 = x0 + x7 - - movq_m2r(*(dataptr+7), mm3); // load x3 /* stage 1 */ - movq_r2r(mm2, mm5); // copy x2 - - psubw_m2r(*(dataptr+15), mm7); // tmp07 = x0 - x7 - movq_r2r(mm3, mm4); // copy x3 - - paddw_m2r(*(dataptr+13), mm1); // tmp01 = x1 + x6 - - movq_r2m(mm7, tmp7); // save tmp07 - movq_r2r(mm0, mm7); // copy tmp00 - - psubw_m2r(*(dataptr+13), mm6); // tmp06 = x1 - x6 - - /* stage 2, Even Part */ - - paddw_m2r(*(dataptr+9), mm3); // tmp03 = x3 + x4 - - movq_r2m(mm6, tmp6); // save tmp07 - movq_r2r(mm1, mm6); // copy tmp01 - - paddw_m2r(*(dataptr+11), mm2); // tmp02 = x2 + x5 - paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03 - - psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03 - - psubw_m2r(*(dataptr+9), mm4); // tmp04 = x3 - x4 - psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02 - - paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02 - - psubw_m2r(*(dataptr+11), mm5); // tmp05 = x2 - x5 - paddw_r2r(mm7, mm6); // tmp12 + tmp13 - - /* stage 3, Even and stage 4 & 5 even */ - - movq_m2r(tmp6, mm2); // load tmp6 - movq_r2r(mm0, mm3); // copy tmp10 - - psllw_i2r(2, mm6); // shift z1 - paddw_r2r(mm1, mm0); // y0=tmp10 + tmp11 - - pmulhw_m2r(RTjpeg_C4, mm6); // z1 - psubw_r2r(mm1, mm3); // y4=tmp10 - tmp11 - - movq_r2m(mm0, *(dataptr+1)); //save y0 - movq_r2r(mm7, mm0); // copy tmp13 - - /* odd part */ - - movq_r2m(mm3, *(dataptr+9)); //save y4 - paddw_r2r(mm5, mm4); // tmp10 = tmp4 + tmp5 - - movq_m2r(tmp7, mm3); // load tmp7 - paddw_r2r(mm6, mm0); // tmp32 = tmp13 + z1 - - paddw_r2r(mm2, mm5); // tmp11 = tmp5 + tmp6 - psubw_r2r(mm6, mm7); // tmp33 = tmp13 - z1 - - movq_r2m(mm0, *(dataptr+5)); //save y2 - paddw_r2r(mm3, mm2); // tmp12 = tmp6 + tmp7 - - /* stage 4 */ - - movq_r2m(mm7, *(dataptr+13)); //save y6 - movq_r2r(mm4, mm1); // copy tmp10 - - psubw_r2r(mm2, mm1); // tmp10 - tmp12 - psllw_i2r(2, mm4); // shift tmp10 - - movq_m2r(RTjpeg_C2mC6, mm0); // load C2mC6 - psllw_i2r(2, mm1); // shift (tmp10-tmp12) - - pmulhw_m2r(RTjpeg_C6, mm1); // z5 - psllw_i2r(2, mm5); // prepare for multiply - - pmulhw_r2r(mm0, mm4); // multiply by converted real - - /* stage 5 */ - - pmulhw_m2r(RTjpeg_C4, mm5); // z3 - psllw_i2r(2, mm2); // prepare for multiply - - pmulhw_m2r(RTjpeg_C2pC6, mm2); // multiply - movq_r2r(mm3, mm0); // copy tmp7 - - movq_m2r(*(dataptr+9), mm7); // m03:m02|m01:m00 - first line (line 4)and copy into mm7 - paddw_r2r(mm1, mm4); // z2 - - paddw_r2r(mm5, mm0); // z11 - psubw_r2r(mm5, mm3); // z13 - - /* stage 6 */ - - movq_r2r(mm3, mm5); // copy z13 - paddw_r2r(mm1, mm2); // z4 - - movq_r2r(mm0, mm6); // copy z11 - psubw_r2r(mm4, mm5); // y3 - - paddw_r2r(mm2, mm6); // y1 - paddw_r2r(mm4, mm3); // y5 - - movq_r2m(mm5, *(dataptr+7)); //save y3 - psubw_r2r(mm2, mm0); // y\xE8=z11 - z4 - - movq_r2m(mm3, *(dataptr+11)); //save y5 - - movq_r2m(mm6, *(dataptr+3)); //save y1 - - movq_r2m(mm0, *(dataptr+15)); //save y7 - - -#endif -} - -#define FIX_1_082392200 ((__s32) 277) /* FIX(1.082392200) */ -#define FIX_1_414213562 ((__s32) 362) /* FIX(1.414213562) */ -#define FIX_1_847759065 ((__s32) 473) /* FIX(1.847759065) */ -#define FIX_2_613125930 ((__s32) 669) /* FIX(2.613125930) */ - -#define DESCALE(x) (__s16)( ((x)+4) >> 3) - -/* clip yuv to 16..235 (should be 16..240 for cr/cb but ... */ - -#define RL(x) ((x)>235) ? 235 : (((x)<16) ? 16 : (x)) -#define MULTIPLY(var,const) (((__s32) ((var) * (const)) + 128)>>8) - -void RTjpeg_idct_init(void) -{ - int i; - - for(i=0; i<64; i++) - { - RTjpeg_liqt[i]=((__u64)RTjpeg_liqt[i]*RTjpeg_aan_tab[i])>>32; - RTjpeg_ciqt[i]=((__u64)RTjpeg_ciqt[i]*RTjpeg_aan_tab[i])>>32; - } -} - -void RTjpeg_idct(__u8 *odata, __s16 *data, int rskip) -{ -#ifdef MMX - -static mmx_t fix_141 = (mmx_t)(long long)0x5a825a825a825a82LL; -static mmx_t fix_184n261 = (mmx_t)(long long)0xcf04cf04cf04cf04LL; -static mmx_t fix_184 = (mmx_t)(long long)0x7641764176417641LL; -static mmx_t fix_n184 = (mmx_t)(long long)0x896f896f896f896fLL; -static mmx_t fix_108n184 = (mmx_t)(long long)0xcf04cf04cf04cf04LL; - - mmx_t workspace[64]; - mmx_t *wsptr = workspace; - register mmx_t *dataptr = (mmx_t *)odata; - mmx_t *idata = (mmx_t *)data; - - rskip = rskip>>3; -/* - * Perform inverse DCT on one block of coefficients. - */ - - /* Odd part */ - - movq_m2r(*(idata+10), mm1); // load idata[DCTSIZE*5] - - movq_m2r(*(idata+6), mm0); // load idata[DCTSIZE*3] - - movq_m2r(*(idata+2), mm3); // load idata[DCTSIZE*1] - - movq_r2r(mm1, mm2); // copy tmp6 /* phase 6 */ - - movq_m2r(*(idata+14), mm4); // load idata[DCTSIZE*7] - - paddw_r2r(mm0, mm1); // z13 = tmp6 + tmp5; - - psubw_r2r(mm0, mm2); // z10 = tmp6 - tmp5 - - psllw_i2r(2, mm2); // shift z10 - movq_r2r(mm2, mm0); // copy z10 - - pmulhw_m2r(fix_184n261, mm2); // MULTIPLY( z12, FIX_1_847759065); /* 2*c2 */ - movq_r2r(mm3, mm5); // copy tmp4 - - pmulhw_m2r(fix_n184, mm0); // MULTIPLY(z10, -FIX_1_847759065); /* 2*c2 */ - paddw_r2r(mm4, mm3); // z11 = tmp4 + tmp7; - - movq_r2r(mm3, mm6); // copy z11 /* phase 5 */ - psubw_r2r(mm4, mm5); // z12 = tmp4 - tmp7; - - psubw_r2r(mm1, mm6); // z11-z13 - psllw_i2r(2, mm5); // shift z12 - - movq_m2r(*(idata+12), mm4); // load idata[DCTSIZE*6], even part - movq_r2r(mm5, mm7); // copy z12 - - pmulhw_m2r(fix_108n184, mm5); // MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; /* 2*(c2-c6) */ even part - paddw_r2r(mm1, mm3); // tmp7 = z11 + z13; - - //ok - - /* Even part */ - pmulhw_m2r(fix_184, mm7); // MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; /* -2*(c2+c6) */ - psllw_i2r(2, mm6); - - movq_m2r(*(idata+4), mm1); // load idata[DCTSIZE*2] - - paddw_r2r(mm5, mm0); // tmp10 - - paddw_r2r(mm7, mm2); // tmp12 - - pmulhw_m2r(fix_141, mm6); // tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ - psubw_r2r(mm3, mm2); // tmp6 = tmp12 - tmp7 - - movq_r2r(mm1, mm5); // copy tmp1 - paddw_r2r(mm4, mm1); // tmp13= tmp1 + tmp3; /* phases 5-3 */ - - psubw_r2r(mm4, mm5); // tmp1-tmp3 - psubw_r2r(mm2, mm6); // tmp5 = tmp11 - tmp6; - - movq_r2m(mm1, *(wsptr)); // save tmp13 in workspace - psllw_i2r(2, mm5); // shift tmp1-tmp3 - - movq_m2r(*(idata), mm7); // load idata[DCTSIZE*0] - - pmulhw_m2r(fix_141, mm5); // MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - paddw_r2r(mm6, mm0); // tmp4 = tmp10 + tmp5; - - movq_m2r(*(idata+8), mm4); // load idata[DCTSIZE*4] - - psubw_r2r(mm1, mm5); // tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */ - - movq_r2m(mm0, *(wsptr+4)); // save tmp4 in workspace - movq_r2r(mm7, mm1); // copy tmp0 /* phase 3 */ - - movq_r2m(mm5, *(wsptr+2)); // save tmp12 in workspace - psubw_r2r(mm4, mm1); // tmp11 = tmp0 - tmp2; - - paddw_r2r(mm4, mm7); // tmp10 = tmp0 + tmp2; - movq_r2r(mm1, mm5); // copy tmp11 - - paddw_m2r(*(wsptr+2), mm1); // tmp1 = tmp11 + tmp12; - movq_r2r(mm7, mm4); // copy tmp10 /* phase 2 */ - - paddw_m2r(*(wsptr), mm7); // tmp0 = tmp10 + tmp13; - - psubw_m2r(*(wsptr), mm4); // tmp3 = tmp10 - tmp13; - movq_r2r(mm7, mm0); // copy tmp0 - - psubw_m2r(*(wsptr+2), mm5); // tmp2 = tmp11 - tmp12; - paddw_r2r(mm3, mm7); // wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); - - psubw_r2r(mm3, mm0); // wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); - - movq_r2m(mm7, *(wsptr)); // wsptr[DCTSIZE*0] - movq_r2r(mm1, mm3); // copy tmp1 - - movq_r2m(mm0, *(wsptr+14)); // wsptr[DCTSIZE*7] - paddw_r2r(mm2, mm1); // wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); - - psubw_r2r(mm2, mm3); // wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); - - movq_r2m(mm1, *(wsptr+2)); // wsptr[DCTSIZE*1] - movq_r2r(mm4, mm1); // copy tmp3 - - movq_r2m(mm3, *(wsptr+12)); // wsptr[DCTSIZE*6] - - paddw_m2r(*(wsptr+4), mm4); // wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); - - psubw_m2r(*(wsptr+4), mm1); // wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); - - movq_r2m(mm4, *(wsptr+8)); - movq_r2r(mm5, mm7); // copy tmp2 - - paddw_r2r(mm6, mm5); // wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) - - movq_r2m(mm1, *(wsptr+6)); - psubw_r2r(mm6, mm7); // wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); - - movq_r2m(mm5, *(wsptr+4)); - - movq_r2m(mm7, *(wsptr+10)); - - //ok - - -/*****************************************************************/ - - idata++; - wsptr++; - -/*****************************************************************/ - - movq_m2r(*(idata+10), mm1); // load idata[DCTSIZE*5] - - movq_m2r(*(idata+6), mm0); // load idata[DCTSIZE*3] - - movq_m2r(*(idata+2), mm3); // load idata[DCTSIZE*1] - movq_r2r(mm1, mm2); // copy tmp6 /* phase 6 */ - - movq_m2r(*(idata+14), mm4); // load idata[DCTSIZE*7] - paddw_r2r(mm0, mm1); // z13 = tmp6 + tmp5; - - psubw_r2r(mm0, mm2); // z10 = tmp6 - tmp5 - - psllw_i2r(2, mm2); // shift z10 - movq_r2r(mm2, mm0); // copy z10 - - pmulhw_m2r(fix_184n261, mm2); // MULTIPLY( z12, FIX_1_847759065); /* 2*c2 */ - movq_r2r(mm3, mm5); // copy tmp4 - - pmulhw_m2r(fix_n184, mm0); // MULTIPLY(z10, -FIX_1_847759065); /* 2*c2 */ - paddw_r2r(mm4, mm3); // z11 = tmp4 + tmp7; - - movq_r2r(mm3, mm6); // copy z11 /* phase 5 */ - psubw_r2r(mm4, mm5); // z12 = tmp4 - tmp7; - - psubw_r2r(mm1, mm6); // z11-z13 - psllw_i2r(2, mm5); // shift z12 - - movq_m2r(*(idata+12), mm4); // load idata[DCTSIZE*6], even part - movq_r2r(mm5, mm7); // copy z12 - - pmulhw_m2r(fix_108n184, mm5); // MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; /* 2*(c2-c6) */ even part - paddw_r2r(mm1, mm3); // tmp7 = z11 + z13; - - //ok - - /* Even part */ - pmulhw_m2r(fix_184, mm7); // MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; /* -2*(c2+c6) */ - psllw_i2r(2, mm6); - - movq_m2r(*(idata+4), mm1); // load idata[DCTSIZE*2] - - paddw_r2r(mm5, mm0); // tmp10 - - paddw_r2r(mm7, mm2); // tmp12 - - pmulhw_m2r(fix_141, mm6); // tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ - psubw_r2r(mm3, mm2); // tmp6 = tmp12 - tmp7 - - movq_r2r(mm1, mm5); // copy tmp1 - paddw_r2r(mm4, mm1); // tmp13= tmp1 + tmp3; /* phases 5-3 */ - - psubw_r2r(mm4, mm5); // tmp1-tmp3 - psubw_r2r(mm2, mm6); // tmp5 = tmp11 - tmp6; - - movq_r2m(mm1, *(wsptr)); // save tmp13 in workspace - psllw_i2r(2, mm5); // shift tmp1-tmp3 - - movq_m2r(*(idata), mm7); // load idata[DCTSIZE*0] - paddw_r2r(mm6, mm0); // tmp4 = tmp10 + tmp5; - - pmulhw_m2r(fix_141, mm5); // MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - - movq_m2r(*(idata+8), mm4); // load idata[DCTSIZE*4] - - psubw_r2r(mm1, mm5); // tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */ - - movq_r2m(mm0, *(wsptr+4)); // save tmp4 in workspace - movq_r2r(mm7, mm1); // copy tmp0 /* phase 3 */ - - movq_r2m(mm5, *(wsptr+2)); // save tmp12 in workspace - psubw_r2r(mm4, mm1); // tmp11 = tmp0 - tmp2; - - paddw_r2r(mm4, mm7); // tmp10 = tmp0 + tmp2; - movq_r2r(mm1, mm5); // copy tmp11 - - paddw_m2r(*(wsptr+2), mm1); // tmp1 = tmp11 + tmp12; - movq_r2r(mm7, mm4); // copy tmp10 /* phase 2 */ - - paddw_m2r(*(wsptr), mm7); // tmp0 = tmp10 + tmp13; - - psubw_m2r(*(wsptr), mm4); // tmp3 = tmp10 - tmp13; - movq_r2r(mm7, mm0); // copy tmp0 - - psubw_m2r(*(wsptr+2), mm5); // tmp2 = tmp11 - tmp12; - paddw_r2r(mm3, mm7); // wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); - - psubw_r2r(mm3, mm0); // wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); - - movq_r2m(mm7, *(wsptr)); // wsptr[DCTSIZE*0] - movq_r2r(mm1, mm3); // copy tmp1 - - movq_r2m(mm0, *(wsptr+14)); // wsptr[DCTSIZE*7] - paddw_r2r(mm2, mm1); // wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); - - psubw_r2r(mm2, mm3); // wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); - - movq_r2m(mm1, *(wsptr+2)); // wsptr[DCTSIZE*1] - movq_r2r(mm4, mm1); // copy tmp3 - - movq_r2m(mm3, *(wsptr+12)); // wsptr[DCTSIZE*6] - - paddw_m2r(*(wsptr+4), mm4); // wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); - - psubw_m2r(*(wsptr+4), mm1); // wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); - - movq_r2m(mm4, *(wsptr+8)); - movq_r2r(mm5, mm7); // copy tmp2 - - paddw_r2r(mm6, mm5); // wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) - - movq_r2m(mm1, *(wsptr+6)); - psubw_r2r(mm6, mm7); // wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); - - movq_r2m(mm5, *(wsptr+4)); - - movq_r2m(mm7, *(wsptr+10)); - -/*****************************************************************/ - - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ - -/*****************************************************************/ - /* Even part */ - - wsptr--; - -// tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); -// tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); -// tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); -// tmp14 = ((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6]); - movq_m2r(*(wsptr), mm0); // wsptr[0,0],[0,1],[0,2],[0,3] - - movq_m2r(*(wsptr+1), mm1); // wsptr[0,4],[0,5],[0,6],[0,7] - movq_r2r(mm0, mm2); - - movq_m2r(*(wsptr+2), mm3); // wsptr[1,0],[1,1],[1,2],[1,3] - paddw_r2r(mm1, mm0); // wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] - - movq_m2r(*(wsptr+3), mm4); // wsptr[1,4],[1,5],[1,6],[1,7] - psubw_r2r(mm1, mm2); // wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] - - movq_r2r(mm0, mm6); - movq_r2r(mm3, mm5); - - paddw_r2r(mm4, mm3); // wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] - movq_r2r(mm2, mm1); - - psubw_r2r(mm4, mm5); // wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] - punpcklwd_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] - - movq_m2r(*(wsptr+7), mm7); // wsptr[3,4],[3,5],[3,6],[3,7] - punpckhwd_r2r(mm3, mm6); // wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] - - movq_m2r(*(wsptr+4), mm3); // wsptr[2,0],[2,1],[2,2],[2,3] - punpckldq_r2r(mm6, mm0); // wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] - - punpcklwd_r2r(mm5, mm1); // wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] - movq_r2r(mm3, mm4); - - movq_m2r(*(wsptr+6), mm6); // wsptr[3,0],[3,1],[3,2],[3,3] - punpckhwd_r2r(mm5, mm2); // wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] - - movq_m2r(*(wsptr+5), mm5); // wsptr[2,4],[2,5],[2,6],[2,7] - punpckldq_r2r(mm2, mm1); // wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] - - - paddw_r2r(mm5, mm3); // wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] - movq_r2r(mm6, mm2); - - psubw_r2r(mm5, mm4); // wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] - paddw_r2r(mm7, mm6); // wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] - - movq_r2r(mm3, mm5); - punpcklwd_r2r(mm6, mm3); // wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] - - psubw_r2r(mm7, mm2); // wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] - punpckhwd_r2r(mm6, mm5); // wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] - - movq_r2r(mm4, mm7); - punpckldq_r2r(mm5, mm3); // wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] - - punpcklwd_r2r(mm2, mm4); // wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] - - punpckhwd_r2r(mm2, mm7); // wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] - - punpckldq_r2r(mm7, mm4); // wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] - movq_r2r(mm1, mm6); - - //ok - -// mm0 = ;wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] -// mm1 = ;wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] - - - movq_r2r(mm0, mm2); - punpckhdq_r2r(mm4, mm6); // wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] - - punpckldq_r2r(mm4, mm1); // wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] - psllw_i2r(2, mm6); - - pmulhw_m2r(fix_141, mm6); - punpckldq_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] - - punpckhdq_r2r(mm3, mm2); // wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] - movq_r2r(mm0, mm7); - -// tmp0 = tmp10 + tmp13; -// tmp3 = tmp10 - tmp13; - paddw_r2r(mm2, mm0); // [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] - psubw_r2r(mm2, mm7); // [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] - -// tmp12 = MULTIPLY(tmp14, FIX_1_414213562) - tmp13; - psubw_r2r(mm2, mm6); // wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] -// tmp1 = tmp11 + tmp12; -// tmp2 = tmp11 - tmp12; - movq_r2r(mm1, mm5); - - //OK - - /* Odd part */ - -// z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3]; -// z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; -// z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; -// z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; - movq_m2r(*(wsptr), mm3); // wsptr[0,0],[0,1],[0,2],[0,3] - paddw_r2r(mm6, mm1); // [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] - - movq_m2r(*(wsptr+1), mm4); // wsptr[0,4],[0,5],[0,6],[0,7] - psubw_r2r(mm6, mm5); // [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] - - movq_r2r(mm3, mm6); - punpckldq_r2r(mm4, mm3); // wsptr[0,0],[0,1],[0,4],[0,5] - - punpckhdq_r2r(mm6, mm4); // wsptr[0,6],[0,7],[0,2],[0,3] - movq_r2r(mm3, mm2); - -//Save tmp0 and tmp1 in wsptr - movq_r2m(mm0, *(wsptr)); // save tmp0 - paddw_r2r(mm4, mm2); // wsptr[xxx],[0,z11],[xxx],[0,z13] - - -//Continue with z10 --- z13 - movq_m2r(*(wsptr+2), mm6); // wsptr[1,0],[1,1],[1,2],[1,3] - psubw_r2r(m... [truncated message content] |
From: <nic...@us...> - 2009-12-18 19:05:43
|
Revision: 49 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=49&view=rev Author: nickols_k Date: 2009-12-18 19:05:35 +0000 (Fri, 18 Dec 2009) Log Message: ----------- simplify makefile system Modified Paths: -------------- mplayerxp/Makefile mplayerxp/configure mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/libnuppelvideo/Makefile mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.c mplayerxp/libmpdemux/Makefile mplayerxp/libmpdemux/freesdp/Makefile mplayerxp/libmpdemux/librtsp/Makefile mplayerxp/libmpdemux/realrtsp/Makefile mplayerxp/postproc/Makefile mplayerxp/postproc/libmenu/Makefile Modified: mplayerxp/Makefile =================================================================== --- mplayerxp/Makefile 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/Makefile 2009-12-18 19:05:35 UTC (rev 49) @@ -29,21 +29,14 @@ OBJS_MPLAYER = $(SRCS_MPLAYER:.c=.o) -MP_LIBS = libmpdemux/libmpdemux.a -ifeq ($(HAVE_CSS),yes) -MP_LIBS += libmpdemux/librtsp/librtsp.a \ - libmpdemux/realrtsp/librealrtsp.a \ - libmpdemux/freesdp/libfreesdp.a -endif -MP_LIBS += libmpcodecs/libmpcodecs.a \ - libmpcodecs/libnuppelvideo/libnuppelvideo.a \ - libao2/libao2.a \ - postproc/libpostproc.a \ - postproc/libmenu/libmenu.a \ - input/libinput.a \ - libvo/libvo.a \ - osdep/libosdep.a \ - nls/libnls.a +MP_LIBS = libmpdemux/libmpdemux.a \ + libmpcodecs/libmpcodecs.a \ + libao2/libao2.a \ + postproc/libpostproc.a \ + input/libinput.a \ + libvo/libvo.a \ + osdep/libosdep.a \ + nls/libnls.a COMMON_LIBS = $(MP_LIBS) $(EXTRALIBS) -lm CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Ilibvo $(EXTRA_INC) Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/configure 2009-12-18 19:05:35 UTC (rev 49) @@ -257,6 +257,7 @@ pkg_config=pkg-config debug= language= +prefix="/usr/local" for ac_option do optval="${ac_option#*=}" case "$ac_option" in Modified: mplayerxp/libmpcodecs/Makefile =================================================================== --- mplayerxp/libmpcodecs/Makefile 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/libmpcodecs/Makefile 2009-12-18 19:05:35 UTC (rev 49) @@ -1,10 +1,9 @@ include ../mp_config.mak -DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done - LIBNAME = libmpcodecs.a - SUBDIRS = libnuppelvideo +DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done +DO_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done SRCS=dec_video.c vd.c vd_null.c vd_ffmpeg.c vd_divx4.c vd_raw.c vd_nuv.c vd_libmpeg2.c vd_dshow.c vd_vfw.c vd_xvid.c vd_xanim.c vd_mpegpes.c vd_huffyuv.c vd_real.c vd_dmo.c vd_qtvideo.c vd_theora.c SRCS+=ad.c dec_audio.c ad_null.c ad_ffmp3.c ad_mp3.c ad_a52.c ad_dca.c ad_hwac3.c ad_pcm.c ad_dvdpcm.c ad_dshow.c ad_acm.c ad_vorbis.c ad_real.c ad_dmo.c ad_qtaudio.c ad_faad.c ad_twin.c @@ -16,17 +15,20 @@ .SUFFIXES: .c .o -# .PHONY: all clean +.PHONY: $(SUBDIRS) +all: $(LIBNAME) + +$(SUBDIRS): + $(DO_ALL) -all: $(LIBNAME) $(SUBDIRS) - $(DO_MAKE) - .c.o: $(CC) -c $(CFLAGS) -o $@ $< -$(LIBNAME): $(OBJS) - $(AR) r $(LIBNAME) $(OBJS) +$(LIBNAME): $(SUBDIRS) $(OBJS) + $(AR) r $(LIBNAME) $(OBJS) \ + $(wildcard libnuppelvideo/*.o) + clean: $(DO_MAKE) Modified: mplayerxp/libmpcodecs/libnuppelvideo/Makefile =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/Makefile 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/libmpcodecs/libnuppelvideo/Makefile 2009-12-18 19:05:35 UTC (rev 49) @@ -1,7 +1,5 @@ include ../../mp_config.mak -LIBNAME = libnuppelvideo.a - SRCS = RTjpegN.c \ minilzo.c \ nuppelvideo.c @@ -12,17 +10,11 @@ .SUFFIXES: .c .o -# .PHONY: all clean +all: $(OBJS) -all: $(LIBNAME) - .c.o: $(CC) -c $(CFLAGS) -o $@ $< -$(LIBNAME): $(OBJS) - $(AR) r $(LIBNAME) $(OBJS) - - clean: rm -f *.o *.a *~ Modified: mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.c =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.c 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.c 2009-12-18 19:05:35 UTC (rev 49) @@ -78,9 +78,9 @@ static unsigned char RTjpeg_lb8; static unsigned char RTjpeg_cb8; -static int RTjpeg_width, RTjpeg_height; -static int RTjpeg_Ywidth, RTjpeg_Cwidth; -static int RTjpeg_Ysize, RTjpeg_Csize; +static unsigned RTjpeg_width, RTjpeg_height; +static unsigned RTjpeg_Ywidth, RTjpeg_Cwidth; +static unsigned RTjpeg_Ysize, RTjpeg_Csize; static __s16 *RTjpeg_old=NULL; @@ -2779,7 +2779,7 @@ void RTjpeg_init_compress(__u32 *buf, int width, int height, __u8 Q) { - int i; + unsigned i; __u64 qual; RTjpeg_init_data(); @@ -2823,7 +2823,7 @@ void RTjpeg_init_decompress(__u32 *buf, int width, int height) { - int i; + unsigned i; RTjpeg_init_data(); @@ -2855,10 +2855,11 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) { __s8 * sb; - register __s8 * bp1 = bp + (RTjpeg_width<<3); - register __s8 * bp2 = bp + RTjpeg_Ysize; - register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); - register int i, j, k; + register __u8 * bp1 = bp + (RTjpeg_width<<3); + register __u8 * bp2 = bp + RTjpeg_Ysize; + register __u8 * bp3 = bp2 + (RTjpeg_Csize>>1); + register int i; + register unsigned j, k; #ifdef MMX emms(); @@ -2909,9 +2910,10 @@ int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) { __s8 * sb; - register __s8 * bp2 = bp + RTjpeg_Ysize; - register __s8 * bp3 = bp2 + RTjpeg_Csize; - register int i, j, k; + register __u8 * bp2 = bp + RTjpeg_Ysize; + register __u8 * bp3 = bp2 + RTjpeg_Csize; + register int i; + register unsigned j, k; #ifdef MMX emms(); @@ -2953,7 +2955,7 @@ int RTjpeg_compress8(__s8 *sp, unsigned char *bp) { __s8 * sb; - int i, j; + unsigned i, j; #ifdef MMX emms(); @@ -2980,9 +2982,10 @@ void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp) { - register __s8 * bp2 = bp + RTjpeg_Ysize; - register __s8 * bp3 = bp2 + (RTjpeg_Csize); - int i, j,k; + register __u8 * bp2 = bp + RTjpeg_Ysize; + register __u8 * bp3 = bp2 + (RTjpeg_Csize); + int i; + unsigned j,k; #ifdef MMX emms(); @@ -3028,10 +3031,11 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) { - register __s8 * bp1 = bp + (RTjpeg_width<<3); - register __s8 * bp2 = bp + RTjpeg_Ysize; - register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); - int i, j,k; + register __u8 * bp1 = bp + (RTjpeg_width<<3); + register __u8 * bp2 = bp + RTjpeg_Ysize; + register __u8 * bp3 = bp2 + (RTjpeg_Csize>>1); + int i; + unsigned j,k; #ifdef MMX emms(); @@ -3090,7 +3094,7 @@ void RTjpeg_decompress8(__s8 *sp, __u8 *bp) { - int i, j; + unsigned i, j; #ifdef MMX emms(); @@ -3209,10 +3213,11 @@ { __s8 * sb; //rh __s16 *block; - register __s8 * bp1 = bp + (RTjpeg_width<<3); - register __s8 * bp2 = bp + RTjpeg_Ysize; - register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); - register int i, j, k; + register __u8 * bp1 = bp + (RTjpeg_width<<3); + register __u8 * bp2 = bp + RTjpeg_Ysize; + register __u8 * bp3 = bp2 + (RTjpeg_Csize>>1); + register int i; + unsigned j, k; #ifdef MMX emms(); @@ -3301,9 +3306,10 @@ { __s8 * sb; __s16 *block; - register __s8 * bp2; - register __s8 * bp3; - register int i, j, k; + register __u8 * bp2; + register __u8 * bp3; + register int i; + unsigned j, k; #ifdef MMX emms(); @@ -3366,7 +3372,7 @@ bp2+=RTjpeg_width<<2; bp3+=RTjpeg_width<<2; } - printf ("%d\n", block - RTjpeg_old); + printf ("%ld\n", block - RTjpeg_old); #ifdef MMX emms(); #endif @@ -3377,7 +3383,7 @@ { __s8 * sb; __s16 *block; - int i, j; + unsigned i, j; #ifdef MMX emms(); @@ -3424,7 +3430,7 @@ void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride) { int tmp; - int i, j; + unsigned i, j; __s32 y, crR, crG, cbG, cbB; __u8 *bufcr, *bufcb, *bufy, *bufoute; int yskip; @@ -3472,7 +3478,7 @@ void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride) { int tmp; - int i, j; + unsigned i, j; __s32 y, crR, crG, cbG, cbB; __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto; int oskip, yskip; @@ -3546,7 +3552,7 @@ void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride) { int tmp; - int i, j; + unsigned i, j; __s32 y, crR, crG, cbG, cbB; __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto; int oskip, yskip; @@ -3622,7 +3628,7 @@ void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride) { int tmp; - int i, j; + unsigned i, j; __s32 y, crR, crG, cbG, cbB; __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto; int oskip, yskip; @@ -3695,7 +3701,7 @@ void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride) { int tmp; - int i, j; + unsigned i, j; __s32 y, crR, crG, cbG, cbB; __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto; int oskip, yskip; Modified: mplayerxp/libmpdemux/Makefile =================================================================== --- mplayerxp/libmpdemux/Makefile 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/libmpdemux/Makefile 2009-12-18 19:05:35 UTC (rev 49) @@ -4,6 +4,7 @@ include ../mp_config.mak DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done +DO_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done SRCS = s_file.c s_ffmpeg.c ifeq ($(HAVE_CDDA),yes) @@ -50,16 +51,24 @@ .SUFFIXES: .c .o -# .PHONY: all clean +.PHONY: $(SUBDIRS) -all: $(LIBNAME) $(SUBDIRS) - $(DO_MAKE) +all: $(LIBNAME) +$(SUBDIRS): + $(DO_ALL) + .c.o: $(CC) -c $(CFLAGS) -o $@ $< -$(LIBNAME): $(OBJS) +$(LIBNAME): $(SUBDIRS) $(OBJS) $(AR) r $(LIBNAME) $(OBJS) +ifeq ($(HAVE_STREAMING),yes) + $(AR) r $(LIBNAME) \ + $(wildcard freesdp/*.o) \ + $(wildcard librtsp/*.o) \ + $(wildcard realrtsp/*.o) +endif test: $(LIBNAME) test.c $(CC) $(CFLAGS) test.c ../mp_msg.c ../linux/shmem.c -o test -L. -lmpdemux -ldvdread -lz -lpthread Modified: mplayerxp/libmpdemux/freesdp/Makefile =================================================================== --- mplayerxp/libmpdemux/freesdp/Makefile 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/libmpdemux/freesdp/Makefile 2009-12-18 19:05:35 UTC (rev 49) @@ -1,7 +1,5 @@ include ../../mp_config.mak -LIBNAME = libfreesdp.a - SRCS = common.c \ errorlist.c \ parser.c @@ -11,17 +9,11 @@ .SUFFIXES: .c .o -# .PHONY: all clean +all: $(OBJS) -all: $(LIBNAME) - .c.o: $(CC) -c $(CFLAGS) -o $@ $< -$(LIBNAME): $(OBJS) - $(AR) r $(LIBNAME) $(OBJS) - - clean: rm -f *.o *.a *~ Modified: mplayerxp/libmpdemux/librtsp/Makefile =================================================================== --- mplayerxp/libmpdemux/librtsp/Makefile 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/libmpdemux/librtsp/Makefile 2009-12-18 19:05:35 UTC (rev 49) @@ -1,7 +1,5 @@ include ../../mp_config.mak -LIBNAME = librtsp.a - SRCS = rtsp.c \ rtsp_rtp.c \ rtsp_session.c @@ -11,17 +9,11 @@ .SUFFIXES: .c .o -# .PHONY: all clean +all: $(OBJS) -all: $(LIBNAME) - .c.o: $(CC) -c $(CFLAGS) -o $@ $< -$(LIBNAME): $(OBJS) - $(AR) r $(LIBNAME) $(OBJS) - - clean: rm -f *.o *.a *~ Modified: mplayerxp/libmpdemux/realrtsp/Makefile =================================================================== --- mplayerxp/libmpdemux/realrtsp/Makefile 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/libmpdemux/realrtsp/Makefile 2009-12-18 19:05:35 UTC (rev 49) @@ -14,17 +14,11 @@ .SUFFIXES: .c .o -# .PHONY: all clean +all: $(OBJS) -all: $(LIBNAME) - .c.o: $(CC) -c $(CFLAGS) -o $@ $< -$(LIBNAME): $(OBJS) - $(AR) r $(LIBNAME) $(OBJS) - - clean: rm -f *.o *.a *~ Modified: mplayerxp/postproc/Makefile =================================================================== --- mplayerxp/postproc/Makefile 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/postproc/Makefile 2009-12-18 19:05:35 UTC (rev 49) @@ -2,9 +2,9 @@ include ../mp_config.mak LIBNAME = libpostproc.a - -SUBDIRS=libmenu +SUBDIRS = libmenu DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done +DO_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done SRCS=postprocess.c swscale.c SRCS+=af.c af_ao2.c af_crystality.c af_mp.c af_dummy.c af_delay.c af_channels.c af_format.c af_resample.c af_volume.c af_equalizer.c af_tools.c af_comp.c af_gate.c af_pan.c af_surround.c af_sub.c af_export.c af_volnorm.c af_extrastereo.c af_lp.c af_dyn.c af_echo3d.c af_hrtf.c af_ffenc.c af_raw.c af_karaoke.c af_center.c af_sinesuppress.c af_scaletempo.c @@ -15,19 +15,20 @@ .SUFFIXES: .c .o -# .PHONY: all clean +.PHONY: $(SUBDIRS) -all: $(LIBNAME) $(SUBDIRS) - $(DO_MAKE) +all: $(LIBNAME) +$(SUBDIRS): + $(DO_ALL) + .c.o: $(CC) -c $(CFLAGS) -o $@ $< +$(LIBNAME): $(SUBDIRS) $(OBJS) + $(AR) r $(LIBNAME) $(OBJS) \ + $(wildcard libmenu/*.o) -$(LIBNAME): $(OBJS) - $(AR) r $(LIBNAME) $(OBJS) - - clean: $(DO_MAKE) rm -f *.o *.a *~ Modified: mplayerxp/postproc/libmenu/Makefile =================================================================== --- mplayerxp/postproc/libmenu/Makefile 2009-12-17 18:44:54 UTC (rev 48) +++ mplayerxp/postproc/libmenu/Makefile 2009-12-18 19:05:35 UTC (rev 49) @@ -1,7 +1,5 @@ include ../../mp_config.mak -LIBNAME = libmenu.a - SRCS = menu.c \ menu_cmdlist.c \ menu_pt.c \ @@ -16,17 +14,11 @@ .SUFFIXES: .c .o -# .PHONY: all clean +all: $(OBJS) -all: $(LIBNAME) - .c.o: $(CC) -c $(CFLAGS) -o $@ $< -$(LIBNAME): $(OBJS) - $(AR) r $(LIBNAME) $(OBJS) - - clean: rm -f *.o *.a *~ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2009-12-26 10:39:47
|
Revision: 54 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=54&view=rev Author: nickols_k Date: 2009-12-26 10:39:37 +0000 (Sat, 26 Dec 2009) Log Message: ----------- increase static level linkage and use new way of configure Modified Paths: -------------- configure functions mplayerxp/Makefile mplayerxp/codec-cfg.c mplayerxp/configure mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/ad.c mplayerxp/libmpcodecs/ad_acm.c mplayerxp/libmpcodecs/ad_dmo.c mplayerxp/libmpcodecs/ad_dshow.c mplayerxp/libmpcodecs/ad_internal.h mplayerxp/libmpcodecs/ad_qtaudio.c mplayerxp/libmpcodecs/ad_twin.c mplayerxp/libmpcodecs/codecs_ld.c mplayerxp/libmpcodecs/codecs_ld.h mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd_dmo.c mplayerxp/libmpcodecs/vd_dshow.c mplayerxp/libmpcodecs/vd_qtvideo.c mplayerxp/libmpcodecs/vd_vfw.c mplayerxp/libmpdemux/aviprint.h mplayerxp/libmpdemux/demux_mkv.c mplayerxp/libmpdemux/demux_mov.c mplayerxp/libmpdemux/demux_mpxp64.c mplayerxp/libmpdemux/mux_mpxp64.c mplayerxp/libmpdemux/mux_raw.c mplayerxp/libmpdemux/muxer.c mplayerxp/libmpdemux/s_oss.c mplayerxp/libmpdemux/stheader.h mplayerxp/loader/Makefile mplayerxp/loader/afl.c mplayerxp/loader/com.h mplayerxp/loader/dmo/DMO_AudioDecoder.c mplayerxp/loader/dmo/DMO_VideoDecoder.c mplayerxp/loader/dmo/Makefile mplayerxp/loader/dmo/dmo.c mplayerxp/loader/driver.c mplayerxp/loader/dshow/DS_AudioDecoder.c mplayerxp/loader/dshow/DS_Filter.c mplayerxp/loader/dshow/DS_VideoDecoder.c mplayerxp/loader/dshow/Makefile mplayerxp/loader/dshow/allocator.c mplayerxp/loader/dshow/mediatype.c mplayerxp/loader/module.c mplayerxp/loader/pe_image.c mplayerxp/loader/registry.c mplayerxp/loader/resource.c mplayerxp/loader/win32.c mplayerxp/loader/wine/avifmt.h mplayerxp/loader/wine/debugtools.h mplayerxp/postproc/af_format.c Added Paths: ----------- mplayerxp/loader/ Removed Paths: ------------- loader/ mplayerxp/libmpcodecs/interface/dshow/ mplayerxp/libmpdemux/wine/ mplayerxp/loader/configure mplayerxp/loader/cpudetect.c mplayerxp/loader/cpudetect.h mplayerxp/loader/dshow/aviprint.c mplayerxp/loader/get_path.c Modified: configure =================================================================== --- configure 2009-12-21 18:42:47 UTC (rev 53) +++ configure 2009-12-26 10:39:37 UTC (rev 54) @@ -9,7 +9,7 @@ fi done # for parm in ... -for i in codecs loader etc DOCS mplayerxp ; do +for i in codecs etc DOCS mplayerxp ; do echo Entering \'"$i"\' directory cd $i ./configure "$@" Modified: functions =================================================================== --- functions 2009-12-21 18:42:47 UTC (rev 53) +++ functions 2009-12-26 10:39:37 UTC (rev 54) @@ -5,6 +5,14 @@ # Prefer these macros to full length text ! # These macros only return an error code - NO display is done +# Check how echo works in this /bin/sh +init_functions(){ +case `echo -n` in + -n) echo_n= echo_c='\c';; # SysV echo + *) echo_n='-n ' echo_c= ;; # BSD echo +esac +} + log(){ echo "$@" >>"$TMPLOG" } @@ -869,6 +877,10 @@ } mktmps() { +local I +for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do + test "$I" && break +done TMPLOG="configure.log" rm -f "$TMPLOG" TMPC="$I/mplayerxp-conf-$RANDOM-$$.c" @@ -978,8 +990,8 @@ echocheck() { if test "$echocheked" != "yes"; then echocheked=yes - echo "============ Checking for $@ ============" >> "$TMPLOG" - echo ${_echo_n} "Checking for $@ ... ${_echo_c}" + log "============ Checking for $@ ============" + echo $echo_n "Checking for $@ ... "$echo_c fi } @@ -987,19 +999,14 @@ echores() { if test "$echocheked" = "yes"; then echocheked=no - echo "Result is: $@" >> "$TMPLOG" - echo "##########################################" >> "$TMPLOG" - echo "" >> "$TMPLOG" + log "Result is: $@" + log "##########################################" + log "" echo "$@" fi } ############################################################################# -# Check how echo works in this /bin/sh -case `echo -n` in - -n) _echo_n= _echo_c='\c' ;; # SysV echo - *) _echo_n='-n ' _echo_c= ;; # BSD echo -esac # Guessing target system guess_target() { @@ -1112,15 +1119,15 @@ if test -z $CFLAGS ; then add_cflags $locarch fi -if enabled profile || test "$debug" || enabled gcov; then +if enabled profile || test $debug -gt 0 || enabled gcov; then add_cflags "-O2 -fno-builtin" if enabled profile ; then add_cflags "-pg" add_ldflags "-pg" fi -if test -n $debug ; then - add_cflags $debug - add_ldflags $debug +if test $debug -gt 0 ; then + add_cflags "-g$debug" + add_ldflags "-g$debug" fi if enabled gcov ; then add_cflags "-fprofile-arcs -ftest-coverage" @@ -1214,3 +1221,156 @@ #endif /* MPXP_CONFIG_ARCH */ EOF } + +trim() +{ + local trimmed=$1 + trimmed=${trimmed%% } + trimmed=${trimmed## } + echo $trimmed +} + +print_help(){ +echo "Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets." +local list="$1[*]" +list=${!list} +local index=1 +OLD_IFS=$IFS +IFS= +while true +do + local line=$(trim `echo $list | cut -d ',' -f $index`) + test -z $line && break + local opt=$(trim `echo $line | cut -d '|' -f 1`) + local descr=$(trim `echo $line | cut -s -d '|' -f 2`) + local opref=$(trim `echo $line | cut -s -d '|' -f 3`) + echo "$descr:" + opt="$opt[*]" + opt=${!opt} + local i=1 + while true + do + local oval=$(trim `echo $opt | cut -d ',' -f $i`) + test -z $oval && break + local oopt=$(trim `echo $oval | cut -d '|' -f 1`) + local odesc=$(trim `echo $oval | cut -s -d '|' -f 2`) + local odef=$(trim `echo $oval | cut -s -d '|' -f 3`) + printf " " + test -z $opref || printf "%s" $opref +# ((for(j=0;j<(25-lpref);j++))) printf " " + printf "%-25s %s " ${oopt//_/-} $odesc + test -z $odef && echo "" || echo "[$odef]" + (( i++ )) + done + (( index++ )) +done +IFS=$OLD_IFS +} + +make_defaults(){ +local list="$1[*]" +list=${!list} +local index=1 +OLD_IFS=$IFS +IFS= +while true +do + local line=$(trim `echo $list | cut -d ',' -f $index`) + test -z $line && break + local opt=$(trim `echo $line | cut -d '|' -f 1`) + opt="$opt[*]" + opt=${!opt} + local i=1 + while true + do + local oval=$(trim `echo $opt | cut -d ',' -f $i`) + test -z $oval && break + local oopt=$(trim `echo $oval | cut -d '|' -f 1`) + local odef=$(trim `echo $oval | cut -s -d '|' -f 3`) + test -z $odef || eval "$oopt=\"$odef\"" + (( i++ )) + done + (( index++ )) +done +IFS=$OLD_IFS +} + +in_list(){ +local list="$1[*]" +list=${!list} +local index=1 +OLD_IFS=$IFS +IFS= +while true +do + local line=$(trim `echo $list | cut -d ',' -f $index`) + test -z $line && break + local opt=$(trim `echo $line | cut -d '|' -f 1`) + opt="$opt[*]" + opt=${!opt} + local i=1 + while true + do + local oval=$(trim `echo $opt | cut -d ',' -f $i`) + test -z $oval && break + local oopt=$(trim `echo $oval | cut -d '|' -f 1`) + if test $2 = $oopt ; then + IFS=$OLD_IFS + return 0 + fi + (( i++ )) + done + (( index++ )) +done +IFS=$OLD_IFS +return 1 +} + +make_environment(){ +local list="$1[*]" +list=${!list} +local i=1 +OLD_IFS=$IFS +IFS= +while true +do + local oval=$(trim `echo $list | cut -s -d ',' -f $i`) + test -z $oval && break + local oopt=$(trim `echo $oval | cut -d '|' -f 3`) + local odef=$(trim `echo $oval | cut -s -d '|' -f 1`) + eval "odef=\$$odef" + test -z $oopt || test -z $odef || eval "$oopt=\"$odef\"" + (( i++ )) +done +IFS=$OLD_IFS +} + +set_list(){ +local list="$1[*]" +list=${!list} +local i=1 +OLD_IFS=$IFS +IFS= +while true +do + local oval=$(trim `echo $list | cut -s -d ',' -f $i`) + test -z $oval && break + local oopt=$(trim `echo $oval | cut -d '|' -f 1`) + eval "$oopt=$2" + (( i++ )) +done +IFS=$OLD_IFS +} + +enable_list(){ +set_list $1 yes +} + +disable_list(){ +set_list $1 no +} Modified: mplayerxp/Makefile =================================================================== --- mplayerxp/Makefile 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/Makefile 2009-12-26 10:39:37 UTC (rev 54) @@ -14,16 +14,15 @@ PRG_CFG = codec-cfg-xp # these subdirectories required installation due binaries within them SUBDIRS = libmpdemux libmpcodecs libao2 osdep postproc input nls libvo +ifeq ($(TARGET_ARCH_X86),yes) +SUBDIRS+=loader +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 -#prefix = /usr/local -BINDIR = ${prefix}/bin -# BINDIR = /usr/local/bin MANDIR = ${prefix}/man LDFLAGS += -Wl,-rpath,${CODECDIR}/codecs - SRCS_COMMON = cpudetect.c mp_msg.c codec-cfg.c cfgparser.c my_profile.c my_malloc.c spudec.c playtree.c playtreeparser.c asxparser.c mp_image.c subopt-helper.c SRCS_MPLAYER = mplayer.c $(SRCS_COMMON) find_sub.c subreader.c mixer.c vobsub.c mp-opt-reg.c sig_hand.c dump.c dec_ahead.c m_option.c m_property.c m_struct.c @@ -37,6 +36,9 @@ libvo/libvo.a \ osdep/libosdep.a \ nls/libnls.a +ifeq ($(TARGET_ARCH_X86),yes) + MP_LIBS += loader/libloader.a +endif COMMON_LIBS = $(MP_LIBS) $(EXTRALIBS) -lm CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Ilibvo $(EXTRA_INC) Modified: mplayerxp/codec-cfg.c =================================================================== --- mplayerxp/codec-cfg.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/codec-cfg.c 2009-12-26 10:39:37 UTC (rev 54) @@ -24,7 +24,7 @@ #include <string.h> // for mmioFOURCC: -#include "wine/avifmt.h" +#include "loader/wine/avifmt.h" #include "libvo/img_format.h" #include "codec-cfg.h" #define MSGT_CLASS MSGT_CODECCFG Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/configure 2009-12-26 10:39:37 UTC (rev 54) @@ -24,272 +24,193 @@ ############################################################################# . ../functions +init_functions + cd nls LANGUAGES=`echo help_mp-??.h | sed "s/help_mp-\(..\).h/\1/g"` cd .. +linguas=`echo $LANG | sed 's/^\([^_]*\).*$/\1/'` +test -z $linguas && linguas=en -for parm in "$@" ; do - if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then - cat << EOF +# GOTCHA: the variables below defines the default behavior for autodetection +# and have - unless stated otherwise - at least 2 states : yes no +# If autodetection is available then the third state is: auto +ENABLED_LIST=( + "shared|build shared libraries", + "gomp|use GNU OpenMP (requires gcc-4.3+)", + "fastcall|use regparm method on x86 systems", + "fastmemcpy|use 3dnow/sse/mmx optimized memcpy()", + "streaming|build with network support (http/mms/rtp)", + "af_inet6|build with support for IPv6 protocol", + "termcap|build with termcap database for key codes", + "termios|build with termios database for key codes", + "shm|build with shared memory if possible", + "rtc|use RTC (/dev/rtc) on Linux", + "iconv|build with iconv for encoding conversion", + "winsock2|use winsock2.h if possible", + "largefiles|enable support for files > 2GB", + "ossaudio|build with OSS audio output", + "audio_select|use select() on OSS audio device", + "alsa|build with ALSA audio output", + "arts|build with ARTS audio output", + "esd|build with ESD audio ouput", + "openal|build with OpenAL audio output", + "nas|build with NAS uadio output", + "jack|build with JACK audio output", + "libcdio|build with libcdio support", + "x11|build with X11 video ouput", + "xv|build with Xv video output", + "sdl|build with SDL video and audio output", + "sdl_image|build with SDL_image for screenshots", + "fbdev|build with FBDev video ouput", + "jpg|build with JPEG for screenshots", + "png|build with PNG for screenshots", + "opengl|build with OpenGL video output", + "vdpau|build with VDPAU video output", + "dga|build with DGA video output", + "vesa|build with VESA video output", + "vidix|build with VIDIX video output", + "xdpms|build with X11 DPMS support", + "xinerama|build with X11 Xinerama support", + "xf86vm|build with X11 XF86Vm support", + "tv|build wuth TV Interface (tv/dvb grabbers)", + "tv_v4l|build with Video 4 Linux TV Interface support", + "lirc|build with LIRC (remote control) support", + "lircc|build with LIRCC (remote daemon control) support", + "joystick|build with joystick support", + "libcss|build with libcss support", + "libdvdread|build with libdvdread support", + "libdvdnav|build with libdvdnav support", + "libvcd|build with libvcd support" +) +DISABLED_LIST=( + "gcov|compile gnu coverage information into PROGRAM", + "profile|compile profiling information into PROGRAM", + "static|build static libraries" +) -Usage: $0 [OPTIONS]... +AUTOCONF_LIST=( + "ENABLED_LIST", + "DISABLED_LIST" +) -Configuration: - -h, --help display this help and exit +PATH_LIST=( + "prefix|architecture-independent files|/usr/local", + "exec_prefix|architecture-dependent files|\$prefix", + "bindir|user executables|\$exec_prefix/bin", + "libdir|object code libraries|\$exec_prefix/lib", + "datadir|read-only architecture-independent data|\$prefix/share", + "confdir|read-only configuration files|\$prefix/share", + "codecdir|codec's shared libraries|\$libdir/mplayerxp", + "win32libdir|win32 .dll locations [/usr/lib/win32]" +) -Installation directories: - --prefix=DIR use this prefix for installing mplayerxp [/usr/local] +PROGNAME_LIST=( + "program_prefix|prepend PREFIX to installed program names", + "program_suffix|append SUFFIX to installed program names", + "program_transform_name|use TRANSFORM_NAME as program name|mplayerxp" +) -Fine tuning of the installation directories: - --datadir=DIR use this prefix for installing machine independent - data files (fonts, skins) [PREFIX/share/mplayerxp] - --confdir=DIR use this prefix for installing configuration files - [same as datadir] - --libdir=DIR use this prefix to specify library location - [PREFIX/lib] - --codecdir=DIR use this prefix for installing shared libraries - [LIBDIR/mplayerxp] -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build program to run on HOST [BUILD] +SYSTYPES_LIST=( + "build|configure for building on BUILD [guessed]", + "host|cross-compile to build program to run on HOST [BUILD]", + "cc|use this C compiler to build PROGRAM|gcc", + "as|use this ASSEMBLER to build PROGRAM|as", + "ld|use this LINKER to build PROGRAM|gcc", + "ldconfig|use this LDCONFIG to install PROGRAM|ldconfig", + "install|use this INSTALL to install PROGRAM|install", + "pkg_config|use this PKG-CONFIG to configure PROGRAM|pkg-config", + "debug|compile debugging information into PROGRAM|0", + "language|force this language as default for PROGRAM (Available: $LANGUAGES)|$linguas" +) -Program names: - --program-suffix=SUFX append SUFX to installed program names +SYSCONF_LIST=( + "SYSTYPES_LIST", + "PROGNAME_LIST", + "PATH_LIST" +) -Optional features: - --enable-gomp enable GNU OpenMP (requires gcc-4.3+) [autodetect] - --enable-largefiles enable support for files >2^32 bytes long [enable] - --enable-linux-devfs set default devices to devfs ones [disable] - --enable-termcap use termcap database for key codes [autodetect] - --enable-lirc enable LIRC (remote control) support [autodetect] - --enable-lircc enable LIRCC (remote daemon control) support [autodetect] - --enable-png enable png support [autodetect] - --enable-jpeg enable jpeg support [autodetect] - --disable-tv disable TV Interface (tv/dvb grabbers) [enable] - --disable-tv-v4l disable Video 4 Linux TV Interface support [autodetect] - --disable-iconv do not use iconv(3) function [autodetect] - --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect] - --disable-streaming disable network streaming support - (support for: http/mms/rtp) [enable] - --disable-ipv6 disable network IPv6 support [autodetect] - --enable-winsock2 enable winsock2 [autodetect] - --disable-vidix disable VIDIX stuff [autodetect] - --enable-joystick enable joystick support [autodetect] - --disable-sdl-image build with SDL_image support [autodetect] - --disable-libcdio Disable libcdio support [autodetect] - --disable-libcss Disable libcss support [autodetect] - --disable-libdvdread Disable libdvdread support [autodetect] - --disable-libdvdnav Disable libdvdnav support [autodetect] -Video: - --enable-dga build with DGA1 or DGA2 support [autodetect] - --enable-vesa build with VESA support [autodetect] - --enable-sdl build with SDL render support [autodetect] - --enable-vm build with XF86VidMode support for X11 [autodetect] - --enable-x11 build with X11 render support [autodetect] - --enable-xdpms build with X11 DPMS support [autodetect] - --enable-xinerama build with Xinerama support for X11 [autodetect] - --enable-xf86vm build with Xf86vm support for X11 [autodetect] - --enable-xv build with Xv render support for X 4.x [autodetect] - --enable-opengl build with OpenGL render support [autodetect] - --enable-vdpau build with VDPAU render support [autodetect] - --enable-fbdev build with FBDev render support [autodetect] - --enable-fbdev=nocopy yuv12 converts directly into framebuffer - --enable-mlib build with MLIB support (Solaris only) [autodetect] +EXTRA_LIST=( + "asflags|add these FLAGS to [\$ASFLAGS=$ASFLAGS]", + "cflags|add these FLAGS to [\$CFLAGS=$CFLAGS]", + "ldflags|add these FLAGS to [\$LDFLAGS=$LDFLAGS]", + "extralibs|add these LIBS to [\$LIBS=$LIBS]" +) -Audio: - --disable-ossaudio disable OSS sound support [autodetect] - --disable-alsa disable alsa sound support [autodetect] - --disable-arts disable aRts audio output [autodetect] - --disable-esd disable ESound audio output [autodetect] - --disable-openal disable OpenAL audio output [autodetect] - --disable-nas disable NAS audio output [autodetect] - --disable-jack disable JACK audio output [autodetect] - --disable-audio_select disable using select() on OSS audio device [enable] +ADD_LIST=( + "EXTRA_LIST", +) -Miscellaneous options: - --cc=COMPILER use this C compiler to build MPlayerXP [gcc] - --as=ASSEMBLER use this ASSEMBLER to build MPlayerXP [as] - --ld=LINKER use this LINKER to build MPlayerXP [gcc] - --ldconfig=LDCONFIG use this LDCONFIG to install MPlayerXP [ldconfig] - --install=INSTALL use this INSTALL to install MPlayerXP [install] - --language=xx select a language [en] - (Available: $LANGUAGES) +ENVIRONMENT_LIST=( + "MAKE|Make command (example: 'make -j')|make", + "AS|Assembler command|as", + "CC|C compiler command (example: 'gcc -m64')|cc", + "CFLAGS|C compiler flags (example: '-funit-at-a-time')", + "LDFLAGS|linker flags (example: '-L/opt/lib64')", + "LIBS|additional libraries (example: 'LIBS=-lacml_mv')", + "DESTDIR|specifies base of installation" +) -Advanced options: - --disable-fastmemcpy disable 3dnow/sse/mmx optimized memcpy() [enable] - --disable-fastcall disable regparm method on x86 systems [autodetect] - --enable-debug[=1-3] compile debugging information into mplayerxp [disable] - --enable-profile compile profiling information into mplayerxp [disable] - --enable-gcov compile gnu coverage information into biew [disable] +HELP_LIST=( + "PATH_LIST|Fine tuning of the installation directories|--", + "PROGNAME_LIST|Program names|--", + "SYSTYPES_LIST|System types|--", + "EXTRA_LIST|Extralist|--", + "ENABLED_LIST|Optional list of enabled fautures|--disable-", + "DISABLED_LIST|Optional list of disabled fautures|--enable-", + "ENVIRONMENT_LIST|Environment variables| " +) -Use these options if autodetection fails: - --asflags=ASFLAGS add ASFLAGS to [$ASFLAGS] - --cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS] - --ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS] - --extralibs=ELIBS add ELIBS [$ELIBS] +DEFAULT_LIST=( + "PATH_LIST|Fine tuning of the installation directories|--", + "SYSTYPES_LIST|System types|--", + "PROGNAME_LIST|Program names|--", + "EXTRA_LIST|Extralist|--" +) -Environment variables: - MAKE Make command (example: "make -j") - AS Assembler command - CC C compiler command (example: "gcc -m64 -mveclibabi=acml") - CFLAGS C compiler flags (example: - "-O3 -msse -msse2 -msse3 -mfpmath=387,sse -mfancy-math-387 - -ffast-math -funroll-all-loops -ftree-loop-optimize - -ftree-vect-loop-version -ftree-vectorize -fomit-frame-pointer - -finline-functions-called-once -funit-at-a-time -pipe") - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - LIBS specifies additional libs (like: export LIBS=-lacml_mv) - DESTDIR specifies base of installation +enable_list "ENABLED_LIST" +disable_list "DISABLED_LIST" +make_defaults "DEFAULT_LIST" +make_environment "ENVIRONMENT_LIST" -EOF - exit 0 - fi -done # for parm in ... +gas=`$cc -print-prog-name=as` +test -n $gas && as=$gas -# GOTCHA: the variables below defines the default behavior for autodetection -# and have - unless stated otherwise - at least 2 states : yes no -# If autodetection is available then the third state is: auto -ENABLED_LIST=' - shared - gomp - fastcall - fastmemcpy - streaming - af_inet6 - termcap - termios - shm - rtc - iconv - winsock2 - largefiles - alsa - arts - esd - openal - nas - jack - libcdio - fbdev - jpg - lirc - lircc - ossaudio - joystick - libcss - libdvdread - libdvdnav - png - sdl - sdl_image - libvcd - tv_v4l - x11 - xdpms - xv - xinerama - xf86vm - opengl - vdpau - dga - vesa - vidix - audio_select - tv -' -DISABLED_LIST=' - gcov - profile - static -' - -enable $ENABLED_LIST -disable $DISABLED_LIST - -AUTOCONF_LIST=" - $ENABLED_LIST - $DISABLED_LIST -" - -PATH_LIST=' - prefix - datadir - confdir - libdir - codecdir -' - -SYSCONF_LIST=" - build - host - cc - as - ld - ldconfig - install - program_suffix - pkg_config - language - $PATH_LIST -" - -EXTRA_LIST=' - asflags - cflags - ldflags - extralibs -' - -# 1st pass checking for vital options -cc=gcc -test "$CC" && cc="$CC" -as=`$cc -print-prog-name=as` -test -z "$as" && as=as -ld=$cc -ldconfig=ldconfig -install=install -linux_devfs=no -bad_options= -program_suffix= -pkg_config=pkg-config -debug= -language= -prefix="/usr/local" for ac_option do optval="${ac_option#*=}" case "$ac_option" in - --enable-debug) - debug='-g' + --help) + print_help "HELP_LIST" + exit 0 ;; - --enable-debug=*) - debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2` - ;; - --enable-*=*|--disable-*=*) eval $(echo "${ac_option%%=*}" | sed 's/--/action=/;s/-/ thing=/') - is_in ${thing} $AUTOCONF_LIST || bad_options="$ac_option $bad_options" + in_list "AUTOCONF_LIST" ${thing} || bad_options="$ac_option $bad_options" if test "$action" = "disable"; then test "${optval}" = "no" && action=enable else test "${optval}" = "no" && action=disable fi + echo "$action ${thing}" $action ${thing} ;; --enable-?*|--disable-?*) eval $(echo "$ac_option" | sed 's/--/action=/;s/-/ thing=/;s/-/_/g') - is_in ${thing} $AUTOCONF_LIST || bad_options="$ac_option $bad_options" + in_list "AUTOCONF_LIST" ${thing} || bad_options="$ac_option $bad_options" +# echo "$action ${thing}" $action ${thing} ;; *) optname="${ac_option%%=*}" optname="${optname#--}" - optname=$(echo "$optname" | sed 's/-/_/g') - if is_in $optname $SYSCONF_LIST; then + optname=${optname//-/_} + if in_list "SYSCONF_LIST" $optname ; then +# echo "eval $optname=$optval" eval $optname=$optval - elif is_in $optname $EXTRA_LIST; then + elif in_list "ADD_LIST" $optname ; then action="add_$optname" +# echo "$action ${optval}" $action ${optval} else bad_options="$ac_option $bad_options" @@ -298,13 +219,6 @@ esac done -# LGB: temporary files -for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do - test "$I" && break -done - -enabled static && add_ldflags "-static" - mktmps guess_target mp_config.mak mp_config.h @@ -316,6 +230,7 @@ # (libraries) which might be installed into /usr/local. Let users use this # stuff explicitly as command line argument. In other words: It would be # resonable have or only /usr/include or only /usr/local/include. +enabled static && add_ldflags "-static" if freebsd ; then add_ldflags "-L/usr/local/lib" @@ -386,7 +301,8 @@ fi echocheck "Program name" -prog_alias="mplayerxp$program_suffix" +prog_alias=$program_transform_name +prog_alias="$program_prefix$prog_alias$program_suffix" echores "$prog_alias" # Atmos: moved this here, to be correct, if --prefix is specified @@ -397,9 +313,6 @@ test -z "$libdir" && libdir="." test -z "$codecdir" && codecdir="." else -test -z "$datadir" && datadir="$prefix/share/$prog_alias" -test -z "$confdir" && confdir="$datadir" -test -z "$libdir" && libdir="$prefix/lib" test -z "$codecdir" && codecdir="$libdir/$prog_alias" fi @@ -436,6 +349,7 @@ ###################### # MAIN TESTS GO HERE # ###################### +add_cflags "-I$srcdir" disable ffmpeg @@ -531,7 +445,7 @@ enabled mmap && check_func2 "sys/mman.h" mlock print_config HAVE_ mp_config.h mp_config.mak mlock -check_func2 "stdarg.h" vsscanf +check_func2 "stdio.h stdarg.h" vsscanf print_config HAVE_ mp_config.h mp_config.mak vsscanf if enabled termcap; then @@ -608,6 +522,25 @@ mp_help="nls/help_mp-$linguas.h" test -f nls/help_mp-$linguas.h || die "nls/help_mp-$linguas.h not found" +enable win32loader +if win32 || ! x86_32 ; then +disable win32loader +fi +win32 && add_ldflags -lkernel32 +print_config HAVE_ mp_config.h mp_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\"" >>mp_config.h + ######### # VIDEO # ######### @@ -795,15 +728,6 @@ # 64 bit file offsets? enabled largefiles && CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64 -D__USE_LARGEFILE -D_LARGEFILE64_SOURCE" -# Determine OS dependent libs -if win32 ; then - def_win32_cmt='/* using native windows system */' - def_win32_loader='#undef WIN32_LOADER' -else - def_win32_cmt='/* using non-native windows system */' - def_win32_loader='#define WIN32_LOADER 1' -fi - # Dynamic linking flags # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly) bsd && add_ldflags "-rdynamic" @@ -827,6 +751,7 @@ LANG = C prefix = $prefix +BINDIR = $bindir DATADIR = $datadir CONFDIR = $confdir LIBDIR = $libdir @@ -868,6 +793,7 @@ /* Common data directory (for fonts, etc) */ #define PROGNAME "$prog_alias" +#define BINDIR "$bindir" #define DATADIR "$datadir" #define CONFDIR "$confdir" #define LIBDIR "$libdir" @@ -933,9 +859,6 @@ $def_ossaudio_devdsp $def_ossaudio_devmixer -$def_win32_cmt -$def_win32_loader - #ifdef sun #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0" #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE Modified: mplayerxp/libmpcodecs/Makefile =================================================================== --- mplayerxp/libmpcodecs/Makefile 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/Makefile 2009-12-26 10:39:37 UTC (rev 54) @@ -5,19 +5,56 @@ DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done DO_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done -SRCS=dec_video.c vd.c vd_null.c vd_ffmpeg.c vd_divx4.c vd_raw.c vd_nuv.c vd_libmpeg2.c vd_dshow.c vd_vfw.c vd_xvid.c vd_xanim.c vd_mpegpes.c vd_huffyuv.c vd_real.c vd_dmo.c vd_qtvideo.c vd_theora.c -SRCS+=ad.c dec_audio.c ad_null.c ad_ffmp3.c ad_mp3.c ad_a52.c ad_dca.c ad_hwac3.c ad_pcm.c ad_dvdpcm.c ad_dshow.c ad_acm.c ad_vorbis.c ad_real.c ad_dmo.c ad_qtaudio.c ad_faad.c ad_twin.c -SRCS+=codecs_ld.c +SRCS=dec_video.c \ + vd.c \ + vd_null.c \ + vd_ffmpeg.c \ + vd_divx4.c \ + vd_raw.c \ + vd_nuv.c \ + vd_libmpeg2.c \ + vd_xvid.c \ + vd_xanim.c \ + vd_mpegpes.c \ + vd_huffyuv.c \ + vd_real.c \ + vd_theora.c \ + ad.c \ + dec_audio.c \ + ad_null.c \ + ad_ffmp3.c \ + ad_mp3.c \ + ad_a52.c \ + ad_dca.c \ + ad_hwac3.c \ + ad_pcm.c \ + ad_dvdpcm.c \ + ad_vorbis.c \ + ad_real.c \ + ad_faad.c \ + codecs_ld.c +ifeq ($(HAVE_WIN32LOADER),yes) +SRCS+=vd_dshow.c \ + vd_vfw.c \ + vd_dmo.c \ + vd_qtvideo.c \ + ad_dshow.c \ + ad_acm.c \ + ad_dmo.c \ + ad_qtaudio.c \ + ad_twin.c +endif + OBJS=$(SRCS:.c=.o) -CFLAGS = $(OPTFLAGS) -I. -I.. -I../libmpdemux -I../loader -Wall +CFLAGS = $(OPTFLAGS) -I. -I.. -I../libmpdemux -I../loader -Wall .SUFFIXES: .c .o .PHONY: $(SUBDIRS) -all: $(LIBNAME) +all: $(LIBNAME) $(SUBDIRS): $(DO_ALL) Modified: mplayerxp/libmpcodecs/ad.c =================================================================== --- mplayerxp/libmpcodecs/ad.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/ad.c 2009-12-26 10:39:37 UTC (rev 54) @@ -23,7 +23,7 @@ extern const ad_functions_t mpcodecs_ad_hwac3; extern const ad_functions_t mpcodecs_ad_pcm; extern const ad_functions_t mpcodecs_ad_dvdpcm; -extern const ad_functions_t mpcodecs_ad_divx; +extern const ad_functions_t mpcodecs_ad_dshow; extern const ad_functions_t mpcodecs_ad_msacm; extern const ad_functions_t mpcodecs_ad_faad; extern const ad_functions_t mpcodecs_ad_vorbis; @@ -42,14 +42,16 @@ &mpcodecs_ad_ffmp3, &mpcodecs_ad_pcm, &mpcodecs_ad_dvdpcm, - &mpcodecs_ad_divx, - &mpcodecs_ad_msacm, &mpcodecs_ad_faad, &mpcodecs_ad_vorbis, &mpcodecs_ad_real, +#ifdef HAVE_WIN32LOADER + &mpcodecs_ad_dshow, &mpcodecs_ad_twin, + &mpcodecs_ad_msacm, &mpcodecs_ad_dmo, &mpcodecs_ad_qtaudio, +#endif NULL }; Modified: mplayerxp/libmpcodecs/ad_acm.c =================================================================== --- mplayerxp/libmpcodecs/ad_acm.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/ad_acm.c 2009-12-26 10:39:37 UTC (rev 54) @@ -6,7 +6,7 @@ #define __AD_ACM #include "ad_internal.h" #include "codecs_ld.h" -#include "../../loader/wineacm.h" +#include "loader/wineacm.h" #include "../libmpdemux/aviprint.h" #include "help_mp.h" @@ -24,23 +24,6 @@ LIBAD_EXTERN(msacm) -/* ACM audio and VfW video codecs initialization */ -/* based on the avifile library [http://divx.euro.ru] */ -static MMRESULT WINAPI (*acmStreamConvert_ptr)(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwConvert); -static MMRESULT WINAPI (*acmStreamOpen_ptr)(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pwfxSrc,PWAVEFORMATEX pwfxDst, PWAVEFILTER pwfltr, DWORD dwCallback,DWORD dwInstance, DWORD fdwOpen); -static MMRESULT WINAPI (*acmStreamClose_ptr)(HACMSTREAM has, DWORD fdwClose); -static MMRESULT WINAPI (*acmStreamPrepareHeader_ptr)(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwPrepare); -static MMRESULT WINAPI (*acmStreamSize_ptr)(HACMSTREAM has, DWORD cbInput,LPDWORD pdwOutputBytes, DWORD fdwSize); -static MMRESULT WINAPI (*acmStreamUnprepareHeader_ptr)(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwUnprepare); -static PWINE_ACMDRIVERID (*MSACM_RegisterDriver_ptr)(const char* pszFileName,WORD wFormatTag,HINSTANCE hinstModule); -#define acmStreamConvert(a,b,c) (*acmStreamConvert_ptr)(a,b,c) -#define acmStreamOpen(a,b,c,d,e,f,g,h) (*acmStreamOpen_ptr)(a,b,c,d,e,f,g,h) -#define acmStreamClose(a,b) (*acmStreamClose_ptr)(a,b) -#define acmStreamPrepareHeader(a,b,c) (*acmStreamPrepareHeader_ptr)(a,b,c) -#define acmStreamSize(a,b,c,d) (*acmStreamSize_ptr)(a,b,c,d) -#define acmStreamUnprepareHeader(a,b,c) (*acmStreamUnprepareHeader_ptr)(a,b,c) -#define MSACM_RegisterDriver(a,b,c) (*MSACM_RegisterDriver_ptr)(a,b,c) - typedef struct acm_priv_s { float pts; @@ -48,23 +31,6 @@ HACMSTREAM srcstream; // handle }acm_priv_t; -static void *dll_handle; -static int load_lib( const char *libname ) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - acmStreamConvert_ptr = ld_sym(dll_handle,"acmStreamConvert"); - acmStreamOpen_ptr = ld_sym(dll_handle,"acmStreamOpen"); - acmStreamClose_ptr = ld_sym(dll_handle,"acmStreamClose"); - acmStreamPrepareHeader_ptr = ld_sym(dll_handle,"acmStreamPrepareHeader"); - acmStreamSize_ptr = ld_sym(dll_handle,"acmStreamSize"); - acmStreamUnprepareHeader_ptr = ld_sym(dll_handle,"acmStreamUnprepareHeader"); - MSACM_RegisterDriver_ptr = ld_sym(dll_handle,"MSACM_RegisterDriver"); - return acmStreamConvert_ptr && acmStreamOpen_ptr && - acmStreamPrepareHeader_ptr && acmStreamSize_ptr && - acmStreamUnprepareHeader_ptr && acmStreamClose_ptr && - MSACM_RegisterDriver_ptr; -} - static int init_acm_audio_codec(sh_audio_t *sh_audio){ HRESULT ret; WAVEFORMATEX *in_fmt=sh_audio->wf; @@ -123,8 +89,6 @@ 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->channels=priv->o_wf.nChannels; sh_audio->samplerate=priv->o_wf.nSamplesPerSec; @@ -140,9 +104,9 @@ { HRESULT ret; acm_priv_t *priv=sh_audio->context; - + ret = acmStreamClose(priv->srcstream, 0); - + if (ret) switch(ret) { @@ -157,7 +121,7 @@ default: MSG_WARN( "ACM_Decoder: unknown error occured: %d\n", ret); return(0); - } + } /* MSACM_UnregisterAllDrivers();*/ return(1); } @@ -180,7 +144,6 @@ acm_priv_t *priv; if(!(sh_audio->context=malloc(sizeof(acm_priv_t)))) return 0; priv=sh_audio->context; - if(!load_lib(wineld_name("libloader"SLIBSUFFIX))) return 0; if(!init_acm_audio_codec(sh_audio)){ MSG_ERR(MSGTR_ACMiniterror); return 0; @@ -193,7 +156,6 @@ { close_acm_audio_codec(sh); free(sh->context); - dlclose(dll_handle); } int control(sh_audio_t *sh_audio,int cmd,void* arg, ...) @@ -268,13 +230,13 @@ } 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_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){ Modified: mplayerxp/libmpcodecs/ad_dmo.c =================================================================== --- mplayerxp/libmpcodecs/ad_dmo.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/ad_dmo.c 2009-12-26 10:39:37 UTC (rev 54) @@ -25,7 +25,7 @@ LIBAD_EXTERN(dmo) -#include "../../loader/dmo/DMO_AudioDecoder.h" +#include "loader/dmo/DMO_AudioDecoder.h" typedef struct dmo_priv_s { @@ -33,31 +33,6 @@ DMO_AudioDecoder* ds_adec; }dmo_priv_t; -static DMO_AudioDecoder* (*DMO_AudioDecoder_Open_ptr)(char* dllname, GUID* guid, WAVEFORMATEX* wf,int out_channels); -static void (*DMO_AudioDecoder_Destroy_ptr)(DMO_AudioDecoder *this); -static int (*DMO_AudioDecoder_Convert_ptr)(DMO_AudioDecoder *this, const void* in_data, unsigned int in_size, - void* out_data, unsigned int out_size, - unsigned int* size_read, unsigned int* size_written); -static int (*DMO_AudioDecoder_GetSrcSize_ptr)(DMO_AudioDecoder *this, int dest_size); - -#define DMO_AudioDecoder_Open(a,b,c,d) (*DMO_AudioDecoder_Open_ptr)(a,b,c,d) -#define DMO_AudioDecoder_Destroy(a) (*DMO_AudioDecoder_Destroy_ptr)(a) -#define DMO_AudioDecoder_Convert(a,b,c,d,e,f,g) (*DMO_AudioDecoder_Convert_ptr)(a,b,c,d,e,f,g) -#define DMO_AudioDecoder_GetSrcSize(a,b) (*DMO_AudioDecoder_GetSrcSize_ptr)(a,b) - -static void *dll_handle; -static int load_lib( const char *libname ) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - DMO_AudioDecoder_Open_ptr = ld_sym(dll_handle,"DMO_AudioDecoder_Open"); - DMO_AudioDecoder_Destroy_ptr = ld_sym(dll_handle,"DMO_AudioDecoder_Destroy"); - DMO_AudioDecoder_Convert_ptr = ld_sym(dll_handle,"DMO_AudioDecoder_Convert"); - DMO_AudioDecoder_GetSrcSize_ptr = ld_sym(dll_handle,"DMO_AudioDecoder_GetSrcSize"); - return DMO_AudioDecoder_Open_ptr && DMO_AudioDecoder_Destroy_ptr && DMO_AudioDecoder_Convert_ptr && - DMO_AudioDecoder_GetSrcSize_ptr; -} - - static int init(sh_audio_t *sh) { return 1; @@ -72,7 +47,6 @@ audio_output_channels : (sh_audio->wf->nChannels>=2 ? 2 : 1); if(!(sh_audio->context=malloc(sizeof(dmo_priv_t)))) return 0; priv=sh_audio->context; - if(!load_lib(wineld_name("DMO_Filter"SLIBSUFFIX))) return 0; 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); @@ -94,7 +68,6 @@ dmo_priv_t*priv = sh->context; DMO_AudioDecoder_Destroy(priv->ds_adec); free(priv); - dlclose(dll_handle); } static int control(sh_audio_t *sh_audio,int cmd,void* arg, ...) Modified: mplayerxp/libmpcodecs/ad_dshow.c =================================================================== --- mplayerxp/libmpcodecs/ad_dshow.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/ad_dshow.c 2009-12-26 10:39:37 UTC (rev 54) @@ -5,7 +5,7 @@ #include "ad_internal.h" #include "mp_config.h" #include "help_mp.h" -#include "interface/dshow/DS_AudioDecoder.h" +#include "loader/dshow/DS_AudioDecoder.h" #include "codecs_ld.h" static const ad_info_t info = @@ -20,7 +20,7 @@ { NULL, NULL, 0, 0, 0, 0, NULL} }; -LIBAD_EXTERN(divx) +LIBAD_EXTERN(dshow) typedef struct dshow_priv_s { @@ -28,27 +28,6 @@ DS_AudioDecoder* ds_adec; }dshow_priv_t; -DS_AudioDecoder * (*DS_AudioDecoder_Open_ptr)(char* dllname, GUID* guid, WAVEFORMATEX* wf); -int (*DS_AudioDecoder_Convert_ptr)(DS_AudioDecoder *this, const void* in_data, unsigned int in_size, - void* out_data, unsigned int out_size, - unsigned int* size_read, unsigned int* size_written); -int (*DS_AudioDecoder_GetSrcSize_ptr)(DS_AudioDecoder *this, int dest_size); -void (*DS_AudioDecoder_Destroy_ptr)(DS_AudioDecoder *this); - -static void *dll_handle; - -static int load_lib( const char *libname ) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - DS_AudioDecoder_Open_ptr = ld_sym(dll_handle,"DS_AudioDecoder_Open"); - DS_AudioDecoder_Destroy_ptr = ld_sym(dll_handle,"DS_AudioDecoder_Destroy"); - DS_AudioDecoder_Convert_ptr = ld_sym(dll_handle,"DS_AudioDecoder_Convert"); - DS_AudioDecoder_GetSrcSize_ptr = ld_sym(dll_handle,"DS_AudioDecoder_GetSrcSize"); - return DS_AudioDecoder_Open_ptr && DS_AudioDecoder_Convert_ptr && - DS_AudioDecoder_GetSrcSize_ptr && DS_AudioDecoder_Destroy_ptr; -} - - int init(sh_audio_t *sh) { return 1; @@ -58,9 +37,8 @@ { dshow_priv_t *priv; if(!(sh_audio->context=malloc(sizeof(dshow_priv_t)))) return 0; - if(!load_lib(wineld_name("DS_Filter"SLIBSUFFIX))) return 0; priv=sh_audio->context; - if(!(priv->ds_adec=(*DS_AudioDecoder_Open_ptr)(sh_audio->codec->dll_name,&sh_audio->codec->guid,sh_audio->wf))) + 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); free(sh_audio->context); @@ -79,9 +57,8 @@ void uninit(sh_audio_t *sh) { dshow_priv_t* priv = sh->context; - (*DS_AudioDecoder_Destroy_ptr)(priv->ds_adec); + DS_AudioDecoder_Destroy(priv->ds_adec); free(priv); - dlclose(dll_handle); } int control(sh_audio_t *sh_audio,int cmd,void* arg, ...) @@ -115,7 +92,7 @@ int len=-1; { int size_in=0; int size_out=0; - int srcsize=(*DS_AudioDecoder_GetSrcSize_ptr)(priv->ds_adec, maxlen); + int 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(sh_audio->a_in_buffer_len<srcsize){ @@ -127,7 +104,7 @@ priv->pts=*pts; } else *pts=priv->pts; - (*DS_AudioDecoder_Convert_ptr)(priv->ds_adec, sh_audio->a_in_buffer,sh_audio->a_in_buffer_len, + DS_AudioDecoder_Convert(priv->ds_adec, 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) %d\n",size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,ds_tell_pts_r(sh_audio->ds)); if(size_in>=sh_audio->a_in_buffer_len){ Modified: mplayerxp/libmpcodecs/ad_internal.h =================================================================== --- mplayerxp/libmpcodecs/ad_internal.h 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/ad_internal.h 2009-12-26 10:39:37 UTC (rev 54) @@ -1,5 +1,5 @@ #ifdef __AD_ACM /* simply ugly hack */ -#include "wine/msacm.h" +#include "loader/wine/msacm.h" #endif #include "codec-cfg.h" Modified: mplayerxp/libmpcodecs/ad_qtaudio.c =================================================================== --- mplayerxp/libmpcodecs/ad_qtaudio.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/ad_qtaudio.c 2009-12-26 10:39:37 UTC (rev 54) @@ -49,23 +49,23 @@ 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,void * 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 void *inputPtr, - unsigned long inputFrames, - void *outputPtr, - unsigned long *outputFrames, - unsigned long *outputBytes ); +typedef int (__cdecl* LPFUNC5)(SoundConverter sc, OSType selector,void * 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 void *inputPtr, + unsigned long inputFrames, + void *outputPtr, + unsigned long *outputFrames, + unsigned long *outputBytes ); typedef int (__cdecl* LPFUNC8)(SoundConverter sc, - void *outputPtr, + void *outputPtr, unsigned long *outputFrames, unsigned long *outputBytes); -typedef int (__cdecl* LPFUNC9)(SoundConverter sc) ; +typedef int (__cdecl* LPFUNC9)(SoundConverter sc); static HINSTANCE qtml_dll; static LPFUNC1 InitializeQTML; @@ -80,35 +80,10 @@ #define siDecompressionParams 2002876005 // siDecompressionParams = FOUR_CHAR_CODE('wave') -static HMODULE (* WINAPI LoadLibraryA_ptr)(LPCSTR); -static FARPROC (* WINAPI GetProcAddress_ptr)(HMODULE,LPCSTR); -static int (* WINAPI FreeLibrary_ptr)(HMODULE); -#ifdef WIN32_LOADER -static ldt_fs_t* (*Setup_LDT_Keeper_ptr)(void); -#endif -#define LoadLibraryA(a) (*LoadLibraryA_ptr)(a) -#define GetProcAddress(a,b) (*GetProcAddress_ptr)(a,b) -#define FreeLibrary(a) (*FreeLibrary_ptr)(a) -#define Setup_LDT_Keeper() (*Setup_LDT_Keeper_ptr)() +HMODULE WINAPI LoadLibraryA(LPCSTR); +FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); +int WINAPI FreeLibrary(HMODULE); -static void *dll_handle; -static int load_lib( const char *libname ) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - LoadLibraryA_ptr = ld_sym(dll_handle,"LoadLibraryA"); - GetProcAddress_ptr = ld_sym(dll_handle,"GetProcAddress"); - FreeLibrary_ptr = ld_sym(dll_handle,"FreeLibrary"); -#ifdef WIN32_LOADER - Setup_LDT_Keeper_ptr = ld_sym(dll_handle,"Setup_LDT_Keeper"); -#endif - return LoadLibraryA_ptr && GetProcAddress_ptr && FreeLibrary_ptr -#ifdef WIN32_LOADER - && Setup_LDT_Keeper_ptr -#endif - ; -} - - static int loader_init() { #ifdef WIN32_LOADER @@ -181,8 +156,8 @@ return 0; } -static SoundConverter myConverter = NULL; -static SoundComponentData InputFormatInfo,OutputFormatInfo; +static SoundConverter myConverter = NULL; +static SoundComponentData InputFormatInfo,OutputFormatInfo; static int InFrameSize; static int OutFrameSize; @@ -200,20 +175,19 @@ return 0; } MSG_INFO("win32 libquicktime loader (c) Sascha Sommer\n"); - if(!load_lib(wineld_name("libloader"SLIBSUFFIX))) return 0; #ifdef MACOSX EnterMovies(); #else if(loader_init()) return 0; // failed to load DLL - + MSG_V("loader_init DONE!\n"); error = InitializeQTML(6+16); MSG_ERR("InitializeQTML:%i\n",error); if(error) return 0; #endif - + #if 1 OutputFormatInfo.flags = InputFormatInfo.flags = 0; OutputFormatInfo.sampleCount = InputFormatInfo.sampleCount = 0; @@ -244,7 +218,7 @@ 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; @@ -256,7 +230,7 @@ sh->audio_out_minsize=OutputBufferSize; sh->audio_in_minsize=InputBufferSize; - + sh->channels=sh->wf->nChannels; sh->samplerate=sh->wf->nSamplesPerSec; sh->samplesize=2; //(sh->wf->wBitsPerSample+7)/8; @@ -301,7 +275,6 @@ #ifdef MACOSX ExitMovies(); #endif - dlclose(dll_handle); } static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen,float *pts){ @@ -310,7 +283,7 @@ 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; @@ -329,7 +302,7 @@ if(InputBufferSize>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, @@ -337,7 +310,7 @@ // 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; Modified: mplayerxp/libmpcodecs/ad_twin.c =================================================================== --- mplayerxp/libmpcodecs/ad_twin.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/ad_twin.c 2009-12-26 10:39:37 UTC (rev 54) @@ -6,9 +6,8 @@ #include "ad_internal.h" #include "codecs_ld.h" #include "interface/vqf.h" -#ifdef WIN32_LOADER -#include "../../loader/ldt_keeper.h" -#endif +#include "loader/ldt_keeper.h" +#include "loader/wine/windef.h" #include "../libao2/afmt.h" #include "../libmpdemux/aviprint.h" @@ -28,16 +27,9 @@ LIBAD_EXTERN(twin) -static HMODULE (* WINAPI LoadLibraryA_ptr)(LPCSTR); -static FARPROC (* WINAPI GetProcAddress_ptr)(HMODULE,LPCSTR); -static int (* WINAPI FreeLibrary_ptr)(HMODULE); -#ifdef WIN32_LOADER -static ldt_fs_t* (*Setup_LDT_Keeper_ptr)(void); -#endif -#define LoadLibraryA(a) (*LoadLibraryA_ptr)(a) -#define GetProcAddress(a,b) (*GetProcAddress_ptr)(a,b) -#define FreeLibrary(a) (*FreeLibrary_ptr)(a) -#define Setup_LDT_Keeper() (*Setup_LDT_Keeper_ptr)() +extern void* WINAPI LoadLibraryA(char* name); +extern void* WINAPI GetProcAddress(void* handle, char* func); +extern int WINAPI FreeLibrary(void* handle); static int (*TvqInitialize_ptr)( headerInfo *setupInfo, INDEX *index, int dispErrorMessageBox ); #define TvqInitialize(a,b,c) (*TvqInitialize_ptr)(a,b,c) @@ -81,23 +73,7 @@ char buf[BBUFSIZ]; /* the bit buffer */ }vqf_priv_t; -static void *dll_handle; static HINSTANCE vqf_dll; -static int load_lib( const char *libname ) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - LoadLibraryA_ptr = ld_sym(dll_handle,"LoadLibraryA"); - GetProcAddress_ptr = ld_sym(dll_handle,"GetProcAddress"); - FreeLibrary_ptr = ld_sym(dll_handle,"FreeLibrary"); -#ifdef WIN32_LOADER - Setup_LDT_Keeper_ptr = ld_sym(dll_handle,"Setup_LDT_Keeper"); -#endif - return LoadLibraryA_ptr && GetProcAddress_ptr && FreeLibrary_ptr -#ifdef WIN32_LOADER - && Setup_LDT_Keeper_ptr -#endif - ; -} static int load_dll( const char *libname ) { @@ -199,7 +175,6 @@ vqf_priv_t *priv; if(!(sh_audio->context=malloc(sizeof(vqf_priv_t)))) return 0; priv=sh_audio->context; - if(!load_lib(wineld_name("libloader"SLIBSUFFIX))) return 0; if(!load_dll((const char *)sh_audio->codec->dll_name)) { MSG_ERR("win32.dll looks broken :(\n"); @@ -218,7 +193,6 @@ close_vqf_audio_codec(sh); free(sh->context); FreeLibrary(vqf_dll); - dlclose(dll_handle); } int control(sh_audio_t *sh_audio,int cmd,void* arg, ...) Modified: mplayerxp/libmpcodecs/codecs_ld.c =================================================================== --- mplayerxp/libmpcodecs/codecs_ld.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/codecs_ld.c 2009-12-26 10:39:37 UTC (rev 54) @@ -33,13 +33,6 @@ return cname; } -char * wineld_name( const char *name ) -{ - strcpy(cname,CODECDIR"/wine/"); - strcat(cname,name); - return cname; -} - void * ld_sym(void *handle,const char *sym_name) { void *rval; Modified: mplayerxp/libmpcodecs/codecs_ld.h =================================================================== --- mplayerxp/libmpcodecs/codecs_ld.h 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/codecs_ld.h 2009-12-26 10:39:37 UTC (rev 54) @@ -7,7 +7,6 @@ extern void * ld_codec(const char *name,const char *url_hint); extern char * codec_name( const char *name ); -extern char * wineld_name( const char *name ); extern void * ld_sym(void *handle,const char *sym_name); #if defined(__OpenBSD__) && !defined(__ELF__) Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/vd.c 2009-12-26 10:39:37 UTC (rev 54) @@ -43,23 +43,25 @@ extern const vd_functions_t mpcodecs_vd_theora; const vd_functions_t* mpcodecs_vd_drivers[] = { - &mpcodecs_vd_null, - &mpcodecs_vd_ffmpeg, - &mpcodecs_vd_dshow, - &mpcodecs_vd_vfw, - &mpcodecs_vd_vfwex, - &mpcodecs_vd_divx4, - &mpcodecs_vd_raw, - &mpcodecs_vd_nuv, - &mpcodecs_vd_libmpeg2, - &mpcodecs_vd_xvid, - &mpcodecs_vd_mpegpes, - &mpcodecs_vd_huffyuv, - &mpcodecs_vd_xanim, - &mpcodecs_vd_real, - &mpcodecs_vd_dmo, - &mpcodecs_vd_qtvideo, - &mpcodecs_vd_theora, + &mpcodecs_vd_null, + &mpcodecs_vd_ffmpeg, +#ifdef HAVE_WIN32LOADER + &mpcodecs_vd_dshow, + &mpcodecs_vd_vfw, + &mpcodecs_vd_vfwex, + &mpcodecs_vd_dmo, + &mpcodecs_vd_qtvideo, +#endif + &mpcodecs_vd_divx4, + &mpcodecs_vd_raw, + &mpcodecs_vd_nuv, + &mpcodecs_vd_libmpeg2, + &mpcodecs_vd_xvid, + &mpcodecs_vd_mpegpes, + &mpcodecs_vd_huffyuv, + &mpcodecs_vd_xanim, + &mpcodecs_vd_real, + &mpcodecs_vd_theora, NULL }; static unsigned int nddrivers=sizeof(mpcodecs_vd_drivers)/sizeof(vd_functions_t*); Modified: mplayerxp/libmpcodecs/vd_dmo.c =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/vd_dmo.c 2009-12-26 10:39:37 UTC (rev 54) @@ -11,7 +11,7 @@ #include "vd_internal.h" #include "codecs_ld.h" -#include "../../loader/dmo/DMO_VideoDecoder.h" +#include "loader/dmo/DMO_VideoDecoder.h" #include "vd_msg.h" static const vd_info_t info = { @@ -28,31 +28,6 @@ LIBVD_EXTERN(dmo) -static DMO_VideoDecoder * (*DMO_VideoDecoder_Open_ptr)(char* dllname, GUID* guid, BITMAPINFOHEADER * format, int flip, int maxauto); -static void (*DMO_VideoDecoder_Destroy_ptr)(DMO_VideoDecoder *this); -static void (*DMO_VideoDecoder_StartInternal_ptr)(DMO_VideoDecoder *this); -static int (*DMO_VideoDecoder_DecodeInternal_ptr)(DMO_VideoDecoder *this, const void* src, int size, int is_keyframe, char* pImage); -static int (*DMO_VideoDecoder_SetDestFmt_ptr)(DMO_VideoDecoder *this, int bits, unsigned int csp); - -#define DMO_VideoDecoder_Open(a,b,c,d,e) (*DMO_VideoDecoder_Open_ptr)(a,b,c,d,e) -#define DMO_VideoDecoder_Destroy(a) (*DMO_VideoDecoder_Destroy_ptr)(a) -#define DMO_VideoDecoder_StartInternal(a) (*DMO_VideoDecoder_StartInternal_ptr)(a) -#define DMO_VideoDecoder_DecodeInternal(a,b,c,d,e) (*DMO_VideoDecoder_DecodeInternal_ptr)(a,b,c,d,e) -#define DMO_VideoDecoder_SetDestFmt(a,b,c) (*DMO_VideoDecoder_SetDestFmt_ptr)(a,b,c) - -static void *dll_handle; -static int load_lib( const char *libname ) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - DMO_VideoDecoder_Open_ptr = ld_sym(dll_handle,"DMO_VideoDecoder_Open"); - DMO_VideoDecoder_Destroy_ptr = ld_sym(dll_handle,"DMO_VideoDecoder_Destroy"); - DMO_VideoDecoder_StartInternal_ptr = ld_sym(dll_handle,"DMO_VideoDecoder_StartInternal"); - DMO_VideoDecoder_DecodeInternal_ptr = ld_sym(dll_handle,"DMO_VideoDecoder_DecodeInternal"); - DMO_VideoDecoder_SetDestFmt_ptr = ld_sym(dll_handle,"DMO_VideoDecoder_SetDestFmt"); - return DMO_VideoDecoder_Open_ptr && DMO_VideoDecoder_Destroy_ptr && DMO_VideoDecoder_StartInternal_ptr && - DMO_VideoDecoder_DecodeInternal_ptr && DMO_VideoDecoder_SetDestFmt_ptr; -} - // to set/get/query special features/parameters static int control(sh_video_t *sh,int cmd,void* arg,...){ switch(cmd){ @@ -73,7 +48,6 @@ // init driver static int init(sh_video_t *sh){ unsigned int out_fmt; - if(!load_lib(wineld_name("DMO_Filter"SLIBSUFFIX))) return 0; if(!(sh->context=DMO_VideoDecoder_Open(sh->codec->dll_name,&sh->codec->guid, sh->bih, 0, 0))){ MSG_ERR(MSGTR_MissingDLLcodec,sh->codec->dll_name); MSG_HINT("Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n" @@ -103,7 +77,6 @@ // uninit driver static void uninit(sh_video_t *sh){ DMO_VideoDecoder_Destroy(sh->context); - dlclose(dll_handle); } // decode a frame Modified: mplayerxp/libmpcodecs/vd_dshow.c =================================================================== --- mplayerxp/libmpcodecs/vd_dshow.c 2009-12-21 18:42:47 UTC (rev 53) +++ mplayerxp/libmpcodecs/vd_dshow.c 2009-12-26 10:39:37 UTC (rev 54) @@ -9,7 +9,7 @@ #include "vd_internal.h" -#include "interface/dshow/DS_VideoDecoder.h" +#include "loader/dshow/DS_VideoDecoder.h" #include "codecs_ld.h" static const vd_info_t info = { @@ -26,37 +26,6 @@ LIBVD_EXTERN(dshow) -void* (*DS_VideoDecoder_Open_ptr)(char* dllname, GUID* guid, BITMAPINFOHEADER* format, int flip, int maxauto); - -void (*DS_VideoDecoder_StartInternal_ptr)(void* _handle); - -void (*DS_VideoDecoder_Destroy_ptr)(void* _handle); - -int (*DS_VideoDecoder_DecodeInternal_ptr)(void* _handle, char* src, int size, int is_keyframe, char* dest); - -int (*DS_VideoDecoder_SetDestFmt_ptr)(void* _handle, int bits, int csp); - -int (*DS_VideoDecoder_SetValue_ptr)(void* _handle, char* name, int value); -int (*DS_SetAttr_DivX_ptr)(char* attribute, int value); - -static void *dll_handle; - -static int load_lib( const char *libname ) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - DS_VideoDecoder_Open_ptr = ld_sym(dll_handle,"DS_VideoDecoder_Open"); - DS_VideoDecoder_StartInternal_ptr = ld_sym(dll_handle,"DS_VideoDecoder_StartInternal"); - DS_VideoDecoder_Destroy_ptr = ld_sym(dll_handle,"DS_VideoDecoder_Destroy"); - DS_VideoDecoder_DecodeInternal_ptr = ld_sym(dll_handle,"DS_VideoDecoder_DecodeInternal"); - DS_VideoDecoder_SetDestFmt_ptr = ld_sym(dll_handle,"DS_VideoDecoder_SetDestFmt"); - DS_VideoDecoder_SetValue_ptr = ld_sym(dll_handle,"DS_VideoDecoder_SetValue"); - DS_SetAttr_DivX_ptr = ld_sym(dll_handle,"DS_SetAttr_DivX"); - return DS_VideoDecoder_Open_ptr && DS_VideoDecoder_StartInternal_ptr && - DS_VideoDecoder_Destroy_ptr && DS_VideoDecoder_DecodeInternal_ptr && - DS_VideoDecoder_SetDestFmt_ptr && DS_VideoDecoder_SetValue_ptr && - DS_SetAttr_DivX_ptr; -} - // to set/get/query special features/parameters static int control(sh_video_t *sh,int cmd,void* arg,...){ switch(cmd){ @@ -64,7 +33,7 @@ return 4; case VDCTRL_SET_PP_LEVEL: if(!sh->context) return CONTROL_ERROR; - (*DS_VideoDecoder_SetValue_ptr)(sh->context,"Quality",*((int*)arg)); + DS_VideoDecoder_SetValue(sh->context,"Quality",*((int*)arg)); return CONTROL_OK; case VDCTRL_SET_EQUALIZER: { va_list ap; @@ -73,7 +42,7 @@ value=va_arg(ap, int); va_end(ap); value=(value/2)+50; - if((*DS_VideoDecoder_SetValue_ptr)(sh->context,arg,value)==0) + if(DS_VideoDecoder_SetValue(sh->context,arg,value)==0) return CONTROL_OK; return CONTROL_FALSE; } @@ -94,8 +63,7 @@ // init driver static int init(sh_video_t *sh){ unsigned int out_fmt; - if(!load_lib(wineld_name("DS_Filter"SLIBSUFFIX))) return 0; - if(!(sh->context=(*DS_VideoDecoder_Open_ptr)(sh->codec->dll_name,&sh->codec->guid, sh->bih, 0, 0))){ + if(!(sh->context=DS_VideoDecoder_Open(sh->codec->dll_name,&sh->codec->guid, sh->bih, 0, 0))){ MSG_ERR(MSGTR_MissingDLLcodec,sh->codec->dll_name); MSG_HINT("Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n"); MSG_HINT("package from: ftp://mplayerhq.hu/MPlayer/releases/w32codec.zip !\n"); @@ -106,44 +74,43 @@ switch(out_fmt){ case IMGFMT_YUY2: case IMGFMT_UYVY: - (*DS_VideoDecoder_SetDestFmt_ptr)(sh->context,16,out_fmt);break; // packed YUV + DS_VideoDecoder_SetDestFmt(sh->context,16,out_fmt);break; // packed YUV case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_IYUV: - (*DS_VideoDecoder_SetDestFmt_ptr)(sh->context,12,out_fmt);break; // planar YUV + DS_VideoDecoder_SetDestFmt(sh->context,12,out_fmt);break; // planar YUV case IMGFMT_YVU9: - (*DS_VideoDecoder_SetDestFmt_ptr)(sh->context,9,out_fmt);break; + DS_VideoDecoder_SetDestFmt(sh->context,9,out_fmt);break; default: - (*DS_VideoDecoder_SetDestFmt_ptr)(sh->context,out_fmt&255,0); // RGB/BGR + DS_VideoDecoder_SetDestFmt(sh->context,out_fmt&255,0); // RGB/BGR } - (*DS_SetAtt... [truncated message content] |
From: <nic...@us...> - 2010-01-01 09:47:01
|
Revision: 55 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=55&view=rev Author: nickols_k Date: 2010-01-01 09:46:55 +0000 (Fri, 01 Jan 2010) Log Message: ----------- Fixed some lacks Modified Paths: -------------- mplayerxp/configure mplayerxp/libmpcodecs/ad_ffmp3.c Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2009-12-26 10:39:37 UTC (rev 54) +++ mplayerxp/configure 2010-01-01 09:46:55 UTC (rev 55) @@ -99,8 +99,8 @@ "exec_prefix|architecture-dependent files|\$prefix", "bindir|user executables|\$exec_prefix/bin", "libdir|object code libraries|\$exec_prefix/lib", - "datadir|read-only architecture-independent data|\$prefix/share", - "confdir|read-only configuration files|\$prefix/share", + "datadir|read-only architecture-independent data|\$prefix/share/mplayerxp", + "confdir|read-only configuration files|\$prefix/share/mplayerxp", "codecdir|codec's shared libraries|\$libdir/mplayerxp", "win32libdir|win32 .dll locations [/usr/lib/win32]" ) @@ -313,7 +313,7 @@ test -z "$libdir" && libdir="." test -z "$codecdir" && codecdir="." else -test -z "$codecdir" && codecdir="$libdir/$prog_alias" +codecdir="$libdir/$prog_alias" fi srcdir=`pwd` Modified: mplayerxp/libmpcodecs/ad_ffmp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_ffmp3.c 2009-12-26 10:39:37 UTC (rev 54) +++ mplayerxp/libmpcodecs/ad_ffmp3.c 2010-01-01 09:46:55 UTC (rev 55) @@ -126,9 +126,10 @@ lavc_context->extradata = malloc(sh_audio->codecdata_len); lavc_context->extradata_size = sh_audio->codecdata_len; memcpy(lavc_context->extradata, (char *)sh_audio->codecdata, - lavc_context->extradata_size); + lavc_context->extradata_size); } lavc_context->codec_tag = sh_audio->format; + lavc_context->codec_type = lavc_codec->type; lavc_context->codec_id = lavc_codec->id; /* open it */ if ((*avcodec_open_ptr)(lavc_context, lavc_codec) < 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-03 18:01:10
|
Revision: 64 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=64&view=rev Author: nickols_k Date: 2010-01-03 18:00:58 +0000 (Sun, 03 Jan 2010) Log Message: ----------- simplify opengl driver Modified Paths: -------------- functions mplayerxp/configure mplayerxp/libvo/Makefile mplayerxp/libvo/vo_opengl.c mplayerxp/libvo/vo_x11.c mplayerxp/libvo/vo_xv.c mplayerxp/libvo/x11_common.c Removed Paths: ------------- mplayerxp/libvo/gl_common.c mplayerxp/libvo/gl_common.h Modified: functions =================================================================== --- functions 2010-01-03 14:25:30 UTC (rev 63) +++ functions 2010-01-03 18:00:58 UTC (rev 64) @@ -1119,7 +1119,7 @@ if test -z $CFLAGS ; then add_cflags $locarch fi -if enabled profile || test $debug -gt 0 || enabled gcov; then +if enabled profile || test "$debug" != "0" || enabled gcov; then add_cflags "-O2 -fno-builtin" if enabled profile ; then add_cflags "-pg" Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-03 14:25:30 UTC (rev 63) +++ mplayerxp/configure 2010-01-03 18:00:58 UTC (rev 64) @@ -361,7 +361,7 @@ x86_64 && _arch="x86_64" ffmpeg_args="--arch=$arch $ffmpeg_args" fi -test "$debug" -gt "0" && ffmpeg_args="$ffmpeg_args --enable-debug=$debug" +test "$debug" != "0" && ffmpeg_args="$ffmpeg_args --enable-debug=$debug" enabled $profile && ffmpeg_args="$ffmpeg_args --enable-profile" echocheck "configuring ffmpeg stuff: --cc=\"$cc\" $ffmpeg_args" cd ../ffmpeg Modified: mplayerxp/libvo/Makefile =================================================================== --- mplayerxp/libvo/Makefile 2010-01-03 14:25:30 UTC (rev 63) +++ mplayerxp/libvo/Makefile 2010-01-03 18:00:58 UTC (rev 64) @@ -8,7 +8,7 @@ SRCS+=vo_sdl.c endif ifeq ($(HAVE_OPENGL),yes) -SRCS+=gl_common.c vo_opengl.c +SRCS+=vo_opengl.c endif ifeq ($(HAVE_VDPAU),yes) SRCS+=vo_vdpau.c Deleted: mplayerxp/libvo/gl_common.c =================================================================== --- mplayerxp/libvo/gl_common.c 2010-01-03 14:25:30 UTC (rev 63) +++ mplayerxp/libvo/gl_common.c 2010-01-03 18:00:58 UTC (rev 64) @@ -1,1698 +0,0 @@ -/* - * common OpenGL routines - * - * copyleft (C) 2005 Reimar Döffinger <Rei...@st...> - * Special thanks go to the xine team and Matthias Hopf, whose video_out_opengl.c - * gave me lots of good ideas. - * - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * \file gl_common.c - * \brief OpenGL helper functions used by vo_gl.c and vo_gl2.c - */ - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include <math.h> -#include "gl_common.h" -#include "img_format.h" -#include "vo_msg.h" -#include "libavutil/common.h" - -/** - * \defgroup glextfunctions OpenGL extension functions - * - * the pointers to these functions are acquired when the OpenGL - * context is created - * \{ - */ -void (APIENTRY *GenBuffers)(GLsizei, GLuint *); -void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *); -void (APIENTRY *BindBuffer)(GLenum, GLuint); -GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); -GLboolean (APIENTRY *UnmapBuffer)(GLenum); -void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum); -void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *); -void (APIENTRY *CombinerParameteri)(GLenum, GLint); -void (APIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum, - GLenum); -void (APIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum, - GLenum, GLenum, GLboolean, GLboolean, - GLboolean); -void (APIENTRY *BeginFragmentShader)(void); -void (APIENTRY *EndFragmentShader)(void); -void (APIENTRY *SampleMap)(GLuint, GLuint, GLenum); -void (APIENTRY *ColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint, - GLuint, GLuint, GLuint, GLuint, GLuint); -void (APIENTRY *ColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint, - GLuint, GLuint, GLuint, GLuint, GLuint, - GLuint, GLuint, GLuint); -void (APIENTRY *SetFragmentShaderConstant)(GLuint, const GLfloat *); -void (APIENTRY *ActiveTexture)(GLenum); -void (APIENTRY *BindTexture)(GLenum, GLuint); -void (APIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat); -void (APIENTRY *GenPrograms)(GLsizei, GLuint *); -void (APIENTRY *DeletePrograms)(GLsizei, const GLuint *); -void (APIENTRY *BindProgram)(GLenum, GLuint); -void (APIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *); -void (APIENTRY *GetProgramiv)(GLenum, GLenum, GLint *); -void (APIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat, - GLfloat, GLfloat); -int (APIENTRY *SwapInterval)(int); -void (APIENTRY *TexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, - GLint, GLenum, GLenum, const GLvoid *); -void* (APIENTRY *AllocateMemoryMESA)(void *, int, size_t, float, float, float); -void (APIENTRY *FreeMemoryMESA)(void *, int, void *); -/** \} */ // end of glextfunctions group - -//! \defgroup glgeneral OpenGL general helper functions - -//! \defgroup glcontext OpenGL context management helper functions - -//! \defgroup gltexture OpenGL texture handling helper functions - -//! \defgroup glconversion OpenGL conversion helper functions - -static GLint hqtexfmt; - -/** - * \brief adjusts the GL_UNPACK_ALIGNMENT to fit the stride. - * \param stride number of bytes per line for which alignment should fit. - * \ingroup glgeneral - */ -void glAdjustAlignment(int stride) { - GLint gl_alignment; - if (stride % 8 == 0) - gl_alignment=8; - else if (stride % 4 == 0) - gl_alignment=4; - else if (stride % 2 == 0) - gl_alignment=2; - else - gl_alignment=1; - glPixelStorei (GL_UNPACK_ALIGNMENT, gl_alignment); -} - -struct gl_name_map_struct { - GLint value; - const char *name; -}; - -#undef MAP -#define MAP(a) {a, #a} -//! mapping table for the glValName function -static const struct gl_name_map_struct gl_name_map[] = { - // internal format - MAP(GL_R3_G3_B2), MAP(GL_RGB4), MAP(GL_RGB5), MAP(GL_RGB8), - MAP(GL_RGB10), MAP(GL_RGB12), MAP(GL_RGB16), MAP(GL_RGBA2), - MAP(GL_RGBA4), MAP(GL_RGB5_A1), MAP(GL_RGBA8), MAP(GL_RGB10_A2), - MAP(GL_RGBA12), MAP(GL_RGBA16), MAP(GL_LUMINANCE8), - - // format - MAP(GL_RGB), MAP(GL_RGBA), MAP(GL_RED), MAP(GL_GREEN), MAP(GL_BLUE), - MAP(GL_ALPHA), MAP(GL_LUMINANCE), MAP(GL_LUMINANCE_ALPHA), - MAP(GL_COLOR_INDEX), - // rest 1.2 only - MAP(GL_BGR), MAP(GL_BGRA), - - //type - MAP(GL_BYTE), MAP(GL_UNSIGNED_BYTE), MAP(GL_SHORT), MAP(GL_UNSIGNED_SHORT), - MAP(GL_INT), MAP(GL_UNSIGNED_INT), MAP(GL_FLOAT), MAP(GL_DOUBLE), - MAP(GL_2_BYTES), MAP(GL_3_BYTES), MAP(GL_4_BYTES), - // rest 1.2 only - MAP(GL_UNSIGNED_BYTE_3_3_2), MAP(GL_UNSIGNED_BYTE_2_3_3_REV), - MAP(GL_UNSIGNED_SHORT_5_6_5), MAP(GL_UNSIGNED_SHORT_5_6_5_REV), - MAP(GL_UNSIGNED_SHORT_4_4_4_4), MAP(GL_UNSIGNED_SHORT_4_4_4_4_REV), - MAP(GL_UNSIGNED_SHORT_5_5_5_1), MAP(GL_UNSIGNED_SHORT_1_5_5_5_REV), - MAP(GL_UNSIGNED_INT_8_8_8_8), MAP(GL_UNSIGNED_INT_8_8_8_8_REV), - MAP(GL_UNSIGNED_INT_10_10_10_2), MAP(GL_UNSIGNED_INT_2_10_10_10_REV), - {0, 0} -}; -#undef MAP - -/** - * \brief return the name of an OpenGL constant - * \param value the constant - * \return name of the constant or "Unknown format!" - * \ingroup glgeneral - */ -const char *glValName(GLint value) -{ - int i = 0; - - while (gl_name_map[i].name) { - if (gl_name_map[i].value == value) - return gl_name_map[i].name; - i++; - } - return "Unknown format!"; -} - -//! always return this format as internal texture format in glFindFormat -#define TEXTUREFORMAT_ALWAYS GL_RGB8 -#undef TEXTUREFORMAT_ALWAYS - -/** - * \brief find the OpenGL settings coresponding to format. - * - * All parameters may be NULL. - * \param fmt MPlayer format to analyze. - * \param bpp [OUT] bits per pixel of that format. - * \param gl_texfmt [OUT] internal texture format that fits the - * image format, not necessarily the best for performance. - * \param gl_format [OUT] OpenGL format for this image format. - * \param gl_type [OUT] OpenGL type for this image format. - * \return 1 if format is supported by OpenGL, 0 if not. - * \ingroup gltexture - */ -int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt, - GLenum *gl_format, GLenum *gl_type) -{ - int supported = 1; - int dummy1; - GLenum dummy2; - GLint dummy3; - if (!bpp) bpp = &dummy1; - if (!gl_texfmt) gl_texfmt = &dummy3; - if (!gl_format) gl_format = &dummy2; - if (!gl_type) gl_type = &dummy2; - - *bpp = IMGFMT_IS_BGR(fmt)?IMGFMT_BGR_DEPTH(fmt):IMGFMT_RGB_DEPTH(fmt); - *gl_texfmt = 3; - switch (fmt) { - case IMGFMT_RGB48NE: - *gl_format = GL_RGB; - *gl_type = GL_UNSIGNED_SHORT; - break; - case IMGFMT_RGB24: - *gl_format = GL_RGB; - *gl_type = GL_UNSIGNED_BYTE; - break; - case IMGFMT_RGBA: - *gl_texfmt = 4; - *gl_format = GL_RGBA; - *gl_type = GL_UNSIGNED_BYTE; - break; - case IMGFMT_YV12: - supported = 0; // no native YV12 support - case IMGFMT_Y800: - case IMGFMT_Y8: - *gl_texfmt = 1; - *bpp = 8; - *gl_format = GL_LUMINANCE; - *gl_type = GL_UNSIGNED_BYTE; - break; - case IMGFMT_UYVY: - case IMGFMT_YUY2: - *gl_texfmt = GL_YCBCR_MESA; - *bpp = 16; - *gl_format = GL_YCBCR_MESA; - *gl_type = fmt == IMGFMT_UYVY ? GL_UNSIGNED_SHORT_8_8 : GL_UNSIGNED_SHORT_8_8_REV; - break; -#if 0 - // we do not support palettized formats, although the format the - // swscale produces works - case IMGFMT_RGB8: - gl_format = GL_RGB; - gl_type = GL_UNSIGNED_BYTE_2_3_3_REV; - break; -#endif - case IMGFMT_RGB15: - *gl_format = GL_RGBA; - *gl_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - break; - case IMGFMT_RGB16: - *gl_format = GL_RGB; - *gl_type = GL_UNSIGNED_SHORT_5_6_5_REV; - break; -#if 0 - case IMGFMT_BGR8: - // special case as red and blue have a differen number of bits. - // GL_BGR and GL_UNSIGNED_BYTE_3_3_2 isn't supported at least - // by nVidia drivers, and in addition would give more bits to - // blue than to red, which isn't wanted - gl_format = GL_RGB; - gl_type = GL_UNSIGNED_BYTE_3_3_2; - break; -#endif - case IMGFMT_BGR15: - *gl_format = GL_BGRA; - *gl_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - break; - case IMGFMT_BGR16: - *gl_format = GL_RGB; - *gl_type = GL_UNSIGNED_SHORT_5_6_5; - break; - case IMGFMT_BGR24: - *gl_format = GL_BGR; - *gl_type = GL_UNSIGNED_BYTE; - break; - case IMGFMT_BGRA: - *gl_texfmt = 4; - *gl_format = GL_BGRA; - *gl_type = GL_UNSIGNED_BYTE; - break; - default: - *gl_texfmt = 4; - *gl_format = GL_RGBA; - *gl_type = GL_UNSIGNED_BYTE; - supported = 0; - } -#ifdef TEXTUREFORMAT_ALWAYS - *gl_texfmt = TEXTUREFORMAT_ALWAYS; -#endif - return supported; -} - -static void *setNull(const GLubyte *s) { - return NULL; -} - -typedef struct { - void *funcptr; - const char *extstr; - const char *funcnames[7]; -} extfunc_desc_t; - -static const extfunc_desc_t extfuncs[] = { - {&GenBuffers, NULL, {"glGenBuffers", "glGenBuffersARB", NULL}}, - {&DeleteBuffers, NULL, {"glDeleteBuffers", "glDeleteBuffersARB", NULL}}, - {&BindBuffer, NULL, {"glBindBuffer", "glBindBufferARB", NULL}}, - {&MapBuffer, NULL, {"glMapBuffer", "glMapBufferARB", NULL}}, - {&UnmapBuffer, NULL, {"glUnmapBuffer", "glUnmapBufferARB", NULL}}, - {&BufferData, NULL, {"glBufferData", "glBufferDataARB", NULL}}, - {&CombinerParameterfv, "NV_register_combiners", {"glCombinerParameterfv", "glCombinerParameterfvNV", NULL}}, - {&CombinerParameteri, "NV_register_combiners", {"glCombinerParameteri", "glCombinerParameteriNV", NULL}}, - {&CombinerInput, "NV_register_combiners", {"glCombinerInput", "glCombinerInputNV", NULL}}, - {&CombinerOutput, "NV_register_combiners", {"glCombinerOutput", "glCombinerOutputNV", NULL}}, - {&BeginFragmentShader, "ATI_fragment_shader", {"glBeginFragmentShaderATI", NULL}}, - {&EndFragmentShader, "ATI_fragment_shader", {"glEndFragmentShaderATI", NULL}}, - {&SampleMap, "ATI_fragment_shader", {"glSampleMapATI", NULL}}, - {&ColorFragmentOp2, "ATI_fragment_shader", {"glColorFragmentOp2ATI", NULL}}, - {&ColorFragmentOp3, "ATI_fragment_shader", {"glColorFragmentOp3ATI", NULL}}, - {&SetFragmentShaderConstant, "ATI_fragment_shader", {"glSetFragmentShaderConstantATI", NULL}}, - {&ActiveTexture, NULL, {"glActiveTexture", "glActiveTextureARB", NULL}}, - {&BindTexture, NULL, {"glBindTexture", "glBindTextureARB", "glBindTextureEXT", NULL}}, - {&MultiTexCoord2f, NULL, {"glMultiTexCoord2f", "glMultiTexCoord2fARB", NULL}}, - {&GenPrograms, "_program", {"glGenProgramsARB", NULL}}, - {&DeletePrograms, "_program", {"glDeleteProgramsARB", NULL}}, - {&BindProgram, "_program", {"glBindProgramARB", NULL}}, - {&ProgramString, "_program", {"glProgramStringARB", NULL}}, - {&GetProgramiv, "_program", {"glGetProgramivARB", NULL}}, - {&ProgramEnvParameter4f, "_program", {"glProgramEnvParameter4fARB", NULL}}, - {&SwapInterval, "_swap_control", {"glXSwapInterval", "glXSwapIntervalEXT", "glXSwapIntervalSGI", "wglSwapInterval", "wglSwapIntervalEXT", "wglSwapIntervalSGI", NULL}}, - {&TexImage3D, NULL, {"glTexImage3D", NULL}}, - {&AllocateMemoryMESA, "GLX_MESA_allocate_memory", {"glXAllocateMemoryMESA", NULL}}, - {&FreeMemoryMESA, "GLX_MESA_allocate_memory", {"glXFreeMemoryMESA", NULL}}, - {NULL} -}; - -/** - * \brief find the function pointers of some useful OpenGL extensions - * \param getProcAddress function to resolve function names, may be NULL - * \param ext2 an extra extension string - */ -static void getFunctions(void *(*getProcAddress)(const GLubyte *), - const char *ext2) { - const extfunc_desc_t *dsc; - const char *extensions = (const char *)glGetString(GL_EXTENSIONS); - char *allexts; - if (!extensions) extensions = ""; - if (!ext2) ext2 = ""; - allexts = malloc(strlen(extensions) + strlen(ext2) + 2); - strcpy(allexts, extensions); - strcat(allexts, " "); - strcat(allexts, ext2); - MSG_DBG2("OpenGL extensions string:\n%s\n", allexts); - if (!getProcAddress) - getProcAddress = setNull; - for (dsc = extfuncs; dsc->funcptr; dsc++) { - void *ptr = NULL; - int i; - if (!dsc->extstr || strstr(allexts, dsc->extstr)) { - for (i = 0; !ptr && dsc->funcnames[i]; i++) - ptr = getProcAddress((const GLubyte *)dsc->funcnames[i]); - } - *(void **)dsc->funcptr = ptr; - } - if (strstr(allexts, "_texture_float")) - hqtexfmt = GL_RGB32F; - else if (strstr(allexts, "NV_float_buffer")) - hqtexfmt = GL_FLOAT_RGB32_NV; - else - hqtexfmt = GL_RGB16; - free(allexts); -} - -/** - * \brief create a texture and set some defaults - * \param target texture taget, usually GL_TEXTURE_2D - * \param fmt internal texture format - * \param format texture host data format - * \param type texture host data type - * \param filter filter used for scaling, e.g. GL_LINEAR - * \param w texture width - * \param h texture height - * \param val luminance value to fill texture with - * \ingroup gltexture - */ -void glCreateClearTex(GLenum target, GLenum fmt, GLenum format, GLenum type, GLint filter, - int w, int h, unsigned char val) { - GLfloat fval = (GLfloat)val / 255.0; - GLfloat border[4] = {fval, fval, fval, fval}; - int stride = w * glFmt2bpp(format, type); - char *init; - if (!stride) return; - init = malloc(stride * h); - memset(init, val, stride * h); - glAdjustAlignment(stride); - glPixelStorei(GL_UNPACK_ROW_LENGTH, w); - glTexImage2D(target, 0, fmt, w, h, 0, format, type, init); - glTexParameterf(target, GL_TEXTURE_PRIORITY, 1.0); - glTexParameteri(target, GL_TEXTURE_MIN_FILTER, filter); - glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filter); - glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - // Border texels should not be used with CLAMP_TO_EDGE - // We set a sane default anyway. - glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border); - free(init); -} - -/** - * \brief skips whitespace and comments - * \param f file to read from - */ -static void ppm_skip(FILE *f) { - int c, comment = 0; - do { - c = fgetc(f); - if (c == '#') - comment = 1; - if (c == '\n') - comment = 0; - } while (c != EOF && (isspace(c) || comment)); - if (c != EOF) - ungetc(c, f); -} - -#define MAXDIM (16 * 1024) - -/** - * \brief creates a texture from a PPM file - * \param target texture taget, usually GL_TEXTURE_2D - * \param fmt internal texture format, 0 for default - * \param filter filter used for scaling, e.g. GL_LINEAR - * \param f file to read PPM from - * \param width [out] width of texture - * \param height [out] height of texture - * \param maxval [out] maxval value from PPM file - * \return 0 on error, 1 otherwise - * \ingroup gltexture - */ -int glCreatePPMTex(GLenum target, GLenum fmt, GLint filter, - FILE *f, int *width, int *height, int *maxval) { - unsigned w, h, m, val, bpp; - char *data; - GLenum type; - ppm_skip(f); - if (fgetc(f) != 'P' || fgetc(f) != '6') - return 0; - ppm_skip(f); - if (fscanf(f, "%u", &w) != 1) - return 0; - ppm_skip(f); - if (fscanf(f, "%u", &h) != 1) - return 0; - ppm_skip(f); - if (fscanf(f, "%u", &m) != 1) - return 0; - val = fgetc(f); - if (!isspace(val)) - return 0; - if (w > MAXDIM || h > MAXDIM) - return 0; - bpp = (m > 255) ? 6 : 3; - data = malloc(w * h * bpp); - if (fread(data, w * bpp, h, f) != h) { - free(data); - return 0; - } - if (!fmt) { - fmt = (m > 255) ? hqtexfmt : 3; - if (fmt == GL_FLOAT_RGB32_NV && target != GL_TEXTURE_RECTANGLE) - fmt = GL_RGB16; - } - type = m > 255 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE; - glCreateClearTex(target, fmt, GL_RGB, type, filter, w, h, 0); - glUploadTex(target, GL_RGB, type, - data, w * bpp, 0, 0, w, h, 0); - free(data); - if (width) *width = w; - if (height) *height = h; - if (maxval) *maxval = m; - return 1; -} - -/** - * \brief return the number of bytes per pixel for the given format - * \param format OpenGL format - * \param type OpenGL type - * \return bytes per pixel - * \ingroup glgeneral - * - * Does not handle all possible variants, just those used by MPlayer - */ -int glFmt2bpp(GLenum format, GLenum type) { - int component_size = 0; - switch (type) { - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - return 1; - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - return 2; - case GL_UNSIGNED_BYTE: - component_size = 1; - break; - case GL_UNSIGNED_SHORT: - component_size = 2; - break; - } - switch (format) { - case GL_LUMINANCE: - case GL_ALPHA: - return component_size; - case GL_YCBCR_MESA: - return 2; - case GL_RGB: - case GL_BGR: - return 3 * component_size; - case GL_RGBA: - case GL_BGRA: - return 4 * component_size; - } - return 0; // unknown -} - -/** - * \brief upload a texture, handling things like stride and slices - * \param target texture target, usually GL_TEXTURE_2D - * \param format OpenGL format of data - * \param type OpenGL type of data - * \param dataptr data to upload - * \param stride data stride - * \param x x offset in texture - * \param y y offset in texture - * \param w width of the texture part to upload - * \param h height of the texture part to upload - * \param slice height of an upload slice, 0 for all at once - * \ingroup gltexture - */ -void glUploadTex(GLenum target, GLenum format, GLenum type, - const void *dataptr, int stride, - int x, int y, int w, int h, int slice) { - const uint8_t *data = dataptr; - int y_max = y + h; - if (w <= 0 || h <= 0) return; - if (slice <= 0) - slice = h; - if (stride < 0) { - data += (h - 1) * stride; - stride = -stride; - } - // this is not always correct, but should work for MPlayer - glAdjustAlignment(stride); - glPixelStorei(GL_UNPACK_ROW_LENGTH, stride / glFmt2bpp(format, type)); - for (; y + slice <= y_max; y += slice) { - glTexSubImage2D(target, 0, x, y, w, slice, format, type, data); - data += stride * slice; - } - if (y < y_max) - glTexSubImage2D(target, 0, x, y, w, y_max - y, format, type, data); -} - -static void fillUVcoeff(GLfloat *ucoef, GLfloat *vcoef, - float uvcos, float uvsin) { - int i; - ucoef[0] = 0 * uvcos + 1.403 * uvsin; - vcoef[0] = 0 * uvsin + 1.403 * uvcos; - ucoef[1] = -0.344 * uvcos + -0.714 * uvsin; - vcoef[1] = -0.344 * uvsin + -0.714 * uvcos; - ucoef[2] = 1.770 * uvcos + 0 * uvsin; - vcoef[2] = 1.770 * uvsin + 0 * uvcos; - ucoef[3] = 0; - vcoef[3] = 0; - // Coefficients (probably) must be in [0, 1] range, whereas they originally - // are in [-2, 2] range, so here comes the trick: - // First put them in the [-0.5, 0.5] range, then add 0.5. - // This can be undone with the HALF_BIAS and SCALE_BY_FOUR arguments - // for CombinerInput and CombinerOutput (or the respective ATI variants) - for (i = 0; i < 4; i++) { - ucoef[i] = ucoef[i] * 0.25 + 0.5; - vcoef[i] = vcoef[i] * 0.25 + 0.5; - } -} - -/** - * \brief Setup register combiners for YUV to RGB conversion. - * \param uvcos used for saturation and hue adjustment - * \param uvsin used for saturation and hue adjustment - */ -static void glSetupYUVCombiners(float uvcos, float uvsin) { - GLfloat ucoef[4]; - GLfloat vcoef[4]; - GLint i; - if (!CombinerInput || !CombinerOutput || - !CombinerParameterfv || !CombinerParameteri) { - MSG_FATAL("[gl] Combiner functions missing!\n"); - return; - } - glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &i); - if (i < 2) - MSG_ERR( - "[gl] 2 general combiners needed for YUV combiner support (found %i)\n", i); - glGetIntegerv(GL_MAX_TEXTURE_UNITS, &i); - if (i < 3) - MSG_ERR( - "[gl] 3 texture units needed for YUV combiner support (found %i)\n", i); - fillUVcoeff(ucoef, vcoef, uvcos, uvsin); - CombinerParameterfv(GL_CONSTANT_COLOR0_NV, ucoef); - CombinerParameterfv(GL_CONSTANT_COLOR1_NV, vcoef); - - // UV first, like this green component cannot overflow - CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV, - GL_TEXTURE1, GL_HALF_BIAS_NORMAL_NV, GL_RGB); - CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV, - GL_CONSTANT_COLOR0_NV, GL_HALF_BIAS_NORMAL_NV, GL_RGB); - CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV, - GL_TEXTURE2, GL_HALF_BIAS_NORMAL_NV, GL_RGB); - CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_D_NV, - GL_CONSTANT_COLOR1_NV, GL_HALF_BIAS_NORMAL_NV, GL_RGB); - CombinerOutput(GL_COMBINER0_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, - GL_SPARE0_NV, GL_SCALE_BY_FOUR_NV, GL_NONE, GL_FALSE, - GL_FALSE, GL_FALSE); - - // stage 2 - CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_A_NV, GL_SPARE0_NV, - GL_SIGNED_IDENTITY_NV, GL_RGB); - CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, - GL_UNSIGNED_INVERT_NV, GL_RGB); - CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_C_NV, - GL_TEXTURE0, GL_SIGNED_IDENTITY_NV, GL_RGB); - CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, - GL_UNSIGNED_INVERT_NV, GL_RGB); - CombinerOutput(GL_COMBINER1_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, - GL_SPARE0_NV, GL_NONE, GL_NONE, GL_FALSE, - GL_FALSE, GL_FALSE); - - // leave final combiner stage in default mode - CombinerParameteri(GL_NUM_GENERAL_COMBINERS_NV, 2); -} - -/** - * \brief Setup ATI version of register combiners for YUV to RGB conversion. - * \param uvcos used for saturation and hue adjustment - * \param uvsin used for saturation and hue adjustment - * - * ATI called this fragment shader, but the name is confusing in the - * light of a very different OpenGL 2.0 extension with the same name - */ -static void glSetupYUVCombinersATI(float uvcos, float uvsin) { - GLfloat ucoef[4]; - GLfloat vcoef[4]; - GLint i; - if (!BeginFragmentShader || !EndFragmentShader || - !SetFragmentShaderConstant || !SampleMap || - !ColorFragmentOp2 || !ColorFragmentOp3) { - MSG_FATAL("[gl] Combiner (ATI) functions missing!\n"); - return; - } - glGetIntegerv(GL_NUM_FRAGMENT_REGISTERS_ATI, &i); - if (i < 3) - MSG_ERR( - "[gl] 3 registers needed for YUV combiner (ATI) support (found %i)\n", i); - glGetIntegerv (GL_MAX_TEXTURE_UNITS, &i); - if (i < 3) - MSG_ERR( - "[gl] 3 texture units needed for YUV combiner (ATI) support (found %i)\n", i); - fillUVcoeff(ucoef, vcoef, uvcos, uvsin); - BeginFragmentShader(); - SetFragmentShaderConstant(GL_CON_0_ATI, ucoef); - SetFragmentShaderConstant(GL_CON_1_ATI, vcoef); - SampleMap(GL_REG_0_ATI, GL_TEXTURE0, GL_SWIZZLE_STR_ATI); - SampleMap(GL_REG_1_ATI, GL_TEXTURE1, GL_SWIZZLE_STR_ATI); - SampleMap(GL_REG_2_ATI, GL_TEXTURE2, GL_SWIZZLE_STR_ATI); - // UV first, like this green component cannot overflow - ColorFragmentOp2(GL_MUL_ATI, GL_REG_1_ATI, GL_NONE, GL_NONE, - GL_REG_1_ATI, GL_NONE, GL_BIAS_BIT_ATI, - GL_CON_0_ATI, GL_NONE, GL_BIAS_BIT_ATI); - ColorFragmentOp3(GL_MAD_ATI, GL_REG_2_ATI, GL_NONE, GL_4X_BIT_ATI, - GL_REG_2_ATI, GL_NONE, GL_BIAS_BIT_ATI, - GL_CON_1_ATI, GL_NONE, GL_BIAS_BIT_ATI, - GL_REG_1_ATI, GL_NONE, GL_NONE); - ColorFragmentOp2(GL_ADD_ATI, GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_2_ATI, GL_NONE, GL_NONE); - EndFragmentShader(); -} - -/** - * \brief helper function for gen_spline_lookup_tex - * \param x subpixel-position ((0,1) range) to calculate weights for - * \param dst where to store transformed weights, must provide space for 4 GLfloats - * - * calculates the weights and stores them after appropriate transformation - * for the scaler fragment program. - */ -static void store_weights(float x, GLfloat *dst) { - float w0 = (((-1 * x + 3) * x - 3) * x + 1) / 6; - float w1 = ((( 3 * x - 6) * x + 0) * x + 4) / 6; - float w2 = (((-3 * x + 3) * x + 3) * x + 1) / 6; - float w3 = ((( 1 * x + 0) * x + 0) * x + 0) / 6; - *dst++ = 1 + x - w1 / (w0 + w1); - *dst++ = 1 - x + w3 / (w2 + w3); - *dst++ = w0 + w1; - *dst++ = 0; -} - -//! to avoid artefacts this should be rather large -#define LOOKUP_BSPLINE_RES (2 * 1024) -/** - * \brief creates the 1D lookup texture needed for fast higher-order filtering - * \param unit texture unit to attach texture to - */ -static void gen_spline_lookup_tex(GLenum unit) { - GLfloat *tex = calloc(4 * LOOKUP_BSPLINE_RES, sizeof(*tex)); - GLfloat *tp = tex; - int i; - for (i = 0; i < LOOKUP_BSPLINE_RES; i++) { - float x = (float)(i + 0.5) / LOOKUP_BSPLINE_RES; - store_weights(x, tp); - tp += 4; - } - store_weights(0, tex); - store_weights(1, &tex[4 * (LOOKUP_BSPLINE_RES - 1)]); - ActiveTexture(unit); - glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16, LOOKUP_BSPLINE_RES, 0, GL_RGBA, GL_FLOAT, tex); - glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_PRIORITY, 1.0); - glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT); - ActiveTexture(GL_TEXTURE0); - free(tex); -} - -static const char *bilin_filt_template = - "TEX yuv.%c, fragment.texcoord[%c], texture[%c], %s;"; - -#define BICUB_FILT_MAIN(textype) \ - /* first y-interpolation */ \ - "ADD coord, fragment.texcoord[%c].xyxy, cdelta.xyxw;" \ - "ADD coord2, fragment.texcoord[%c].xyxy, cdelta.zyzw;" \ - "TEX a.r, coord.xyxy, texture[%c], "textype";" \ - "TEX a.g, coord.zwzw, texture[%c], "textype";" \ - /* second y-interpolation */ \ - "TEX b.r, coord2.xyxy, texture[%c], "textype";" \ - "TEX b.g, coord2.zwzw, texture[%c], "textype";" \ - "LRP a.b, parmy.b, a.rrrr, a.gggg;" \ - "LRP a.a, parmy.b, b.rrrr, b.gggg;" \ - /* x-interpolation */ \ - "LRP yuv.%c, parmx.b, a.bbbb, a.aaaa;" - -static const char *bicub_filt_template_2D = - "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};" - "TEX parmx, coord.x, texture[%c], 1D;" - "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};" - "TEX parmy, coord.y, texture[%c], 1D;" - "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};" - BICUB_FILT_MAIN("2D"); - -static const char *bicub_filt_template_RECT = - "ADD coord, fragment.texcoord[%c], {0.5, 0.5};" - "TEX parmx, coord.x, texture[%c], 1D;" - "MUL cdelta.xz, parmx.rrgg, {-1, 0, 1, 0};" - "TEX parmy, coord.y, texture[%c], 1D;" - "MUL cdelta.yw, parmy.rrgg, {0, -1, 0, 1};" - BICUB_FILT_MAIN("RECT"); - -#define CALCWEIGHTS(t, s) \ - "MAD "t", {-0.5, 0.1666, 0.3333, -0.3333}, "s", {1, 0, -0.5, 0.5};" \ - "MAD "t", "t", "s", {0, 0, -0.5, 0.5};" \ - "MAD "t", "t", "s", {-0.6666, 0, 0.8333, 0.1666};" \ - "RCP a.x, "t".z;" \ - "RCP a.y, "t".w;" \ - "MAD "t".xy, "t".xyxy, a.xyxy, {1, 1, 0, 0};" \ - "ADD "t".x, "t".xxxx, "s";" \ - "SUB "t".y, "t".yyyy, "s";" - -static const char *bicub_notex_filt_template_2D = - "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};" - "FRC coord.xy, coord.xyxy;" - CALCWEIGHTS("parmx", "coord.xxxx") - "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};" - CALCWEIGHTS("parmy", "coord.yyyy") - "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};" - BICUB_FILT_MAIN("2D"); - -static const char *bicub_notex_filt_template_RECT = - "ADD coord, fragment.texcoord[%c], {0.5, 0.5};" - "FRC coord.xy, coord.xyxy;" - CALCWEIGHTS("parmx", "coord.xxxx") - "MUL cdelta.xz, parmx.rrgg, {-1, 0, 1, 0};" - CALCWEIGHTS("parmy", "coord.yyyy") - "MUL cdelta.yw, parmy.rrgg, {0, -1, 0, 1};" - BICUB_FILT_MAIN("RECT"); - -#define BICUB_X_FILT_MAIN(textype) \ - "ADD coord.xy, fragment.texcoord[%c].xyxy, cdelta.xyxy;" \ - "ADD coord2.xy, fragment.texcoord[%c].xyxy, cdelta.zyzy;" \ - "TEX a.r, coord, texture[%c], "textype";" \ - "TEX b.r, coord2, texture[%c], "textype";" \ - /* x-interpolation */ \ - "LRP yuv.%c, parmx.b, a.rrrr, b.rrrr;" - -static const char *bicub_x_filt_template_2D = - "MAD coord.x, fragment.texcoord[%c], {%f}, {0.5};" - "TEX parmx, coord, texture[%c], 1D;" - "MUL cdelta.xyz, parmx.rrgg, {-%f, 0, %f};" - BICUB_X_FILT_MAIN("2D"); - -static const char *bicub_x_filt_template_RECT = - "ADD coord.x, fragment.texcoord[%c], {0.5};" - "TEX parmx, coord, texture[%c], 1D;" - "MUL cdelta.xyz, parmx.rrgg, {-1, 0, 1};" - BICUB_X_FILT_MAIN("RECT"); - -static const char *unsharp_filt_template = - "PARAM dcoord%c = {%f, %f, %f, %f};" - "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" - "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" - "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" - "TEX b.r, coord.xyxy, texture[%c], %s;" - "TEX b.g, coord.zwzw, texture[%c], %s;" - "ADD b.r, b.r, b.g;" - "TEX b.b, coord2.xyxy, texture[%c], %s;" - "TEX b.g, coord2.zwzw, texture[%c], %s;" - "DP3 b, b, {0.25, 0.25, 0.25};" - "SUB b.r, a.r, b.r;" - "MAD yuv.%c, b.r, {%f}, a.r;"; - -static const char *unsharp_filt_template2 = - "PARAM dcoord%c = {%f, %f, %f, %f};" - "PARAM dcoord2%c = {%f, 0, 0, %f};" - "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" - "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" - "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" - "TEX b.r, coord.xyxy, texture[%c], %s;" - "TEX b.g, coord.zwzw, texture[%c], %s;" - "ADD b.r, b.r, b.g;" - "TEX b.b, coord2.xyxy, texture[%c], %s;" - "TEX b.g, coord2.zwzw, texture[%c], %s;" - "ADD b.r, b.r, b.b;" - "ADD b.a, b.r, b.g;" - "ADD coord, fragment.texcoord[%c].xyxy, dcoord2%c;" - "SUB coord2, fragment.texcoord[%c].xyxy, dcoord2%c;" - "TEX b.r, coord.xyxy, texture[%c], %s;" - "TEX b.g, coord.zwzw, texture[%c], %s;" - "ADD b.r, b.r, b.g;" - "TEX b.b, coord2.xyxy, texture[%c], %s;" - "TEX b.g, coord2.zwzw, texture[%c], %s;" - "DP4 b.r, b, {-0.1171875, -0.1171875, -0.1171875, -0.09765625};" - "MAD b.r, a.r, {0.859375}, b.r;" - "MAD yuv.%c, b.r, {%f}, a.r;"; - -static const char *yuv_prog_template = - "PARAM ycoef = {%.4f, %.4f, %.4f};" - "PARAM ucoef = {%.4f, %.4f, %.4f};" - "PARAM vcoef = {%.4f, %.4f, %.4f};" - "PARAM offsets = {%.4f, %.4f, %.4f};" - "TEMP res;" - "MAD res.rgb, yuv.rrrr, ycoef, offsets;" - "MAD res.rgb, yuv.gggg, ucoef, res;" - "MAD result.color.rgb, yuv.bbbb, vcoef, res;" - "END"; - -static const char *yuv_pow_prog_template = - "PARAM ycoef = {%.4f, %.4f, %.4f};" - "PARAM ucoef = {%.4f, %.4f, %.4f};" - "PARAM vcoef = {%.4f, %.4f, %.4f};" - "PARAM offsets = {%.4f, %.4f, %.4f};" - "PARAM gamma = {%.4f, %.4f, %.4f};" - "TEMP res;" - "MAD res.rgb, yuv.rrrr, ycoef, offsets;" - "MAD res.rgb, yuv.gggg, ucoef, res;" - "MAD_SAT res.rgb, yuv.bbbb, vcoef, res;" - "POW result.color.r, res.r, gamma.r;" - "POW result.color.g, res.g, gamma.g;" - "POW result.color.b, res.b, gamma.b;" - "END"; - -static const char *yuv_lookup_prog_template = - "PARAM ycoef = {%.4f, %.4f, %.4f, 0};" - "PARAM ucoef = {%.4f, %.4f, %.4f, 0};" - "PARAM vcoef = {%.4f, %.4f, %.4f, 0};" - "PARAM offsets = {%.4f, %.4f, %.4f, 0.125};" - "TEMP res;" - "MAD res, yuv.rrrr, ycoef, offsets;" - "MAD res.rgb, yuv.gggg, ucoef, res;" - "MAD res.rgb, yuv.bbbb, vcoef, res;" - "TEX result.color.r, res.raaa, texture[%c], 2D;" - "ADD res.a, res.a, 0.25;" - "TEX result.color.g, res.gaaa, texture[%c], 2D;" - "ADD res.a, res.a, 0.25;" - "TEX result.color.b, res.baaa, texture[%c], 2D;" - "END"; - -static const char *yuv_lookup3d_prog_template = - "TEX result.color, yuv, texture[%c], 3D;" - "END"; - -/** - * \brief creates and initializes helper textures needed for scaling texture read - * \param scaler scaler type to create texture for - * \param texu contains next free texture unit number - * \param texs texture unit ids for the scaler are stored in this array - */ -static void create_scaler_textures(int scaler, int *texu, char *texs) { - switch (scaler) { - case YUV_SCALER_BILIN: - case YUV_SCALER_BICUB_NOTEX: - case YUV_SCALER_UNSHARP: - case YUV_SCALER_UNSHARP2: - break; - case YUV_SCALER_BICUB: - case YUV_SCALER_BICUB_X: - texs[0] = (*texu)++; - gen_spline_lookup_tex(GL_TEXTURE0 + texs[0]); - texs[0] += '0'; - break; - default: - MSG_ERR("[gl] unknown scaler type %i\n", scaler); - } -} - -static void gen_gamma_map(unsigned char *map, int size, float gamma); - -#define ROW_R 0 -#define ROW_G 1 -#define ROW_B 2 -#define COL_Y 0 -#define COL_U 1 -#define COL_V 2 -#define COL_C 3 - -static void get_yuv2rgb_coeffs(gl_conversion_params_t *params, float yuv2rgb[3][4]) { - float uvcos = params->saturation * cos(params->hue); - float uvsin = params->saturation * sin(params->hue); - int i; - float uv_coeffs[3][2] = { - { 0.000, 1.596}, - {-0.391, -0.813}, - { 2.018, 0.000} - }; - for (i = 0; i < 3; i++) { - yuv2rgb[i][COL_C] = params->brightness; - yuv2rgb[i][COL_Y] = 1.164 * params->contrast; - yuv2rgb[i][COL_C] += (-16 / 255.0) * yuv2rgb[i][COL_Y]; - yuv2rgb[i][COL_U] = uv_coeffs[i][0] * uvcos + uv_coeffs[i][1] * uvsin; - yuv2rgb[i][COL_C] += (-128 / 255.0) * yuv2rgb[i][COL_U]; - yuv2rgb[i][COL_V] = uv_coeffs[i][0] * uvsin + uv_coeffs[i][1] * uvcos; - yuv2rgb[i][COL_C] += (-128 / 255.0) * yuv2rgb[i][COL_V]; - // this "centers" contrast control so that e.g. a contrast of 0 - // leads to a grey image, not a black one - yuv2rgb[i][COL_C] += 0.5 - params->contrast / 2.0; - } -} - -//! size of gamma map use to avoid slow exp function in gen_yuv2rgb_map -#define GMAP_SIZE (1024) -/** - * \brief generate a 3D YUV -> RGB map - * \param params struct containing parameters like brightness, gamma, ... - * \param map where to store map. Must provide space for (size + 2)^3 elements - * \param size size of the map, excluding border - */ -static void gen_yuv2rgb_map(gl_conversion_params_t *params, unsigned char *map, int size) { - int i, j, k, l; - float step = 1.0 / size; - float y, u, v; - float yuv2rgb[3][4]; - unsigned char gmaps[3][GMAP_SIZE]; - gen_gamma_map(gmaps[0], GMAP_SIZE, params->rgamma); - gen_gamma_map(gmaps[1], GMAP_SIZE, params->ggamma); - gen_gamma_map(gmaps[2], GMAP_SIZE, params->bgamma); - get_yuv2rgb_coeffs(params, yuv2rgb); - for (i = 0; i < 3; i++) - for (j = 0; j < 4; j++) - yuv2rgb[i][j] *= GMAP_SIZE - 1; - v = 0; - for (i = -1; i <= size; i++) { - u = 0; - for (j = -1; j <= size; j++) { - y = 0; - for (k = -1; k <= size; k++) { - for (l = 0; l < 3; l++) { - float rgb = yuv2rgb[l][COL_Y] * y + yuv2rgb[l][COL_U] * u + yuv2rgb[l][COL_V] * v + yuv2rgb[l][COL_C]; - *map++ = gmaps[l][av_clip(rgb, 0, GMAP_SIZE - 1)]; - } - y += (k == -1 || k == size - 1) ? step / 2 : step; - } - u += (j == -1 || j == size - 1) ? step / 2 : step; - } - v += (i == -1 || i == size - 1) ? step / 2 : step; - } -} - -//! resolution of texture for gamma lookup table -#define LOOKUP_RES 512 -//! resolution for 3D yuv->rgb conversion lookup table -#define LOOKUP_3DRES 32 -/** - * \brief creates and initializes helper textures needed for yuv conversion - * \param params struct containing parameters like brightness, gamma, ... - * \param texu contains next free texture unit number - * \param texs texture unit ids for the conversion are stored in this array - */ -static void create_conv_textures(gl_conversion_params_t *params, int *texu, char *texs) { - unsigned char *lookup_data = NULL; - int conv = YUV_CONVERSION(params->type); - switch (conv) { - case YUV_CONVERSION_FRAGMENT: - case YUV_CONVERSION_FRAGMENT_POW: - break; - case YUV_CONVERSION_FRAGMENT_LOOKUP: - texs[0] = (*texu)++; - ActiveTexture(GL_TEXTURE0 + texs[0]); - lookup_data = malloc(4 * LOOKUP_RES); - gen_gamma_map(lookup_data, LOOKUP_RES, params->rgamma); - gen_gamma_map(&lookup_data[LOOKUP_RES], LOOKUP_RES, params->ggamma); - gen_gamma_map(&lookup_data[2 * LOOKUP_RES], LOOKUP_RES, params->bgamma); - glCreateClearTex(GL_TEXTURE_2D, GL_LUMINANCE8, GL_LUMINANCE, GL_UNSIGNED_BYTE, GL_LINEAR, - LOOKUP_RES, 4, 0); - glUploadTex(GL_TEXTURE_2D, GL_LUMINANCE, GL_UNSIGNED_BYTE, lookup_data, - LOOKUP_RES, 0, 0, LOOKUP_RES, 4, 0); - ActiveTexture(GL_TEXTURE0); - texs[0] += '0'; - break; - case YUV_CONVERSION_FRAGMENT_LOOKUP3D: - { - int sz = LOOKUP_3DRES + 2; // texture size including borders - if (!TexImage3D) { - MSG_ERR("[gl] Missing 3D texture function!\n"); - break; - } - texs[0] = (*texu)++; - ActiveTexture(GL_TEXTURE0 + texs[0]); - lookup_data = malloc(3 * sz * sz * sz); - gen_yuv2rgb_map(params, lookup_data, LOOKUP_3DRES); - glAdjustAlignment(sz); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - TexImage3D(GL_TEXTURE_3D, 0, 3, sz, sz, sz, 1, - GL_RGB, GL_UNSIGNED_BYTE, lookup_data); - glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_PRIORITY, 1.0); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP); - ActiveTexture(GL_TEXTURE0); - texs[0] += '0'; - } - break; - default: - MSG_ERR("[gl] unknown conversion type %i\n", conv); - } - if (lookup_data) - free(lookup_data); -} - -/** - * \brief adds a scaling texture read at the current fragment program position - * \param scaler type of scaler to insert - * \param prog_pos current position in fragment program - * \param remain how many bytes remain in the buffer given by prog_pos - * \param texs array containing the texture unit identifiers for this scaler - * \param in_tex texture unit the scaler should read from - * \param out_comp component of the yuv variable the scaler stores the result in - * \param rect if rectangular (pixel) adressing should be used for in_tex - * \param texw width of the in_tex texture - * \param texh height of the in_tex texture - * \param strength strength of filter effect if the scaler does some kind of filtering - */ -static void add_scaler(int scaler, char **prog_pos, int *remain, char *texs, - char in_tex, char out_comp, int rect, int texw, int texh, - double strength) { - const char *ttype = rect ? "RECT" : "2D"; - const float ptw = rect ? 1.0 : 1.0 / texw; - const float pth = rect ? 1.0 : 1.0 / texh; - switch (scaler) { - case YUV_SCALER_BILIN: - snprintf(*prog_pos, *remain, bilin_filt_template, out_comp, in_tex, - in_tex, ttype); - break; - case YUV_SCALER_BICUB: - if (rect) - snprintf(*prog_pos, *remain, bicub_filt_template_RECT, - in_tex, texs[0], texs[0], - in_tex, in_tex, in_tex, in_tex, in_tex, in_tex, out_comp); - else - snprintf(*prog_pos, *remain, bicub_filt_template_2D, - in_tex, (float)texw, (float)texh, - texs[0], ptw, ptw, texs[0], pth, pth, - in_tex, in_tex, in_tex, in_tex, in_tex, in_tex, out_comp); - break; - case YUV_SCALER_BICUB_X: - if (rect) - snprintf(*prog_pos, *remain, bicub_x_filt_template_RECT, - in_tex, texs[0], - in_tex, in_tex, in_tex, in_tex, out_comp); - else - snprintf(*prog_pos, *remain, bicub_x_filt_template_2D, - in_tex, (float)texw, - texs[0], ptw, ptw, - in_tex, in_tex, in_tex, in_tex, out_comp); - break; - case YUV_SCALER_BICUB_NOTEX: - if (rect) - snprintf(*prog_pos, *remain, bicub_notex_filt_template_RECT, - in_tex, - in_tex, in_tex, in_tex, in_tex, in_tex, in_tex, out_comp); - else - snprintf(*prog_pos, *remain, bicub_notex_filt_template_2D, - in_tex, (float)texw, (float)texh, ptw, ptw, pth, pth, - in_tex, in_tex, in_tex, in_tex, in_tex, in_tex, out_comp); - break; - case YUV_SCALER_UNSHARP: - snprintf(*prog_pos, *remain, unsharp_filt_template, - out_comp, 0.5 * ptw, 0.5 * pth, 0.5 * ptw, -0.5 * pth, - in_tex, out_comp, in_tex, out_comp, in_tex, - in_tex, ttype, in_tex, ttype, in_tex, ttype, in_tex, ttype, - in_tex, ttype, out_comp, strength); - break; - case YUV_SCALER_UNSHARP2: - snprintf(*prog_pos, *remain, unsharp_filt_template2, - out_comp, 1.2 * ptw, 1.2 * pth, 1.2 * ptw, -1.2 * pth, - out_comp, 1.5 * ptw, 1.5 * pth, - in_tex, out_comp, in_tex, out_comp, in_tex, - in_tex, ttype, in_tex, ttype, in_tex, ttype, in_tex, ttype, - in_tex, ttype, in_tex, out_comp, in_tex, out_comp, - in_tex, ttype, in_tex, ttype, in_tex, ttype, - in_tex, ttype, out_comp, strength); - break; - } - *remain -= strlen(*prog_pos); - *prog_pos += strlen(*prog_pos); -} - -static const struct { - const char *name; - GLenum cur; - GLenum max; -} progstats[] = { - {"instructions", 0x88A0, 0x88A1}, - {"native instructions", 0x88A2, 0x88A3}, - {"temporaries", 0x88A4, 0x88A5}, - {"native temporaries", 0x88A6, 0x88A7}, - {"parameters", 0x88A8, 0x88A9}, - {"native parameters", 0x88AA, 0x88AB}, - {"attribs", 0x88AC, 0x88AD}, - {"native attribs", 0x88AE, 0x88AF}, - {"ALU instructions", 0x8805, 0x880B}, - {"TEX instructions", 0x8806, 0x880C}, - {"TEX indirections", 0x8807, 0x880D}, - {"native ALU instructions", 0x8808, 0x880E}, - {"native TEX instructions", 0x8809, 0x880F}, - {"native TEX indirections", 0x880A, 0x8810}, - {NULL, 0, 0} -}; - -/** - * \brief load the specified GPU Program - * \param target program target to load into, only GL_FRAGMENT_PROGRAM is tested - * \param prog program string - * \return 1 on success, 0 otherwise - */ -int loadGPUProgram(GLenum target, char *prog) { - int i; - GLint cur = 0, max = 0, err = 0; - if (!ProgramString) { - MSG_ERR("[gl] Missing GPU program function\n"); - return 0; - } - ProgramString(target, GL_PROGRAM_FORMAT_ASCII, strlen(prog), prog); - glGetIntegerv(GL_PROGRAM_ERROR_POSITION, &err); - if (err != -1) { - MSG_ERR( - "[gl] Error compiling fragment program, make sure your card supports\n" - "[gl] GL_ARB_fragment_program (use glxinfo to check).\n" - "[gl] Error message:\n %s at %.10s\n", - glGetString(GL_PROGRAM_ERROR_STRING), &prog[err]); - return 0; - } - if (!GetProgramiv) - return 1; - MSG_V("[gl] Program statistics:\n"); - for (i = 0; progstats[i].name; i++) { - GetProgramiv(target, progstats[i].cur, &cur); - GetProgramiv(target, progstats[i].max, &max); - MSG_V( "[gl] %s: %i/%i\n", progstats[i].name, cur, max); - } - return 1; -} - -#define MAX_PROGSZ (1024*1024) - -/** - * \brief setup a fragment program that will do YUV->RGB conversion - * \param parms struct containing parameters like conversion and scaler type, - * brightness, ... - */ -static void glSetupYUVFragprog(gl_conversion_params_t *params) { - int type = params->type; - int texw = params->texw; - int texh = params->texh; - int rect = params->target == GL_TEXTURE_RECTANGLE; - static const char prog_hdr[] = - "!!ARBfp1.0\n" - "OPTION ARB_precision_hint_fastest;" - // all scaler variables must go here so they aren't defined - // multiple times when the same scaler is used more than once - "TEMP coord, coord2, cdelta, parmx, parmy, a, b, yuv;"; - int prog_remain; - char *yuv_prog, *prog_pos; - int cur_texu = 3; - char lum_scale_texs[1]; - char chrom_scale_texs[1]; - char conv_texs[1]; - GLint i; - // this is the conversion matrix, with y, u, v factors - // for red, green, blue and the constant offsets - float yuv2rgb[3][4]; - create_conv_textures(params, &cur_texu, conv_texs); - create_scaler_textures(YUV_LUM_SCALER(type), &cur_texu, lum_scale_texs); - if (YUV_CHROM_SCALER(type) == YUV_LUM_SCALER(type)) - memcpy(chrom_scale_texs, lum_scale_texs, sizeof(chrom_scale_texs)); - else - create_scaler_textures(YUV_CHROM_SCALER(type), &cur_texu, chrom_scale_texs); - glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &i); - if (i < cur_texu) - MSG_ERR( - "[gl] %i texture units needed for this type of YUV fragment support (found %i)\n", - cur_texu, i); - if (!ProgramString) { - MSG_FATAL("[gl] ProgramString function missing!\n"); - return; - } - yuv_prog = malloc(MAX_PROGSZ); - strcpy(yuv_prog, prog_hdr); - prog_pos = yuv_prog + sizeof(prog_hdr) - 1; - prog_remain = MAX_PROGSZ - sizeof(prog_hdr); - add_scaler(YUV_LUM_SCALER(type), &prog_pos, &prog_remain, lum_scale_texs, - '0', 'r', rect, texw, texh, params->filter_strength); - add_scaler(YUV_CHROM_SCALER(type), &prog_pos, &prog_remain, chrom_scale_texs, - '1', 'g', rect, texw / 2, texh / 2, params->filter_strength); - add_scaler(YUV_CHROM_SCALER(type), &prog_pos, &prog_remain, chrom_scale_texs, - '2', 'b', rect, texw / 2, texh / 2, params->filter_strength); - get_yuv2rgb_coeffs(params, yuv2rgb); - switch (YUV_CONVERSION(type)) { - case YUV_CONVERSION_FRAGMENT: - snprintf(prog_pos, prog_remain, yuv_prog_template, - yuv2rgb[ROW_R][COL_Y], yuv2rgb[ROW_G][COL_Y], yuv2rgb[ROW_B][COL_Y], - yuv2rgb[ROW_R][COL_U], yuv2rgb[ROW_G][COL_U], yuv2rgb[ROW_B][COL_U], - yuv2rgb[ROW_R][COL_V], yuv2rgb[ROW_G][COL_V], yuv2rgb[ROW_B][COL_V], - yuv2rgb[ROW_R][COL_C], yuv2rgb[ROW_G][COL_C], yuv2rgb[ROW_B][COL_C]); - break; - case YUV_CONVERSION_FRAGMENT_POW: - snprintf(prog_pos, prog_remain, yuv_pow_prog_template, - yuv2rgb[ROW_R][COL_Y], yuv2rgb[ROW_G][COL_Y], yuv2rgb[ROW_B][COL_Y], - yuv2rgb[ROW_R][COL_U], yuv2rgb[ROW_G][COL_U], yuv2rgb[ROW_B][COL_U], - yuv2rgb[ROW_R][COL_V], yuv2rgb[ROW_G][COL_V], yuv2rgb[ROW_B][COL_V], - yuv2rgb[ROW_R][COL_C], yuv2rgb[ROW_G][COL_C], yuv2rgb[ROW_B][COL_C], - (float)1.0 / params->rgamma, (float)1.0 / params->bgamma, (float)1.0 / params->bgamma); - break; - case YUV_CONVERSION_FRAGMENT_LOOKUP: - snprintf(prog_pos, prog_remain, yuv_lookup_prog_template, - yuv2rgb[ROW_R][COL_Y], yuv2rgb[ROW_G][COL_Y], yuv2rgb[ROW_B][COL_Y], - yuv2rgb[ROW_R][COL_U], yuv2rgb[ROW_G][COL_U], yuv2rgb[ROW_B][COL_U], - yuv2rgb[ROW_R][COL_V], yuv2rgb[ROW_G][COL_V], yuv2rgb[ROW_B][COL_V], - yuv2rgb[ROW_R][COL_C], yuv2rgb[ROW_G][COL_C], yuv2rgb[ROW_B][COL_C], - conv_texs[0], conv_texs[0], conv_texs[0]); - break; - case YUV_CONVERSION_FRAGMENT_LOOKUP3D: - snprintf(prog_pos, prog_remain, yuv_lookup3d_prog_template, conv_texs[0]); - break; - default: - MSG_ERR("[gl] unknown conversion type %i\n", YUV_CONVERSION(type)); - break; - } - MSG_DBG2("[gl] generated fragment program:\n%s\n", yuv_prog); - loadGPUProgram(GL_FRAGMENT_PROGRAM, yuv_prog); - free(yuv_prog); -} - -/** - * \brief little helper function to create a lookup table for gamma - * \param map buffer to create map into - * \param size size of buffer - * \param gamma gamma value - */ -static void gen_gamma_map(unsigned char *map, int size, float gamma) { - int i; - if (gamma == 1.0) { - for (i = 0; i < size; i++) - map[i] = 255 * i / (size - 1); - return; - } - gamma = 1.0 / gamma; - for (i = 0; i < size; i++) { - float tmp = (float)i / (size - 1.0); - tmp = pow(tmp, gamma); - if (tmp > 1.0) tmp = 1.0; - if (tmp < 0.0) tmp = 0.0; - map[i] = 255 * tmp; - } -} - -/** - * \brief setup YUV->RGB conversion - * \param parms struct containing parameters like conversion and scaler type, - * brightness, ... - * \ingroup glconversion - */ -void glSetupYUVConversion(gl_conversion_params_t *params) { - float uvcos = params->saturation * cos(params->hue); - float uvsin = params->saturation * sin(params->hue); - switch (YUV_CONVERSION(params->type)) { - case YUV_CONVERSION_COMBINERS: - glSetupYUVCombiners(uvcos, uvsin); - break; - case YUV_CONVERSION_COMBINERS_ATI: - glSetupYUVCombinersATI(uvcos, uvsin); - break; - case YUV_CONVERSION_FRAGMENT_LOOKUP: - case YUV_CONVERSION_FRAGMENT_LOOKUP3D: - case YUV_CONVERSION_FRAGMENT: - case YUV_CONVERSION_FRAGMENT_POW: - glSetupYUVFragprog(params); - break; - default: - MSG_ERR("[gl] unknown conversion type %i\n", YUV_CONVERSION(params->type)); - } -} - -/** - * \brief enable the specified YUV conversion - * \param target texture target for Y, U and V textures (e.g. GL_TEXTURE_2D) - * \param type type of YUV conversion - * \ingroup glconversion - */ -void glEnableYUVConversion(GLenum target, int type) { - if (type <= 0) return; - switch (YUV_CONVERSION(type)) { - case YUV_CONVERSION_COMBINERS: - ActiveTexture(GL_TEXTURE1); - glEnable(target); - ActiveTexture(GL_TEXTURE2); - glEnable(target); - ActiveTexture(GL_TEXTURE0); - glEnable(GL_REGISTER_COMBINERS_NV); - break; - case YUV_CONVERSION_COMBINERS_ATI: - ActiveTexture(GL_TEXTURE1); - glEnable(target); - ActiveTexture(GL_TEXTURE2); - glEnable(target); - ActiveTexture(GL_TEXTURE0); - glEnable(GL_FRAGMENT_SHADER_ATI); - break; - case YUV_CONVERSION_FRAGMENT_LOOKUP3D: - case YUV_CONVERSION_FRAGMENT_LOOKUP: - case YUV_CONVERSION_FRAGMENT_POW: - case YUV_CONVERSION_FRAGMENT: - glEnable(GL_FRAGMENT_PROGRAM); - break; - } -} - -/** - * \brief disable the specified YUV conversion - * \param target texture target for Y, U and V textures (e.g. GL_TEXTURE_2D) - * \param type type of YUV conversion - * \ingroup glconversion - */ -void glDisableYUVConversion(GLenum target, int type) { - if (type <= 0) return; - switch (YUV_CONVERSION(type)) { - case YUV_CONVERSION_COMBINERS: - ActiveTexture(GL_TEXTURE1); - glDisable(target); - ActiveTexture(GL_TEXTURE2); - glDisable(target); - ActiveTexture(GL_TEXTURE0); - glDisable(GL_REGISTER_COMBINERS_NV); - break; - case YUV_CONVERSION_COMBINERS_ATI: - ActiveTexture(GL_TEXTURE1); - glDisable(target); - ActiveTexture(GL_TEXTURE2); - glDisable(target); - ActiveTexture(GL_TEXTURE0); - glDisable(GL_FRAGMENT_SHADER_ATI); - break; - case YUV_CONVERSION_FRAGMENT_LOOKUP3D: - case YUV_CONVERSION_FRAGMENT_LOOKUP: - case YUV_CONVERSION_FRAGMENT_POW: - case YUV_CONVERSION_FRAGMENT: - glDisable(GL_FRAGMENT_PROGRAM); - break; - } -} - -/** - * \brief draw a texture part at given 2D coordinates - * \param x screen top coordinate - * \param y screen left coordinate - * \param w screen width coordinate - * \param h screen height coordinate - * \param tx texture top coordinate in pixels - * \param ty texture left coordinate in pixels - * \param tw texture part width in pixels - * \param th texture part height in pixels - * \param sx width of texture in pixels - * \param sy height of texture in pixels - * \param rect_tex whether this texture uses texture_rectangle extension - * \param is_yv12 if set, also draw the textures from units 1 and 2 - * \param flip flip the texture upside down - * \ingroup gltexture - */ -void glDrawTex(GLfloat x, GLfloat y, GLfloat w, GLfloat h, - GLfloat tx, GLfloat ty, GLfloat tw, GLfloat th, - int sx, int sy, int rect_tex, int is_yv12, int flip) { - GLfloat tx2 = tx / 2, ty2 = ty / 2, tw2 = tw / 2, th2 = th / 2; - if (!rect_tex) { - tx /= sx; ty /= sy; tw /= sx; th /= sy; - tx2 = tx, ty2 = ty, tw2 = tw, th2 = th; - } - if (flip) { - y += h; - h = -h; - } - glBegin(GL_QUADS); - glTexCoord2f(tx, ty); - if (is_yv12) { - MultiTexCoord2f(GL_TEXTURE1, tx2, ty2); - MultiTexCoord2f(GL_TEXTURE2, tx2, ty2); - } - glVertex2f(x, y); - glTexCoord2f(tx, ty + th); - if (is_yv12) { - MultiTexCoord2f(GL_TEXTURE1, tx2, ty2 + th2); - MultiTexCoord2f(GL_TEXTURE2, tx2, ty2 + th2); - } - glVertex2f(x, y + h); - glTexCoord2f(tx + tw, ty + th); - if (is_yv12) { - MultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2 + th2); - MultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2 + th2); - } - glVertex2f(x + w, y + h); - glTexCoord2f(tx + tw, ty); - if (is_yv12) { - MultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2); - MultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2); - } - glVertex2f(x + w, y); - glEnd(); -} - -#ifdef GL_WIN32 -#include "w32_common.h" -/** - * \brief little helper since wglGetProcAddress definition does not fit our - * getProcAddress - * \param procName name of function to look up - * \return function pointer returned by wglGetProcAddress - */ -static void *w32gpa(const GLubyte *procName) { - HMODULE oglmod; - void *res = wglGetProcAddress(procName); - if (res) return res; - oglmod = GetModuleHandle("opengl32.dll"); - return GetProcAddress(oglmod, procName); -} - -int setGlWindow(int *vinfo, HGLRC *context, HWND win) -{ - int new_vinfo; - HDC windc = vo_w32_get_dc(win); - HGLRC new_context = 0; - int keep_context = 0; - int res = SET_WINDOW_FAILED; - - // should only be needed when keeping context, but not doing glFinish - // can cause flickering even when we do not keep it. - if (*context) - glFinish(); - new_vinfo = GetPixelFormat(windc); - if (*context && *vinfo && new_vinfo && *vinfo == new_vinfo) { - // we can keep the wglContext - new_context = *context; - keep_context = 1; - } else { - // create a context - new_context = wglCreateContext(windc); - if (!new_context) { - MSG_FATAL("[gl] Could not create GL context!\n"); - goto out; - } - } - - // set context - if (!wglMakeCurrent(windc, new_context)) { - MSG_FATAL("[gl] Could not set GL context!\n"); - if (!keep_context) { - wglDeleteContext(new_context); - } - goto out; - } - - // set new values - vo_w32_window = win; - { - RECT rect; - GetClientRect(win, &rect); - vo_dwidth = rect.right; - vo_dheight = rect.bottom; - } - if (!keep_context) { - if (*context) - wglDeleteContext(*context); - *context = new_context; - *vinfo = new_vinfo; - getFunctions(w32gpa, NULL); - - // and inform that reinit is neccessary - res = SET_WINDOW_REINIT; - } else - res = SET_WINDOW_OK; - -out: - vo_w32_release_dc(win, windc); - return res; -} - -void releaseGlContext(int *vinfo, HGLRC *context) { - *vinfo = 0; - if (*context) { - wglMakeCurrent(0, 0); - wglDeleteContext(*context); - } - *context = 0; -} - -void swapGlBuffers(void) { - HDC vo_hdc = vo_w32_get_dc(vo_w32_window); - SwapBuffers(vo_hdc); - vo_w32_release_dc(vo_w32_window, vo_hdc); -} -#else -#ifdef HAVE_LIBDL -#include <dlfcn.h> -#endif -#include "x11_common.h" -/** - * \brief find address of a linked function - * \param s name of function to find - * \return address of function or NULL if not found - */ -static void *getdladdr(const char *s) { - void *ret = NULL; -#ifdef HAVE_LIBDL - void *handle = dlopen(NULL, RTLD_LAZY); - if (!handle) - return NULL; - ret = dlsym(handle, s); - dlclose(handle); -#endif - return ret; -} - -/** - * \brief Returns the XVisualInfo associated with Window win. - * \param win Window whose XVisualInfo is returne. - * \return XVisualInfo of the window. Caller must use XFree to free it. - */ -static XVisualInfo *getWindowVisualInfo(Window win) { - XWindowAttributes xw_attr; - XVisualInfo vinfo_template; - int tmp; - XGetWindowAttributes(mDisplay, win, &xw_attr); - vinfo_template.visualid = XVisualIDFromVisual(xw_attr.visual); - return XGetVisualInfo(mDisplay, VisualIDMask, &vinfo_template, &tmp); -} - -static void appendstr(char **dst, const char *str) -{ - int newsize; - char *newstr; - if (!str) - return; - newsize = strlen(*dst) + 1 + strlen(str) + 1; - newstr = realloc(*dst, newsize); - if (!newstr) - return; - *dst = newstr; - strcat(*dst, " "); - strcat(*dst, str); -} - -/** - * \brief Changes the window in which video is displayed. - * If possible only transfers the context to the new window, otherwise - * creates a new one, which must be initialized by the caller. - * \param vinfo Currently used visual. - * \param context Currently used context. - * \param win window that should be used for drawing. - * \return one of SET_WINDOW_FAILED, SET_WINDOW_OK or SET_WINDOW_REINIT. - * In case of SET_WINDOW_REINIT the context could not be transfered - * and the caller must initialize it correctly. - * \ingroup glcontext - */ -int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win) -{ - XVisualInfo *new_vinfo; - GLXContext new_context = NULL; - int keep_context = 0; - - // should only be needed when keeping context, but not doing glFinish - // can cause flickering even when we do not keep it. - if (*context) - glFinish(); - new_vinfo = getWindowVisualInfo(win); - if (*context && *vinfo && new_vinfo && - (*vinfo)->visualid == new_vinfo->visualid) ... [truncated message content] |
From: <nic...@us...> - 2010-01-04 13:29:00
|
Revision: 68 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=68&view=rev Author: nickols_k Date: 2010-01-04 12:15:47 +0000 (Mon, 04 Jan 2010) Log Message: ----------- remove nvidia-only specific stuff Modified Paths: -------------- mplayerxp/configure mplayerxp/libvo/Makefile mplayerxp/libvo/video_out.c Removed Paths: ------------- mplayerxp/libvo/vo_vdpau.c Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-04 12:13:41 UTC (rev 67) +++ mplayerxp/configure 2010-01-04 12:15:47 UTC (rev 68) @@ -66,7 +66,6 @@ "jpg|build with JPEG for screenshots", "png|build with PNG for screenshots", "opengl|build with OpenGL video output", - "vdpau|build with VDPAU video output", "dga|build with DGA video output", "vesa|build with VESA video output", "vidix|build with VIDIX video output", @@ -579,10 +578,6 @@ print_config HAVE_ mp_config.h mp_config.mak opengl enabled opengl && vomodules="opengl $vomodules" || novomodules="opengl $novomodules" -enabled vdpau && require3 vdpau "vdpau/vdpau_x11.h" VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 vdp_device_create_x11 -lvdpau -print_config HAVE_ mp_config.h mp_config.mak vdpau -enabled vdpau && vomodules="vdpau $vomodules" || novomodules="vdpau $novomodules" - # Note: the -lXxf86vm library is the VideoMode extension and though it's not # needed for DGA, AFAIK every distribution packages together with DGA stuffs # named 'X extensions' or something similar. Modified: mplayerxp/libvo/Makefile =================================================================== --- mplayerxp/libvo/Makefile 2010-01-04 12:13:41 UTC (rev 67) +++ mplayerxp/libvo/Makefile 2010-01-04 12:15:47 UTC (rev 68) @@ -10,9 +10,6 @@ ifeq ($(HAVE_OPENGL),yes) SRCS+=vo_opengl.c endif -ifeq ($(HAVE_VDPAU),yes) -SRCS+=vo_vdpau.c -endif ifeq ($(HAVE_X11),yes) SRCS+=vo_x11.c x11_common.c ifeq ($(CONFIG_VIDIX),yes) Modified: mplayerxp/libvo/video_out.c =================================================================== --- mplayerxp/libvo/video_out.c 2010-01-04 12:13:41 UTC (rev 67) +++ mplayerxp/libvo/video_out.c 2010-01-04 12:15:47 UTC (rev 68) @@ -111,7 +111,6 @@ extern vo_functions_t video_out_fbdev; extern vo_functions_t video_out_png; extern vo_functions_t video_out_opengl; -extern vo_functions_t video_out_vdpau; #ifdef HAVE_VESA extern vo_functions_t video_out_vesa; #endif @@ -127,9 +126,6 @@ #ifdef HAVE_OPENGL &video_out_opengl, #endif -#ifdef HAVE_VDPAU - &video_out_vdpau, -#endif #if defined(CONFIG_VIDIX) && defined(HAVE_X11) &video_out_xvidix, #endif Deleted: mplayerxp/libvo/vo_vdpau.c =================================================================== --- mplayerxp/libvo/vo_vdpau.c 2010-01-04 12:13:41 UTC (rev 67) +++ mplayerxp/libvo/vo_vdpau.c 2010-01-04 12:15:47 UTC (rev 68) @@ -1,1288 +0,0 @@ -/* - * VDPAU video output driver - * - * Copyright (C) 2008 NVIDIA - * - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * \defgroup VDPAU_Presentation VDPAU Presentation - * \ingroup Decoder - * - * Actual decoding and presentation are implemented here. - * All necessary frame information is collected through - * the "vdpau_render_state" structure after parsing all headers - * etc. in libavcodec for different codecs. - * - * @{ - */ - -#include <stdio.h> -#include <stdlib.h> - -#include "../mp_config.h" -#include "../mplayer.h" -#include "../dec_ahead.h" -#include "video_out.h" -#include "video_out_internal.h" -#include "x11_common.h" -#include "aspect.h" -#include "sub.h" -#include "subopt-helper.h" -#include "../postproc/vfcap.h" -#include "libavcodec/vdpau.h" -#include "libavutil/common.h" -#include "libavutil/mathematics.h" - -#include "vo_msg.h" - -static vo_info_t vo_info = { - "VDPAU with X11", - "vdpau", - "Rajib Mahapatra <rma...@nv...> and others", - "" -}; - -LIBVO_EXTERN(vdpau) - -static const vo_info_t *get_info(void) -{ - return(&vo_info); -} - -#define CHECK_ST_ERROR(message) \ - if (vdp_st != VDP_STATUS_OK) { \ - MSG_ERR("[vdpau] %s: %s\n", \ - message, vdp_get_error_string(vdp_st)); \ - return -1; \ - } - -#define CHECK_ST_WARNING(message) \ - if (vdp_st != VDP_STATUS_OK) \ - MSG_WARN("[vdpau] %s: %s\n", \ - message, vdp_get_error_string(vdp_st)); - -/* number of video and output surfaces */ -#define NUM_OUTPUT_SURFACES 2 -#define MAX_VIDEO_SURFACES 50 - -/* number of palette entries */ -#define PALETTE_SIZE 256 - -/* - * Global variable declaration - VDPAU specific - */ - -/* Declaration for all variables of win_x11_init_vdpau_procs() and - * win_x11_init_vdpau_flip_queue() functions - */ -static VdpDevice vdp_device; -static VdpGetProcAddress *vdp_get_proc_address; - -static VdpPresentationQueueTarget vdp_flip_target; -static VdpPresentationQueue vdp_flip_queue; - -static VdpDeviceDestroy *vdp_device_destroy; -static VdpVideoSurfaceCreate *vdp_video_surface_create; -static VdpVideoSurfaceDestroy *vdp_video_surface_destroy; - -static VdpGetErrorString *vdp_get_error_string; - -/* May be used in software filtering/postprocessing options - * in MPlayer (./mplayer -vf ..) if we copy video_surface data to - * system memory. - */ -static VdpVideoSurfacePutBitsYCbCr *vdp_video_surface_put_bits_y_cb_cr; -static VdpOutputSurfacePutBitsNative *vdp_output_surface_put_bits_native; - -static VdpOutputSurfaceCreate *vdp_output_surface_create; -static VdpOutputSurfaceDestroy *vdp_output_surface_destroy; - -/* VideoMixer puts video_surface data on displayable output_surface. */ -static VdpVideoMixerCreate *vdp_video_mixer_create; -static VdpVideoMixerDestroy *vdp_video_mixer_destroy; -static VdpVideoMixerRender *vdp_video_mixer_render; -static VdpVideoMixerSetFeatureEnables *vdp_video_mixer_set_feature_enables; -static VdpVideoMixerSetAttributeValues *vdp_video_mixer_set_attribute_values; - -static VdpPresentationQueueTargetDestroy *vdp_presentation_queue_target_destroy; -static VdpPresentationQueueCreate *vdp_presentation_queue_create; -static VdpPresentationQueueDestroy *vdp_presentation_queue_destroy; -static VdpPresentationQueueDisplay *vdp_presentation_queue_display; -static VdpPresentationQueueBlockUntilSurfaceIdle *vdp_presentation_queue_block_until_surface_idle; -static VdpPresentationQueueTargetCreateX11 *vdp_presentation_queue_target_create_x11; - -static VdpOutputSurfaceRenderOutputSurface *vdp_output_surface_render_output_surface; -static VdpOutputSurfacePutBitsIndexed *vdp_output_surface_put_bits_indexed; -static VdpOutputSurfaceRenderBitmapSurface *vdp_output_surface_render_bitmap_surface; - -static VdpBitmapSurfaceCreate *vdp_bitmap_surface_create; -static VdpBitmapSurfaceDestroy *vdp_bitmap_surface_destroy; -static VdpBitmapSurfacePutBitsNative *vdp_bitmap_surface_putbits_native; - -static VdpDecoderCreate *vdp_decoder_create; -static VdpDecoderDestroy *vdp_decoder_destroy; -static VdpDecoderRender *vdp_decoder_render; - -static VdpGenerateCSCMatrix *vdp_generate_csc_matrix; -static VdpPreemptionCallbackRegister *vdp_preemption_callback_register; - -/* output_surfaces[NUM_OUTPUT_SURFACES] is misused for OSD. */ -#define osd_surface output_surfaces[NUM_OUTPUT_SURFACES] -static VdpOutputSurface output_surfaces[NUM_OUTPUT_SURFACES + 1]; -static VdpVideoSurface deint_surfaces[3]; -static mp_image_t *deint_mpi[3]; -static uint32_t output_surface_width, output_surface_height; - -static VdpVideoMixer video_mixer; -static int deint; -static int deint_type; -static int deint_counter; -static int deint_buffer_past_frames; -static int pullup; -static float denoise; -static float sharpen; -static int colorspace; -static int chroma_deint; -static int force_mixer; -static int top_field_first; -static int hqscaling; - -static VdpDecoder decoder; -static int decoder_max_refs; - -static VdpRect src_rect_vid; -static VdpRect out_rect_vid; -static int border_x, border_y; -static uint32_t dwidth,dheight; - -static struct vdpau_render_state surface_render[MAX_VIDEO_SURFACES]; -static int surface_num; -static int vid_surface_num; -static uint32_t vid_width, vid_height; -static uint32_t image_format; -static VdpChromaType vdp_chroma_type; -static VdpYCbCrFormat vdp_pixel_format; - -static volatile int is_preempted; - -/* draw_osd */ -static unsigned char *index_data; -static int index_data_size; -static uint32_t palette[PALETTE_SIZE]; -static void draw_osd(void); - -// Video equalizer -static VdpProcamp procamp; - -/* - * X11 specific - */ -static int visible_buf; -static int int_pause; - -static void push_deint_surface(VdpVideoSurface surface) -{ - deint_surfaces[2] = deint_surfaces[1]; - deint_surfaces[1] = deint_surfaces[0]; - deint_surfaces[0] = surface; -} - -static void video_to_output_surface(void) -{ - VdpTime dummy; - VdpStatus vdp_st; - int i; - if (vid_surface_num < 0) - return; - - if (deint < 2 || deint_surfaces[0] == VDP_INVALID_HANDLE) - push_deint_surface(surface_render[vid_surface_num].surface); - - for (i = 0; i <= !!(deint > 1); i++) { - int field = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME; - VdpOutputSurface output_surface; - if (i) { - draw_osd(); - flip_page(0); - } - if (deint) - field = (top_field_first == i) ^ (deint > 1) ? - VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD: - VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD; - output_surface = output_surfaces[surface_num]; - vdp_st = vdp_presentation_queue_block_until_surface_idle(vdp_flip_queue, - output_surface, - &dummy); - CHECK_ST_WARNING("Error when calling vdp_presentation_queue_block_until_surface_idle") - - vdp_st = vdp_video_mixer_render(video_mixer, VDP_INVALID_HANDLE, 0, - field, 2, deint_surfaces + 1, - deint_surfaces[0], - 1, &surface_render[vid_surface_num].surface, - &src_rect_vid, - output_surface, - NULL, &out_rect_vid, 0, NULL); - CHECK_ST_WARNING("Error when calling vdp_video_mixer_render") - push_deint_surface(surface_render[vid_surface_num].surface); - } -} - -static void resize(int x,int y) -{ - VdpStatus vdp_st; - int i; - struct vo_rect src_rect; - struct vo_rect dst_rect; - struct vo_rect borders; - int w = x, h = y; - aspect(&w,&h,A_ZOOM); - dst_rect.left=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2; - dst_rect.top=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2; - w=(dwidth > vo_screenwidth?vo_screenwidth:dwidth); - h=(dheight > vo_screenheight?vo_screenheight:dheight); - dst_rect.bottom=dst_rect.top+h; - dst_rect.right=dst_rect.left+w; - - out_rect_vid.x0 = dst_rect.left; - out_rect_vid.x1 = dst_rect.right; - out_rect_vid.y0 = dst_rect.top; - out_rect_vid.y1 = dst_rect.bottom; - src_rect_vid.x0 = src_rect.left; - src_rect_vid.x1 = src_rect.right; - src_rect_vid.y0 = flip ? src_rect.bottom : src_rect.top; - src_rect_vid.y1 = flip ? src_rect.top : src_rect.bottom; - border_x = borders.left; - border_y = borders.top; -#ifdef CONFIG_FREETYPE - // adjust font size to display size - force_load_font = 1; -#endif - vo_osd_changed(OSDTYPE_OSD); - - if (output_surface_width < vo_dwidth || output_surface_height < vo_dheight) { - if (output_surface_width < vo_dwidth) { - output_surface_width += output_surface_width >> 1; - output_surface_width = FFMAX(output_surface_width, vo_dwidth); - } - if (output_surface_height < vo_dheight) { - output_surface_height += output_surface_height >> 1; - output_surface_height = FFMAX(output_surface_height, vo_dheight); - } - // Creation of output_surfaces - for (i = 0; i <= NUM_OUTPUT_SURFACES; i++) { - if (output_surfaces[i] != VDP_INVALID_HANDLE) - vdp_output_surface_destroy(output_surfaces[i]); - vdp_st = vdp_output_surface_create(vdp_device, VDP_RGBA_FORMAT_B8G8R8A8, - output_surface_width, output_surface_height, - &output_surfaces[i]); - CHECK_ST_WARNING("Error when calling vdp_output_surface_create") - MSG_DBG2("OUT CREATE: %u\n", output_surfaces[i]); - } - } - if (image_format == IMGFMT_BGRA) { - vdp_st = vdp_output_surface_render_output_surface(output_surfaces[surface_num], - NULL, VDP_INVALID_HANDLE, - NULL, NULL, NULL, - VDP_OUTPUT_SURFACE_RENDER_ROTATE_0); - CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface") - vdp_st = vdp_output_surface_render_output_surface(output_surfaces[1 - surface_num], - NULL, VDP_INVALID_HANDLE, - NULL, NULL, NULL, - VDP_OUTPUT_SURFACE_RENDER_ROTATE_0); - CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface") - } else - video_to_output_surface(); - if (visible_buf) - flip_page(0); -} - -static void preemption_callback(VdpDevice device, void *context) -{ - MSG_ERR("[vdpau] Display preemption detected\n"); - is_preempted = 1; -} - -/* Initialize vdp_get_proc_address, called from preinit() */ -static int win_x11_init_vdpau_procs(void) -{ - VdpStatus vdp_st; - - struct vdp_function { - const int id; - void *pointer; - }; - - const struct vdp_function *dsc; - - static const struct vdp_function vdp_func[] = { - {VDP_FUNC_ID_GET_ERROR_STRING, &vdp_get_error_string}, - {VDP_FUNC_ID_DEVICE_DESTROY, &vdp_device_destroy}, - {VDP_FUNC_ID_VIDEO_SURFACE_CREATE, &vdp_video_surface_create}, - {VDP_FUNC_ID_VIDEO_SURFACE_DESTROY, &vdp_video_surface_destroy}, - {VDP_FUNC_ID_VIDEO_SURFACE_PUT_BITS_Y_CB_CR, - &vdp_video_surface_put_bits_y_cb_cr}, - {VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE, - &vdp_output_surface_put_bits_native}, - {VDP_FUNC_ID_OUTPUT_SURFACE_CREATE, &vdp_output_surface_create}, - {VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY, &vdp_output_surface_destroy}, - {VDP_FUNC_ID_VIDEO_MIXER_CREATE, &vdp_video_mixer_create}, - {VDP_FUNC_ID_VIDEO_MIXER_DESTROY, &vdp_video_mixer_destroy}, - {VDP_FUNC_ID_VIDEO_MIXER_RENDER, &vdp_video_mixer_render}, - {VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES, - &vdp_video_mixer_set_feature_enables}, - {VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES, - &vdp_video_mixer_set_attribute_values}, - {VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_DESTROY, - &vdp_presentation_queue_target_destroy}, - {VDP_FUNC_ID_PRESENTATION_QUEUE_CREATE, &vdp_presentation_queue_create}, - {VDP_FUNC_ID_PRESENTATION_QUEUE_DESTROY, - &vdp_presentation_queue_destroy}, - {VDP_FUNC_ID_PRESENTATION_QUEUE_DISPLAY, - &vdp_presentation_queue_display}, - {VDP_FUNC_ID_PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE, - &vdp_presentation_queue_block_until_surface_idle}, - {VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11, - &vdp_presentation_queue_target_create_x11}, - {VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE, - &vdp_output_surface_render_output_surface}, - {VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED, - &vdp_output_surface_put_bits_indexed}, - {VDP_FUNC_ID_DECODER_CREATE, &vdp_decoder_create}, - {VDP_FUNC_ID_DECODER_RENDER, &vdp_decoder_render}, - {VDP_FUNC_ID_DECODER_DESTROY, &vdp_decoder_destroy}, - {VDP_FUNC_ID_BITMAP_SURFACE_CREATE, &vdp_bitmap_surface_create}, - {VDP_FUNC_ID_BITMAP_SURFACE_DESTROY, &vdp_bitmap_surface_destroy}, - {VDP_FUNC_ID_BITMAP_SURFACE_PUT_BITS_NATIVE, - &vdp_bitmap_surface_putbits_native}, - {VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_BITMAP_SURFACE, - &vdp_output_surface_render_bitmap_surface}, - {VDP_FUNC_ID_GENERATE_CSC_MATRIX, &vdp_generate_csc_matrix}, - {VDP_FUNC_ID_PREEMPTION_CALLBACK_REGISTER, - &vdp_preemption_callback_register}, - {0, NULL} - }; - - vdp_st = vdp_device_create_x11(mDisplay, mScreen, - &vdp_device, &vdp_get_proc_address); - if (vdp_st != VDP_STATUS_OK) { - MSG_ERR("[vdpau] Error when calling vdp_device_create_x11: %i\n", vdp_st); - return -1; - } - - vdp_get_error_string = NULL; - for (dsc = vdp_func; dsc->pointer; dsc++) { - vdp_st = vdp_get_proc_address(vdp_device, dsc->id, dsc->pointer); - if (vdp_st != VDP_STATUS_OK) { - MSG_ERR("[vdpau] Error when calling vdp_get_proc_address(function id %d): %s\n", - dsc->id, vdp_get_error_string ? vdp_get_error_string(vdp_st) : "?"); - return -1; - } - } - vdp_st = vdp_preemption_callback_register(vdp_device, - preemption_callback, NULL); - CHECK_ST_ERROR("Error when calling vdp_preemption_callback_register") - - return 0; -} - -/* Initialize vdpau_flip_queue, called from config() */ -static int win_x11_init_vdpau_flip_queue(void) -{ - VdpStatus vdp_st; - - vdp_st = vdp_presentation_queue_target_create_x11(vdp_device, vo_window, - &vdp_flip_target); - CHECK_ST_ERROR("Error when calling vdp_presentation_queue_target_create_x11") - - vdp_st = vdp_presentation_queue_create(vdp_device, vdp_flip_target, - &vdp_flip_queue); - CHECK_ST_ERROR("Error when calling vdp_presentation_queue_create") - - return 0; -} - -static int update_csc_matrix(void) -{ - VdpStatus vdp_st; - VdpCSCMatrix matrix; - static const VdpVideoMixerAttribute attributes[] = {VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX}; - const void *attribute_values[] = {&matrix}; - static const VdpColorStandard vdp_colors[] = {0, VDP_COLOR_STANDARD_ITUR_BT_601, VDP_COLOR_STANDARD_ITUR_BT_709, VDP_COLOR_STANDARD_SMPTE_240M}; - static const char * const vdp_names[] = {NULL, "BT.601", "BT.709", "SMPTE-240M"}; - int csp = colorspace; - - if (!csp) - csp = vid_width >= 1280 || vid_height > 576 ? 2 : 1; - - MSG_V("[vdpau] Updating CSC matrix for %s\n", - vdp_names[csp]); - - vdp_st = vdp_generate_csc_matrix(&procamp, vdp_colors[csp], &matrix); - CHECK_ST_WARNING("Error when generating CSC matrix") - - vdp_st = vdp_video_mixer_set_attribute_values(video_mixer, 1, attributes, - attribute_values); - CHECK_ST_WARNING("Error when setting CSC matrix") - return VO_TRUE; -} - -static int create_vdp_mixer(VdpChromaType vdp_chroma_type) -{ -#define VDP_NUM_MIXER_PARAMETER 3 -#define MAX_NUM_FEATURES 6 - int i; - VdpStatus vdp_st; - int feature_count = 0; - VdpVideoMixerFeature features[MAX_NUM_FEATURES]; - VdpBool feature_enables[MAX_NUM_FEATURES]; - static const VdpVideoMixerAttribute denoise_attrib[] = {VDP_VIDEO_MIXER_ATTRIBUTE_NOISE_REDUCTION_LEVEL}; - const void * const denoise_value[] = {&denoise}; - static const VdpVideoMixerAttribute sharpen_attrib[] = {VDP_VIDEO_MIXER_ATTRIBUTE_SHARPNESS_LEVEL}; - const void * const sharpen_value[] = {&sharpen}; - static const VdpVideoMixerAttribute skip_chroma_attrib[] = {VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE}; - const uint8_t skip_chroma_value = 1; - const void * const skip_chroma_value_ptr[] = {&skip_chroma_value}; - static const VdpVideoMixerParameter parameters[VDP_NUM_MIXER_PARAMETER] = { - VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH, - VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT, - VDP_VIDEO_MIXER_PARAMETER_CHROMA_TYPE - }; - const void *const parameter_values[VDP_NUM_MIXER_PARAMETER] = { - &vid_width, - &vid_height, - &vdp_chroma_type - }; - features[feature_count++] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL; - if (deint == 4) - features[feature_count++] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL; - if (pullup) - features[feature_count++] = VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE; - if (denoise) - features[feature_count++] = VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION; - if (sharpen) - features[feature_count++] = VDP_VIDEO_MIXER_FEATURE_SHARPNESS; - if (hqscaling) - features[feature_count++] = VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 + (hqscaling - 1); - - vdp_st = vdp_video_mixer_create(vdp_device, feature_count, features, - VDP_NUM_MIXER_PARAMETER, - parameters, parameter_values, - &video_mixer); - CHECK_ST_ERROR("Error when calling vdp_video_mixer_create") - - for (i = 0; i < feature_count; i++) - feature_enables[i] = VDP_TRUE; - if (deint < 3) - feature_enables[0] = VDP_FALSE; - if (feature_count) - vdp_video_mixer_set_feature_enables(video_mixer, feature_count, features, feature_enables); - if (denoise) - vdp_video_mixer_set_attribute_values(video_mixer, 1, denoise_attrib, denoise_value); - if (sharpen) - vdp_video_mixer_set_attribute_values(video_mixer, 1, sharpen_attrib, sharpen_value); - if (!chroma_deint) - vdp_video_mixer_set_attribute_values(video_mixer, 1, skip_chroma_attrib, skip_chroma_value_ptr); - - update_csc_matrix(); - return 0; -} - -// Free everything specific to a certain video file -static void free_video_specific(void) -{ - int i; - VdpStatus vdp_st; - - if (decoder != VDP_INVALID_HANDLE) - vdp_decoder_destroy(decoder); - decoder = VDP_INVALID_HANDLE; - decoder_max_refs = -1; - - for (i = 0; i < 3; i++) - deint_surfaces[i] = VDP_INVALID_HANDLE; - - for (i = 0; i < 2; i++) - if (deint_mpi[i]) { - deint_mpi[i] = NULL; - } - - for (i = 0; i < MAX_VIDEO_SURFACES; i++) { - if (surface_render[i].surface != VDP_INVALID_HANDLE) { - vdp_st = vdp_video_surface_destroy(surface_render[i].surface); - CHECK_ST_WARNING("Error when calling vdp_video_surface_destroy") - } - surface_render[i].surface = VDP_INVALID_HANDLE; - } - - if (video_mixer != VDP_INVALID_HANDLE) { - vdp_st = vdp_video_mixer_destroy(video_mixer); - CHECK_ST_WARNING("Error when calling vdp_video_mixer_destroy") - } - video_mixer = VDP_INVALID_HANDLE; -} - -static int create_vdp_decoder(uint32_t format, uint32_t width, uint32_t height, - int max_refs) -{ - VdpStatus vdp_st; - VdpDecoderProfile vdp_decoder_profile; - if (decoder != VDP_INVALID_HANDLE) - vdp_decoder_destroy(decoder); - switch (format) { - case IMGFMT_VDPAU_MPEG1: - vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG1; - break; - case IMGFMT_VDPAU_MPEG2: - vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG2_MAIN; - break; - case IMGFMT_VDPAU_H264: - vdp_decoder_profile = VDP_DECODER_PROFILE_H264_HIGH; - MSG_V("[vdpau] Creating H264 hardware decoder for %d reference frames.\n", max_refs); - break; - case IMGFMT_VDPAU_WMV3: - vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_MAIN; - break; - case IMGFMT_VDPAU_VC1: - vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED; - break; - case IMGFMT_VDPAU_MPEG4: - vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; - break; - default: - goto err_out; - } - vdp_st = vdp_decoder_create(vdp_device, vdp_decoder_profile, - width, height, max_refs, &decoder); - CHECK_ST_WARNING("Failed creating VDPAU decoder"); - if (vdp_st != VDP_STATUS_OK) { -err_out: - decoder = VDP_INVALID_HANDLE; - decoder_max_refs = 0; - return 0; - } - decoder_max_refs = max_refs; - return 1; -} - -static void mark_vdpau_objects_uninitialized(void) -{ - int i; - - decoder = VDP_INVALID_HANDLE; - for (i = 0; i < MAX_VIDEO_SURFACES; i++) - surface_render[i].surface = VDP_INVALID_HANDLE; - for (i = 0; i < 3; i++) { - deint_surfaces[i] = VDP_INVALID_HANDLE; - deint_mpi[i] = NULL; - } - video_mixer = VDP_INVALID_HANDLE; - vdp_flip_queue = VDP_INVALID_HANDLE; - vdp_flip_target = VDP_INVALID_HANDLE; - for (i = 0; i <= NUM_OUTPUT_SURFACES; i++) - output_surfaces[i] = VDP_INVALID_HANDLE; - vdp_device = VDP_INVALID_HANDLE; - output_surface_width = output_surface_height = -1; - visible_buf = 0; -} - -static int handle_preemption(void) -{ - if (!is_preempted) - return 0; - is_preempted = 0; - MSG_INFO("[vdpau] Attempting to recover from preemption.\n"); - mark_vdpau_objects_uninitialized(); - if (win_x11_init_vdpau_procs() < 0 || - win_x11_init_vdpau_flip_queue() < 0 || - create_vdp_mixer(vdp_chroma_type) < 0) { - MSG_ERR("[vdpau] Recovering from preemption failed\n"); - is_preempted = 1; - return -1; - } -// resize(); - MSG_INFO("[vdpau] Recovered from display preemption.\n"); - return 1; -} - -/* - * connect to X server, create and map window, initialize all - * VDPAU objects, create different surfaces etc. - */ -static uint32_t __FASTCALL__ config(uint32_t width, uint32_t height, uint32_t d_width, - uint32_t d_height, uint32_t flags, char *title, - uint32_t format,const vo_tune_info_t *tune) -{ - XSizeHints hint; - XVisualInfo vinfo; - XSetWindowAttributes xswa; - XWindowAttributes attribs; - unsigned long xswamask; - int depth; - -#ifdef CONFIG_XF86VM - int vm = flags & VOFLAG_MODESWITCHING; -#endif - flip = flags & VOFLAG_FLIPPING; - - image_format = format; - vid_width = width; - vid_height = height; - dwidth = d_width; - dheight = d_height; - free_video_specific(); - if (IMGFMT_IS_VDPAU(image_format) - && !create_vdp_decoder(image_format, vid_width, vid_height, 2)) - return -1; - - int_pause = 0; - visible_buf = 0; - -#ifdef CONFIG_GUI - if (use_gui) - guiGetEvent(guiSetShVideo, 0); // the GUI will set up / resize our window - else -#endif - { -#ifdef CONFIG_XF86VM - if (vm) - vo_vm_switch(); - else -#endif - XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &attribs); - depth = attribs.depth; - if (depth != 15 && depth != 16 && depth != 24 && depth != 32) - depth = 24; - XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, &vinfo); - - xswa.background_pixel = 0; - xswa.border_pixel = 0; - /* Do not use CWBackPixel: It leads to VDPAU errors after - aspect ratio changes. */ - xswamask = CWBorderPixel; - - aspect_save_screenres(vo_screenwidth,vo_screenheight); - - aspect(&d_width,&d_height,softzoom?A_ZOOM:A_NOZOOM); -#ifdef X11_FULLSCREEN - if( vo_fs ) aspect(&d_width,&d_height,A_ZOOM); -#endif - vo_x11_calcpos(&hint,d_width,d_height,flags); - hint.flags = PPosition | PSize; - vo_window = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen), - hint.x, hint.y, hint.width, hint.height, - 0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa); -// vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height, -// flags, CopyFromParent, "vdpau", title); - XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa); - -#ifdef CONFIG_XF86VM - if (vm) { - /* Grab the mouse pointer in our window */ - if (vo_grabpointer) - XGrabPointer(mDisplay, vo_window, True, 0, - GrabModeAsync, GrabModeAsync, - vo_window, None, CurrentTime); - XSetInputFocus(mDisplay, vo_window, RevertToNone, CurrentTime); - } -#endif - } - - if ((flags & VOFLAG_FULLSCREEN) && WinID <= 0) - vo_fs = 1; - - /* -----VDPAU related code here -------- */ - if (vdp_flip_queue == VDP_INVALID_HANDLE && win_x11_init_vdpau_flip_queue()) - return -1; - - vdp_chroma_type = VDP_CHROMA_TYPE_420; - switch (image_format) { - case IMGFMT_YV12: - case IMGFMT_I420: - case IMGFMT_IYUV: - vdp_pixel_format = VDP_YCBCR_FORMAT_YV12; - break; - case IMGFMT_NV12: - vdp_pixel_format = VDP_YCBCR_FORMAT_NV12; - break; - case IMGFMT_YUY2: - vdp_pixel_format = VDP_YCBCR_FORMAT_YUYV; - vdp_chroma_type = VDP_CHROMA_TYPE_422; - break; - case IMGFMT_UYVY: - vdp_pixel_format = VDP_YCBCR_FORMAT_UYVY; - vdp_chroma_type = VDP_CHROMA_TYPE_422; - } - if (create_vdp_mixer(vdp_chroma_type)) - return -1; - - surface_num = 0; - vid_surface_num = -1; -// resize(); - - return 0; -} - -static uint32_t __FASTCALL__ check_events(int (* __FASTCALL__ adjust_size)(unsigned cw,unsigned ch,unsigned *w,unsigned *h)) -{ - int e = vo_x11_check_events(mDisplay,adjust_size); - - if (handle_preemption() < 0) - return 0; - - if (e & VO_EVENT_RESIZE) - resize(vo_dwidth,vo_dheight); - - if ((e & VO_EVENT_EXPOSE || e & VO_EVENT_RESIZE) && int_pause) { - /* did we already draw a buffer */ - if (visible_buf) { - /* redraw the last visible buffer */ - VdpStatus vdp_st; - vdp_st = vdp_presentation_queue_display(vdp_flip_queue, - output_surfaces[surface_num], - vo_dwidth, vo_dheight, - 0); - CHECK_ST_WARNING("Error when calling vdp_presentation_queue_display") - } - } - return e; -} - -static void draw_osd_I8A8(int x0,int y0, int w,int h, const unsigned char *src, - const unsigned char *srca, int stride, unsigned char* dstbase,int dststride) -{ - VdpOutputSurface output_surface = output_surfaces[surface_num]; - VdpStatus vdp_st; - int i, j; - int pitch; - int index_data_size_required; - VdpRect output_indexed_rect_vid; - VdpOutputSurfaceRenderBlendState blend_state; - - if (!w || !h) - return; - - index_data_size_required = 2*w*h; - if (index_data_size < index_data_size_required) { - index_data = realloc(index_data, index_data_size_required); - index_data_size = index_data_size_required; - } - - // index_data creation, component order - I, A, I, A, ..... - for (i = 0; i < h; i++) - for (j = 0; j < w; j++) { - index_data[i*2*w + j*2] = src [i*stride + j]; - index_data[i*2*w + j*2 + 1] = -srca[i*stride + j]; - } - - output_indexed_rect_vid.x0 = x0; - output_indexed_rect_vid.y0 = y0; - output_indexed_rect_vid.x1 = x0 + w; - output_indexed_rect_vid.y1 = y0 + h; - - pitch = w*2; - - // write source_data to osd_surface. - vdp_st = vdp_output_surface_put_bits_indexed(osd_surface, - VDP_INDEXED_FORMAT_I8A8, - (const void *const*)&index_data, - &pitch, - &output_indexed_rect_vid, - VDP_COLOR_TABLE_FORMAT_B8G8R8X8, - (void *)palette); - CHECK_ST_WARNING("Error when calling vdp_output_surface_put_bits_indexed") - - blend_state.struct_version = VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION; - blend_state.blend_factor_source_color = VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE; - blend_state.blend_factor_source_alpha = VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE; - blend_state.blend_factor_destination_color = VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA; - blend_state.blend_factor_destination_alpha = VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA; - blend_state.blend_equation_color = VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD; - blend_state.blend_equation_alpha = VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD; - - vdp_st = vdp_output_surface_render_output_surface(output_surface, - &output_indexed_rect_vid, - osd_surface, - &output_indexed_rect_vid, - NULL, - &blend_state, - VDP_OUTPUT_SURFACE_RENDER_ROTATE_0); - CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface") -} - -static void draw_osd(void) -{ - MSG_DBG2("DRAW_OSD\n"); - - if (handle_preemption() < 0) - return; - - vo_draw_text(vo_dwidth, vo_dheight, draw_osd_I8A8); -} - -static void flip_page(unsigned idx) -{ - VdpStatus vdp_st; - MSG_DBG2("\nFLIP_PAGE VID:%u -> OUT:%u\n", - surface_render[vid_surface_num].surface, output_surfaces[surface_num]); - - if (handle_preemption() < 0) - return; - - vdp_st = vdp_presentation_queue_display(vdp_flip_queue, output_surfaces[surface_num], - vo_dwidth, vo_dheight, - 0); - CHECK_ST_WARNING("Error when calling vdp_presentation_queue_display") - - surface_num = (surface_num + 1) % NUM_OUTPUT_SURFACES; - visible_buf = 1; -} - -static int draw_slice(uint8_t *image[], int stride[], int w, int h, - int x, int y) -{ - VdpStatus vdp_st; - struct vdpau_render_state *rndr = (struct vdpau_render_state *)image[0]; - int max_refs = image_format == IMGFMT_VDPAU_H264 ? rndr->info.h264.num_ref_frames : 2; - - if (handle_preemption() < 0) - return VO_TRUE; - - if (!IMGFMT_IS_VDPAU(image_format)) - return VO_FALSE; - if ((decoder == VDP_INVALID_HANDLE || decoder_max_refs < max_refs) - && !create_vdp_decoder(image_format, vid_width, vid_height, max_refs)) - return VO_FALSE; - - vdp_st = vdp_decoder_render(decoder, rndr->surface, (void *)&rndr->info, rndr->bitstream_buffers_used, rndr->bitstream_buffers); - CHECK_ST_WARNING("Failed VDPAU decoder rendering"); - return VO_TRUE; -} - - -static int draw_frame(uint8_t *src[]) -{ - return VO_ERROR; -} - -static struct vdpau_render_state *get_surface(int number) -{ - if (number > MAX_VIDEO_SURFACES) - return NULL; - if (surface_render[number].surface == VDP_INVALID_HANDLE) { - VdpStatus vdp_st; - vdp_st = vdp_video_surface_create(vdp_device, vdp_chroma_type, - vid_width, vid_height, - &surface_render[number].surface); - CHECK_ST_WARNING("Error when calling vdp_video_surface_create") - if (vdp_st != VDP_STATUS_OK) - return NULL; - } - MSG_DBG2("VID CREATE: %u\n", surface_render[number].surface); - return &surface_render[number]; -} - -static uint32_t draw_image(mp_image_t *mpi) -{ - if (IMGFMT_IS_VDPAU(image_format)) { - struct vdpau_render_state *rndr = mpi->priv; - vid_surface_num = rndr - surface_render; - if (deint_buffer_past_frames) { - deint_mpi[1] = deint_mpi[0]; - deint_mpi[0] = mpi; - } - } else if (image_format == IMGFMT_BGRA) { - VdpStatus vdp_st; - VdpRect r = {0, 0, vid_width, vid_height}; - vdp_st = vdp_output_surface_put_bits_native(output_surfaces[2], - (void const*const*)mpi->planes, - mpi->stride, &r); - CHECK_ST_ERROR("Error when calling vdp_output_surface_put_bits_native") - vdp_st = vdp_output_surface_render_output_surface(output_surfaces[surface_num], - &out_rect_vid, - output_surfaces[2], - &src_rect_vid, NULL, NULL, - VDP_OUTPUT_SURFACE_RENDER_ROTATE_0); - CHECK_ST_ERROR("Error when calling vdp_output_surface_render_output_surface") - } else if (!(mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)) { - VdpStatus vdp_st; - void *destdata[3] = {mpi->planes[0], mpi->planes[2], mpi->planes[1]}; - struct vdpau_render_state *rndr = get_surface(deint_counter); - deint_counter = (deint_counter + 1) % 3; - vid_surface_num = rndr - surface_render; - if (image_format == IMGFMT_NV12) - destdata[1] = destdata[2]; - vdp_st = vdp_video_surface_put_bits_y_cb_cr(rndr->surface, - vdp_pixel_format, - (const void *const*)destdata, - mpi->stride); // pitch - CHECK_ST_ERROR("Error when calling vdp_video_surface_put_bits_y_cb_cr") - } - if (mpi->fields & MP_IMGFIELD_ORDERED) - top_field_first = !!(mpi->fields & MP_IMGFIELD_TOP_FIRST); - else - top_field_first = 1; - - video_to_output_surface(); - return VO_TRUE; -} - -static uint32_t get_image(mp_image_t *mpi) -{ - struct vdpau_render_state *rndr; - - // no dr for non-decoding for now - if (!IMGFMT_IS_VDPAU(image_format)) - return VO_FALSE; -// if (mpi->type != MP_IMGTYPE_NUMBERED) -// return VO_FALSE; - - rndr = get_surface(0/*mpi->number*/); - if (!rndr) { - MSG_ERR("[vdpau] no surfaces available in get_image\n"); - // TODO: this probably breaks things forever, provide a dummy buffer? - return VO_FALSE; - } - mpi->flags |= MP_IMGFLAG_DIRECT; - mpi->stride[0] = mpi->stride[1] = mpi->stride[2] = 0; - mpi->planes[0] = mpi->planes[1] = mpi->planes[2] = NULL; - // hack to get around a check and to avoid a special-case in vd_ffmpeg.c - mpi->planes[0] = (void *)rndr; - mpi->num_planes = 1; - mpi->priv = rndr; - return VO_TRUE; -} - -static int query_format(uint32_t format) -{ - int default_flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_OSD | VFCAP_FLIP; - switch (format) { - case IMGFMT_BGRA: - if (force_mixer) - return 0; - case IMGFMT_YV12: - case IMGFMT_I420: - case IMGFMT_IYUV: - case IMGFMT_NV12: - case IMGFMT_YUY2: - case IMGFMT_UYVY: - return default_flags/* | VOCAP_NOSLICES*/; - case IMGFMT_VDPAU_MPEG1: - case IMGFMT_VDPAU_MPEG2: - case IMGFMT_VDPAU_H264: - case IMGFMT_VDPAU_WMV3: - case IMGFMT_VDPAU_VC1: - case IMGFMT_VDPAU_MPEG4: - if (create_vdp_decoder(format, 48, 48, 2)) - return default_flags; - } - return 0; -} - -static void DestroyVdpauObjects(void) -{ - int i; - VdpStatus vdp_st; - - free_video_specific(); - - vdp_st = vdp_presentation_queue_destroy(vdp_flip_queue); - CHECK_ST_WARNING("Error when calling vdp_presentation_queue_destroy") - - vdp_st = vdp_presentation_queue_target_destroy(vdp_flip_target); - CHECK_ST_WARNING("Error when calling vdp_presentation_queue_target_destroy") - - for (i = 0; i <= NUM_OUTPUT_SURFACES; i++) { - vdp_st = vdp_output_surface_destroy(output_surfaces[i]); - output_surfaces[i] = VDP_INVALID_HANDLE; - CHECK_ST_WARNING("Error when calling vdp_output_surface_destroy") - } - - vdp_st = vdp_device_destroy(vdp_device); - CHECK_ST_WARNING("Error when calling vdp_device_destroy") -} - -static void uninit(void) -{ - int i; - -// if (!vo_config_count) -// return; - visible_buf = 0; - - for (i = 0; i < MAX_VIDEO_SURFACES; i++) { - // Allocated in ff_vdpau_add_data_chunk() - free(surface_render[i].bitstream_buffers); - surface_render[i].bitstream_buffers_allocated = 0; - } - - /* Destroy all vdpau objects */ - DestroyVdpauObjects(); - - free(index_data); - index_data = NULL; - -#ifdef CONFIG_XF86VM - vo_vm_close(); -#endif - vo_x11_uninit(mDisplay,vo_window); -} - -static const opt_t subopts[] = { - {"deint", OPT_ARG_INT, &deint, (opt_test_f)int_non_neg}, - {"chroma-deint", OPT_ARG_BOOL, &chroma_deint, NULL}, - {"pullup", OPT_ARG_BOOL, &pullup, NULL}, - {"denoise", OPT_ARG_FLOAT, &denoise, NULL}, - {"sharpen", OPT_ARG_FLOAT, &sharpen, NULL}, - {"colorspace", OPT_ARG_INT, &colorspace, NULL}, - {"force-mixer", OPT_ARG_BOOL, &force_mixer, NULL}, - {"hqscaling", OPT_ARG_INT, &hqscaling, (opt_test_f)int_non_neg}, - {NULL} -}; - -static const char help_msg[] = - "\n-vo vdpau command line help:\n" - "Example: mplayer -vo vdpau:deint=2\n" - "\nOptions:\n" - " deint (all modes > 0 respect -field-dominance)\n" - " 0: no deinterlacing\n" - " 1: only show first field\n" - " 2: bob deinterlacing\n" - " 3: temporal deinterlacing (resource-hungry)\n" - " 4: temporal-spatial deinterlacing (very resource-hungry)\n" - " chroma-deint\n" - " Operate on luma and chroma when using temporal deinterlacing (default)\n" - " Use nochroma-deint to speed up temporal deinterlacing\n" - " pullup\n" - " Try to apply inverse-telecine (needs temporal deinterlacing)\n" - " denoise\n" - " Apply denoising, argument is strength from 0.0 to 1.0\n" - " sharpen\n" - " Apply sharpening or softening, argument is strength from -1.0 to 1.0\n" - " colorspace\n" - " 0: guess based on video resolution\n" - " 1: ITU-R BT.601 (default)\n" - " 2: ITU-R BT.709\n" - " 3: SMPTE-240M\n" - " hqscaling\n" - " 0: default VDPAU scaler\n" - " 1-9: high quality VDPAU scaler (needs capable hardware)\n" - " force-mixer\n" - " Use the VDPAU mixer (default)\n" - " Use noforce-mixer to allow BGRA output (disables all above options)\n" - ; - -static uint32_t __FASTCALL__ preinit(const char *arg) -{ - int i; - - deint = 0; - deint_type = 3; - deint_counter = 0; - deint_buffer_past_frames = 0; - deint_mpi[0] = deint_mpi[1] = NULL; - chroma_deint = 1; - pullup = 0; - denoise = 0; - sharpen = 0; - colorspace = 1; - force_mixer = 1; - hqscaling = 0; - if (subopt_parse(arg, subopts) != 0) { - MSG_FATAL(help_msg); - return -1; - } - if (deint) - deint_type = deint; - if (deint > 1) - deint_buffer_past_frames = 1; - if (colorspace < 0 || colorspace > 3) { - MSG_WARN("[vdpau] Invalid color space specified, " - "using BT.601\n"); - colorspace = 1; - } - - if (!vo_init(arg) || win_x11_init_vdpau_procs()) - return -1; - - decoder = VDP_INVALID_HANDLE; - for (i = 0; i < MAX_VIDEO_SURFACES; i++) - surface_render[i].surface = VDP_INVALID_HANDLE; - video_mixer = VDP_INVALID_HANDLE; - for (i = 0; i <= NUM_OUTPUT_SURFACES; i++) - output_surfaces[i] = VDP_INVALID_HANDLE; - vdp_flip_queue = VDP_INVALID_HANDLE; - output_surface_width = output_surface_height = -1; - - // full grayscale palette. - for (i = 0; i < PALETTE_SIZE; ++i) - palette[i] = (i << 16) | (i << 8) | i; - index_data = NULL; - index_data_size = 0; - - procamp.struct_version = VDP_PROCAMP_VERSION; - procamp.brightness = 0.0; - procamp.contrast = 1.0; - procamp.saturation = 1.0; - procamp.hue = 0.0; - - return 0; -} - -static int get_equalizer(char *name, int *value) -{ - if (!strcasecmp(name, "brightness")) - *value = procamp.brightness * 100; - else if (!strcasecmp(name, "contrast")) - *value = (procamp.contrast-1.0) * 100; - else if (!strcasecmp(name, "saturation")) - *value = (procamp.saturation-1.0) * 100; - else if (!strcasecmp(name, "hue")) - *value = procamp.hue * 100 / M_PI; - else - return VO_NOTIMPL; - return VO_TRUE; -} - -static int set_equalizer(char *name, int value) -{ - if (!strcasecmp(name, "brightness")) - procamp.brightness = value / 100.0; - else if (!strcasecmp(name, "contrast")) - procamp.contrast = value / 100.0 + 1.0; - else if (!strcasecmp(name, "saturation")) - procamp.saturation = value / 100.0 + 1.0; - else if (!strcasecmp(name, "hue")) - procamp.hue = value / 100.0 * M_PI; - else - return VO_NOTIMPL; - - return update_csc_matrix(); -} - -static uint32_t control(uint32_t request, void *data) -{ - if (handle_preemption() < 0) - return VO_FALSE; - - switch (request) { - case VOCTRL_CHECK_EVENTS: - { - vo_resize_t * vrest = (vo_resize_t *)data; - vrest->event_type = check_events(vrest->adjust_size); - if(enable_xp && (vrest->event_type & VO_EVENT_RESIZE)==VO_EVENT_RESIZE) - LOCK_VDECODING(); /* just for compatibility with other vo */ - return VO_TRUE; - } -#if 0 - case VOCTRL_GET_DEINTERLACE: - *(int*)data = deint; - return VO_TRUE; - case VOCTRL_SET_DEINTERLACE: - if (image_format == IMGFMT_BGRA) - return VO_NOTIMPL; - deint = *(int*)data; - if (deint) - deint = deint_type; - if (deint_type > 2) { - VdpStatus vdp_st; - VdpVideoMixerFeature features[1] = - {deint_type == 3 ? - VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL : - VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL}; - VdpBool feature_enables[1] = {deint ? VDP_TRUE : VDP_FALSE}; - vdp_st = vdp_video_mixer_set_feature_enables(video_mixer, 1, - features, - feature_enables); - CHECK_ST_WARNING("Error changing deinterlacing settings") - deint_buffer_past_frames = 1; - } - return VO_TRUE; -#endif - case VOCTRL_PAUSE: - return int_pause = 1; - case VOCTRL_RESUME: - return int_pause = 0; - case VOCTRL_QUERY_FORMAT: - return query_format(*(uint32_t *)data); -#if 0 - case VOCTRL_GET_IMAGE: - return get_image(data); - case VOCTRL_DRAW_IMAGE: - return draw_image(data); - case VOCTRL_GUISUPPORT: - return VO_TRUE; - case VOCTRL_BORDER: - vo_x11_border(); - resize(); - return VO_TRUE; -#endif - case VOCTRL_FULLSCREEN: - vo_x11_fullscreen(); - resize(vo_dwidth, vo_dheight); - return VO_TRUE; -#if 0 - case VOCTRL_GET_PANSCAN: - return VO_TRUE; - case VOCTRL_SET_PANSCAN: - resize(); - return VO_TRUE; -#endif - case VOCTRL_SET_EQUALIZER: { - int value=*(int *)data; - if (image_format == IMGFMT_BGRA) - return VO_NOTIMPL; - return set_equalizer(data, value); - } - case VOCTRL_GET_EQUALIZER: { - int *value = (int *)data; - return get_equalizer(data, value); - } -#if 0 - case VOCTRL_ONTOP: - vo_x11_ontop(); - return VO_TRUE; - case VOCTRL_UPDATE_SCREENINFO: - update_xinerama_info(); - return VO_TRUE; - case VOCTRL_DRAW_EOSD: - if (!data) - return VO_FALSE; - generate_eosd(data); - draw_eosd(); - return VO_TRUE; - case VOCTRL_GET_EOSD_RES: { - mp_eosd_res_t *r = data; - r->mt = r->mb = r->ml = r->mr = 0; - if (vo_fs) { - r->w = vo_screenwidth; - r->h = vo_screenheight; - r->ml = r->mr = border_x; - r->mt = r->mb = border_y; - } else { - r->w = vo_dwidth; - r->h = vo_dheight; - } - return VO_TRUE; - } -#endif - } - return VO_NOTIMPL; -} - -/* @} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-05 11:40:02
|
Revision: 73 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=73&view=rev Author: nickols_k Date: 2010-01-05 11:39:56 +0000 (Tue, 05 Jan 2010) Log Message: ----------- support for new codecs and fourcc Modified Paths: -------------- etc/codecs.conf mplayerxp/codec-cfg.c mplayerxp/libvo/img_format.c mplayerxp/libvo/img_format.h mplayerxp/libvo/vo_opengl.c mplayerxp/libvo/vo_x11.c mplayerxp/libvo/vo_xvidix.c mplayerxp/m_option.c mplayerxp/mp_image.c mplayerxp/postproc/vf_scale.c Modified: etc/codecs.conf =================================================================== --- etc/codecs.conf 2010-01-05 08:04:53 UTC (rev 72) +++ etc/codecs.conf 2010-01-05 11:39:56 UTC (rev 73) @@ -24,6 +24,9 @@ fourcc mx3n,mx3p fourcc AVmp fourcc mp2v,mpgv + fourcc m2v1,m1v1 + fourcc PIM1 ; Pinnacle hardware-MPEG-1 + fourcc PIM2 ; Pinnacle hardware-MPEG-2 fourcc VCR2 fourcc LMP2 ; Lead mpeg2 in avi driver mpegpes @@ -117,6 +120,14 @@ out I420,IYUV out YV12 +videocodec ffv210 + info "FFmpeg V210 - 10-bit" + status untested + fourcc v210 + driver ffmpeg + dll v210 + out 422P16 + ; ============== MPLAYER OPENSOURCE CODECS ========= videocodec cvid @@ -191,6 +202,45 @@ dll "xanlib.dll" out BGR24,BGR15,BGR8 flip +videocodec nogatech + status working + fourcc NTN1,NTN2 + driver vfw + dll "nuvision.ax" + out BGR24 flip + +videocodec geomp4 + info "GeoVision Advanced MPEG-4" + status working + fourcc GMP4,GM40 + driver vfw + dll "GXAMP4.dll" + out BGR24 flip + +videocodec frwuvfw + info "Forward Uncompressed Video Codec" + status working + fourcc FRWU + driver vfw + dll "FRWU.dll" + out BGR24 flip + +videocodec frwdvfw + info "Forward JPEG Video Codec" + status working + fourcc FRWD + driver vfw + dll "FRWD.dll" + out BGR24 flip + +videocodec frwtvfw + info "Forward JPEG+Alpha Video" + status working + fourcc FRWT + driver vfw + dll "FRWT.dll" + out BGR24 flip + videocodec u263 info "UB Video H.263/H.263+/H.263++ Decoder" comment "added by Juanjo" @@ -262,7 +312,7 @@ out YUY2 yuvhack out BGR32,BGR24,BGR15 cpuflags mmx - + videocodec divx4vfw info "DivX4Windows-VFW (DivX 3.x, DivX4)" status working @@ -353,6 +403,16 @@ out YUY2 out BGR32,BGR24,BGR15 + +videocodec sp4x + info "SP4x codec - used by Aiptek MegaCam" + status working + fourcc SP40,SP41,SP42,SP43,SP44,SP45 + fourcc SP46,SP47 + driver vfw + dll "SP4X_32.DLL" + out BGR24,BGR15 flip + videocodec sp5x info "SP5x codec - used by Aiptek MegaCam" status working @@ -466,6 +526,39 @@ dll "psiv.dll" out BGR32,BGR24 flip +videocodec midivid3 + info "www.midivid.com/codec/mv3codec.html" + status working + fourcc MV30 + driver vfw + dll "MV3.dll" + out BGR24,BGR16 + +videocodec moyea + info "Moyea Flash to Video Converter" + comment "requires zlib1.dll" ; c7d4d685a0af2a09cbc21cb474358595 + status working + fourcc MFZ0 + driver vfw + dll "MyFlashZip0.ax" + out BGR24 flip + +videocodec nsvideo + info "Power VideoWorks video" + status working + fourcc NSVI + driver vfw + dll "nsvideo.dll" + out BGR24 flip + +videocodec smv2vfw + info "DideoNET SMV2" + status working + fourcc SMV2 + driver vfw + dll "smv2vfw.dll" + out BGR32,BGR24,BGR8,RGB32,RGB24,RGB8 flip + videocodec canopushq status working info "Canopus HQ Codec" @@ -484,6 +577,174 @@ dll "CLLCcodc.dll" out BGR24 +videocodec wavcvfw + info "centre for wavelets, approximation and infromation processing" + status working + fourcc wavc + driver vfw + dll "WavCWAIP.dll" + out BGR24 flip + +videocodec slifvfw + info "SoftLab-NSK Forward MPEG2 I-frames" + status working + fourcc slif + driver vfw + dll "slif.dll" + out RGB32 flip + +videocodec cjpg + info "Creative Labs Video Blaster Webcam" + comment "sequential jpeg files?" + status working + fourcc CJPG + driver vfw + dll "CtWbJpg.DLL" + out YUY2 + out UYVY + out BGR24,BGR15 + +videocodec kensington + info "kensington webcam" + status working + fourcc AJPG,ABYR + fourcc LBYR,JBYR ; untested, creative labs cam + fourcc UV12 ; untested + driver vfw + dll "aoxdxipl.ax" + out BGR24 flip + +videocodec xjpg + info "xiricam Veo PC Camera" + status working + fourcc XJPG + driver vfw + dll "camfc.dll" + out BGR24 flip + +videocodec tm2xvfw + info "TrueMotion 2.0" + status working + fourcc TM2X + fourcc TM2A + driver vfw + dll "tm2X.dll" + out BGR32,BGR24,BGR16 flip + +videocodec tr20 + info "TrueMotion RT" + status working + fourcc TR20 + driver vfw + dll "tr2032.dll" + out BGR15 + +videocodec sif1vfw + info "sif1 alpha4" + status working + fourcc SIF1 + driver vfw + dll "Sif1_vfw.dll" + out YV12,YUY2 + +videocodec bt411 + info "Brooktree 411 codec" + status working + fourcc BT20,Y41P + driver vfwex + dll "btvvc32.drv" + out BGR24 + +videocodec bwmpeg + info "Broadway MPEG Capture Codec" + status working + fourcc BW10 + driver vfwex + dll "bw10.dll" ;requires vtaccess.dll + out YV12,YUY2,I420 + +videocodec zdsoft + info "zdsoft screen recorder" + status working + fourcc ZDSV + driver vfwex + dll "scrvid.dll" + out BGR32 + +videocodec webtrain + info "WebTrain Communication lossless screen recorder" + status working + fourcc WTVC + driver vfw + dll "wtvc.dll" + out BGR16 flip + +videocodec kegavideo + info "Kega Video" + comment "requires MSVCR80.DLL on windows" + status working + fourcc KGV1 + driver vfw + dll "KGV1-VFW.dll" + out BGR16 flip + +videocodec xfire + info "xfire video" + status working + fourcc XFR1 + driver vfw + dll "xfcodec.dll" + out YV12,YUY2 + +videocodec vfapi + info "VFAPI rgb transcode codec" + status untested + fourcc vifp + driver vfwex + dll "VFCodec.dll" + out BGR24 flip + +videocodec eyecon + info "nokia eti camcorder eyecon" + status working + fourcc NUB0,NUB1,NUB2 + driver vfw + dll "nub2.dll" + out YV12,YUY2 + +videocodec smsvvfw + info "WorldConnect Wavelet Video" + comment "found in visualmail videos" + status working + fourcc SMSV + driver vfw + dll "wv32vfw.dll" + out BGR24 flip + +videocodec foxmotion + info "fox motion video" + status working + fourcc FMVC + driver vfw + dll "fmcodec.dll" + out BGR32,BGR24,BGR15 flip + +videocodec tridvfw + status untested + fourcc ty2c,TY2C,ty0n + fourcc TY2N,TY0N,T565 + driver vfw + dll "TRICDC32.DRV" + out BGR24 flip + +videocodec vdtzvfw + info "Telegeny VDTZ" + status working + fourcc VDTZ + driver vfw + dll "VTZ32.DLL" + out BGR24 flip + ; ======= DMO Video codecs ============= videocodec wmv9dmo info "Windows Media Video 9 DMO" @@ -544,6 +805,15 @@ guid 0x7bafb3b1, 0xd8f4, 0x4279, 0x92, 0x53, 0x27, 0xda, 0x42, 0x31, 0x08, 0xde out BGR32,BGR24,BGR16 +videocodec gotomeeting + info "GoToMeeting codec" + status working + fourcc G2M2,G2M3 + driver dmo + dll "G2M.dll" + guid 0x23F891A4, 0x572B, 0x474A, 0x86, 0xDA, 0x66, 0xCD, 0xD3, 0xD1, 0xAC, 0x2E + out BGR24,RGB24 flip + videocodec wmv7 info "Windows Media Video 7" status working @@ -579,6 +849,16 @@ ; out YUY2 ; YUV output faulting out BGR32,BGR24,BGR16,BGR15 +videocodec sif1ds + info "sif1 alpha4" + status buggy + comment "one frame every 5 seconds?" + fourcc SIF1 + driver dshow + dll "Sif1Dec.ax" + guid 0x31666973, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 + out BGR32 + videocodec qdv info "Sony Digital Video (DV)" status working @@ -1254,7 +1534,7 @@ videocodec sp6x info "SP6x codec" status working - fourcc SP61 + fourcc SP60,SP61,SP62 driver vfw dll "sp6x_32.dll" out BGR24 flip @@ -1284,9 +1564,19 @@ fourcc ljpg,LJPG ; lossless jpeg fourcc dmb1,DMB1 ; MJPEG by Matrox Rainbow Runner fourcc MJLS ; JPEG-LS custom FOURCC for avi - encoder + fourcc MMJP,QIVG + fourcc ACDV ; ACDSee jpeg + fourcc SLMJ ; SL M-JPEG + fourcc MVJP ; Midvid JPEG Video Codec + fourcc IJLV ; Intel JPEG Library Video Codec + fourcc avi1,avi2 + fourcc MTSJ driver ffmpeg dll mjpeg out YV12,I420,IYUV + out BGR32 ; lossless JPEG + out RGB24 ; JPEG-LS + out Y800 videocodec ffmjpegb info "FFmpeg MJPEG-B decoder" @@ -1310,9 +1600,11 @@ videocodec ffh263 info "FFmpeg H263+ decoder" status working + fourcc T263 fourcc D263 ; DEC H263 fourcc ILVR ; ITU H263+ fourcc L263 ; Lead H263 + fourcc VX1K ; Agora Labs VX1000S H263 fourcc H263,h263 fourcc M263,m263 fourcc S263,s263 @@ -1379,6 +1671,7 @@ fourcc MPG3,mpg3 fourcc MP43,mp43 ; M$ MPEG4 v3 (fourcc mapping to div3) fourcc DIV3,div3 + fourcc DIVF,divf ; divx4.12 fourcc DIV4,div4 fourcc DIV5,div5 ; DivX 3.20 fourcc DIV6,div6 ; -||- @@ -1386,6 +1679,7 @@ fourcc COL0,col0 fourcc COL1,col1 ; Cool codec (based on mpg4ds32.ax) fourcc 3IVD,3ivd ; divxdoctored files (3ivx.com) + fourcc DVX3 driver ffmpeg dll msmpeg4 out YV12,I420,IYUV @@ -1393,6 +1687,7 @@ videocodec ffmp42 info "FFmpeg M$ MPEG-4 v2" status working + fourcc DIV1,div1 fourcc DIV2,div2 fourcc MP42,mp42 driver ffmpeg @@ -1442,6 +1737,22 @@ dll cyuv out 411P +videocodec ffaura + info "Auravision Aura (libavcodec)" + status working + fourcc aura,AURA + driver ffmpeg + dll "aura" + out 411P + +videocodec ffaura2 + info "Auravision Aura 2 (libavcodec)" + status working + fourcc aur2,AUR2 + driver ffmpeg + dll "aura2" + out 422P + videocodec ffsvq1 info "Sorenson video codec v1" status working @@ -1450,6 +1761,14 @@ dll svq1 out YVU9 +videocodec ffr210 + info "FFmpeg R210 - 10-bit RGB" + status working + fourcc r210 + driver ffmpeg + dll "r210" + out RGB48BE,RGB48LE + videocodec ff4xm info "FFmpeg 4XM video" status working @@ -1504,6 +1823,10 @@ fourcc m4cc,M4CC fourcc hdx4,HDX4 fourcc FVFW,fvfw + fourcc FFDS + fourcc DCOD,MVXM,EM4A,PM4V + fourcc M4T3,DMK2,DIGI,INMC + fourcc EPHV,SN40 driver ffmpeg dll mpeg4 ;opendivx out YV12,I420,IYUV @@ -1568,6 +1891,8 @@ videocodec ffdv info "Raw DV decoder using libavcodec" status working + fourcc CDVC,cdvc + fourcc CDVH,cdvh ; Canopus DVCPRO HD fourcc DVSD,dvsd ; PAL fourcc DVCS,dvcs ; NTSC ? fourcc "dvcp" ; PAL DV in .mov @@ -1580,6 +1905,7 @@ fourcc dvhq,dvhp fourcc dvh5,dvh6,dvh3 fourcc dvhd,dvsl,dv25 + fourcc dvs1,dvh1 driver ffmpeg dll dvvideo out YV12,411P @@ -1742,7 +2068,7 @@ driver ffmpeg dll h263 out YV12,I420,IYUV flip - + videocodec fftheora info "FFmpeg's Theora" status untested @@ -1755,6 +2081,7 @@ info "Duck Truemotion1" status working fourcc DUCK + fourcc PVEZ driver ffmpeg dll "truemotion1" out BGR15 @@ -2164,6 +2491,13 @@ dll c93 out BGR8 +videocodec fffrwu + info "FFmpeg Forward Uncompressed Video Codec" + status working + fourcc FRWU + driver ffmpeg + dll "FRWU" + out UYVY ; ============== RAW (uncompressed) and NULL CODECS ========= @@ -2590,6 +2924,13 @@ driver qtaudio dll "QuickTime.qts" +audiocodec zygoaudio + info "Zygo audio" + status working + fourcc SPXN + driver qtaudio + dll "ZyGoAudioS.qtx" + ;============ FFMPEG's codecs audiocodec ffra144 @@ -3053,6 +3394,14 @@ driver ffmpeg dll adpcm_yamaha +audiocodec fftwinvq + info "FFmpeg TwinVQ" + status working + fourcc TWI2 ; internal MPlayer FourCC, different from mplayer's TwinVQ decoder + ; since lavf demuxer is incompatible with it + driver ffmpeg + dll twinvq + ; =============== Windows ACM codecs audiocodec msadpcmacm Modified: mplayerxp/codec-cfg.c =================================================================== --- mplayerxp/codec-cfg.c 2010-01-05 08:04:53 UTC (rev 72) +++ mplayerxp/codec-cfg.c 2010-01-05 11:39:56 UTC (rev 73) @@ -132,9 +132,19 @@ {"CLJR", IMGFMT_CLJR}, {"CYUV", IMGFMT_cyuv}, +{"444P16BE", IMGFMT_444P16_BE}, +{"444P16LE", IMGFMT_444P16_LE}, +{"444P16", IMGFMT_444P16}, +{"422P16BE", IMGFMT_422P16_BE}, +{"422P16LE", IMGFMT_422P16_LE}, +{"422P16", IMGFMT_422P16}, +{"420P16BE", IMGFMT_420P16_BE}, +{"420P16LE", IMGFMT_420P16_LE}, +{"420P16", IMGFMT_420P16}, {"444P", IMGFMT_444P}, {"422P", IMGFMT_422P}, {"411P", IMGFMT_411P}, +{"420A", IMGFMT_420A}, {"NV12", IMGFMT_NV12}, {"NV21", IMGFMT_NV21}, @@ -156,6 +166,9 @@ {"YUVP", IMGFMT_YUVP}, {"UYVP", IMGFMT_UYVP}, +{"RGB48LE",IMGFMT_RGB48LE}, +{"RGB48BE",IMGFMT_RGB48BE}, +{"RGB48", IMGFMT_RGB48NE}, {"RGB4", IMGFMT_RGB|4}, {"RGB8", IMGFMT_RGB|8}, {"RGB15", IMGFMT_RGB|15}, @@ -166,6 +179,9 @@ {"ARGB", IMGFMT_ARGB}, {"RGB1", IMGFMT_RGB|1}, +{"BGR48LE",IMGFMT_BGR48LE}, +{"BGR48BE",IMGFMT_BGR48BE}, +{"BGR48", IMGFMT_BGR48NE}, {"BGR4", IMGFMT_BGR|4}, {"BGR8", IMGFMT_BGR|8}, {"BGR15", IMGFMT_BGR|15}, @@ -219,16 +235,20 @@ sflags+=strlen(flagstr[j]); } while (*(sflags++) == ','); - if (*(--sflags) != '\0') + if (*(--sflags) != '\0') { + MSG_ERR("\n{found unparsed flg tile: %s}\n",sflags); goto err_out_parse_error; + } } do { for (j = 0; fmt_table[j].name != NULL; j++) if (!strncmp(sfmt, fmt_table[j].name, strlen(fmt_table[j].name))) break; - if (fmt_table[j].name == NULL) + if (fmt_table[j].name == NULL) { + MSG_ERR("\n{%s is not registered format}\n",sfmt); goto err_out_parse_error; + } outfmt[i] = fmt_table[j].num; outflags[i] = flags; ++i; @@ -238,9 +258,11 @@ if (!freeslots) goto err_out_too_many; - if (*(--sfmt) != '\0') + if (*(--sfmt) != '\0') { + MSG_ERR("\n{found unparsed tile %s}\n",sfmt); goto err_out_parse_error; - + } + return 1; err_out_too_many: MSG_ERR("too many out..."); @@ -378,14 +400,15 @@ codecs_t **codecsp = NULL;// points to audio_codecs or to video_codecs char *endptr; // strtoul()... int *nr_codecsp; + const char *err_hint=NULL; int codec_type; /* TYPE_VIDEO/TYPE_AUDIO */ int tmp, i; // in case we call it secont time if(video_codecs!=NULL)free(video_codecs); else video_codecs=NULL; - - if(audio_codecs!=NULL)free(audio_codecs); + + if(audio_codecs!=NULL)free(audio_codecs); else audio_codecs=NULL; nr_vcodecs = 0; @@ -414,8 +437,8 @@ goto out; if (!strcmp(token[0], "audiocodec") || !strcmp(token[0], "videocodec")) goto loop_enter; + err_hint=token[0]; goto err_out_parse_error; - while ((tmp = get_token(1, 1)) != RET_EOF) { if (tmp == RET_EOL) continue; @@ -440,7 +463,7 @@ } if (!(*codecsp = (codecs_t *) realloc(*codecsp, sizeof(codecs_t) * (*nr_codecsp + 2)))) { - MSG_FATAL("can't realloc '*codecsp': %s\n", strerror(errno)); + MSG_FATAL(" can't realloc '*codecsp': %s\n", strerror(errno)); goto err_out; } codec=*codecsp + *nr_codecsp; @@ -449,53 +472,71 @@ memset(codec->fourcc, 0xff, sizeof(codec->fourcc)); memset(codec->outfmt, 0xff, sizeof(codec->outfmt)); memset(codec->infmt, 0xff, sizeof(codec->infmt)); - + if (get_token(1, 1) < 0) goto err_out_parse_error; for (i = 0; i < *nr_codecsp - 1; i++) { if(( (*codecsp)[i].codec_name!=NULL) && (!strcmp(token[0], (*codecsp)[i].codec_name)) ) { - MSG_ERR("codec name '%s' isn't unique", token[0]); + MSG_ERR(" codec name '%s' isn't unique", token[0]); goto err_out_print_linenum; } } strncpy(codec->codec_name,token[0],sizeof(codec->codec_name)); codec->codec_name[sizeof(codec->codec_name)-1]=0; } else if (!strcmp(token[0], "info")) { - if (codec->s_info[0] || get_token(1, 1) < 0) + err_hint="info"; + if (codec->s_info[0] || get_token(1, 1) < 0) { goto err_out_parse_error; + } strncpy(codec->s_info,token[0],sizeof(codec->s_info)); codec->s_info[sizeof(codec->s_info)-1]=0; } else if (!strcmp(token[0], "comment")) { - if (get_token(1, 1) < 0) + err_hint="comment"; + if (get_token(1, 1) < 0) { goto err_out_parse_error; + } strncat(codec->s_comment,token[0],sizeof(codec->s_comment)); codec->s_comment[sizeof(codec->s_comment)-1]=0; } else if (!strcmp(token[0], "fourcc")) { - if (get_token(1, 2) < 0) + err_hint="fourcc"; + if (get_token(1, 2) < 0) { goto err_out_parse_error; + } if (!add_to_fourcc(token[0], token[1], codec->fourcc, - codec->fourccmap)) + codec->fourccmap)) { + MSG_ERR(" can't add fourcc '%s'",token[0]); goto err_out_print_linenum; + } } else if (!strcmp(token[0], "format")) { - if (get_token(1, 1) < 0) + err_hint="format"; + if (get_token(1, 1) < 0) { goto err_out_parse_error; - if (!add_to_format(token[0], codec->fourcc,codec->fourccmap)) + } + if (!add_to_format(token[0], codec->fourcc,codec->fourccmap)) { + MSG_ERR(" can't add format '%s'", token[0]); goto err_out_print_linenum; + } } else if (!strcmp(token[0], "driver")) { - if (get_token(1, 1) < 0) + err_hint="driver"; + if (get_token(1, 1) < 0) { goto err_out_parse_error; + } strncpy(codec->driver_name,token[0],sizeof(codec->driver_name)); codec->driver_name[sizeof(codec->driver_name)-1]=0; } else if (!strcmp(token[0], "dll")) { - if (get_token(1, 1) < 0) + err_hint="dll"; + if (get_token(1, 1) < 0) { goto err_out_parse_error; + } strncpy(codec->dll_name,token[0],sizeof(codec->dll_name)); codec->dll_name[sizeof(codec->dll_name)-1]=0; } else if (!strcmp(token[0], "guid")) { - if (get_token(11, 11) < 0) + err_hint="guid"; + if (get_token(11, 11) < 0) { goto err_out_parse_error; + } codec->guid.f1=strtoul(token[0],&endptr,0); if ((*endptr != ',' || *(endptr + 1) != '\0') && *endptr != '\0') @@ -515,27 +556,39 @@ goto err_out_parse_error; } } else if (!strcmp(token[0], "out")) { - if (get_token(1, 2) < 0) + err_hint="out"; + if (get_token(1, 2) < 0) { goto err_out_parse_error; + } if (!add_to_inout(token[0], token[1], codec->outfmt, - codec->outflags)) + codec->outflags)) { + MSG_ERR(" can't add outfmt '%s'", token[0]); goto err_out_print_linenum; + } } else if (!strcmp(token[0], "in")) { - if (get_token(1, 2) < 0) + err_hint="in"; + if (get_token(1, 2) < 0) { goto err_out_parse_error; + } if (!add_to_inout(token[0], token[1], codec->infmt, - codec->inflags)) + codec->inflags)) { + MSG_ERR(" can't add infmt '%s'", token[0]); goto err_out_print_linenum; + } } else if (!strcmp(token[0], "flags")) { - if (get_token(1, 1) < 0) + err_hint="flags"; + if (get_token(1, 1) < 0) { goto err_out_parse_error; + } if (!strcmp(token[0], "seekable")) codec->flags |= CODECS_FLAG_SEEKABLE; else goto err_out_parse_error; } else if (!strcmp(token[0], "status")) { - if (get_token(1, 1) < 0) + err_hint="status"; + if (get_token(1, 1) < 0) { goto err_out_parse_error; + } if (!strcasecmp(token[0], "working")) codec->status = CODECS_STATUS_WORKING; else if (!strcasecmp(token[0], "crashing")) @@ -547,31 +600,34 @@ else goto err_out_parse_error; } else if (!strcmp(token[0], "cpuflags")) { + err_hint="cpuflags"; if (get_token(1, 1) < 0) goto err_out_parse_error; if (!(codec->cpuflags = get_cpuflags(token[0]))) goto err_out_parse_error; } else if (!strcasecmp(token[0], "priority")) { + err_hint="priority"; if (get_token(1, 1) < 0) goto err_out_parse_error; - codec->priority = atoi(token[0]); - } else - goto err_out_parse_error; - } - if (!validate_codec(codec, codec_type)) - goto err_out_not_valid; - MSG_INFO("%d audio & %d video codecs\n", nr_acodecs, nr_vcodecs); - if(video_codecs) video_codecs[nr_vcodecs].codec_name[0] = '\0'; - if(audio_codecs) audio_codecs[nr_acodecs].codec_name[0] = '\0'; + codec->priority = atoi(token[0]); + } else + goto err_out_parse_error; + } + if (!validate_codec(codec, codec_type)) + goto err_out_not_valid; + MSG_INFO("%d audio & %d video codecs\n", nr_acodecs, nr_vcodecs); + if(video_codecs) video_codecs[nr_vcodecs].codec_name[0] = '\0'; + if(audio_codecs) audio_codecs[nr_acodecs].codec_name[0] = '\0'; out: - free(line); - line=NULL; - fclose(fp); - return 1; + free(line); + line=NULL; + fclose(fp); + return 1; err_out_parse_error: - MSG_ERR("parse error"); + MSG_ERR("parse error "); err_out_print_linenum: + if(err_hint) MSG_ERR("(%s)",err_hint); PRINT_LINENUM; err_out: if (audio_codecs) Modified: mplayerxp/libvo/img_format.c =================================================================== --- mplayerxp/libvo/img_format.c 2010-01-05 08:04:53 UTC (rev 72) +++ mplayerxp/libvo/img_format.c 2010-01-05 11:39:56 UTC (rev 73) @@ -14,6 +14,7 @@ case IMGFMT_RGB15: return("RGB 15-bit"); case IMGFMT_RGB16: return("RGB 16-bit"); case IMGFMT_RGB24: return("RGB 24-bit"); + case IMGFMT_RGB48NE: return("RGB 48-bit"); // case IMGFMT_RGB32: return("RGB 32-bit"); case IMGFMT_BGR1: return("BGR 1-bit"); case IMGFMT_BGR4: return("BGR 4-bit"); @@ -22,6 +23,7 @@ case IMGFMT_BGR15: return("BGR 15-bit"); case IMGFMT_BGR16: return("BGR 16-bit"); case IMGFMT_BGR24: return("BGR 24-bit"); + case IMGFMT_BGR48NE: return("BGR 48-bit"); // case IMGFMT_BGR32: return("BGR 32-bit"); case IMGFMT_ABGR: return("ABGR"); case IMGFMT_BGRA: return("BGRA"); @@ -61,6 +63,13 @@ case IMGFMT_CLJR: return("Packed CLJR"); case IMGFMT_YUVP: return("Packed YUVP"); case IMGFMT_UYVP: return("Packed UYVP"); + case IMGFMT_420A: return "Planar YV12 with alpha"; + case IMGFMT_420P16_LE: return "Planar 420P 16-bit little-endian"; + case IMGFMT_420P16_BE: return "Planar 420P 16-bit big-endian"; + case IMGFMT_422P16_LE: return "Planar 422P 16-bit little-endian"; + case IMGFMT_422P16_BE: return "Planar 422P 16-bit big-endian"; + case IMGFMT_444P16_LE: return "Planar 444P 16-bit little-endian"; + case IMGFMT_444P16_BE: return "Planar 444P 16-bit big-endian"; case IMGFMT_MPEGPES: return("Mpeg PES"); case IMGFMT_ZRMJPEGNI: return("Zoran MJPEG non-interlaced"); case IMGFMT_ZRMJPEGIT: return("Zoran MJPEG top field first"); @@ -88,6 +97,8 @@ { PIX_FMT_YUV410P, IMGFMT_YVU9 }, ///< Planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) { PIX_FMT_YUV410P, IMGFMT_IF09 }, ///< rough alias { PIX_FMT_YUV411P, IMGFMT_411P }, ///< Planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) + { PIX_FMT_RGB48BE, IMGFMT_RGB48BE }, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, big-endian + { PIX_FMT_RGB48LE, IMGFMT_RGB48LE }, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, little-endian { PIX_FMT_RGB565, IMGFMT_RGB16}, ///< Packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), in cpu endianness { PIX_FMT_RGB555, IMGFMT_RGB15}, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in cpu endianness most significant bit to 1 { PIX_FMT_GRAY8, IMGFMT_Y800 }, ///< Y , 8bpp @@ -115,6 +126,14 @@ { PIX_FMT_NV12, IMGFMT_NV12 }, ///< Planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV { PIX_FMT_NV21, IMGFMT_NV21 }, ///< as above, but U and V bytes are swapped + { PIX_FMT_YUVA420P, IMGFMT_420A },///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) + { PIX_FMT_YUV420P16LE, IMGFMT_420P16_LE }, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + { PIX_FMT_YUV420P16BE, IMGFMT_420P16_BE },///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + { PIX_FMT_YUV422P16LE, IMGFMT_422P16_LE },///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + { PIX_FMT_YUV422P16BE, IMGFMT_422P16_BE },///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + { PIX_FMT_YUV444P16LE, IMGFMT_444P16_LE },///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + { PIX_FMT_YUV444P16BE, IMGFMT_444P16_BE },///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + { PIX_FMT_RGB32_1, IMGFMT_RGBA }, ///< Packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in cpu endianness { PIX_FMT_BGR32_1, IMGFMT_BGRA } ///< Packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in cpu endianness }; @@ -142,6 +161,11 @@ int rgbfmt_depth(int fmt) { switch(pixfmt_from_fourcc(fmt)) { + case PIX_FMT_RGB48BE: + case PIX_FMT_RGB48LE: +// case PIX_FMT_BGR48BE: +// case PIX_FMT_BGR48LE: + return 48; case PIX_FMT_BGRA: case PIX_FMT_ABGR: case PIX_FMT_RGBA: @@ -169,6 +193,6 @@ case PIX_FMT_MONOBLACK: return 1; default: - return 0; + return 256; } } Modified: mplayerxp/libvo/img_format.h =================================================================== --- mplayerxp/libvo/img_format.h 2010-01-05 08:04:53 UTC (rev 72) +++ mplayerxp/libvo/img_format.h 2010-01-05 11:39:56 UTC (rev 73) @@ -15,6 +15,8 @@ #define IMGFMT_RGB16 (IMGFMT_RGB|16) #define IMGFMT_RGB24 (IMGFMT_RGB|24) #define IMGFMT_RGB32 (IMGFMT_RGB|32) +#define IMGFMT_RGB48LE (IMGFMT_RGB|48) +#define IMGFMT_RGB48BE (IMGFMT_RGB|48|128) #define IMGFMT_BGR_MASK 0xFFFFFF00 #define IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8)) @@ -26,8 +28,8 @@ #define IMGFMT_BGR16 (IMGFMT_BGR|16) #define IMGFMT_BGR24 (IMGFMT_BGR|24) #define IMGFMT_BGR32 (IMGFMT_BGR|32) -#define IMGFMT_RGB48LE (IMGFMT_RGB|48) -#define IMGFMT_RGB48BE (IMGFMT_RGB|48|128) +#define IMGFMT_BGR48LE (IMGFMT_BGR|48) +#define IMGFMT_BGR48BE (IMGFMT_BGR|48|128) #ifdef WORDS_BIGENDIAN #define IMGFMT_ABGR IMGFMT_RGB32 @@ -35,12 +37,14 @@ #define IMGFMT_ARGB IMGFMT_BGR32 #define IMGFMT_RGBA (IMGFMT_BGR32|64) #define IMGFMT_RGB48NE IMGFMT_RGB48BE +#define IMGFMT_BGR48NE IMGFMT_RGB48LE #else #define IMGFMT_ABGR (IMGFMT_BGR32|64) #define IMGFMT_BGRA IMGFMT_BGR32 #define IMGFMT_ARGB (IMGFMT_RGB32|64) #define IMGFMT_RGBA IMGFMT_RGB32 #define IMGFMT_RGB48NE IMGFMT_RGB48LE +#define IMGFMT_BGR48NE IMGFMT_RGB48BE #endif /* old names for compatibility */ @@ -94,6 +98,31 @@ #define IMGFMT_YUVP 0x50565559 #define IMGFMT_UYVP 0x50565955 +// 4:2:0 planar with alpha +#define IMGFMT_420A 0x41303234 + +#define IMGFMT_444P16_LE 0x51343434 +#define IMGFMT_444P16_BE 0x34343451 +#define IMGFMT_422P16_LE 0x51323234 +#define IMGFMT_422P16_BE 0x34323251 +#define IMGFMT_420P16_LE 0x51303234 +#define IMGFMT_420P16_BE 0x34323051 +#if HAVE_BIGENDIAN +#define IMGFMT_444P16 IMGFMT_444P16_BE +#define IMGFMT_422P16 IMGFMT_422P16_BE +#define IMGFMT_420P16 IMGFMT_420P16_BE +#else +#define IMGFMT_444P16 IMGFMT_444P16_LE +#define IMGFMT_422P16 IMGFMT_422P16_LE +#define IMGFMT_420P16 IMGFMT_420P16_LE +#endif + +#define IMGFMT_IS_YUVP16_LE(fmt) (((fmt ^ IMGFMT_420P16_LE) & 0xff0000ff) == 0) +#define IMGFMT_IS_YUVP16_BE(fmt) (((fmt ^ IMGFMT_420P16_BE) & 0xff0000ff) == 0) +#define IMGFMT_IS_YUVP16_NE(fmt) (((fmt ^ IMGFMT_420P16 ) & 0xff0000ff) == 0) +#define IMGFMT_IS_YUVP16(fmt) (IMGFMT_IS_YUVP16_LE(fmt) || IMGFMT_IS_YUVP16_BE(fmt)) + + /* Compressed Formats */ #define IMGFMT_MPEGPES (('M'<<24)|('P'<<16)|('E'<<8)|('S')) /* Formats that are understood by zoran chips, we include Modified: mplayerxp/libvo/vo_opengl.c =================================================================== --- mplayerxp/libvo/vo_opengl.c 2010-01-05 08:04:53 UTC (rev 72) +++ mplayerxp/libvo/vo_opengl.c 2010-01-05 11:39:56 UTC (rev 73) @@ -428,12 +428,14 @@ static uint32_t __FASTCALL__ query_format( vo_query_fourcc_t* format ) { - MSG_DBG2("vo_x11: query_format was called: %x (%s)\n",format->fourcc,vo_format_name(format->fourcc)); - if (IMGFMT_IS_BGR(format->fourcc)||IMGFMT_IS_RGB(format->fourcc)) + MSG_DBG2("vo_opengl: query_format was called: %x (%s)\n",format->fourcc,vo_format_name(format->fourcc)); + if((IMGFMT_IS_BGR(format->fourcc)||IMGFMT_IS_RGB(format->fourcc))&&rgbfmt_depth(format->fourcc)<48) { + MSG_DBG2("vo_opengl: OK\n"); return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN; } + MSG_DBG2("vo_opengl: FALSE\n"); return 0; } Modified: mplayerxp/libvo/vo_x11.c =================================================================== --- mplayerxp/libvo/vo_x11.c 2010-01-05 08:04:53 UTC (rev 72) +++ mplayerxp/libvo/vo_x11.c 2010-01-05 11:39:56 UTC (rev 73) @@ -423,9 +423,9 @@ { MSG_DBG2("vo_x11: query_format was called: %x (%s)\n",format->fourcc,vo_format_name(format->fourcc)); #ifdef WORDS_BIGENDIAN - if (IMGFMT_IS_BGR(format->fourcc)) + if (IMGFMT_IS_BGR(format->fourcc) && rgbfmt_depth(format->fourcc)<48) #else - if (IMGFMT_IS_RGB(format->fourcc)) + if (IMGFMT_IS_RGB(format->fourcc) && rgbfmt_depth(format->fourcc)<48) #endif { if (rgbfmt_depth(format->fourcc) == (unsigned)vo_depthonscreen) Modified: mplayerxp/libvo/vo_xvidix.c =================================================================== --- mplayerxp/libvo/vo_xvidix.c 2010-01-05 08:04:53 UTC (rev 72) +++ mplayerxp/libvo/vo_xvidix.c 2010-01-05 11:39:56 UTC (rev 73) @@ -187,7 +187,7 @@ image_width = width; image_format = format; - if (IMGFMT_IS_RGB(format) || IMGFMT_IS_BGR(format)) + if ((IMGFMT_IS_RGB(format) || IMGFMT_IS_BGR(format)) && rgbfmt_depth(format)<48) { image_depth = rgbfmt_depth(format); } Modified: mplayerxp/m_option.c =================================================================== --- mplayerxp/m_option.c 2010-01-05 08:04:53 UTC (rev 72) +++ mplayerxp/m_option.c 2010-01-05 11:39:56 UTC (rev 73) @@ -1014,9 +1014,19 @@ const char* name; unsigned int fmt; } mp_imgfmt_list[] = { + {"444p16be", IMGFMT_444P16_BE}, + {"444p16le", IMGFMT_444P16_LE}, + {"444p16", IMGFMT_444P16}, + {"422p16be", IMGFMT_422P16_BE}, + {"422p16le", IMGFMT_422P16_LE}, + {"422p16", IMGFMT_422P16}, + {"420p16be", IMGFMT_420P16_BE}, + {"420p16le", IMGFMT_420P16_LE}, + {"420p16", IMGFMT_420P16}, {"444p", IMGFMT_444P}, {"422p", IMGFMT_422P}, {"411p", IMGFMT_411P}, + {"420a", IMGFMT_420A}, {"yuy2", IMGFMT_YUY2}, {"uyvy", IMGFMT_UYVY}, {"yvu9", IMGFMT_YVU9}, @@ -1030,6 +1040,9 @@ {"y8", IMGFMT_Y8}, {"nv12", IMGFMT_NV12}, {"nv21", IMGFMT_NV21}, + {"bgr48be", IMGFMT_BGR48BE}, + {"bgr48le", IMGFMT_BGR48LE}, + {"bgr48", IMGFMT_BGR48NE}, {"bgr24", IMGFMT_BGR24}, {"bgr32", IMGFMT_BGR32}, {"bgr16", IMGFMT_BGR16}, @@ -1038,6 +1051,9 @@ {"bgr4", IMGFMT_BGR4}, {"bg4b", IMGFMT_BG4B}, {"bgr1", IMGFMT_BGR1}, + {"rgb48be", IMGFMT_RGB48BE}, + {"rgb48le", IMGFMT_RGB48LE}, + {"rgb48", IMGFMT_RGB48NE}, {"rgb24", IMGFMT_RGB24}, {"rgb32", IMGFMT_RGB32}, {"rgb16", IMGFMT_RGB16}, @@ -1196,7 +1212,6 @@ return d; return -1e100; } - static int parse_time(const m_option_t* opt,const char *name, char *param, void* dst, int src) { @@ -1204,14 +1219,14 @@ if (param == NULL || strlen(param) == 0) return M_OPT_MISSING_PARAM; - + time = parse_timestring(param); if (time == -1e100) { MSG_ERR("Option %s: invalid time: '%s'\n", name,param); return M_OPT_INVALID; } - + if (dst) *(double *)dst = time; return 1; @@ -1240,7 +1255,7 @@ if (param == NULL || strlen(param) == 0) return M_OPT_MISSING_PARAM; - + ts.pos=0; /* End at size parsing */ if(sscanf(param, "%lf%3s", &end_at, unit) == 2) { @@ -1269,7 +1284,7 @@ name,param); return M_OPT_INVALID; } - + ts.type = END_AT_TIME; ts.pos = end_at; out: @@ -1291,7 +1306,6 @@ NULL }; - //// Objects (i.e. filters, etc) settings #include "m_struct.h" @@ -1439,7 +1453,7 @@ ret = malloc((n+2)*2*sizeof(char*)); n = nold = 0; last_ptr = params; - + while(last_ptr && last_ptr[0] != '\0') { ptr = strchr(last_ptr,separator); if(!ptr) { @@ -1459,7 +1473,7 @@ } ret[n*2] = ret[n*2+1] = NULL; *_ret = ret; - + return 1; } @@ -1489,7 +1503,7 @@ for(r = 0 ; opts[r] ; r += 2) m_struct_set(desc,dst,opts[r],opts[r+1]); - return 1; + return 1; } @@ -1532,7 +1546,6 @@ char *param,**plist = NULL; const m_struct_t* desc; m_obj_settings_t *ret = _ret ? *_ret : NULL; - // Now check that the object exists param = strchr(str,'='); @@ -1748,7 +1761,7 @@ if( ((opt->flags & M_OPT_MIN) && (n < opt->min)) || ((opt->flags & M_OPT_MAX) && (n > opt->max)) ) return M_OPT_OUT_OF_RANGE; - + if(dst) { if(queue) { int qsize; @@ -1767,7 +1780,7 @@ memcpy(&head[hsize],res,(n+1)*sizeof(m_obj_settings_t)); free(res); res = head; - } + } VAL(dst) = res; } return 1; @@ -1802,9 +1815,7 @@ if(VAL(dst)) free_obj_settings_list(dst); if(!s) return; - - - + for(n = 0 ; s[n].name ; n++) /* NOP */; d = malloc((n+1)*sizeof(m_obj_settings_t)); @@ -1831,8 +1842,6 @@ free_obj_settings_list, }; - - static int parse_obj_presets(const m_option_t* opt,const char *name, char *param, void* dst, int src) { m_obj_presets_t* obj_p = (m_obj_presets_t*)opt->priv; @@ -1878,7 +1887,7 @@ } if(!dst) return 1; - + for(i = 0 ; in_desc->fields[i].name ; i++) { const m_option_t* out_opt = m_option_list_find(out_desc->fields, in_desc->fields[i].name); @@ -1910,7 +1919,7 @@ int pos1, pos2, r, v6addr = 0; char *ptr1=NULL, *ptr2=NULL, *ptr3=NULL, *ptr4=NULL; m_struct_t* desc = opt->priv; - + if(!desc) { MSG_ERR("Option %s: Custom URL needs a pointer to a m_struct_t in the priv field.\n",name); return M_OPT_PARSER_ERR; @@ -1956,7 +1965,7 @@ ptr2 = NULL; } if( ptr2!=NULL ) { - + // We got something, at least a username... if(!m_option_list_find(desc->fields,"username")) { MSG_WARN("Option %s: This URL doesn't have a username part.\n",name); @@ -2013,7 +2022,7 @@ ptr2 = ptr3; v6addr = 1; } else { - ptr2 = ptr1; + ptr2 = ptr1; } // look if the port is given @@ -2113,4 +2122,4 @@ NULL, NULL, NULL -}; +}; Modified: mplayerxp/mp_image.c =================================================================== --- mplayerxp/mp_image.c 2010-01-05 08:04:53 UTC (rev 72) +++ mplayerxp/mp_image.c 2010-01-05 11:39:56 UTC (rev 73) @@ -52,6 +52,7 @@ mpi->chroma_x_shift=1; mpi->chroma_y_shift=1; return; + case IMGFMT_420A: case IMGFMT_IF09: mpi->num_planes=4; case IMGFMT_YVU9: @@ -62,6 +63,15 @@ mpi->chroma_x_shift=2; mpi->chroma_y_shift=2; return; + case IMGFMT_444P16_LE: + case IMGFMT_444P16_BE: + mpi->flags|=MP_IMGFLAG_PLANAR; + mpi->bpp=48; + mpi->chroma_width=(mpi->width); + mpi->chroma_height=(mpi->height); + mpi->chroma_x_shift=0; + mpi->chroma_y_shift=0; + return; case IMGFMT_444P: mpi->flags|=MP_IMGFLAG_PLANAR; mpi->bpp=24; @@ -70,6 +80,15 @@ mpi->chroma_x_shift=0; mpi->chroma_y_shift=0; return; + case IMGFMT_422P16_LE: + case IMGFMT_422P16_BE: + mpi->flags|=MP_IMGFLAG_PLANAR; + mpi->bpp=32; + mpi->chroma_width=(mpi->width>>1); + mpi->chroma_height=(mpi->height); + mpi->chroma_x_shift=1; + mpi->chroma_y_shift=0; + return; case IMGFMT_422P: mpi->flags|=MP_IMGFLAG_PLANAR; mpi->bpp=16; @@ -78,6 +97,15 @@ mpi->chroma_x_shift=1; mpi->chroma_y_shift=0; return; + case IMGFMT_420P16_LE: + case IMGFMT_420P16_BE: + mpi->flags|=MP_IMGFLAG_PLANAR; + mpi->bpp=24; + mpi->chroma_width=(mpi->width>>2); + mpi->chroma_height=(mpi->height); + mpi->chroma_x_shift=2; + mpi->chroma_y_shift=0; + return; case IMGFMT_411P: mpi->flags|=MP_IMGFLAG_PLANAR; mpi->bpp=12; Modified: mplayerxp/postproc/vf_scale.c =================================================================== --- mplayerxp/postproc/vf_scale.c 2010-01-05 08:04:53 UTC (rev 72) +++ mplayerxp/postproc/vf_scale.c 2010-01-05 11:39:56 UTC (rev 73) @@ -50,6 +50,13 @@ static const unsigned int outfmt_list[]={ // YUV: + IMGFMT_444P16_LE, + IMGFMT_444P16_BE, + IMGFMT_422P16_LE, + IMGFMT_422P16_BE, + IMGFMT_420P16_LE, + IMGFMT_420P16_BE, + IMGFMT_420A, IMGFMT_444P, IMGFMT_422P, IMGFMT_YV12, @@ -61,6 +68,8 @@ IMGFMT_YUY2, IMGFMT_UYVY, // RGB and grayscale (Y8 and Y800): + IMGFMT_RGB48LE, + IMGFMT_RGB48BE, IMGFMT_BGR32, IMGFMT_RGB32, IMGFMT_BGR24, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-06 11:01:00
|
Revision: 76 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=76&view=rev Author: nickols_k Date: 2010-01-06 11:00:49 +0000 (Wed, 06 Jan 2010) Log Message: ----------- show homepages of missing packages Modified Paths: -------------- functions mplayerxp/configure Modified: functions =================================================================== --- functions 2010-01-05 14:26:28 UTC (rev 75) +++ functions 2010-01-06 11:00:49 UTC (rev 76) @@ -1331,6 +1331,62 @@ return 1 } +find_in_list(){ +local list="$1[*]" +list=${!list} +local index=1 +OLD_IFS=$IFS +IFS= +while true +do + local line=$(trim `echo $list | cut -d ',' -f $index`) + test -z $line && break + local opt=$(trim `echo $line | cut -d '|' -f 1`) + opt="$opt[*]" + opt=${!opt} + local i=1 + while true + do + local oval=$(trim `echo $opt | cut -d ',' -f $i`) + test -z $oval && break + local oopt=$(trim `echo $oval | cut -d '|' -f 1`) + if test $2 = $oopt ; then + IFS=$OLD_IFS + echo "$oval" + return 0 + fi + (( i++ )) + done + (( index++ )) +done +IFS=$OLD_IFS +return 1 +} + +show_homepage() { +local name=$1 +local list="$2[*]" +list=${!list} +local descr +local site +echo " $name" +if [ -z $3 ]; then +return +else +for i in $list ; do + descr=`find_in_list "$3" $i` + result=$? + site=$(trim `echo $descr | cut -d '|' -f 3`) + echo $echo_n " $i " | tee -a $TMPLOG + if test -z $site ; then + echo $echo_c "" | tee -a $TMPLOG + else + echo $echo_c "(site: $site)" | tee -a $TMPLOG + fi +done +fi +} + make_environment(){ local list="$1[*]" list=${!list} Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-05 14:26:28 UTC (rev 75) +++ mplayerxp/configure 2010-01-06 11:00:49 UTC (rev 76) @@ -23,7 +23,6 @@ # ############################################################################# . ../functions - init_functions cd nls @@ -42,48 +41,48 @@ "fastmemcpy|use 3dnow/sse/mmx optimized memcpy()", "streaming|build with network support (http/mms/rtp)", "af_inet6|build with support for IPv6 protocol", - "termcap|build with termcap database for key codes", - "termios|build with termios database for key codes", + "termcap|build with termcap database for key codes|http://www.catb.org/~esr/terminfo", + "termios|build with termios database for key codes|http://www.catb.org/~esr/terminfo", "shm|build with shared memory if possible", "rtc|use RTC (/dev/rtc) on Linux", - "iconv|build with iconv for encoding conversion", + "iconv|build with iconv for encoding conversion|http://www.gnu.org/software/libiconv", "winsock2|use winsock2.h if possible", "largefiles|enable support for files > 2GB", "ossaudio|build with OSS audio output", "audio_select|use select() on OSS audio device", - "alsa|build with ALSA audio output", - "arts|build with ARTS audio output", - "esd|build with ESD audio ouput", - "openal|build with OpenAL audio output", - "nas|build with NAS uadio output", - "jack|build with JACK audio output", - "libcdio|build with libcdio support", - "x11|build with X11 video ouput", - "xv|build with Xv video output", - "sdl|build with SDL video and audio output", - "sdl_image|build with SDL_image for screenshots", + "alsa|build with ALSA audio output|http://www.alsa-project.org", + "arts|build with ARTS audio output|http://www.arts-project.org", + "esd|build with ESD audio ouput|ftp://ftp.gnome.org/pub/gnome/sources/esound", + "openal|build with OpenAL audio output|http://connect.creativelabs.com/openal/default.aspx", + "nas|build with NAS uadio output|http://nas.sourceforge.net", + "jack|build with JACK audio output|http://jackaudio.org", + "libcdio|build with libcdio support|http://www.gnu.org/software/libcdio/index.html", + "x11|build with X11 video ouput|http://www.x.org", + "xv|build with Xv video output|http://www.x.org", + "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", "fbdev|build with FBDev video ouput", - "jpg|build with JPEG for screenshots", - "png|build with PNG for screenshots", - "opengl|build with OpenGL video output", - "dga|build with DGA video output", + "jpg|build with JPEG for screenshots|http://www.ijg.org", + "png|build with PNG for screenshots|http://www.libpng.org/pub/png/libpng.html", + "opengl|build with OpenGL video output|http://mesa3d.org", + "dga|build with DGA video output|http://www.x.org", "vesa|build with VESA video output", - "vidix|build with VIDIX video output", - "xdpms|build with X11 DPMS support", - "xinerama|build with X11 Xinerama support", - "xf86vm|build with X11 XF86Vm support", + "vidix|build with VIDIX video output|http://vidix.sourceforge.net", + "xdpms|build with X11 DPMS support|http://www.x.org", + "xinerama|build with X11 Xinerama support|http://www.x.org", + "xf86vm|build with X11 XF86Vm support|http://www.x.org", "tv|build wuth TV Interface (tv/dvb grabbers)", "tv_v4l|build with Video 4 Linux TV Interface support", - "lirc|build with LIRC (remote control) support", - "lircc|build with LIRCC (remote daemon control) support", + "lirc|build with LIRC (remote control) support|http://www.lirc.org", + "lircc|build with LIRCC (remote daemon control) support|http://www.lirc.org", "joystick|build with joystick support", - "libcss|build with libcss support", - "libdvdread|build with libdvdread support", - "libdvdnav|build with libdvdnav support", - "libvcd|build with libvcd support", - "libvorbis|build with libvorbis support", - "libtheora|build with libtheora support", - "libbz2|build with libbz2 support" + "libcss|build with libcss support|http://download.videolan.org/pub/videolan/libdvdcss", + "libdvdread|build with libdvdread support|http://www.dtek.chalmers.se/groups/dvd/downloads.shtml", + "libdvdnav|build with libdvdnav support|http://dvd.sourceforge.net", + "libvcd|build with libvcd support|http://www.gnu.org/software/vcdimager", + "libvorbis|build with libvorbis support|http://www.vorbis.com", + "libtheora|build with libtheora support|http://www.theora.org", + "libbz2|build with libbz2 support|http://www.bzip.org" ) DISABLED_LIST=( "gcov|compile gnu coverage information into PROGRAM", @@ -633,6 +632,7 @@ fi enabled sdl && aomodules="sdl $aomodules" || noaomodules="sdl $noaomodules" enabled sdl && vomodules="sdl $vomodules" || novomodules="sdl $novomodules" +enabled sdl_image && vomodules="sdl_image $vomodules" || novomodules="sdl_image $novomodules" enabled libcdio && require2 libcdio "cdio/cdio.h" cdio_read_mode2_sectors -lcdio print_config HAVE_ mp_config.h mp_config.mak libcdio @@ -688,7 +688,7 @@ enabled libcss && require2 libcss css.h CSSisEncrypted -lcss print_config HAVE_ mp_config.h mp_config.mak libcss -enabled libcss && inputmodules="css $inputmodules" || noinputmodules="css $noinputmodules" +enabled libcss && inputmodules="libcss $inputmodules" || noinputmodules="libcss $noinputmodules" enabled libdvdread && require2 libdvdread "stdint.h dvdread/dvd_reader.h dvdread/ifo_types.h dvdread/ifo_read.h dvdread/nav_read.h" DVDOpenFile -ldvdread dvdread=$libdvdread @@ -748,7 +748,7 @@ # Checking for VIDIX enabled vidix && require2 vidix vidix/vidixlib.h vdlAllocFourccS -lvidix print_config CONFIG_ mp_config.h mp_config.mak vidix -enabled x11 && enabled vidix && vomodules="xvidix $vomodules" || novomodules="xvidix $novomodules" +enabled x11 && enabled vidix && vomodules="vidix $vomodules" || novomodules="vidix $novomodules" enabled joystick && test linux || disable joystick @@ -953,14 +953,14 @@ Audio output: $aomodules Video output: $vomodules Disabled optional drivers: - Input: $noinputmodules - Codecs: $nocodecmodules - Audio output: $noaomodules - Video output: $novomodules - Picture support: $sdl_image +EOF +show_homepage "Input:" "noinputmodules" "AUTOCONF_LIST" +show_homepage "Codecs:" "nocodecmodules" "AUTOCONF_LIST" +show_homepage "Audio output:" "noaomodules" "AUTOCONF_LIST" +show_homepage "Video output:" "novomodules" "AUTOCONF_LIST" +cat << EOF | tee -a $TMPLOG 'make' will now compile MPlayerXP and 'make install' will install it. Note: On non-Linux systems you might need to use 'gmake' instead of 'make'. - EOF if disabled gomp ; then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-06 13:50:23
|
Revision: 78 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=78&view=rev Author: nickols_k Date: 2010-01-06 13:34:27 +0000 (Wed, 06 Jan 2010) Log Message: ----------- add: -afm (-vfm) help Modified Paths: -------------- mplayerxp/libmpcodecs/ad.c mplayerxp/libmpcodecs/ad.h mplayerxp/libmpcodecs/ad_a52.c mplayerxp/libmpcodecs/ad_acm.c mplayerxp/libmpcodecs/ad_dca.c mplayerxp/libmpcodecs/ad_dmo.c mplayerxp/libmpcodecs/ad_dshow.c mplayerxp/libmpcodecs/ad_dvdpcm.c mplayerxp/libmpcodecs/ad_faad.c mplayerxp/libmpcodecs/ad_ffmp3.c mplayerxp/libmpcodecs/ad_hwac3.c mplayerxp/libmpcodecs/ad_mp3.c mplayerxp/libmpcodecs/ad_null.c mplayerxp/libmpcodecs/ad_pcm.c mplayerxp/libmpcodecs/ad_qtaudio.c mplayerxp/libmpcodecs/ad_real.c mplayerxp/libmpcodecs/ad_twin.c mplayerxp/libmpcodecs/ad_vorbis.c mplayerxp/libmpcodecs/dec_audio.h mplayerxp/libmpcodecs/dec_video.h mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd.h mplayerxp/libmpcodecs/vd_divx4.c mplayerxp/libmpcodecs/vd_dmo.c mplayerxp/libmpcodecs/vd_dshow.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpcodecs/vd_huffyuv.c mplayerxp/libmpcodecs/vd_libmpeg2.c mplayerxp/libmpcodecs/vd_mpegpes.c mplayerxp/libmpcodecs/vd_null.c mplayerxp/libmpcodecs/vd_nuv.c mplayerxp/libmpcodecs/vd_qtvideo.c mplayerxp/libmpcodecs/vd_raw.c mplayerxp/libmpcodecs/vd_real.c mplayerxp/libmpcodecs/vd_theora.c mplayerxp/libmpcodecs/vd_vfw.c mplayerxp/libmpcodecs/vd_xanim.c mplayerxp/libmpcodecs/vd_xvid.c mplayerxp/mplayer.c Modified: mplayerxp/libmpcodecs/ad.c =================================================================== --- mplayerxp/libmpcodecs/ad.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad.c 2010-01-06 13:34:27 UTC (rev 78) @@ -69,3 +69,12 @@ m_config_register_options(cfg,mpcodecs_ad_drivers[i]->options); } } + +void afm_help(void) { + unsigned i; + for(i=0;i<nddrivers;i++) { + if(mpcodecs_ad_drivers[i]) + if(mpcodecs_ad_drivers[i]->options) + MSG_INFO(" %-10s %s\n",mpcodecs_ad_drivers[i]->info->driver_name,mpcodecs_ad_drivers[i]->info->descr); + } +} Modified: mplayerxp/libmpcodecs/ad.h =================================================================== --- mplayerxp/libmpcodecs/ad.h 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad.h 2010-01-06 13:34:27 UTC (rev 78) @@ -6,14 +6,14 @@ typedef struct ad_info_s { - /* codec long name ("Autodesk FLI/FLC Animation decoder" */ - const char *codec_name; + /* driver description ("Autodesk FLI/FLC Animation decoder" */ + const char *descr; /* driver name ("dshow") */ const char *driver_name; /* interface author/maintainer */ - const char *maintainer; - /* any additional comments */ - const char *comment; + const char *author; + /* URL of homepage */ + const char *url; } ad_info_t; #define CONTROL_OK 1 Modified: mplayerxp/libmpcodecs/ad_a52.c =================================================================== --- mplayerxp/libmpcodecs/ad_a52.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_a52.c 2010-01-06 13:34:27 UTC (rev 78) @@ -29,10 +29,10 @@ static const ad_info_t info = { - "AC3-liba52", + "liba52 AC3 driver", "liba52", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_acm.c =================================================================== --- mplayerxp/libmpcodecs/ad_acm.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_acm.c 2010-01-06 13:34:27 UTC (rev 78) @@ -10,12 +10,12 @@ #include "../libmpdemux/aviprint.h" #include "help_mp.h" -static const ad_info_t info = +static const ad_info_t info = { - "DivX audio (WMA)", + "Win32/ACM decoders", "acm", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_dca.c =================================================================== --- mplayerxp/libmpcodecs/ad_dca.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_dca.c 2010-01-06 13:34:27 UTC (rev 78) @@ -38,7 +38,7 @@ "DTS Coherent Acoustics", "libdca", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_dmo.c =================================================================== --- mplayerxp/libmpcodecs/ad_dmo.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_dmo.c 2010-01-06 13:34:27 UTC (rev 78) @@ -15,7 +15,7 @@ "Win32/DMO decoders", "dmo", "A'rpi", - "avifile.sf.net" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_dshow.c =================================================================== --- mplayerxp/libmpcodecs/ad_dshow.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_dshow.c 2010-01-06 13:34:27 UTC (rev 78) @@ -10,10 +10,10 @@ static const ad_info_t info = { - "Win32 direct show audio", + "Win32/DirectShow decoders", "dshow", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_dvdpcm.c =================================================================== --- mplayerxp/libmpcodecs/ad_dvdpcm.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_dvdpcm.c 2010-01-06 13:34:27 UTC (rev 78) @@ -7,10 +7,10 @@ static const ad_info_t info = { - "Uncompressed DVD PCM audio decoder", + "Uncompressed DVD/VOB LPCM audio decoder", "dvdpcm", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_faad.c =================================================================== --- mplayerxp/libmpcodecs/ad_faad.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_faad.c 2010-01-06 13:34:27 UTC (rev 78) @@ -26,7 +26,7 @@ "AAC (MPEG2/4 Advanced Audio Coding)", "faad", "Felix Buenemann", - "faad2" + "http://www.audiocoding.com/faad2.html" }; static const config_t options[] = { @@ -82,7 +82,7 @@ /* configure maximum supported channels, * * this is theoretically max. 64 chans */ #define FAAD_MAX_CHANNELS 6 -#define FAAD_BUFFLEN (FAAD_MIN_STREAMSIZE*FAAD_MAX_CHANNELS) +#define FAAD_BUFFLEN (FAAD_MIN_STREAMSIZE*FAAD_MAX_CHANNELS) #ifdef _WIN32 #pragma pack(push, 8) #ifndef NEAACDECAPI @@ -138,7 +138,7 @@ static void *dll_handle; static int load_dll(const char *libname) { - if(!(dll_handle=ld_codec(libname,"http://www.audiocoding.com/faad2.html"))) return 0; + if(!(dll_handle=ld_codec(libname,mpcodecs_ad_faad.info->url))) return 0; NeAACDecOpen_ptr = ld_sym(dll_handle,"NeAACDecOpen"); NeAACDecGetCurrentConfiguration_ptr = ld_sym(dll_handle,"NeAACDecGetCurrentConfiguration"); NeAACDecSetConfiguration_ptr = ld_sym(dll_handle,"NeAACDecSetConfiguration"); Modified: mplayerxp/libmpcodecs/ad_ffmp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_ffmp3.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_ffmp3.c 2010-01-06 13:34:27 UTC (rev 78) @@ -24,10 +24,10 @@ static const ad_info_t info = { - "FFmpeg layer-123 audio decoder - integer only", + "FFmpeg/libavcodec audio decoders", "ffmpeg", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_hwac3.c =================================================================== --- mplayerxp/libmpcodecs/ad_hwac3.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_hwac3.c 2010-01-06 13:34:27 UTC (rev 78) @@ -143,10 +143,10 @@ static const ad_info_t info = { - "AC3 through SPDIF", + "AC3/DTS pass-through S/PDIF", "hwac3", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_mp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_mp3.c 2010-01-06 13:34:27 UTC (rev 78) @@ -17,7 +17,7 @@ "MPEG layer-123", "mp3lib", "Nickols_K", - "Optimized to MMX/SSE/3Dnow!" + "http://www.mpg123.de" }; static const config_t options[] = { @@ -216,7 +216,7 @@ static void *dll_handle; static int load_dll(const char *libname) { - if(!(dll_handle=ld_codec(libname,"http://www.mpg123.de"))) return 0; + if(!(dll_handle=ld_codec(libname,mpcodecs_ad_mp3.info->url))) return 0; mpg123_init_ptr = ld_sym(dll_handle,"mpg123_init"); mpg123_exit_ptr = ld_sym(dll_handle,"mpg123_exit"); mpg123_new_ptr = ld_sym(dll_handle,"mpg123_new"); Modified: mplayerxp/libmpcodecs/ad_null.c =================================================================== --- mplayerxp/libmpcodecs/ad_null.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_null.c 2010-01-06 13:34:27 UTC (rev 78) @@ -8,7 +8,7 @@ "Null audio decoder", "null", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_pcm.c =================================================================== --- mplayerxp/libmpcodecs/ad_pcm.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_pcm.c 2010-01-06 13:34:27 UTC (rev 78) @@ -9,7 +9,7 @@ "Uncompressed PCM audio decoder", "pcm", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_qtaudio.c =================================================================== --- mplayerxp/libmpcodecs/ad_qtaudio.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_qtaudio.c 2010-01-06 13:34:27 UTC (rev 78) @@ -21,7 +21,7 @@ "QuickTime Audio Decoder", "qtaudio", "A'rpi & Sascha Sommer", - "uses win32 quicktime DLLs" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_real.c =================================================================== --- mplayerxp/libmpcodecs/ad_real.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_real.c 2010-01-06 13:34:27 UTC (rev 78) @@ -15,7 +15,7 @@ "RealAudio decoder", "realaud", "A'rpi", - "Florian Schneider" + "build-in" }; static const config_t options[] = { @@ -188,7 +188,7 @@ static int init(sh_audio_t *sh_audio){ // initialize the decoder, set tables etc... - + // set sample format/rate parameters if you didn't do it in preinit() yet. return 1; // return values: 1=OK 0=ERROR Modified: mplayerxp/libmpcodecs/ad_twin.c =================================================================== --- mplayerxp/libmpcodecs/ad_twin.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_twin.c 2010-01-06 13:34:27 UTC (rev 78) @@ -17,7 +17,7 @@ "TWinVQ decoder", "vqf", "Nickols_K", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/ad_vorbis.c =================================================================== --- mplayerxp/libmpcodecs/ad_vorbis.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/ad_vorbis.c 2010-01-06 13:34:27 UTC (rev 78) @@ -13,7 +13,7 @@ "Ogg/Vorbis audio decoder", "libvorbis", "Felix Buenemann, A'rpi", - "buggy" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/dec_audio.h =================================================================== --- mplayerxp/libmpcodecs/dec_audio.h 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/dec_audio.h 2010-01-06 13:34:27 UTC (rev 78) @@ -20,3 +20,5 @@ int in_samplerate, int in_channels, int in_format, int in_bps, int out_samplerate, int out_channels, int out_format, int out_bps, int out_minsize, int out_maxsize); + +extern void afm_help(void); Modified: mplayerxp/libmpcodecs/dec_video.h =================================================================== --- mplayerxp/libmpcodecs/dec_video.h 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/dec_video.h 2010-01-06 13:34:27 UTC (rev 78) @@ -14,3 +14,5 @@ extern void resync_video_stream(sh_video_t *sh_video); extern int divx_quality; + +extern void vfm_help(void); Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd.c 2010-01-06 13:34:27 UTC (rev 78) @@ -79,6 +79,15 @@ } } +void vfm_help(void) { + unsigned i; + for(i=0;i<nddrivers;i++) { + if(mpcodecs_vd_drivers[i]) + if(mpcodecs_vd_drivers[i]->options) + MSG_INFO(" %-10s %s\n",mpcodecs_vd_drivers[i]->info->driver_name,mpcodecs_vd_drivers[i]->info->descr); + } +} + #include "libvo/video_out.h" extern const vd_functions_t* mpvdec; // FIXME! Modified: mplayerxp/libmpcodecs/vd.h =================================================================== --- mplayerxp/libmpcodecs/vd.h 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd.h 2010-01-06 13:34:27 UTC (rev 78) @@ -1,15 +1,13 @@ typedef struct vd_info_s { - /* codec long name ("Autodesk FLI/FLC Animation decoder" */ - const char *codec_name; + /* driver description ("Autodesk FLI/FLC Animation decoder" */ + const char *descr; /* driver name ("dshow") */ const char *driver_name; /* interface author/maintainer */ - const char *maintainer; - /* codec author ("Aaron Holtzman <aho...@es...>") */ const char *author; - /* any additional comments */ - const char *comment; + /* URL of homepage */ + const char *url; } vd_info_t; /* interface of video decoder drivers */ Modified: mplayerxp/libmpcodecs/vd_divx4.c =================================================================== --- mplayerxp/libmpcodecs/vd_divx4.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_divx4.c 2010-01-06 13:34:27 UTC (rev 78) @@ -25,8 +25,7 @@ "DivX4Linux lib (divx4/5 mode)", "divx4", "Nickols_K", - "http://www.divx.com", - "native codecs" + "http://labs.divx.com/DivXLinuxCodec" }; static const config_t options[] = { @@ -60,9 +59,9 @@ #define DEC_PAR_SMOOTH 9 ///< Use smooth playback when pParam is set to 1. #define DEC_PAR_SHOWPP 10 ///< Show the postprocessing level in use on the top left corner of the output image. -// Decoder return values. +// Decoder return values. -#define DEC_OK 0 ///< Decoder call succeded. +#define DEC_OK 0 ///< Decoder call succeded. #define DEC_INVALID_SYNTAX -1 ///< A semantic error occourred while parsing the stream. #define DEC_FAIL 1 ///< General failure message. An unexpected problem occourred. #define DEC_INVALID_ARGUMENT 3 ///< One of the arguments passed to the decoder is invalid. @@ -180,7 +179,7 @@ static int load_lib( const char *libname ) { - if(!(dll_handle=ld_codec(libname,"http://labs.divx.com/DivXLinuxCodec"))) return 0; + if(!(dll_handle=ld_codec(libname,mpcodecs_vd_divx4.info->url))) return 0; getDecore_ptr = ld_sym(dll_handle,"getDecore"); return getDecore_ptr != NULL; } Modified: mplayerxp/libmpcodecs/vd_dmo.c =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_dmo.c 2010-01-06 13:34:27 UTC (rev 78) @@ -15,11 +15,10 @@ #include "vd_msg.h" static const vd_info_t info = { - "DMO video codecs", + "Win32/DMO video codecs", "dmo", "A'rpi", - "based on http://avifile.sf.net", - "win32 codecs" + "build-in }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_dshow.c =================================================================== --- mplayerxp/libmpcodecs/vd_dshow.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_dshow.c 2010-01-06 13:34:27 UTC (rev 78) @@ -13,11 +13,10 @@ #include "codecs_ld.h" static const vd_info_t info = { - "DirectShow video codecs", + "Win32/DirectShow video codecs", "dshow", "A'rpi", - "based on http://avifile.sf.net", - "win32 codecs" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-06 13:34:27 UTC (rev 78) @@ -19,8 +19,7 @@ "FFmpeg's libavcodec codec family", "ffmpeg", "A'rpi", - "http://ffmpeg.sf.net", - "native codecs" + "build-in" }; static int lavc_param_error_resilience=2; Modified: mplayerxp/libmpcodecs/vd_huffyuv.c =================================================================== --- mplayerxp/libmpcodecs/vd_huffyuv.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_huffyuv.c 2010-01-06 13:34:27 UTC (rev 78) @@ -27,9 +27,8 @@ static const vd_info_t info = { "HuffYUV Video decoder", "huffyuv", - "Roberto Togni", - "Roberto Togni", - "native codec, original win32 by Ben Rudiak-Gould http://www.math.berkeley.edu/~benrg/huffyuv.html" + "Roberto Togni (original win32 by Ben Rudiak-Gould http://www.math.berkeley.edu/~benrg/huffyuv.html)", + "build-in" }; static const config_t options[] = { @@ -55,7 +54,7 @@ #define DECORR_FLAG 64 #define METHOD_LEFT_DECORR (METHOD_LEFT | DECORR_FLAG) #define METHOD_GRAD_DECORR (METHOD_GRAD | DECORR_FLAG) -#define METHOD_OLD -2 +#define METHOD_OLD -2 #define FOURCC_HFYU mmioFOURCC('H','F','Y','U') @@ -151,13 +150,13 @@ * Internal function prototypes */ unsigned char* InitializeDecodeTable(unsigned char* hufftable, - unsigned char* shift, DecodeTable* decode_table); + unsigned char* shift, DecodeTable* decode_table); unsigned char* InitializeShiftAddTables(unsigned char* hufftable, - unsigned char* shift, unsigned* add_shifted); + unsigned char* shift, unsigned* add_shifted); unsigned char* DecompressHuffmanTable(unsigned char* hufftable, - unsigned char* dst); + unsigned char* dst); unsigned char huff_decompress(unsigned int* in, unsigned int *pos, - DecodeTable *decode_table, unsigned char *decode_shift); + DecodeTable *decode_table, unsigned char *decode_shift); @@ -710,7 +709,7 @@ unsigned char* InitializeDecodeTable(unsigned char* hufftable, - unsigned char* shift, DecodeTable* decode_table) + unsigned char* shift, DecodeTable* decode_table) { unsigned int add_shifted[256]; char code_lengths[256]; @@ -773,7 +772,7 @@ unsigned char* InitializeShiftAddTables(unsigned char* hufftable, - unsigned char* shift, unsigned* add_shifted) + unsigned char* shift, unsigned* add_shifted) { int i, j; unsigned int bits; // must be 32bit unsigned @@ -822,7 +821,7 @@ unsigned char* DecompressHuffmanTable(unsigned char* hufftable, - unsigned char* dst) + unsigned char* dst) { int val; int repeat; Modified: mplayerxp/libmpcodecs/vd_libmpeg2.c =================================================================== --- mplayerxp/libmpcodecs/vd_libmpeg2.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_libmpeg2.c 2010-01-06 13:34:27 UTC (rev 78) @@ -20,11 +20,10 @@ static const vd_info_t info = { - "MPEG 1/2 Video decoder", + "libmpeg2 MPEG 1/2 Video decoder", "libmpeg2", "A'rpi", - "Aaron & Walken", - "native" + "http://libmpeg2.sourceforge.net" }; static const config_t options[] = { @@ -151,7 +150,7 @@ static void *dll_handle; static int load_lib( const char *libname ) { - if(!(dll_handle=ld_codec(libname,"http://libmpeg2.sourceforge.net"))) return 0; + if(!(dll_handle=ld_codec(libname,mpcodecs_vd_libmpeg2.info->url))) return 0; mpeg2_init_ptr = ld_sym(dll_handle,"mpeg2_init"); mpeg2_close_ptr = ld_sym(dll_handle,"mpeg2_close"); mpeg2_info_ptr = ld_sym(dll_handle,"mpeg2_info"); Modified: mplayerxp/libmpcodecs/vd_mpegpes.c =================================================================== --- mplayerxp/libmpcodecs/vd_mpegpes.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_mpegpes.c 2010-01-06 13:34:27 UTC (rev 78) @@ -10,8 +10,7 @@ "MPEG 1/2 Video passthrough", "mpegpes", "A'rpi", - "A'rpi", - "for hw decoders" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_null.c =================================================================== --- mplayerxp/libmpcodecs/vd_null.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_null.c 2010-01-06 13:34:27 UTC (rev 78) @@ -10,8 +10,7 @@ "Null video decoder", "null", "A'rpi", - "A'rpi", - "" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_nuv.c =================================================================== --- mplayerxp/libmpcodecs/vd_nuv.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_nuv.c 2010-01-06 13:34:27 UTC (rev 78) @@ -8,9 +8,8 @@ static const vd_info_t info = { "NuppelVideo decoder", "nuv", - "A'rpi", - "Alex & Panagiotis Issaris <ta...@lu...>", - "native codecs" + "A'rpi (Alex & Panagiotis Issaris <ta...@lu...>)", + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_qtvideo.c =================================================================== --- mplayerxp/libmpcodecs/vd_qtvideo.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_qtvideo.c 2010-01-06 13:34:27 UTC (rev 78) @@ -18,9 +18,8 @@ static const vd_info_t info = { "Quicktime Video decoder", "qtvideo", - "A'rpi", - "Faust3", - "win32" + "A'rpi & Faust3", + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_raw.c =================================================================== --- mplayerxp/libmpcodecs/vd_raw.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_raw.c 2010-01-06 13:34:27 UTC (rev 78) @@ -8,9 +8,8 @@ static const vd_info_t info = { "RAW Uncompressed Video", "raw", - "A'rpi", "A'rpi & Alex", - "uncompressed" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_real.c =================================================================== --- mplayerxp/libmpcodecs/vd_real.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_real.c 2010-01-06 13:34:27 UTC (rev 78) @@ -11,11 +11,10 @@ #include "vd_msg.h" static const vd_info_t info = { - "RealPlayer 8 video codecs", + "RealPlayer video codecs", "realvid", - "Florian Schneider", - "using original closed source codecs for Linux", - "binary real video codecs" + "Florian Schneider (using original closed source codecs for Linux)", + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_theora.c =================================================================== --- mplayerxp/libmpcodecs/vd_theora.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_theora.c 2010-01-06 13:34:27 UTC (rev 78) @@ -14,11 +14,10 @@ #include "vd_msg.h" static const vd_info_t info = { - "Theora/VP3", + "Theora/VP3 video decoder", "theora", - "David Kuehling", - "www.theora.org", - "Theora project's VP3 codec" + "David Kuehling (www.theora.org)", + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_vfw.c =================================================================== --- mplayerxp/libmpcodecs/vd_vfw.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_vfw.c 2010-01-06 13:34:27 UTC (rev 78) @@ -19,16 +19,14 @@ "Win32/VfW video codecs", "vfw", "A'rpi", - "based on http://avifile.sf.net", - "win32 codecs" + "build-in" }; static const vd_info_t info_vfwex = { "Win32/VfWex video codecs", "vfwex", "A'rpi", - "based on http://avifile.sf.net", - "win32 codecs" + "build-in" }; static const config_t options[] = { Modified: mplayerxp/libmpcodecs/vd_xanim.c =================================================================== --- mplayerxp/libmpcodecs/vd_xanim.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_xanim.c 2010-01-06 13:34:27 UTC (rev 78) @@ -31,9 +31,8 @@ static const vd_info_t info = { "XAnim codecs", "xanim", - "A'rpi & Alex", - "Xanim (http://xanim.va.pubnix.com/)", - "binary codec plugins" + "A'rpi & Alex <Xanim (http://xanim.va.pubnix.com/)>", + "build-in" }; static const config_t options[] = { @@ -275,7 +274,7 @@ dlclose(codec_driver->file_handler); return(0); } - + MSG_INFO( "=== XAnim Codec ===\n"); MSG_INFO( " Filename: %s (API revision: %x)\n", filename, mod_hdr->api_rev); MSG_INFO( " Codec: %s. Rev: %s\n", mod_hdr->desc, mod_hdr->rev); @@ -301,7 +300,7 @@ dlclose(codec_driver->file_handler); return(0); } - + MSG_DBG2( "Exported functions by codec: [functable: 0x%08x entries: %d]\n", mod_hdr->funcs, mod_hdr->num_funcs); for (i = 0; i < mod_hdr->num_funcs; i++) @@ -370,7 +369,7 @@ char dll[1024]; XA_CODEC_HDR codec_hdr; int i; - + xacodec_driver = realloc(xacodec_driver, sizeof(struct xacodec_driver)); if (xacodec_driver == NULL) { @@ -581,7 +580,7 @@ MSG_DBG2( "body\n"); return NULL; } - + return NULL; } @@ -794,7 +793,7 @@ // scale U,V planes by 2: imagex>>=2; imagey>>=2; - + uvstride=(yuv->uv_w)?yuv->uv_w:imagex; for(y=0;y<imagey;y++){ @@ -925,7 +924,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ mp_image_t* mpi; xacodec_image_t* image; - + if(len<=0) return NULL; // skipped frame image=xacodec_decode_frame(data,len,(flags&3)?1:0); @@ -941,7 +940,7 @@ mpi->stride[0]=image->stride[0]; mpi->stride[1]=image->stride[1]; mpi->stride[2]=image->stride[2]; - + return mpi; } Modified: mplayerxp/libmpcodecs/vd_xvid.c =================================================================== --- mplayerxp/libmpcodecs/vd_xvid.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/libmpcodecs/vd_xvid.c 2010-01-06 13:34:27 UTC (rev 78) @@ -19,9 +19,8 @@ static const vd_info_t info = { "XviD MPEG4 codec ", "xvid", - "Nickols_K", - "http://www.xvid.org <(C) Christoph Lampert (gr...@we...)>", - "native codecs" + "Nickols_K <(C) Christoph Lampert (gr...@we...)>", + "http://www.xvid.org", }; typedef struct { @@ -192,7 +191,7 @@ static int load_lib( const char *libname ) { - if(!(dll_handle=ld_codec(libname,"http://www.xvid.org"))) return 0; + if(!(dll_handle=ld_codec(libname,mpcodecs_vd_xvid.info->url))) return 0; xvid_decore_ptr = ld_sym(dll_handle,"xvid_decore"); xvid_global_ptr = ld_sym(dll_handle,"xvid_global"); return xvid_decore_ptr != NULL && xvid_global_ptr!=NULL; Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2010-01-06 11:16:09 UTC (rev 77) +++ mplayerxp/mplayer.c 2010-01-06 13:34:27 UTC (rev 78) @@ -977,6 +977,20 @@ MSG_INFO("\n"); exit(0); } + + if(video_family && strcmp(video_family,"help")==0){ + MSG_INFO("Available video codec families/drivers:\n"); + vfm_help(); + MSG_INFO("\n"); + exit(0); + } + + if(audio_family && strcmp(audio_family,"help")==0){ + MSG_INFO("Available audio codec families/drivers:\n"); + afm_help(); + MSG_INFO("\n"); + exit(0); + } } int decore_audio( int xp_id ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-06 14:57:16
|
Revision: 79 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=79&view=rev Author: nickols_k Date: 2010-01-06 14:57:04 +0000 (Wed, 06 Jan 2010) Log Message: ----------- add libdv support Modified Paths: -------------- etc/codecs.conf mplayerxp/configure mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/ad.c mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd_dmo.c mplayerxp/libmpdemux/Makefile mplayerxp/libmpdemux/demux_avi.c mplayerxp/libmpdemux/demux_fli.c mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demuxer.c mplayerxp/libmpdemux/demuxer.h Added Paths: ----------- mplayerxp/libmpcodecs/ad_libdv.c mplayerxp/libmpcodecs/vd_libdv.c mplayerxp/libmpdemux/demux_dv.c Modified: etc/codecs.conf =================================================================== --- etc/codecs.conf 2010-01-06 13:34:27 UTC (rev 78) +++ etc/codecs.conf 2010-01-06 14:57:04 UTC (rev 79) @@ -859,6 +859,19 @@ guid 0x31666973, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 out BGR32 +videocodec libdv + info "Raw DV decoder (libdv)" + status working + fourcc DVSD,dvsd ; PAL + fourcc DVCS,dvcs ; NTSC ? + fourcc "dvcp" ; PAL DV in .mov + fourcc "dvc " ; NTSC DV in .mov + fourcc dvpp ; DVCPRO - PAL + fourcc AVdv ; AVID DV + driver libdv + dll libdv.so.2 + out YUY2 + videocodec qdv info "Sony Digital Video (DV)" status working @@ -1888,6 +1901,7 @@ ; out IDCT_MPEG2 ; out MOCO_MPEG2 + videocodec ffdv info "Raw DV decoder using libavcodec" status working @@ -2765,13 +2779,19 @@ ; driver acm ; dll "vorbis.acm" - audiocodec TwinVQ info "VQF codec by NTTLabs" status working fourcc TWIN driver vqf dll "tvqdec.dll" + +audiocodec libdv + info "raw DV audio (libdv)" + status working + fourcc RADV + driver libdv + dll libdv.so.2 ;==========RealCodecs================== audiocodec ra144 Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/configure 2010-01-06 14:57:04 UTC (rev 79) @@ -79,6 +79,7 @@ "libcss|build with libcss support|http://download.videolan.org/pub/videolan/libdvdcss", "libdvdread|build with libdvdread support|http://www.dtek.chalmers.se/groups/dvd/downloads.shtml", "libdvdnav|build with libdvdnav support|http://dvd.sourceforge.net", + "libdv|build with libdv support|http://libdv.sourceforge.net/", "libvcd|build with libvcd support|http://www.gnu.org/software/vcdimager", "libvorbis|build with libvorbis support|http://www.vorbis.com", "libtheora|build with libtheora support|http://www.theora.org", @@ -704,6 +705,11 @@ print_config USE_ mp_config.h mp_config.mak libvcd enabled libvcd && inputmodules="libvcd $inputmodules" || noinputmodules="libvcd $noinputmodules" +enabled libdv && check_pkg libdv libdv +enabled libdv && require2 libdv "libdv/dv.h" dv_encoder_new -ldv +print_config HAVE_ mp_config.h mp_config.mak libdv +enabled libdv && inputmodules="libdv $inputmodules" || noinputmodules="libdv $noinputmodules" + enabled fastmemcpy && x86 || disable fastmemcpy print_config USE_ mp_config.h mp_config.mak fastmemcpy @@ -718,11 +724,11 @@ enabled libvorbis && check_pkg libvorbis vorbis print_config HAVE_ mp_config.h mp_config.mak libvorbis -enabled libvorbis && inputmodules="vorbis $inputmodules" || noinputmodules="vorbis $noinputmodules" +enabled libvorbis && inputmodules="libvorbis $inputmodules" || noinputmodules="libvorbis $noinputmodules" enabled libtheora && check_pkg libtheora theora print_config HAVE_ mp_config.h mp_config.mak libtheora -enabled libtheora && inputmodules="theora $inputmodules" || noinputmodules="theora $noinputmodules" +enabled libtheora && inputmodules="libtheora $inputmodules" || noinputmodules="libtheora $noinputmodules" enabled libbz2 && require2 libbz2 bzlib.h BZ2_bzlibVersion -lbz2 || disable libbz2 print_config HAVE_ mp_config.h mp_config.mak libbz2 Modified: mplayerxp/libmpcodecs/Makefile =================================================================== --- mplayerxp/libmpcodecs/Makefile 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpcodecs/Makefile 2010-01-06 14:57:04 UTC (rev 79) @@ -38,6 +38,9 @@ ifeq ($(HAVE_LIBTHEORA),yes) SRCS+=vd_theora.c endif +ifeq ($(HAVE_LIBDV),yes) +SRCS+= ad_libdv.c vd_libdv.c +endif ifeq ($(HAVE_WIN32LOADER),yes) SRCS+=vd_dshow.c \ Modified: mplayerxp/libmpcodecs/ad.c =================================================================== --- mplayerxp/libmpcodecs/ad.c 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpcodecs/ad.c 2010-01-06 14:57:04 UTC (rev 79) @@ -22,6 +22,7 @@ extern const ad_functions_t mpcodecs_ad_dca; extern const ad_functions_t mpcodecs_ad_hwac3; extern const ad_functions_t mpcodecs_ad_pcm; +extern const ad_functions_t mpcodecs_ad_libdv; extern const ad_functions_t mpcodecs_ad_dvdpcm; extern const ad_functions_t mpcodecs_ad_dshow; extern const ad_functions_t mpcodecs_ad_msacm; @@ -46,6 +47,9 @@ #ifdef HAVE_LIBVORBIS &mpcodecs_ad_vorbis, #endif +#ifdef HAVE_LIBDV + &mpcodecs_ad_libdv, +#endif &mpcodecs_ad_real, #ifdef HAVE_WIN32LOADER &mpcodecs_ad_dshow, Added: mplayerxp/libmpcodecs/ad_libdv.c =================================================================== --- mplayerxp/libmpcodecs/ad_libdv.c (rev 0) +++ mplayerxp/libmpcodecs/ad_libdv.c 2010-01-06 14:57:04 UTC (rev 79) @@ -0,0 +1,110 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <math.h> + +#include "mp_config.h" +#include "../help_mp.h" + +#include <libdv/dv.h> +#include <libdv/dv_types.h> + +#include "libmpdemux/stream.h" +#include "libmpdemux/demuxer.h" +#include "libmpdemux/stheader.h" + +#include "ad_internal.h" + +static ad_info_t info = +{ + "Raw DV Audio Decoder", + "libdv", + "Alexander Neundorf <neu...@kd...>", + "http://libdv.sourceforge.net" +}; + +static const config_t options[] = { + { NULL, NULL, 0, 0, 0, 0, NULL} +}; + +LIBAD_EXTERN(libdv) + +// defined in vd_libdv.c: +dv_decoder_t* init_global_rawdv_decoder(void); + +static int preinit(sh_audio_t *sh_audio) +{ + sh_audio->audio_out_minsize=4*DV_AUDIO_MAX_SAMPLES*2; + return 1; +} + +static int16_t *audioBuffers[4]={NULL,NULL,NULL,NULL}; + +static int init(sh_audio_t *sh) +{ + int i; + WAVEFORMATEX *h=sh->wf; + + if(!h) return 0; + + sh->i_bps=h->nAvgBytesPerSec; + sh->channels=h->nChannels; + sh->samplerate=h->nSamplesPerSec; + sh->samplesize=(h->wBitsPerSample+7)/8; + + sh->context=init_global_rawdv_decoder(); + + for (i=0; i < 4; i++) + audioBuffers[i] = malloc(2*DV_AUDIO_MAX_SAMPLES); + + return 1; +} + +static void uninit(sh_audio_t *sh_audio) +{ + int i; + for (i=0; i < 4; i++) + free(audioBuffers[i]); +} + +static int control(sh_audio_t *sh,int cmd,void* arg, ...) +{ + // TODO!!! + return CONTROL_UNKNOWN; +} + +static int decode_audio(sh_audio_t *audio, unsigned char *buf, int minlen, int maxlen,float *pts) +{ + dv_decoder_t* decoder=audio->context; //global_rawdv_decoder; + unsigned char* dv_audio_frame=NULL; + int xx; + size_t len=0; + float apts; + while(len<minlen) { + xx=ds_get_packet_r(audio->ds,&dv_audio_frame,len>0?&apts:pts); + if(xx<=0 || !dv_audio_frame) return 0; // EOF? + + dv_parse_header(decoder, dv_audio_frame); + + if(xx!=decoder->frame_size) + MSG_WARN("AudioFramesize differs %u %u\n",xx, decoder->frame_size); + + if (dv_decode_full_audio(decoder, dv_audio_frame,(int16_t**) audioBuffers)) { + /* Interleave the audio into a single buffer */ + int i=0; + int16_t *bufP=(int16_t*)buf; + + for (i=0; i < decoder->audio->samples_this_frame; i++) + { + int ch; + for (ch=0; ch < decoder->audio->num_channels; ch++) + bufP[len++] = audioBuffers[ch][i]; + } + } + len+=decoder->audio->samples_this_frame; + buf+=decoder->audio->samples_this_frame; + } + return len*2; +} Property changes on: mplayerxp/libmpcodecs/ad_libdv.c ___________________________________________________________________ Added: svn:eol-style + native Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpcodecs/vd.c 2010-01-06 14:57:04 UTC (rev 79) @@ -27,6 +27,7 @@ extern const vd_functions_t mpcodecs_vd_vfwex; extern const vd_functions_t mpcodecs_vd_divx4; extern const vd_functions_t mpcodecs_vd_raw; +extern const vd_functions_t mpcodecs_vd_libdv; extern const vd_functions_t mpcodecs_vd_xanim; extern const vd_functions_t mpcodecs_vd_fli; extern const vd_functions_t mpcodecs_vd_nuv; @@ -64,6 +65,9 @@ #ifdef HAVE_LIBTHEORA &mpcodecs_vd_theora, #endif +#ifdef HAVE_LIBDV + &mpcodecs_vd_libdv, +#endif NULL }; static unsigned int nddrivers=sizeof(mpcodecs_vd_drivers)/sizeof(vd_functions_t*); Modified: mplayerxp/libmpcodecs/vd_dmo.c =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.c 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpcodecs/vd_dmo.c 2010-01-06 14:57:04 UTC (rev 79) @@ -18,7 +18,7 @@ "Win32/DMO video codecs", "dmo", "A'rpi", - "build-in + "build-in" }; static const config_t options[] = { Added: mplayerxp/libmpcodecs/vd_libdv.c =================================================================== --- mplayerxp/libmpcodecs/vd_libdv.c (rev 0) +++ mplayerxp/libmpcodecs/vd_libdv.c 2010-01-06 14:57:04 UTC (rev 79) @@ -0,0 +1,86 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <math.h> + +#include "mp_config.h" + +#include "libvo/img_format.h" + +#include <libdv/dv.h> +#include <libdv/dv_types.h> + +#include "libmpdemux/stream.h" +#include "libmpdemux/demuxer.h" +#include "libmpdemux/stheader.h" + +#include "vd_internal.h" + +static vd_info_t info = +{ + "Raw DV Video Decoder", + "libdv", + "Alexander Neundorf <neu...@kd...>", + "http://libdv.sourceforge.net" +}; + +static const config_t options[] = { + { NULL, NULL, 0, 0, 0, 0, NULL} +}; + +LIBVD_EXTERN(libdv) + +// to set/get/query special features/parameters +static int control(sh_video_t *sh,int cmd,void* arg,...){ + return CONTROL_UNKNOWN; +} + +static dv_decoder_t* global_rawdv_decoder=NULL; + +dv_decoder_t* init_global_rawdv_decoder(void) +{ + if(!global_rawdv_decoder){ + global_rawdv_decoder=dv_decoder_new(TRUE,TRUE,FALSE); + global_rawdv_decoder->quality=DV_QUALITY_BEST; + global_rawdv_decoder->prev_frame_decoded = 0; + } + return global_rawdv_decoder; +} + +// init driver +static int init(sh_video_t *sh) +{ + sh->context = (void *)init_global_rawdv_decoder(); + return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,NULL); +} + +// uninit driver +static void uninit(sh_video_t *sh){ +} + +// decode a frame +static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags) +{ + mp_image_t* mpi; + dv_decoder_t *decoder=sh->context; + + if(len<=0 || (flags&3)){ +// fprintf(stderr,"decode() (rawdv) SKIPPED\n"); + return NULL; // skipped frame + } + + dv_parse_header(decoder, data); + + mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, sh->disp_w, sh->disp_h); + + if(!mpi){ // temporary! + MSG_ERR("couldn't allocate image for stderr codec\n"); + return NULL; + } + + dv_decode_full_frame(decoder, data, e_dv_color_yuv, mpi->planes, mpi->stride); + + return mpi; +} Property changes on: mplayerxp/libmpcodecs/vd_libdv.c ___________________________________________________________________ Added: svn:eol-style + native Modified: mplayerxp/libmpdemux/Makefile =================================================================== --- mplayerxp/libmpdemux/Makefile 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpdemux/Makefile 2010-01-06 14:57:04 UTC (rev 79) @@ -26,6 +26,9 @@ ifeq ($(USE_LIBVCD),yes) SRCS += s_vcdnav.c endif +ifeq ($(HAVE_LIBDV),yes) +SRCS += demux_dv.c +endif SRCS += cache2.c dvdauth.c stream.c tvi_dummy.c tvi_v4l.c SRCS += tvi_bsdbt848.c frequencies.c mrl.c Modified: mplayerxp/libmpdemux/demux_avi.c =================================================================== --- mplayerxp/libmpdemux/demux_avi.c 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpdemux/demux_avi.c 2010-01-06 14:57:04 UTC (rev 79) @@ -283,7 +283,7 @@ *(uint32_t *)s->dwChunkId = stream_read_dword_le(demuxer->stream); stream_read(demuxer->stream, (char *)s->dwReserved, 3*4); memset(s->dwReserved, 0, 3*4); - + print_avisuperindex_chunk(s); msize = sizeof (uint32_t) * s->wLongsPerEntry * s->nEntriesInUse; @@ -483,7 +483,7 @@ } else if(chunksize>0) stream_skip(demuxer->stream,chunksize); else if((int)chunksize<0) MSG_WARN("chunksize=%u (id=%.4s)\n",chunksize,(char *) &id); - + } if (priv->suidx_size > 0 && priv->idx_size == 0) { @@ -660,7 +660,7 @@ // build index for file: stream_reset(demuxer->stream); stream_seek(demuxer->stream,demuxer->movi_start); - + priv->idx_pos=0; priv->idx_size=0; priv->idx=NULL; @@ -701,8 +701,8 @@ if(idxfix_divx) if(avi_stream_id(id)==idxfix_videostream){ switch(idxfix_divx){ - case 3: c=stream_read_dword(demuxer->stream)<<5; //skip 32+5 bits for m$mpeg4v1 - case 1: if(c&0x40000000) idx->dwFlags&=~AVIIF_KEYFRAME;break; // divx 3 + case 3: c=stream_read_dword(demuxer->stream)<<5; //skip 32+5 bits for m$mpeg4v1 + case 1: if(c&0x40000000) idx->dwFlags&=~AVIIF_KEYFRAME;break; // divx 3 case 2: if(c==0x1B6) idx->dwFlags&=~AVIIF_KEYFRAME;break; // divx 4 } } @@ -839,7 +839,7 @@ avi_priv_t *priv=demux->priv; int skip; float pts=0; - + MSG_DBG3("demux_avi.read_packet: %X\n",id); if(ds==demux->audio){ @@ -867,7 +867,7 @@ // update blockcount: priv->audio_block_no+=priv->audio_block_size ? ((len+priv->audio_block_size-1)/priv->audio_block_size) : 1; - } else + } else if(ds==demux->video){ // video if(priv->skip_video_frames>0){ @@ -887,10 +887,10 @@ if(ds) ++priv->video_pack_no; } - + // len=stream_read_dword_le(demux->stream); skip=(len+1)&(~1); // total bytes in this chunk - + if(ds){ MSG_DBG2("DEMUX_AVI: Read %d data bytes from packet %04X\n",len,id); ds_read_packet(ds,demux->stream,len,pts,idxpos,flags); @@ -918,9 +918,9 @@ AVIINDEXENTRY *idx=NULL; if(priv->idx_size>0 && priv->idx_pos<priv->idx_size){ off_t pos; - + idx=&((AVIINDEXENTRY *)priv->idx)[priv->idx_pos++]; - + //stream_seek(demux->stream,idx.dwChunkOffset); // pos-4,idx->dwChunkLength,idx->dwFlags); if(idx->dwFlags&AVIIF_LIST){ @@ -946,7 +946,7 @@ demux->filepos=stream_tell(demux->stream); id=stream_read_dword_le(demux->stream); if(stream_eof(demux->stream)) return 0; // EOF! - + if(id!=idx->ckid){ MSG_V("ChunkID mismatch! raw=%.4s idx=%.4s \n",(char *)&id,(char *)&idx->ckid); if(valid_fourcc(idx->ckid)) @@ -972,7 +972,7 @@ id=stream_read_dword_le(demux->stream); len=stream_read_dword_le(demux->stream); if(stream_eof(demux->stream)) return 0; // EOF! - + if(id==mmioFOURCC('L','I','S','T') || id==mmioFOURCC('R', 'I', 'F', 'F')){ id=stream_read_dword_le(demux->stream); // list or RIFF type continue; @@ -1018,16 +1018,16 @@ AVIINDEXENTRY *idx=NULL; int idx_pos=0; demux->filepos=stream_tell(demux->stream); - + if(ds==demux->video) idx_pos=priv->idx_pos_v++; else if(ds==demux->audio) idx_pos=priv->idx_pos_a++; else idx_pos=priv->idx_pos++; - + if(priv->idx_size>0 && idx_pos<priv->idx_size){ off_t pos; idx=&((AVIINDEXENTRY *)priv->idx)[idx_pos]; // idx=&priv->idx[idx_pos]; - + if(idx->dwFlags&AVIIF_LIST){ // LIST continue; @@ -1112,7 +1112,7 @@ id=stream_read_dword_le(demux->stream); // "AVIX" continue; } - + if(ds==demux_avi_select_stream(demux,id)){ // read it! ret=demux_avi_read_packet(demux,ds,id,len,priv->idx_pos-1,DP_NONKEYFRAME); @@ -1121,7 +1121,7 @@ int skip=(len+1)&(~1); // total bytes in this chunk stream_skip(demux->stream,skip); } - + } while(ret!=1); fpos[0]=stream_tell(demux->stream); return 1; @@ -1160,7 +1160,7 @@ MSG_WARN("AVI: invalid video stream ID: %d - ignoring (using default)\n",demuxer->video->id); demuxer->video->id=-1; // autodetect } - + stream_reset(demuxer->stream); stream_seek(demuxer->stream,demuxer->movi_start); priv->idx_pos=0; @@ -1186,7 +1186,7 @@ (int)((AVIINDEXENTRY *)priv->idx)[1].dwChunkOffset); } // demuxer->endpos=avi_header.movi_end; - + if(priv->idx_size>0){ // check that file is non-interleaved: int i; @@ -1354,11 +1354,11 @@ // seek absolute video_chunk_pos=0; } - + if(flags&DEMUX_SEEK_PERCENTS){ rel_seek_frames=rel_seek_secs*priv->numberofframes; } - + priv->skip_video_frames=0; priv->avi_audio_pts=0; Added: mplayerxp/libmpdemux/demux_dv.c =================================================================== --- mplayerxp/libmpdemux/demux_dv.c (rev 0) +++ mplayerxp/libmpdemux/demux_dv.c 2010-01-06 14:57:04 UTC (rev 79) @@ -0,0 +1,258 @@ +/* + * raw DV file parser + * copyright (c) 2002 Alexander Neundorf <neu...@kd...> + * based on the fli demuxer + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with MPlayer; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include "../mp_config.h" +#include "demux_msg.h" + +#include "stream.h" +#include "demuxer.h" +#include "stheader.h" + +#include <libdv/dv.h> +#include <libdv/dv_types.h> + +#define DV_PAL_FRAME_SIZE 144000 +#define DV_NTSC_FRAME_SIZE 122000 + +typedef struct +{ + int current_frame; + int frame_size; + off_t current_filepos; + int frame_number; + dv_decoder_t *decoder; +} rawdv_frames_t; + +static void dv_seek(demuxer_t *demuxer,float rel_seek_secs,float audio_delay,int flags) +{ + rawdv_frames_t *frames = (rawdv_frames_t *)demuxer->priv; + sh_video_t *sh_video = demuxer->video->sh; + off_t newpos=(flags&DEMUX_SEEK_SET)?0:frames->current_frame; + if(flags&DEMUX_SEEK_PERCENTS) + { + // float 0..1 + newpos+=rel_seek_secs*frames->frame_number; + } + else + { + // secs + newpos+=rel_seek_secs*sh_video->fps; + } + if(newpos<0) + newpos=0; + else if(newpos>frames->frame_number) + newpos=frames->frame_number; + frames->current_frame=newpos; + frames->current_filepos=newpos*frames->frame_size; +} + +static int dv_probe(demuxer_t *demuxer) +{ + unsigned char tmp_buffer[DV_PAL_FRAME_SIZE]; + int bytes_read=0; + int result=0; + dv_decoder_t *td; + + MSG_V("Checking for DV\n"); + + bytes_read=stream_read(demuxer->stream,tmp_buffer,DV_PAL_FRAME_SIZE); + if ((bytes_read!=DV_PAL_FRAME_SIZE) && (bytes_read!=DV_NTSC_FRAME_SIZE)) + return 0; + + td=dv_decoder_new(TRUE,TRUE,FALSE); + if (!td) + return 0; + + td->quality=DV_QUALITY_BEST; + result=dv_parse_header(td, tmp_buffer); + if (result<0) + return 0; + + if ((( td->num_dif_seqs==10) || (td->num_dif_seqs==12)) + && (td->width==720) + && ((td->height==576) || (td->height==480))) + result=1; + dv_decoder_free(td); + if (result) + return 1; + else + return 0; +} + +// return value: +// 0 = EOF or no stream found +// 1 = successfully read a packet +static int dv_demux(demuxer_t *demuxer, demux_stream_t *ds) +{ + rawdv_frames_t *frames = (rawdv_frames_t *)demuxer->priv; + demux_packet_t* dp_video=NULL; + sh_video_t *sh_video = demuxer->video->sh; + int bytes_read=0; +// fprintf(stderr,"demux_rawdv_fill_buffer() seek to %qu, size: %d\n",frames->current_filepos,frames->frame_size); + // fetch the frame from the file + // first, position the file properly since ds_read_packet() doesn't + // seem to do it, even though it takes a file offset as a parameter + stream_seek(demuxer->stream, frames->current_filepos); + + dp_video=new_demux_packet(frames->frame_size); + bytes_read=stream_read(demuxer->stream,dp_video->buffer,frames->frame_size); + if (bytes_read<frames->frame_size) + return 0; + dp_video->pts=frames->current_frame/sh_video->fps; + dp_video->pos=frames->current_filepos; + dp_video->flags=0; + + if (demuxer->audio && demuxer->audio->id>=-1) + { + demux_packet_t* dp_audio=clone_demux_packet(dp_video); + ds_add_packet(demuxer->audio,dp_audio); + } + ds_add_packet(demuxer->video,dp_video); + // get the next frame ready + frames->current_filepos+=frames->frame_size; + frames->current_frame++; +// fprintf(stderr," audio->packs: %d , video->packs: %d \n",demuxer->audio->packs, demuxer->video->packs); + return 1; +} + +static demuxer_t* dv_open(demuxer_t* demuxer) +{ + unsigned char dv_frame[DV_PAL_FRAME_SIZE]; + sh_video_t *sh_video = NULL; + rawdv_frames_t *frames = malloc(sizeof(rawdv_frames_t)); + dv_decoder_t *dv_decoder=NULL; + + MSG_V("demux_open_rawdv() end_pos %"PRId64"\n",(int64_t)demuxer->stream->end_pos); + + // go back to the beginning + stream_reset(demuxer->stream); + stream_seek(demuxer->stream, 0); + + //get the first frame + stream_read(demuxer->stream, dv_frame, DV_PAL_FRAME_SIZE); + + //read params from this frame + dv_decoder=dv_decoder_new(TRUE,TRUE,FALSE); + dv_decoder->quality=DV_QUALITY_BEST; + + if (dv_parse_header(dv_decoder, dv_frame) == -1) + return NULL; + + // create a new video stream header + sh_video = new_sh_video(demuxer, 0); + if (!sh_video) + return NULL; + + // make sure the demuxer knows about the new video stream header + // (even though new_sh_video() ought to take care of it) + demuxer->flags |= DEMUXF_SEEKABLE; + demuxer->video->sh = sh_video; + + // make sure that the video demuxer stream header knows about its + // parent video demuxer stream (this is getting wacky), or else + // video_read_properties() will choke + sh_video->ds = demuxer->video; + + // custom fourcc for internal MPlayer use +// sh_video->format = mmioFOURCC('R', 'A', 'D', 'V'); + sh_video->format = mmioFOURCC('D', 'V', 'S', 'D'); + + sh_video->disp_w = dv_decoder->width; + sh_video->disp_h = dv_decoder->height; + mp_msg(MSGT_DEMUXER,MSGL_V,"demux_open_rawdv() frame_size: %d w: %d h: %d dif_seq: %d system: %d\n",dv_decoder->frame_size,dv_decoder->width, dv_decoder->height,dv_decoder->num_dif_seqs,dv_decoder->system); + + sh_video->fps= (dv_decoder->system==e_dv_system_525_60?29.97:25); + sh_video->frametime = 1.0/sh_video->fps; + + // emulate BITMAPINFOHEADER for win32 decoders: + sh_video->bih=calloc(1, sizeof(BITMAPINFOHEADER)); + sh_video->bih->biSize=40; + sh_video->bih->biWidth = dv_decoder->width; + sh_video->bih->biHeight = dv_decoder->height; + sh_video->bih->biPlanes=1; + sh_video->bih->biBitCount=24; + sh_video->bih->biCompression=sh_video->format; // "DVSD" + sh_video->bih->biSizeImage=sh_video->bih->biWidth*sh_video->bih->biHeight*3; + + + frames->current_filepos=0; + frames->current_frame=0; + frames->frame_size=dv_decoder->frame_size; + frames->frame_number=demuxer->stream->end_pos/frames->frame_size; + + MSG_V("demux_open_rawdv() seek to %qu, size: %d, dv_dec->frame_size: %d\n",frames->current_filepos,frames->frame_size, dv_decoder->frame_size); + if (dv_decoder->audio != NULL && demuxer->audio->id>=-1){ + sh_audio_t *sh_audio = new_sh_audio(demuxer, 0); + demuxer->audio->id = 0; + demuxer->audio->sh = sh_audio; + sh_audio->ds = demuxer->audio; + MSG_V("demux_open_rawdv() chan: %d samplerate: %d\n",dv_decoder->audio->num_channels,dv_decoder->audio->frequency ); + // custom fourcc for internal MPlayer use + sh_audio->format = mmioFOURCC('R', 'A', 'D', 'V'); + + sh_audio->wf = malloc(sizeof(WAVEFORMATEX)); + memset(sh_audio->wf, 0, sizeof(WAVEFORMATEX)); + sh_audio->wf->wFormatTag = sh_audio->format; + sh_audio->wf->nChannels = dv_decoder->audio->num_channels; + sh_audio->wf->wBitsPerSample = 16; + sh_audio->wf->nSamplesPerSec = dv_decoder->audio->frequency; + // info about the input stream: + sh_audio->wf->nAvgBytesPerSec = sh_video->fps*dv_decoder->frame_size; + sh_audio->wf->nBlockAlign = dv_decoder->frame_size; + +// sh_audio->context=(void*)dv_decoder; + } + stream_reset(demuxer->stream); + stream_seek(demuxer->stream, 0); + dv_decoder_free(dv_decoder); //we keep this in the context of both stream headers + demuxer->priv=frames; + return demuxer; +} + +static void dv_close(demuxer_t* demuxer) +{ + rawdv_frames_t *frames = (rawdv_frames_t *)demuxer->priv; + + if(frames==0) + return; + free(frames); +} + +static int dv_control(demuxer_t *demuxer,int cmd, void *arg) { + return DEMUX_UNKNOWN; +} + +demuxer_driver_t demux_dv = { + "DV video: IEC 61834 and SMPTE 314M", + ".dv", + NULL, // no options + dv_probe, + dv_open, + dv_demux, + dv_seek, + dv_close, + dv_control +}; Property changes on: mplayerxp/libmpdemux/demux_dv.c ___________________________________________________________________ Added: svn:eol-style + native Modified: mplayerxp/libmpdemux/demux_fli.c =================================================================== --- mplayerxp/libmpdemux/demux_fli.c 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpdemux/demux_fli.c 2010-01-06 14:57:04 UTC (rev 79) @@ -51,7 +51,7 @@ // seem to do it, even though it takes a file offset as a parameter stream_seek(demuxer->stream, frames->filepos[frames->current_frame]); ds_read_packet(demuxer->video, - demuxer->stream, + demuxer->stream, frames->frame_size[frames->current_frame], frames->current_frame/sh_video->fps, frames->filepos[frames->current_frame], Modified: mplayerxp/libmpdemux/demux_lavf.c =================================================================== --- mplayerxp/libmpdemux/demux_lavf.c 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpdemux/demux_lavf.c 2010-01-06 14:57:04 UTC (rev 79) @@ -454,7 +454,7 @@ if(av_read_frame(priv->avfc, &pkt) < 0) return 0; - + id= pkt.stream_index; if(id==demux->audio->id){ @@ -475,7 +475,7 @@ av_free_packet(&pkt); return 1; } - + if(0/*pkt.destruct == av_destruct_packet*/){ //ok kids, dont try this at home :) dp=(demux_packet_t*)malloc(sizeof(demux_packet_t)); @@ -510,7 +510,7 @@ static void lavf_seek(demuxer_t *demuxer, float rel_seek_secs, int flags){ lavf_priv_t *priv = demuxer->priv; MSG_DBG2("lavf_demux(%p, %f, %d)\n", demuxer, rel_seek_secs, flags); - + #if LIBAVFORMAT_BUILD < 4619 av_seek_frame(priv->avfc, -1, priv->last_pts + rel_seek_secs*AV_TIME_BASE); #else Modified: mplayerxp/libmpdemux/demuxer.c =================================================================== --- mplayerxp/libmpdemux/demuxer.c 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpdemux/demuxer.c 2010-01-06 14:57:04 UTC (rev 79) @@ -452,6 +452,17 @@ ds->pts_bytes=0; } +demux_packet_t* clone_demux_packet(demux_packet_t* pack){ + demux_packet_t* dp=(demux_packet_t*)malloc(sizeof(demux_packet_t)); +// while(pack->master) pack=pack->master; // find the master + memcpy(dp,pack,sizeof(demux_packet_t)); +// dp->next=NULL; +// dp->refcount=0; +// dp->master=pack; +// pack->refcount++; + return dp; +} + int ds_get_packet(demux_stream_t *ds,unsigned char **start){ while(1){ int len; Modified: mplayerxp/libmpdemux/demuxer.h =================================================================== --- mplayerxp/libmpdemux/demuxer.h 2010-01-06 13:34:27 UTC (rev 78) +++ mplayerxp/libmpdemux/demuxer.h 2010-01-06 14:57:04 UTC (rev 79) @@ -191,6 +191,7 @@ free(dp); } +demux_packet_t* clone_demux_packet(demux_packet_t* pack); demux_stream_t* new_demuxer_stream(struct demuxer_st *demuxer,int id); demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id); void free_demuxer_stream(demux_stream_t *ds); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-07 09:23:05
|
Revision: 83 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=83&view=rev Author: nickols_k Date: 2010-01-07 09:22:57 +0000 (Thu, 07 Jan 2010) Log Message: ----------- add: --long-help option Modified Paths: -------------- mplayerxp/cfgparser.c mplayerxp/codec-cfg.c mplayerxp/libmpcodecs/ad.c mplayerxp/libmpcodecs/vd.c mplayerxp/mplayer.c mplayerxp/postproc/af.c mplayerxp/postproc/vf.c Modified: mplayerxp/cfgparser.c =================================================================== --- mplayerxp/cfgparser.c 2010-01-06 18:42:48 UTC (rev 82) +++ mplayerxp/cfgparser.c 2010-01-07 09:22:57 UTC (rev 83) @@ -86,7 +86,7 @@ } memset(&save[sl],0,2*sizeof(config_save_t)); save[sl].opt = conf; - + switch(conf->type) { case CONF_TYPE_FLAG : case CONF_TYPE_INT : @@ -97,13 +97,13 @@ break; case CONF_TYPE_STRING : save[sl].param.as_pointer = *((char**)conf->p); - break; + break; case CONF_TYPE_FUNC_FULL : if(strcasecmp(conf->name,opt) != 0) save->opt_name = strdup(opt); case CONF_TYPE_FUNC_PARAM : if(param) save->param.as_pointer = strdup(param); - case CONF_TYPE_FUNC : + case CONF_TYPE_FUNC : break; default : MSG_ERR("Should never append in m_config_save_option : conf->type=%d\n",conf->type); @@ -170,7 +170,7 @@ if (iter->param.as_pointer == NULL) { MSG_ERR("We lost param for option %s?\n",iter->opt->name); return -1; - } + } if ((((cfg_func_param_t) iter->opt->p)(iter->opt, (char*)iter->param.as_pointer)) < 0) return -1; break; @@ -181,7 +181,7 @@ }else { if (((cfg_func_arg_param_t) save->opt->p)(iter->opt, arg, (char*)iter->param.as_pointer) < 0) return -1; - + } break; } @@ -189,7 +189,7 @@ default : MSG_ERR("Why do we reverse this : name=%s type=%d ?\n",save->opt->name,save->opt->type); } - + return 1; } @@ -216,7 +216,7 @@ m_config_pop(m_config_t* config) { int i,ret= 1; config_save_t* cs; - + #ifdef MP_DEBUG assert(config != NULL); //assert(config->cs_level > 0); @@ -393,7 +393,7 @@ free(pr); if(channel) free(channel); - + } } @@ -445,7 +445,7 @@ if (config->parser_mode == CONFIG_FILE) MSG_ERR( "invalid option: %s\n",opt); ret = ERR_NOT_AN_OPTION; - goto out; + goto out; option_found : MSG_DBG3( "read_option: name='%s' p=%p type=%d\n", conf[i].name, conf[i].p, conf[i].type); @@ -639,7 +639,7 @@ int sscanf_ret; /* clear out */ subopt[0] = subparam[0] = 0; - + sscanf_ret = sscanf(token, "%[^=]=%s", subopt, subparam); MSG_DBG3( "token: '%s', i=%d, subopt='%s', subparam='%s' (ret: %d)\n", token, i, subopt, subparam, sscanf_ret); @@ -930,6 +930,8 @@ return ret; } +extern void show_help(void); +extern void show_long_help(void); int m_config_parse_command_line(m_config_t *config, int argc, char **argv, char **envp) { int i; @@ -955,8 +957,16 @@ for (i = 1; i < argc; i++) { //next: opt = argv[i]; + if(strcmp(opt,"--help")==0) { + show_help(); + exit(0); + } + if(strcmp(opt,"--long-help")==0) { + show_long_help(); + exit(0); + } /* check for -- (no more options id.) except --help! */ - if ((*opt == '-') && (*(opt+1) == '-') && (*(opt+2) != 'h')) + if ((*opt == '-') && (*(opt+1) == '-')) { no_more_opts = 1; if (i+1 >= argc) @@ -969,7 +979,7 @@ if((opt[0] == '{') && (opt[1] == '\0')) { play_tree_t* entry = play_tree_new(); - UNSET_GLOBAL(config); + UNSET_GLOBAL(config); if(config->last_entry == NULL) { play_tree_set_child(config->last_parent,entry); } else { @@ -990,7 +1000,7 @@ config->last_parent = config->last_entry->parent; continue; } - + if ((no_more_opts == 0) && (*opt == '-') && (*(opt+1) != 0)) /* option */ { /* remove leading '-' */ @@ -1022,8 +1032,8 @@ /* opt is not an option -> treat it as a filename */ UNSET_GLOBAL(config); // We start entry specific options if(config->last_entry == NULL) - play_tree_set_child(config->last_parent,entry); - else + play_tree_set_child(config->last_parent,entry); + else play_tree_append_entry(config->last_entry,entry); config->last_entry = entry; } @@ -1034,7 +1044,7 @@ MSG_ERR("Missing }- ?\n"); UNSET_GLOBAL(config); SET_RUNNING(config); - return 1; + return 1; #if 0 err_out_mem: MSG_ERR( "can't allocate memory for filenames (%s)\n", strerror(errno)); @@ -1054,12 +1064,12 @@ assert(config != NULL); assert(args != NULL); #endif - + if(conf_list) { for ( ; conf_list[list_len] != NULL; list_len++) /* NOTHING */; } - + conf_list = (config_t**)realloc(conf_list,sizeof(struct conf*)*(list_len+2)); if(conf_list == NULL) { MSG_ERR( "Can't allocate %d bytes of memory : %s\n",sizeof(struct conf*)*(list_len+2),strerror(errno)); @@ -1215,12 +1225,12 @@ int m_config_switch_flag(m_config_t *config,const char* opt) { config_t *conf; - + #ifdef MP_DEBUG assert(config != NULL); assert(opt != NULL); #endif - + conf = m_config_get_option(config,opt); if(!conf || conf->type != CONF_TYPE_FLAG) return 0; if( AS_INT(conf) == conf->min) AS_INT(conf) = conf->max; @@ -1229,7 +1239,7 @@ return 1; } - + int m_config_set_flag(m_config_t* config,const char* opt, int state) { config_t *conf; @@ -1275,7 +1285,7 @@ opt = m_config_get_option(config,arg); - if(!opt) + if(!opt) return -1; for(l = config->cs_level ; l >= 0 ; l--) { Modified: mplayerxp/codec-cfg.c =================================================================== --- mplayerxp/codec-cfg.c 2010-01-06 18:42:48 UTC (rev 82) +++ mplayerxp/codec-cfg.c 2010-01-07 09:22:57 UTC (rev 83) @@ -702,34 +702,39 @@ } void list_codecs(int audioflag){ - int i; - codecs_t *c; + int i; + codecs_t *c; - if (audioflag) { - i = nr_acodecs; - c = audio_codecs; - MSG_INFO("ac: afm: status: info: [lib/dll]\n"); - } else { - i = nr_vcodecs; - c = video_codecs; - MSG_INFO("vc: vfm: status: info: [lib/dll]\n"); + if (audioflag) { + i = nr_acodecs; + c = audio_codecs; + MSG_INFO("Available audio codecs:\n"); + } else { + i = nr_vcodecs; + c = video_codecs; + MSG_INFO("Available video codecs:\n"); + } + MSG_INFO(" %-11s %-10s %s %s [%s]\n" + ,audioflag?"ac:":"vc:" + ,audioflag?"afm:":"vfm:" + ,"status:" + ,"info:" + ,"lib/dll"); + if(!i) return; + for (/* NOTHING */; i--; c++) { + char* s="unknown "; + switch(c->status){ + case CODECS_STATUS_WORKING: s="working ";break; + case CODECS_STATUS_PROBLEMS: s="problems";break; + case CODECS_STATUS_NOT_WORKING: s="crashing";break; + case CODECS_STATUS_UNTESTED: s="untested";break; } - if(!i) return; - for (/* NOTHING */; i--; c++) { - char* s="unknown "; - switch(c->status){ - case CODECS_STATUS_WORKING: s="working ";break; - case CODECS_STATUS_PROBLEMS: s="problems";break; - case CODECS_STATUS_NOT_WORKING: s="crashing";break; - case CODECS_STATUS_UNTESTED: s="untested";break; - } - if(c->dll_name) - MSG_INFO("%-11s %s %s %s [%s]\n",c->codec_name,c->driver_name,s,c->s_info,c->dll_name); - else - MSG_INFO("%-11s %s %s %s\n",c->codec_name,c->driver_name,s,c->s_info); - - } - + if(c->dll_name) + MSG_INFO(" %-11s %-10s %s %s [%s]\n",c->codec_name,c->driver_name,s,c->s_info,c->dll_name); + else + MSG_INFO(" %-11s %-10s %s %s\n",c->codec_name,c->driver_name,s,c->s_info); + } + MSG_INFO("\n"); } Modified: mplayerxp/libmpcodecs/ad.c =================================================================== --- mplayerxp/libmpcodecs/ad.c 2010-01-06 18:42:48 UTC (rev 82) +++ mplayerxp/libmpcodecs/ad.c 2010-01-07 09:22:57 UTC (rev 83) @@ -76,9 +76,11 @@ void afm_help(void) { unsigned i; + MSG_INFO("Available audio codec families/drivers:\n"); for(i=0;i<nddrivers;i++) { if(mpcodecs_ad_drivers[i]) if(mpcodecs_ad_drivers[i]->options) - MSG_INFO(" %-10s %s\n",mpcodecs_ad_drivers[i]->info->driver_name,mpcodecs_ad_drivers[i]->info->descr); + MSG_INFO("\t%-10s %s\n",mpcodecs_ad_drivers[i]->info->driver_name,mpcodecs_ad_drivers[i]->info->descr); } + MSG_INFO("\n"); } Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2010-01-06 18:42:48 UTC (rev 82) +++ mplayerxp/libmpcodecs/vd.c 2010-01-07 09:22:57 UTC (rev 83) @@ -85,11 +85,13 @@ void vfm_help(void) { unsigned i; + MSG_INFO("Available video codec families/drivers:\n"); for(i=0;i<nddrivers;i++) { if(mpcodecs_vd_drivers[i]) if(mpcodecs_vd_drivers[i]->options) - MSG_INFO(" %-10s %s\n",mpcodecs_vd_drivers[i]->info->driver_name,mpcodecs_vd_drivers[i]->info->descr); + MSG_INFO("\t%-10s %s\n",mpcodecs_vd_drivers[i]->info->driver_name,mpcodecs_vd_drivers[i]->info->descr); } + MSG_INFO("\n"); } #include "libvo/video_out.h" Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2010-01-06 18:42:48 UTC (rev 82) +++ mplayerxp/mplayer.c 2010-01-07 09:22:57 UTC (rev 83) @@ -930,6 +930,7 @@ } #endif + static void init_player( void ) { if(video_driver && strcmp(video_driver,"help")==0) @@ -937,60 +938,72 @@ vo_print_help(); exit(0); } - if(audio_driver && strcmp(audio_driver,"help")==0) { ao_print_help(); exit(0); } - - /* check codec.conf*/ - if(!parse_codec_cfg(get_path("codecs.conf"))){ - if(!parse_codec_cfg(CONFDIR"/codecs.conf")){ - MSG_HINT(MSGTR_CopyCodecsConf); - exit(0); - } + if(video_family && strcmp(video_family,"help")==0){ + vfm_help(); + exit(0); } - - if(audio_codec && strcmp(audio_codec,"help")==0){ - MSG_INFO("Available audio codecs:\n"); - list_codecs(1); - MSG_INFO("\n"); + if(audio_family && strcmp(audio_family,"help")==0){ + afm_help(); exit(0); } - if(vf_cfg.list && strcmp(vf_cfg.list,"help")==0){ vf_help(); MSG_INFO("\n"); exit(0); } - if(af_cfg.list && strcmp(af_cfg.list,"help")==0){ af_help(); MSG_INFO("\n"); exit(0); } + /* check codec.conf*/ + if(!parse_codec_cfg(get_path("codecs.conf"))){ + if(!parse_codec_cfg(CONFDIR"/codecs.conf")){ + MSG_HINT(MSGTR_CopyCodecsConf); + exit(0); + } + } + + if(audio_codec && strcmp(audio_codec,"help")==0){ + list_codecs(1); + exit(0); + } if(video_codec && strcmp(video_codec,"help")==0){ - MSG_INFO("Available video codecs:\n"); list_codecs(0); - MSG_INFO("\n"); exit(0); } +} - if(video_family && strcmp(video_family,"help")==0){ - MSG_INFO("Available video codec families/drivers:\n"); - vfm_help(); - MSG_INFO("\n"); - exit(0); - } +void show_help(void) { + // no file/vcd/dvd -> show HELP: + MSG_INFO("%s",help_text); + print_stream_drivers(); + MSG_INFO("\nUse --long-help option for full help\n"); +} - if(audio_family && strcmp(audio_family,"help")==0){ - MSG_INFO("Available audio codec families/drivers:\n"); - afm_help(); - MSG_INFO("\n"); - exit(0); +void show_long_help(void) { + show_help(); + vo_print_help(); + ao_print_help(); + vf_help(); + af_help(); + vfm_help(); + afm_help(); + /* check codec.conf*/ + if(!parse_codec_cfg(get_path("codecs.conf"))){ + if(!parse_codec_cfg(CONFDIR"/codecs.conf")){ + MSG_HINT(MSGTR_CopyCodecsConf); + exit(0); + } } + list_codecs(0); + list_codecs(1); } int decore_audio( int xp_id ) @@ -1003,17 +1016,17 @@ int playsize; float pts=HUGE; int ret=0; - + ao_data.pts=sh_audio->timer*90000.0; playsize=ao_get_space(); - + if(!playsize) { if(sh_video) break; // buffer is full, do not block here!!! usec_sleep(10000); // Wait a tick before retry continue; } - + if(playsize>MAX_OUTBURST) playsize=MAX_OUTBURST; // we shouldn't exceed it! //if(playsize>outburst) playsize=outburst; @@ -2104,9 +2117,7 @@ init_player(); if(!filename){ - // no file/vcd/dvd -> show HELP: - MSG_INFO("%s",help_text); - print_stream_drivers(); + show_help(); return 0; } Modified: mplayerxp/postproc/af.c =================================================================== --- mplayerxp/postproc/af.c 2010-01-06 18:42:48 UTC (rev 82) +++ mplayerxp/postproc/af.c 2010-01-07 09:22:57 UTC (rev 83) @@ -706,11 +706,12 @@ MSG_INFO( "Available audio filters:\n"); while (filter_list[i]) { if (filter_list[i]->comment && filter_list[i]->comment[0]) - MSG_INFO( " %-15s: %s (%s)\n", filter_list[i]->name, filter_list[i]->info, filter_list[i]->comment); + MSG_INFO( "\t%-10s: %s (%s)\n", filter_list[i]->name, filter_list[i]->info, filter_list[i]->comment); else - MSG_INFO( " %-15s: %s\n", filter_list[i]->name, filter_list[i]->info); + MSG_INFO( "\t%-10s: %s\n", filter_list[i]->name, filter_list[i]->info); i++; } + MSG_INFO("\n"); } af_stream_t *af_new(void *_parent) Modified: mplayerxp/postproc/vf.c =================================================================== --- mplayerxp/postproc/vf.c 2010-01-06 18:42:48 UTC (rev 82) +++ mplayerxp/postproc/vf.c 2010-01-07 09:22:57 UTC (rev 83) @@ -468,10 +468,12 @@ void vf_help(){ int i=0; + MSG_INFO( "Available video filters:\n"); while(filter_list[i]){ MSG_INFO("\t%-10s: %s\n",filter_list[i]->name,filter_list[i]->info); i++; } + MSG_INFO("\n"); } extern vf_cfg_t vf_cfg; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-08 15:24:06
|
Revision: 86 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=86&view=rev Author: nickols_k Date: 2010-01-08 15:23:59 +0000 (Fri, 08 Jan 2010) Log Message: ----------- use parallel video filtering Modified Paths: -------------- mplayerxp/cfg-mplayer.h mplayerxp/configure mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libvo/x11_common.c mplayerxp/mp_image.c mplayerxp/mplayer.c mplayerxp/postproc/vf.c mplayerxp/postproc/vf.h mplayerxp/postproc/vf_2xsai.c mplayerxp/postproc/vf_aspect.c mplayerxp/postproc/vf_format.c mplayerxp/postproc/vf_pp.c mplayerxp/postproc/vf_rectangle.c mplayerxp/postproc/vf_scale.c mplayerxp/postproc/vf_smartblur.c mplayerxp/postproc/vf_swapuv.c mplayerxp/postproc/vf_vo.c mplayerxp/postproc/vf_yuvcsp.c mplayerxp/postproc/vf_yuy2.c mplayerxp/postproc/vf_yvu9.c Modified: mplayerxp/cfg-mplayer.h =================================================================== --- mplayerxp/cfg-mplayer.h 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/cfg-mplayer.h 2010-01-08 15:23:59 UTC (rev 86) @@ -78,6 +78,7 @@ #endif extern int enable_xp; +extern int enable_gomp; extern int enable_xp_audio; extern unsigned vo_da_buffs; extern unsigned vo_use_bm; @@ -250,6 +251,8 @@ {"xp", &enable_xp, CONF_TYPE_INT, CONF_RANGE, 0, 4, NULL}, {"noxp", &enable_xp, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"gomp", &enable_gomp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nogomp", &enable_gomp, CONF_TYPE_FLAG, 0, 1, 0, NULL}, {"da_buffs", &vo_da_buffs, CONF_TYPE_INT, CONF_RANGE, 4, 1024, NULL}, {"enable_bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"enable_bm2", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 2, NULL}, Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/configure 2010-01-08 15:23:59 UTC (rev 86) @@ -325,6 +325,7 @@ enabled gomp && check_ldflags -fopenmp || disable gomp enabled gomp && require2 gomp omp.h omp_get_thread_num -lgomp || disable gomp enabled gomp && check_cflags -fopenmp || disable gomp +print_config HAVE_ mp_config.h mp_config.mak gomp #enabled gomp && check_cflags -ftree-parallelize-loops=4 ##################################################### add_cflags "-Werror-implicit-function-declaration" Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/libmpcodecs/dec_video.c 2010-01-08 15:23:59 UTC (rev 86) @@ -1,5 +1,9 @@ #include "mp_config.h" +#ifdef HAVE_GOMP +#include <omp.h> +#endif + #include <stdio.h> #ifdef HAVE_MALLOC #include <malloc.h> @@ -76,9 +80,16 @@ sh_video->inited=0; } +#ifdef HAVE_GOMP +#define MPDEC_THREAD_COND (VF_FLAGS_THREADS|VF_FLAGS_SLICES) +static unsigned smp_num_cpus=1; +static unsigned use_vf_threads=0; +extern int enable_gomp; +#endif + extern char *video_codec; int init_video(sh_video_t *sh_video,const char* codecname,const char * vfm,int status){ - unsigned o_bps,bpp; + unsigned o_bps,bpp,vf_flags; sh_video->codec=NULL; MSG_DBG3("init_video(%p, %s, %s, %i)\n",sh_video,codecname,vfm,status); while((sh_video->codec=find_codec(sh_video->format, @@ -153,6 +164,20 @@ ,o_bps); // Yeah! We got it! sh_video->inited=1; +#ifdef HAVE_GOMP + if(enable_gomp) { + smp_num_cpus=omp_get_num_procs(); + vf_flags=vf_query_flags(sh_video->vfilter); + use_vf_threads=0; + MSG_V("[mpdec] vf_flags=%08X num_cpus=%u\n",vf_flags,smp_num_cpus); + if(((vf_flags&MPDEC_THREAD_COND)==MPDEC_THREAD_COND) && (smp_num_cpus>1)) { + MSG_OK("[VC] using %u threads for video filters\n",smp_num_cpus); + use_vf_threads=1; + } + } +#else + MSG_V("[mpdec] GOMP was not compiled-in! Using single threaded video filtering!\n"); +#endif return 1; } return 0; @@ -223,6 +248,33 @@ if(!(mpi->flags&(MP_IMGFLAG_DRAW_CALLBACK))){ MSG_DBG2("Put whole frame\n"); +#ifdef HAVE_GOMP + if(use_vf_threads) { + unsigned i,y,h_step,h; + mp_image_t ampi[smp_num_cpus]; + h_step = mpi->h/smp_num_cpus; + h=mpi->height; + mpi->height=h_step; + y=0; + for(i=0;i<smp_num_cpus;i++) { + ampi[i] = *mpi; + ampi[i].y = y; + ampi[i].height = h_step; + y+=h_step; + } +#pragma omp parallel for shared(vf) private(i) + for(i=0;i<smp_num_cpus;i++) { + MSG_V("Put slice[%u %u] in threads\n",ampi[i].y,h_step); + vf->put_slice(vf,&i[i]); + } + if(y<h) { + ampi[0].y = y; + ampi[0].height = h - ampi[0].y; + vf->put_slice(vf,&i[0]); + } + } + else +#endif vf->put_slice(vf,mpi); } t2=GetTimer()-t2; Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-08 15:23:59 UTC (rev 86) @@ -549,7 +549,7 @@ mpi->qstride=vdff_ctx->lavc_picture->qstride; mpi->pict_type=vdff_ctx->lavc_picture->pict_type; mpi->qscale_type=vdff_ctx->lavc_picture->qscale_type; - + if(sh->codec->outfmt[sh->outfmtidx] == IMGFMT_I420 || sh->codec->outfmt[sh->outfmtidx] == IMGFMT_IYUV) { Modified: mplayerxp/libvo/x11_common.c =================================================================== --- mplayerxp/libvo/x11_common.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/libvo/x11_common.c 2010-01-08 15:23:59 UTC (rev 86) @@ -664,12 +664,13 @@ "ColormapNotify", "ClientMessage", "MappingNotify", +"GenericEvent", "LASTEvent" }; static const char * __FASTCALL__ evt_name(unsigned num) { - if(num >=2 && num <= 35) return evt_names[num-2]; + if(num >=2 && num <= 36) return evt_names[num-2]; else return "Unknown"; } @@ -692,7 +693,7 @@ ret|=VO_EVENT_EXPOSE; break; case ConfigureNotify: - nw = Event.xconfigure.width; + nw = Event.xconfigure.width; nh = Event.xconfigure.height; if(adjust_size) adj_ret = (*adjust_size)(vo_dwidth,vo_dheight,&nw,&nh); ow = vo_dwidth; @@ -717,7 +718,7 @@ ret|=VO_EVENT_RESIZE; break; case KeyPress: - { + { int key; XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat ); #ifdef XF86XK_AudioPause Modified: mplayerxp/mp_image.c =================================================================== --- mplayerxp/mp_image.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/mp_image.c 2010-01-08 15:23:59 UTC (rev 86) @@ -192,7 +192,7 @@ if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; } mpi->flags|=MP_IMGFLAG_ALLOCATED; - + return mpi; } Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/mplayer.c 2010-01-08 15:23:59 UTC (rev 86) @@ -97,6 +97,7 @@ #include "dec_ahead.h" int enable_xp=XP_VAPlay; +int enable_gomp=1; volatile int dec_ahead_active_frame=0; volatile unsigned abs_dec_ahead_active_frame=0; volatile unsigned loc_dec_ahead_active_frame=0; Modified: mplayerxp/postproc/vf.c =================================================================== --- mplayerxp/postproc/vf.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf.c 2010-01-08 15:23:59 UTC (rev 86) @@ -536,6 +536,18 @@ }while(next); } +unsigned __FASTCALL__ vf_query_flags(vf_instance_t*vfi) +{ + unsigned flags=0xFFFFFFFF; + vf_instance_t *next=vfi; + do{ + MSG_DBG2("[vf_%s] flags: %08X\n",next->info->name,next->info->flags); + flags &= next->info->flags; + next=next->next; + }while(next); + return flags; +} + static int __FASTCALL__ dummy_config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int voflags, unsigned int outfmt,void *tune){ Modified: mplayerxp/postproc/vf.h =================================================================== --- mplayerxp/postproc/vf.h 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf.h 2010-01-08 15:23:59 UTC (rev 86) @@ -8,8 +8,9 @@ struct vf_instance_s; struct vf_priv_s; -#define VF_FLAGS_THREADS 0x00000000UL /**< requires to be applied within of threads */ -#define VF_FLAGS_OSD 0x00000001UL /**< requires to be applied during page flipping */ +#define VF_FLAGS_THREADS 0x00000001UL /**< Thread safe plugin (requires to be applied within of threads) */ +#define VF_FLAGS_OSD 0x00000002UL /**< requires to be applied during page flipping */ +#define VF_FLAGS_SLICES 0x00000004UL /**< really can draw slices (requires to be applied on SMP etc) */ typedef struct vf_info_s { const char *info; @@ -115,6 +116,9 @@ vf_instance_t* __FASTCALL__ append_filters(vf_instance_t* last); +/* returns ANDed flags of whole chain */ +unsigned __FASTCALL__ vf_query_flags(vf_instance_t*vfi); + void vf_help(); void __FASTCALL__ vf_uninit_filter(vf_instance_t* vf); Modified: mplayerxp/postproc/vf_2xsai.c =================================================================== --- mplayerxp/postproc/vf_2xsai.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_2xsai.c 2010-01-08 15:23:59 UTC (rev 86) @@ -291,7 +291,7 @@ dmpi->planes[0], dmpi->stride[0], mpi->x, mpi->y, mpi->w, mpi->h); - + return vf_next_put_slice(vf,dmpi); } @@ -319,7 +319,7 @@ "2xsai", "A'rpi", "http://elektron.its.tudelft.nl/~dalikifa/", - VF_FLAGS_THREADS, + VF_FLAGS_THREADS|VF_FLAGS_SLICES, vf_open }; Modified: mplayerxp/postproc/vf_aspect.c =================================================================== --- mplayerxp/postproc/vf_aspect.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_aspect.c 2010-01-08 15:23:59 UTC (rev 86) @@ -66,7 +66,7 @@ "aspect", "Rich Felker", "", - VF_FLAGS_THREADS, + VF_FLAGS_THREADS|VF_FLAGS_SLICES, vf_open }; Modified: mplayerxp/postproc/vf_format.c =================================================================== --- mplayerxp/postproc/vf_format.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_format.c 2010-01-08 15:23:59 UTC (rev 86) @@ -118,7 +118,7 @@ "noformat", "A'rpi", "FIXME! get_image()/put_image()", - VF_FLAGS_THREADS, + VF_FLAGS_THREADS|VF_FLAGS_SLICES, vf_no_open }; Modified: mplayerxp/postproc/vf_pp.c =================================================================== --- mplayerxp/postproc/vf_pp.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_pp.c 2010-01-08 15:23:59 UTC (rev 86) @@ -109,7 +109,7 @@ MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE, (mpi->w+7)&(~7),(mpi->h+7)&(~7)); } - + if(vf->priv->pp || !(mpi->flags&MP_IMGFLAG_DIRECT)){ // do the postprocessing! (or copy if no DR) pp2_postprocess(mpi->planes ,mpi->stride, Modified: mplayerxp/postproc/vf_rectangle.c =================================================================== --- mplayerxp/postproc/vf_rectangle.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_rectangle.c 2010-01-08 15:23:59 UTC (rev 86) @@ -70,7 +70,7 @@ mpi->w, mpi->h); memcpy_pic(dmpi->planes[0],mpi->planes[0],mpi->w*bpp, mpi->h, - dmpi->stride[0],mpi->stride[0]); + dmpi->stride[0],mpi->stride[0]); if(mpi->flags&MP_IMGFLAG_PLANAR && mpi->flags&MP_IMGFLAG_YUV){ memcpy_pic(dmpi->planes[1],mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, Modified: mplayerxp/postproc/vf_scale.c =================================================================== --- mplayerxp/postproc/vf_scale.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_scale.c 2010-01-08 15:23:59 UTC (rev 86) @@ -103,7 +103,7 @@ ret= vf_next_query_format(vf, outfmt_list[i],w,h); vf->priv->query_format_cache[i]= ret+1; } - + MSG_DBG2("scale: query(%s) -> %d\n",vo_format_name(format),ret&3); if(ret&VFCAP_CSP_SUPPORTED_BY_HW){ best=format; // no conversion -> bingo! @@ -129,12 +129,12 @@ int vo_flags; int int_sws_flags=0; SwsFilter *srcFilter, *dstFilter; - + if(!best){ MSG_WARN("SwScale: no supported outfmt found :(\n"); return 0; } - + vo_flags=vf_next_query_format(vf,best,d_width,d_height); MSG_DBG2("vf_scale: %i=vf_next_query_format(%p,%X,%u,%u);\n" ,vo_flags,vf,best,d_width,d_height); @@ -193,14 +193,14 @@ if(vf->priv->h==-2) vf->priv->h=vf->priv->w*d_height/d_width; break; } - + if(vf->priv->h<0) vf->priv->h=height; else if(vf->priv->h==0) vf->priv->h=d_height; - + // free old ctx: if(vf->priv->ctx) sws_freeContext(vf->priv->ctx); if(vf->priv->ctx2)sws_freeContext(vf->priv->ctx2); - + // new swscaler: sws_getFlagsAndFilterFromCmdLine(&int_sws_flags, &srcFilter, &dstFilter); MSG_DBG2("vf_scale: sws_getFlagsAndFilterFromCmdLine(...);\n"); @@ -317,7 +317,7 @@ sws_scale_ordered(sws2, src2, src_stride2, y>>1, h>>1, dst2, dst_stride2); }else{ sws_scale_ordered(sws1, src, src_stride, y, h, dst, dst_stride); - } + } } static int __FASTCALL__ put_slice(struct vf_instance_s* vf, mp_image_t *mpi){ @@ -493,7 +493,7 @@ MSG_V("SwScale params: %d x %d (-1=no scaling)\n", vf->priv->w, vf->priv->h); - + return 1; } @@ -535,7 +535,7 @@ sws_lum_gblur, sws_chr_gblur, sws_lum_sharpen, sws_chr_sharpen, sws_chr_hshift, sws_chr_vshift, verbose>1); - + switch(sws_flags) { case 0: *flags|= SWS_FAST_BILINEAR; break; @@ -587,7 +587,7 @@ "scale", "A'rpi", "", - VF_FLAGS_THREADS, + VF_FLAGS_THREADS|VF_FLAGS_SLICES, vf_open }; @@ -597,7 +597,7 @@ "fmtcvt", "A'rpi", "", - VF_FLAGS_THREADS, + VF_FLAGS_THREADS|VF_FLAGS_SLICES, vf_open }; Modified: mplayerxp/postproc/vf_smartblur.c =================================================================== --- mplayerxp/postproc/vf_smartblur.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_smartblur.c 2010-01-08 15:23:59 UTC (rev 86) @@ -191,7 +191,7 @@ dmpi->stride[1], dmpi->stride[1], vf->priv->chroma.radius, vf->priv->chroma.strength); vBlur(dmpi->planes[2], dmpi->planes[2], cw,ch, dmpi->stride[2], dmpi->stride[2], vf->priv->chroma.radius, vf->priv->chroma.strength); - + return vf_next_put_slice(vf,dmpi); } Modified: mplayerxp/postproc/vf_swapuv.c =================================================================== --- mplayerxp/postproc/vf_swapuv.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_swapuv.c 2010-01-08 15:23:59 UTC (rev 86) @@ -56,7 +56,7 @@ static int __FASTCALL__ put_slice(struct vf_instance_s* vf, mp_image_t *mpi){ mp_image_t *dmpi; - + if(mpi->flags&MP_IMGFLAG_DIRECT){ dmpi=(mp_image_t*)mpi->priv; } else { @@ -70,7 +70,7 @@ dmpi->stride[2]=mpi->stride[1]; dmpi->width=mpi->width; } - + vf_clone_mpi_attributes(dmpi, mpi); return vf_next_put_slice(vf,dmpi); } @@ -104,7 +104,7 @@ "swapuv", "Michael Niedermayer", "", - VF_FLAGS_THREADS, + VF_FLAGS_THREADS|VF_FLAGS_SLICES, vf_open }; Modified: mplayerxp/postproc/vf_vo.c =================================================================== --- mplayerxp/postproc/vf_vo.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_vo.c 2010-01-08 15:23:59 UTC (rev 86) @@ -159,7 +159,7 @@ "vo", "A'rpi", "for internal use", - VF_FLAGS_THREADS, + VF_FLAGS_THREADS|VF_FLAGS_SLICES, vf_open }; Modified: mplayerxp/postproc/vf_yuvcsp.c =================================================================== --- mplayerxp/postproc/vf_yuvcsp.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_yuvcsp.c 2010-01-08 15:23:59 UTC (rev 86) @@ -38,7 +38,7 @@ vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h); - + y_in = mpi->planes[0]; cb_in = mpi->planes[1]; cr_in = mpi->planes[2]; @@ -46,27 +46,18 @@ y_out = vf->dmpi->planes[0]; cb_out = vf->dmpi->planes[1]; cr_out = vf->dmpi->planes[2]; -#ifdef _OPENMP -#pragma omp parallel sections -{ -#pragma omp section -#endif - for (i = 0; i < mpi->height; i++) - for (j = 0; j < mpi->width; j++) + + for (i = mpi->y; i < mpi->height; i++) + for (j = mpi->x; j < mpi->width; j++) y_out[i*vf->dmpi->stride[0]+j] = clamp_y(y_in[i*mpi->stride[0]+j]); -#ifdef _OPENMP -#pragma omp section -#endif - for (i = 0; i < mpi->chroma_height; i++) - for (j = 0; j < mpi->chroma_width; j++) + for (i = (mpi->y)>>(mpi->chroma_y_shift); i < mpi->chroma_height; i++) + for (j = (mpi->x)>>(mpi->chroma_x_shift); j < mpi->chroma_width; j++) { cb_out[i*vf->dmpi->stride[1]+j] = clamp_c(cb_in[i*mpi->stride[1]+j]); cr_out[i*vf->dmpi->stride[2]+j] = clamp_c(cr_in[i*mpi->stride[2]+j]); } -#ifdef _OPENMP -} -#endif + return vf_next_put_slice(vf,vf->dmpi); } @@ -103,7 +94,7 @@ "yuvcsp", "Alex Beregszaszi", "", - VF_FLAGS_THREADS, + VF_FLAGS_THREADS|VF_FLAGS_SLICES, vf_open }; Modified: mplayerxp/postproc/vf_yuy2.c =================================================================== --- mplayerxp/postproc/vf_yuy2.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_yuy2.c 2010-01-08 15:23:59 UTC (rev 86) @@ -21,12 +21,12 @@ unsigned int flags, unsigned int outfmt,void *tune){ sws_rgb2rgb_init(get_sws_cpuflags()); - + if(vf_next_query_format(vf,IMGFMT_YUY2,d_width,d_height)<=0){ MSG_ERR("yuy2 isn't supported by next filter/vo :(\n"); return 0; } - + return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_YUY2,tune); } @@ -44,9 +44,9 @@ else yv12toyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0], mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]); - + vf_clone_mpi_attributes(dmpi, mpi); - + return vf_next_put_slice(vf,dmpi); } Modified: mplayerxp/postproc/vf_yvu9.c =================================================================== --- mplayerxp/postproc/vf_yvu9.c 2010-01-07 10:44:05 UTC (rev 85) +++ mplayerxp/postproc/vf_yvu9.c 2010-01-08 15:23:59 UTC (rev 86) @@ -18,12 +18,12 @@ static int __FASTCALL__ config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt,void *tune){ - + if(vf_next_query_format(vf,IMGFMT_YV12,d_width,d_height)<=0){ MSG_ERR("yv12 isn't supported by next filter/vo :(\n"); return 0; } - + return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_YV12,tune); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-08 15:50:02
|
Revision: 87 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=87&view=rev Author: nickols_k Date: 2010-01-08 15:49:56 +0000 (Fri, 08 Jan 2010) Log Message: ----------- disable slice-based draw_callback method on SMP [by default] Modified Paths: -------------- mplayerxp/cfg-mplayer.h mplayerxp/libmpcodecs/vd_ffmpeg.c Modified: mplayerxp/cfg-mplayer.h =================================================================== --- mplayerxp/cfg-mplayer.h 2010-01-08 15:23:59 UTC (rev 86) +++ mplayerxp/cfg-mplayer.h 2010-01-08 15:49:56 UTC (rev 87) @@ -79,6 +79,7 @@ extern int enable_xp; extern int enable_gomp; +extern int enable_ffslices; extern int enable_xp_audio; extern unsigned vo_da_buffs; extern unsigned vo_use_bm; @@ -253,6 +254,8 @@ {"noxp", &enable_xp, CONF_TYPE_FLAG, 0, 1, 0, NULL}, {"gomp", &enable_gomp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"nogomp", &enable_gomp, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"ffslices", &enable_ffslices, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noffslices", &enable_ffslices, CONF_TYPE_FLAG, 0, 1, 0, NULL}, {"da_buffs", &vo_da_buffs, CONF_TYPE_INT, CONF_RANGE, 4, 1024, NULL}, {"enable_bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"enable_bm2", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 2, NULL}, Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-08 15:23:59 UTC (rev 86) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-08 15:49:56 UTC (rev 87) @@ -5,6 +5,10 @@ #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ #include "mp_config.h" +#ifdef HAVE_GOMP +#include <omp.h> +#endif + #include "help_mp.h" #include "bswap.h" @@ -61,6 +65,9 @@ #include "libavcodec/avcodec.h" #include "libvo/video_out.h" +int enable_ffslices=-1; +extern int enable_gomp; + extern char *npp_options; static int vcodec_inited=0; typedef struct priv_s @@ -200,7 +207,7 @@ MSG_ERR(MSGTR_MissingLAVCcodec,sh->codec->dll_name); return 0; } - + vdff_ctx->ctx = avcodec_alloc_context(); vdff_ctx->lavc_picture = avcodec_alloc_frame(); if(!(vdff_ctx->ctx && vdff_ctx->lavc_picture)) @@ -208,6 +215,14 @@ MSG_ERR(MSGTR_OutOfMemory); return 0; } +#ifdef HAVE_GOMP + /* Note: Slices have effect on UNI-processor machines only */ + if(enable_ffslices==-1) { + if(omp_get_num_procs()>1 && enable_gomp)enable_ffslices=0; + else enable_ffslices=1; + } +#endif + #ifdef CODEC_FLAG_NOT_TRUNCATED vdff_ctx->ctx->flags|= CODEC_FLAG_NOT_TRUNCATED; #endif @@ -323,7 +338,7 @@ #endif if(sh->bih) vdff_ctx->ctx->bits_per_coded_sample= sh->bih->biBitCount; - if(vdff_ctx->lavc_codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND) vdff_ctx->cap_slices=1; + if(vdff_ctx->lavc_codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND && enable_ffslices) vdff_ctx->cap_slices=1; /* enable DR1 method */ if(vdff_ctx->lavc_codec->capabilities&CODEC_CAP_DR1) vdff_ctx->cap_dr1=1; vdff_ctx->ctx->flags|= CODEC_FLAG_EMU_EDGE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-08 16:02:16
|
Revision: 88 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=88&view=rev Author: nickols_k Date: 2010-01-08 16:02:07 +0000 (Fri, 08 Jan 2010) Log Message: ----------- document last changes Modified Paths: -------------- mplayerxp/mplayer.c mplayerxp/nls/help_mp-en.h mplayerxp/nls/help_mp-ru.h Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2010-01-08 15:49:56 UTC (rev 87) +++ mplayerxp/mplayer.c 2010-01-08 16:02:07 UTC (rev 88) @@ -1342,7 +1342,6 @@ if(mpxp_after_seek) mpxp_after_seek--; else { MSG_WARN(MSGTR_SystemTooSlow); - if(enable_xp != XP_None) MSG_WARN("Also try to decrease the number of buffers for decoding ahead: '-da_buffs'\n"); } } MSG_INFO("A-V SYNC: FRAMEDROP (SH_AV_delay=%.3f)!\n", SH_AV_delay); Modified: mplayerxp/nls/help_mp-en.h =================================================================== --- mplayerxp/nls/help_mp-en.h 2010-01-08 15:49:56 UTC (rev 87) +++ mplayerxp/nls/help_mp-en.h 2010-01-08 16:02:07 UTC (rev 88) @@ -79,7 +79,10 @@ " Also try study these keys:\n"\ " -enable_bm (currently may work with some vidix drivers only) [speedup upto 30%]\n"\ " '/bin/sh hdparm -u1 -d1 -a8 /dev/hdX' [25%]\n"\ -" Try disable OSD by pressing 'O' key twice [5-15%]\n\n" +" Try disable OSD by pressing 'O' key twice [5-15%]\n"\ +"Also try to decrease the number of buffers for decoding ahead: '-da_buffs'\n"\ +"*******************************************************************************\n"\ +"On SMP -noffslices may help too\n" #endif #ifndef MSGTR_Exiting Modified: mplayerxp/nls/help_mp-ru.h =================================================================== --- mplayerxp/nls/help_mp-ru.h 2010-01-08 15:49:56 UTC (rev 87) +++ mplayerxp/nls/help_mp-ru.h 2010-01-08 16:02:07 UTC (rev 88) @@ -71,9 +71,12 @@ " Также изучите эти ключи:\n"\ " -enable_bm (в настоящее время работает только на некоторых драйверах vidix) [ускоряет на 30%]\n"\ " '/bin/sh hdparm -u1 -d1 -a8 /dev/hdX' [25%]\n"\ -" Откажитесь от OSD двойным нажатием клавиши 'O' [5-15%]\n\n" +" Откажитесь от OSD двойным нажатием клавиши 'O' [5-15%]\n"\ +" Также попытайтесь уменьшить ичсло буферов упреждающего декодирования: '-da_buffs'\n"\ +"*******************************************************************************\n"\ +"На многопроцессорных машинах также может помочь: -noffslices\n" -// mplayer.c: +// mplayer.c: #define MSGTR_Exiting "\nВыходим... (%s)\n" #define MSGTR_Exit_frames "Запрошенное количество кадров проиграно" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |