summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore17
-rw-r--r--Changelog2
-rw-r--r--DOCS/man/de/mplayer.114
-rw-r--r--DOCS/man/en/mplayer.1174
-rw-r--r--DOCS/man/fr/mplayer.12
-rw-r--r--DOCS/tech/MAINTAINERS2
-rw-r--r--DOCS/tech/binary-packaging.txt22
-rw-r--r--DOCS/tech/general.txt1
-rw-r--r--DOCS/tech/libmpcodecs.txt22
-rw-r--r--DOCS/tech/libvo.txt1
-rw-r--r--DOCS/tech/realcodecs/TODO2
-rw-r--r--DOCS/tech/realcodecs/audio-codecs.txt3
-rw-r--r--DOCS/tech/realcodecs/video-codecs.txt2
-rw-r--r--DOCS/tech/slave.txt9
-rw-r--r--DOCS/tech/snow.txt1
-rw-r--r--DOCS/tech/subcp.txt2
-rw-r--r--DOCS/tech/swscaler_methods.txt1
-rw-r--r--DOCS/xml/en/documentation.xml1
-rw-r--r--DOCS/xml/en/faq.xml6
-rw-r--r--DOCS/xml/en/install.xml29
-rw-r--r--DOCS/xml/en/skin.xml1200
-rw-r--r--DOCS/xml/ldp.dsl1
-rw-r--r--DOCS/xml/ru/ports.xml2
-rw-r--r--Makefile179
-rw-r--r--README51
-rw-r--r--TOOLS/asfinfo.c1
-rw-r--r--TOOLS/avisubdump.c1
-rw-r--r--TOOLS/compare.c1
-rwxr-xr-xTOOLS/matroska.py397
-rw-r--r--TOOLS/modify_reg.c1
-rw-r--r--TOOLS/realcodecs/cook.c1
-rw-r--r--TOOLS/realcodecs/drv4.c1
-rw-r--r--TOOLS/realcodecs/ra.c1
-rw-r--r--TOOLS/realcodecs/rv30.c1
-rw-r--r--TOOLS/realcodecs/sipr.c1
-rw-r--r--TOOLS/vdpau_functions.py61
-rwxr-xr-xTOOLS/w32codec_dl.pl1
-rw-r--r--ass_mp.c302
-rw-r--r--ass_mp.h81
-rw-r--r--asxparser.c14
-rw-r--r--asxparser.h4
-rw-r--r--av_log.c111
-rw-r--r--av_log.h1
-rw-r--r--av_opts.c1
-rw-r--r--cfg-common-opts.h79
-rw-r--r--cfg-common.h9
-rw-r--r--cfg-mencoder.h8
-rw-r--r--cfg-mplayer.h103
-rw-r--r--codec-cfg.c73
-rw-r--r--codec-cfg.h2
-rw-r--r--command.c1084
-rw-r--r--command.h2
-rw-r--r--common.mak78
-rwxr-xr-xconfigure1051
-rw-r--r--cpudetect.h2
-rw-r--r--debian/README.debian4
-rw-r--r--debian/TODO.Debian2
-rw-r--r--debian/changelog7
-rw-r--r--debian/compat1
-rwxr-xr-xdebian/config52
-rw-r--r--debian/control4
-rw-r--r--debian/menu6
-rw-r--r--debian/postrm18
-rwxr-xr-xdebian/rules21
-rw-r--r--debian/templates26
-rw-r--r--debian/watch3
-rw-r--r--defaultopts.c62
-rw-r--r--defaultopts.h3
-rw-r--r--drivers/radeon_vid.c1
-rw-r--r--edl.c18
-rw-r--r--etc/codecs.conf63
-rw-r--r--etc/input.conf12
-rw-r--r--etc/menu.conf2
-rw-r--r--ffmpeg_files/arm/bswap.h72
-rw-r--r--ffmpeg_files/arm/intreadwrite.h78
-rw-r--r--ffmpeg_files/bfin/bswap.h45
-rw-r--r--ffmpeg_files/bswap.h103
-rw-r--r--ffmpeg_files/intreadwrite.h268
-rw-r--r--ffmpeg_files/sh4/bswap.h48
-rw-r--r--ffmpeg_files/taglists.c339
-rw-r--r--ffmpeg_files/taglists.h9
-rw-r--r--ffmpeg_files/x86/bswap.h61
-rw-r--r--ffmpeg_files/x86_cpu.h76
-rw-r--r--find_sub.c4
-rw-r--r--gui/app.c239
-rw-r--r--gui/app.h204
-rw-r--r--gui/bitmap.c187
-rw-r--r--gui/bitmap.h34
-rw-r--r--gui/cfg.c371
-rw-r--r--gui/cfg.h81
-rw-r--r--gui/interface.c1312
-rw-r--r--gui/interface.h240
-rw-r--r--gui/mplayer/gmplayer.h51
-rw-r--r--gui/mplayer/gtk/about.c346
-rw-r--r--gui/mplayer/gtk/about.h29
-rw-r--r--gui/mplayer/gtk/eq.c691
-rw-r--r--gui/mplayer/gtk/eq.h29
-rw-r--r--gui/mplayer/gtk/fs.c656
-rw-r--r--gui/mplayer/gtk/fs.h39
-rw-r--r--gui/mplayer/gtk/gtk_common.c197
-rw-r--r--gui/mplayer/gtk/gtk_common.h41
-rw-r--r--gui/mplayer/gtk/gtk_url.c171
-rw-r--r--gui/mplayer/gtk/gtk_url.h30
-rw-r--r--gui/mplayer/gtk/mb.c114
-rw-r--r--gui/mplayer/gtk/mb.h29
-rw-r--r--gui/mplayer/gtk/menu.c645
-rw-r--r--gui/mplayer/gtk/menu.h31
-rw-r--r--gui/mplayer/gtk/opts.c1832
-rw-r--r--gui/mplayer/gtk/opts.h33
-rw-r--r--gui/mplayer/gtk/pl.c546
-rw-r--r--gui/mplayer/gtk/pl.h29
-rw-r--r--gui/mplayer/gtk/sb.c211
-rw-r--r--gui/mplayer/gtk/sb.h30
-rw-r--r--gui/mplayer/gui_common.c308
-rw-r--r--gui/mplayer/gui_common.h37
-rw-r--r--gui/mplayer/menu.c175
-rw-r--r--gui/mplayer/mw.c636
-rw-r--r--gui/mplayer/pb.c265
-rw-r--r--gui/mplayer/pixmaps/MPlayer_mini.xpm638
-rw-r--r--gui/mplayer/pixmaps/a11.xpm22
-rw-r--r--gui/mplayer/pixmaps/a169.xpm22
-rw-r--r--gui/mplayer/pixmaps/a235.xpm22
-rw-r--r--gui/mplayer/pixmaps/a43.xpm22
-rw-r--r--gui/mplayer/pixmaps/ab.xpm34
-rw-r--r--gui/mplayer/pixmaps/about.xpm427
-rw-r--r--gui/mplayer/pixmaps/aspect.xpm22
-rw-r--r--gui/mplayer/pixmaps/cancel.xpm139
-rw-r--r--gui/mplayer/pixmaps/chapter.xpm23
-rw-r--r--gui/mplayer/pixmaps/delsub.xpm22
-rw-r--r--gui/mplayer/pixmaps/dir.xpm148
-rw-r--r--gui/mplayer/pixmaps/dolby.xpm23
-rw-r--r--gui/mplayer/pixmaps/double.xpm151
-rw-r--r--gui/mplayer/pixmaps/dvd.xpm129
-rw-r--r--gui/mplayer/pixmaps/empty.xpm20
-rw-r--r--gui/mplayer/pixmaps/empty1px.xpm5
-rw-r--r--gui/mplayer/pixmaps/eq.xpm35
-rw-r--r--gui/mplayer/pixmaps/error.xpm544
-rw-r--r--gui/mplayer/pixmaps/exit.xpm82
-rw-r--r--gui/mplayer/pixmaps/file.xpm26
-rw-r--r--gui/mplayer/pixmaps/file2.xpm27
-rw-r--r--gui/mplayer/pixmaps/fs.xpm109
-rw-r--r--gui/mplayer/pixmaps/half.xpm144
-rw-r--r--gui/mplayer/pixmaps/icon.xpm323
-rw-r--r--gui/mplayer/pixmaps/loadeaf.xpm151
-rw-r--r--gui/mplayer/pixmaps/logo.xpm1227
-rw-r--r--gui/mplayer/pixmaps/mplayer-desktop.xpm149
-rw-r--r--gui/mplayer/pixmaps/next.xpm79
-rw-r--r--gui/mplayer/pixmaps/normal.xpm130
-rw-r--r--gui/mplayer/pixmaps/ok.xpm24
-rw-r--r--gui/mplayer/pixmaps/open.xpm83
-rw-r--r--gui/mplayer/pixmaps/pause.xpm48
-rw-r--r--gui/mplayer/pixmaps/pl.xpm26
-rw-r--r--gui/mplayer/pixmaps/play.xpm56
-rw-r--r--gui/mplayer/pixmaps/playdvd.xpm137
-rw-r--r--gui/mplayer/pixmaps/playvcd.xpm201
-rw-r--r--gui/mplayer/pixmaps/prefs.xpm69
-rw-r--r--gui/mplayer/pixmaps/prev.xpm77
-rw-r--r--gui/mplayer/pixmaps/question.xpm335
-rw-r--r--gui/mplayer/pixmaps/skin.xpm181
-rw-r--r--gui/mplayer/pixmaps/sound.xpm140
-rw-r--r--gui/mplayer/pixmaps/stop.xpm254
-rw-r--r--gui/mplayer/pixmaps/stop2.xpm48
-rw-r--r--gui/mplayer/pixmaps/sub.xpm21
-rw-r--r--gui/mplayer/pixmaps/title.xpm23
-rw-r--r--gui/mplayer/pixmaps/tongue.xpm169
-rw-r--r--gui/mplayer/pixmaps/tonguebla.xpm156
-rw-r--r--gui/mplayer/pixmaps/up.xpm112
-rw-r--r--gui/mplayer/pixmaps/url.xpm21
-rw-r--r--gui/mplayer/pixmaps/vcd.xpm179
-rw-r--r--gui/mplayer/pixmaps/warning.xpm314
-rw-r--r--gui/mplayer/play.c387
-rw-r--r--gui/mplayer/play.h49
-rw-r--r--gui/mplayer/sw.c110
-rw-r--r--gui/mplayer/widgets.c255
-rw-r--r--gui/mplayer/widgets.h80
-rw-r--r--gui/skin/cut.c53
-rw-r--r--gui/skin/cut.h27
-rw-r--r--gui/skin/font.c269
-rw-r--r--gui/skin/font.h54
-rw-r--r--gui/skin/skin.c745
-rw-r--r--gui/skin/skin.h35
-rw-r--r--gui/win32/Changelog317
-rw-r--r--gui/win32/README21
-rw-r--r--gui/win32/dialogs.c1122
-rw-r--r--gui/win32/dialogs.h134
-rw-r--r--gui/win32/gui.c1549
-rw-r--r--gui/win32/gui.h121
-rw-r--r--gui/win32/interface.c948
-rw-r--r--gui/win32/playlist.c158
-rw-r--r--gui/win32/playlist.h61
-rw-r--r--gui/win32/preferences.c714
-rw-r--r--gui/win32/skinload.c776
-rw-r--r--gui/win32/skinload.h215
-rw-r--r--gui/win32/widgetrender.c354
-rw-r--r--gui/win32/wincfg.c147
-rw-r--r--gui/wm/ws.c1312
-rw-r--r--gui/wm/ws.h275
-rw-r--r--gui/wm/wskeys.h181
-rw-r--r--gui/wm/wsmkeys.h86
-rw-r--r--gui/wm/wsxdnd.c259
-rw-r--r--gui/wm/wsxdnd.h71
-rw-r--r--help/help_mp-en.h1
-rw-r--r--help/help_mp-es.h1
-rw-r--r--help/help_mp-hu.h1
-rw-r--r--help/help_mp-pl.h1
-rw-r--r--help/help_mp-sk.h1
-rw-r--r--help/help_mp-sv.h1
-rw-r--r--help/help_mp-uk.h1
-rw-r--r--input/appleir.c14
-rw-r--r--input/ar.c4
-rw-r--r--input/ar.h4
-rw-r--r--input/input.c859
-rw-r--r--input/input.h72
-rw-r--r--input/joystick.c20
-rw-r--r--input/joystick.h2
-rw-r--r--input/lirc.c6
-rw-r--r--libaf/af.c2
-rw-r--r--libaf/af.h2
-rw-r--r--libaf/af_delay.c2
-rw-r--r--libaf/af_equalizer.c7
-rw-r--r--libaf/af_ladspa.c30
-rw-r--r--libaf/af_lavcac3enc.c6
-rw-r--r--libaf/af_resample.c1
-rw-r--r--libaf/af_scaletempo.c33
-rw-r--r--libaf/af_sweep.c1
-rw-r--r--libaf/filter.c1
-rw-r--r--libaf/format.c2
-rw-r--r--libaf/window.c1
-rw-r--r--libao2/ao_alsa.c137
-rw-r--r--libao2/ao_alsa5.c46
-rw-r--r--libao2/ao_arts.c13
-rw-r--r--libao2/ao_dxr2.c5
-rw-r--r--libao2/ao_esd.c6
-rw-r--r--libao2/ao_ivtv.c4
-rw-r--r--libao2/ao_jack.c1
-rw-r--r--libao2/ao_mpegpes.c8
-rw-r--r--libao2/ao_openal.c1
-rw-r--r--libao2/ao_oss.c55
-rw-r--r--libao2/ao_pcm.c12
-rw-r--r--libao2/ao_sdl.c20
-rw-r--r--libao2/ao_sgi.c34
-rw-r--r--libao2/ao_sun.c9
-rw-r--r--libao2/ao_v4l2.c4
-rw-r--r--libao2/audio_out.c16
-rw-r--r--libao2/audio_out.h3
-rw-r--r--libass/ass.c1246
-rw-r--r--libass/ass.h374
-rw-r--r--libass/ass_bitmap.c537
-rw-r--r--libass/ass_bitmap.h57
-rw-r--r--libass/ass_cache.c380
-rw-r--r--libass/ass_cache.h119
-rw-r--r--libass/ass_cache_template.h122
-rw-r--r--libass/ass_drawing.c495
-rw-r--r--libass/ass_drawing.h77
-rw-r--r--libass/ass_font.c532
-rw-r--r--libass/ass_font.h66
-rw-r--r--libass/ass_fontconfig.c461
-rw-r--r--libass/ass_fontconfig.h47
-rw-r--r--libass/ass_library.c147
-rw-r--r--libass/ass_library.h43
-rw-r--r--libass/ass_mp.c278
-rw-r--r--libass/ass_mp.h75
-rw-r--r--libass/ass_parse.c926
-rw-r--r--libass/ass_parse.h38
-rw-r--r--libass/ass_render.c2694
-rw-r--r--libass/ass_render.h262
-rw-r--r--libass/ass_strtod.c247
-rw-r--r--libass/ass_types.h125
-rw-r--r--libass/ass_utils.c207
-rw-r--r--libass/ass_utils.h147
-rw-r--r--libass/mputils.h31
-rw-r--r--libmenu/menu.c50
-rw-r--r--libmenu/menu.h5
-rw-r--r--libmenu/menu_chapsel.c4
-rw-r--r--libmenu/menu_cmdlist.c18
-rw-r--r--libmenu/menu_console.c18
-rw-r--r--libmenu/menu_dvbin.c4
-rw-r--r--libmenu/menu_filesel.c17
-rw-r--r--libmenu/menu_list.c1
-rw-r--r--libmenu/menu_param.c16
-rw-r--r--libmenu/menu_pt.c8
-rw-r--r--libmenu/menu_txt.c8
-rw-r--r--libmenu/vf_menu.c25
-rw-r--r--libmpcodecs/ad.c54
-rw-r--r--libmpcodecs/ad.h6
-rw-r--r--libmpcodecs/ad_acm.c6
-rw-r--r--libmpcodecs/ad_alaw.c2
-rw-r--r--libmpcodecs/ad_dk3adpcm.c2
-rw-r--r--libmpcodecs/ad_dmo.c4
-rw-r--r--libmpcodecs/ad_dshow.c4
-rw-r--r--libmpcodecs/ad_dvdpcm.c4
-rw-r--r--libmpcodecs/ad_faad.c4
-rw-r--r--libmpcodecs/ad_ffmpeg.c8
-rw-r--r--libmpcodecs/ad_hwac3.c4
-rw-r--r--libmpcodecs/ad_hwmpa.c2
-rw-r--r--libmpcodecs/ad_imaadpcm.c2
-rw-r--r--libmpcodecs/ad_internal.h2
-rw-r--r--libmpcodecs/ad_liba52.c6
-rw-r--r--libmpcodecs/ad_libdca.c2
-rw-r--r--libmpcodecs/ad_libdv.c4
-rw-r--r--libmpcodecs/ad_libmad.c2
-rw-r--r--libmpcodecs/ad_libvorbis.c2
-rw-r--r--libmpcodecs/ad_mp3lib.c2
-rw-r--r--libmpcodecs/ad_mpc.c3
-rw-r--r--libmpcodecs/ad_msadpcm.c4
-rw-r--r--libmpcodecs/ad_msgsm.c2
-rw-r--r--libmpcodecs/ad_pcm.c41
-rw-r--r--libmpcodecs/ad_qtaudio.c2
-rw-r--r--libmpcodecs/ad_realaud.c4
-rw-r--r--libmpcodecs/ad_sample.c2
-rw-r--r--libmpcodecs/ad_speex.c3
-rw-r--r--libmpcodecs/ad_twin.c2
-rw-r--r--libmpcodecs/ae.c2
-rw-r--r--libmpcodecs/ae_lame.c182
-rw-r--r--libmpcodecs/ae_lavc.c48
-rw-r--r--libmpcodecs/ae_pcm.c1
-rw-r--r--libmpcodecs/ae_toolame.c1
-rw-r--r--libmpcodecs/ae_twolame.c1
-rw-r--r--libmpcodecs/dec_audio.c65
-rw-r--r--libmpcodecs/dec_teletext.c6
-rw-r--r--libmpcodecs/dec_video.c615
-rw-r--r--libmpcodecs/dec_video.h3
-rw-r--r--libmpcodecs/img_format.c2
-rw-r--r--libmpcodecs/mp_image.h2
-rw-r--r--libmpcodecs/native/xa_gsm.c2
-rw-r--r--libmpcodecs/pullup.c9
-rw-r--r--libmpcodecs/vd.c519
-rw-r--r--libmpcodecs/vd.h8
-rw-r--r--libmpcodecs/vd_dmo.c10
-rw-r--r--libmpcodecs/vd_dshow.c10
-rw-r--r--libmpcodecs/vd_ffmpeg.c325
-rw-r--r--libmpcodecs/vd_hmblck.c2
-rw-r--r--libmpcodecs/vd_ijpg.c4
-rw-r--r--libmpcodecs/vd_internal.h2
-rw-r--r--libmpcodecs/vd_libdv.c2
-rw-r--r--libmpcodecs/vd_libmpeg2.c6
-rw-r--r--libmpcodecs/vd_lzo.c2
-rw-r--r--libmpcodecs/vd_mpegpes.c2
-rw-r--r--libmpcodecs/vd_mpng.c2
-rw-r--r--libmpcodecs/vd_mtga.c3
-rw-r--r--libmpcodecs/vd_null.c3
-rw-r--r--libmpcodecs/vd_qtvideo.c2
-rw-r--r--libmpcodecs/vd_raw.c2
-rw-r--r--libmpcodecs/vd_realvid.c4
-rw-r--r--libmpcodecs/vd_sgi.c3
-rw-r--r--libmpcodecs/vd_theora.c2
-rw-r--r--libmpcodecs/vd_vfw.c4
-rw-r--r--libmpcodecs/vd_xanim.c2
-rw-r--r--libmpcodecs/vd_xvid4.c2
-rw-r--r--libmpcodecs/vd_zrmjpeg.c2
-rw-r--r--libmpcodecs/ve.c5
-rw-r--r--libmpcodecs/ve_lavc.c22
-rw-r--r--libmpcodecs/ve_libdv.c8
-rw-r--r--libmpcodecs/ve_nuv.c12
-rw-r--r--libmpcodecs/ve_qtvideo.c8
-rw-r--r--libmpcodecs/ve_raw.c12
-rw-r--r--libmpcodecs/ve_vfw.c22
-rw-r--r--libmpcodecs/ve_x264.c16
-rw-r--r--libmpcodecs/ve_xvid4.c10
-rw-r--r--libmpcodecs/vf.c110
-rw-r--r--libmpcodecs/vf.h62
-rw-r--r--libmpcodecs/vf_1bpp.c8
-rw-r--r--libmpcodecs/vf_2xsai.c10
-rw-r--r--libmpcodecs/vf_ass.c163
-rw-r--r--libmpcodecs/vf_blackframe.c10
-rw-r--r--libmpcodecs/vf_bmovl.c8
-rw-r--r--libmpcodecs/vf_boxblur.c6
-rw-r--r--libmpcodecs/vf_crop.c17
-rw-r--r--libmpcodecs/vf_cropdetect.c8
-rw-r--r--libmpcodecs/vf_decimate.c6
-rw-r--r--libmpcodecs/vf_delogo.c16
-rw-r--r--libmpcodecs/vf_denoise3d.c8
-rw-r--r--libmpcodecs/vf_detc.c12
-rw-r--r--libmpcodecs/vf_dint.c4
-rw-r--r--libmpcodecs/vf_divtc.c8
-rw-r--r--libmpcodecs/vf_down3dright.c9
-rw-r--r--libmpcodecs/vf_dsize.c3
-rw-r--r--libmpcodecs/vf_dvbscale.c2
-rw-r--r--libmpcodecs/vf_eq.c13
-rw-r--r--libmpcodecs/vf_expand.c72
-rw-r--r--libmpcodecs/vf_field.c6
-rw-r--r--libmpcodecs/vf_fil.c6
-rw-r--r--libmpcodecs/vf_filmdint.c17
-rw-r--r--libmpcodecs/vf_flip.c6
-rw-r--r--libmpcodecs/vf_format.c6
-rw-r--r--libmpcodecs/vf_framestep.c8
-rw-r--r--libmpcodecs/vf_fspp.c12
-rw-r--r--libmpcodecs/vf_geq.c18
-rw-r--r--libmpcodecs/vf_gradfun.c12
-rw-r--r--libmpcodecs/vf_halfpack.c9
-rw-r--r--libmpcodecs/vf_harddup.c8
-rw-r--r--libmpcodecs/vf_hqdn3d.c8
-rw-r--r--libmpcodecs/vf_hue.c13
-rw-r--r--libmpcodecs/vf_il.c2
-rw-r--r--libmpcodecs/vf_ilpack.c7
-rw-r--r--libmpcodecs/vf_ivtc.c10
-rw-r--r--libmpcodecs/vf_kerndeint.c10
-rw-r--r--libmpcodecs/vf_lavc.c10
-rw-r--r--libmpcodecs/vf_lavcdeint.c6
-rw-r--r--libmpcodecs/vf_mcdeint.c15
-rw-r--r--libmpcodecs/vf_mirror.c2
-rw-r--r--libmpcodecs/vf_noformat.c6
-rw-r--r--libmpcodecs/vf_noise.c12
-rw-r--r--libmpcodecs/vf_ow.c10
-rw-r--r--libmpcodecs/vf_palette.c16
-rw-r--r--libmpcodecs/vf_perspective.c8
-rw-r--r--libmpcodecs/vf_phase.c4
-rw-r--r--libmpcodecs/vf_pp.c48
-rw-r--r--libmpcodecs/vf_pp7.c12
-rw-r--r--libmpcodecs/vf_pullup.c14
-rw-r--r--libmpcodecs/vf_qp.c10
-rw-r--r--libmpcodecs/vf_rectangle.c6
-rw-r--r--libmpcodecs/vf_remove_logo.c10
-rw-r--r--libmpcodecs/vf_rgb2bgr.c6
-rw-r--r--libmpcodecs/vf_rgbtest.c6
-rw-r--r--libmpcodecs/vf_rotate.c6
-rw-r--r--libmpcodecs/vf_sab.c8
-rw-r--r--libmpcodecs/vf_scale.c39
-rw-r--r--libmpcodecs/vf_screenshot.c12
-rw-r--r--libmpcodecs/vf_smartblur.c8
-rw-r--r--libmpcodecs/vf_softpulldown.c6
-rw-r--r--libmpcodecs/vf_softskip.c10
-rw-r--r--libmpcodecs/vf_spp.c17
-rw-r--r--libmpcodecs/vf_swapuv.c6
-rw-r--r--libmpcodecs/vf_telecine.c10
-rw-r--r--libmpcodecs/vf_test.c8
-rw-r--r--libmpcodecs/vf_tfields.c30
-rw-r--r--libmpcodecs/vf_tile.c10
-rw-r--r--libmpcodecs/vf_tinterlace.c8
-rw-r--r--libmpcodecs/vf_unsharp.c12
-rw-r--r--libmpcodecs/vf_uspp.c12
-rw-r--r--libmpcodecs/vf_vo.c126
-rw-r--r--libmpcodecs/vf_yadif.c24
-rw-r--r--libmpcodecs/vf_yuvcsp.c8
-rw-r--r--libmpcodecs/vf_yuy2.c8
-rw-r--r--libmpcodecs/vf_yvu9.c8
-rw-r--r--libmpcodecs/vf_zrmjpeg.c7
-rw-r--r--libmpdemux/asfheader.c30
-rw-r--r--libmpdemux/aviheader.c53
-rw-r--r--libmpdemux/aviprint.c1
-rw-r--r--libmpdemux/demux_asf.c10
-rw-r--r--libmpdemux/demux_audio.c4
-rw-r--r--libmpdemux/demux_avi.c43
-rw-r--r--libmpdemux/demux_avs.c2
-rw-r--r--libmpdemux/demux_demuxers.c5
-rw-r--r--libmpdemux/demux_lavf.c39
-rw-r--r--libmpdemux/demux_lmlm4.c6
-rw-r--r--libmpdemux/demux_mkv.c4738
-rw-r--r--libmpdemux/demux_mng.c1
-rw-r--r--libmpdemux/demux_mov.c21
-rw-r--r--libmpdemux/demux_mpg.c18
-rw-r--r--libmpdemux/demux_nemesi.c2
-rw-r--r--libmpdemux/demux_nut.c4
-rw-r--r--libmpdemux/demux_ogg.c13
-rw-r--r--libmpdemux/demux_pva.c2
-rw-r--r--libmpdemux/demux_real.c12
-rw-r--r--libmpdemux/demux_rtp.cpp10
-rw-r--r--libmpdemux/demux_ty.c5
-rw-r--r--libmpdemux/demux_ty_osd.c3
-rw-r--r--libmpdemux/demux_viv.c6
-rw-r--r--libmpdemux/demux_vqf.c2
-rw-r--r--libmpdemux/demux_xmms.c6
-rw-r--r--libmpdemux/demuxer.c350
-rw-r--r--libmpdemux/demuxer.h92
-rw-r--r--libmpdemux/ebml.c754
-rw-r--r--libmpdemux/ebml.h189
-rw-r--r--libmpdemux/ebml_defs.c382
-rw-r--r--libmpdemux/ebml_types.h433
-rw-r--r--libmpdemux/extension.c1
-rw-r--r--libmpdemux/mf.c1
-rw-r--r--libmpdemux/mp3_hdr.c4
-rw-r--r--libmpdemux/mp_taglists.c21
-rw-r--r--libmpdemux/mp_taglists.h10
-rw-r--r--libmpdemux/muxer.c9
-rw-r--r--libmpdemux/muxer_avi.c8
-rw-r--r--libmpdemux/muxer_lavf.c8
-rw-r--r--libmpdemux/muxer_mpeg.c37
-rw-r--r--libmpdemux/muxer_rawaudio.c7
-rw-r--r--libmpdemux/parse_mp4.c3
-rw-r--r--libmpdemux/parse_mp4.h1
-rw-r--r--libmpdemux/stheader.h43
-rw-r--r--libmpdemux/video.c23
-rw-r--r--libmpdemux/yuv4mpeg.c2
-rw-r--r--libmpdemux/yuv4mpeg.h2
-rw-r--r--libmpdemux/yuv4mpeg_ratio.c1
-rw-r--r--libswscale/Makefile23
-rw-r--r--libswscale/bfin/internal_bfin.S606
-rw-r--r--libswscale/bfin/swscale_bfin.c93
-rw-r--r--libswscale/bfin/yuv2rgb_bfin.c203
-rw-r--r--libswscale/colorspace-test.c178
-rw-r--r--libswscale/libswscale.v4
-rw-r--r--libswscale/mlib/yuv2rgb_mlib.c88
-rw-r--r--libswscale/options.c61
-rw-r--r--libswscale/ppc/swscale_altivec_template.c545
-rw-r--r--libswscale/ppc/yuv2rgb_altivec.c953
-rw-r--r--libswscale/rgb2rgb.c444
-rw-r--r--libswscale/rgb2rgb.h161
-rw-r--r--libswscale/rgb2rgb_template.c3010
-rw-r--r--libswscale/sparc/yuv2rgb_vis.c212
-rw-r--r--libswscale/swscale-test.c260
-rw-r--r--libswscale/swscale.c1914
-rw-r--r--libswscale/swscale.h297
-rw-r--r--libswscale/swscale_internal.h460
-rw-r--r--libswscale/swscale_template.c3064
-rw-r--r--libswscale/utils.c1588
-rw-r--r--libswscale/x86/yuv2rgb_mmx.c101
-rw-r--r--libswscale/x86/yuv2rgb_template.c564
-rw-r--r--libswscale/yuv2rgb.c753
-rw-r--r--libvo/aclib.c2
-rw-r--r--libvo/aclib_template.c1
-rw-r--r--libvo/aspect.c146
-rw-r--r--libvo/aspect.h37
-rw-r--r--libvo/aspecttest.c1
-rw-r--r--libvo/font_load.h1
-rw-r--r--libvo/font_load_ft.c24
-rw-r--r--libvo/gl_common.c29
-rw-r--r--libvo/gl_common.h2
-rw-r--r--libvo/gtf.c2
-rw-r--r--libvo/mga_common.c57
-rw-r--r--libvo/old_vo_defines.h24
-rw-r--r--libvo/old_vo_wrapper.c116
-rw-r--r--libvo/old_vo_wrapper.h29
-rw-r--r--libvo/osd.c1
-rw-r--r--libvo/osx_common.c3
-rw-r--r--libvo/spuenc.c47
-rw-r--r--libvo/spuenc.h1
-rw-r--r--libvo/sub.c129
-rw-r--r--libvo/sub.h43
-rw-r--r--libvo/vdpau_template.c42
-rw-r--r--libvo/vesa_lvo.c22
-rw-r--r--libvo/vesa_lvo.h4
-rw-r--r--libvo/video_out.c395
-rw-r--r--libvo/video_out.h292
-rw-r--r--libvo/video_out_internal.h21
-rw-r--r--libvo/vo_3dfx.c20
-rw-r--r--libvo/vo_aa.c63
-rw-r--r--libvo/vo_bl.c2
-rw-r--r--libvo/vo_caca.c2
-rw-r--r--libvo/vo_corevideo.m4
-rw-r--r--libvo/vo_cvidix.c22
-rw-r--r--libvo/vo_dfbmga.c26
-rw-r--r--libvo/vo_dga.c2
-rw-r--r--libvo/vo_direct3d.c4
-rw-r--r--libvo/vo_directfb2.c22
-rw-r--r--libvo/vo_directx.c31
-rw-r--r--libvo/vo_dxr2.c17
-rw-r--r--libvo/vo_dxr3.c182
-rw-r--r--libvo/vo_fbdev.c26
-rw-r--r--libvo/vo_fbdev2.c2
-rw-r--r--libvo/vo_ggi.c12
-rw-r--r--libvo/vo_gif89a.c3
-rw-r--r--libvo/vo_gl.c54
-rw-r--r--libvo/vo_gl2.c43
-rw-r--r--libvo/vo_ivtv.c4
-rw-r--r--libvo/vo_jpeg.c49
-rw-r--r--libvo/vo_kva.c22
-rw-r--r--libvo/vo_matrixview.c32
-rw-r--r--libvo/vo_md5sum.c19
-rw-r--r--libvo/vo_mga.c5
-rw-r--r--libvo/vo_mpegpes.c11
-rw-r--r--libvo/vo_null.c4
-rw-r--r--libvo/vo_png.c79
-rw-r--r--libvo/vo_pnm.c55
-rw-r--r--libvo/vo_quartz.c2
-rw-r--r--libvo/vo_s3fb.c2
-rw-r--r--libvo/vo_sdl.c28
-rw-r--r--libvo/vo_svga.c51
-rw-r--r--libvo/vo_tdfx_vid.c45
-rw-r--r--libvo/vo_tdfxfb.c22
-rw-r--r--libvo/vo_tga.c4
-rw-r--r--libvo/vo_v4l2.c4
-rw-r--r--libvo/vo_vdpau.c2257
-rw-r--r--libvo/vo_vesa.c110
-rw-r--r--libvo/vo_wii.c2
-rw-r--r--libvo/vo_winvidix.c31
-rw-r--r--libvo/vo_x11.c35
-rw-r--r--libvo/vo_xmga.c11
-rw-r--r--libvo/vo_xover.c60
-rw-r--r--libvo/vo_xv.c947
-rw-r--r--libvo/vo_xvidix.c46
-rw-r--r--libvo/vo_xvmc.c30
-rw-r--r--libvo/vo_xvr100.c2
-rw-r--r--libvo/vo_yuv4mpeg.c64
-rw-r--r--libvo/vo_zr.c2
-rw-r--r--libvo/vo_zr2.c2
-rw-r--r--libvo/vosub_vidix.c90
-rw-r--r--libvo/vosub_vidix.h4
-rw-r--r--libvo/w32_common.c17
-rw-r--r--libvo/x11_common.c1003
-rw-r--r--libvo/x11_common.h194
-rw-r--r--loader/dmo/DMO_VideoDecoder.c1
-rw-r--r--loader/dshow/DS_VideoDecoder.c4
-rw-r--r--loader/ldt_keeper.c2
-rw-r--r--loader/qtx/qtxsdk/components.h2
-rw-r--r--loader/vfl.c1
-rw-r--r--loader/wrapper.S1
-rw-r--r--loader/wrapper.h1
-rw-r--r--m_config.c212
-rw-r--r--m_config.h7
-rw-r--r--m_option.c10
-rw-r--r--m_option.h29
-rw-r--r--m_property.c7
-rw-r--r--mencoder.c322
-rw-r--r--metadata.h5
-rw-r--r--mixer.c7
-rw-r--r--mp3lib/dct36.c1
-rw-r--r--mp3lib/dct64_sse.c3
-rw-r--r--mp3lib/layer1.c2
-rw-r--r--mp3lib/layer3.c2
-rw-r--r--mp3lib/sr1.c4
-rw-r--r--mp_core.h176
-rw-r--r--mp_fifo.c121
-rw-r--r--mp_fifo.h13
-rw-r--r--mp_msg-mencoder.c3
-rw-r--r--mp_msg.c100
-rw-r--r--mp_msg.h12
-rw-r--r--mp_osd.h6
-rw-r--r--mpbswap.h2
-rw-r--r--mpcommon.c60
-rw-r--r--mpcommon.h10
-rw-r--r--mplayer.c2526
-rw-r--r--mplayer.h23
-rw-r--r--options.h84
-rw-r--r--osdep/findfiles.c97
-rw-r--r--osdep/findfiles.h2
-rw-r--r--osdep/getch2-os2.c6
-rw-r--r--osdep/getch2-win.c6
-rw-r--r--osdep/getch2.c8
-rw-r--r--osdep/getch2.h3
-rw-r--r--osdep/mmap_anon.c2
-rw-r--r--osdep/mplayer.rc1
-rw-r--r--osdep/priority.c3
-rw-r--r--osdep/priority.h1
-rw-r--r--osdep/shmem.c2
-rw-r--r--osdep/timer-darwin.c18
-rw-r--r--osdep/timer-linux.c47
-rw-r--r--osdep/timer-win2.c14
-rw-r--r--osdep/timer.h9
-rw-r--r--parser-mecmd.c8
-rw-r--r--parser-mpcmd.c18
-rw-r--r--playtree.c18
-rw-r--r--playtree.h14
-rw-r--r--playtreeparser.c23
-rw-r--r--playtreeparser.h7
-rw-r--r--spudec.c23
-rw-r--r--spudec.h4
-rw-r--r--stream/ai_alsa.c26
-rw-r--r--stream/ai_alsa1x.c32
-rw-r--r--stream/ai_oss.c20
-rw-r--r--stream/asf_mmst_streaming.c57
-rw-r--r--stream/asf_streaming.c75
-rw-r--r--stream/audio_in.c12
-rw-r--r--stream/cache2.c15
-rw-r--r--stream/cdinfo.c6
-rw-r--r--stream/network.c44
-rw-r--r--stream/network.h3
-rw-r--r--stream/open.c4
-rw-r--r--stream/pnm.c2
-rw-r--r--stream/realrtsp/asmrp.c1
-rw-r--r--stream/realrtsp/real.c2
-rw-r--r--stream/realrtsp/rmff.c2
-rw-r--r--stream/realrtsp/sdpplin.c1
-rw-r--r--stream/stream.c55
-rw-r--r--stream/stream.h33
-rw-r--r--stream/stream_cdda.c6
-rw-r--r--stream/stream_cddb.c74
-rw-r--r--stream/stream_cue.c72
-rw-r--r--stream/stream_dvd.c52
-rw-r--r--stream/stream_dvd_common.c12
-rw-r--r--stream/stream_dvdnav.c6
-rw-r--r--stream/stream_ffmpeg.c2
-rw-r--r--stream/stream_file.c4
-rw-r--r--stream/stream_live555.c2
-rw-r--r--stream/stream_nemesi.c1
-rw-r--r--stream/stream_netstream.c6
-rw-r--r--stream/stream_radio.c147
-rw-r--r--stream/stream_radio.h12
-rw-r--r--stream/stream_rtsp.c2
-rw-r--r--stream/stream_smb.c4
-rw-r--r--stream/stream_vcd.c8
-rw-r--r--stream/stream_vstream.c4
-rw-r--r--stream/tcp.c20
-rw-r--r--stream/tv.c93
-rw-r--r--stream/tvi_bsdbt848.c62
-rw-r--r--stream/tvi_dshow.c84
-rw-r--r--stream/tvi_v4l.c4
-rw-r--r--stream/url.c22
-rw-r--r--stream/vcd_read.h2
-rw-r--r--stream/vcd_read_fbsd.h2
-rw-r--r--sub_cc.c1
-rw-r--r--sub_cc.h1
-rw-r--r--subdir.mak102
-rw-r--r--subopt-helper.c1
-rw-r--r--subreader.c5
-rw-r--r--subreader.h9
-rw-r--r--talloc.c1758
-rw-r--r--talloc.h183
-rw-r--r--unrar_exec.c1
-rwxr-xr-xversion.sh12
-rw-r--r--vidix/.gitignore5
-rw-r--r--vidix/drivers.c1
-rw-r--r--vidix/nvidia_vid.c5
-rw-r--r--vidix/sysdep/pci_alpha.c1
-rw-r--r--vobsub.h1
704 files changed, 18589 insertions, 68801 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..411891e554
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,17 @@
+*.o
+*.a
+*.d
+.depend
+
+/ffmpeg
+/config.h
+/config.mak
+/configure.log
+/help_mp.h
+/mencoder
+/mplayer
+/version.h
+/codecs.conf.h
+/codec-cfg
+/codec-cfg-test
+/codecs2html
diff --git a/Changelog b/Changelog
index 4418beb246..3b856cc4f6 100644
--- a/Changelog
+++ b/Changelog
@@ -41,8 +41,6 @@ MPlayer (1.0)
* -name, -title and -use-filename-title options for MPlayer
* support for stream handling via FFmpeg
Use e.g. ffmpeg://http://example.com/test
- * experimental support for external libass, configure with
- --disable-ass-internal
* better support for 16-bit-per-component formats and formats
with alpha channel.
* better out-of-the-box support for compiling for ARM, IA64,
diff --git a/DOCS/man/de/mplayer.1 b/DOCS/man/de/mplayer.1
index e0e0412b53..12a545157c 100644
--- a/DOCS/man/de/mplayer.1
+++ b/DOCS/man/de/mplayer.1
@@ -2193,7 +2193,6 @@ Siehe auch \-vf expand.
Schaltet das Zeichnen von SSA/ASS-Untertiteln ein.
Mit dieser Option wird libass für externe SSA/ASS-Untertitel und
Matroska-Spuren verwendet.
-Du möchtest vielleicht auch \-embeddedfonts verwenden.
.br
.I ANMERKUNG:
Wenn fontconfig eincompiliert wurde, schaltet \-ass automatisch \-fontconfig
@@ -2320,17 +2319,10 @@ Speichert den Untertitel-Substream eines VOB-Streams.
Siehe auch die Optionen \-dump*sub und \-vobsubout*.
.
.TP
-.B \-embeddedfonts (nur bei FreeType)
-Aktiviert die Extraktion von in Matroska eingebetteten Schriften (Standard:
-deaktiviert).
+.B \-noembeddedfonts
+Deaktiviert die Nutzung von in Matroska-Dateien und ASS-Untertiteln eingebetteten Schriften (Standard:
+aktiviert).
Diese Schriften können für das Rendern von SSA/ASS-Untertiteln verwendet werden
-(Option \-ass).
-Schriftdateien werden im Verzeichnis ~/.mplayer/\:fonts angelegt.
-.br
-.I ANMERKUNG:
-Bei der Verwendung von FontConfig 2.4.2 oder neuer werden eingebettete
-Schriften direkt vom Speicher geöffnet; diese Option ist per Voreinstellung
-aktiviert.
.
.TP
.B \-ffactor <Nummer>
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 600db5d0f0..6e9282ae25 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -124,11 +124,6 @@ tivo://host/[list|llist|fsid]
[options]
.
.br
-.B gmplayer
-[options]
-[\-skin\ skin]
-.
-.br
.B mencoder
[options] file
[file|URL|\-] [\-o file | file://file | smb://[user:pass@]host/filepath]
@@ -182,10 +177,7 @@ more.
.PP
.B gmplayer
is MPlayer with a graphical user interface.
-It has the same options as MPlayer, however they might not all work correctly
-due to conflicts with the configuration via the GUI (stored in gui.conf).
-In particular some options might be overwritten by settings in gui.conf while
-others might end up stored permanently in gui.conf.
+It has the same options as MPlayer.
.PP
Usage examples to get you started quickly can be found at the end
of this man page.
@@ -290,8 +282,10 @@ Show filename on the OSD.
Seek to the beginning of the previous/next chapter.
.IPs "D (\-vo xvmc, \-vo vdpau, \-vf yadif, \-vf kerndeint only)"
Activate/deactivate deinterlacer.
-.IPs "A"
+.IPs "A\ \ \ \ "
Cycle through the available DVD angles.
+.IPs "c (currently -vo vdpau and -vo xv only)"
+Change YUV colorspace.
.RE
.PD 1
.PP
@@ -365,30 +359,6 @@ Seek backward/\:forward 1 minute.
.PD 1
.PP
.RS
-(The following keys are only valid if GUI support is compiled in
-and will take precedence over the keys defined above.)
-.RE
-.PP
-.PD 0
-.RS
-.IPs ENTER
-Start playing.
-.IPs "ESC\ \ "
-Stop playing.
-.IPs "l\ \ \ \ "
-Load file.
-.IPs "t\ \ \ \ "
-Load subtitle.
-.IPs "c\ \ \ \ "
-Open skin browser.
-.IPs "p\ \ \ \ "
-Open playlist.
-.IPs "r\ \ \ \ "
-Open preferences.
-.RE
-.PD 1
-.PP
-.RS
(The following keys are only valid if you compiled with TV or DVB input
support and will take precedence over the keys defined above.)
.RE
@@ -723,8 +693,6 @@ Available options are:
.RSs
.IPs "all\ \ "
all configuration files
-.IPs "gui (GUI only)"
-GUI configuration file
.IPs system
system configuration file
.IPs "user\ "
@@ -760,7 +728,6 @@ Use the given profile(s), \-profile help displays a list of the defined profiles
.TP
.B \-really\-quiet (also see \-quiet)
Display even less output and status messages than with \-quiet.
-Also suppresses the GUI error message boxes.
.
.TP
.B \-show\-profile <profile>
@@ -834,8 +801,8 @@ xover, xv (see \-vo xv:ck), xvmc (see \-vo xv:ck) and directx video output
drivers.
.
.TP
-.B \-correct\-pts (EXPERIMENTAL)
-Switches MPlayer to an experimental mode where timestamps for video frames
+.B \-correct\-pts
+Switches MPlayer to a mode where timestamps for video frames
are calculated differently and video filters which add new frames or
modify timestamps of existing ones are supported.
The more accurate timestamps can be visible for example when playing
@@ -868,15 +835,12 @@ later.
See http://www.mplayerhq.hu/\:DOCS/\:HTML/\:en/\:edl.html for details.
.
.TP
-.B \-enqueue (GUI only)
-Enqueue files given on the command line in the playlist instead of playing them
-immediately.
-.
-.TP
-.B \-fixed\-vo
-Enforces a fixed video system for multiple files (one (un)initialization for
-all files).
+.B \-nofixed\-vo
+\-fixed\-vo enforces a fixed video system for multiple files (one
+(un)initialization for all files).
Therefore only one window will be opened for all files.
+Now enabled by default, use \-nofixed\-vo to disable and create a new window
+whenever the video stream changes.
Currently the following drivers are fixed-vo compliant: gl, gl2, mga, svga, x11,
xmga, xv, xvidix and dfbmga.
.
@@ -887,12 +851,6 @@ Video filters are not applied to such frames.
For B-frames even decoding is skipped completely.
.
.TP
-.B \-(no)gui
-Enable or disable the GUI interface (default depends on binary name).
-Only works as the first argument on the command line.
-Does not work as a config-file option.
-.
-.TP
.B \-h, \-help, \-\-help
Show short summary of options.
.
@@ -1077,6 +1035,26 @@ Turns off LIRC support.
.B \-nomouseinput
Disable mouse button press/\:release input (mozplayerxp's context menu relies
on this option).
+.TP
+.B \-noordered\-chapters
+Disable support for Matroska ordered chapters.
+MPlayer will not load or search for video segments from other files,
+and will also ignore any chapter order specified for the main file.
+.
+.TP
+.B \-pts\-association\-mode <mode number>
+Select the method used to determine which container packet timestamp
+corresponds to a particular output frame from the video decoder.
+.PD 0
+.RSs
+.IPs 0
+Try to pick a working mode from the ones below automatically (default)
+.IPs 1
+Use decoder reordering functionality.
+.IPs 2
+Maintain a buffer of unused pts values and use the lowest value for the frame.
+.RE
+.PD 1
.
.TP
.B \-rtc (RTC only)
@@ -1119,20 +1097,6 @@ Use the specified device for RTC timing.
Play files in random order.
.
.TP
-.B \-skin <name> (GUI only)
-Loads a skin from the directory given as parameter below the default skin
-directories, /usr/\:local/\:share/\:mplayer/\:skins/\: and ~/.mplayer/\:skins/.
-.sp 1
-.I EXAMPLE:
-.PD 0
-.RSs
-.IPs "\-skin fittyfene"
-Tries /usr/\:local/\:share/\:mplayer/\:skins/\:fittyfene
-and afterwards ~/.mplayer/\:skins/\:fittyfene.
-.RE
-.PD 1
-.
-.TP
.B \-slave (also see \-input)
Switches on slave mode, in which MPlayer works as a backend for other programs.
Instead of intercepting keyboard events, MPlayer will read commands separated
@@ -1335,6 +1299,12 @@ Specify which chapter to start playing at.
Optionally specify which chapter to end playing at (default: 1).
.
.TP
+.B \-edition <edition ID> (Matroska, MPlayer only)
+Specify the edition (set of chapters) to use, where 0 is the first. If set to
+-1 (the default), MPlayer will choose the first edition declared as a default,
+or if there is no default, the first edition defined.
+.
+.TP
.B \-cookies (network only)
Send cookies when making HTTP requests.
.
@@ -2100,7 +2070,6 @@ Also see \-vf expand.
Turn on SSA/ASS subtitle rendering.
With this option, libass will be used for SSA/ASS
external subtitles and Matroska tracks.
-You may also want to use \-embeddedfonts.
.br
.I NOTE:
Unlike normal OSD, libass uses fontconfig by default. To disable it, use
@@ -2157,7 +2126,7 @@ The same, but hinting will only be performed if the OSD is rendered at
screen resolution and will therefore not be scaled.
.RE
.RSs
-The default value is 7 (use native hinter for unscaled OSD and no hinting otherwise).
+The default value is 5 (use light hinter for unscaled OSD and no hinting otherwise).
.RE
.PD 1
.
@@ -2225,15 +2194,10 @@ Dumps the subtitle substream from VOB streams.
Also see the \-dump*sub and \-vobsubout* options.
.
.TP
-.B \-embeddedfonts (FreeType only)
-Enables extraction of Matroska embedded fonts (default: disabled).
+.B \-noembeddedfonts
+Disables use of fonts embedded in Matroska containers and ASS scripts (default: enabled).
These fonts can be used for SSA/ASS subtitle
rendering (\-ass option).
-Font files are created in the ~/.mplayer/\:fonts directory.
-.br
-.I NOTE:
-With FontConfig 2.4.2 or newer, embedded fonts are opened directly from memory,
-and this option is enabled by default.
.
.TP
.B \-ffactor <number>
@@ -3070,6 +3034,13 @@ VESA framebuffer does not support mode changing.
Override framebuffer mode configuration file (default: /etc/\:fb.modes).
.
.TP
+.B \-force\-window\-position
+Forcefully move MPlayer's video output window to default location whenever
+there is a change in video parameters, video stream or file.
+This used to be the default behavior.
+Currently only affects X11 VOs.
+.
+.TP
.B \-fs (also see \-zoom)
Fullscreen playback (centers movie, and paints black bands around it).
Not supported by all video output drivers.
@@ -3157,12 +3128,6 @@ Places the window at the bottom right corner of the screen.
.PD 1
.
.TP
-.B \-guiwid <window ID> (also see \-wid) (GUI only)
-This tells the GUI to also use an X11 window and stick itself to the bottom
-of the video, which is useful to embed a mini-GUI in a browser (with the
-MPlayer plugin for instance).
-.
-.TP
.B \-hue <\-100\-100>
Adjust the hue of the video signal (default: 0).
You can get a colored negative of the image with this option.
@@ -3220,8 +3185,12 @@ Useful for multihead setups.
.TP
.B \-nokeepaspect
Do not keep window aspect ratio when resizing windows.
-Only works with the x11, xv, xmga, xvidix, directx video output drivers.
-Furthermore under X11 your window manager has to honor window aspect hints.
+By default MPlayer tries to keep the correct video aspect ratio by
+instructing the window manager to maintain window aspect when resizing,
+and by adding black bars if the window manager nevertheless allows
+window shape to change.
+This option disables window manager aspect hints and scales the video
+to completely fill the window without regard for aspect ratio.
.
.TP
.B "\-ontop\ "
@@ -3307,7 +3276,7 @@ the new display mode.
Enables VBI for the vesa, dfbmga and svga video output drivers.
.
.TP
-.B \-wid <window ID> (also see \-guiwid) (X11, OpenGL and DirectX only)
+.B \-wid <window ID> (X11, OpenGL and DirectX only)
This tells MPlayer to attach to an existing window.
Useful to embed MPlayer in a browser (e.g.\& the plugger extension).
This option fills the given window completely, thus aspect scaling,
@@ -3538,11 +3507,26 @@ Use default VDPAU scaling (default).
.IPs 1\-9
Apply high quality VDPAU scaling (needs capable hardware).
.RE
-.IPs force\-mixer
-Forces the use of the VDPAU mixer, which implements all above options (default).
-Use noforce\-mixer to allow displaying BGRA colorspace.
-(Disables all above options and the hardware equalizer
-if image format BGRA is actually used.)
+.IPs fps=<number>
+Override autodetected display refresh rate value (the value is needed for framedrop to allow video playback rates higher than display refresh rate, and for vsync-aware frame timing adjustments).
+Default 0 means use autodetected value.
+A positive value is interpreted as a refresh rate in Hz and overrides the autodetected value.
+A negative value disables all timing adjustment and framedrop logic.
+.IPs queuetime_windowed=<number>
+.IPs queuetime_fs=<number>
+Use VDPAU's presentation queue functionality to queue future video frame
+changes at most this many milliseconds in advance (default: 50).
+This makes MPlayer's flip timing less sensitive to system CPU load and allows
+it to start decoding the next frame slightly earlier which can reduce jitter
+caused by individual slow-to-decode frames.
+However the NVIDIA graphics drivers can make other window behavior such as
+window moves choppy if VDPAU is using the blit queue (mainly happens
+if you have the composite extension enabled) and this feature is active.
+If this happens on your system and you care about it then you can set the
+time to 0 to disable this feature.
+The settings to use in windowed and fullscreen mode are separate because there
+should be less reason to disable this for fullscreen mode (as the driver issue
+shouldn't affect the video itself).
.RE
.PD 1
.
@@ -4429,8 +4413,6 @@ Each file takes the frame number padded with leading zeros as name.
.IPs z=<0\-9>
Specifies the compression level.
0 is no compression, 9 is maximum compression.
-.IPs outdir=<dirname>
-Specify the directory to save the PNG files to (default: ./).
.IPs alpha (default: noalpha)
Create PNG files with an alpha channel.
Note that MPlayer in general does not support alpha, so this will only
@@ -11190,14 +11172,6 @@ MEncoder user settings
input bindings (see '\-input keylist' for the full list)
.
.TP
-~/.mplayer/\:gui.conf
-GUI configuration file
-.
-.TP
-~/.mplayer/\:gui.pl
-GUI playlist
-.
-.TP
~/.mplayer/\:font/
font directory (There must be a font.desc file and files with .RAW extension.)
.
diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1
index ad7a42ac7b..6209931071 100644
--- a/DOCS/man/fr/mplayer.1
+++ b/DOCS/man/fr/mplayer.1
@@ -4644,8 +4644,6 @@ Ne gère que les formats RGB et BGR 24 bits/pixel.
.IPs z=<0\-9>
Définit le taux de compression.
0 équivaut à pas de compression et 9 à la compression maximale.
-.IPs outdir=<chemin>
-Définit le répertoire où sauver les fichiers PNG (par défaut\ ./).
.IPs alpha (par défaut\ : noalpha)
Crée un fichier PNG avec un canal alpha.
Notez que MPlayer ne gère en général pas les canaux alpha, donc cette
diff --git a/DOCS/tech/MAINTAINERS b/DOCS/tech/MAINTAINERS
index 7b7b1c710c..e2fcf01862 100644
--- a/DOCS/tech/MAINTAINERS
+++ b/DOCS/tech/MAINTAINERS
@@ -84,8 +84,6 @@ MPlayer code:
* playtree, input layer: Alban Bedel
* libswscale: Michael Niedermayer, Luca Abeni
* DVB support: Nico Sabbi
- * GUI: None
- * GUI skins: Diego Biurrun
* EDL code: Oded Shimon
Imported libs/projects:
diff --git a/DOCS/tech/binary-packaging.txt b/DOCS/tech/binary-packaging.txt
index 9d852372db..974a20d46f 100644
--- a/DOCS/tech/binary-packaging.txt
+++ b/DOCS/tech/binary-packaging.txt
@@ -66,9 +66,6 @@ the following features MUST be included in any official binary package:
(*) if available for your OS/hardware
-There is great demand for the GUI, so it SHOULD be included, but it MUST
-come as a separate package (see Tips and Tricks for details).
-
Including other features, like LIVE.COM streaming or JACK support, is
acceptable. They SHOULD, however, be build-time configurable, with the
default build configuration containing the above set.
@@ -111,7 +108,6 @@ for Red Hat and Fedora RPMs I am using FHS-compliant paths:
/usr/share/doc/mplayer-version/ docs
/usr/share/man/man1/ man page
/usr/share/man/XX/man1/ translated man page
-/usr/share/mplayer/skins/ GUI skins
You MUST NOT include the codecs.conf file in your package. It is useful
only for development purposes and often causes obscure problems for users.
@@ -129,13 +125,9 @@ install only what you need. This is the layout I am using for Red Hat and
Fedora RPMs:
mencoder contains MEncoder binary (mencoder)
-mplayer contains MPlayer binary without GUI (mplayer),
- config files, man pages and documentation;
- required by mplayer-gui
+mplayer contains MPlayer binary config files, man pages and
+ documentation;
mplayer-codecs-* contain binary codecs available from MPlayer's site
-mplayer-gui contains MPlayer binary with GUI (gmplayer);
- contains default skin (Blue)
-mplayer-skin-* contain various MPlayer GUI skins
There is no strict policy for now, just use your common sense.
@@ -200,14 +192,8 @@ ao=alsa,
Tips and tricks
~~~~~~~~~~~~~~~
-In my package layout, mplayer and mplayer-gui can be installed at the same
-time, because they contain differently named binaries and there is no
-conflict. The trick is to build MPlayer once with --enable-gui, rename the
-resulting binary to "gmplayer" and then build it again, without GUI, but
-keeping the rest of ./configure options the same.
-
-To provide man pages for all MPlayer suite binaries (mplayer, gmplayer,
-mencoder), you can use man-links instead of regular symbolic links.
+To provide man pages for all MPlayer suite binaries (mplayer, mencoder), you
+can use man-links instead of regular symbolic links.
Creating a mencoder man page linked to mplayer is as simple as:
echo ".so mplayer.1" >> mencoder.1
diff --git a/DOCS/tech/general.txt b/DOCS/tech/general.txt
index f4b7f0d713..631ee3f9de 100644
--- a/DOCS/tech/general.txt
+++ b/DOCS/tech/general.txt
@@ -226,4 +226,3 @@ Now, go on:
6.a audio plugins
for details on this, read libao2.txt
-
diff --git a/DOCS/tech/libmpcodecs.txt b/DOCS/tech/libmpcodecs.txt
index 22d29aaf98..5015f5dcc0 100644
--- a/DOCS/tech/libmpcodecs.txt
+++ b/DOCS/tech/libmpcodecs.txt
@@ -153,7 +153,7 @@ vf_info_t* info;
const char *name; // short name of the filter, must be FILTERNAME
const char *author; // name and email/URL of the author(s)
const char *comment; // comment, URL to papers describing algorithm etc.
- int (*open)(struct vf_instance_s* vf,char* args);
+ int (*open)(struct vf_instance* vf,char* args);
// pointer to the open() function:
Sample:
@@ -197,13 +197,13 @@ static int open(vf_instance_t *vf, char* args)
return 1;
}
-Functions in vf_instance_s:
+Functions in vf_instance:
NOTE: All these are optional, their function pointer is either NULL or points
to a default implementation. If you implement them, don't forget to set
vf->FUNCNAME in your open() !
- int (*query_format)(struct vf_instance_s* vf, unsigned int fmt);
+ int (*query_format)(struct vf_instance* vf, unsigned int fmt);
The query_format() function is called one or more times before the config(),
to find out the capabilities and/or support status of a given colorspace (fmt).
@@ -216,7 +216,7 @@ next filter will accept at least one of your possible output colorspaces!
Sample:
-static int query_format(struct vf_instance_s* vf, unsigned int fmt)
+static int query_format(struct vf_instance* vf, unsigned int fmt)
{
switch(fmt){
case IMGFMT_YV12:
@@ -232,7 +232,7 @@ For the more complex case, when you have an N -> M colorspace mapping matrix,
see vf_scale or vf_rgb2bgr for examples.
- int (*config)(struct vf_instance_s* vf,
+ int (*config)(struct vf_instance* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt);
@@ -257,7 +257,7 @@ Its parameters are already well-known from libvo:
Sample:
-static int config(struct vf_instance_s* vf,
+static int config(struct vf_instance* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt)
{
@@ -272,12 +272,12 @@ static int config(struct vf_instance_s* vf,
return vf_next_config(vf,vf->priv->w,vf->priv->h,d_width,d_height,flags,outfmt);
}
- void (*uninit)(struct vf_instance_s* vf);
+ void (*uninit)(struct vf_instance* vf);
Okay, uninit() is the simplest, it's called at the end. You can free your
private buffers etc here.
- int (*put_image)(struct vf_instance_s* vf, mp_image_t *mpi);
+ int (*put_image)(struct vf_instance* vf, mp_image_t *mpi);
Ah, put_image(). This is the main filter function, it should convert/filter/
transform the image data from one format/size/color/whatever to another.
@@ -332,7 +332,7 @@ image:
Ok, the rest is for advanced functionality only:
- int (*control)(struct vf_instance_s* vf, int request, void* data);
+ int (*control)(struct vf_instance* vf, int request, void* data);
You can control the filter at runtime from MPlayer/MEncoder/dec_video:
#define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
@@ -343,7 +343,7 @@ You can control the filter at runtime from MPlayer/MEncoder/dec_video:
#define VFCTRL_CHANGE_RECTANGLE 9 /* Change the rectangle boundaries */
- void (*get_image)(struct vf_instance_s* vf, mp_image_t *mpi);
+ void (*get_image)(struct vf_instance* vf, mp_image_t *mpi);
This is for direct rendering support, works the same way as in libvo drivers.
It makes in-place pixel modifications possible.
@@ -359,7 +359,7 @@ order, while put_image is called for display) so the only safe place to save
it is in the mpi struct itself: mpi->priv=(void*)dmpi;
- void (*draw_slice)(struct vf_instance_s* vf, unsigned char** src,
+ void (*draw_slice)(struct vf_instance* vf, unsigned char** src,
int* stride, int w,int h, int x, int y);
It's the good old draw_slice callback, already known from libvo.
diff --git a/DOCS/tech/libvo.txt b/DOCS/tech/libvo.txt
index e80f80d2fb..945aeab952 100644
--- a/DOCS/tech/libvo.txt
+++ b/DOCS/tech/libvo.txt
@@ -171,4 +171,3 @@ Each vo driver _has_ to implement these:
real. This is 'swapbuffers' when doublebuffering.
Try to do as little work here as possible, since that affect jitter/
A-V sync.
-
diff --git a/DOCS/tech/realcodecs/TODO b/DOCS/tech/realcodecs/TODO
index 00f20f13ac..5ba035bfdd 100644
--- a/DOCS/tech/realcodecs/TODO
+++ b/DOCS/tech/realcodecs/TODO
@@ -20,5 +20,3 @@ TODO:
also statistics->streams->video->POST FILTER: ON
(i've found that custommessage calls differ wiht pp on/off, but adding
these calls to mplayer didn't make a pixel difference between outputs)
-
-
diff --git a/DOCS/tech/realcodecs/audio-codecs.txt b/DOCS/tech/realcodecs/audio-codecs.txt
index 6d79815ac0..8a0d958354 100644
--- a/DOCS/tech/realcodecs/audio-codecs.txt
+++ b/DOCS/tech/realcodecs/audio-codecs.txt
@@ -153,6 +153,3 @@ output_buffer points to the output buffer from the last
decode operation.
retval is unknown, returning always 0x18 in a specific sample
-> further investigation needed
-
-
-
diff --git a/DOCS/tech/realcodecs/video-codecs.txt b/DOCS/tech/realcodecs/video-codecs.txt
index 5ef9a51961..2bef957172 100644
--- a/DOCS/tech/realcodecs/video-codecs.txt
+++ b/DOCS/tech/realcodecs/video-codecs.txt
@@ -183,5 +183,3 @@ Transform (internally calls (0x1c,x,y))
]
Free
-
-
diff --git a/DOCS/tech/slave.txt b/DOCS/tech/slave.txt
index bab7605621..96badf539f 100644
--- a/DOCS/tech/slave.txt
+++ b/DOCS/tech/slave.txt
@@ -270,6 +270,10 @@ set_mouse_pos <x> <y>
set_property <property> <value>
Set a property.
+set_property_osd <property> <value>
+ Same as above, but show the new value on the OSD in the standard
+ manner defined for that property (if any).
+
speed_incr <value>
Add <value> to the current playback speed.
@@ -284,6 +288,10 @@ step_property <property> [value] [direction]
not given or zero. The direction is reversed if direction is less
than zero.
+step_property_osd <property> [value] [direction]
+ Same as above, but show the new value on the OSD in the standard
+ manner defined for that property (if any).
+
stop
Stop playback.
@@ -555,4 +563,3 @@ teletext_format int 0 3 X X X 0 - opaque,
3 - transp. inv.
teletext_half_page int 0 2 X X X 0 - off, 1 - top half,
2- bottom half
-
diff --git a/DOCS/tech/snow.txt b/DOCS/tech/snow.txt
index db1b558cb9..be531fcb5c 100644
--- a/DOCS/tech/snow.txt
+++ b/DOCS/tech/snow.txt
@@ -87,4 +87,3 @@ vcodec=snow:vstrict=-2:vpass=2:vbitrate=$B:pred=0:cmp=12:subcmp=12:mbcmp=1:qpel:
Decent, fast options are
vcodec=snow:vstrict=-2:vpass=1:vbitrate=$B:pred=0:cmp=1:subcmp=1:mbcmp=1
vcodec=snow:vstrict=-2:vpass=2:vbitrate=$B:pred=0:cmp=2:subcmp=2:mbcmp=1:refs=2
-
diff --git a/DOCS/tech/subcp.txt b/DOCS/tech/subcp.txt
index df96f31e80..60c370771c 100644
--- a/DOCS/tech/subcp.txt
+++ b/DOCS/tech/subcp.txt
@@ -40,5 +40,3 @@ I tested charmap2enc script only with /usr/share/i18n/charmaps/EUC-KR.gz
--
Artur Zaprzala
-
-
diff --git a/DOCS/tech/swscaler_methods.txt b/DOCS/tech/swscaler_methods.txt
index e37227b982..b2c7077652 100644
--- a/DOCS/tech/swscaler_methods.txt
+++ b/DOCS/tech/swscaler_methods.txt
@@ -66,4 +66,3 @@ m mosaic (blocky) (upscale only)
Notes:
area upscale is identical to bilinear
-
diff --git a/DOCS/xml/en/documentation.xml b/DOCS/xml/en/documentation.xml
index c13e67890e..00afd76f06 100644
--- a/DOCS/xml/en/documentation.xml
+++ b/DOCS/xml/en/documentation.xml
@@ -176,4 +176,3 @@ can be distributed under the terms of the GNU General Public License Version 2.
&encoding-guide.xml;
&faq.xml;
&bugreports.xml;
-&skin.xml;
diff --git a/DOCS/xml/en/faq.xml b/DOCS/xml/en/faq.xml
index 83989dbf3a..9234ad7334 100644
--- a/DOCS/xml/en/faq.xml
+++ b/DOCS/xml/en/faq.xml
@@ -644,11 +644,7 @@ your configuration file. Add
<programlisting>
vo = <replaceable>selected_vo</replaceable>
</programlisting>
-to <filename>~/.mplayer/config</filename> and/or
-<programlisting>
-vo_driver = <replaceable>selected_vo</replaceable>
-</programlisting>
-to <filename>~/.mplayer/gui.conf</filename>.
+to <filename>~/.mplayer/config</filename>
</para></answer>
</qandaentry>
diff --git a/DOCS/xml/en/install.xml b/DOCS/xml/en/install.xml
index 21de5406bf..dd03e00377 100644
--- a/DOCS/xml/en/install.xml
+++ b/DOCS/xml/en/install.xml
@@ -106,10 +106,6 @@ answers.
<itemizedlist>
<listitem><para>
- Decide if you need GUI. If you do, see the <link linkend="gui">GUI</link>
- section before compiling.
-</para></listitem>
-<listitem><para>
If you want to install <application>MEncoder</application> (our great
all-purpose encoder), see the
<link linkend="mencoder"><application>MEncoder</application></link> section.
@@ -184,27 +180,10 @@ See the <link linkend="subosd">Subtitles and OSD</link> section for details.
<title>What about the GUI?</title>
<para>
-The GUI needs GTK 1.2.x or GTK 2.0 (it isn't fully GTK, but the panels are),
-so <systemitem class="library">GTK</systemitem> (and the devel stuff, usually
-called <systemitem class="library">gtk-dev</systemitem>) has to be installed.
-You can build it by specifying <option>--enable-gui</option> during
-<filename>./configure</filename>. Then, to turn on GUI mode, you have to
-execute the <command>gmplayer</command> binary.
-</para>
-
-<para>
-As <application>MPlayer</application> doesn't have a skin included, you
-have to download one if you want to use the GUI. See the <ulink
-url="http://www.mplayerhq.hu/dload.html">download page</ulink>.
-It should be extracted to the usual system-wide directory (<filename
-class="directory">$PREFIX/share/mplayer/skins</filename>), or to <filename
-class="directory">$HOME/.mplayer/skins</filename>.
-<application>MPlayer</application> by default looks in these directories
-for a directory named <filename class="directory">default</filename>, but
-you can use the <option>-skin <replaceable>newskin</replaceable></option>
-option, or the <literal>skin=newskin</literal> config file directive to use
-the skin in the <filename class="directory">*/skins/newskin</filename>
-directory.
+MPlayer used to have an internal GUI, but it was removed because it was
+buggy, unmaintained and there are much better alternatives. See <ulink
+url="http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends">the
+frontends page</ulink> for a list of existing GUIs.
</para>
</sect1>
diff --git a/DOCS/xml/en/skin.xml b/DOCS/xml/en/skin.xml
deleted file mode 100644
index 38feef6782..0000000000
--- a/DOCS/xml/en/skin.xml
+++ /dev/null
@@ -1,1200 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- $Revision$ -->
-<appendix id="skin">
-<title><application>MPlayer</application> skin format</title>
-
-<sect1 id="skin-overview">
-<title>Overview</title>
-
-<!-- ********** -->
-
-<sect2 id="skin-overview-components">
-<title>Skin components</title>
-
-<para>
-Skins are quite free-format (unlike the fixed-format skins of
-<application>Winamp</application>/<application>XMMS</application>,
-for example), so it is up to you to create something great.
-</para>
-
-<para>
-Currently there are four windows to be decorated: the
-<link linkend="skin-file-main">main window</link>, the
-<link linkend="skin-file-subwindow">subwindow</link>, the
-<link linkend="skin-file-main">playbar</link>, and the
-<link linkend="skin-file-menu">skin menu</link> (which can be activated
-by a right click).
-
-<itemizedlist>
-<listitem>
- <para>
- The <emphasis role="bold">main window</emphasis> and/or the
- <emphasis role="bold">playbar</emphasis> is where you can control
- <application>MPlayer</application>. The background of the window is an image.
- Various items can (and must) be placed in the window:
- <emphasis>buttons</emphasis>, <emphasis>potmeters</emphasis> (sliders) and
- <emphasis>labels</emphasis>.
- For every item, you must specify its position and size.
- </para>
-
- <para>
- A <emphasis role="bold">button</emphasis> has three states (pressed, released,
- disabled), thus its image must be divided into three parts vertically. See the
- <link linkend="skin-button">button</link> item for details.
- </para>
-
- <para>
- A <emphasis role="bold">potmeter</emphasis> (mainly used for the seek bar and
- volume/balance control) can have any number of phases by dividing its image
- into different parts below each other. See
- <link linkend="skin-hpotmeter">hpotmeter</link> and
- <link linkend="skin-potmeter">potmeter</link> for details.
- </para>
-
- <para>
- <emphasis role="bold">Labels</emphasis> are a bit special: The characters
- needed to draw them are taken from an image file, and the characters in the
- image are described by a
- <link linkend="skin-fonts">font description file</link>.
- The latter is a plain text file which specifies the x,y position and size of
- each character in the image (the image file and its font description file
- form a font <emphasis>together</emphasis>).
- See <link linkend="skin-dlabel">dlabel</link>
- and <link linkend="skin-slabel">slabel</link> for details.
- </para>
-
- <note><para>
- All images can have full transparency as described in the section about
- <link linkend="skin-overview-formats">image formats</link>. If the X server
- doesn't support the XShape extension, the parts marked transparent will be
- black. If you'd like to use this feature, the width of the main window's
- background image must be dividable by 8.
- </para></note>
-</listitem>
-
-<listitem><para>
- The <emphasis role="bold">subwindow</emphasis> is where the movie appears. It
- can display a specified image if there is no movie loaded (it is quite boring
- to have an empty window :-)) <emphasis role="bold">Note:</emphasis>
- transparency is <emphasis role="bold">not allowed</emphasis> here.
-</para></listitem>
-
-<listitem>
- <para>
- The <emphasis role="bold">skin menu</emphasis> is just a way to control
- <application>MPlayer</application> by means of menu entries. Two images
- are required for the menu: one of them is the base image that shows the
- menu in its normal state, the other one is used to display the selected
- entries. When you pop up the menu, the first image is shown. If you move
- the mouse over the menu entries, the currently selected entry is copied
- from the second image over the menu entry below the mouse pointer
- (the second image is never shown as a whole).
- </para>
- <para>
- A menu entry is defined by its position and size in the image (see the
- section about the <link linkend="skin-file-menu">skin menu</link> for
- details).
- </para>
-</listitem>
-</itemizedlist>
-</para>
-
-<para>
-There is an important thing not mentioned yet: For buttons, potmeters and
-menu entries to work, <application>MPlayer</application> must know what to
-do if they are clicked. This is done by <link linkend="skin-gui">messages</link>
-(events). For these items you must define the messages to be generated when
-they are clicked.
-</para>
-</sect2>
-
-<sect2 id="skin-overview-formats">
-<title>Image formats</title>
-
-<para>Images must be truecolor (24 or 32 bpp) PNGs.</para>
-<para>
-In the main window and in the playbar (see below) you can use images with
-`transparency': Regions filled with the color #FF00FF (magenta) are fully
-transparent when viewed by <application>MPlayer</application>. This means
-that you can even have shaped windows if your X server has the XShape extension.
-</para>
-</sect2>
-
-<!-- ********** -->
-
-<sect2 id="skin-files">
-<title>Files</title>
-
-<para>
-You need the following files to build a skin:
-<itemizedlist>
-<listitem><para>
- The configuration file named <link linkend="skin-file">skin</link> tells
- <application>MPlayer</application> how to put different parts of the skin
- together and what to do if you click somewhere in the window.
-</para></listitem>
-<listitem><para>
- The background image for the main window.
-</para></listitem>
-<listitem><para>
- Images for the items in the main window (including one or more font
- description files needed to draw labels).
-</para></listitem>
-<listitem><para>
- The image to be displayed in the subwindow (optional).
-</para></listitem>
-<listitem><para>
- Two images for the skin menu (they are needed only if you want to create
- a menu).
-</para></listitem>
-</itemizedlist>
- With the exception of the skin configuration file, you can name the other
- files whatever you want (but note that font description files must have
- a <filename>.fnt</filename> extension).
-</para>
-</sect2>
-</sect1>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-
-<sect1 id="skin-file">
-<title>The skin file</title>
-
-<para>
-As mentioned above, this is the skin configuration file. It is line oriented;
-comment lines start with a '<literal>;</literal>' character at the beginning of
-the line (only spaces and tabs are allowed before the '<literal>;</literal>').
-</para>
-
-<para>
-The file is made up of sections. Each section describes the skin for an
-application and has the following form:
-<programlisting>
-section = <replaceable>section name</replaceable>
-.
-.
-.
-end
-</programlisting>
-</para>
-
-<para>
-Currently there is only one application, so you need only one section: its name
-is <emphasis role="bold">movieplayer</emphasis>.
-</para>
-
-<para>
-Within this section each window is described by a block of the following form:
-<programlisting>
-window = <replaceable>window name</replaceable>
-.
-.
-.
-end
-</programlisting>
-</para>
-
-<para>
-where <replaceable>window name</replaceable> can be one of these strings:
-<itemizedlist>
-<listitem><para>
- <emphasis role="bold">main</emphasis> - for the main window
-</para></listitem>
-<listitem><para>
- <emphasis role="bold">sub</emphasis> - for the subwindow
-</para></listitem>
-<listitem><para>
- <emphasis role="bold">menu</emphasis> - for the skin menu
-</para></listitem>
-<listitem><para>
- <emphasis role="bold">playbar</emphasis> - playbar
-</para></listitem>
-</itemizedlist>
-</para>
-
-<para>
-(The sub and menu blocks are optional - you do not need to create a menu or
-decorate the subwindow.)
-</para>
-
-<para>
-Within a window block, you can define each item for the window by a line in
-this form:
-<programlisting>item = parameter</programlisting>
-Where <literal>item</literal> is a string that identifies the type of the GUI
-item, <literal>parameter</literal> is a numeric or textual value (or a list of
-values separated by commas).
-</para>
-
-<para>
-Putting the above together, the whole file looks something like this:
-<programlisting>
-section = movieplayer
- window = main
- ; ... items for main window ...
- end
-
- window = sub
- ; ... items for subwindow ...
- end
-
- window = menu
- ; ... items for menu ...
- end
-
- window = playbar
- ; ... items for playbar ...
- end
-end
-</programlisting>
-</para>
-
-<para>
-The name of an image file must be given without leading directories - images
-are searched for in the <filename class="directory">skins</filename> directory.
-You may (but you need not) specify the extension of the file. If the file does
-not exist, <application>MPlayer</application> tries to load the file
-<filename>&lt;filename&gt;.&lt;ext&gt;</filename>, where <literal>png</literal>
-and <literal>PNG</literal> are tried for <filename>&lt;ext&gt;</filename>
-(in this order). The first matching file will be used.
-</para>
-
-<para>
-Here is an example to make this clear. Suppose that you have an image called
-<filename>main.png</filename> that you use for the main window:
-<programlisting>base = main, -1, -1</programlisting>
-<application>MPlayer</application> tries to load <filename>main</filename>,
-<filename>main.png</filename>, <filename>main.PNG</filename> files.
-</para>
-
-<para>
-Finally some words about positioning. The main window and the subwindow can be
-placed in the different corners of the screen by giving <literal>X</literal>
-and <literal>Y</literal> coordinates. <literal>0</literal> is top or left,
-<literal>-1</literal> is center and <literal>-2</literal> is right or bottom, as
-shown in this illustration:
-<informalfigure>
-<screen>
-(0, 0)----(-1, 0)----(-2, 0)
- | | |
- | | |
-(0,-1)----(-1,-1)----(-2,-1)
- | | |
- | | |
-(0,-2)----(-1,-2)----(-2,-2)
-</screen>
-</informalfigure>
-</para>
-
-<!-- ********** -->
-
-<sect2 id="skin-file-main">
-<title>Main window and playbar</title>
-
-<para>
-Below is the list of entries that can be used in the
-'<literal>window = main</literal>' ... '<literal>end</literal>',
-and the '<literal>window = playbar</literal>' ... '<literal>end</literal>'
-blocks.
-</para>
-
-<variablelist>
-<varlistentry>
- <term><literal>
- <anchor id="skin-main-base"/>base = image, X, Y
- </literal></term>
- <listitem>
- <para>
- Lets you specify the background image to be used for the main window.
- The window will appear at the given <literal>X,Y</literal> position on
- the screen The window will have the size of the image.
- </para>
- <note><para>
- These coordinates do not currently work for the display window.
- </para></note>
- <warning><para>Transparent regions in the image (colored #FF00FF) appear black
- on X servers without the XShape extension. The image's width must be dividable
- by 8.</para></warning>
- </listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-button"/>button = image, X, Y, width, height, message
- </literal></term>
- <listitem>
- <para>
- Place a button of <literal>width</literal> * <literal>height</literal> size at
- position <literal>X,Y</literal>. The specified <literal>message</literal> is
- generated when the button is clicked. The image given by
- <literal>image</literal> must have three parts below each other (according to
- the possible states of the button), like this:
- </para>
- <informalfigure>
- <screen>
-+------------+
-| pressed |
-+------------+
-| released |
-+------------+
-| disabled |
-+------------+<!--
- --></screen>
- </informalfigure>
- </listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-decoration"/>decoration = enable|disable
- </literal></term>
- <listitem>
- <para>
- Enable or disable window manager decoration of the main window. Default is
- <emphasis role="bold">disable</emphasis>.
- </para>
- <note><para>
- This doesn't work for the display window, there is no need to.
- </para></note>
- </listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-hpotmeter"/>hpotmeter = button, bwidth, bheight, phases, numphases, default, X, Y, width, height, message
- </literal></term>
- <listitem><para>
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-vpotmeter"/>vpotmeter = button, bwidth, bheight, phases, numphases, default, X, Y, width, height, message
- </literal></term>
- <listitem><para>
- Place a horizontal (hpotmeter) or vertical (vpotmeter) potmeter of
- <literal>width</literal> * <literal>height</literal> size at position
- <literal>X,Y</literal>. The image can be divided into different parts for the
- different phases of the potmeter (for example, you can have a pot for volume
- control that turns from green to red while its value changes from the minimum
- to the maximum.). <literal>hpotmeter</literal> can have a button that can be
- dragged horizontally. The parameters are:
- <itemizedlist>
- <listitem><para>
- <literal>button</literal> - the image to be used for the
- button (must have three parts below each other, like in case of
- <link linkend="skin-button">button</link>)
- </para></listitem>
- <listitem><para>
- <literal>bwidth</literal>, <literal>bheight</literal> - size
- of the button
- </para></listitem>
- <listitem><para>
- <literal>phases</literal> - the image to be used for the
- different phases of the hpotmeter. A special value of <literal>NULL</literal>
- can be used if you want no such image. The image must be divided into
- <literal>numphases</literal> parts vertically like this:
- <informalfigure><screen>
-+------------+
-| phase #1 |
-+------------+
-| phase #2 |
-+------------+
- ...
-+------------+
-| phase #n |
-+------------+<!--
- --></screen></informalfigure>
- </para></listitem>
- <listitem><para>
- <literal>numphases</literal> - number of phases stored in the
- <literal>phases</literal> image
- </para></listitem>
- <listitem><para>
- <literal>default</literal> - default value for hpotmeter
- (in the range <literal>0</literal> to <literal>100</literal>)
- </para></listitem>
- <listitem><para>
- <literal>X</literal>, <literal>Y</literal> - position for the hpotmeter
- </para></listitem>
- <listitem><para>
- <literal>width</literal>, <literal>height</literal> - width and height
- of the <literal>hpotmeter</literal>
- </para></listitem>
- <listitem><para>
- <literal>message</literal> - the message to be generated when the
- value of <literal>hpotmeter</literal> is changed
- </para></listitem>
- </itemizedlist>
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-potmeter"/>potmeter = phases, numphases, default, X, Y, width, height, message
- </literal></term>
- <listitem><para>
- A <literal>hpotmeter</literal> without a button. (I guess it is meant to be
- turned around, but it reacts to horizontal dragging only.) For the description
- of the parameters see <link linkend="skin-hpotmeter">hpotmeter</link>.
- <literal>phases</literal> can be <literal>NULL</literal>, but it is quite
- useless, since you cannot see where the <literal>potmeter</literal> is set.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-font"/>font = fontfile, fontid
- </literal></term>
- <listitem><para>
- Defines a font. <literal>fontfile</literal> is the name of a font description
- file with a <filename>.fnt</filename> extension (do not specify the extension
- here). <literal>fontid</literal> is used to refer to the font
- (see <link linkend="skin-dlabel">dlabel</link>
- and <link linkend="skin-slabel">slabel</link>). Up to 25 fonts can be defined.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-slabel"/>slabel = X, Y, fontid, "text"
- </literal></term>
- <listitem><para>
- Place a static label at the position <literal>X,Y</literal>.
- <literal>text</literal> is displayed using the font identified by
- <literal>fontid</literal>. The text is just a raw string
- (<literal>$x</literal> variables do not work) that must be enclosed between
- double quotes (but the " character cannot be part of the text). The
- label is displayed using the font identified by <literal>fontid</literal>.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-dlabel"/>dlabel = X, Y, length, align, fontid, "text"
- </literal></term>
- <listitem>
- <para>
- Place a dynamic label at the position <literal>X,Y</literal>. The label is
- called dynamic because its text is refreshed periodically. The maximum length
- of the label is given by <literal>length</literal> (its height is the height
- of a character). If the text to be displayed is wider than that, it will be
- scrolled,
- otherwise it is aligned within the specified space by the value of the
- <literal>align</literal> parameter: <literal>0</literal> is for right,
- <literal>1</literal> is for center, <literal>2</literal> is for left.
- </para>
- <para>
- The text to be displayed is given by <literal>text</literal>: It must be
- written between double quotes (but the " character cannot be part of the
- text). The label is displayed using the font identified by
- <literal>fontid</literal>. You can use the following variables in the text:
- </para>
-
- <informaltable>
- <tgroup cols="2">
- <thead>
- <row><entry>Variable</entry><entry>Meaning</entry></row>
- </thead>
- <tbody>
- <row>
- <entry>$1</entry>
- <entry>play time in <emphasis>hh:mm:ss</emphasis> format</entry>
- </row>
- <row>
- <entry>$2</entry>
- <entry>play time in <emphasis>mmmm:ss</emphasis> format</entry>
- </row>
- <row>
- <entry>$3</entry>
- <entry>play time in <emphasis>hh</emphasis> format (hours)</entry>
- </row>
- <row>
- <entry>$4</entry>
- <entry>play time in <emphasis>mm</emphasis> format (minutes)</entry>
- </row>
- <row>
- <entry>$5</entry>
- <entry>play time in <emphasis>ss</emphasis> format (seconds)</entry>
- </row>
- <row>
- <entry>$6</entry>
- <entry>movie length in <emphasis>hh:mm:ss</emphasis> format</entry>
- </row>
- <row>
- <entry>$7</entry>
- <entry>movie length in <emphasis>mmmm:ss</emphasis> format</entry>
- </row>
- <row>
- <entry>$8</entry>
- <entry>play time in <emphasis>h:mm:ss</emphasis> format</entry>
- </row>
- <row>
- <entry>$v</entry>
- <entry>volume in <emphasis>xxx.xx</emphasis>% format</entry>
- </row>
- <row>
- <entry>$V</entry>
- <entry>volume in <emphasis>xxx.xx</emphasis> format</entry>
- </row>
- <row>
- <entry>$b</entry>
- <entry>balance in <emphasis>xxx.xx</emphasis>% format</entry>
- </row>
- <row>
- <entry>$B</entry>
- <entry>balance in <emphasis>xxx.xx</emphasis> format</entry>
- </row>
- <row>
- <entry>$$</entry>
- <entry>the $ character</entry>
- </row>
- <row>
- <entry>$a</entry>
- <entry>a character according to the audio type (none: <literal>n</literal>,
- mono: <literal>m</literal>, stereo: <literal>t</literal>)</entry>
- </row>
- <row>
- <entry>$t</entry>
- <entry>track number (in playlist)</entry>
- </row>
- <row>
- <entry>$o</entry>
- <entry>filename</entry>
- </row>
- <row>
- <entry>$f</entry>
- <entry>filename in lower case</entry>
- </row>
- <row>
- <entry>$F</entry>
- <entry>filename in upper case</entry>
- </row>
- <row>
- <entry>$T</entry>
- <entry>
- a character according to the stream type (file: <literal>f</literal>,
- Video CD: <literal>v</literal>, DVD: <literal>d</literal>,
- URL: <literal>u</literal>)
- </entry>
- </row>
- <row>
- <entry>$p</entry>
- <entry>the <keycap>p</keycap> character (if a movie is playing and the font
- has the <keycap>p</keycap> character)</entry>
- </row>
- <row>
- <entry>$s</entry>
- <entry>the <keycap>s</keycap> character (if the movie is stopped and the
- font has the <keycap>s</keycap> character)</entry>
- </row>
- <row>
- <entry>$e</entry>
- <entry>the <keycap>e</keycap> character (if playback is paused and the font
- has the <keycap>e</keycap> character)</entry>
- </row>
- <row>
- <entry>$x</entry>
- <entry>movie width</entry>
- </row>
- <row>
- <entry>$y</entry>
- <entry>movie height</entry>
- </row>
- <row>
- <entry>$C</entry>
- <entry>name of the codec used</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
-
- <note><para>
- The <literal>$a, $T, $p, $s</literal> and <literal>$e</literal>
- variables all return characters that should be displayed as special symbols
- (for example, <keycap>e</keycap> is for the pause symbol that usually looks
- something like ||). You should have a font for normal characters and
- a different font for symbols. See the section about
- <link linkend="skin-fonts-symbols">symbols</link> for more information.
- </para></note>
- </listitem>
-</varlistentry>
-</variablelist>
-</sect2>
-
-<!-- ********** -->
-
-<sect2 id="skin-file-subwindow">
-<title>Subwindow</title>
-
-<para>
-The following entries can be used in the
-'<literal>window = sub</literal>' . . . '<literal>end</literal>' block.
-</para>
-
-<variablelist>
-<varlistentry>
- <term><literal>
- <anchor id="skin-sub-base"/>base = image, X, Y, width, height
- </literal></term>
- <listitem><para>
- The image to be displayed in the window. The window will appear at the given
- <literal>X,Y</literal> position on the screen (<literal>0,0</literal> is the
- top left corner). You can specify <literal>-1</literal> for center and
- <literal>-2</literal> for right (<literal>X</literal>) and bottom
- (<literal>Y</literal>). The window will be as large as the image.
- <literal>width</literal> and <literal>height</literal>
- denote the size of the window; they are optional (if they are missing, the
- window is the same size as the image).
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-background"/>background = R, G, B
- </literal></term>
- <listitem><para>
- Lets you set the background color. It is useful if the image is smaller than
- the window. <literal>R</literal>, <literal>G</literal> and
- <literal>B</literal> specifies the red, green and blue component of the color
- (each of them is a decimal number from 0 to 255).
- </para></listitem>
-</varlistentry>
-</variablelist>
-</sect2>
-
-<!-- ********** -->
-
-<sect2 id="skin-file-menu">
-<title>Skin menu</title>
-
-<para>
-As mentioned earlier, the menu is displayed using two images. Normal menu
-entries are taken from the image specified by the <literal>base</literal> item,
-while the currently selected entry is taken from the image specified by the
-<literal>selected</literal> item. You must define the position and size of each
-menu entry through the menu item.
-</para>
-
-<para>
-The following entries can be used in the
-'<literal>window = menu</literal>'. . .'<literal>end</literal>' block.
-</para>
-
-<variablelist>
-<varlistentry>
- <term><literal>
- <anchor id="skin-menu-base"/>base = image
- </literal></term>
- <listitem><para>
- The image for normal menu entries.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-selected"/>selected = image
- </literal></term>
- <listitem><para>
- The image showing the menu with all entries selected.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><literal>
- <anchor id="skin-menu"/>menu = X, Y, width, height, message
- </literal></term>
- <listitem><para>
- Defines the <literal>X,Y</literal> position and the size of a menu entry in
- the image. <literal>message</literal> is the message to be generated when the
- mouse button is released over the entry.
- </para></listitem>
-</varlistentry>
-</variablelist>
-</sect2>
-</sect1>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-
-<sect1 id="skin-fonts">
-<title>Fonts</title>
-<para>
-As mentioned in the section about the parts of a skin, a font is defined by an
-image and a description file. You can place the characters anywhere in the
-image, but make sure that their position and size is given in the description
-file exactly.
-</para>
-
-<para>
-The font description file (with <filename>.fnt</filename> extension) can have
-comment lines starting with '<literal>;</literal>'. The file must have a line
-in the form
-<anchor id="skin-font-image"/>
-<programlisting>image = <replaceable>image</replaceable></programlisting>
-Where <literal><replaceable>image</replaceable></literal> is the name of the
-image file to be used for the font (you do not have to specify the extension).
-<anchor id="skin-font-char"/>
-<programlisting>"char" = X, Y, width, height</programlisting>
-Here <literal>X</literal> and <literal>Y</literal> specify the position of the
-<literal>char</literal> character in the image (<literal>0,0</literal> is the
-upper left corner). <literal>width</literal> and <literal>height</literal> are
-the dimensions of the character in pixels.
-</para>
-
-<para>
-This example defines the A, B, C characters using <filename>font.png</filename>.
-<programlisting>
-; Can be "font" instead of "font.png".
-image = font.png
-
-; Three characters are enough for demonstration purposes :-)
-"A" = 0,0, 7,13
-"B" = 7,0, 7,13
-"C" = 14,0, 7,13
-</programlisting>
-</para>
-
-<!-- ********** -->
-
-<sect2 id="skin-fonts-symbols">
-<title>Symbols</title>
-
-<para>
-Some characters have special meanings when returned by some of the variables
-used in <link linkend="skin-dlabel">dlabel</link>. These characters are meant
-to be shown as symbols so that things like a nice DVD logo can be displayed
-instead of the character '<literal>d</literal>' for a DVD stream.
-</para>
-
-<para>
-The following table lists all the characters that can be used to display
-symbols (and thus require a different font).
-</para>
-
-<informaltable>
-<tgroup cols="2">
-<thead>
- <row><entry>Character</entry><entry>Symbol</entry></row>
-</thead>
-<tbody>
- <row><entry><keycap>p</keycap></entry><entry>play</entry></row>
- <row><entry><keycap>s</keycap></entry><entry>stop</entry></row>
- <row><entry><keycap>e</keycap></entry><entry>pause</entry></row>
- <row><entry><keycap>n</keycap></entry><entry>no sound</entry></row>
- <row><entry><keycap>m</keycap></entry><entry>mono sound</entry></row>
- <row><entry><keycap>t</keycap></entry><entry>stereo sound</entry></row>
- <row><entry><keycap>f</keycap></entry><entry>stream is a file</entry></row>
- <row><entry><keycap>v</keycap></entry><entry>stream is a Video CD</entry></row>
- <row><entry><keycap>d</keycap></entry><entry>stream is a DVD</entry></row>
- <row><entry><keycap>u</keycap></entry><entry>stream is a URL</entry></row>
-</tbody>
-</tgroup>
-</informaltable>
-</sect2>
-</sect1>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-
-<sect1 id="skin-gui">
-<title>GUI messages</title>
-
-<para>
-These are the messages that can be generated by buttons, potmeters and
-menu entries.
-</para>
-
-<variablelist>
-<title>Playback control:</title>
-<varlistentry>
- <term><emphasis role="bold">evNext</emphasis></term>
- <listitem><para>
- Jump to next track in the playlist.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evPause</emphasis></term>
- <listitem><para>
- Forms a switch together with <literal>evPlaySwitchToPause</literal>. They can
- be used to have a common play/pause button. Both messages should be assigned
- to buttons displayed at the very same position in the window. This message
- pauses playing and the image for the <literal>evPlaySwitchToPause</literal>
- button is displayed (to indicate that the button can be pressed to continue
- playing).
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evPlay</emphasis></term>
- <listitem><para>
- Start playing.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evPlaySwitchToPause</emphasis></term>
- <listitem><para>
- The opposite of <literal>evPauseSwitchToPlay</literal>. This message starts
- playing and the image for the <literal>evPauseSwitchToPlay</literal> button
- is displayed (to indicate that the button can be pressed to pause playing).
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evPrev</emphasis></term>
- <listitem><para>
- Jump to previous track in the playlist.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evStop</emphasis></term>
- <listitem><para>
- Stop playing.
- </para></listitem>
-</varlistentry>
-</variablelist>
-
-<variablelist>
-<title>Seeking:</title>
-<varlistentry>
- <term><emphasis role="bold">evBackward10sec</emphasis></term>
- <listitem><para>
- Seek backward 10 seconds.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evBackward1min</emphasis></term>
- <listitem><para>
- Seek backward 1 minute.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evBackward10min</emphasis></term>
- <listitem><para>
- Seek backward 10 minutes.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evForward10sec</emphasis></term>
- <listitem><para>
- Seek forward 10 seconds.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evForward1min</emphasis></term>
- <listitem><para>
- Seek forward 1 minute.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evForward10min</emphasis></term>
- <listitem><para>
- Seek forward 10 minutes.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evSetMoviePosition</emphasis></term>
- <listitem><para>
- Seek to position (can be used by a potmeter; the
- relative value (0-100%) of the potmeter is used).
- </para></listitem>
-</varlistentry>
-</variablelist>
-
-<variablelist>
-<title>Video control:</title>
-<varlistentry>
- <term><emphasis role="bold">evHalfSize</emphasis></term>
- <listitem><para>
- Set the movie window to half size.
- </para></listitem>
-</varlistentry>
-<varlistentry>
- <term><emphasis role="bold">evDoubleSize</emphasis></term>
- <listitem><para>
- Set the movie window to double size.
- </para></listitem>
-</varlistentry>
-<varlistentry>
- <term><emphasis role="bold">evFullScreen</emphasis></term>
- <listitem><para>
- Switch fullscreen mode on/off.
- </para></listitem>
-</varlistentry>
-<varlistentry>
- <term><emphasis role="bold">evNormalSize</emphasis></term>
- <listitem><para>
- Set the movie window to its normal size.
- </para></listitem>
-</varlistentry>
-</variablelist>
-
-<variablelist>
-<title>Audio control:</title>
-<varlistentry>
- <term><emphasis role="bold">evDecAudioBufDelay</emphasis></term>
- <listitem><para>
- Decrease audio buffer delay.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evDecBalance</emphasis></term>
- <listitem><para>
- Decrease balance.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evDecVolume</emphasis></term>
- <listitem><para>
- Decrease volume.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evIncAudioBufDelay</emphasis></term>
- <listitem><para>
- Increase audio buffer delay.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evIncBalance</emphasis></term>
- <listitem><para>
- Increase balance.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evIncVolume</emphasis></term>
- <listitem><para>
- Increase volume.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evMute</emphasis></term>
- <listitem><para>
- Mute/unmute the sound.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evSetBalance</emphasis></term>
- <listitem><para>
- Set balance (can be used by a potmeter; the
- relative value (0-100%) of the potmeter is used).
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evSetVolume</emphasis></term>
- <listitem><para>
- Set volume (can be used by a potmeter; the relative
- value (0-100%) of the potmeter is used).
- </para></listitem>
-</varlistentry>
-</variablelist>
-
-<variablelist>
-<title>Miscellaneous:</title>
-<varlistentry>
- <term><emphasis role="bold">evAbout</emphasis></term>
- <listitem><para>
- Open the about window.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evDropSubtitle</emphasis></term>
- <listitem><para>
- Disables the currently used subtitle.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evEqualizer</emphasis></term>
- <listitem><para>
- Turn the equalizer on/off.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evExit</emphasis></term>
- <listitem><para>
- Quit the program.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evIconify</emphasis></term>
- <listitem><para>
- Iconify the window.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evLoad</emphasis></term>
- <listitem><para>
- Load a file (by opening a file browser window, where you can choose a file).
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evLoadPlay</emphasis></term>
- <listitem><para>
- Does the same as <literal>evLoad</literal>, but it automatically starts
- playing after the file is loaded.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evLoadSubtitle</emphasis></term>
- <listitem><para>
- Loads a subtitle file (with the file selector).
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evLoadAudioFile</emphasis></term>
- <listitem><para>
- Loads an audio file (with the file selector).
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evNone</emphasis></term>
- <listitem><para>
- Empty message, it has no effect (except maybe in Subversion versions :-)).
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evPlaylist</emphasis></term>
- <listitem><para>
- Open/close the playlist window.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evPlayDVD</emphasis></term>
- <listitem><para>
- Tries to open the disc in the given DVD-ROM drive.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evPlayVCD</emphasis></term>
- <listitem><para>
- Tries to open the disc in the given CD-ROM drive.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evPreferences</emphasis></term>
- <listitem><para>
- Open the preferences window.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evSetAspect</emphasis></term>
- <listitem><para>
- Sets displayed image aspect.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evSetURL</emphasis></term>
- <listitem><para>
- Displays the URL dialog window.
- </para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><emphasis role="bold">evSkinBrowser</emphasis></term>
- <listitem><para>
- Open the skin browser window.
- </para></listitem>
-</varlistentry>
-</variablelist>
-</sect1>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-
-<sect1 id="skin-quality">
-<title>Creating quality skins</title>
-
-<para>
-So you have read up on creating skins for the
-<application>MPlayer</application> GUI, done your best with the
-<application>Gimp</application> and wish to submit your skin to us?
-Read on for some guidelines to avoid common mistakes and produce
-a high quality skin.
-</para>
-
-<para>
-We want skins that we add to our repository to conform to certain
-quality standards. There are also a number of things that you can do
-to make our lives easier.
-</para>
-
-<para>
-As an example you can look at the <systemitem>Blue</systemitem> skin,
-it satisfies all the criteria listed below since version 1.5.
-</para>
-
-<itemizedlist>
-<listitem><para>
- Each skin should come with a
- <filename>README</filename> file that contains information about
- you, the author, copyright and license notices and anything else
- you wish to add. If you wish to have a changelog, this file is a
- good place.
-</para></listitem>
-
-<listitem><para>
- There should be a file <filename>VERSION</filename>
- with nothing more than the version number of the skin on a single
- line (e.g. 1.0).
-</para></listitem>
-
-<listitem><para>
- Horizontal and vertical controls (sliders like volume
- or position) should have the center of the knob properly centered on
- the middle of the slider. It should be possible to move the knob to
- both ends of the slider, but not past it.
-</para></listitem>
-
-<listitem><para>
- Skin elements should have the right sizes declared
- in the skin file. If this is not the case you can click outside of
- e.g. a button and still trigger it or click inside its area and not
- trigger it.
-</para></listitem>
-
-<listitem><para>
- The <filename>skin</filename> file should be
- prettyprinted and not contain tabs. Prettyprinted means that the
- numbers should line up neatly in columns.
-</para></listitem>
-</itemizedlist>
-
-</sect1>
-</appendix>
diff --git a/DOCS/xml/ldp.dsl b/DOCS/xml/ldp.dsl
index ef52e849de..20bc32277b 100644
--- a/DOCS/xml/ldp.dsl
+++ b/DOCS/xml/ldp.dsl
@@ -362,4 +362,3 @@
<external-specification id="docbook" document="docbook.dsl">
</style-sheet>
-
diff --git a/DOCS/xml/ru/ports.xml b/DOCS/xml/ru/ports.xml
index 20ddafe126..181b204b8c 100644
--- a/DOCS/xml/ru/ports.xml
+++ b/DOCS/xml/ru/ports.xml
@@ -868,5 +868,3 @@ MPlayer_source_directory
</sect2>
</sect1>
</chapter>
-
-
diff --git a/Makefile b/Makefile
index a3971dda5c..da5172ef7d 100644
--- a/Makefile
+++ b/Makefile
@@ -115,20 +115,8 @@ SRCS_COMMON-$(LIBA52_INTERNAL) += liba52/crc.c \
liba52/imdct.c \
liba52/parse.c \
-SRCS_COMMON-$(LIBASS) += libmpcodecs/vf_ass.c \
- libass/ass_mp.c \
-
-SRCS_COMMON-$(LIBASS_INTERNAL) += libass/ass.c \
- libass/ass_bitmap.c \
- libass/ass_cache.c \
- libass/ass_drawing.c \
- libass/ass_font.c \
- libass/ass_fontconfig.c \
- libass/ass_library.c \
- libass/ass_parse.c \
- libass/ass_render.c \
- libass/ass_strtod.c \
- libass/ass_utils.c \
+SRCS_COMMON-$(LIBASS) += ass_mp.c \
+ libmpcodecs/vf_ass.c \
SRCS_COMMON-$(LIBAVCODEC) += av_opts.c \
libaf/af_lavcresample.c \
@@ -137,15 +125,15 @@ SRCS_COMMON-$(LIBAVCODEC) += av_opts.c \
libmpcodecs/vf_lavc.c \
libmpcodecs/vf_lavcdeint.c \
libmpcodecs/vf_screenshot.c \
+ libmpcodecs/vf_uspp.c \
# These filters use private headers and do not work with shared libavcodec.
-SRCS_COMMON-$(LIBAVCODEC_A) += libaf/af_lavcac3enc.c \
+SRCS_COMMON-$(LIBAVCODEC_INTERNALS) += libaf/af_lavcac3enc.c \
libmpcodecs/vf_fspp.c \
libmpcodecs/vf_geq.c \
libmpcodecs/vf_mcdeint.c \
libmpcodecs/vf_qp.c \
libmpcodecs/vf_spp.c \
- libmpcodecs/vf_uspp.c \
SRCS_COMMON-$(LIBAVFORMAT) += libmpdemux/demux_lavf.c \
stream/stream_ffmpeg.c \
@@ -188,6 +176,9 @@ SRCS_COMMON-$(LIBNEMESI) += libmpdemux/demux_nemesi.c \
SRCS_COMMON-$(LIBNUT) += libmpdemux/demux_nut.c
SRCS_COMMON-$(LIBPOSTPROC) += libmpcodecs/vf_pp.c
SRCS_COMMON-$(LIBSMBCLIENT) += stream/stream_smb.c
+SRCS_COMMON-$(LIBSWSCALE_INTERNALS) += libmpcodecs/vf_palette.c \
+ libmpcodecs/vf_rgb2bgr.c \
+ libmpcodecs/vf_yuy2.c
SRCS_COMMON-$(LIBTHEORA) += libmpcodecs/vd_theora.c
SRCS_COMMON-$(LIVE555) += libmpdemux/demux_rtp.cpp \
libmpdemux/demux_rtp_codec.cpp \
@@ -330,8 +321,10 @@ SRCS_COMMON-$(XVID4) += libmpcodecs/vd_xvid4.c
SRCS_COMMON-$(ZR) += libmpcodecs/vd_zrmjpeg.c \
libmpcodecs/vf_zrmjpeg.c
SRCS_COMMON = asxparser.c \
+ av_log.c \
codec-cfg.c \
cpudetect.c \
+ defaultopts.c \
edl.c \
find_sub.c \
fmt-conversion.c \
@@ -339,6 +332,7 @@ SRCS_COMMON = asxparser.c \
m_config.c \
m_option.c \
m_struct.c \
+ mp_msg.c \
mpcommon.c \
parser-cfg.c \
playtree.c \
@@ -347,6 +341,7 @@ SRCS_COMMON = asxparser.c \
sub_cc.c \
subopt-helper.c \
subreader.c \
+ talloc.c \
vobsub.c \
libaf/af.c \
libaf/af_center.c \
@@ -438,14 +433,12 @@ SRCS_COMMON = asxparser.c \
libmpcodecs/vf_noformat.c \
libmpcodecs/vf_noise.c \
libmpcodecs/vf_ow.c \
- libmpcodecs/vf_palette.c \
libmpcodecs/vf_perspective.c \
libmpcodecs/vf_phase.c \
libmpcodecs/vf_pp7.c \
libmpcodecs/vf_pullup.c \
libmpcodecs/vf_rectangle.c \
libmpcodecs/vf_remove_logo.c \
- libmpcodecs/vf_rgb2bgr.c \
libmpcodecs/vf_rgbtest.c \
libmpcodecs/vf_rotate.c \
libmpcodecs/vf_sab.c \
@@ -463,7 +456,6 @@ SRCS_COMMON = asxparser.c \
libmpcodecs/vf_vo.c \
libmpcodecs/vf_yadif.c \
libmpcodecs/vf_yuvcsp.c \
- libmpcodecs/vf_yuy2.c \
libmpcodecs/vf_yvu9.c \
libmpdemux/aac_hdr.c \
libmpdemux/asfheader.c \
@@ -510,6 +502,7 @@ SRCS_COMMON = asxparser.c \
libmpdemux/yuv4mpeg_ratio.c \
libvo/osd.c \
libvo/sub.c \
+ osdep/findfiles.c \
osdep/$(GETCH) \
osdep/$(TIMER) \
stream/open.c \
@@ -550,41 +543,6 @@ SRCS_MPLAYER-$(GL) += libvo/gl_common.c libvo/vo_gl.c libvo/vo_gl2.c l
SRCS_MPLAYER-$(GL_WIN32) += libvo/w32_common.c
SRCS_MPLAYER-$(GL_X11) += libvo/x11_common.c
SRCS_MPLAYER-$(MATRIXVIEW) += libvo/vo_matrixview.c libvo/matrixview.c
-SRCS_MPLAYER-$(GUI) += gui/bitmap.c
-SRCS_MPLAYER-$(GUI_GTK) += gui/app.c \
- gui/cfg.c \
- gui/interface.c \
- gui/mplayer/gui_common.c \
- gui/mplayer/menu.c \
- gui/mplayer/mw.c \
- gui/mplayer/pb.c \
- gui/mplayer/play.c \
- gui/mplayer/sw.c \
- gui/mplayer/widgets.c \
- gui/mplayer/gtk/about.c \
- gui/mplayer/gtk/eq.c \
- gui/mplayer/gtk/fs.c \
- gui/mplayer/gtk/gtk_common.c \
- gui/mplayer/gtk/gtk_url.c \
- gui/mplayer/gtk/mb.c \
- gui/mplayer/gtk/menu.c \
- gui/mplayer/gtk/opts.c \
- gui/mplayer/gtk/pl.c \
- gui/mplayer/gtk/sb.c \
- gui/skin/cut.c \
- gui/skin/font.c \
- gui/skin/skin.c \
- gui/wm/ws.c \
- gui/wm/wsxdnd.c \
-
-SRCS_MPLAYER-$(GUI_WIN32) += gui/win32/dialogs.c \
- gui/win32/gui.c \
- gui/win32/interface.c \
- gui/win32/playlist.c \
- gui/win32/preferences.c \
- gui/win32/skinload.c \
- gui/win32/widgetrender.c \
- gui/win32/wincfg.c \
SRCS_MPLAYER-$(IVTV) += libao2/ao_ivtv.c libvo/vo_ivtv.c
SRCS_MPLAYER-$(JACK) += libao2/ao_jack.c
@@ -665,7 +623,6 @@ SRCS_MPLAYER = command.c \
m_property.c \
mixer.c \
mp_fifo.c \
- mp_msg.c \
mplayer.c \
parser-mpcmd.c \
input/input.c \
@@ -675,6 +632,7 @@ SRCS_MPLAYER = command.c \
libao2/audio_out.c \
libvo/aspect.c \
libvo/geometry.c \
+ libvo/old_vo_wrapper.c \
libvo/spuenc.c \
libvo/video_out.c \
libvo/vo_mpegpes.c \
@@ -696,7 +654,6 @@ SRCS_MENCODER-$(X264) += libmpcodecs/ve_x264.c
SRCS_MENCODER-$(XVID4) += libmpcodecs/ve_xvid4.c
SRCS_MENCODER = mencoder.c \
- mp_msg-mencoder.c \
parser-mecmd.c \
xvid_vbr.c \
libmpcodecs/ae.c \
@@ -710,12 +667,6 @@ SRCS_MENCODER = mencoder.c \
libmpdemux/muxer_rawvideo.c \
$(SRCS_MENCODER-yes)
-
-COMMON_LIBS-$(LIBAVFORMAT_A) += libavformat/libavformat.a
-COMMON_LIBS-$(LIBAVCODEC_A) += libavcodec/libavcodec.a
-COMMON_LIBS-$(LIBAVUTIL_A) += libavutil/libavutil.a
-COMMON_LIBS-$(LIBPOSTPROC_A) += libpostproc/libpostproc.a
-COMMON_LIBS-$(LIBSWSCALE_A) += libswscale/libswscale.a
COMMON_LIBS += $(COMMON_LIBS-yes)
OBJS_COMMON += $(addsuffix .o, $(basename $(SRCS_COMMON)))
@@ -731,38 +682,15 @@ DEPS = $(filter-out %.S,$(patsubst %.cpp,%.d,$(patsubst %.c,%.d,$(SRCS_COMMON) $
ALL_PRG-$(MPLAYER) += mplayer$(EXESUF)
ALL_PRG-$(MENCODER) += mencoder$(EXESUF)
-INSTALL_TARGETS-$(GUI) += install-gui
INSTALL_TARGETS-$(MENCODER) += install-mencoder install-mencoder-man
INSTALL_TARGETS-$(MPLAYER) += install-mplayer install-mplayer-man
DIRS = . \
- gui \
- gui/mplayer \
- gui/mplayer/gtk \
- gui/skin \
- gui/wm \
- gui/win32 \
input \
liba52 \
libaf \
libao2 \
libass \
- libavcodec \
- libavcodec/alpha \
- libavcodec/arm \
- libavcodec/bfin \
- libavcodec/mlib \
- libavcodec/ppc \
- libavcodec/sh4 \
- libavcodec/sparc \
- libavcodec/x86 \
- libavformat \
- libavutil \
- libavutil/arm \
- libavutil/bfin \
- libavutil/ppc \
- libavutil/sh4 \
- libavutil/x86 \
libdvdcss \
libdvdnav \
libdvdnav/vm \
@@ -773,7 +701,6 @@ DIRS = . \
libmpcodecs/native \
libmpdemux \
libmpeg2 \
- libpostproc \
libswscale \
libswscale/bfin \
libswscale/mlib \
@@ -801,47 +728,28 @@ ADDSUFFIXES = $(foreach suf,$(1),$(addsuffix $(suf),$(2)))
ADD_ALL_DIRS = $(call ADDSUFFIXES,$(1),$(DIRS))
ADD_ALL_EXESUFS = $(1) $(call ADDSUFFIXES,$(EXESUFS_ALL),$(1))
-FFMPEGPARTS = libavcodec \
- libavformat \
- libavutil \
- libpostproc \
- libswscale \
-
-FFMPEGLIBS = $(foreach part, $(FFMPEGPARTS), $(part)/$(part).a)
-FFMPEGFILES = $(foreach part, $(FFMPEGPARTS), $(wildcard $(part)/*.[chS] $(part)/*/*.[chS]))
-
-
-
###### generic rules #######
all: $(ALL_PRG-yes)
-%.d: %.c
- $(MPDEPEND_CMD) > $@
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ -MD -MP -MF $*.d $<
-%.d: %.cpp
- $(MPDEPEND_CMD_CXX) > $@
+%.o: %.cpp
+ $(CXX) $(CXXFLAGS) -c -o $@ -MD -MP -MF $*.d $<
-%.d: %.m
- $(MPDEPEND_CMD) > $@
+%.o: %.m
+ $(CC) $(CFLAGS) -c -o $@ -MD -MP -MF $*.d $<
%.ho: %.h
$(CC) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
-%.o: %.m
- $(CC) $(CFLAGS) -c -o $@ $<
-
%-rc.o: %.rc
$(WINDRES) -I. $< $@
checkheaders: $(ALLHEADERS:.h=.ho)
dep depend: $(DEPS)
- for part in $(FFMPEGPARTS); do $(MAKE) -C $$part depend; done
-
-$(FFMPEGLIBS): $(FFMPEGFILES) config.h
- $(MAKE) -C $(@D)
- touch $@
mencoder$(EXESUF): $(MENCODER_DEPS)
mencoder$(EXESUF): EXTRALIBS += $(EXTRALIBS_MENCODER)
@@ -850,7 +758,7 @@ mplayer$(EXESUF): EXTRALIBS += $(EXTRALIBS_MPLAYER)
mencoder$(EXESUF) mplayer$(EXESUF):
$(CC) -o $@ $^ $(EXTRALIBS)
-codec-cfg$(EXESUF): codec-cfg.c help_mp.h
+codec-cfg$(EXESUF): codec-cfg.c codec-cfg.h help_mp.h
$(HOST_CC) -O -DCODECS2HTML -I. -o $@ $<
codecs.conf.h: codec-cfg$(EXESUF) etc/codecs.conf
@@ -865,10 +773,6 @@ config.mak: configure
help_mp.h: help/help_mp-en.h $(HELP_FILE)
help/help_create.sh $(HELP_FILE) $(CHARSET)
-# rebuild version.h each time the working copy is updated
-ifeq ($(wildcard .svn/entries),.svn/entries)
-version.h: .svn/entries
-endif
version.h: version.sh
./$< `$(CC) -dumpversion`
@@ -881,7 +785,18 @@ version.h: version.sh
# Make sure all generated header files are created.
codec-cfg.d codec-cfg.o: codecs.conf.h
$(DEPS) $(MENCODER_DEPS) $(MPLAYER_DEPS): help_mp.h
-$(call ADDSUFFIXES,.d .o,mpcommon vobsub stream/stream_cddb stream/network libmpdemux/muxer_avi gui/win32/gui): version.h
+$(call ADDSUFFIXES,.d .o,mpcommon vobsub stream/stream_cddb stream/network libmpdemux/muxer_avi): version.h
+
+# Files that depend on libswscale internals
+libvo/vo_mga.o libvo/vo_xmga.o libmpcodecs/vf_halfpack.o libmpcodecs/vf_palette.o libmpcodecs/vf_rgb2bgr.o libmpcodecs/vf_yuy2.o: CFLAGS := -I$(FFMPEG_SOURCE_PATH) $(CFLAGS)
+
+# Files that depend on libavcodec internals
+libaf/af_lavcac3enc.o libmpcodecs/vf_fspp.o libmpcodecs/vf_geq.o libmpcodecs/vf_mcdeint.o libmpcodecs/vf_qp.o libmpcodecs/vf_spp.o libvo/jpeg_enc.o: CFLAGS := -I$(FFMPEG_SOURCE_PATH) $(CFLAGS)
+
+# yuv4mpeg has rgb conversion code under #ifdef CONFIG_LIBSWSCALE_INTERNALS
+ifeq ($(LIBSWSCALE_INTERNALS),yes)
+libvo/vo_yuv4mpeg.o: CFLAGS := -I$(FFMPEG_SOURCE_PATH) $(CFLAGS)
+endif
libdvdcss/%: CFLAGS := -Ilibdvdcss -D__USE_UNIX98 -D_GNU_SOURCE -DVERSION=\"1.2.10\" $(CFLAGS_LIBDVDCSS) $(CFLAGS)
libdvdnav/%: CFLAGS := -Ilibdvdnav -D__USE_UNIX98 -D_GNU_SOURCE -DHAVE_CONFIG_H -DVERSION=\"MPlayer-custom\" $(CFLAGS)
@@ -918,36 +833,23 @@ $(VIDIX_DEPS) $(VIDIX_OBJS): $(VIDIX_PCI_FILES)
install: $(INSTALL_TARGETS-yes)
install-dirs:
- $(INSTALL) -d $(BINDIR) $(CONFDIR) $(LIBDIR)
+ if test ! -d $(BINDIR) ; then $(INSTALL) -d $(BINDIR) ; fi
+ if test ! -d $(CONFDIR) ; then $(INSTALL) -d $(CONFDIR) ; fi
+ if test ! -d $(LIBDIR) ; then $(INSTALL) -d $(LIBDIR) ; fi
install-%: %$(EXESUF) install-dirs
$(INSTALL) -m 755 $(INSTALLSTRIP) $< $(BINDIR)
-install-gui: install-mplayer
- -ln -sf mplayer$(EXESUF) $(BINDIR)/gmplayer$(EXESUF)
- $(INSTALL) -d $(DATADIR)/skins $(prefix)/share/pixmaps $(prefix)/share/applications
- $(INSTALL) -m 644 etc/mplayer.xpm $(prefix)/share/pixmaps/
- $(INSTALL) -m 644 etc/mplayer.desktop $(prefix)/share/applications/
-
-install-gui-man: $(foreach lang,$(MAN_LANGS),install-gui-man-$(lang))
install-mencoder-man: $(foreach lang,$(MAN_LANGS),install-mencoder-man-$(lang))
install-mplayer-man: $(foreach lang,$(MAN_LANGS),install-mplayer-man-$(lang))
-install-gui-man-en: install-mplayer-man-en
- cd $(MANDIR)/man1/ && ln -sf mplayer.1 gmplayer.1
-
install-mencoder-man-en: install-mplayer-man-en
cd $(MANDIR)/man1 && ln -sf mplayer.1 mencoder.1
install-mplayer-man-en:
- $(INSTALL) -d $(MANDIR)/man1
+ if test ! -d $(MANDIR)/man1 ; then $(INSTALL) -d $(MANDIR)/man1 ; fi
$(INSTALL) -m 644 DOCS/man/en/mplayer.1 $(MANDIR)/man1/
-define GUI_MAN_RULE
-install-gui-man-$(lang): install-mplayer-man-$(lang)
- cd $(MANDIR)/$(lang)/man1/ && ln -sf mplayer.1 gmplayer.1
-endef
-
define MENCODER_MAN_RULE
install-mencoder-man-$(lang): install-mplayer-man-$(lang)
cd $(MANDIR)/$(lang)/man1 && ln -sf mplayer.1 mencoder.1
@@ -955,11 +857,10 @@ endef
define MPLAYER_MAN_RULE
install-mplayer-man-$(lang):
- $(INSTALL) -d $(MANDIR)/$(lang)/man1
+ if test ! -d $(MANDIR)/$(lang)/man1 ; then $(INSTALL) -d $(MANDIR)/$(lang)/man1 ; fi
$(INSTALL) -m 644 DOCS/man/$(lang)/mplayer.1 $(MANDIR)/$(lang)/man1/
endef
-$(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(GUI_MAN_RULE)))
$(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(MENCODER_MAN_RULE)))
$(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(MPLAYER_MAN_RULE)))
@@ -992,11 +893,13 @@ TAGS:
tags:
rm -f $@; find . -name '*.[chS]' -o -name '*.asm' | xargs ctags -a
-
+generated_ebml:
+ TOOLS/matroska.py --generate-header >libmpdemux/ebml_types.h
+ TOOLS/matroska.py --generate-definitions >libmpdemux/ebml_defs.c
###### tests / tools #######
-TEST_OBJS = mp_msg-mencoder.o mp_fifo.o osdep/$(GETCH) osdep/$(TIMER) -ltermcap -lm
+TEST_OBJS = mp_msg.o mp_fifo.o osdep/$(GETCH) osdep/$(TIMER) -ltermcap -lm
codec-cfg-test$(EXESUF): codec-cfg.c codecs.conf.h help_mp.h $(TEST_OBJS)
$(CC) -I. -DTESTING -o $@ $^
diff --git a/README b/README
index 7b202ba38e..acc7fcac88 100644
--- a/README
+++ b/README
@@ -2,8 +2,7 @@ Welcome to MPlayer, The Movie Player. MPlayer can play most standard video
formats out of the box and almost all others with the help of external codecs.
MPlayer currently works best from the command line, but visual feedback for
many functions is available from its onscreen status display (OSD), which is
-also used for displaying subtitles. MPlayer also has a GUI with skin support and
-several unofficial alternative graphical frontends are available.
+also used for displaying subtitles.
MEncoder is a command line video encoder for advanced users that can be built
from the MPlayer source tree. Unofficial graphical frontends exist but are
@@ -23,7 +22,6 @@ Requirements:
package(s) installed.
- To compile MPlayer with X11 support, you need to have the X Window System
development packages (like for XFree86 or X.Org) installed.
-- For the GUI you need the GTK development packages.
Before you start...
@@ -39,8 +37,7 @@ STEP0: Getting MPlayer
~~~~~~~~~~~~~~~~~~~~~~
Official releases and Subversion snapshots, as well as binary codec packages
-and a number of different skins for the GUI are available from the download
-section of our homepage at
+available from the download section of our homepage at
http://www.mplayerhq.hu/dload.html
@@ -54,9 +51,9 @@ Please note that binary codecs only work on the processor architecture they
were compiled for. Choose the correct package for your processor. No other
package is necessary.
-The GUI needs at least one skin and codec packages add support for some more
-video and audio formats. MPlayer does not come with any of these by default,
-you have to download and install them separately.
+Codec packages add support for some more video and audio formats. MPlayer does
+not come with any of these by default, you have to download and install them
+separately.
You can also get MPlayer via Subversion. Issue the following commands to get
the latest sources:
@@ -90,14 +87,8 @@ MPlayer can be adapted to all kinds of needs and hardware environments. Run
./configure
-to configure MPlayer with the default options. GUI support has to be enabled
-separately, run
-
- ./configure --enable-gui
-
-if you want to use the GUI.
-
-If something does not work as expected, try
+to configure MPlayer with the default options. If something does not work as
+expected, try
./configure --help
@@ -136,15 +127,15 @@ NOTE: If you run Debian you can configure, compile and build a proper Debian
fakeroot debian/rules binary
If you want to pass custom options to configure, you can set up the
-DEB_BUILD_OPTIONS environment variable. For instance, if you want GUI
-and OSD menu support you would use:
+DEB_BUILD_OPTIONS environment variable. For instance, if you want OSD menu
+support you would use:
- DEB_BUILD_OPTIONS="--enable-gui --enable-menu" fakeroot debian/rules binary
+ DEB_BUILD_OPTIONS="--enable-menu" fakeroot debian/rules binary
You can also pass some variables to the Makefile. For example, if you want
to compile with gcc 3.4 even if it's not the default compiler:
- CC=gcc-3.4 DEB_BUILD_OPTIONS="--enable-gui" fakeroot debian/rules binary
+ CC=gcc-3.4 DEB_BUILD_OPTIONS="--enable-menu" fakeroot debian/rules binary
To clean up the source tree run the following command:
@@ -161,32 +152,14 @@ you can create a symbolic link from either ~/.mplayer/subfont.ttf or
/usr/local/share/mplayer/subfont.ttf to your TrueType font.
-____________________________
-STEP5: Installing a GUI skin
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Unpack the archive and put the contents in /usr/local/share/mplayer/skins/ or
-~/.mplayer/skins/. MPlayer will use the skin in the subdirectory named default
-of /usr/local/share/mplayer/skins/ or ~/.mplayer/skins/ unless told otherwise
-via the '-skin' switch. You should therefore rename your skin subdirectory or
-make a suitable symbolic link.
-
-
__________________
-STEP6: Let's play!
+STEP5: Let's play!
~~~~~~~~~~~~~~~~~~
That's it for the moment. To start playing movies, open a command line and try
mplayer <moviefile>
-or for the GUI
-
- gmplayer <moviefile>
-
-gmplayer is a symbolic link to mplayer created by 'make install'.
-Without <moviefile>, gmplayer will start with the GUI filepicker.
-
To play a VCD track or a DVD title, try:
mplayer vcd://2 -cdrom-device /dev/hdc
diff --git a/TOOLS/asfinfo.c b/TOOLS/asfinfo.c
index 500d0a3615..85883b462f 100644
--- a/TOOLS/asfinfo.c
+++ b/TOOLS/asfinfo.c
@@ -286,4 +286,3 @@ int main(int argc, char* argv[]){
return 0;
}
-
diff --git a/TOOLS/avisubdump.c b/TOOLS/avisubdump.c
index e48f1ddce7..9fc50aff46 100644
--- a/TOOLS/avisubdump.c
+++ b/TOOLS/avisubdump.c
@@ -193,4 +193,3 @@ int main(int argc,char* argv[])
return 0;
}
-
diff --git a/TOOLS/compare.c b/TOOLS/compare.c
index 67aa8ac1c2..8a48bc8255 100644
--- a/TOOLS/compare.c
+++ b/TOOLS/compare.c
@@ -71,4 +71,3 @@ int main(int argc, char **argv)
printf("%d (+/-1)differences found\n", dif);
exit(0);
}
-
diff --git a/TOOLS/matroska.py b/TOOLS/matroska.py
new file mode 100755
index 0000000000..8368f35185
--- /dev/null
+++ b/TOOLS/matroska.py
@@ -0,0 +1,397 @@
+#!/usr/bin/python
+"""
+Generate C definitions for parsing Matroska files.
+Can also be used to directly parse Matroska files and display their contents.
+"""
+
+#
+# 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.
+#
+
+
+elements_ebml = (
+ 'EBML, 1a45dfa3, sub', (
+ 'EBMLVersion, 4286, uint',
+ 'EBMLReadVersion, 42f7, uint',
+ 'EBMLMaxIDLength, 42f2, uint',
+ 'EBMLMaxSizeLength, 42f3, uint',
+ 'DocType, 4282, str',
+ 'DocTypeVersion, 4287, uint',
+ 'DocTypeReadVersion, 4285, uint',
+ ),
+
+ 'CRC32, bf, binary',
+ 'Void, ec, binary',
+)
+
+elements_matroska = (
+ 'Segment, 18538067, sub', (
+
+ 'SeekHead*, 114d9b74, sub', (
+ 'Seek*, 4dbb, sub', (
+ 'SeekID, 53ab, ebml_id',
+ 'SeekPosition, 53ac, uint',
+ ),
+ ),
+
+ 'Info*, 1549a966, sub', (
+ 'SegmentUID, 73a4, binary',
+ 'PrevUID, 3cb923, binary',
+ 'NextUID, 3eb923, binary',
+ 'TimecodeScale, 2ad7b1, uint',
+ 'DateUTC, 4461, sint',
+ 'Title, 7ba9, str',
+ 'MuxingApp, 4d80, str',
+ 'WritingApp, 5741, str',
+ 'Duration, 4489, float',
+ ),
+
+ 'Cluster*, 1f43b675, sub', (
+ 'Timecode, e7, uint',
+ 'BlockGroup*, a0, sub', (
+ 'Block, a1, binary',
+ 'BlockDuration, 9b, uint',
+ 'ReferenceBlock*, fb, sint',
+ ),
+ 'SimpleBlock*, a3, binary',
+ ),
+
+ 'Tracks*, 1654ae6b, sub', (
+ 'TrackEntry*, ae, sub', (
+ 'TrackNumber, d7, uint',
+ 'TrackUID, 73c5, uint',
+ 'TrackType, 83, uint',
+ 'FlagEnabled, b9, uint',
+ 'FlagDefault, 88, uint',
+ 'FlagForced, 55aa, uint',
+ 'FlagLacing, 9c, uint',
+ 'MinCache, 6de7, uint',
+ 'DefaultDuration, 23e383, uint',
+ 'TrackTimecodeScale, 23314f, float',
+ 'MaxBlockAdditionID, 55ee, uint',
+ 'Name, 536e, str',
+ 'Language, 22b59c, str',
+ 'CodecID, 86, str',
+ 'CodecPrivate, 63a2, binary',
+ 'CodecDecodeAll, aa, uint',
+ 'Video, e0, sub', (
+ 'FlagInterlaced, 9a, uint',
+ 'PixelWidth, b0, uint',
+ 'PixelHeight, ba, uint',
+ 'DisplayWidth, 54b0, uint',
+ 'DisplayHeight, 54ba, uint',
+ 'FrameRate, 2383e3, float',
+ ),
+ 'Audio, e1, sub', (
+ 'SamplingFrequency, b5, float',
+ 'Channels, 9f, uint',
+ 'BitDepth, 6264, uint',
+ ),
+ 'ContentEncodings, 6d80, sub', (
+ 'ContentEncoding*, 6240, sub', (
+ 'ContentEncodingOrder, 5031, uint',
+ 'ContentEncodingScope, 5032, uint',
+ 'ContentEncodingType, 5033, uint',
+ 'ContentCompression, 5034, sub', (
+ 'ContentCompAlgo, 4254, uint',
+ 'ContentCompSettings, 4255, binary',
+ ),
+ ),
+ ),
+ ),
+ ),
+
+ 'Cues, 1c53bb6b, sub', (
+ 'CuePoint*, bb, sub', (
+ 'CueTime, b3, uint',
+ 'CueTrackPositions*, b7, sub', (
+ 'CueTrack, f7, uint',
+ 'CueClusterPosition, f1, uint',
+ ),
+ ),
+ ),
+
+ 'Attachments, 1941a469, sub', (
+ 'AttachedFile*, 61a7, sub', (
+ 'FileName, 466e, str',
+ 'FileMimeType, 4660, str',
+ 'FileData, 465c, binary',
+ 'FileUID, 46ae, uint',
+ ),
+ ),
+
+ 'Chapters, 1043a770, sub', (
+ 'EditionEntry*, 45b9, sub', (
+ 'EditionUID, 45bc, uint',
+ 'EditionFlagHidden, 45bd, uint',
+ 'EditionFlagDefault, 45db, uint',
+ 'EditionFlagOrdered, 45dd, uint',
+ 'ChapterAtom*, b6, sub', (
+ 'ChapterUID, 73c4, uint',
+ 'ChapterTimeStart, 91, uint',
+ 'ChapterTimeEnd, 92, uint',
+ 'ChapterFlagHidden, 98, uint',
+ 'ChapterFlagEnabled, 4598, uint',
+ 'ChapterSegmentUID, 6e67, binary',
+ 'ChapterSegmentEditionUID, 6ebc, uint',
+ 'ChapterDisplay*, 80, sub', (
+ 'ChapString, 85, str',
+ 'ChapLanguage*, 437c, str',
+ ),
+ ),
+ ),
+ ),
+ 'Tags*, 1254c367, sub', (
+ 'Tag*, 7373, sub', (
+ 'Targets, 63c0, sub', (
+ 'TargetTypeValue, 68ca, uint',
+ ),
+ ),
+ ),
+ ),
+)
+
+
+import sys
+from math import ldexp
+
+def byte2num(s):
+ return int(s.encode('hex'), 16)
+
+def camelcase_to_words(name):
+ parts = []
+ start = 0
+ for i in range(1, len(name)):
+ if name[i].isupper() and (name[i-1].islower() or
+ name[i+1:i+2].islower()):
+ parts.append(name[start:i])
+ start = i
+ parts.append(name[start:])
+ return '_'.join(parts).lower()
+
+class MatroskaElement(object):
+
+ def __init__(self, name, elid, valtype, namespace):
+ self.name = name
+ self.definename = '%s_ID_%s' % (namespace, name.upper())
+ self.fieldname = camelcase_to_words(name)
+ self.structname = 'ebml_' + self.fieldname
+ self.elid = elid
+ self.valtype = valtype
+ if valtype == 'sub':
+ self.ebmltype = 'EBML_TYPE_SUBELEMENTS'
+ self.valname = 'struct %s' % self.structname
+ else:
+ self.ebmltype = 'EBML_TYPE_' + valtype.upper()
+ try:
+ self.valname = {'uint': 'uint64_t', 'str': 'struct bstr',
+ 'binary': 'struct bstr', 'ebml_id': 'uint32_t',
+ 'float': 'double', 'sint': 'int64_t',
+ }[valtype]
+ except KeyError:
+ raise SyntaxError('Unrecognized value type ' + valtype)
+ self.subelements = ()
+
+ def add_subelements(self, subelements):
+ self.subelements = subelements
+ self.subids = set(x[0].elid for x in subelements)
+
+elementd = {}
+elementlist = []
+def parse_elems(l, namespace):
+ subelements = []
+ for el in l:
+ if isinstance(el, str):
+ name, hexid, eltype = [x.strip() for x in el.split(',')]
+ multiple = name.endswith('*')
+ name = name.strip('*')
+ new = MatroskaElement(name, hexid, eltype, namespace)
+ elementd[hexid] = new
+ elementlist.append(new)
+ subelements.append((new, multiple))
+ else:
+ new.add_subelements(parse_elems(el, namespace))
+ return subelements
+
+parse_elems(elements_ebml, 'EBML')
+parse_elems(elements_matroska, 'MATROSKA')
+
+def generate_C_header():
+ print('// Generated by TOOLS/matroska.py, do not edit manually')
+ print
+
+ for el in elementlist:
+ print('#define %-40s 0x%s' % (el.definename, el.elid))
+
+ print
+
+ for el in reversed(elementlist):
+ if not el.subelements:
+ continue
+ print
+ print('struct %s {' % el.structname)
+ l = max(len(subel.valname) for subel, multiple in el.subelements)+1
+ for subel, multiple in el.subelements:
+ print(' %-*s %s%s;' % (l, subel.valname, (' ', '*')[multiple],
+ subel.fieldname))
+ print
+ for subel, multiple in el.subelements:
+ print(' int n_%s;' % (subel.fieldname))
+ print('};')
+
+ for el in elementlist:
+ if not el.subelements:
+ continue
+ print('extern const struct ebml_elem_desc %s_desc;' % el.structname)
+
+ print
+ print('#define MAX_EBML_SUBELEMENTS %d' % max(len(el.subelements)
+ for el in elementlist))
+
+
+
+def generate_C_definitions():
+ print('// Generated by TOOLS/matroska.py, do not edit manually')
+ print
+ for el in reversed(elementlist):
+ print
+ if el.subelements:
+ print('#define N %s' % el.fieldname)
+ print('E_S("%s", %d)' % (el.name, len(el.subelements)))
+ for subel, multiple in el.subelements:
+ print('F(%s, %s, %d)' % (subel.definename, subel.fieldname,
+ multiple))
+ print('}};')
+ print('#undef N')
+ else:
+ print('E("%s", %s, %s)' % (el.name, el.fieldname, el.ebmltype))
+
+def read(s, length):
+ t = s.read(length)
+ if len(t) != length:
+ raise IOError
+ return t
+
+def read_id(s):
+ t = read(s, 1)
+ i = 0
+ mask = 128
+ if ord(t) == 0:
+ raise SyntaxError
+ while not ord(t) & mask:
+ i += 1
+ mask >>= 1
+ t += read(s, i)
+ return t
+
+def read_vint(s):
+ t = read(s, 1)
+ i = 0
+ mask = 128
+ if ord(t) == 0:
+ raise SyntaxError
+ while not ord(t) & mask:
+ i += 1
+ mask >>= 1
+ t = chr(ord(t) & (mask - 1))
+ t += read(s, i)
+ return i+1, byte2num(t)
+
+def read_str(s, length):
+ return read(s, length)
+
+def read_uint(s, length):
+ t = read(s, length)
+ return byte2num(t)
+
+def read_sint(s, length):
+ i = read_uint(s, length)
+ mask = 1 << (length * 8 - 1)
+ if i & mask:
+ i -= 2 * mask
+ return i
+
+def read_float(s, length):
+ t = read(s, length)
+ i = byte2num(t)
+ if length == 4:
+ f = ldexp((i & 0x7fffff) + (1 << 23), (i >> 23 & 0xff) - 150)
+ if i & (1 << 31):
+ f = -f
+ return f
+ raise SyntaxError
+
+def parse_one(s, depth, parent, maxlen):
+ elid = read_id(s).encode('hex')
+ elem = elementd.get(elid)
+ if parent is not None and elid not in parent.subids and elid not in ('ec', 'bf'):
+ print('Unexpected:', elid)
+ if 1:
+ raise NotImplementedError
+ size, length = read_vint(s)
+ this_length = len(elid) / 2 + size + length
+ if elem is not None:
+ if elem.valtype != 'skip':
+ print depth, elid, elem.name, 'size:', length, 'value:',
+ if elem.valtype == 'sub':
+ print('subelements:')
+ while length > 0:
+ length -= parse_one(s, depth + 1, elem, length)
+ if length < 0:
+ raise SyntaxError
+ elif elem.valtype == 'str':
+ print 'string', repr(read_str(s, length))
+ elif elem.valtype in ('binary', 'ebml_id'):
+ t = read_str(s, length)
+ dec = ''
+ if elem.valtype == 'ebml_id':
+ idelem = elementd.get(t.encode('hex'))
+ if idelem is None:
+ dec = '(UNKNOWN)'
+ else:
+ dec = '(%s)' % idelem.name
+ if len(t) < 20:
+ t = t.encode('hex')
+ else:
+ t = '<skipped %d bytes>' % len(t)
+ print 'binary', t, dec
+ elif elem.valtype == 'uint':
+ print 'uint', read_uint(s, length)
+ elif elem.valtype == 'sint':
+ print 'sint', read_sint(s, length)
+ elif elem.valtype == 'float':
+ print 'float', read_float(s, length)
+ elif elem.valtype == 'skip':
+ read(s, length)
+ else:
+ raise NotImplementedError
+ else:
+ print(depth, 'Unknown element:', elid, 'size:', length)
+ read(s, length)
+ return this_length
+
+def parse_toplevel(s):
+ parse_one(s, 0, None, 1 << 63)
+
+if sys.argv[1] == '--generate-header':
+ generate_C_header()
+elif sys.argv[1] == '--generate-definitions':
+ generate_C_definitions()
+else:
+ s = open(sys.argv[1])
+ while 1:
+ parse_toplevel(s)
diff --git a/TOOLS/modify_reg.c b/TOOLS/modify_reg.c
index 9c4e865883..888d9eac32 100644
--- a/TOOLS/modify_reg.c
+++ b/TOOLS/modify_reg.c
@@ -180,4 +180,3 @@ int main(int argc, char *argv[]) {
}
return 0;
}
-
diff --git a/TOOLS/realcodecs/cook.c b/TOOLS/realcodecs/cook.c
index 0cbd43af54..ede9a33aca 100644
--- a/TOOLS/realcodecs/cook.c
+++ b/TOOLS/realcodecs/cook.c
@@ -426,4 +426,3 @@ void SetDLLAccessPath(ulong p1) {
hexdump((void*)p1, 44);
fprintf(stderr, "--> void\n\n\n");
}
-
diff --git a/TOOLS/realcodecs/drv4.c b/TOOLS/realcodecs/drv4.c
index 39d642a180..ad68c1ac36 100644
--- a/TOOLS/realcodecs/drv4.c
+++ b/TOOLS/realcodecs/drv4.c
@@ -402,4 +402,3 @@ ulong RV20toYUV420Transform(ulong p1,ulong p2,ulong p3,ulong p4,ulong p5) {
// fprintf(stderr, "RV20toYUV420Transform --> 0x%0lx(%ld)\n\n\n", result, result);
return result;
}
-
diff --git a/TOOLS/realcodecs/ra.c b/TOOLS/realcodecs/ra.c
index 6a17911ba5..fd6d55a688 100644
--- a/TOOLS/realcodecs/ra.c
+++ b/TOOLS/realcodecs/ra.c
@@ -392,4 +392,3 @@ void SetDLLAccessPath(ulong p1) {
hexdump((void*)p1, 44);
fprintf(stderr, "--> void\n\n\n");
}
-
diff --git a/TOOLS/realcodecs/rv30.c b/TOOLS/realcodecs/rv30.c
index 41f49eadaa..bf02fe3a78 100644
--- a/TOOLS/realcodecs/rv30.c
+++ b/TOOLS/realcodecs/rv30.c
@@ -537,4 +537,3 @@ void SetDLLAccessPath(ulong p1) {
// hexdump((void*)p1, 44);
fprintf(stderr, "--> void\n\n\n");
}
-
diff --git a/TOOLS/realcodecs/sipr.c b/TOOLS/realcodecs/sipr.c
index 9a3399ea6c..43e0805b2e 100644
--- a/TOOLS/realcodecs/sipr.c
+++ b/TOOLS/realcodecs/sipr.c
@@ -480,4 +480,3 @@ void RASetPwd(ulong p1,ulong p2) {
// hexdump((void*)p1, 44);
fprintf(stderr, "--> void\n\n\n");
}
-
diff --git a/TOOLS/vdpau_functions.py b/TOOLS/vdpau_functions.py
new file mode 100644
index 0000000000..098e30a251
--- /dev/null
+++ b/TOOLS/vdpau_functions.py
@@ -0,0 +1,61 @@
+# Generate vdpau_template.c
+
+functions = """
+# get_error_string should be first, because the function lookup loop should
+# have it available to print errors for other functions
+get_error_string
+
+bitmap_surface_create
+bitmap_surface_destroy
+bitmap_surface_put_bits_native
+bitmap_surface_query_capabilities
+decoder_create
+decoder_destroy
+decoder_render
+device_destroy
+generate_csc_matrix GenerateCSCMatrix # CSC completely capitalized
+output_surface_create
+output_surface_destroy
+output_surface_put_bits_indexed
+output_surface_put_bits_native
+output_surface_render_bitmap_surface
+output_surface_render_output_surface
+preemption_callback_register
+presentation_queue_block_until_surface_idle
+presentation_queue_create
+presentation_queue_destroy
+presentation_queue_display
+presentation_queue_get_time
+presentation_queue_query_surface_status
+presentation_queue_target_create_x11
+presentation_queue_target_destroy
+video_mixer_create
+video_mixer_destroy
+video_mixer_query_feature_support
+video_mixer_render
+video_mixer_set_attribute_values
+video_mixer_set_feature_enables
+video_surface_create
+video_surface_destroy
+video_surface_put_bits_y_cb_cr
+"""
+
+print("""
+/* List the VDPAU functions used by MPlayer.
+ * Generated by vdpau_functions.py.
+ * First argument on each line is the VDPAU function type name,
+ * second macro name needed to get function address,
+ * third name MPlayer uses for the function.
+ */
+""")
+for line in functions.splitlines():
+ parts = line.split('#')[0].strip().split()
+ if not parts:
+ continue # empty/comment line
+ if len(parts) > 1:
+ mp_name, vdpau_name = parts
+ else:
+ mp_name = parts[0]
+ vdpau_name = ''.join(part.capitalize() for part in mp_name.split('_'))
+ macro_name = mp_name.upper()
+ print('VDP_FUNCTION(Vdp%s, VDP_FUNC_ID_%s, %s)' % (vdpau_name, macro_name, mp_name))
diff --git a/TOOLS/w32codec_dl.pl b/TOOLS/w32codec_dl.pl
index 41f4f9feca..c4a16b6b58 100755
--- a/TOOLS/w32codec_dl.pl
+++ b/TOOLS/w32codec_dl.pl
@@ -166,4 +166,3 @@ sub get_codec
print "No such file!\n";
}
}
-
diff --git a/ass_mp.c b/ass_mp.c
new file mode 100644
index 0000000000..959f985446
--- /dev/null
+++ b/ass_mp.c
@@ -0,0 +1,302 @@
+/*
+ * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
+ *
+ * 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 libass; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include <ass/ass.h>
+#include <ass/ass_types.h>
+
+#include "mp_msg.h"
+#include "get_path.h"
+#include "ass_mp.h"
+#include "subreader.h"
+
+#ifdef CONFIG_FONTCONFIG
+#include <fontconfig/fontconfig.h>
+#endif
+
+// libass-related command line options
+ASS_Library *ass_library;
+float ass_font_scale = 1.;
+float ass_line_spacing = 0.;
+int ass_top_margin = 0;
+int ass_bottom_margin = 0;
+int use_embedded_fonts = 1;
+char **ass_force_style_list = NULL;
+int ass_use_margins = 0;
+char *ass_color = NULL;
+char *ass_border_color = NULL;
+char *ass_styles_file = NULL;
+int ass_hinting = ASS_HINTING_LIGHT + 4; // light hinting for unscaled osd
+
+#ifdef CONFIG_FONTCONFIG
+extern int font_fontconfig;
+#else
+static int font_fontconfig = -1;
+#endif
+extern char *font_name;
+extern char *sub_font_name;
+extern float text_font_scale_factor;
+extern int subtitle_autoscale;
+
+#ifdef CONFIG_ICONV
+extern char *sub_cp;
+#else
+static char *sub_cp = 0;
+#endif
+
+void process_force_style(ASS_Track *track);
+
+ASS_Track *ass_default_track(ASS_Library *library)
+{
+ ASS_Track *track = ass_new_track(library);
+
+ track->track_type = TRACK_TYPE_ASS;
+ track->Timer = 100.;
+ track->PlayResY = 288;
+ track->WrapStyle = 0;
+
+ if (ass_styles_file)
+ ass_read_styles(track, ass_styles_file, sub_cp);
+
+ if (track->n_styles == 0) {
+ ASS_Style *style;
+ int sid;
+ double fs;
+ uint32_t c1, c2;
+
+ sid = ass_alloc_style(track);
+ style = track->styles + sid;
+ style->Name = strdup("Default");
+ style->FontName = (font_fontconfig >= 0
+ && sub_font_name) ? strdup(sub_font_name)
+ : (font_fontconfig >= 0
+ && font_name) ? strdup(font_name) : strdup("Sans");
+ style->treat_fontname_as_pattern = 1;
+
+ fs = track->PlayResY * text_font_scale_factor / 100.;
+ // approximate autoscale coefficients
+ if (subtitle_autoscale == 2)
+ fs *= 1.3;
+ else if (subtitle_autoscale == 3)
+ fs *= 1.4;
+ style->FontSize = fs;
+
+ if (ass_color)
+ c1 = strtoll(ass_color, NULL, 16);
+ else
+ c1 = 0xFFFF0000;
+ if (ass_border_color)
+ c2 = strtoll(ass_border_color, NULL, 16);
+ else
+ c2 = 0x00000000;
+
+ style->PrimaryColour = c1;
+ style->SecondaryColour = c1;
+ style->OutlineColour = c2;
+ style->BackColour = 0x00000000;
+ style->BorderStyle = 1;
+ style->Alignment = 2;
+ style->Outline = 2;
+ style->MarginL = 10;
+ style->MarginR = 10;
+ style->MarginV = 5;
+ style->ScaleX = 1.;
+ style->ScaleY = 1.;
+ }
+
+ ass_process_force_style(track);
+ return track;
+}
+
+static int check_duplicate_plaintext_event(ASS_Track *track)
+{
+ int i;
+ ASS_Event *evt = track->events + track->n_events - 1;
+
+ for (i = 0; i < track->n_events - 1; ++i) // ignoring last event, it is the one we are comparing with
+ if (track->events[i].Start == evt->Start &&
+ track->events[i].Duration == evt->Duration &&
+ strcmp(track->events[i].Text, evt->Text) == 0)
+ return 1;
+ return 0;
+}
+
+/**
+ * \brief Convert subtitle to ASS_Events for the given track
+ * \param track track
+ * \param sub subtitle to convert
+ * \return event id
+ * note: assumes that subtitle is _not_ fps-based; caller must manually correct
+ * Start and Duration in other case.
+ **/
+int ass_process_subtitle(ASS_Track *track, subtitle *sub)
+{
+ int eid;
+ ASS_Event *event;
+ int len = 0, j;
+ char *p;
+ char *end;
+
+ eid = ass_alloc_event(track);
+ event = track->events + eid;
+
+ event->Start = sub->start * 10;
+ event->Duration = (sub->end - sub->start) * 10;
+ event->Style = 0;
+
+ for (j = 0; j < sub->lines; ++j)
+ len += sub->text[j] ? strlen(sub->text[j]) : 0;
+
+ len += 2 * sub->lines; // '\N', including the one after the last line
+ len += 6; // {\anX}
+ len += 1; // '\0'
+
+ event->Text = malloc(len);
+ end = event->Text + len;
+ p = event->Text;
+
+ if (sub->alignment)
+ p += snprintf(p, end - p, "{\\an%d}", sub->alignment);
+
+ for (j = 0; j < sub->lines; ++j)
+ p += snprintf(p, end - p, "%s\\N", sub->text[j]);
+
+ if (sub->lines > 0)
+ p -= 2; // remove last "\N"
+ *p = 0;
+
+ if (check_duplicate_plaintext_event(track)) {
+ ass_free_event(track, eid);
+ track->n_events--;
+ return -1;
+ }
+
+ mp_msg(MSGT_ASS, MSGL_V,
+ "plaintext event at %" PRId64 ", +%" PRId64 ": %s \n",
+ (int64_t) event->Start, (int64_t) event->Duration, event->Text);
+
+ return eid;
+}
+
+
+/**
+ * \brief Convert subdata to ASS_Track
+ * \param subdata subtitles struct from subreader
+ * \param fps video framerate
+ * \return newly allocated ASS_Track, filled with subtitles from subdata
+ */
+ASS_Track *ass_read_subdata(ASS_Library *library, sub_data *subdata,
+ double fps)
+{
+ ASS_Track *track;
+ int i;
+
+ track = ass_default_track(library);
+ track->name = subdata->filename ? strdup(subdata->filename) : 0;
+
+ for (i = 0; i < subdata->sub_num; ++i) {
+ int eid = ass_process_subtitle(track, subdata->subtitles + i);
+ if (eid < 0)
+ continue;
+ if (!subdata->sub_uses_time) {
+ track->events[eid].Start *= 100. / fps;
+ track->events[eid].Duration *= 100. / fps;
+ }
+ }
+ return track;
+}
+
+void ass_configure(ASS_Renderer *priv, int w, int h, int unscaled)
+{
+ int hinting;
+ ass_set_frame_size(priv, w, h);
+ ass_set_margins(priv, ass_top_margin, ass_bottom_margin, 0, 0);
+ ass_set_use_margins(priv, ass_use_margins);
+ ass_set_font_scale(priv, ass_font_scale);
+ if (!unscaled && (ass_hinting & 4))
+ hinting = 0;
+ else
+ hinting = ass_hinting & 3;
+ ass_set_hinting(priv, hinting);
+ ass_set_line_spacing(priv, ass_line_spacing);
+}
+
+void ass_configure_fonts(ASS_Renderer *priv)
+{
+ char *dir, *path, *family;
+ dir = get_path("fonts");
+ if (font_fontconfig < 0 && sub_font_name)
+ path = strdup(sub_font_name);
+ else if (font_fontconfig < 0 && font_name)
+ path = strdup(font_name);
+ else
+ path = get_path("subfont.ttf");
+ if (font_fontconfig >= 0 && sub_font_name)
+ family = strdup(sub_font_name);
+ else if (font_fontconfig >= 0 && font_name)
+ family = strdup(font_name);
+ else
+ family = 0;
+
+ ass_set_fonts(priv, path, family, font_fontconfig + 1, NULL, 1);
+
+ free(dir);
+ free(path);
+ free(family);
+}
+
+static void message_callback(int level, const char *format, va_list va, void *ctx)
+{
+ mp_msg(MSGT_ASS, level, "[ass] ");
+ mp_msg_va(MSGT_ASS, level, format, va);
+ // libass messages lack trailing \n
+ mp_msg(MSGT_ASS, level, "\n");
+}
+
+ASS_Library *ass_init(void)
+{
+ ASS_Library *priv;
+ char *path = get_path("fonts");
+ priv = ass_library_init();
+ ass_set_message_cb(priv, message_callback, NULL);
+ ass_set_fonts_dir(priv, path);
+ ass_set_extract_fonts(priv, use_embedded_fonts);
+ ass_set_style_overrides(priv, ass_force_style_list);
+ free(path);
+ return priv;
+}
+
+int ass_force_reload = 0; // flag set if global ass-related settings were changed
+
+ASS_Image *ass_mp_render_frame(ASS_Renderer *priv, ASS_Track *track,
+ long long now, int *detect_change)
+{
+ if (ass_force_reload) {
+ ass_set_margins(priv, ass_top_margin, ass_bottom_margin, 0, 0);
+ ass_set_use_margins(priv, ass_use_margins);
+ ass_set_font_scale(priv, ass_font_scale);
+ ass_force_reload = 0;
+ }
+ return ass_render_frame(priv, track, now, detect_change);
+}
diff --git a/ass_mp.h b/ass_mp.h
new file mode 100644
index 0000000000..58ebae0938
--- /dev/null
+++ b/ass_mp.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
+ *
+ * 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 libass; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef MPLAYER_ASS_MP_H
+#define MPLAYER_ASS_MP_H
+
+#include <stdint.h>
+
+#include "ass_mp.h"
+
+#include "subreader.h"
+
+#ifdef CONFIG_ASS
+#include <ass/ass.h>
+#include <ass/ass_types.h>
+
+extern ASS_Library *ass_library;
+extern float ass_font_scale;
+extern float ass_line_spacing;
+extern int ass_top_margin;
+extern int ass_bottom_margin;
+extern int use_embedded_fonts;
+extern char **ass_force_style_list;
+extern int ass_use_margins;
+extern char *ass_color;
+extern char *ass_border_color;
+extern char *ass_styles_file;
+extern int ass_hinting;
+
+ASS_Track *ass_default_track(ASS_Library *library);
+int ass_process_subtitle(ASS_Track *track, subtitle *sub);
+ASS_Track *ass_read_subdata(ASS_Library *library, sub_data *subdata,
+ double fps);
+
+void ass_configure(ASS_Renderer *priv, int w, int h, int hinting);
+void ass_configure_fonts(ASS_Renderer *priv);
+ASS_Library *ass_init(void);
+
+extern int ass_force_reload;
+ASS_Image *ass_mp_render_frame(ASS_Renderer *priv, ASS_Track *track,
+ long long now, int *detect_change);
+
+#else /* CONFIG_ASS */
+
+/* Needed for EOSD code using this type to compile */
+
+typedef struct ass_image {
+ int w, h;
+ int stride;
+ unsigned char *bitmap;
+ uint32_t color;
+ int dst_x, dst_y;
+ struct ass_image *next;
+} ASS_Image;
+
+#endif
+
+typedef struct {
+ ASS_Image *imgs;
+ int changed;
+} mp_eosd_images_t;
+
+
+#endif /* MPLAYER_ASS_MP_H */
diff --git a/asxparser.c b/asxparser.c
index 1505e8a625..6005987d87 100644
--- a/asxparser.c
+++ b/asxparser.c
@@ -32,8 +32,6 @@
#include "mp_msg.h"
#include "m_config.h"
-extern m_config_t* mconfig;
-
////// List utils
void
@@ -127,8 +125,10 @@ asx_attrib_to_enum(const char* val,char** valid_vals) {
#define asx_warning_body_parse_error(p,e) mp_msg(MSGT_PLAYTREE,MSGL_WARN,"At line %d : error while parsing %s body",p->line,e)
ASX_Parser_t*
-asx_parser_new(void) {
+asx_parser_new(struct m_config *mconfig)
+{
ASX_Parser_t* parser = calloc(1,sizeof(ASX_Parser_t));
+ parser->mconfig = mconfig;
return parser;
}
@@ -444,7 +444,7 @@ asx_parse_param(ASX_Parser_t* parser, char** attribs, play_tree_t* pt) {
return;
}
val = asx_get_attrib("VALUE",attribs);
- if(m_config_get_option(mconfig,name) == NULL) {
+ if(m_config_get_option(parser->mconfig,name) == NULL) {
mp_msg(MSGT_PLAYTREE,MSGL_WARN,"Found unknown param in asx: %s",name);
if(val)
mp_msg(MSGT_PLAYTREE,MSGL_WARN,"=%s\n",val);
@@ -512,7 +512,7 @@ asx_parse_entryref(ASX_Parser_t* parser,char* buffer,char** _attribs) {
mp_msg(MSGT_PLAYTREE,MSGL_V,"Adding playlist %s to element entryref\n",href);
- ptp = play_tree_parser_new(stream,parser->deep+1);
+ ptp = play_tree_parser_new(stream, parser->mconfig, parser->deep+1);
pt = play_tree_parser_get_play_tree(ptp, 1);
@@ -629,11 +629,11 @@ asx_parse_repeat(ASX_Parser_t* parser,char* buffer,char** _attribs) {
play_tree_t*
-asx_parser_build_tree(char* buffer,int deep) {
+asx_parser_build_tree(struct m_config *mconfig, char* buffer,int deep) {
char *element,*asx_body,**asx_attribs,*body = NULL, **attribs;
int r;
play_tree_t *asx,*entry,*list = NULL;
- ASX_Parser_t* parser = asx_parser_new();
+ ASX_Parser_t* parser = asx_parser_new(mconfig);
parser->line = 1;
parser->deep = deep;
diff --git a/asxparser.h b/asxparser.h
index b300dde0e3..c5a3b18fc7 100644
--- a/asxparser.h
+++ b/asxparser.h
@@ -32,10 +32,12 @@ struct ASX_Parser_t {
int ret_stack_size;
char* last_body;
int deep;
+ struct m_config *mconfig;
};
+struct m_config;
ASX_Parser_t*
-asx_parser_new(void);
+asx_parser_new(struct m_config *mconfig);
void
asx_parser_free(ASX_Parser_t* parser);
diff --git a/av_log.c b/av_log.c
new file mode 100644
index 0000000000..99f6e91a81
--- /dev/null
+++ b/av_log.c
@@ -0,0 +1,111 @@
+/*
+ * av_log to mp_msg converter
+ * Copyright (C) 2006 Michael Niedermayer
+ * Copyright (C) 2009 Uoti Urpala
+ *
+ * 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.
+ */
+
+#include <stdlib.h>
+#include <stdbool.h>
+
+#include "config.h"
+#include "mp_msg.h"
+#include <libavutil/log.h>
+
+#ifdef CONFIG_LIBAVCODEC
+#include <libavcodec/avcodec.h>
+#endif
+
+#ifdef CONFIG_LIBAVFORMAT
+#include <libavformat/avformat.h>
+#endif
+
+static int av_log_level_to_mp_level(int av_level)
+{
+ if (av_level > AV_LOG_INFO)
+ return MSGL_V;
+ if (av_level > AV_LOG_WARNING)
+ return MSGL_INFO;
+ if (av_level > AV_LOG_ERROR)
+ return MSGL_WARN;
+ if (av_level > AV_LOG_FATAL)
+ return MSGL_ERR;
+ return MSGL_FATAL;
+}
+
+static int extract_msg_type_from_ctx(void *ptr)
+{
+ if (!ptr)
+ return MSGT_FIXME;
+
+ AVClass *avc = *(AVClass **)ptr;
+
+#ifdef CONFIG_LIBAVCODEC
+ if (!strcmp(avc->class_name, "AVCodecContext")) {
+ AVCodecContext *s = ptr;
+ if (s->codec) {
+ if (s->codec->type == CODEC_TYPE_AUDIO) {
+ if (s->codec->decode)
+ return MSGT_DECAUDIO;
+ } else if (s->codec->type == CODEC_TYPE_VIDEO) {
+ if (s->codec->decode)
+ return MSGT_DECVIDEO;
+ }
+ // FIXME subtitles, encoders
+ // What msgt for them? There is nothing appropriate...
+ }
+ return MSGT_FIXME;
+ }
+#endif
+
+#ifdef CONFIG_LIBAVFORMAT
+ if (!strcmp(avc->class_name, "AVFormatContext")) {
+ AVFormatContext *s = ptr;
+ if (s->iformat)
+ return MSGT_DEMUXER;
+ else if (s->oformat)
+ return MSGT_MUXER;
+ return MSGT_FIXME;
+ }
+#endif
+
+ return MSGT_FIXME;
+}
+
+static void mp_msg_av_log_callback(void *ptr, int level, const char *fmt,
+ va_list vl)
+{
+ static bool print_prefix = 1;
+ AVClass *avc = ptr ? *(AVClass **)ptr : NULL;
+ int mp_level = av_log_level_to_mp_level(level);
+ int type = extract_msg_type_from_ctx(ptr);
+
+ if (!mp_msg_test(type, mp_level))
+ return;
+
+ if (print_prefix && avc)
+ mp_msg(type, mp_level, "[%s @ %p]", avc->item_name(ptr), avc);
+ print_prefix = fmt[strlen(fmt) - 1] == '\n';
+
+ mp_msg_va(type, mp_level, fmt, vl);
+}
+
+void set_av_log_callback(void)
+{
+ av_log_set_callback(mp_msg_av_log_callback);
+}
diff --git a/av_log.h b/av_log.h
new file mode 100644
index 0000000000..baffb276ce
--- /dev/null
+++ b/av_log.h
@@ -0,0 +1 @@
+void set_av_log_callback(void);
diff --git a/av_opts.c b/av_opts.c
index 2d708ebddc..452253b4de 100644
--- a/av_opts.c
+++ b/av_opts.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
+#include "av_opts.h"
#include "libavcodec/opt.h"
int parse_avopts(void *v, char *str){
diff --git a/cfg-common-opts.h b/cfg-common-opts.h
index dd9b691002..7a32b2101a 100644
--- a/cfg-common-opts.h
+++ b/cfg-common-opts.h
@@ -16,19 +16,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPLAYER_CFG_COMMON_OPTS_H
-#define MPLAYER_CFG_COMMON_OPTS_H
-
-#include "config.h"
-
-#include "osdep/priority.h"
-
// ------------------------- common options --------------------
{"quiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"noquiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
{"really-quiet", &verbose, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_PRE_PARSE, 0, -10, NULL},
{"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL},
- {"msglevel", msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ {"msglevel", (void *) msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
{"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"nomsgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
{"msgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
@@ -36,11 +29,10 @@
#ifdef CONFIG_ICONV
{"msgcharset", &mp_msg_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
#endif
- {"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL},
#ifdef CONFIG_PRIORITY
{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
#endif
- {"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
+ {"noconfig", (void *) noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
// ------------------------- stream options --------------------
@@ -66,6 +58,7 @@
{"dvd-speed", "MPlayer was compiled without libdvdread support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
{"dvd", "MPlayer was compiled without libdvdread support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
#endif /* CONFIG_DVDREAD */
+ OPT_INTRANGE("edition", edition_id, 0, -1, 8190),
{"alang", &audio_lang, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"slang", &dvdsub_lang, CONF_TYPE_STRING, 0, 0, 0, NULL},
@@ -146,12 +139,12 @@
{"loadidx", &index_file_load, CONF_TYPE_STRING, 0, 0, 0, NULL},
// select audio/video/subtitle stream
- {"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, -2, 8190, NULL},
+ OPT_INTRANGE("aid", audio_id, 0, -2, 8190),
{"ausid", &audio_substream_id, CONF_TYPE_INT, 0, 0, 0, NULL},
- {"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, -2, 8190, NULL},
- {"sid", &dvdsub_id, CONF_TYPE_INT, CONF_RANGE, -2, 8190, NULL},
- {"nosub", &dvdsub_id, CONF_TYPE_FLAG, 0, -1, -2, NULL},
- {"novideo", &video_id, CONF_TYPE_FLAG, 0, -1, -2, NULL},
+ OPT_INTRANGE("vid", video_id, 0, -2, 8190),
+ OPT_INTRANGE("sid", sub_id, 0, -2, 8190),
+ OPT_FLAG_CONSTANTS("nosub", sub_id, 0, -1, -2),
+ OPT_FLAG_CONSTANTS("novideo", video_id, 0, -1, -2),
{ "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL },
{ "nohr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL},
@@ -173,25 +166,25 @@
{ "extbased", &extension_parsing, CONF_TYPE_FLAG, 0, 0, 1, NULL },
{ "noextbased", &extension_parsing, CONF_TYPE_FLAG, 0, 1, 0, NULL },
- {"mf", mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
+ {"mf", (void *) mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
#ifdef CONFIG_RADIO
{"radio", radioopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#else
{"radio", "MPlayer was compiled without Radio interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
#endif /* CONFIG_RADIO */
#ifdef CONFIG_TV
- {"tv", tvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"tv", (void *) tvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#else
{"tv", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
#endif /* CONFIG_TV */
#ifdef CONFIG_PVR
- {"pvr", pvropts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"pvr", (void *) pvropts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#else
{"pvr", "MPlayer was compiled without V4L2/PVR interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
#endif /* CONFIG_PVR */
- {"vivo", vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"vivo", (void *) vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#ifdef CONFIG_DVBIN
- {"dvbin", dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"dvbin", (void *) dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#endif
// ------------------------- a-v sync options --------------------
@@ -208,7 +201,7 @@
{"srate", &force_srate, CONF_TYPE_INT, CONF_RANGE, 1000, 8*48000, NULL},
{"channels", &audio_output_channels, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL},
{"format", &audio_output_format, CONF_TYPE_AFMT, 0, 0, 0, NULL},
- {"speed", &playback_speed, CONF_TYPE_FLOAT, CONF_RANGE, 0.01, 100.0, NULL},
+ OPT_FLOATRANGE("speed", playback_speed, 0, 0.01, 100.0),
// set a-v distance
{"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -100.0, 100.0, NULL},
@@ -229,14 +222,14 @@
#endif
// disable audio
- {"sound", &audio_id, CONF_TYPE_FLAG, 0, -2, -1, NULL},
- {"nosound", &audio_id, CONF_TYPE_FLAG, 0, -1, -2, NULL},
+ OPT_FLAG_CONSTANTS("sound", audio_id, 0, -2, -1),
+ OPT_FLAG_CONSTANTS("nosound", audio_id, 0, -1, -2),
{"af*", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
- {"af-adv", audio_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"af-adv", (void *) audio_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
{"vop", "-vop has been removed, use -vf instead.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL},
- {"vf*", &vf_settings, CONF_TYPE_OBJ_SETTINGS_LIST, 0, 0, 0, &vf_obj_list},
+ OPT_SETTINGSLIST("vf*", vf_settings, 0, &vf_obj_list),
// select audio/video codec (by name) or codec family (by number):
// {"afm", &audio_family, CONF_TYPE_INT, CONF_MIN, 0, 22, NULL}, // keep ranges in sync
// {"vfm", &video_family, CONF_TYPE_INT, CONF_MIN, 0, 29, NULL}, // with codec-cfg.c
@@ -257,15 +250,15 @@
// scaling:
{"sws", &sws_flags, CONF_TYPE_INT, 0, 0, 2, NULL},
- {"ssf", scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
- {"zoom", &softzoom, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"nozoom", &softzoom, CONF_TYPE_FLAG, 0, 1, 0, NULL},
- {"aspect", &movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, NULL},
- {"noaspect", &movie_aspect, CONF_TYPE_FLAG, 0, 0, 0, NULL},
- {"xy", &screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0.001, 4096, NULL},
-
- {"flip", &flip, CONF_TYPE_FLAG, 0, -1, 1, NULL},
- {"noflip", &flip, CONF_TYPE_FLAG, 0, -1, 0, NULL},
+ {"ssf", (void *) scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ OPT_FLAG_ON("zoom", softzoom, 0),
+ OPT_FLAG_OFF("nozoom", softzoom, 0),
+ OPT_FLOATRANGE("aspect", movie_aspect, 0, 0.2, 3.0),
+ OPT_FLAG_CONSTANTS("noaspect", movie_aspect, 0, 0, 0),
+ OPT_FLOATRANGE("xy", screen_size_xy, 0, 0.001, 4096),
+
+ OPT_FLAG_CONSTANTS("flip", flip, 0, -1, 1),
+ OPT_FLAG_CONSTANTS("noflip", flip, 0, -1, 0),
{"tsfastparse", "-tsfastparse is no longer a valid option.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL
},
{"tsprog", &ts_prog, CONF_TYPE_INT, CONF_RANGE, 0, 65534, NULL},
@@ -275,15 +268,15 @@
{"tskeepbroken", &ts_keep_broken, CONF_TYPE_FLAG, 0, 0, 1, NULL},
// draw by slices or whole frame (useful with libmpeg2/libavcodec)
- {"slices", &vd_use_slices, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"noslices", &vd_use_slices, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ OPT_FLAG_ON("slices", vd_use_slices, 0),
+ OPT_FLAG_OFF("noslices", vd_use_slices, 0),
{"field-dominance", &field_dominance, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL},
#ifdef CONFIG_LIBAVCODEC
- {"lavdopts", lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"lavdopts", (void *) lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#endif
#ifdef CONFIG_LIBAVFORMAT
- {"lavfdopts", lavfdopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ {"lavfdopts", (void *) lavfdopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
#endif
#ifdef CONFIG_XVID4
{"xvidopts", xvid_dec_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
@@ -346,16 +339,16 @@
{"subfont-autoscale", &subtitle_autoscale, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
#endif
#ifdef CONFIG_ASS
- {"ass", &ass_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"noass", &ass_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ OPT_FLAG_ON("ass", ass_enabled, 0),
+ OPT_FLAG_OFF("noass", ass_enabled, 0),
{"ass-font-scale", &ass_font_scale, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL},
{"ass-line-spacing", &ass_line_spacing, CONF_TYPE_FLOAT, CONF_RANGE, -1000, 1000, NULL},
{"ass-top-margin", &ass_top_margin, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
{"ass-bottom-margin", &ass_bottom_margin, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
{"ass-use-margins", &ass_use_margins, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"noass-use-margins", &ass_use_margins, CONF_TYPE_FLAG, 0, 1, 0, NULL},
- {"embeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"noembeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ {"embeddedfonts", &use_embedded_fonts, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+ {"noembeddedfonts", &use_embedded_fonts, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"ass-force-style", &ass_force_style_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
{"ass-color", &ass_color, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"ass-border-color", &ass_border_color, CONF_TYPE_STRING, 0, 0, 0, NULL},
@@ -369,5 +362,3 @@
{"fontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
{"nofontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
#endif /* CONFIG_FONTCONFIG */
-
-#endif /* MPLAYER_CFG_COMMON_OPTS_H */
diff --git a/cfg-common.h b/cfg-common.h
index db167d2f27..e4f3af7efd 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -28,12 +28,6 @@ extern char *mp_msg_charset;
extern int mp_msg_color;
extern int mp_msg_module;
-// codec/filter opts: (defined at libmpcodecs/vd.c)
-extern float screen_size_xy;
-extern float movie_aspect;
-extern int softzoom;
-extern int flip;
-
/* defined in codec-cfg.c */
extern char * codecs_file;
@@ -245,7 +239,6 @@ extern int mf_w;
extern int mf_h;
extern double mf_fps;
extern char * mf_type;
-extern m_obj_settings_t* vf_settings;
extern m_obj_list_t vf_obj_list;
const m_option_t mfopts_conf[]={
@@ -273,7 +266,6 @@ const m_option_t msgl_config[]={
{ "global", &mp_msg_levels[MSGT_GLOBAL], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{ "cplayer", &mp_msg_levels[MSGT_CPLAYER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
- { "gplayer", &mp_msg_levels[MSGT_GPLAYER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{ "vo", &mp_msg_levels[MSGT_VO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{ "ao", &mp_msg_levels[MSGT_AO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{ "demuxer", &mp_msg_levels[MSGT_DEMUXER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
@@ -319,7 +311,6 @@ const m_option_t msgl_config[]={
{"help", "Available msg modules:\n"
" global - common player errors/information\n"
" cplayer - console player (mplayer.c)\n"
- " gplayer - gui player\n"
" vo - libvo\n"
" ao - libao\n"
" demuxer - demuxer.c (general stuff)\n"
diff --git a/cfg-mencoder.h b/cfg-mencoder.h
index d58f87b4d3..4d390bfdcc 100644
--- a/cfg-mencoder.h
+++ b/cfg-mencoder.h
@@ -202,11 +202,11 @@ const m_option_t mencoder_opts[]={
{"xsize", "-xsize has been removed, use -vf crop=w:h:x:y for cropping.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
// output audio/video codec selection
- {"oac", oac_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
- {"ovc", ovc_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ {"oac", (void *) oac_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ {"ovc", (void *) ovc_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
// output file format
- {"of", of_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ {"of", (void *) of_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
// override audio format tag in output file
{"fafmttag", &force_audiofmttag, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL},
@@ -233,7 +233,7 @@ const m_option_t mencoder_opts[]={
{"noodml", &write_odml, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
// info header strings
- {"info", info_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ {"info", (void *) info_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
#ifdef CONFIG_MP3LAME
{"lameopts", lameopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index 4eb42a3adf..d8170ec9e7 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -23,10 +23,10 @@
* config for cfgparser
*/
-#include "cfg-common.h"
+#include <stddef.h>
-extern int key_fifo_size;
-extern unsigned doubleclick_time;
+#include "cfg-common.h"
+#include "options.h"
extern char *fb_mode_cfgfile;
extern char *fb_mode_name;
@@ -34,15 +34,9 @@ extern char *dfb_params;
extern char *lirc_configfile;
-extern float vo_panscanrange;
/* only used at startup (setting these values from configfile) */
extern char *vo_geometry;
-extern int opt_screen_size_x;
-extern int opt_screen_size_y;
-extern int fullscreen;
-extern int vidmode;
-
extern char *ao_outputfilename;
extern int ao_pcm_waveheader;
@@ -63,14 +57,6 @@ void vo_zr_revertoption(const m_option_t* opt,char* pram);
extern m_option_t dxr2_opts[];
-extern char * skinName;
-extern int guiWinID;
-
-
-/* from libvo/aspect.c */
-extern float force_monitor_aspect;
-extern float monitor_pixel_aspect;
-
extern int sws_flags;
int readPPOpt(void *conf, char *arg);
void revertPPOpt(void *conf, char* opt);
@@ -108,12 +94,12 @@ const m_option_t mplayer_opts[]={
//---------------------- libao/libvo options ------------------------
{"o", "Option -o has been renamed to -vo (video-out), use -vo.\n",
CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
- {"vo", &video_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
- {"ao", &audio_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
- {"fixed-vo", &fixed_vo, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL},
- {"nofixed-vo", &fixed_vo, CONF_TYPE_FLAG,CONF_GLOBAL, 1, 0, NULL},
- {"ontop", &vo_ontop, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"noontop", &vo_ontop, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ OPT_STRINGLIST("vo", video_driver_list, 0),
+ OPT_STRINGLIST("ao", audio_driver_list, 0),
+ OPT_FLAG_ON("fixed-vo", fixed_vo, CONF_GLOBAL),
+ OPT_FLAG_OFF("nofixed-vo", fixed_vo, CONF_GLOBAL),
+ OPT_FLAG_ON("ontop", vo_ontop, 0),
+ OPT_FLAG_OFF("noontop", vo_ontop, 0),
{"rootwin", &vo_rootwin, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"border", &vo_border, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"noborder", &vo_border, CONF_TYPE_FLAG, 0, 1, 0, NULL},
@@ -181,30 +167,32 @@ const m_option_t mplayer_opts[]={
#endif
// force window width/height or resolution (with -vm)
- {"x", &opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL},
- {"y", &opt_screen_size_y, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL},
+ OPT_INTRANGE("x", screen_size_x, 0, 0, 4096),
+ OPT_INTRANGE("y", screen_size_y, 0, 0, 4096),
// set screen dimensions (when not detectable or virtual!=visible)
- {"screenw", &vo_screenwidth, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL},
- {"screenh", &vo_screenheight, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL},
+ OPT_INTRANGE("screenw", vo_screenwidth, CONF_OLD, 0, 4096),
+ OPT_INTRANGE("screenh", vo_screenheight, CONF_OLD, 0, 4096),
// Geometry string
{"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ OPT_FLAG_ON("force-window-position", force_window_position, 0),
+ OPT_FLAG_OFF("noforce-window-position", force_window_position, 0),
// vo name (X classname) and window title strings
{"name", &vo_winname, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"title", &vo_wintitle, CONF_TYPE_STRING, 0, 0, 0, NULL},
// set aspect ratio of monitor - useful for 16:9 TV-out
- {"monitoraspect", &force_monitor_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 9.0, NULL},
- {"monitorpixelaspect", &monitor_pixel_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 9.0, NULL},
+ OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0),
+ OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 0.2, 9.0),
// video mode switching: (x11,xv,dga)
- {"vm", &vidmode, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"novm", &vidmode, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ OPT_FLAG_ON("vm", vidmode, 0),
+ OPT_FLAG_OFF("novm", vidmode, 0),
// start in fullscreen mode:
- {"fs", &fullscreen, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"nofs", &fullscreen, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ OPT_FLAG_ON("fs", fullscreen, 0),
+ OPT_FLAG_OFF("nofs", fullscreen, 0),
// set fullscreen switch method (workaround for buggy WMs)
{"fsmode", "-fsmode is obsolete, avoid it and use -fstype instead.\nIf you really want it, try -fsmode-dontuse, but don't report bugs!\n", CONF_TYPE_PRINT, CONF_RANGE, 0, 31, NULL},
{"fsmode-dontuse", &vo_fsmode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL},
// set bpp (x11+vm, dga, fbdev, vesa, svga?)
- {"bpp", &vo_dbpp, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL},
+ OPT_INTRANGE("bpp", vo_dbpp, 0, 0, 32),
{"colorkey", &vo_colorkey, CONF_TYPE_INT, 0, 0, 0, NULL},
{"nocolorkey", &vo_colorkey, CONF_TYPE_FLAG, 0, 0, 0x1000000, NULL},
{"double", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 0, 1, NULL},
@@ -213,7 +201,7 @@ const m_option_t mplayer_opts[]={
{"vsync", &vo_vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"novsync", &vo_vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"panscan", &vo_panscan, CONF_TYPE_FLOAT, CONF_RANGE, -1.0, 1.0, NULL},
- {"panscanrange", &vo_panscanrange, CONF_TYPE_FLOAT, CONF_RANGE, -19.0, 99.0, NULL},
+ OPT_FLOATRANGE("panscanrange", vo_panscanrange, 0, -19.0, 99.0),
{"grabpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"nograbpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 1, 0, NULL},
@@ -235,10 +223,10 @@ const m_option_t mplayer_opts[]={
{"xineramascreen", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, -2, 32, NULL},
- {"brightness",&vo_gamma_brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
- {"saturation",&vo_gamma_saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
- {"contrast",&vo_gamma_contrast, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
- {"hue",&vo_gamma_hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
+ OPT_INTRANGE("brightness", vo_gamma_brightness, 0, -100, 100),
+ OPT_INTRANGE("saturation", vo_gamma_saturation, 0, -100, 100),
+ OPT_INTRANGE("contrast", vo_gamma_contrast, 0, -100, 100),
+ OPT_INTRANGE("hue", vo_gamma_hue, 0, -100, 100),
{"keepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"nokeepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 1, 0, NULL},
@@ -273,8 +261,8 @@ const m_option_t mplayer_opts[]={
{"crash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"nocrash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
#endif
- {"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
- {"osd-duration", &osd_duration, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL},
+ OPT_INTRANGE("osdlevel", osd_level, 0, 0, 3),
+ OPT_INTRANGE("osd-duration", osd_duration, 0, 0, 3600000),
#ifdef CONFIG_MENU
{"menu", &use_menu, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"nomenu", &use_menu, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
@@ -328,23 +316,21 @@ const m_option_t mplayer_opts[]={
{"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
#endif
- {"gui", "The -gui option will only work as the first command line argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1},
- {"nogui", "The -nogui option will only work as the first command line argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1},
-
-#ifdef CONFIG_GUI
- {"skin", &skinName, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
- {"enqueue", &enqueue, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"noenqueue", &enqueue, CONF_TYPE_FLAG, 0, 1, 0, NULL},
- {"guiwid", &guiWinID, CONF_TYPE_INT, 0, 0, 0, NULL},
-#endif
+ // these should be removed when gmplayer is forgotten
+ {"gui", "Internal GUI was removed. Use some other frontend instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
+ {"nogui", "Internal GUI was removed, -nogui is no longer valid.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
- {"noloop", &mpctx_s.loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL},
- {"loop", &mpctx_s.loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL},
+ OPT_FLAG_CONSTANTS("noloop", loop_times, 0, 0, -1),
+ OPT_INTRANGE("loop", loop_times, 0, -1, 10000),
{"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ OPT_FLAG_ON("ordered-chapters", ordered_chapters, 0),
+ OPT_FLAG_OFF("noordered-chapters", ordered_chapters, 0),
+
// a-v sync stuff:
- {"correct-pts", &user_correct_pts, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"nocorrect-pts", &user_correct_pts, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ OPT_FLAG_ON("correct-pts", user_correct_pts, 0),
+ OPT_FLAG_OFF("nocorrect-pts", user_correct_pts, 0),
+ OPT_INTRANGE("pts-association-mode", user_pts_assoc_mode, 0, 0, 2),
{"noautosync", &autosync, CONF_TYPE_FLAG, 0, 0, -1, NULL},
{"autosync", &autosync, CONF_TYPE_INT, CONF_RANGE, 0, 10000, NULL},
// {"dapsync", &dapsync, CONF_TYPE_FLAG, 0, 0, 1, NULL},
@@ -366,14 +352,14 @@ const m_option_t mplayer_opts[]={
{"idle", &player_idle_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL},
{"noidle", &player_idle_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 1, 0, NULL},
{"use-stdin", "-use-stdin has been renamed to -noconsolecontrols, use that instead.", CONF_TYPE_PRINT, 0, 0, 0, NULL},
- {"key-fifo-size", &key_fifo_size, CONF_TYPE_INT, CONF_RANGE, 2, 65000, NULL},
+ OPT_INTRANGE("key-fifo-size", key_fifo_size, CONF_GLOBAL, 2, 65000),
{"noconsolecontrols", &noconsolecontrols, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"consolecontrols", &noconsolecontrols, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
{"mouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"nomouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
- {"doubleclick-time", &doubleclick_time, CONF_TYPE_INT, CONF_RANGE, 0, 1000, NULL},
+ OPT_INTRANGE("doubleclick-time", doubleclick_time, 0, 0, 1000),
#ifdef CONFIG_TV
- {"tvscan", tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"tvscan", (void *) tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#else
{"tvscan", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
#endif /* CONFIG_TV */
@@ -386,9 +372,8 @@ const m_option_t mplayer_opts[]={
{"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
{"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
- {"vd", vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"vd", (void *) vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
{NULL, NULL, 0, 0, 0, 0, NULL}
};
#endif /* MPLAYER_CFG_MPLAYER_H */
-
diff --git a/codec-cfg.c b/codec-cfg.c
index 5d796275ce..ae84af4c1a 100644
--- a/codec-cfg.c
+++ b/codec-cfg.c
@@ -40,10 +40,12 @@
#include <ctype.h>
#include <assert.h>
#include <string.h>
+#include <stdint.h>
#include "config.h"
#include "mp_msg.h"
#ifdef CODECS2HTML
+#define mp_tmsg mp_msg
#ifdef __GNUC__
#define mp_msg(t, l, m, args...) fprintf(stderr, m, ##args)
#else
@@ -53,9 +55,6 @@
#include "help_mp.h"
-// for mmioFOURCC:
-#include "libmpdemux/aviheader.h"
-
#include "libmpcodecs/img_format.h"
#include "codec-cfg.h"
@@ -63,6 +62,10 @@
#include "codecs.conf.h"
#endif
+#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
+ ( (uint32_t)(uint8_t)(ch0) | ( (uint32_t)(uint8_t)(ch1) << 8 ) | \
+ ( (uint32_t)(uint8_t)(ch2) << 16 ) | ( (uint32_t)(uint8_t)(ch3) << 24 ) )
+
#define PRINT_LINENUM mp_msg(MSGT_CODECCFG,MSGL_ERR," at line %d\n", line_num)
#define MAX_NR_TOKEN 16
@@ -107,13 +110,13 @@ static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc,
goto err_out_parse_error;
return 1;
err_out_duplicated:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFourcc);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"duplicated FourCC");
return 0;
err_out_too_many:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
return 0;
err_out_parse_error:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
return 0;
}
@@ -126,20 +129,20 @@ static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int
for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++)
/* NOTHING */;
if (i == CODECS_MAX_FOURCC) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
return 0;
}
fourcc[i]=strtoul(s,&endptr,0);
if (*endptr != '\0') {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDNotNumber);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID not a number?)");
return 0;
}
if(alias){
fourccmap[i]=strtoul(alias,&endptr,0);
if (*endptr != '\0') {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDAliasNotNumber);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID alias not a number?)");
return 0;
}
} else
@@ -147,7 +150,7 @@ static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int
for (j = 0; j < i; j++)
if (fourcc[j] == fourcc[i]) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFID);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"duplicated format ID");
return 0;
}
@@ -219,7 +222,7 @@ static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int
{"VDPAU_H264",IMGFMT_VDPAU_H264},
{"VDPAU_WMV3",IMGFMT_VDPAU_WMV3},
{"VDPAU_VC1",IMGFMT_VDPAU_VC1},
- {"VDPAU_MPEG4",IMGFMT_VDPAU_MPEG4},
+ {"VDPAU_MPEG4",IMGFMT_VDPAU_MPEG4},
{NULL, 0}
};
@@ -284,10 +287,10 @@ static int add_to_inout(char *sfmt, char *sflags, unsigned int *outfmt,
return 1;
err_out_too_many:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyOut);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many out...");
return 0;
err_out_parse_error:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
return 0;
}
@@ -368,7 +371,7 @@ static int validate_codec(codecs_t *c, int type)
/* NOTHING */;
if (i < strlen(tmp_name)) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_InvalidCodecName, c->name);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) name is not valid!\n", c->name);
return 0;
}
@@ -377,13 +380,13 @@ static int validate_codec(codecs_t *c, int type)
#if 0
if (c->fourcc[0] == 0xffffffff) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksFourcc, c->name);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have FourCC/format!\n", c->name);
return 0;
}
#endif
if (!c->drv) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksDriver, c->name);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have a driver!\n", c->name);
return 0;
}
@@ -392,7 +395,7 @@ static int validate_codec(codecs_t *c, int type)
#warning Where are they defined ????????????
if (!c->dll && (c->driver == 4 ||
(c->driver == 2 && type == TYPE_VIDEO))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsDLL, c->name);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs a 'dll'!\n", c->name);
return 0;
}
#warning Can guid.f1 be 0? How does one know that it was not given?
@@ -400,7 +403,7 @@ static int validate_codec(codecs_t *c, int type)
if (type == TYPE_VIDEO)
if (c->outfmt[0] == 0xffffffff) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsOutfmt, c->name);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs an 'outfmt'!\n", c->name);
return 0;
}
#endif
@@ -418,7 +421,7 @@ static int add_comment(char *s, char **d)
(*d)[pos++] = '\n';
}
if (!(*d = realloc(*d, pos + strlen(s) + 1))) {
- mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantAllocateComment);
+ mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't allocate memory for comment. ");
return 0;
}
strcpy(*d + pos, s);
@@ -467,7 +470,7 @@ static int get_token(int min, int max)
char c;
if (max >= MAX_NR_TOKEN) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"get_token(): max >= MAX_MR_TOKEN!");
goto out_eof;
}
@@ -551,15 +554,15 @@ int parse_codec_cfg(const char *cfgfile)
#endif
}
- mp_msg(MSGT_CODECCFG,MSGL_V,MSGTR_ReadingFile, cfgfile);
+ mp_tmsg(MSGT_CODECCFG,MSGL_V,"Reading %s: ", cfgfile);
if ((fp = fopen(cfgfile, "r")) == NULL) {
- mp_msg(MSGT_CODECCFG,MSGL_V,MSGTR_CantOpenFileError, cfgfile, strerror(errno));
+ mp_tmsg(MSGT_CODECCFG,MSGL_V,"Can't open '%s': %s\n", cfgfile, strerror(errno));
return 0;
}
if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) {
- mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantGetMemoryForLine, strerror(errno));
+ mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't get memory for 'line': %s\n", strerror(errno));
return 0;
}
read_nextline = 1;
@@ -617,7 +620,7 @@ int parse_codec_cfg(const char *cfgfile)
}
if (!(*codecsp = realloc(*codecsp,
sizeof(codecs_t) * (*nr_codecsp + 2)))) {
- mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantReallocCodecsp, strerror(errno));
+ mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't realloc '*codecsp': %s\n", strerror(errno));
goto err_out;
}
codec=*codecsp + *nr_codecsp;
@@ -632,19 +635,19 @@ int parse_codec_cfg(const char *cfgfile)
for (i = 0; i < *nr_codecsp - 1; i++) {
if(( (*codecsp)[i].name!=NULL) &&
(!strcmp(token[0], (*codecsp)[i].name)) ) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNameNotUnique, token[0]);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Codec name '%s' isn't unique.", token[0]);
goto err_out_print_linenum;
}
}
if (!(codec->name = strdup(token[0]))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupName, strerror(errno));
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'name': %s\n", strerror(errno));
goto err_out;
}
} else if (!strcmp(token[0], "info")) {
if (codec->info || get_token(1, 1) < 0)
goto err_out_parse_error;
if (!(codec->info = strdup(token[0]))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupInfo, strerror(errno));
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'info': %s\n", strerror(errno));
goto err_out;
}
} else if (!strcmp(token[0], "comment")) {
@@ -668,14 +671,14 @@ int parse_codec_cfg(const char *cfgfile)
if (get_token(1, 1) < 0)
goto err_out_parse_error;
if (!(codec->drv = strdup(token[0]))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDriver, strerror(errno));
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'driver': %s\n", strerror(errno));
goto err_out;
}
} else if (!strcmp(token[0], "dll")) {
if (get_token(1, 1) < 0)
goto err_out_parse_error;
if (!(codec->dll = strdup(token[0]))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDLL, strerror(errno));
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'dll': %s", strerror(errno));
goto err_out;
}
} else if (!strcmp(token[0], "guid")) {
@@ -744,7 +747,7 @@ int parse_codec_cfg(const char *cfgfile)
}
if (!validate_codec(codec, codec_type))
goto err_out_not_valid;
- mp_msg(MSGT_CODECCFG,MSGL_INFO,MSGTR_AudioVideoCodecTotals, nr_acodecs, nr_vcodecs);
+ mp_tmsg(MSGT_CODECCFG,MSGL_INFO,"%d audio & %d video codecs\n", nr_acodecs, nr_vcodecs);
if(video_codecs) video_codecs[nr_vcodecs].name = NULL;
if(audio_codecs) audio_codecs[nr_acodecs].name = NULL;
out:
@@ -754,7 +757,7 @@ out:
return 1;
err_out_parse_error:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
err_out_print_linenum:
PRINT_LINENUM;
err_out:
@@ -766,10 +769,10 @@ err_out:
fclose(fp);
return 0;
err_out_not_valid:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecDefinitionIncorrect);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Codec is not defined correctly.");
goto err_out_print_linenum;
err_out_release_num:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_OutdatedCodecsConf);
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"This codecs.conf is too old and incompatible with this MPlayer release!");
goto err_out_print_linenum;
}
@@ -1053,8 +1056,8 @@ int main(int argc, char* argv[])
nr[1] = nr_acodecs;
printf("/* GENERATED FROM %s, DO NOT EDIT! */\n\n",argv[1]);
- printf("#include <stddef.h>\n",argv[1]);
- printf("#include \"codec-cfg.h\"\n\n",argv[1]);
+ printf("#include <stddef.h>\n");
+ printf("#include \"codec-cfg.h\"\n\n");
for (i=0; i<2; i++) {
printf("const codecs_t %s[] = {\n", nm[i]);
diff --git a/codec-cfg.h b/codec-cfg.h
index d3a1ae03ab..3522f68a48 100644
--- a/codec-cfg.h
+++ b/codec-cfg.h
@@ -56,7 +56,7 @@ typedef struct {
#endif
-typedef struct codecs_st {
+typedef struct codecs {
unsigned int fourcc[CODECS_MAX_FOURCC];
unsigned int fourccmap[CODECS_MAX_FOURCC];
unsigned int outfmt[CODECS_MAX_OUTFMT];
diff --git a/command.c b/command.c
index cd9d2abf5d..54b1332d16 100644
--- a/command.c
+++ b/command.c
@@ -20,8 +20,10 @@
#include <inttypes.h>
#include <unistd.h>
#include <string.h>
+#include <stdbool.h>
#include "config.h"
+#include "talloc.h"
#include "command.h"
#include "input/input.h"
#include "stream/stream.h"
@@ -36,6 +38,7 @@
#include "metadata.h"
#include "libmpcodecs/vf.h"
#include "libmpcodecs/vd.h"
+#include "mp_osd.h"
#include "libvo/video_out.h"
#include "libvo/font_load.h"
#include "playtree.h"
@@ -47,6 +50,7 @@
#include "vobsub.h"
#include "spudec.h"
#include "get_path.h"
+#include "ass_mp.h"
#include "stream/tv.h"
#include "stream/stream_radio.h"
#include "stream/pvr.h"
@@ -57,10 +61,8 @@
#include "stream/stream_dvd.h"
#endif
#include "stream/stream_dvdnav.h"
-#include "libass/ass_mp.h"
#include "m_struct.h"
#include "libmenu/menu.h"
-#include "gui/interface.h"
#include "mp_core.h"
#include "mp_fifo.h"
@@ -70,35 +72,38 @@
extern int use_menu;
-static void rescale_input_coordinates(int ix, int iy, double *dx, double *dy)
+static void rescale_input_coordinates(struct MPContext *mpctx, int ix, int iy,
+ double *dx, double *dy)
{
+ struct MPOpts *opts = &mpctx->opts;
+ struct vo *vo = mpctx->video_out;
//remove the borders, if any, and rescale to the range [0,1],[0,1]
if (vo_fs) { //we are in full-screen mode
- if (vo_screenwidth > vo_dwidth) //there are borders along the x axis
- ix -= (vo_screenwidth - vo_dwidth) / 2;
- if (vo_screenheight > vo_dheight) //there are borders along the y axis (usual way)
- iy -= (vo_screenheight - vo_dheight) / 2;
+ if (opts->vo_screenwidth > vo->dwidth) //there are borders along the x axis
+ ix -= (opts->vo_screenwidth - vo->dwidth) / 2;
+ if (opts->vo_screenheight > vo->dheight) //there are borders along the y axis (usual way)
+ iy -= (opts->vo_screenheight - vo->dheight) / 2;
- if (ix < 0 || ix > vo_dwidth) {
+ if (ix < 0 || ix > vo->dwidth) {
*dx = *dy = -1.0;
return;
} //we are on one of the borders
- if (iy < 0 || iy > vo_dheight) {
+ if (iy < 0 || iy > vo->dheight) {
*dx = *dy = -1.0;
return;
} //we are on one of the borders
}
- *dx = (double) ix / (double) vo_dwidth;
- *dy = (double) iy / (double) vo_dheight;
+ *dx = (double) ix / (double) vo->dwidth;
+ *dy = (double) iy / (double) vo->dheight;
mp_msg(MSGT_CPLAYER, MSGL_V,
- "\r\nrescaled coordinates: %.3lf, %.3lf, screen (%d x %d), vodisplay: (%d, %d), fullscreen: %d\r\n",
- *dx, *dy, vo_screenwidth, vo_screenheight, vo_dwidth,
- vo_dheight, vo_fs);
+ "\r\nrescaled coordinates: %.3f, %.3f, screen (%d x %d), vodisplay: (%d, %d), fullscreen: %d\r\n",
+ *dx, *dy, opts->vo_screenwidth, opts->vo_screenheight, vo->dwidth,
+ vo->dheight, vo_fs);
}
-static int sub_source_by_pos(MPContext * mpctx, int pos)
+static int sub_source_by_pos(MPContext *mpctx, int pos)
{
int source = -1;
int top = -1;
@@ -113,7 +118,7 @@ static int sub_source_by_pos(MPContext * mpctx, int pos)
return source;
}
-static int sub_source(MPContext * mpctx)
+static int sub_source(MPContext *mpctx)
{
return sub_source_by_pos(mpctx, mpctx->global_sub_pos);
}
@@ -128,7 +133,7 @@ static int sub_source(MPContext * mpctx)
* which need to be fixed while watching the movie.
*/
-static void log_sub(void)
+static void log_sub(struct MPContext *mpctx)
{
char *fname;
FILE *f;
@@ -144,14 +149,14 @@ static void log_sub(void)
if (subdata->sub_uses_time) {
fprintf(f,
"N: %s S: %02ld:%02ld:%02ld.%02ld E: %02ld:%02ld:%02ld.%02ld\n",
- filename, vo_sub_last->start / 360000,
+ mpctx->filename, vo_sub_last->start / 360000,
(vo_sub_last->start / 6000) % 60,
(vo_sub_last->start / 100) % 60, vo_sub_last->start % 100,
vo_sub_last->end / 360000, (vo_sub_last->end / 6000) % 60,
(vo_sub_last->end / 100) % 60, vo_sub_last->end % 100);
} else {
- fprintf(f, "N: %s S: %ld E: %ld\n", filename, vo_sub_last->start,
- vo_sub_last->end);
+ fprintf(f, "N: %s S: %ld E: %ld\n", mpctx->filename,
+ vo_sub_last->start, vo_sub_last->end);
}
for (i = 0; i < vo_sub_last->lines; i++) {
fprintf(f, "%s\n", vo_sub_last->text[i]);
@@ -168,77 +173,80 @@ static void log_sub(void)
///@{
/// OSD level (RW)
-static int mp_property_osdlevel(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_osdlevel(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
- return m_property_choice(prop, action, arg, &osd_level);
+ return m_property_choice(prop, action, arg, &mpctx->opts.osd_level);
}
/// Loop (RW)
-static int mp_property_loop(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_loop(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
+ struct MPOpts *opts = &mpctx->opts;
switch (action) {
case M_PROPERTY_PRINT:
if (!arg) return M_PROPERTY_ERROR;
- if (mpctx->loop_times < 0)
+ if (opts->loop_times < 0)
*(char**)arg = strdup("off");
- else if (mpctx->loop_times == 0)
+ else if (opts->loop_times == 0)
*(char**)arg = strdup("inf");
else
break;
return M_PROPERTY_OK;
}
- return m_property_int_range(prop, action, arg, &mpctx->loop_times);
+ return m_property_int_range(prop, action, arg, &opts->loop_times);
}
/// Playback speed (RW)
-static int mp_property_playback_speed(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_playback_speed(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
+ struct MPOpts *opts = &mpctx->opts;
switch (action) {
case M_PROPERTY_SET:
if (!arg)
return M_PROPERTY_ERROR;
M_PROPERTY_CLAMP(prop, *(float *) arg);
- playback_speed = *(float *) arg;
- build_afilter_chain(mpctx->sh_audio, &ao_data);
+ opts->playback_speed = *(float *) arg;
+ build_afilter_chain(mpctx, mpctx->sh_audio, &ao_data);
return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
- playback_speed += (arg ? *(float *) arg : 0.1) *
+ opts->playback_speed += (arg ? *(float *) arg : 0.1) *
(action == M_PROPERTY_STEP_DOWN ? -1 : 1);
- M_PROPERTY_CLAMP(prop, playback_speed);
- build_afilter_chain(mpctx->sh_audio, &ao_data);
+ M_PROPERTY_CLAMP(prop, opts->playback_speed);
+ build_afilter_chain(mpctx, mpctx->sh_audio, &ao_data);
return M_PROPERTY_OK;
}
- return m_property_float_range(prop, action, arg, &playback_speed);
+ return m_property_float_range(prop, action, arg, &opts->playback_speed);
}
/// filename with path (RO)
-static int mp_property_path(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_path(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
- return m_property_string_ro(prop, action, arg, filename);
+ return m_property_string_ro(prop, action, arg, mpctx->filename);
}
/// filename without path (RO)
-static int mp_property_filename(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_filename(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
char *f;
- if (!filename)
+ if (!mpctx->filename)
return M_PROPERTY_UNAVAILABLE;
- if (((f = strrchr(filename, '/')) || (f = strrchr(filename, '\\'))) && f[1])
+ if (((f = strrchr(mpctx->filename, '/'))
+ || (f = strrchr(mpctx->filename, '\\'))) && f[1])
f++;
else
- f = filename;
+ f = mpctx->filename;
return m_property_string_ro(prop, action, arg, f);
}
/// Demuxer name (RO)
-static int mp_property_demuxer(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_demuxer(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->demuxer)
return M_PROPERTY_UNAVAILABLE;
@@ -247,8 +255,8 @@ static int mp_property_demuxer(m_option_t * prop, int action, void *arg,
}
/// Position in the stream (RW)
-static int mp_property_stream_pos(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_stream_pos(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->demuxer || !mpctx->demuxer->stream)
return M_PROPERTY_UNAVAILABLE;
@@ -267,8 +275,8 @@ static int mp_property_stream_pos(m_option_t * prop, int action, void *arg,
}
/// Stream start offset (RO)
-static int mp_property_stream_start(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_stream_start(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->demuxer || !mpctx->demuxer->stream)
return M_PROPERTY_UNAVAILABLE;
@@ -281,8 +289,8 @@ static int mp_property_stream_start(m_option_t * prop, int action,
}
/// Stream end offset (RO)
-static int mp_property_stream_end(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_stream_end(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->demuxer || !mpctx->demuxer->stream)
return M_PROPERTY_UNAVAILABLE;
@@ -295,8 +303,8 @@ static int mp_property_stream_end(m_option_t * prop, int action, void *arg,
}
/// Stream length (RO)
-static int mp_property_stream_length(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_stream_length(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->demuxer || !mpctx->demuxer->stream)
return M_PROPERTY_UNAVAILABLE;
@@ -310,8 +318,8 @@ static int mp_property_stream_length(m_option_t * prop, int action,
}
/// Media length in seconds (RO)
-static int mp_property_length(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_length(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
double len;
@@ -323,8 +331,8 @@ static int mp_property_length(m_option_t * prop, int action, void *arg,
}
/// Current position in percent (RW)
-static int mp_property_percent_pos(m_option_t * prop, int action,
- void *arg, MPContext * mpctx) {
+static int mp_property_percent_pos(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx) {
int pos;
if (!mpctx->demuxer)
@@ -348,14 +356,14 @@ static int mp_property_percent_pos(m_option_t * prop, int action,
demuxer_get_percent_pos(mpctx->demuxer));
}
- abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR;
- rel_seek_secs = pos / 100.0;
+ mpctx->abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR;
+ mpctx->rel_seek_secs = pos / 100.0;
return M_PROPERTY_OK;
}
/// Current position in seconds (RW)
-static int mp_property_time_pos(m_option_t * prop, int action,
- void *arg, MPContext * mpctx) {
+static int mp_property_time_pos(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx) {
if (!(mpctx->sh_video || (mpctx->sh_audio && mpctx->audio_out)))
return M_PROPERTY_UNAVAILABLE;
@@ -363,34 +371,31 @@ static int mp_property_time_pos(m_option_t * prop, int action,
case M_PROPERTY_SET:
if(!arg) return M_PROPERTY_ERROR;
M_PROPERTY_CLAMP(prop, *(double*)arg);
- abs_seek_pos = SEEK_ABSOLUTE;
- rel_seek_secs = *(double*)arg;
+ mpctx->abs_seek_pos = SEEK_ABSOLUTE;
+ mpctx->rel_seek_secs = *(double*)arg;
return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
- rel_seek_secs += (arg ? *(double*)arg : 10.0) *
+ mpctx->rel_seek_secs += (arg ? *(double*)arg : 10.0) *
(action == M_PROPERTY_STEP_UP ? 1.0 : -1.0);
return M_PROPERTY_OK;
}
return m_property_time_ro(prop, action, arg,
mpctx->sh_video ? mpctx->sh_video->pts :
- playing_audio_pts(mpctx->sh_audio,
- mpctx->d_audio,
- mpctx->audio_out));
+ playing_audio_pts(mpctx));
}
/// Current chapter (RW)
static int mp_property_chapter(m_option_t *prop, int action, void *arg,
MPContext *mpctx)
{
+ struct MPOpts *opts = &mpctx->opts;
int chapter = -1;
- float next_pts = 0;
- int chapter_num;
int step_all;
char *chapter_name = NULL;
if (mpctx->demuxer)
- chapter = demuxer_get_current_chapter(mpctx->demuxer);
+ chapter = get_current_chapter(mpctx);
if (chapter < 0)
return M_PROPERTY_UNAVAILABLE;
@@ -403,7 +408,7 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg,
case M_PROPERTY_PRINT: {
if (!arg)
return M_PROPERTY_ERROR;
- chapter_name = demuxer_chapter_display_name(mpctx->demuxer, chapter);
+ chapter_name = chapter_display_name(mpctx, chapter);
if (!chapter_name)
return M_PROPERTY_UNAVAILABLE;
*(char **) arg = chapter_name;
@@ -428,26 +433,27 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg,
default:
return M_PROPERTY_NOT_IMPLEMENTED;
}
- rel_seek_secs = 0;
- abs_seek_pos = 0;
- chapter = demuxer_seek_chapter(mpctx->demuxer, chapter, 1,
- &next_pts, &chapter_num, &chapter_name);
+
+ double next_pts = 0;
+ chapter = seek_chapter(mpctx, chapter, &next_pts, &chapter_name);
+ mpctx->rel_seek_secs = 0;
+ mpctx->abs_seek_pos = 0;
if (chapter >= 0) {
if (next_pts > -1.0) {
- abs_seek_pos = SEEK_ABSOLUTE;
- rel_seek_secs = next_pts;
+ mpctx->abs_seek_pos = SEEK_ABSOLUTE;
+ mpctx->rel_seek_secs = next_pts;
}
if (chapter_name)
- set_osd_msg(OSD_MSG_TEXT, 1, osd_duration,
- MSGTR_OSDChapter, chapter + 1, chapter_name);
+ set_osd_tmsg(OSD_MSG_TEXT, 1, opts->osd_duration,
+ "Chapter: (%d) %s", chapter + 1, chapter_name);
}
else if (step_all > 0)
- rel_seek_secs = 1000000000.;
+ mpctx->rel_seek_secs = 1000000000.;
else
- set_osd_msg(OSD_MSG_TEXT, 1, osd_duration,
- MSGTR_OSDChapter, 0, MSGTR_Unknown);
+ set_osd_tmsg(OSD_MSG_TEXT, 1, opts->osd_duration,
+ "Chapter: (%d) %s", 0, mp_gtext("unknown"));
if (chapter_name)
- free(chapter_name);
+ talloc_free(chapter_name);
return M_PROPERTY_OK;
}
@@ -466,6 +472,7 @@ static int mp_property_chapters(m_option_t *prop, int action, void *arg,
static int mp_property_angle(m_option_t *prop, int action, void *arg,
MPContext *mpctx)
{
+ struct MPOpts *opts = &mpctx->opts;
int angle = -1;
int angles;
char *angle_name = NULL;
@@ -517,19 +524,19 @@ static int mp_property_angle(m_option_t *prop, int action, void *arg,
return M_PROPERTY_NOT_IMPLEMENTED;
}
angle = demuxer_set_angle(mpctx->demuxer, angle);
- set_osd_msg(OSD_MSG_TEXT, 1, osd_duration,
- MSGTR_OSDAngle, angle, angles);
+ set_osd_tmsg(OSD_MSG_TEXT, 1, opts->osd_duration,
+ "Angle: %d/%d", angle, angles);
if (angle_name)
free(angle_name);
return M_PROPERTY_OK;
}
/// Demuxer meta data
-static int mp_property_metadata(m_option_t * prop, int action, void *arg,
- MPContext * mpctx) {
+static int mp_property_metadata(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx) {
m_property_action_t* ka;
char* meta;
- static m_option_t key_type =
+ static const m_option_t key_type =
{ "metadata", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL };
if (!mpctx->demuxer)
return M_PROPERTY_UNAVAILABLE;
@@ -558,10 +565,31 @@ static int mp_property_metadata(m_option_t * prop, int action, void *arg,
return M_PROPERTY_NOT_IMPLEMENTED;
}
-static int mp_property_pause(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_pause(m_option_t *prop, int action, void *arg,
+ void *ctx)
{
- return m_property_flag_ro(prop, action, arg, mpctx->osd_function == OSD_PAUSE);
+ MPContext *mpctx = ctx;
+
+ switch (action) {
+ case M_PROPERTY_SET:
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ if (mpctx->paused == (bool)*(int *) arg)
+ return M_PROPERTY_OK;
+ case M_PROPERTY_STEP_UP:
+ case M_PROPERTY_STEP_DOWN:
+ if (mpctx->paused) {
+ unpause_player(mpctx);
+ mpctx->osd_function = OSD_PLAY;
+ }
+ else {
+ pause_player(mpctx);
+ mpctx->osd_function = OSD_PAUSE;
+ }
+ return M_PROPERTY_OK;
+ default:
+ return m_property_flag(prop, action, arg, &mpctx->paused);
+ }
}
@@ -572,8 +600,8 @@ static int mp_property_pause(m_option_t * prop, int action, void *arg,
///@{
/// Volume (RW)
-static int mp_property_volume(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_volume(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->sh_audio)
@@ -628,8 +656,8 @@ static int mp_property_volume(m_option_t * prop, int action, void *arg,
}
/// Mute (RW)
-static int mp_property_mute(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_mute(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->sh_audio)
@@ -656,7 +684,7 @@ static int mp_property_mute(m_option_t * prop, int action, void *arg,
if (!arg)
return M_PROPERTY_ERROR;
if (mpctx->edl_muted) {
- *(char **) arg = strdup(MSGTR_EnabledEdl);
+ *(char **) arg = strdup(mp_gtext("enabled (EDL)"));
return M_PROPERTY_OK;
}
default:
@@ -666,8 +694,8 @@ static int mp_property_mute(m_option_t * prop, int action, void *arg,
}
/// Audio delay (RW)
-static int mp_property_audio_delay(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_audio_delay(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!(mpctx->sh_audio && mpctx->sh_video))
return M_PROPERTY_UNAVAILABLE;
@@ -690,8 +718,8 @@ static int mp_property_audio_delay(m_option_t * prop, int action,
}
/// Audio codec tag (RO)
-static int mp_property_audio_format(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_audio_format(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->sh_audio)
return M_PROPERTY_UNAVAILABLE;
@@ -699,8 +727,8 @@ static int mp_property_audio_format(m_option_t * prop, int action,
}
/// Audio codec name (RO)
-static int mp_property_audio_codec(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_audio_codec(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->sh_audio || !mpctx->sh_audio->codec)
return M_PROPERTY_UNAVAILABLE;
@@ -708,8 +736,8 @@ static int mp_property_audio_codec(m_option_t * prop, int action,
}
/// Audio bitrate (RO)
-static int mp_property_audio_bitrate(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_audio_bitrate(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->sh_audio)
return M_PROPERTY_UNAVAILABLE;
@@ -717,8 +745,8 @@ static int mp_property_audio_bitrate(m_option_t * prop, int action,
}
/// Samplerate (RO)
-static int mp_property_samplerate(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_samplerate(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->sh_audio)
return M_PROPERTY_UNAVAILABLE;
@@ -733,8 +761,8 @@ static int mp_property_samplerate(m_option_t * prop, int action, void *arg,
}
/// Number of channels (RO)
-static int mp_property_channels(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_channels(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->sh_audio)
return M_PROPERTY_UNAVAILABLE;
@@ -759,8 +787,8 @@ static int mp_property_channels(m_option_t * prop, int action, void *arg,
}
/// Balance (RW)
-static int mp_property_balance(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_balance(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
float bal;
@@ -810,9 +838,10 @@ static int mp_property_balance(m_option_t * prop, int action, void *arg,
}
/// Selected audio id (RW)
-static int mp_property_audio(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_audio(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
+ struct MPOpts *opts = &mpctx->opts;
int current_id, tmp;
if (!mpctx->demuxer || !mpctx->demuxer->audio)
return M_PROPERTY_UNAVAILABLE;
@@ -829,9 +858,10 @@ static int mp_property_audio(m_option_t * prop, int action, void *arg,
return M_PROPERTY_ERROR;
if (current_id < 0)
- *(char **) arg = strdup(MSGTR_Disabled);
+ *(char **) arg = strdup(mp_gtext("disabled"));
else {
- char lang[40] = MSGTR_Unknown;
+ char lang[40];
+ strncpy(lang, mp_gtext("unknown"), sizeof(lang));
sh_audio_t* sh = mpctx->sh_audio;
if (sh && sh->lang)
av_strlcpy(lang, sh->lang, 40);
@@ -861,21 +891,21 @@ static int mp_property_audio(m_option_t * prop, int action, void *arg,
tmp = *((int *) arg);
else
tmp = -1;
- audio_id = demuxer_switch_audio(mpctx->demuxer, tmp);
- if (audio_id == -2
- || (audio_id > -1
+ opts->audio_id = demuxer_switch_audio(mpctx->demuxer, tmp);
+ if (opts->audio_id == -2
+ || (opts->audio_id > -1
&& mpctx->demuxer->audio->id != current_id && current_id != -2))
- uninit_player(INITIALIZED_AO | INITIALIZED_ACODEC);
- if (audio_id > -1 && mpctx->demuxer->audio->id != current_id) {
+ uninit_player(mpctx, INITIALIZED_AO | INITIALIZED_ACODEC);
+ if (opts->audio_id > -1 && mpctx->demuxer->audio->id != current_id) {
sh_audio_t *sh2;
sh2 = mpctx->demuxer->a_streams[mpctx->demuxer->audio->id];
if (sh2) {
sh2->ds = mpctx->demuxer->audio;
mpctx->sh_audio = sh2;
- reinit_audio_chain();
+ reinit_audio_chain(mpctx);
}
}
- mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_TRACK=%d\n", audio_id);
+ mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_TRACK=%d\n", opts->audio_id);
return M_PROPERTY_OK;
default:
return M_PROPERTY_NOT_IMPLEMENTED;
@@ -884,9 +914,10 @@ static int mp_property_audio(m_option_t * prop, int action, void *arg,
}
/// Selected video id (RW)
-static int mp_property_video(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_video(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
+ struct MPOpts *opts = &mpctx->opts;
int current_id, tmp;
if (!mpctx->demuxer || !mpctx->demuxer->video)
return M_PROPERTY_UNAVAILABLE;
@@ -903,9 +934,10 @@ static int mp_property_video(m_option_t * prop, int action, void *arg,
return M_PROPERTY_ERROR;
if (current_id < 0)
- *(char **) arg = strdup(MSGTR_Disabled);
+ *(char **) arg = strdup(mp_gtext("disabled"));
else {
- char lang[40] = MSGTR_Unknown;
+ char lang[40];
+ strncpy(lang, mp_gtext("unknown"), sizeof(lang));
*(char **) arg = malloc(64);
snprintf(*(char **) arg, 64, "(%d) %s", current_id, lang);
}
@@ -917,22 +949,22 @@ static int mp_property_video(m_option_t * prop, int action, void *arg,
tmp = *((int *) arg);
else
tmp = -1;
- video_id = demuxer_switch_video(mpctx->demuxer, tmp);
- if (video_id == -2
- || (video_id > -1 && mpctx->demuxer->video->id != current_id
+ opts->video_id = demuxer_switch_video(mpctx->demuxer, tmp);
+ if (opts->video_id == -2
+ || (opts->video_id > -1 && mpctx->demuxer->video->id != current_id
&& current_id != -2))
- uninit_player(INITIALIZED_VCODEC |
- (fixed_vo && video_id != -2 ? 0 : INITIALIZED_VO));
- if (video_id > -1 && mpctx->demuxer->video->id != current_id) {
+ uninit_player(mpctx, INITIALIZED_VCODEC |
+ (mpctx->opts.fixed_vo && opts->video_id != -2 ? 0 : INITIALIZED_VO));
+ if (opts->video_id > -1 && mpctx->demuxer->video->id != current_id) {
sh_video_t *sh2;
sh2 = mpctx->demuxer->v_streams[mpctx->demuxer->video->id];
if (sh2) {
sh2->ds = mpctx->demuxer->video;
mpctx->sh_video = sh2;
- reinit_video_chain();
+ reinit_video_chain(mpctx);
}
}
- mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_TRACK=%d\n", video_id);
+ mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_TRACK=%d\n", opts->video_id);
return M_PROPERTY_OK;
default:
@@ -940,8 +972,8 @@ static int mp_property_video(m_option_t * prop, int action, void *arg,
}
}
-static int mp_property_program(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_program(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
demux_program_t prog;
@@ -977,8 +1009,8 @@ static int mp_property_program(m_option_t * prop, int action, void *arg,
///@{
/// Fullscreen state (RW)
-static int mp_property_fullscreen(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_fullscreen(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->video_out)
@@ -993,21 +1025,17 @@ static int mp_property_fullscreen(m_option_t * prop, int action, void *arg,
return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
-#ifdef CONFIG_GUI
- if (use_gui)
- guiGetEvent(guiIEvent, (char *) MP_CMD_GUI_FULLSCREEN);
- else
-#endif
- if (vo_config_count)
- mpctx->video_out->control(VOCTRL_FULLSCREEN, 0);
+ if (mpctx->video_out->config_ok)
+ vo_control(mpctx->video_out, VOCTRL_FULLSCREEN, 0);
+ mpctx->opts.fullscreen = vo_fs;
return M_PROPERTY_OK;
default:
return m_property_flag(prop, action, arg, &vo_fs);
}
}
-static int mp_property_deinterlace(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_deinterlace(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
int deinterlace;
vf_instance_t *vf;
@@ -1031,20 +1059,62 @@ static int mp_property_deinterlace(m_option_t * prop, int action,
vf->control(vf, VFCTRL_GET_DEINTERLACE, &deinterlace);
deinterlace = !deinterlace;
vf->control(vf, VFCTRL_SET_DEINTERLACE, &deinterlace);
- set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDDeinterlace,
- deinterlace ? MSGTR_Enabled : MSGTR_Disabled);
+ return M_PROPERTY_OK;
+ }
+ int value = 0;
+ vf->control(vf, VFCTRL_GET_DEINTERLACE, &value);
+ return m_property_flag_ro(prop, action, arg, value);
+}
+
+static int mp_property_yuv_colorspace(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
+{
+ if (!mpctx->sh_video || !mpctx->sh_video->vfilter)
+ return M_PROPERTY_UNAVAILABLE;
+
+ struct vf_instance *vf = mpctx->sh_video->vfilter;
+ int colorspace;
+ switch (action) {
+ case M_PROPERTY_GET:
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ if (vf->control(vf, VFCTRL_GET_YUV_COLORSPACE, arg) != true)
+ return M_PROPERTY_UNAVAILABLE;
+ return M_PROPERTY_OK;
+ case M_PROPERTY_PRINT:
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ if (vf->control(vf, VFCTRL_GET_YUV_COLORSPACE, &colorspace) != true)
+ return M_PROPERTY_UNAVAILABLE;
+ char * const names[] = {"BT.601 (SD)", "BT.709 (HD)", "SMPTE-240M"};
+ if (colorspace < 0 || colorspace >= sizeof(names) / sizeof(names[0]))
+ *(char **)arg = strdup("Unknown");
+ else
+ *(char**)arg = strdup(names[colorspace]);
+ return M_PROPERTY_OK;
+ case M_PROPERTY_SET:
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ M_PROPERTY_CLAMP(prop, *(int *) arg);
+ vf->control(vf, VFCTRL_SET_YUV_COLORSPACE, arg);
+ return M_PROPERTY_OK;
+ case M_PROPERTY_STEP_UP:;
+ if (vf->control(vf, VFCTRL_GET_YUV_COLORSPACE, &colorspace) != true)
+ return M_PROPERTY_UNAVAILABLE;
+ colorspace += 1;
+ vf->control(vf, VFCTRL_SET_YUV_COLORSPACE, &colorspace);
return M_PROPERTY_OK;
}
return M_PROPERTY_NOT_IMPLEMENTED;
}
/// Panscan (RW)
-static int mp_property_panscan(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_panscan(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->video_out
- || mpctx->video_out->control(VOCTRL_GET_PANSCAN, NULL) != VO_TRUE)
+ || vo_control(mpctx->video_out, VOCTRL_GET_PANSCAN, NULL) != VO_TRUE)
return M_PROPERTY_UNAVAILABLE;
switch (action) {
@@ -1053,7 +1123,7 @@ static int mp_property_panscan(m_option_t * prop, int action, void *arg,
return M_PROPERTY_ERROR;
M_PROPERTY_CLAMP(prop, *(float *) arg);
vo_panscan = *(float *) arg;
- mpctx->video_out->control(VOCTRL_SET_PANSCAN, NULL);
+ vo_control(mpctx->video_out, VOCTRL_SET_PANSCAN, NULL);
return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
@@ -1063,7 +1133,7 @@ static int mp_property_panscan(m_option_t * prop, int action, void *arg,
vo_panscan = 1;
else if (vo_panscan < 0)
vo_panscan = 0;
- mpctx->video_out->control(VOCTRL_SET_PANSCAN, NULL);
+ vo_control(mpctx->video_out, VOCTRL_SET_PANSCAN, NULL);
return M_PROPERTY_OK;
default:
return m_property_float_range(prop, action, arg, &vo_panscan);
@@ -1073,8 +1143,8 @@ static int mp_property_panscan(m_option_t * prop, int action, void *arg,
/// Helper to set vo flags.
/** \ingroup PropertyImplHelper
*/
-static int mp_property_vo_flag(m_option_t * prop, int action, void *arg,
- int vo_ctrl, int *vo_var, MPContext * mpctx)
+static int mp_property_vo_flag(m_option_t *prop, int action, void *arg,
+ int vo_ctrl, int *vo_var, MPContext *mpctx)
{
if (!mpctx->video_out)
@@ -1089,8 +1159,8 @@ static int mp_property_vo_flag(m_option_t * prop, int action, void *arg,
return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
- if (vo_config_count)
- mpctx->video_out->control(vo_ctrl, 0);
+ if (mpctx->video_out->config_ok)
+ vo_control(mpctx->video_out, vo_ctrl, 0);
return M_PROPERTY_OK;
default:
return m_property_flag(prop, action, arg, vo_var);
@@ -1098,32 +1168,32 @@ static int mp_property_vo_flag(m_option_t * prop, int action, void *arg,
}
/// Window always on top (RW)
-static int mp_property_ontop(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_ontop(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
- return mp_property_vo_flag(prop, action, arg, VOCTRL_ONTOP, &vo_ontop,
- mpctx);
+ return mp_property_vo_flag(prop, action, arg, VOCTRL_ONTOP,
+ &mpctx->opts.vo_ontop, mpctx);
}
/// Display in the root window (RW)
-static int mp_property_rootwin(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_rootwin(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
return mp_property_vo_flag(prop, action, arg, VOCTRL_ROOTWIN,
&vo_rootwin, mpctx);
}
/// Show window borders (RW)
-static int mp_property_border(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_border(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
return mp_property_vo_flag(prop, action, arg, VOCTRL_BORDER,
&vo_border, mpctx);
}
/// Framedropping state (RW)
-static int mp_property_framedropping(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_framedropping(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->sh_video)
@@ -1133,9 +1203,9 @@ static int mp_property_framedropping(m_option_t * prop, int action,
case M_PROPERTY_PRINT:
if (!arg)
return M_PROPERTY_ERROR;
- *(char **) arg = strdup(frame_dropping == 1 ? MSGTR_Enabled :
- (frame_dropping == 2 ? MSGTR_HardFrameDrop :
- MSGTR_Disabled));
+ *(char **) arg = strdup(frame_dropping == 1 ? mp_gtext("enabled") :
+ (frame_dropping == 2 ? mp_gtext("hard") :
+ mp_gtext("disabled")));
return M_PROPERTY_OK;
default:
return m_property_choice(prop, action, arg, &frame_dropping);
@@ -1143,10 +1213,11 @@ static int mp_property_framedropping(m_option_t * prop, int action,
}
/// Color settings, try to use vf/vo then fall back on TV. (RW)
-static int mp_property_gamma(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_gamma(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
- int *gamma = prop->priv, r, val;
+ int *gamma = (int *)((char *)&mpctx->opts + (int)prop->priv);
+ int r, val;
if (!mpctx->sh_video)
return M_PROPERTY_UNAVAILABLE;
@@ -1200,15 +1271,15 @@ static int mp_property_gamma(m_option_t * prop, int action, void *arg,
}
/// VSync (RW)
-static int mp_property_vsync(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_vsync(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
return m_property_flag(prop, action, arg, &vo_vsync);
}
/// Video codec tag (RO)
-static int mp_property_video_format(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_video_format(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
char* meta;
if (!mpctx->sh_video)
@@ -1242,8 +1313,8 @@ static int mp_property_video_format(m_option_t * prop, int action,
}
/// Video codec name (RO)
-static int mp_property_video_codec(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_video_codec(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->sh_video || !mpctx->sh_video->codec)
return M_PROPERTY_UNAVAILABLE;
@@ -1252,8 +1323,8 @@ static int mp_property_video_codec(m_option_t * prop, int action,
/// Video bitrate (RO)
-static int mp_property_video_bitrate(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_video_bitrate(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->sh_video)
return M_PROPERTY_UNAVAILABLE;
@@ -1261,8 +1332,8 @@ static int mp_property_video_bitrate(m_option_t * prop, int action,
}
/// Video display width (RO)
-static int mp_property_width(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_width(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->sh_video)
return M_PROPERTY_UNAVAILABLE;
@@ -1270,8 +1341,8 @@ static int mp_property_width(m_option_t * prop, int action, void *arg,
}
/// Video display height (RO)
-static int mp_property_height(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_height(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->sh_video)
return M_PROPERTY_UNAVAILABLE;
@@ -1279,8 +1350,8 @@ static int mp_property_height(m_option_t * prop, int action, void *arg,
}
/// Video fps (RO)
-static int mp_property_fps(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_fps(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->sh_video)
return M_PROPERTY_UNAVAILABLE;
@@ -1288,8 +1359,8 @@ static int mp_property_fps(m_option_t * prop, int action, void *arg,
}
/// Video aspect (RO)
-static int mp_property_aspect(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_aspect(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->sh_video)
return M_PROPERTY_UNAVAILABLE;
@@ -1303,8 +1374,8 @@ static int mp_property_aspect(m_option_t * prop, int action, void *arg,
///@{
/// Text subtitle position (RW)
-static int mp_property_sub_pos(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_sub_pos(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
switch (action) {
case M_PROPERTY_SET:
@@ -1319,17 +1390,17 @@ static int mp_property_sub_pos(m_option_t * prop, int action, void *arg,
}
/// Selected subtitles (RW)
-static int mp_property_sub(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_sub(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
+ struct MPOpts *opts = &mpctx->opts;
demux_stream_t *const d_sub = mpctx->d_sub;
const int global_sub_size = mpctx->global_sub_size;
int source = -1, reset_spu = 0;
- double pts = 0;
char *sub_name;
if (global_sub_size <= 0)
- return M_PROPERTY_UNAVAILABLE;
+ return M_PROPERTY_UNAVAILABLE;
switch (action) {
case M_PROPERTY_GET:
@@ -1363,10 +1434,10 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
}
#ifdef CONFIG_DVDNAV
if (mpctx->stream->type == STREAMTYPE_DVDNAV) {
- if (vo_spudec && dvdsub_id >= 0) {
+ if (vo_spudec && opts->sub_id >= 0) {
unsigned char lang[3];
- if (mp_dvdnav_lang_from_sid(mpctx->stream, dvdsub_id, lang)) {
- snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang);
+ if (mp_dvdnav_lang_from_sid(mpctx->stream, opts->sub_id, lang)) {
+ snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id, lang);
return M_PROPERTY_OK;
}
}
@@ -1377,37 +1448,38 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
|| mpctx->demuxer->type == DEMUXER_TYPE_LAVF
|| mpctx->demuxer->type == DEMUXER_TYPE_LAVF_PREFERRED
|| mpctx->demuxer->type == DEMUXER_TYPE_OGG)
- && d_sub && d_sub->sh && dvdsub_id >= 0) {
+ && d_sub && d_sub->sh && opts->sub_id >= 0) {
const char* lang = ((sh_sub_t*)d_sub->sh)->lang;
- if (!lang) lang = MSGTR_Unknown;
- snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang);
+ if (!lang) lang = mp_gtext("unknown");
+ snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id, lang);
return M_PROPERTY_OK;
}
if (vo_vobsub && vobsub_id >= 0) {
- const char *language = MSGTR_Unknown;
+ const char *language = mp_gtext("unknown");
language = vobsub_get_id(vo_vobsub, (unsigned int) vobsub_id);
snprintf(*(char **) arg, 63, "(%d) %s",
- vobsub_id, language ? language : MSGTR_Unknown);
+ vobsub_id, language ? language : mp_gtext("unknown"));
return M_PROPERTY_OK;
}
#ifdef CONFIG_DVDREAD
if (vo_spudec && mpctx->stream->type == STREAMTYPE_DVD
- && dvdsub_id >= 0) {
+ && opts->sub_id >= 0) {
char lang[3];
- int code = dvd_lang_from_sid(mpctx->stream, dvdsub_id);
+ int code = dvd_lang_from_sid(mpctx->stream, opts->sub_id);
lang[0] = code >> 8;
lang[1] = code;
lang[2] = 0;
- snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang);
+ snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id, lang);
return M_PROPERTY_OK;
}
#endif
- if (dvdsub_id >= 0) {
- snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, MSGTR_Unknown);
+ if (opts->sub_id >= 0) {
+ snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id,
+ mp_gtext("unknown"));
return M_PROPERTY_OK;
}
- snprintf(*(char **) arg, 63, MSGTR_Disabled);
+ snprintf(*(char **) arg, 63, mp_gtext("disabled"));
return M_PROPERTY_OK;
case M_PROPERTY_SET:
@@ -1448,7 +1520,7 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
subdata = NULL;
vobsub_id = -1;
- dvdsub_id = -1;
+ opts->sub_id = -1;
if (d_sub) {
if (d_sub->id > -2)
reset_spu = 1;
@@ -1464,7 +1536,7 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
mpctx->set_of_sub_pos =
mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_SUBS];
#ifdef CONFIG_ASS
- if (ass_enabled && mpctx->set_of_ass_tracks[mpctx->set_of_sub_pos])
+ if (opts->ass_enabled && mpctx->set_of_ass_tracks[mpctx->set_of_sub_pos])
ass_track = mpctx->set_of_ass_tracks[mpctx->set_of_sub_pos];
else
#endif
@@ -1473,17 +1545,17 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
vo_osd_changed(OSDTYPE_SUBTITLE);
}
} else if (source == SUB_SOURCE_DEMUX) {
- dvdsub_id =
+ opts->sub_id =
mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_DEMUX];
- if (d_sub && dvdsub_id < MAX_S_STREAMS) {
+ if (d_sub && opts->sub_id < MAX_S_STREAMS) {
int i = 0;
// default: assume 1:1 mapping of sid and stream id
- d_sub->id = dvdsub_id;
+ d_sub->id = opts->sub_id;
d_sub->sh = mpctx->demuxer->s_streams[d_sub->id];
ds_free_packs(d_sub);
for (i = 0; i < MAX_S_STREAMS; i++) {
sh_sub_t *sh = mpctx->demuxer->s_streams[i];
- if (sh && sh->sid == dvdsub_id) {
+ if (sh && sh->sid == opts->sub_id) {
d_sub->id = i;
d_sub->sh = sh;
break;
@@ -1492,9 +1564,9 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
if (d_sub->sh && d_sub->id >= 0) {
sh_sub_t *sh = d_sub->sh;
if (sh->type == 'v')
- init_vo_spudec();
+ init_vo_spudec(mpctx);
#ifdef CONFIG_ASS
- else if (ass_enabled)
+ else if (opts->ass_enabled)
ass_track = sh->ass_track;
#endif
} else {
@@ -1507,23 +1579,20 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
if (vo_spudec
&& (mpctx->stream->type == STREAMTYPE_DVD
|| mpctx->stream->type == STREAMTYPE_DVDNAV)
- && dvdsub_id < 0 && reset_spu) {
+ && opts->sub_id < 0 && reset_spu) {
d_sub->id = -2;
d_sub->sh = NULL;
}
#endif
- if (mpctx->sh_audio)
- pts = mpctx->sh_audio->pts;
- if (mpctx->sh_video)
- pts = mpctx->sh_video->pts;
- update_subtitles(mpctx->sh_video, pts, d_sub, 1);
+
+ update_subtitles(mpctx, &mpctx->opts, mpctx->sh_video, 0, 0, d_sub, 1);
return M_PROPERTY_OK;
}
/// Selected sub source (RW)
-static int mp_property_sub_source(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_sub_source(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
int source;
if (!mpctx->sh_video || mpctx->global_sub_size <= 0)
@@ -1543,16 +1612,16 @@ static int mp_property_sub_source(m_option_t * prop, int action, void *arg,
switch (sub_source(mpctx))
{
case SUB_SOURCE_SUBS:
- snprintf(*(char **) arg, 63, MSGTR_SubSourceFile);
+ snprintf(*(char **) arg, 63, mp_gtext("file"));
break;
case SUB_SOURCE_VOBSUB:
- snprintf(*(char **) arg, 63, MSGTR_SubSourceVobsub);
+ snprintf(*(char **) arg, 63, mp_gtext("vobsub"));
break;
case SUB_SOURCE_DEMUX:
- snprintf(*(char **) arg, 63, MSGTR_SubSourceDemux);
+ snprintf(*(char **) arg, 63, mp_gtext("embedded"));
break;
default:
- snprintf(*(char **) arg, 63, MSGTR_Disabled);
+ snprintf(*(char **) arg, 63, mp_gtext("disabled"));
}
return M_PROPERTY_OK;
case M_PROPERTY_SET:
@@ -1600,8 +1669,8 @@ static int mp_property_sub_source(m_option_t * prop, int action, void *arg,
}
/// Selected subtitles from specific source (RW)
-static int mp_property_sub_by_type(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_sub_by_type(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
int source, is_cur_source, offset;
if (!mpctx->sh_video || mpctx->global_sub_size <= 0)
@@ -1640,7 +1709,7 @@ static int mp_property_sub_by_type(m_option_t * prop, int action, void *arg,
return mp_property_sub(prop, M_PROPERTY_PRINT, arg, mpctx);
*(char **) arg = malloc(64);
(*(char **) arg)[63] = 0;
- snprintf(*(char **) arg, 63, MSGTR_Disabled);
+ snprintf(*(char **) arg, 63, mp_gtext("disabled"));
return M_PROPERTY_OK;
case M_PROPERTY_SET:
if (!arg)
@@ -1700,8 +1769,8 @@ static int mp_property_sub_by_type(m_option_t * prop, int action, void *arg,
}
/// Subtitle delay (RW)
-static int mp_property_sub_delay(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_sub_delay(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
if (!mpctx->sh_video)
return M_PROPERTY_UNAVAILABLE;
@@ -1709,10 +1778,10 @@ static int mp_property_sub_delay(m_option_t * prop, int action, void *arg,
}
/// Alignment of text subtitles (RW)
-static int mp_property_sub_alignment(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_sub_alignment(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
- char *name[] = { MSGTR_Top, MSGTR_Center, MSGTR_Bottom };
+ char *name[] = { _("top"), _("center"), _("bottom") };
if (!mpctx->sh_video || mpctx->global_sub_pos < 0
|| sub_source(mpctx) != SUB_SOURCE_SUBS)
@@ -1723,7 +1792,7 @@ static int mp_property_sub_alignment(m_option_t * prop, int action,
if (!arg)
return M_PROPERTY_ERROR;
M_PROPERTY_CLAMP(prop, sub_alignment);
- *(char **) arg = strdup(name[sub_alignment]);
+ *(char **) arg = strdup(mp_gtext(name[sub_alignment]));
return M_PROPERTY_OK;
case M_PROPERTY_SET:
if (!arg)
@@ -1737,8 +1806,8 @@ static int mp_property_sub_alignment(m_option_t * prop, int action,
}
/// Subtitle visibility (RW)
-static int mp_property_sub_visibility(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_sub_visibility(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->sh_video)
return M_PROPERTY_UNAVAILABLE;
@@ -1759,8 +1828,8 @@ static int mp_property_sub_visibility(m_option_t * prop, int action,
#ifdef CONFIG_ASS
/// Use margins for libass subtitles (RW)
-static int mp_property_ass_use_margins(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_ass_use_margins(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!mpctx->sh_video)
return M_PROPERTY_UNAVAILABLE;
@@ -1779,8 +1848,8 @@ static int mp_property_ass_use_margins(m_option_t * prop, int action,
#endif
/// Show only forced subtitles (RW)
-static int mp_property_sub_forced_only(m_option_t * prop, int action,
- void *arg, MPContext * mpctx)
+static int mp_property_sub_forced_only(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
{
if (!vo_spudec)
return M_PROPERTY_UNAVAILABLE;
@@ -1802,9 +1871,10 @@ static int mp_property_sub_forced_only(m_option_t * prop, int action,
#ifdef CONFIG_FREETYPE
/// Subtitle scale (RW)
-static int mp_property_sub_scale(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_sub_scale(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
+ struct MPOpts *opts = &mpctx->opts;
switch (action) {
case M_PROPERTY_SET:
@@ -1812,7 +1882,7 @@ static int mp_property_sub_scale(m_option_t * prop, int action, void *arg,
return M_PROPERTY_ERROR;
M_PROPERTY_CLAMP(prop, *(float *) arg);
#ifdef CONFIG_ASS
- if (ass_enabled) {
+ if (opts->ass_enabled) {
ass_font_scale = *(float *) arg;
ass_force_reload = 1;
}
@@ -1823,7 +1893,7 @@ static int mp_property_sub_scale(m_option_t * prop, int action, void *arg,
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
#ifdef CONFIG_ASS
- if (ass_enabled) {
+ if (opts->ass_enabled) {
ass_font_scale += (arg ? *(float *) arg : 0.1)*
(action == M_PROPERTY_STEP_UP ? 1.0 : -1.0);
M_PROPERTY_CLAMP(prop, ass_font_scale);
@@ -1837,7 +1907,7 @@ static int mp_property_sub_scale(m_option_t * prop, int action, void *arg,
return M_PROPERTY_OK;
default:
#ifdef CONFIG_ASS
- if (ass_enabled)
+ if (opts->ass_enabled)
return m_property_float_ro(prop, action, arg, ass_font_scale);
else
#endif
@@ -1855,8 +1925,8 @@ static int mp_property_sub_scale(m_option_t * prop, int action, void *arg,
#ifdef CONFIG_TV
/// TV color settings (RW)
-static int mp_property_tv_color(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_tv_color(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
int r, val;
tvi_handle_t *tvh = mpctx->demuxer->priv;
@@ -1888,8 +1958,8 @@ static int mp_property_tv_color(m_option_t * prop, int action, void *arg,
#endif
-static int mp_property_teletext_common(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_teletext_common(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
int val,result;
int base_ioctl=(int)prop->priv;
@@ -1928,8 +1998,8 @@ static int mp_property_teletext_common(m_option_t * prop, int action, void *arg,
return result == VBI_CONTROL_TRUE ? M_PROPERTY_OK : M_PROPERTY_ERROR;
}
-static int mp_property_teletext_mode(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_teletext_mode(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
int result;
int val;
@@ -1941,14 +2011,14 @@ static int mp_property_teletext_mode(m_option_t * prop, int action, void *arg,
if(teletext_control(mpctx->demuxer->teletext,
(int)prop->priv, &val)==VBI_CONTROL_TRUE && val)
- mp_input_set_section("teletext");
+ mp_input_set_section(mpctx->input, "teletext");
else
- mp_input_set_section("tv");
+ mp_input_set_section(mpctx->input, "tv");
return M_PROPERTY_OK;
}
-static int mp_property_teletext_page(m_option_t * prop, int action, void *arg,
- MPContext * mpctx)
+static int mp_property_teletext_page(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
{
int result;
int val;
@@ -2039,6 +2109,8 @@ static const m_option_t mp_properties[] = {
M_OPT_RANGE, 0, 1, NULL },
{ "deinterlace", mp_property_deinterlace, CONF_TYPE_FLAG,
M_OPT_RANGE, 0, 1, NULL },
+ { "yuv_colorspace", mp_property_yuv_colorspace, CONF_TYPE_INT,
+ M_OPT_RANGE, 0, 2, NULL },
{ "ontop", mp_property_ontop, CONF_TYPE_FLAG,
M_OPT_RANGE, 0, 1, NULL },
{ "rootwin", mp_property_rootwin, CONF_TYPE_FLAG,
@@ -2048,15 +2120,15 @@ static const m_option_t mp_properties[] = {
{ "framedropping", mp_property_framedropping, CONF_TYPE_INT,
M_OPT_RANGE, 0, 2, NULL },
{ "gamma", mp_property_gamma, CONF_TYPE_INT,
- M_OPT_RANGE, -100, 100, &vo_gamma_gamma },
+ M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_gamma)},
{ "brightness", mp_property_gamma, CONF_TYPE_INT,
- M_OPT_RANGE, -100, 100, &vo_gamma_brightness },
+ M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_brightness) },
{ "contrast", mp_property_gamma, CONF_TYPE_INT,
- M_OPT_RANGE, -100, 100, &vo_gamma_contrast },
+ M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_contrast) },
{ "saturation", mp_property_gamma, CONF_TYPE_INT,
- M_OPT_RANGE, -100, 100, &vo_gamma_saturation },
+ M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_saturation) },
{ "hue", mp_property_gamma, CONF_TYPE_INT,
- M_OPT_RANGE, -100, 100, &vo_gamma_hue },
+ M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_hue) },
{ "panscan", mp_property_panscan, CONF_TYPE_FLOAT,
M_OPT_RANGE, 0, 1, NULL },
{ "vsync", mp_property_vsync, CONF_TYPE_FLAG,
@@ -2147,7 +2219,7 @@ char* mp_property_print(const char *name, void* ctx)
return ret;
}
-char *property_expand_string(MPContext * mpctx, char *str)
+char *property_expand_string(MPContext *mpctx, char *str)
{
return m_properties_expand_string(mp_properties, str, mpctx);
}
@@ -2158,8 +2230,120 @@ void property_print_help(void)
}
-///@}
-// Properties group
+/* List of default ways to show a property on OSD.
+ *
+ * Setting osd_progbar to -1 displays seek bar, other nonzero displays
+ * a bar showing the current position between min/max values of the
+ * property. In this case osd_msg is only used for terminal output
+ * if there is no video; it'll be a label shown together with percentage.
+ *
+ * Otherwise setting osd_msg will show the string on OSD, formatted with
+ * the text value of the property as argument.
+ */
+static struct property_osd_display {
+ /// property name
+ const char *name;
+ /// progressbar type
+ int osd_progbar; // -1 is special value for seek indicators
+ /// osd msg id if it must be shared
+ int osd_id;
+ /// osd msg template
+ const char *osd_msg;
+} property_osd_display[] = {
+ // general
+ { "loop", 0, -1, _("Loop: %s") },
+ { "chapter", -1, -1, NULL },
+ // audio
+ { "volume", OSD_VOLUME, -1, _("Volume") },
+ { "mute", 0, -1, _("Mute: %s") },
+ { "audio_delay", 0, -1, _("A-V delay: %s") },
+ { "switch_audio", 0, -1, _("Audio: %s") },
+ { "balance", OSD_BALANCE, -1, _("Balance") },
+ // video
+ { "panscan", OSD_PANSCAN, -1, _("Panscan") },
+ { "ontop", 0, -1, _("Stay on top: %s") },
+ { "rootwin", 0, -1, _("Rootwin: %s") },
+ { "border", 0, -1, _("Border: %s") },
+ { "framedropping", 0, -1, _("Framedropping: %s") },
+ { "deinterlace", 0, -1, _("Deinterlace: %s") },
+ { "yuv_colorspace", 0, -1, _("YUV colorspace: %s") },
+ { "gamma", OSD_BRIGHTNESS, -1, _("Gamma") },
+ { "brightness", OSD_BRIGHTNESS, -1, _("Brightness") },
+ { "contrast", OSD_CONTRAST, -1, _("Contrast") },
+ { "saturation", OSD_SATURATION, -1, _("Saturation") },
+ { "hue", OSD_HUE, -1, _("Hue") },
+ { "vsync", 0, -1, _("VSync: %s") },
+ // subs
+ { "sub", 0, -1, _("Subtitles: %s") },
+ { "sub_source", 0, -1, _("Sub source: %s") },
+ { "sub_vob", 0, -1, _("Subtitles: %s") },
+ { "sub_demux", 0, -1, _("Subtitles: %s") },
+ { "sub_file", 0, -1, _("Subtitles: %s") },
+ { "sub_pos", 0, -1, _("Sub position: %s/100") },
+ { "sub_alignment", 0, -1, _("Sub alignment: %s") },
+ { "sub_delay", 0, OSD_MSG_SUB_DELAY, _("Sub delay: %s") },
+ { "sub_visibility", 0, -1, _("Subtitles: %s") },
+ { "sub_forced_only", 0, -1, _("Forced sub only: %s") },
+#ifdef CONFIG_FREETYPE
+ { "sub_scale", 0, -1, _("Sub Scale: %s")},
+#endif
+#ifdef CONFIG_TV
+ { "tv_brightness", OSD_BRIGHTNESS, -1, _("Brightness") },
+ { "tv_hue", OSD_HUE, -1, _("Hue") },
+ { "tv_saturation", OSD_SATURATION, -1, _("Saturation") },
+ { "tv_contrast", OSD_CONTRAST, -1, _("Contrast") },
+#endif
+ {}
+};
+
+static int show_property_osd(MPContext *mpctx, const char *pname)
+{
+ struct MPOpts *opts = &mpctx->opts;
+ int r;
+ m_option_t* prop;
+ struct property_osd_display *p;
+
+ // look for the command
+ for (p = property_osd_display; p->name; p++)
+ if (!strcmp(p->name, pname))
+ break;
+ if (!p->name)
+ return -1;
+
+ if (mp_property_do(pname, M_PROPERTY_GET_TYPE, &prop, mpctx) <= 0 || !prop)
+ return -1;
+
+ if (p->osd_progbar == -1)
+ mpctx->add_osd_seek_info = true;
+ else if (p->osd_progbar) {
+ if (prop->type == CONF_TYPE_INT) {
+ if (mp_property_do(pname, M_PROPERTY_GET, &r, mpctx) > 0)
+ set_osd_bar(mpctx, p->osd_progbar, mp_gtext(p->osd_msg),
+ prop->min, prop->max, r);
+ } else if (prop->type == CONF_TYPE_FLOAT) {
+ float f;
+ if (mp_property_do(pname, M_PROPERTY_GET, &f, mpctx) > 0)
+ set_osd_bar(mpctx, p->osd_progbar, mp_gtext(p->osd_msg),
+ prop->min, prop->max, f);
+ } else {
+ mp_msg(MSGT_CPLAYER, MSGL_ERR,
+ "Property use an unsupported type.\n");
+ return -1;
+ }
+ return 0;
+ }
+
+ if (p->osd_msg) {
+ char *val = mp_property_print(pname, mpctx);
+ if (val) {
+ int index = p - property_osd_display;
+ set_osd_tmsg(p->osd_id >= 0 ? p->osd_id : OSD_MSG_PROPERTY + index,
+ 1, opts->osd_duration, p->osd_msg, val);
+ free(val);
+ }
+ }
+ return 0;
+}
/**
@@ -2189,65 +2373,59 @@ static struct {
int cmd;
/// set/adjust or toggle command
int toggle;
- /// progressbar type
- int osd_progbar;
- /// osd msg id if it must be shared
- int osd_id;
- /// osd msg template
- const char *osd_msg;
} set_prop_cmd[] = {
// general
- { "loop", MP_CMD_LOOP, 0, 0, -1, MSGTR_LoopStatus },
- { "chapter", MP_CMD_SEEK_CHAPTER, 0, 0, -1, NULL },
- { "angle", MP_CMD_SWITCH_ANGLE, 0, 0, -1, NULL },
+ { "loop", MP_CMD_LOOP, 0},
+ { "chapter", MP_CMD_SEEK_CHAPTER, 0},
+ { "angle", MP_CMD_SWITCH_ANGLE, 0},
+ { "pause", MP_CMD_PAUSE, 0},
// audio
- { "volume", MP_CMD_VOLUME, 0, OSD_VOLUME, -1, MSGTR_Volume },
- { "mute", MP_CMD_MUTE, 1, 0, -1, MSGTR_MuteStatus },
- { "audio_delay", MP_CMD_AUDIO_DELAY, 0, 0, -1, MSGTR_AVDelayStatus },
- { "switch_audio", MP_CMD_SWITCH_AUDIO, 1, 0, -1, MSGTR_OSDAudio },
- { "balance", MP_CMD_BALANCE, 0, OSD_BALANCE, -1, MSGTR_Balance },
+ { "volume", MP_CMD_VOLUME, 0},
+ { "mute", MP_CMD_MUTE, 1},
+ { "audio_delay", MP_CMD_AUDIO_DELAY, 0},
+ { "switch_audio", MP_CMD_SWITCH_AUDIO, 1},
+ { "balance", MP_CMD_BALANCE, 0},
// video
- { "fullscreen", MP_CMD_VO_FULLSCREEN, 1, 0, -1, NULL },
- { "panscan", MP_CMD_PANSCAN, 0, OSD_PANSCAN, -1, MSGTR_Panscan },
- { "ontop", MP_CMD_VO_ONTOP, 1, 0, -1, MSGTR_OnTopStatus },
- { "rootwin", MP_CMD_VO_ROOTWIN, 1, 0, -1, MSGTR_RootwinStatus },
- { "border", MP_CMD_VO_BORDER, 1, 0, -1, MSGTR_BorderStatus },
- { "framedropping", MP_CMD_FRAMEDROPPING, 1, 0, -1, MSGTR_FramedroppingStatus },
- { "gamma", MP_CMD_GAMMA, 0, OSD_BRIGHTNESS, -1, MSGTR_Gamma },
- { "brightness", MP_CMD_BRIGHTNESS, 0, OSD_BRIGHTNESS, -1, MSGTR_Brightness },
- { "contrast", MP_CMD_CONTRAST, 0, OSD_CONTRAST, -1, MSGTR_Contrast },
- { "saturation", MP_CMD_SATURATION, 0, OSD_SATURATION, -1, MSGTR_Saturation },
- { "hue", MP_CMD_HUE, 0, OSD_HUE, -1, MSGTR_Hue },
- { "vsync", MP_CMD_SWITCH_VSYNC, 1, 0, -1, MSGTR_VSyncStatus },
- // subs
- { "sub", MP_CMD_SUB_SELECT, 1, 0, -1, MSGTR_SubSelectStatus },
- { "sub_source", MP_CMD_SUB_SOURCE, 1, 0, -1, MSGTR_SubSourceStatus },
- { "sub_vob", MP_CMD_SUB_VOB, 1, 0, -1, MSGTR_SubSelectStatus },
- { "sub_demux", MP_CMD_SUB_DEMUX, 1, 0, -1, MSGTR_SubSelectStatus },
- { "sub_file", MP_CMD_SUB_FILE, 1, 0, -1, MSGTR_SubSelectStatus },
- { "sub_pos", MP_CMD_SUB_POS, 0, 0, -1, MSGTR_SubPosStatus },
- { "sub_alignment", MP_CMD_SUB_ALIGNMENT, 1, 0, -1, MSGTR_SubAlignStatus },
- { "sub_delay", MP_CMD_SUB_DELAY, 0, 0, OSD_MSG_SUB_DELAY, MSGTR_SubDelayStatus },
- { "sub_visibility", MP_CMD_SUB_VISIBILITY, 1, 0, -1, MSGTR_SubVisibleStatus },
- { "sub_forced_only", MP_CMD_SUB_FORCED_ONLY, 1, 0, -1, MSGTR_SubForcedOnlyStatus },
+ { "fullscreen", MP_CMD_VO_FULLSCREEN, 1},
+ { "panscan", MP_CMD_PANSCAN, 0},
+ { "ontop", MP_CMD_VO_ONTOP, 1},
+ { "rootwin", MP_CMD_VO_ROOTWIN, 1},
+ { "border", MP_CMD_VO_BORDER, 1},
+ { "framedropping", MP_CMD_FRAMEDROPPING, 1},
+ { "gamma", MP_CMD_GAMMA, 0},
+ { "brightness", MP_CMD_BRIGHTNESS, 0},
+ { "contrast", MP_CMD_CONTRAST, 0},
+ { "saturation", MP_CMD_SATURATION, 0},
+ { "hue", MP_CMD_HUE, 0},
+ { "vsync", MP_CMD_SWITCH_VSYNC, 1},
+ // subs
+ { "sub", MP_CMD_SUB_SELECT, 1},
+ { "sub_source", MP_CMD_SUB_SOURCE, 1},
+ { "sub_vob", MP_CMD_SUB_VOB, 1},
+ { "sub_demux", MP_CMD_SUB_DEMUX, 1},
+ { "sub_file", MP_CMD_SUB_FILE, 1},
+ { "sub_pos", MP_CMD_SUB_POS, 0},
+ { "sub_alignment", MP_CMD_SUB_ALIGNMENT, 1},
+ { "sub_delay", MP_CMD_SUB_DELAY, 0},
+ { "sub_visibility", MP_CMD_SUB_VISIBILITY, 1},
+ { "sub_forced_only", MP_CMD_SUB_FORCED_ONLY, 1},
#ifdef CONFIG_FREETYPE
- { "sub_scale", MP_CMD_SUB_SCALE, 0, 0, -1, MSGTR_SubScale},
+ { "sub_scale", MP_CMD_SUB_SCALE, 0},
#endif
#ifdef CONFIG_ASS
- { "ass_use_margins", MP_CMD_ASS_USE_MARGINS, 1, 0, -1, NULL },
+ { "ass_use_margins", MP_CMD_ASS_USE_MARGINS, 1},
#endif
#ifdef CONFIG_TV
- { "tv_brightness", MP_CMD_TV_SET_BRIGHTNESS, 0, OSD_BRIGHTNESS, -1, MSGTR_Brightness },
- { "tv_hue", MP_CMD_TV_SET_HUE, 0, OSD_HUE, -1, MSGTR_Hue },
- { "tv_saturation", MP_CMD_TV_SET_SATURATION, 0, OSD_SATURATION, -1, MSGTR_Saturation },
- { "tv_contrast", MP_CMD_TV_SET_CONTRAST, 0, OSD_CONTRAST, -1, MSGTR_Contrast },
+ { "tv_brightness", MP_CMD_TV_SET_BRIGHTNESS, 0},
+ { "tv_hue", MP_CMD_TV_SET_HUE, 0},
+ { "tv_saturation", MP_CMD_TV_SET_SATURATION, 0},
+ { "tv_contrast", MP_CMD_TV_SET_CONTRAST, 0},
#endif
- { NULL, 0, 0, 0, -1, NULL }
+ {}
};
-
/// Handle commands that set a property.
-static int set_property_command(MPContext * mpctx, mp_cmd_t * cmd)
+static int set_property_command(MPContext *mpctx, mp_cmd_t *cmd)
{
int i, r;
m_option_t* prop;
@@ -2278,31 +2456,8 @@ static int set_property_command(MPContext * mpctx, mp_cmd_t * cmd)
if (r <= 0)
return 1;
- if (set_prop_cmd[i].osd_progbar) {
- if (prop->type == CONF_TYPE_INT) {
- if (mp_property_do(pname, M_PROPERTY_GET, &r, mpctx) > 0)
- set_osd_bar(set_prop_cmd[i].osd_progbar,
- set_prop_cmd[i].osd_msg, prop->min, prop->max, r);
- } else if (prop->type == CONF_TYPE_FLOAT) {
- float f;
- if (mp_property_do(pname, M_PROPERTY_GET, &f, mpctx) > 0)
- set_osd_bar(set_prop_cmd[i].osd_progbar,
- set_prop_cmd[i].osd_msg, prop->min, prop->max, f);
- } else
- mp_msg(MSGT_CPLAYER, MSGL_ERR,
- "Property use an unsupported type.\n");
- return 1;
- }
+ show_property_osd(mpctx, pname);
- if (set_prop_cmd[i].osd_msg) {
- char *val = mp_property_print(pname, mpctx);
- if (val) {
- set_osd_msg(set_prop_cmd[i].osd_id >=
- 0 ? set_prop_cmd[i].osd_id : OSD_MSG_PROPERTY + i,
- 1, osd_duration, set_prop_cmd[i].osd_msg, val);
- free(val);
- }
- }
return 1;
}
@@ -2360,7 +2515,7 @@ static void remove_subtitle_range(MPContext *mpctx, int start, int count)
int after = mpctx->set_of_sub_size - end;
sub_data **subs = mpctx->set_of_subtitles;
#ifdef CONFIG_ASS
- ass_track_t **ass_tracks = mpctx->set_of_ass_tracks;
+ struct ass_track **ass_tracks = mpctx->set_of_ass_tracks;
#endif
if (count < 0 || count > mpctx->set_of_sub_size ||
start < 0 || start > mpctx->set_of_sub_size - count) {
@@ -2371,7 +2526,7 @@ static void remove_subtitle_range(MPContext *mpctx, int start, int count)
for (idx = start; idx < end; idx++) {
sub_data *subd = subs[idx];
mp_msg(MSGT_CPLAYER, MSGL_STATUS,
- MSGTR_RemovedSubtitleFile, idx + 1,
+ "SUB: Removed subtitle file (%d): %s\n", idx + 1,
filename_recode(subd->filename));
sub_free(subd);
subs[idx] = NULL;
@@ -2400,46 +2555,49 @@ static void remove_subtitle_range(MPContext *mpctx, int start, int count)
#ifdef CONFIG_ASS
ass_track = NULL;
#endif
- mp_input_queue_cmd(mp_input_parse_cmd("sub_select"));
+ mp_input_queue_cmd(mpctx->input, mp_input_parse_cmd("sub_select"));
} else if (mpctx->set_of_sub_pos >= end) {
mpctx->set_of_sub_pos -= count;
mpctx->global_sub_pos -= count;
}
}
-int run_command(MPContext * mpctx, mp_cmd_t * cmd)
+void run_command(MPContext *mpctx, mp_cmd_t *cmd)
{
+ struct MPOpts *opts = &mpctx->opts;
sh_audio_t * const sh_audio = mpctx->sh_audio;
sh_video_t * const sh_video = mpctx->sh_video;
- int brk_cmd = 0;
+ int osd_duration = opts->osd_duration;
+ int case_fallthrough_hack = 0;
if (!set_property_command(mpctx, cmd))
switch (cmd->id) {
case MP_CMD_SEEK:{
float v;
int abs;
- if (sh_video)
- mpctx->osd_show_percentage = sh_video->fps;
+ mpctx->add_osd_seek_info = true;
v = cmd->args[0].v.f;
abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0;
if (abs == 2) { /* Absolute seek to a specific timestamp in seconds */
- abs_seek_pos = SEEK_ABSOLUTE;
+ mpctx->abs_seek_pos = SEEK_ABSOLUTE;
if (sh_video)
mpctx->osd_function =
(v > sh_video->pts) ? OSD_FFW : OSD_REW;
- rel_seek_secs = v;
+ mpctx->rel_seek_secs = v;
} else if (abs) { /* Absolute seek by percentage */
- abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR;
+ mpctx->abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR;
if (sh_video)
mpctx->osd_function = OSD_FFW; // Direction isn't set correctly
- rel_seek_secs = v / 100.0;
+ mpctx->rel_seek_secs = v / 100.0;
} else {
- rel_seek_secs += v;
+ mpctx->rel_seek_secs += v;
mpctx->osd_function = (v > 0) ? OSD_FFW : OSD_REW;
}
- brk_cmd = 1;
}
break;
+ case MP_CMD_SET_PROPERTY_OSD:
+ case_fallthrough_hack = 1;
+
case MP_CMD_SET_PROPERTY:{
int r = mp_property_do(cmd->args[0].v.s, M_PROPERTY_PARSE,
cmd->args[1].v.s, mpctx);
@@ -2450,11 +2608,16 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
mp_msg(MSGT_CPLAYER, MSGL_WARN,
"Failed to set property '%s' to '%s'.\n",
cmd->args[0].v.s, cmd->args[1].v.s);
+ else if (case_fallthrough_hack)
+ show_property_osd(mpctx, cmd->args[0].v.s);
if (r <= 0)
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_ERROR=%s\n", property_error_string(r));
}
break;
+ case MP_CMD_STEP_PROPERTY_OSD:
+ case_fallthrough_hack = 1;
+
case MP_CMD_STEP_PROPERTY:{
void* arg = NULL;
int r,i;
@@ -2493,6 +2656,8 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
mp_msg(MSGT_CPLAYER, MSGL_WARN,
"Failed to increment property '%s' by %f.\n",
cmd->args[0].v.s, cmd->args[1].v.f);
+ else if (case_fallthrough_hack)
+ show_property_osd(mpctx, cmd->args[0].v.s);
if (r <= 0)
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_ERROR=%s\n", property_error_string(r));
}
@@ -2518,18 +2683,16 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
case MP_CMD_EDL_MARK:
if (edl_fd) {
float v = sh_video ? sh_video->pts :
- playing_audio_pts(sh_audio, mpctx->d_audio,
- mpctx->audio_out);
-
+ playing_audio_pts(mpctx);
if (mpctx->begin_skip == MP_NOPTS_VALUE) {
mpctx->begin_skip = v;
- mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutStartSkip);
+ mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "EDL skip start, press 'i' again to end block.\n");
} else {
if (mpctx->begin_skip > v)
- mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdloutBadStop);
+ mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "EDL skip canceled, last start > stop\n");
else {
fprintf(edl_fd, "%f %f %d\n", mpctx->begin_skip, v, 0);
- mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutEndSkip);
+ mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "EDL skip end, line written.\n");
}
mpctx->begin_skip = MP_NOPTS_VALUE;
}
@@ -2540,40 +2703,38 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
if (!sh_video)
break;
if (cmd->nargs == 0 || cmd->args[0].v.f == -1)
- movie_aspect = (float) sh_video->disp_w / sh_video->disp_h;
+ opts->movie_aspect = (float) sh_video->disp_w / sh_video->disp_h;
else
- movie_aspect = cmd->args[0].v.f;
+ opts->movie_aspect = cmd->args[0].v.f;
mpcodecs_config_vo(sh_video, sh_video->disp_w, sh_video->disp_h, 0);
break;
case MP_CMD_SPEED_INCR:{
float v = cmd->args[0].v.f;
- playback_speed += v;
- build_afilter_chain(sh_audio, &ao_data);
- set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed,
- playback_speed);
+ opts->playback_speed += v;
+ build_afilter_chain(mpctx, sh_audio, &ao_data);
+ set_osd_tmsg(OSD_MSG_SPEED, 1, osd_duration, "Speed: x %6.2f",
+ opts->playback_speed);
} break;
case MP_CMD_SPEED_MULT:{
float v = cmd->args[0].v.f;
- playback_speed *= v;
- build_afilter_chain(sh_audio, &ao_data);
- set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed,
- playback_speed);
+ opts->playback_speed *= v;
+ build_afilter_chain(mpctx, sh_audio, &ao_data);
+ set_osd_tmsg(OSD_MSG_SPEED, 1, osd_duration, "Speed: x %6.2f",
+ opts->playback_speed);
} break;
case MP_CMD_SPEED_SET:{
float v = cmd->args[0].v.f;
- playback_speed = v;
- build_afilter_chain(sh_audio, &ao_data);
- set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed,
- playback_speed);
+ opts->playback_speed = v;
+ build_afilter_chain(mpctx, sh_audio, &ao_data);
+ set_osd_tmsg(OSD_MSG_SPEED, 1, osd_duration, "Speed: x %6.2f",
+ opts->playback_speed);
} break;
case MP_CMD_FRAME_STEP:
- case MP_CMD_PAUSE:
- cmd->pausing = 1;
- brk_cmd = 1;
+ add_step_frame(mpctx);
break;
case MP_CMD_FILE_FILTER:
@@ -2581,38 +2742,26 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_QUIT:
- exit_player_with_rc(EXIT_QUIT,
+ exit_player_with_rc(mpctx, EXIT_QUIT,
(cmd->nargs > 0) ? cmd->args[0].v.i : 0);
case MP_CMD_PLAY_TREE_STEP:{
int n = cmd->args[0].v.i == 0 ? 1 : cmd->args[0].v.i;
int force = cmd->args[1].v.i;
-#ifdef CONFIG_GUI
- if (use_gui) {
- int i = 0;
- if (n > 0)
- for (i = 0; i < n; i++)
- mplNext();
- else
- for (i = 0; i < -1 * n; i++)
- mplPrev();
- } else
-#endif
{
if (!force && mpctx->playtree_iter) {
play_tree_iter_t *i =
play_tree_iter_new_copy(mpctx->playtree_iter);
if (play_tree_iter_step(i, n, 0) ==
PLAY_TREE_ITER_ENTRY)
- mpctx->eof =
+ mpctx->stop_play =
(n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
play_tree_iter_free(i);
} else
- mpctx->eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
- if (mpctx->eof)
+ mpctx->stop_play = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
+ if (mpctx->stop_play)
mpctx->play_tree_step = n;
- brk_cmd = 1;
}
}
break;
@@ -2625,11 +2774,10 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
play_tree_iter_t *i =
play_tree_iter_new_copy(mpctx->playtree_iter);
if (play_tree_iter_up_step(i, n, 0) == PLAY_TREE_ITER_ENTRY)
- mpctx->eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
+ mpctx->stop_play = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
play_tree_iter_free(i);
} else
- mpctx->eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
- brk_cmd = 1;
+ mpctx->stop_play = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
}
break;
@@ -2639,11 +2787,10 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
if (v > 0
&& mpctx->playtree_iter->file <
mpctx->playtree_iter->num_files)
- mpctx->eof = PT_NEXT_SRC;
+ mpctx->stop_play = PT_NEXT_SRC;
else if (v < 0 && mpctx->playtree_iter->file > 1)
- mpctx->eof = PT_PREV_SRC;
+ mpctx->stop_play = PT_PREV_SRC;
}
- brk_cmd = 1;
break;
case MP_CMD_SUB_STEP:
@@ -2657,32 +2804,32 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
(sh_video->pts +
sub_delay) * 1000 + .5, movement) / 1000.;
#endif
- set_osd_msg(OSD_MSG_SUB_DELAY, 1, osd_duration,
- MSGTR_OSDSubDelay, ROUND(sub_delay * 1000));
+ set_osd_tmsg(OSD_MSG_SUB_DELAY, 1, osd_duration,
+ "Sub delay: %d ms", ROUND(sub_delay * 1000));
}
break;
case MP_CMD_SUB_LOG:
- log_sub();
+ log_sub(mpctx);
break;
case MP_CMD_OSD:{
int v = cmd->args[0].v.i;
int max = (term_osd
&& !sh_video) ? MAX_TERM_OSD_LEVEL : MAX_OSD_LEVEL;
- if (osd_level > max)
- osd_level = max;
+ if (opts->osd_level > max)
+ opts->osd_level = max;
if (v < 0)
- osd_level = (osd_level + 1) % (max + 1);
+ opts->osd_level = (opts->osd_level + 1) % (max + 1);
else
- osd_level = v > max ? max : v;
+ opts->osd_level = v > max ? max : v;
/* Show OSD state when disabled, but not when an explicit
argument is given to the OSD command, i.e. in slave mode. */
- if (v == -1 && osd_level <= 1)
- set_osd_msg(OSD_MSG_OSD_STATUS, 0, osd_duration,
- MSGTR_OSDosd,
- osd_level ? MSGTR_OSDenabled :
- MSGTR_OSDdisabled);
+ if (v == -1 && opts->osd_level <= 1)
+ set_osd_tmsg(OSD_MSG_OSD_STATUS, 0, osd_duration,
+ "OSD: %s",
+ opts->osd_level ? mp_gtext("enabled") :
+ mp_gtext("disabled"));
else
rm_osd_msg(OSD_MSG_OSD_STATUS);
}
@@ -2724,17 +2871,16 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
play_tree_free_list(mpctx->playtree->child, 1);
play_tree_set_child(mpctx->playtree, e);
pt_iter_goto_head(mpctx->playtree_iter);
- mpctx->eof = PT_NEXT_SRC;
+ mpctx->stop_play = PT_NEXT_SRC;
}
- brk_cmd = 1;
}
break;
case MP_CMD_LOADLIST:{
- play_tree_t *e = parse_playlist_file(cmd->args[0].v.s);
+ play_tree_t *e = parse_playlist_file(mpctx->mconfig, cmd->args[0].v.s);
if (!e)
- mp_msg(MSGT_CPLAYER, MSGL_ERR,
- MSGTR_PlaylistLoadUnable, cmd->args[0].v.s);
+ mp_tmsg(MSGT_CPLAYER, MSGL_ERR,
+ "\nUnable to load playlist %s.\n", cmd->args[0].v.s);
else {
if (cmd->args[1].v.i) // append
play_tree_append_entry(mpctx->playtree->child, e);
@@ -2747,10 +2893,9 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
play_tree_free_list(mpctx->playtree->child, 1);
play_tree_set_child(mpctx->playtree, e);
pt_iter_goto_head(mpctx->playtree_iter);
- mpctx->eof = PT_NEXT_SRC;
+ mpctx->stop_play = PT_NEXT_SRC;
}
}
- brk_cmd = 1;
}
break;
@@ -2759,8 +2904,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
while (play_tree_iter_up_step
(mpctx->playtree_iter, 0, 1) != PLAY_TREE_ITER_END)
/* NOP */ ;
- mpctx->eof = PT_STOP;
- brk_cmd = 1;
+ mpctx->stop_play = PT_STOP;
break;
#ifdef CONFIG_RADIO
@@ -2774,9 +2918,9 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
radio_step_channel(mpctx->demuxer->stream,
RADIO_CHANNEL_LOWER);
if (radio_get_channel_name(mpctx->demuxer->stream)) {
- set_osd_msg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration,
- MSGTR_OSDChannel,
- radio_get_channel_name(mpctx->demuxer->stream));
+ set_osd_tmsg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration,
+ "Channel: %s",
+ radio_get_channel_name(mpctx->demuxer->stream));
}
}
break;
@@ -2785,9 +2929,9 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) {
radio_set_channel(mpctx->demuxer->stream, cmd->args[0].v.s);
if (radio_get_channel_name(mpctx->demuxer->stream)) {
- set_osd_msg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration,
- MSGTR_OSDChannel,
- radio_get_channel_name(mpctx->demuxer->stream));
+ set_osd_tmsg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration,
+ "Channel: %s",
+ radio_get_channel_name(mpctx->demuxer->stream));
}
}
break;
@@ -2855,8 +2999,8 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
TV_CHANNEL_LOWER);
}
if (tv_channel_list) {
- set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
- MSGTR_OSDChannel, tv_channel_current->name);
+ set_osd_tmsg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
+ "Channel: %s", tv_channel_current->name);
//vo_osd_changed(OSDTYPE_SUBTITLE);
}
}
@@ -2882,8 +3026,10 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
dir = DVB_CHANNEL_LOWER;
- if (dvb_step_channel(mpctx->stream, dir))
- mpctx->eof = mpctx->dvbin_reopen = 1;
+ if (dvb_step_channel(mpctx->stream, dir)) {
+ mpctx->stop_play = PT_NEXT_ENTRY;
+ mpctx->dvbin_reopen = 1;
+ }
}
#endif /* CONFIG_DVBIN */
break;
@@ -2893,8 +3039,8 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
tv_set_channel((tvi_handle_t *) (mpctx->demuxer->priv),
cmd->args[0].v.s);
if (tv_channel_list) {
- set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
- MSGTR_OSDChannel, tv_channel_current->name);
+ set_osd_tmsg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
+ "Channel: %s", tv_channel_current->name);
//vo_osd_changed(OSDTYPE_SUBTITLE);
}
}
@@ -2913,9 +3059,11 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
if (mpctx->stream->type == STREAMTYPE_DVB) {
mpctx->last_dvb_step = 1;
- if (dvb_set_channel
- (mpctx->stream, cmd->args[1].v.i, cmd->args[0].v.i))
- mpctx->eof = mpctx->dvbin_reopen = 1;
+ if (dvb_set_channel(mpctx->stream, cmd->args[1].v.i,
+ cmd->args[0].v.i)) {
+ mpctx->stop_play = PT_NEXT_ENTRY;
+ mpctx->dvbin_reopen = 1;
+ }
}
break;
#endif /* CONFIG_DVBIN */
@@ -2924,8 +3072,8 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
if (mpctx->file_format == DEMUXER_TYPE_TV) {
tv_last_channel((tvi_handle_t *) (mpctx->demuxer->priv));
if (tv_channel_list) {
- set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
- MSGTR_OSDChannel, tv_channel_current->name);
+ set_osd_tmsg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
+ "Channel: %s", tv_channel_current->name);
//vo_osd_changed(OSDTYPE_SUBTITLE);
}
}
@@ -2967,7 +3115,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
case MP_CMD_SUB_LOAD:
if (sh_video) {
int n = mpctx->set_of_sub_size;
- add_subtitles(cmd->args[0].v.s, sh_video->fps, 0);
+ add_subtitles(mpctx, cmd->args[0].v.s, sh_video->fps, 0);
if (n != mpctx->set_of_sub_size) {
if (mpctx->global_sub_indices[SUB_SOURCE_SUBS] < 0)
mpctx->global_sub_indices[SUB_SOURCE_SUBS] =
@@ -2996,7 +3144,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_SCREENSHOT:
- if (vo_config_count) {
+ if (mpctx->video_out && mpctx->video_out->config_ok) {
mp_msg(MSGT_CPLAYER, MSGL_INFO, "sending VFCTRL_SCREENSHOT!\n");
if (CONTROL_OK !=
((vf_instance_t *) sh_video->vfilter)->
@@ -3013,19 +3161,19 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_TIME_LENGTH:{
- mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_LENGTH=%.2lf\n",
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_LENGTH=%.2f\n",
demuxer_get_time_length(mpctx->demuxer));
}
break;
case MP_CMD_GET_FILENAME:{
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_FILENAME='%s'\n",
- get_metadata(META_NAME));
+ get_metadata(mpctx, META_NAME));
}
break;
case MP_CMD_GET_VIDEO_CODEC:{
- char *inf = get_metadata(META_VIDEO_CODEC);
+ char *inf = get_metadata(mpctx, META_VIDEO_CODEC);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VIDEO_CODEC='%s'\n", inf);
@@ -3034,7 +3182,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_VIDEO_BITRATE:{
- char *inf = get_metadata(META_VIDEO_BITRATE);
+ char *inf = get_metadata(mpctx, META_VIDEO_BITRATE);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VIDEO_BITRATE='%s'\n", inf);
@@ -3043,7 +3191,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_VIDEO_RESOLUTION:{
- char *inf = get_metadata(META_VIDEO_RESOLUTION);
+ char *inf = get_metadata(mpctx, META_VIDEO_RESOLUTION);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO,
@@ -3053,7 +3201,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_AUDIO_CODEC:{
- char *inf = get_metadata(META_AUDIO_CODEC);
+ char *inf = get_metadata(mpctx, META_AUDIO_CODEC);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_AUDIO_CODEC='%s'\n", inf);
@@ -3062,7 +3210,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_AUDIO_BITRATE:{
- char *inf = get_metadata(META_AUDIO_BITRATE);
+ char *inf = get_metadata(mpctx, META_AUDIO_BITRATE);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_AUDIO_BITRATE='%s'\n", inf);
@@ -3071,7 +3219,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_AUDIO_SAMPLES:{
- char *inf = get_metadata(META_AUDIO_SAMPLES);
+ char *inf = get_metadata(mpctx, META_AUDIO_SAMPLES);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_AUDIO_SAMPLES='%s'\n", inf);
@@ -3080,7 +3228,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_META_TITLE:{
- char *inf = get_metadata(META_INFO_TITLE);
+ char *inf = get_metadata(mpctx, META_INFO_TITLE);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_TITLE='%s'\n", inf);
@@ -3089,7 +3237,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_META_ARTIST:{
- char *inf = get_metadata(META_INFO_ARTIST);
+ char *inf = get_metadata(mpctx, META_INFO_ARTIST);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_ARTIST='%s'\n", inf);
@@ -3098,7 +3246,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_META_ALBUM:{
- char *inf = get_metadata(META_INFO_ALBUM);
+ char *inf = get_metadata(mpctx, META_INFO_ALBUM);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_ALBUM='%s'\n", inf);
@@ -3107,7 +3255,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_META_YEAR:{
- char *inf = get_metadata(META_INFO_YEAR);
+ char *inf = get_metadata(mpctx, META_INFO_YEAR);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_YEAR='%s'\n", inf);
@@ -3116,7 +3264,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_META_COMMENT:{
- char *inf = get_metadata(META_INFO_COMMENT);
+ char *inf = get_metadata(mpctx, META_INFO_COMMENT);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_COMMENT='%s'\n", inf);
@@ -3125,7 +3273,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_META_TRACK:{
- char *inf = get_metadata(META_INFO_TRACK);
+ char *inf = get_metadata(mpctx, META_INFO_TRACK);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_TRACK='%s'\n", inf);
@@ -3134,7 +3282,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_META_GENRE:{
- char *inf = get_metadata(META_INFO_GENRE);
+ char *inf = get_metadata(mpctx, META_INFO_GENRE);
if (!inf)
inf = strdup("");
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_GENRE='%s'\n", inf);
@@ -3143,7 +3291,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_GET_VO_FULLSCREEN:
- if (mpctx->video_out && vo_config_count)
+ if (mpctx->video_out && mpctx->video_out->config_ok)
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VO_FULLSCREEN=%d\n", vo_fs);
break;
@@ -3157,9 +3305,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
if (sh_video)
pos = sh_video->pts;
else if (sh_audio && mpctx->audio_out)
- pos =
- playing_audio_pts(sh_audio, mpctx->d_audio,
- mpctx->audio_out);
+ pos = playing_audio_pts(mpctx);
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_TIME_POSITION=%.1f\n", pos);
}
break;
@@ -3174,7 +3320,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_KEYDOWN_EVENTS:
- mplayer_put_key(cmd->args[0].v.i);
+ mplayer_put_key(mpctx->key_fifo, cmd->args[0].v.i);
break;
case MP_CMD_SET_MOUSE_POS:{
@@ -3182,7 +3328,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
double dx, dy;
pointer_x = cmd->args[0].v.i;
pointer_y = cmd->args[1].v.i;
- rescale_input_coordinates(pointer_x, pointer_y, &dx, &dy);
+ rescale_input_coordinates(mpctx, pointer_x, pointer_y, &dx, &dy);
#ifdef CONFIG_DVDNAV
if (mpctx->stream->type == STREAMTYPE_DVDNAV
&& dx > 0.0 && dy > 0.0) {
@@ -3191,7 +3337,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
pointer_y = (int) (dy * (double) sh_video->disp_h);
mp_dvdnav_update_mouse_pos(mpctx->stream,
pointer_x, pointer_y, &button);
- if (osd_level > 1 && button > 0)
+ if (opts->osd_level > 1 && button > 0)
set_osd_msg(OSD_MSG_TEXT, 1, osd_duration,
"Selected button number %d", button);
}
@@ -3218,7 +3364,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
command = mp_dvdnav_bindings[i].cmd;
mp_dvdnav_handle_input(mpctx->stream,command,&button);
- if (osd_level > 1 && button > 0)
+ if (opts->osd_level > 1 && button > 0)
set_osd_msg(OSD_MSG_TEXT, 1, osd_duration,
"Selected button number %d", button);
}
@@ -3232,29 +3378,19 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
#endif
default:
-#ifdef CONFIG_GUI
- if ((use_gui) && (cmd->id > MP_CMD_GUI_EVENTS))
- guiGetEvent(guiIEvent, (char *) cmd->id);
- else
-#endif
mp_msg(MSGT_CPLAYER, MSGL_V,
"Received unknown cmd %s\n", cmd->name);
}
switch (cmd->pausing) {
case 1: // "pausing"
- mpctx->osd_function = OSD_PAUSE;
+ pause_player(mpctx);
break;
case 3: // "pausing_toggle"
- mpctx->was_paused = !mpctx->was_paused;
- if (mpctx->was_paused)
- mpctx->osd_function = OSD_PAUSE;
- else if (mpctx->osd_function == OSD_PAUSE)
- mpctx->osd_function = OSD_PLAY;
+ if (mpctx->paused)
+ unpause_player(mpctx);
+ else
+ pause_player(mpctx);
break;
- case 2: // "pausing_keep"
- if (mpctx->was_paused)
- mpctx->osd_function = OSD_PAUSE;
}
- return brk_cmd;
}
diff --git a/command.h b/command.h
index 4bd01a0296..1367fa88e4 100644
--- a/command.h
+++ b/command.h
@@ -22,7 +22,7 @@
struct MPContext;
struct mp_cmd;
-int run_command(struct MPContext *mpctx, struct mp_cmd *cmd);
+void run_command(struct MPContext *mpctx, struct mp_cmd *cmd);
char *property_expand_string(struct MPContext *mpctx, char *str);
void property_print_help(void);
diff --git a/common.mak b/common.mak
deleted file mode 100644
index 343ca749b5..0000000000
--- a/common.mak
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# common bits used by all libraries
-#
-
-all: # make "all" default target
-
-ifndef SUBDIR
-vpath %.c $(SRC_DIR)
-vpath %.h $(SRC_DIR)
-vpath %.S $(SRC_DIR)
-vpath %.asm $(SRC_DIR)
-
-ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
-BUILD_ROOT_REL = .
-else
-BUILD_ROOT_REL = ..
-endif
-
-ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
-
-CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
-
-%.o: %.c
- $(CCDEP)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
-
-%.o: %.S
- $(ASDEP)
- $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
-
-%.ho: %.h
- $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
-
-%$(EXESUF): %.c
-
-SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
-ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
-$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
-endif
-
-$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak
- $< $(SRC_PATH) $@ $(EXTRA_VERSION)
-
-install: install-libs install-headers
-
-uninstall: uninstall-libs uninstall-headers
-
-.PHONY: all depend dep *clean install* uninstall* examples testprogs
-endif
-
-OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
-
-CFLAGS += $(CFLAGS-yes)
-OBJS += $(OBJS-yes)
-FFLIBS := $(FFLIBS-yes) $(FFLIBS)
-TESTPROGS += $(TESTPROGS-yes)
-
-FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
-FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
-
-EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
-OBJS := $(addprefix $(SUBDIR),$(OBJS))
-TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
-
-DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
-
-ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
-SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-))
-checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
-
-DEPS := $(OBJS:.o=.d)
-depend dep: $(DEPS)
-
-CLEANSUFFIXES = *.o *~ *.ho *.map
-DISTCLEANSUFFIXES = *.d *.pc
-LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
-
--include $(wildcard $(DEPS))
diff --git a/configure b/configure
index 89c84bc3fb..519edaad26 100755
--- a/configure
+++ b/configure
@@ -216,6 +216,7 @@ Installation directories:
--mandir=DIR directory for installing man pages [PREFIX/share/man]
--confdir=DIR directory for installing configuration files
[PREFIX/etc/mplayer]
+ --localedir=DIR directory for locale tree [PREFIX/share/locale]
--libdir=DIR directory for object code libraries [PREFIX/lib]
--codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
--win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
@@ -225,8 +226,6 @@ Installation directories:
Optional features:
--disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
--disable-mplayer disable MPlayer compilation [enable]
- --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
- --enable-gtk1 force using GTK 1.2 for the GUI [disable]
--disable-largefiles disable support for files > 2GB [enable]
--enable-linux-devfs set default devices to devfs [disable]
--enable-termcap use termcap database for key codes [autodetect]
@@ -280,8 +279,7 @@ Optional features:
--disable-vstream disable TiVo vstream client support [autodetect]
--disable-pthreads disable Posix threads support [autodetect]
--disable-w32threads disable Win32 threads support [autodetect]
- --disable-ass-internal disable internal SSA/ASS subtitle support [autodetect]
- --disable-ass disable SSA/ASS subtitle support [autodetect]
+ --disable-ass disable internal SSA/ASS subtitle support [autodetect]
--enable-rpath enable runtime linker path for extra libs [disabled]
Codecs:
@@ -296,25 +294,13 @@ Codecs:
--disable-xanim disable XAnim codecs support [enabled]
--disable-real disable RealPlayer codecs support [enabled]
--disable-xvid disable Xvid [autodetect]
- --disable-xvid-lavc disable Xvid in libavcodec [autodetect]
--disable-x264 disable x264 [autodetect]
- --disable-x264-lavc disable x264 in libavcodec [autodetect]
- --disable-libdirac-lavc disable Dirac in libavcodec [autodetect]
- --disable-libschroedinger-lavc disable Dirac in libavcodec (Schroedinger
- decoder) [autodetect]
--disable-libnut disable libnut [autodetect]
- --disable-libavutil_a disable static libavutil [autodetect]
- --disable-libavcodec_a disable static libavcodec [autodetect]
- --disable-libavformat_a disable static libavformat [autodetect]
- --disable-libpostproc_a disable static libpostproc [autodetect]
- --disable-libswscale_a disable static libswscale [autodetect]
- --disable-libavutil_so disable shared libavutil [autodetect]
- --disable-libavcodec_so disable shared libavcodec [autodetect]
- --disable-libavformat_so disable shared libavformat [autodetect]
- --disable-libpostproc_so disable shared libpostproc [autodetect]
- --disable-libswscale_so disable shared libswscale [autodetect]
- --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
- in libavcodec [enabled]
+ --disable-libavutil disable libavutil [autodetect]
+ --disable-libavcodec disable libavcodec [autodetect]
+ --disable-libavformat disable libavformat [autodetect]
+ --disable-libpostproc disable libpostproc [autodetect]
+ --disable-libswscale disable libswscale [autodetect]
--disable-tremor-internal disable internal Tremor [enabled]
--enable-tremor-low enable lower accuracy internal Tremor [disabled]
--enable-tremor enable external Tremor [autodetect]
@@ -325,13 +311,11 @@ Codecs:
--disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
--enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
--disable-faac disable support for FAAC (AAC encoder) [autodetect]
- --disable-faac-lavc disable support for FAAC in libavcodec [autodetect]
--disable-ladspa disable LADSPA plugin support [autodetect]
--disable-libbs2b disable libbs2b audio filter support [autodetect]
--disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
--disable-mad disable libmad (MPEG audio) support [autodetect]
--disable-mp3lame disable LAME MP3 encoding support [autodetect]
- --disable-mp3lame-lavc disable LAME in libavcodec [autodetect]
--disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
--disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
--enable-xmms enable XMMS input plugin support [disabled]
@@ -341,21 +325,6 @@ Codecs:
--enable-liba52-internal enable builtin liba52 [disabled]
--disable-libmpeg2 disable builtin libmpeg2 [autodetect]
--disable-musepack disable musepack support [autodetect]
- --disable-libopencore_amrnb disable libopencore_amr narrowband [autodetect]
- --disable-libopencore_amrwb disable libopencore_amr wideband [autodetect]
- --disable-libopenjpeg disable OpenJPEG (JPEG2000) input/output support [autodetect]
- --disable-decoder=DECODER disable specified FFmpeg decoder
- --enable-decoder=DECODER enable specified FFmpeg decoder
- --disable-encoder=ENCODER disable specified FFmpeg encoder
- --enable-encoder=ENCODER enable specified FFmpeg encoder
- --disable-parser=PARSER disable specified FFmpeg parser
- --enable-parser=PARSER enable specified FFmpeg parser
- --disable-protocol=PROTO disable specified FFmpeg protocol
- --enable-protocol=PROTO enable specified FFmpeg protocol
- --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
- --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
- --disable-muxer=MUXER disable specified FFmpeg muxer
- --enable-muxer=MUXER enable specified FFmpeg muxer
Video output:
--disable-vidix disable VIDIX [for x86 *nix]
@@ -420,7 +389,7 @@ Audio output:
--disable-esd disable esd audio output [autodetect]
--disable-pulse disable Pulseaudio audio output [autodetect]
--disable-jack disable JACK audio output [autodetect]
- --disable-openal disable OpenAL audio output [autodetect]
+ --enable-openal enable OpenAL audio output [disable]
--disable-nas disable NAS audio output [autodetect]
--disable-sgiaudio disable SGI audio output [autodetect]
--disable-sunaudio disable Sun audio output [autodetect]
@@ -430,10 +399,11 @@ Audio output:
--disable-select disable using select() on the audio device [enable]
Language options:
+ --enable-translation enable support for translated output [disable]
--charset=charset convert the console messages to this character set
--language-doc=lang language to use for the documentation [en]
--language-man=lang language to use for the man pages [en]
- --language-msg=lang language to use for the messages and the GUI [en]
+ --language-msg=lang language to use for the messages [en]
--language=lang default language to use [en]
Specific options override --language. You can pass a list of languages separated
by whitespace or commas instead of a single language. Nonexisting translations
@@ -475,13 +445,13 @@ Advanced options:
--enable-neon enable NEON (ARM) [autodetect]
--enable-iwmmxt enable iWMMXt (ARM) [autodetect]
--disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
- --enable-hardcoded-tables put tables in binary instead of calculating them at startup [disable]
--enable-big-endian force byte order to big-endian [autodetect]
--enable-debug[=1-3] compile-in debugging information [disable]
--enable-profile compile-in profiling information [disable]
--disable-sighandler disable sighandler for crashes [enable]
--enable-crash-debug enable automatic gdb attach on crash [disable]
--enable-dynamic-plugins enable dynamic A/V plugins [disable]
+ --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
Use these options if autodetection fails:
--extra-cflags=FLAGS extra CFLAGS
@@ -540,37 +510,13 @@ _yasm=yasm
_runtime_cpudetection=no
_cross_compile=auto
_prefix="/usr/local"
-_libavutil_a=auto
-_libavutil_so=auto
-_libavcodec_a=auto
-_libopencore_amrnb=auto
-_libopencore_amrwb=auto
-libopenjpeg=auto
-_libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
-_libavdecoders=$(echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//)
-_libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
-_libavencoders=$(echo $_libavencoders_all | sed -e 's/ LIB[A-Z0-9_]*_ENCODER//g' -e s/AAC_ENCODER//)
-_libavparsers_all=$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
-_libavparsers=$_libavparsers_all
-_libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
-_libavbsfs=$_libavbsfs_all
-_libavhwaccels_all=$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
-# Disable all hardware accelerators for now.
-_libavhwaccels=
-_libavdemuxers_all=$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
-_libavdemuxers=$(echo $_libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/AVISYNTH_DEMUXER//)
-_libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
-_libavmuxers=$(echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER//)
-_libavprotocols_all=$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
-_libavprotocols=$_libavprotocols_all
-_libavcodec_so=auto
-_libavformat_a=auto
-_libavformat_so=auto
-_libpostproc_a=auto
-_libpostproc_so=auto
-_libswscale_a=auto
-_libswscale_so=auto
-_libavcodec_mpegaudio_hp=yes
+_libavutil=auto
+_libavcodec=auto
+_libavformat=auto
+_libpostproc=auto
+_libswscale=auto
+_libavcodec_internals=no
+_libswscale_internals=no
_mencoder=yes
_mplayer=yes
_x11=auto
@@ -618,12 +564,11 @@ _esd=auto
_pulse=auto
_jack=auto
_dart=auto
-_openal=auto
+_openal=no
_libcdio=auto
_liblzo=auto
_mad=auto
_mp3lame=auto
-_mp3lame_lavc=auto
_toolame=auto
_twolame=auto
_tremor=auto
@@ -641,7 +586,6 @@ _faad=auto
_faad_internal=auto
_faad_fixed=no
_faac=auto
-_faac_lavc=auto
_ladspa=auto
_libbs2b=auto
_xmms=no
@@ -667,7 +611,6 @@ _sgiaudio=auto
_sunaudio=auto
_alsa=auto
_fastmemcpy=yes
-hardcoded_tables=no
_unrar_exec=auto
_win32dll=auto
_select=yes
@@ -684,9 +627,6 @@ _tv_dshow=auto
_pvr=auto
_network=yes
_winsock2_h=auto
-_struct_addrinfo=auto
-_getaddrinfo=auto
-_struct_sockaddr_storage=auto
_smb=auto
_vidix=auto
_vidix_pcidb=yes
@@ -694,11 +634,7 @@ _dhahelper=no
_svgalib_helper=no
_joystick=no
_xvid=auto
-_xvid_lavc=auto
_x264=auto
-_x264_lavc=auto
-_libdirac_lavc=auto
-_libschroedinger_lavc=auto
_libnut=auto
_lirc=auto
_lircc=auto
@@ -722,6 +658,7 @@ _largefiles=yes
#language=en
_shm=auto
_linux_devfs=no
+_translation=no
_charset="UTF-8"
_dynamic_plugins=no
_crash_debug=no
@@ -755,7 +692,6 @@ _vstream=auto
_pthreads=auto
_w32threads=auto
_ass=auto
-ass_internal=yes
_rpath=no
_asmalign_pot=auto
_stream_cache=yes
@@ -800,6 +736,9 @@ for ac_option do
--realcodecsdir=*)
_realcodecsdir=$(echo $ac_option | cut -d '=' -f 2)
;;
+ --localedir=*)
+ _localedir=$(echo $ac_option | cut -d '=' -f 2)
+ ;;
--with-install=*)
_install=$(echo $ac_option | cut -d '=' -f 2 )
@@ -831,10 +770,10 @@ for ac_option do
;;
--extra-cflags=*)
- extra_cflags=$(echo $ac_option | cut -d '=' -f 2-)
+ extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
;;
--extra-ldflags=*)
- extra_ldflags=$(echo $ac_option | cut -d '=' -f 2-)
+ extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
;;
--extra-libs=*)
extra_libs=$(echo $ac_option | cut -d '=' -f 2)
@@ -910,6 +849,8 @@ for ac_option do
--disable-debug)
_debug=
;;
+ --enable-translation) _translation=yes ;;
+ --disable-translation) _translation=no ;;
--enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
--disable-runtime-cpudetection) _runtime_cpudetection=no ;;
--enable-cross-compile) _cross_compile=yes ;;
@@ -950,8 +891,6 @@ for ac_option do
--disable-mng) _mng=no ;;
--enable-jpeg) _jpeg=yes ;;
--disable-jpeg) _jpeg=no ;;
- --enable-libopenjpeg) libopenjpeg=yes ;;
- --disable-libopenjpeg)libopenjpeg=no ;;
--enable-pnm) _pnm=yes ;;
--disable-pnm) _pnm=no ;;
--enable-md5sum) _md5sum=yes ;;
@@ -1016,8 +955,6 @@ for ac_option do
--disable-mad) _mad=no ;;
--enable-mp3lame) _mp3lame=yes ;;
--disable-mp3lame) _mp3lame=no ;;
- --enable-mp3lame-lavc) _mp3lame_lavc=yes ;;
- --disable-mp3lame-lavc) _mp3lame_lavc=no ;;
--enable-toolame) _toolame=yes ;;
--disable-toolame) _toolame=no ;;
--enable-twolame) _twolame=yes ;;
@@ -1058,8 +995,6 @@ for ac_option do
--disable-faad-fixed) _faad_fixed=no ;;
--enable-faac) _faac=yes ;;
--disable-faac) _faac=no ;;
- --enable-faac-lavc) _faac_lavc=yes ;;
- --disable-faac-lavc) _faac_lavc=no ;;
--enable-ladspa) _ladspa=yes ;;
--disable-ladspa) _ladspa=no ;;
--enable-libbs2b) _libbs2b=yes ;;
@@ -1126,8 +1061,6 @@ for ac_option do
--disable-pvr) _pvr=no ;;
--enable-fastmemcpy) _fastmemcpy=yes ;;
--disable-fastmemcpy) _fastmemcpy=no ;;
- --enable-hardcoded-tables) hardcoded_tables=yes ;;
- --disable-hardcoded-tables) hardcoded_tables=no ;;
--enable-network) _network=yes ;;
--disable-network) _network=no ;;
--enable-winsock2_h) _winsock2_h=yes ;;
@@ -1148,56 +1081,22 @@ for ac_option do
--disable-joystick) _joystick=no ;;
--enable-xvid) _xvid=yes ;;
--disable-xvid) _xvid=no ;;
- --enable-xvid-lavc) _xvid_lavc=yes ;;
- --disable-xvid-lavc) _xvid_lavc=no ;;
--enable-x264) _x264=yes ;;
--disable-x264) _x264=no ;;
- --enable-x264-lavc) _x264_lavc=yes ;;
- --disable-x264-lavc) _x264_lavc=no ;;
- --enable-libdirac-lavc) _libdirac_lavc=yes ;;
- --disable-libdirac-lavc) _libdirac_lavc=no ;;
- --enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;;
- --disable-libschroedinger-lavc) _libschroedinger_lavc=no ;;
--enable-libnut) _libnut=yes ;;
--disable-libnut) _libnut=no ;;
- --enable-libavutil_a) _libavutil_a=yes ;;
- --disable-libavutil_a) _libavutil_a=no ;;
- --enable-libavutil_so) _libavutil_so=yes ;;
- --disable-libavutil_so) _libavutil_so=no ;;
- --enable-libavcodec_a) _libavcodec_a=yes ;;
- --disable-libavcodec_a) _libavcodec_a=no ;;
- --enable-libavcodec_so) _libavcodec_so=yes ;;
- --disable-libavcodec_so) _libavcodec_so=no ;;
- --enable-libopencore_amrnb) _libopencore_amrnb=yes ;;
- --disable-libopencore_amrnb) _libopencore_amrnb=no ;;
- --enable-libopencore_amrwb) _libopencore_amrwb=yes ;;
- --disable-libopencore_amrwb) _libopencore_amrwb=no ;;
- --enable-decoder=*) _libavdecoders="$_libavdecoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
- --disable-decoder=*) _libavdecoders=$(echo $_libavdecoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
- --enable-encoder=*) _libavencoders="$_libavencoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
- --disable-encoder=*) _libavencoders=$(echo $_libavencoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
- --enable-parser=*) _libavparsers="$_libavparsers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
- --disable-parser=*) _libavparsers=$(echo $_libavparsers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
- --enable-protocol=*) _libavprotocols="$_libavprotocols $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
- --disable-protocol=*) _libavprotocols=$(echo $_libavprotocols | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
- --enable-demuxer=*) _libavdemuxers="$_libavdemuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
- --disable-demuxer=*) _libavdemuxers=$(echo $_libavdemuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
- --enable-muxer=*) _libavmuxers="$_libavmuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
- --disable-muxer=*) _libavmuxers=$(echo $_libavmuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
- --enable-libavformat_a) _libavformat_a=yes ;;
- --disable-libavformat_a) _libavformat_a=no ;;
- --enable-libavformat_so) _libavformat_so=yes ;;
- --disable-libavformat_so) _libavformat_so=no ;;
- --enable-libpostproc_a) _libpostproc_a=yes ;;
- --disable-libpostproc_a) _libpostproc_a=no ;;
- --enable-libpostproc_so) _libpostproc_so=yes ;;
- --disable-libpostproc_so) _libpostproc_so=no ;;
- --enable-libswscale_a) _libswscale_a=yes ;;
- --disable-libswscale_a) _libswscale_a=no ;;
- --enable-libswscale_so) _libswscale_so=yes ;;
- --disable-libswscale_so) _libswscale_so=no ;;
- --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
- --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
+ --enable-libavutil) _libavutil=yes ;;
+ --disable-libavutil) _libavutil=no ;;
+ --enable-libavcodec) _libavcodec=yes ;;
+ --disable-libavcodec) _libavcodec=no ;;
+ --enable-libavformat) _libavformat=yes ;;
+ --disable-libavformat) _libavformat=no ;;
+ --enable-libpostproc) _libpostproc=yes ;;
+ --disable-libpostproc) _libpostproc=no ;;
+ --enable-libswscale) _libswscale=yes ;;
+ --disable-libswscale) _libswscale=no ;;
+ --ffmpeg-source-dir=*)
+ _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
--enable-lirc) _lirc=yes ;;
--disable-lirc) _lirc=no ;;
@@ -1269,8 +1168,6 @@ for ac_option do
--disable-w32threads) _w32threads=no ;;
--enable-ass) _ass=yes ;;
--disable-ass) _ass=no ;;
- --enable-ass-internal) ass_internal=yes ;;
- --disable-ass-internal) ass_internal=no ;;
--enable-rpath) _rpath=yes ;;
--disable-rpath) _rpath=no ;;
@@ -1365,12 +1262,18 @@ for ac_option do
esac
done
+if test "$_gui" = yes ; then
+ die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
+ (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
+fi
+
# Atmos: moved this here, to be correct, if --prefix is specified
test -z "$_bindir" && _bindir="$_prefix/bin"
test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
test -z "$_mandir" && _mandir="$_prefix/share/man"
test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
test -z "$_libdir" && _libdir="$_prefix/lib"
+test -z "$_localedir" && _localedir="$_prefix/share/locale"
# Determine our OS name and CPU architecture
if test -z "$_target" ; then
@@ -2286,6 +2189,7 @@ EOF
_arch='ALPHA'
_target_arch='ARCH_ALPHA = yes'
iproc='alpha'
+ def_fast_64bit='#define HAVE_FAST_64BIT 1'
echocheck "CPU type"
cat > $TMPC << EOF
@@ -2435,12 +2339,10 @@ if test "$_big_endian" = yes ; then
_byte_order='big-endian'
def_words_endian='#define WORDS_BIGENDIAN 1'
def_bigendian='#define HAVE_BIGENDIAN 1'
- def_av_bigendian='#define AV_HAVE_BIGENDIAN 1'
else
_byte_order='little-endian'
def_words_endian='#undef WORDS_BIGENDIAN'
def_bigendian='#define HAVE_BIGENDIAN 0'
- def_av_bigendian='#define AV_HAVE_BIGENDIAN 0'
fi
echores "$_byte_order"
@@ -2488,8 +2390,8 @@ cat > $TMPC << EOF
__attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
EOF
- cc_check -O4 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
- test -z "$cflags_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
+ cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
+ test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time \
&& tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
test -n "$cflags_stackrealign" && echores "yes" || echores "no"
fi # if darwin && test "$cc_vendor" = "gnu" ; then
@@ -2508,7 +2410,7 @@ elif test -z "$CFLAGS" ; then
elif test "$cc_vendor" != "gnu" ; then
CFLAGS="-O2 $_march $_mcpu $_pipe"
else
- CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+ CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
extra_ldflags="$extra_ldflags -ffast-math"
fi
else
@@ -2520,7 +2422,6 @@ int main(void) { return 0; }
EOF
if test "$cc_vendor" = "gnu" ; then
cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
- cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
@@ -2933,6 +2834,14 @@ fi
echores "$_langinfo"
+echocheck "translation support"
+if test "$_translation" = yes; then
+ def_translation="#define CONFIG_TRANSLATION 1"
+else
+ def_translation="#undef CONFIG_TRANSLATION"
+fi
+echores "$_translation"
+
echocheck "language"
# Set preferred languages, "all" uses English as main language.
test -z "$language" && language=$LINGUAS
@@ -3135,80 +3044,8 @@ echores "$_socklib"
if test $_winsock2_h = yes ; then
_ld_sock="-lws2_32"
def_winsock2_h='#define HAVE_WINSOCK2_H 1'
- cc_check_winsock2_h='-DHAVE_WINSOCK2_H=1'
else
def_winsock2_h='#define HAVE_WINSOCK2_H 0'
- cc_check_winsock2_h='-DHAVE_WINSOCK2_H=0'
-fi
-
-
-echocheck "netdb.h, struct addrinfo"
-if test "$_struct_addrinfo" = auto; then
- _struct_addrinfo=no
- cat > $TMPC << EOF
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#endif
-int main(void) { struct addrinfo *ai; return 0; }
-EOF
- cc_check $cc_check_winsock2_h && _struct_addrinfo=yes
-fi
-echores "$_struct_addrinfo"
-
-if test "$_struct_addrinfo" = yes; then
- def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1"
-else
- def_addrinfo="#define HAVE_STRUCT_ADDRINFO 0"
-fi
-
-
-echocheck "netdb.h, getaddrinfo()"
-if test "$_getaddrinfo" = auto; then
- _getaddrinfo=no
- cat > $TMPC << EOF
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#endif
-int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; }
-EOF
- cc_check $cc_check_winsock2_h && _getaddrinfo=yes
-fi
-echores "$_getaddrinfo"
-
-if test "$_getaddrinfo" = yes; then
- def_getaddrinfo="#define HAVE_GETADDRINFO 1"
-else
- def_getaddrinfo="#define HAVE_GETADDRINFO 0"
-fi
-
-
-echocheck "sockaddr_storage"
-if test "$_struct_sockaddr_storage" = auto; then
- _struct_sockaddr_storage=no
- cat > $TMPC << EOF
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#else
-#include <sys/socket.h>
-#endif
-int main(void) { struct sockaddr_storage sas; return 0; }
-EOF
- cc_check $cc_check_winsock2_h && _struct_sockaddr_storage=yes
-fi
-echores "$_struct_sockaddr_storage"
-
-if test "$_struct_sockaddr_storage" = yes; then
- def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1"
-else
- def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 0"
fi
@@ -3473,16 +3310,6 @@ fi
echores "$_fastmemcpy"
-echocheck "hard-coded tables"
-if test "$hardcoded_tables" = yes ; then
- def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 1'
- mak_hardcoded_tables='CONFIG_HARDCODED_TABLES = yes'
-else
- def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 0'
-fi
-echores "$hardcoded_tables"
-
-
echocheck "mman.h"
cat > $TMPC << EOF
#include <sys/types.h>
@@ -4494,7 +4321,6 @@ if test "$_xvmc" = yes ; then
else
def_xvmc='#define CONFIG_XVMC 0'
_novomodules="xvmc $_novomodules"
- _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER//)
fi
echores "$_xvmc"
@@ -4507,7 +4333,7 @@ if test "$_vdpau" = auto ; then
#include <vdpau/vdpau_x11.h>
int main(void) {
(void) vdp_device_create_x11(0, 0, 0, 0);
- return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
+ return VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE;}
EOF
cc_check -lvdpau && _vdpau=yes
fi
@@ -4519,7 +4345,6 @@ if test "$_vdpau" = yes ; then
else
def_vdpau='#define CONFIG_VDPAU 0'
_novomodules="vdpau $_novomodules"
- _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_VDPAU_DECODER// -e s/MPEG1_VDPAU_DECODER// -e s/H264_VDPAU_DECODER// -e s/WMV3_VDPAU_DECODER// -e s/VC1_VDPAU_DECODER// -e s/MPEG4_VDPAU_DECODER//)
fi
echores "$_vdpau"
@@ -4732,35 +4557,6 @@ else
_novomodules="xvidix $_novomodules"
fi
-echocheck "/dev/mga_vid"
-if test "$_mga" = auto ; then
- _mga=no
- test -c /dev/mga_vid && _mga=yes
-fi
-if test "$_mga" = yes ; then
- def_mga='#define CONFIG_MGA 1'
- _vomodules="mga $_vomodules"
-else
- def_mga='#undef CONFIG_MGA'
- _novomodules="mga $_novomodules"
-fi
-echores "$_mga"
-
-echocheck "xmga"
-if test "$_xmga" = auto ; then
- _xmga=no
- test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
-fi
-if test "$_xmga" = yes ; then
- def_xmga='#define CONFIG_XMGA 1'
- _vomodules="xmga $_vomodules"
-else
- def_xmga='#undef CONFIG_XMGA'
- _novomodules="xmga $_novomodules"
-fi
-echores "$_xmga"
-
-
echocheck "GGI"
if test "$_ggi" = auto ; then
cat > $TMPC << EOF
@@ -5197,28 +4993,6 @@ else
fi
-echocheck "OpenJPEG (JPEG2000) support"
-if test "$libopenjpeg" = auto ; then
- libopenjpeg=no
-cat > $TMPC << EOF
-#define OPJ_STATIC
-#include <openjpeg.h>
-int main(void) { opj_dparameters_t dec_params; opj_set_default_decoder_parameters(&dec_params); return 0; }
-EOF
- cc_check -lopenjpeg $_ld_lm && libopenjpeg=yes
-fi
-echores "$libopenjpeg"
-if test "$libopenjpeg" = yes ; then
- def_libopenjpeg='#define CONFIG_LIBOPENJPEG 1'
- extra_ldflags="$extra_ldflags -lopenjpeg"
- _libavdecoders="$_libavdecoders LIBOPENJPEG_DECODER"
- _libavencoders="$_libavencoders LIBOPENJPEG_ENCODER"
- _codecmodules="OpenJPEG $_codecmodules"
-else
- def_libopenjpeg='#define CONFIG_LIBOPENJPEG 0'
- _nocodecmodules="OpenJPEG $_nocodecmodules"
-fi
-
echocheck "PNM support"
if test "$_pnm" = yes; then
@@ -5651,6 +5425,15 @@ EOF
cc_check && _real_ossaudio=yes
if test "$_real_ossaudio" = yes; then
def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
+ # Check for OSS4 headers (override default headers)
+ # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
+ if test -f /etc/oss.conf; then
+ . /etc/oss.conf
+ _ossinc="$OSSLIBDIR/include"
+ if test -f "$_ossinc/sys/soundcard.h"; then
+ extra_cflags="-I$_ossinc $extra_cflags"
+ fi
+ fi
elif netbsd || openbsd ; then
def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
extra_ldflags="$extra_ldflags -lossaudio"
@@ -6099,6 +5882,9 @@ echores "$_vcd"
echocheck "dvdread"
+if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
+ _dvdread_internal=no
+fi
if test "$_dvdread_internal" = auto ; then
_dvdread_internal=no
_dvdread=no
@@ -6350,42 +6136,19 @@ echores "$_fontconfig"
echocheck "SSA/ASS support"
-# libass depends on FreeType
-if test "$_freetype" = no ; then
- _ass=no
- ass_internal=no
- _res_comment="FreeType support needed"
-fi
-
-if test "$_ass" = auto ; then
- cat > $TMPC << EOF
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 2) || ((FREETYPE_MINOR == 2) && (FREETYPE_PATCH < 1)))
-#error "Need FreeType 2.2.1 or newer"
-#endif
-int main(void) { return 0; }
-EOF
- _ass=no
- cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _ass=yes
- if test "$_ass" = no ; then
- ass_internal=no
- _res_comment="FreeType >= 2.2.1 needed"
- elif test "$ass_internal" = no ; then
- _res_comment="external"
- extra_ldflags="$extra_ldflags -lass"
- fi
-fi
-if test "$_ass" = yes ; then
- def_ass='#define CONFIG_ASS 1'
+if test "$_ass" = auto -o "$_ass" = yes ; then
+ if $_pkg_config libass; then
+ _ass=yes
+ def_ass='#define CONFIG_ASS 1'
+ extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
+ extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
+ else
+ _ass=no
+ def_ass='#undef CONFIG_ASS'
+ fi
else
def_ass='#undef CONFIG_ASS'
fi
-if test "$ass_internal" = yes ; then
- def_ass_internal='#define CONFIG_ASS_INTERNAL 1'
-else
- def_ass_internal='#undef CONFIG_ASS_INTERNAL'
-fi
echores "$_ass"
@@ -6464,8 +6227,6 @@ if test "$_zlib" = yes ; then
extra_ldflags="$extra_ldflags -lz"
else
def_zlib='#define CONFIG_ZLIB 0'
- _libavdecoders=$(echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/ZLIB_DECODER// -e s/DXA_DECODER// -e s/TSCC_DECODER//)
- _libavencoders=$(echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// -e s/ZLIB_ENCODER//)
fi
echores "$_zlib"
@@ -6847,25 +6608,16 @@ int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
EOF
_faac=no
for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
- cc_check -O4 $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
+ cc_check -O2 $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
done
fi
if test "$_faac" = yes ; then
def_faac="#define CONFIG_FAAC 1"
- test "$_faac_lavc" = auto && _faac_lavc=yes
- if test "$_faac_lavc" = yes ; then
- def_faac_lavc="#define CONFIG_LIBFAAC 1"
- libs_mplayer="$libs_mplayer $_ld_faac"
- _libavencoders="$_libavencoders LIBFAAC_ENCODER"
- fi
_codecmodules="faac $_codecmodules"
else
- _faac_lavc=no
def_faac="#undef CONFIG_FAAC"
- def_faac_lavc="#define CONFIG_LIBFAAC 0"
_nocodecmodules="faac $_nocodecmodules"
fi
-_res_comment="in libavcodec: $_faac_lavc"
echores "$_faac"
@@ -7166,15 +6918,8 @@ echores "$_live"
echocheck "FFmpeg libavutil"
-if test "$_libavutil_a" = auto ; then
- if test -d libavutil ; then
- _libavutil_a=yes
- _res_comment="static"
- else
- die "MPlayer will not compile without libavutil in the source tree."
- fi
-elif test "$_libavutil_so" = auto ; then
- _libavutil_so=no
+if test "$_libavutil" = auto ; then
+ _libavutil=no
cat > $TMPC << EOF
#include <libavutil/common.h>
int main(void) { av_gcd(1,1); return 0; }
@@ -7182,38 +6927,24 @@ EOF
if $_pkg_config --exists libavutil ; then
_inc_libavutil=$($_pkg_config --cflags libavutil)
_ld_tmp=$($_pkg_config --libs libavutil)
- cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
- && _libavutil_so=yes
+ cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libavutil" \
+ && _libavutil=yes
elif cc_check -lavutil $_ld_lm ; then
extra_ldflags="$extra_ldflags -lavutil"
- _libavutil_so=yes
- _res_comment="using libavutil.so, but static libavutil is recommended"
+ _libavutil=yes
fi
fi
-_libavutil=no
def_libavutil='#undef CONFIG_LIBAVUTIL'
-def_libavutil_a='#undef CONFIG_LIBAVUTIL_A'
-def_libavutil_so='#undef CONFIG_LIBAVUTIL_SO'
-test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
-test "$_libavutil_a" = yes && def_libavutil_a='#define CONFIG_LIBAVUTIL_A 1'
-test "$_libavutil_so" = yes && def_libavutil_so='#define CONFIG_LIBAVUTIL_SO 1'
-# neither static nor shared libavutil is available, but it is mandatory ...
+# libavutil is not available, but it is mandatory ...
if test "$_libavutil" = no ; then
- die "You need static or shared libavutil, MPlayer will not compile without!"
+ die "You need libavutil, MPlayer will not compile without!"
fi
echores "$_libavutil"
echocheck "FFmpeg libavcodec"
-if test "$_libavcodec_a" = auto ; then
- _libavcodec_a=no
- if test -d libavcodec && test -f libavcodec/utils.c ; then
- _libavcodec_a="yes"
- _res_comment="static"
- fi
-elif test "$_libavcodec_so" = auto ; then
- _libavcodec_so=no
- _res_comment="libavcodec.so is discouraged over static libavcodec"
+if test "$_libavcodec" = auto ; then
+ _libavcodec=no
cat > $TMPC << EOF
#include <libavcodec/avcodec.h>
int main(void) { avcodec_find_encoder_by_name(""); return 0; }
@@ -7221,43 +6952,25 @@ EOF
if $_pkg_config --exists libavcodec ; then
_inc_libavcodec=$($_pkg_config --cflags libavcodec)
_ld_tmp=$($_pkg_config --libs libavcodec)
- cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
- && _libavcodec_so=yes
+ cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavcodec" \
+ && _libavcodec=yes
elif cc_check -lavcodec $_ld_lm ; then
extra_ldflags="$extra_ldflags -lavcodec"
- _libavcodec_so=yes
- _res_comment="using libavcodec.so, but static libavcodec is recommended"
+ _libavcodec=yes
fi
fi
-_libavcodec=no
def_libavcodec='#undef CONFIG_LIBAVCODEC'
-def_libavcodec_a='#undef CONFIG_LIBAVCODEC_A'
-def_libavcodec_so='#undef CONFIG_LIBAVCODEC_SO'
-test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
-test "$_libavcodec_a" = yes && def_libavcodec_a='#define CONFIG_LIBAVCODEC_A 1'
-test "$_libavcodec_so" = yes && def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO 1'
-test "$_libavcodec_mpegaudio_hp" = yes \
- && def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1' \
- && mak_libavcodec_mpegaudio_hp='CONFIG_MPEGAUDIO_HP = yes'
-if test "$_libavcodec_a" = yes ; then
- _codecmodules="libavcodec(internal) $_codecmodules"
-elif test "$_libavcodec_so" = yes ; then
- _codecmodules="libavcodec.so $_codecmodules"
+if test "$_libavcodec" = yes ; then
+ _codecmodules="libavcodec $_codecmodules"
else
_nocodecmodules="libavcodec $_nocodecmodules"
fi
echores "$_libavcodec"
echocheck "FFmpeg libavformat"
-if test "$_libavformat_a" = auto ; then
- _libavformat_a=no
- if test -d libavformat && test -f libavformat/utils.c ; then
- _libavformat_a=yes
- _res_comment="static"
- fi
-elif test "$_libavformat_so" = auto ; then
- _libavformat_so=no
+if test "$_libavformat" = auto ; then
+ _libavformat=no
cat > $TMPC <<EOF
#include <libavformat/avformat.h>
#include <libavcodec/opt.h>
@@ -7266,66 +6979,42 @@ EOF
if $_pkg_config --exists libavformat ; then
_inc_libavformat=$($_pkg_config --cflags libavformat)
_ld_tmp=$($_pkg_config --libs libavformat)
- cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
- && _libavformat_so=yes
+ cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavformat" \
+ && _libavformat=yes
elif cc_check $_ld_lm -lavformat ; then
extra_ldflags="$extra_ldflags -lavformat"
- _libavformat_so=yes
- _res_comment="using libavformat.so, but static libavformat is recommended"
+ _libavformat=yes
fi
fi
-_libavformat=no
def_libavformat='#undef CONFIG_LIBAVFORMAT'
-def_libavformat_a='#undef CONFIG_LIBAVFORMAT_A'
-def_libavformat_so='#undef CONFIG_LIBAVFORMAT_SO'
-test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
-test "$_libavformat_a" = yes && def_libavformat_a='#define CONFIG_LIBAVFORMAT_A 1'
-test "$_libavformat_so" = yes \
- && def_libavformat_so='#define CONFIG_LIBAVFORMAT_SO 1'
echores "$_libavformat"
echocheck "FFmpeg libpostproc"
-if test "$_libpostproc_a" = auto ; then
- _libpostproc_a=no
- if test -d libpostproc && test -f libpostproc/postprocess.h ; then
- _libpostproc_a='yes'
- _res_comment="static"
- fi
-elif test "$_libpostproc_so" = auto ; then
- _libpostproc_so=no
+if test "$_libpostproc" = auto ; then
+ _libpostproc=no
cat > $TMPC << EOF
#include <inttypes.h>
#include <libpostproc/postprocess.h>
int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
EOF
- if cc_check -lpostproc $_ld_lm ; then
+ if $_pkg_config --exists libpostproc ; then
+ _inc_libpostproc=$($_pkg_config --cflags libpostproc)
+ _ld_tmp=$($_pkg_config --libs libpostproc)
+ cc_check $_inc_libpostproc $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libpostproc" \
+ && _libpostproc=yes
+ elif cc_check -lpostproc $_ld_lm ; then
extra_ldflags="$extra_ldflags -lpostproc"
- _libpostproc_so=yes
- _res_comment="using libpostproc.so, but static libpostproc is recommended"
+ _libpostproc=yes
fi
fi
-_libpostproc=no
def_libpostproc='#undef CONFIG_LIBPOSTPROC'
-def_libpostproc_a='#undef CONFIG_LIBPOSTPROC_A'
-def_libpostproc_so='#undef CONFIG_LIBPOSTPROC_SO'
-test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
-test "$_libpostproc_a" = yes && def_libpostproc_a='#define CONFIG_LIBPOSTPROC_A 1'
-test "$_libpostproc_so" = yes \
- && def_libpostproc_so='#define CONFIG_LIBPOSTPROC_SO 1'
echores "$_libpostproc"
echocheck "FFmpeg libswscale"
-if test "$_libswscale_a" = auto ; then
- _libswscale_a=no
- if test -d libswscale && test -f libswscale/swscale.h ; then
- _libswscale_a='yes'
- _res_comment="static"
- fi
-elif test "$_libswscale_so" = auto ; then
- _libswscale_so=no
- _res_comment="using libswscale.so, but static libswscale is recommended"
+if test "$_libswscale" = auto ; then
+ _libswscale=no
cat > $TMPC << EOF
#include <libswscale/swscale.h>
int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
@@ -7333,76 +7022,26 @@ EOF
if $_pkg_config --exists libswscale ; then
_inc_libswscale=$($_pkg_config --cflags libswscale)
_ld_tmp=$($_pkg_config --libs libswscale)
- cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
- && _libswscale_so=yes
+ cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libswscale" \
+ && _libswscale=yes
elif cc_check -lswscale ; then
extra_ldflags="$extra_ldflags -lswscale"
- _libswscale_so=yes
+ _libswscale=yes
fi
fi
-_libswscale=no
def_libswscale='#undef CONFIG_LIBSWSCALE'
-def_libswscale_a='#undef CONFIG_LIBSWSCALE_A'
-def_libswscale_so='#undef CONFIG_LIBSWSCALE_SO'
-test "$_libswscale_a" = yes || test "$_libswscale_so" = yes && _libswscale=yes
test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
-test "$_libswscale_a" = yes && def_libswscale_a='#define CONFIG_LIBSWSCALE_A 1'
-test "$_libswscale_so" = yes \
- && def_libswscale_so='#define CONFIG_LIBSWSCALE_SO 1'
echores "$_libswscale"
-echocheck "libopencore_amr narrowband"
-if test "$_libopencore_amrnb" = auto ; then
- _libopencore_amrnb=no
- cat > $TMPC << EOF
-#include <opencore-amrnb/interf_dec.h>
-int main(void) { Decoder_Interface_init(); return 0; }
-EOF
- cc_check -lopencore-amrnb && _libopencore_amrnb=yes
- if test "$_libavcodec_a" != yes ; then
- _libopencore_amrnb=no
- _res_comment="libavcodec (static) is required by libopencore_amrnb, sorry"
- fi
-fi
-if test "$_libopencore_amrnb" = yes ; then
- _libopencore_amr=yes
- extra_ldflags="$extra_ldflags -lopencore-amrnb"
- def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 1'
- _libavdecoders="$_libavdecoders LIBOPENCORE_AMRNB_DECODER"
- _libavencoders="$_libavencoders LIBOPENCORE_AMRNB_ENCODER"
- _codecmodules="libopencore_amrnb $_codecmodules"
-else
- def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 0'
- _nocodecmodules="libopencore_amrnb $_nocodecmodules"
+def_libswscale_internals="#undef CONFIG_LIBSWSCALE_INTERNALS"
+if ! test -z "$_ffmpeg_source" ; then
+ test "$_libswscale" = yes && def_libswscale_internals="#define CONFIG_LIBSWSCALE_INTERNALS 1" && _libswscale_internals=yes
fi
-echores "$_libopencore_amrnb"
-
-echocheck "libopencore_amr wideband"
-if test "$_libopencore_amrwb" = auto ; then
- _libopencore_amrwb=no
- cat > $TMPC << EOF
-#include <opencore-amrwb/dec_if.h>
-int main(void) { D_IF_init(); return 0; }
-EOF
- cc_check -lopencore-amrwb && _libopencore_amrwb=yes
- if test "$_libavcodec_a" != yes ; then
- _libopencore_amrwb=no
- _res_comment="libavcodec (static) is required by libopencore_amrwb, sorry"
- fi
+def_libavcodec_internals="#undef CONFIG_LIBAVCODEC_INTERNALS"
+if ! test -z "$_ffmpeg_source" ; then
+ test "$_libavcodec" = yes && def_libavcodec_internals="#define CONFIG_LIBAVCODEC_INTERNALS 1" && _libavcodec_internals=yes
fi
-if test "$_libopencore_amrwb" = yes ; then
- _libopencore_amr=yes
- extra_ldflags="$extra_ldflags -lopencore-amrwb"
- def_libopencore_amrwb='#define CONFIG_LIBOPENCORE_AMRWB 1'
- _libavdecoders="$_libavdecoders LIBOPENCORE_AMRWB_DECODER"
- _libavencoders="$_libavencoders LIBOPENCORE_AMRWB_DECODER"
- _codecmodules="libopencore_amrwb $_codecmodules"
-else
- def_libopencore_amrwb='#define LIBOPENCORE_AMRWB 0'
- _nocodecmodules="libopencore_amrwb $_nocodecmodules"
-fi
-echores "$_libopencore_amrwb"
echocheck "libdv-0.9.5+"
if test "$_libdv" = auto ; then
@@ -7445,30 +7084,12 @@ else
fi
echores "$_xvid"
-echocheck "Xvid two pass plugin"
-if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
- cat > $TMPC << EOF
-#include <xvid.h>
-int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
-EOF
- cc_check && _xvid_lavc=yes
-fi
-if test "$_xvid_lavc" = yes ; then
- def_xvid_lavc='#define CONFIG_LIBXVID 1'
- _libavencoders="$_libavencoders LIBXVID_ENCODER"
-else
- _xvid_lavc=no
- def_xvid_lavc='#define CONFIG_LIBXVID 0'
-fi
-echores "$_xvid_lavc"
-
-
echocheck "x264"
if test "$_x264" = auto ; then
cat > $TMPC << EOF
#include <inttypes.h>
#include <x264.h>
-#if X264_BUILD < 83
+#if X264_BUILD < 79
#error We do not support old versions of x264. Get the latest from git.
#endif
int main(void) { x264_encoder_open((void*)0); return 0; }
@@ -7482,95 +7103,12 @@ fi
if test "$_x264" = yes ; then
def_x264='#define CONFIG_X264 1'
_codecmodules="x264 $_codecmodules"
- test "$_x264_lavc" = auto && _x264_lavc=yes
- if test "$_x264_lavc" = yes ; then
- def_x264_lavc='#define CONFIG_LIBX264 1'
- libs_mplayer="$libs_mplayer $_ld_x264"
- _libavencoders="$_libavencoders LIBX264_ENCODER"
- fi
else
- _x264_lavc=no
def_x264='#undef CONFIG_X264'
- def_x264_lavc='#define CONFIG_LIBX264 0'
_nocodecmodules="x264 $_nocodecmodules"
fi
-_res_comment="in libavcodec: $_x264_lavc"
echores "$_x264"
-
-echocheck "libdirac"
-if test "$_libdirac_lavc" = auto; then
- _libdirac_lavc=no
- if test "$_libavcodec_a" != yes; then
- _res_comment="libavcodec (static) is required by libdirac, sorry"
- else
- cat > $TMPC << EOF
-#include <libdirac_encoder/dirac_encoder.h>
-#include <libdirac_decoder/dirac_parser.h>
-int main(void)
-{
- dirac_encoder_context_t enc_ctx;
- dirac_decoder_t *dec_handle;
- dirac_encoder_context_init(&enc_ctx, VIDEO_FORMAT_SD_576I50);
- dec_handle = dirac_decoder_init(0);
- if (dec_handle)
- dirac_decoder_close(dec_handle);
- return 0;
-}
-EOF
- if $_pkg_config --exists dirac ; then
- _inc_dirac=$($_pkg_config --silence-errors --cflags dirac)
- _ld_dirac=$($_pkg_config --silence-errors --libs dirac)
- cc_check $_inc_dirac $_ld_dirac &&
- _libdirac_lavc=yes &&
- extra_cflags="$extra_cflags $_inc_dirac" &&
- extra_ldflags="$extra_ldflags $_ld_dirac"
- fi
- fi
-fi
-if test "$_libdirac_lavc" = yes ; then
- def_libdirac_lavc='#define CONFIG_LIBDIRAC 1'
- _libavencoders="$_libavencoders LIBDIRAC_ENCODER"
- _libavdecoders="$_libavdecoders LIBDIRAC_DECODER"
- _codecmodules="libdirac $_codecmodules"
-else
- def_libdirac_lavc='#define CONFIG_LIBDIRAC 0'
- _nocodecmodules="libdirac $_nocodecmodules"
-fi
-echores "$_libdirac_lavc"
-
-
-echocheck "libschroedinger"
-if test "$_libschroedinger_lavc" = auto ; then
- _libschroedinger_lavc=no
- if test "$_libavcodec_a" != yes; then
- _res_comment="libavcodec (static) is required by libschroedinger, sorry"
- else
- cat > $TMPC << EOF
-#include <schroedinger/schro.h>
-int main(void) { schro_init(); return 0; }
-EOF
- if $_pkg_config --exists schroedinger-1.0 ; then
- _inc_schroedinger=$($_pkg_config --silence-errors --cflags schroedinger-1.0)
- _ld_schroedinger=$($_pkg_config --silence-errors --libs schroedinger-1.0)
- cc_check $_inc_schroedinger $_ld_schroedinger &&
- _libschroedinger_lavc=yes &&
- extra_cflags="$extra_cflags $_inc_schroedinger" &&
- extra_ldflags="$extra_ldflags $_ld_schroedinger"
- fi
- fi
-fi
-if test "$_libschroedinger_lavc" = yes ; then
- def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 1'
- _libavencoders="$_libavencoders LIBSCHROEDINGER_ENCODER"
- _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER"
- _codecmodules="libschroedinger $_codecmodules"
-else
- def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 0'
- _nocodecmodules="libschroedinger $_nocodecmodules"
-fi
-echores "$_libschroedinger_lavc"
-
echocheck "libnut"
if test "$_libnut" = auto ; then
cat > $TMPC << EOF
@@ -7593,7 +7131,48 @@ else
fi
echores "$_libnut"
-#check must be done after libavcodec one
+# These VO checks must be done after libavcodec/libswscale one
+echocheck "/dev/mga_vid"
+if test "$_mga" = auto ; then
+ _mga=no
+ test -c /dev/mga_vid && _mga=yes
+fi
+if test "$_mga" = yes ; then
+ if test "$_libswscale_internals" = yes ; then
+ def_mga='#define CONFIG_MGA 1'
+ _vomodules="mga $_vomodules"
+ else
+ _res_comment="libswscale internal headers are required by mga, sorry"
+ def_mga='#undef CONFIG_MGA'
+ _novomodules="mga $_novomodules"
+ fi
+else
+ def_mga='#undef CONFIG_MGA'
+ _novomodules="mga $_novomodules"
+fi
+echores "$_mga"
+
+
+echocheck "xmga"
+if test "$_xmga" = auto ; then
+ _xmga=no
+ test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
+fi
+if test "$_xmga" = yes ; then
+ if test "$_libswscale_internals" = yes ; then
+ def_xmga='#define CONFIG_XMGA 1'
+ _vomodules="xmga $_vomodules"
+ else
+ _res_comment="libswscale internal headers are required by mga, sorry"
+ def_xmga='#undef CONFIG_XMGA'
+ _novomodules="xmga $_novomodules"
+ fi
+else
+ def_xmga='#undef CONFIG_XMGA'
+ _novomodules="xmga $_novomodules"
+fi
+echores "$_xmga"
+
echocheck "zr"
if test "$_zr" = auto ; then
#36067's seem to identify themselves as 36057PQC's, so the line
@@ -7605,11 +7184,11 @@ if test "$_zr" = auto ; then
fi
fi
if test "$_zr" = yes ; then
- if test "$_libavcodec_a" = yes ; then
+ if test "$_libavcodec_internals" = yes ; then
def_zr='#define CONFIG_ZR 1'
_vomodules="zr zr2 $_vomodules"
else
- _res_comment="libavcodec (static) is required by zr, sorry"
+ _res_comment="libavcodec internal headers are required by zr, sorry"
_novomodules="zr $_novomodules"
def_zr='#undef CONFIG_ZR'
fi
@@ -7649,18 +7228,9 @@ EOF
int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
EOF
cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
- test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
- if test "$_mp3lame_lavc" = yes ; then
- def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
- _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
- libs_mplayer="$libs_mplayer $_ld_mp3lame"
- fi
else
- _mp3lame_lavc=no
def_mp3lame='#undef CONFIG_MP3LAME'
- def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 0"
fi
-_res_comment="in libavcodec: $_mp3lame_lavc"
echores "$_mp3lame"
fi # test "$_mencoder" != no
@@ -7669,10 +7239,6 @@ echocheck "mencoder"
if test "$_mencoder" = yes ; then
def_muxers='#define CONFIG_MUXERS 1'
else
- # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint, png for vf_screenshot
- _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
- test "$_zlib" = yes && _libavencoders="$_libavencoders PNG_ENCODER"
- _libavmuxers=""
def_muxers='#define CONFIG_MUXERS 0'
fi
echores "$_mencoder"
@@ -8048,135 +7614,6 @@ else
fi
echores "$_xmms"
-
-# --------------- GUI specific tests begin -------------------
-echocheck "GUI"
-echo "$_gui"
-if test "$_gui" = yes ; then
-
- # Required libraries
- if test "$_libavcodec" != yes ||
- ! echo $_libavdecoders | grep -q PNG_DECODER ; then
- die "The GUI requires libavcodec with PNG support (needs zlib)."
- fi
- test "$_freetype" = no && test "$_bitmap_font" = no && \
- die "The GUI requires either FreeType or bitmap font support."
-if ! win32 ; then
- _gui_gtk=yes
- test "$_x11" != yes && die "X11 support required for GUI compilation."
-
- echocheck "XShape extension"
- if test "$_xshape" = auto ; then
- _xshape=no
- cat > $TMPC << EOF
-#include <X11/Xlib.h>
-#include <X11/Xproto.h>
-#include <X11/Xutil.h>
-#include <X11/extensions/shape.h>
-#include <stdlib.h>
-int main(void) {
- char *name = ":0.0";
- Display *wsDisplay;
- int exitvar = 0;
- int eventbase, errorbase;
- if (getenv("DISPLAY"))
- name=getenv("DISPLAY");
- wsDisplay=XOpenDisplay(name);
- if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
- exitvar=1;
- XCloseDisplay(wsDisplay);
- return exitvar;
-}
-EOF
- cc_check -lXext && _xshape=yes
- fi
- if test "$_xshape" = yes ; then
- def_xshape='#define CONFIG_XSHAPE 1'
- else
- die "The GUI requires the X11 extension XShape (which was not found)."
- fi
- echores "$_xshape"
-
-#Check for GTK
-if test "$_gtk1" = no ; then
- #Check for GTK2 :
- echocheck "GTK+ version"
-
- if $_pkg_config gtk+-2.0 --exists ; then
- _gtk=$($_pkg_config gtk+-2.0 --modversion 2>/dev/null)
- extra_cflags="$extra_cflags $($_pkg_config gtk+-2.0 --cflags 2>/dev/null)"
- libs_mplayer="$libs_mplayer $($_pkg_config gtk+-2.0 --libs 2>/dev/null)"
- echores "$_gtk"
-
- # Check for GLIB2
- if $_pkg_config glib-2.0 --exists ; then
- echocheck "glib version"
- _glib=$($_pkg_config glib-2.0 --modversion 2>/dev/null)
- libs_mplayer="$libs_mplayer $($_pkg_config glib-2.0 --libs 2>/dev/null)"
- echores "$_glib"
-
- def_gui='#define CONFIG_GUI 1'
- def_gtk2='#define CONFIG_GTK2 1'
- else
- _gtk1=yes
- echo "GLIB-2 devel packages were not found, trying GTK 1.2"
- fi
- else
- echo "GTK-2 devel packages were not found, trying GTK 1.2"
- _gtk1=yes
- fi
-fi
-
-if test "$_gtk1" = yes ; then
- # Check for old GTK (1.2.x)
- echocheck "GTK version"
- if test -z "$_gtkconfig" ; then
- if ( gtk-config --version ) >/dev/null 2>&1 ; then
- _gtkconfig="gtk-config"
- elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
- _gtkconfig="gtk12-config"
- else
- die "The GUI requires GTK devel packages (which were not found)."
- fi
- fi
- _gtk=$($_gtkconfig --version 2>&1)
- extra_cflags="$extra_cflags $($_gtkconfig --cflags 2>&1)"
- libs_mplayer="$libs_mplayer $($_gtkconfig --libs 2>&1)"
- echores "$_gtk (using $_gtkconfig)"
-
- # Check for GLIB
- echocheck "glib version"
- if test -z "$_glibconfig" ; then
- if ( glib-config --version ) >/dev/null 2>&1 ; then
- _glibconfig="glib-config"
- elif ( glib12-config --version ) >/dev/null 2>&1 ; then
- _glibconfig="glib12-config"
- else
- die "The GUI requires GLIB devel packages (which were not found)"
- fi
- fi
- _glib=$($_glibconfig --version 2>&1)
- libs_mplayer="$libs_mplayer $($_glibconfig --libs 2>&1)"
- echores "$_glib (using $_glibconfig)"
-
- def_gui='#define CONFIG_GUI 1'
- def_gtk2='#undef CONFIG_GTK2'
-fi
-
-else #if ! win32
- _gui_win32=yes
- libs_mplayer="$libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
- def_gui='#define CONFIG_GUI 1'
- def_gtk2='#undef CONFIG_GTK2'
-fi #if ! win32
-
-else #if test "$_gui"
- def_gui='#undef CONFIG_GUI'
- def_gtk2='#undef CONFIG_GTK2'
-fi #if test "$_gui"
-# --------------- GUI specific tests end -------------------
-
-
if test "$_charset" != "noconv" ; then
def_charset="#define MSG_CHARSET \"$_charset\""
else
@@ -8192,7 +7629,6 @@ if test "$?" -ne 0 ; then
echo "No working iconv program found, use "
echo "--charset=UTF-8 to continue anyway."
echo "If you also have problems with iconv library functions use --charset=noconv."
- echo "Messages in the GTK-2 interface will be broken then."
exit 1
else
echores "yes"
@@ -8347,7 +7783,7 @@ if test "$_largefiles" = yes || freebsd ; then
fi
fi
-CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
+CXXFLAGS=" $CFLAGS -Iffmpeg -D__STDC_LIMIT_MACROS"
# This must be the last test to be performed. Any other tests following it
# could fail due to linker errors. libdvdnavmini is intentionally not linked
@@ -8355,6 +7791,9 @@ CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
# So any compilation using the flags added here but not linking against
# libdvdread can fail.
echocheck "DVD support (libdvdnav)"
+if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
+ _dvdnav=no
+fi
dvdnav_internal=no
if test "$_dvdnav" = auto ; then
if test "$_dvdread_internal" = yes ; then
@@ -8418,6 +7857,7 @@ DATADIR = \$(DESTDIR)$_datadir
LIBDIR = \$(DESTDIR)$_libdir
MANDIR = \$(DESTDIR)$_mandir
CONFDIR = \$(DESTDIR)$_confdir
+LOCALEDIR = \$(DESTDIR)$_localedir
AR = $_ar
AS = $_cc
@@ -8431,8 +7871,6 @@ RANLIB = $_ranlib
WINDRES = $_windres
CFLAGS = $CFLAGS $extra_cflags
-ASFLAGS = $CFLAGS $extra_cflags
-OPTFLAGS = $CFLAGS $extra_cflags
CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
CFLAGS_DHAHELPER = $cflags_dhahelper
CFLAGS_FAAD_FIXED = $cflags_faad_fixed
@@ -8449,8 +7887,6 @@ EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
EXTRALIBS_MPLAYER = $libs_mplayer
EXTRALIBS_MENCODER = $libs_mencoder
-DEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,\$^) | sed "s,[0-9a-z._-]*: \(\$(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,"
-
MPDEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.xpm,\$(filter-out %.h,$^)) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
MPDEPEND_CMD_CXX = \$(CC) -MM \$(CXXFLAGS) \$(filter-out %.hh,\$(filter-out %.h,$^)) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
@@ -8512,8 +7948,6 @@ FAAC=$_faac
FAAD = $_faad
FAAD_INTERNAL = $_faad_internal
FASTMEMCPY = $_fastmemcpy
-$mak_hardcoded_tables
-$mak_libavcodec_mpegaudio_hp
FBDEV = $_fbdev
FREETYPE = $_freetype
FTP = $_ftp
@@ -8523,9 +7957,6 @@ GL = $_gl
GL_WIN32 = $_gl_win32
GL_X11 = $_gl_x11
MATRIXVIEW = $matrixview
-GUI = $_gui
-GUI_GTK = $_gui_gtk
-GUI_WIN32 = $_gui_win32
HAVE_POSIX_SELECT = $_posix_select
HAVE_SYS_MMAN_H = $_mman
IVTV = $_ivtv
@@ -8537,7 +7968,6 @@ LADSPA = $_ladspa
LIBA52 = $_liba52
LIBA52_INTERNAL = $_liba52_internal
LIBASS = $_ass
-LIBASS_INTERNAL = $ass_internal
LIBBS2B = $_libbs2b
LIBDCA = $_libdca
LIBDV = $_libdv
@@ -8641,33 +8071,13 @@ ZR = $_zr
# FFmpeg
LIBAVUTIL = $_libavutil
-LIBAVUTIL_A = $_libavutil_a
-LIBAVUTIL_SO = $_libavutil_so
LIBAVCODEC = $_libavcodec
-LIBAVCODEC_A = $_libavcodec_a
-LIBAVCODEC_SO = $_libavcodec_so
LIBAVFORMAT = $_libavformat
-LIBAVFORMAT_A = $_libavformat_a
-LIBAVFORMAT_SO = $_libavformat_so
LIBPOSTPROC = $_libpostproc
-LIBPOSTPROC_A = $_libpostproc_a
-LIBPOSTPROC_SO = $_libpostproc_so
LIBSWSCALE = $_libswscale
-LIBSWSCALE_A = $_libswscale_a
-LIBSWSCALE_SO = $_libswscale_so
-
-HOSTCC=\$(HOST_CC)
-HOSTCFLAGS=-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3
-HOSTLIBS=-lm
-CC_O=-o \$@
-LD=gcc
-CONFIG_STATIC=yes
-SRC_PATH=..
-BUILD_ROOT=..
-LIBPREF=lib
-LIBSUF=.a
-LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
-FULLNAME=\$(NAME)\$(BUILDSUF)
+LIBAVCODEC_INTERNALS = $_libavcodec_internals
+LIBSWSCALE_INTERNALS = $_libswscale_internals
+FFMPEG_SOURCE_PATH = $_ffmpeg_source
# Some FFmpeg codecs depend on these. Enable them unconditionally for now.
CONFIG_AANDCT=yes
@@ -8681,25 +8091,8 @@ CONFIG_RDFT=yes
CONFIG_BZLIB=$bzlib
CONFIG_ENCODERS=yes
CONFIG_GPL=yes
-CONFIG_LIBDIRAC_DECODER=$_libdirac_lavc
-CONFIG_LIBDIRAC_ENCODER=$_libdirac_lavc
-CONFIG_LIBFAAC_ENCODER=$_faac_lavc
-CONFIG_LIBMP3LAME_ENCODER=$_mp3lame_lavc
-CONFIG_LIBOPENCORE_AMRNB_DECODER=$_libopencore_amrnb
-CONFIG_LIBOPENCORE_AMRNB_ENCODER=$_libopencore_amrnb
-CONFIG_LIBOPENCORE_AMRWB_DECODER=$_libopencore_amrwb
-OCNFIG_LIBOPENJPEG_DECODER = $libopenjpeg
-OCNFIG_LIBOPENJPEG_ENCODER = $libopenjpeg
-CONFIG_LIBSCHROEDINGER_DECODER=$_libschroedinger_lavc
-CONFIG_LIBSCHROEDINGER_ENCODER=$_libschroedinger_lavc
-CONFIG_LIBVORBIS_ENCODER=$_libvorbis
-CONFIG_LIBX264_ENCODER=$_x264_lavc
-CONFIG_LIBXVID_ENCODER=$_xvid_lavc
CONFIG_MLIB = $_mlib
CONFIG_MUXERS=$_mencoder
-CONFIG_POSTPROC = yes
-# Prevent building libavcodec/imgresample.c with conflicting symbols
-CONFIG_SWSCALE=yes
CONFIG_VDPAU=$_vdpau
CONFIG_XVMC=$_xvmc
CONFIG_ZLIB=$_zlib
@@ -8709,14 +8102,6 @@ HAVE_SHM = $_shm
HAVE_W32THREADS = $_w32threads
HAVE_YASM = $_have_yasm
-$(echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
-$(echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
-$(echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
-$(echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
-$(echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
-$(echo $_libavprotocols | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
-$(echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
-$(echo $_libavhwaccels | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
EOF
#############################################################################
@@ -8752,9 +8137,6 @@ cat > $TMPH << EOF
*/
#define CONFIG_FAKE_MONO 1
-/* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
-#define MAX_OUTBURST 65536
-
/* set up audio OUTBURST. Do not change this! */
#define OUTBURST 512
@@ -8773,6 +8155,9 @@ cat > $TMPH << EOF
#define MPLAYER_DATADIR "$_datadir"
#define MPLAYER_CONFDIR "$_confdir"
#define MPLAYER_LIBDIR "$_libdir"
+#define MPLAYER_LOCALEDIR "$_localedir"
+
+$def_translation
/* definitions needed by included libraries */
#define HAVE_INTTYPES_H 1
@@ -8871,7 +8256,6 @@ $def_crash_debug
$def_debug
$def_dynamic_plugins
$def_fastmemcpy
-$def_hardcoded_tables
$def_menu
$def_runtime_cpudetection
$def_sighandler
@@ -8953,12 +8337,6 @@ $def_xmms
#define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
-/* GUI */
-$def_gtk2
-$def_gui
-$def_xshape
-
-
/* Audio output drivers */
$def_alsa
$def_alsa1x
@@ -9009,7 +8387,6 @@ $def_tv_v4l2
/* font stuff */
$def_ass
-$def_ass_internal
$def_bitmap_font
$def_enca
$def_fontconfig
@@ -9029,9 +8406,6 @@ $def_network
$def_smb
$def_socklen_t
$def_vstream
-$def_addrinfo
-$def_getaddrinfo
-$def_sockaddr_storage
/* libvo options */
@@ -9115,20 +8489,12 @@ $def_zr
/* FFmpeg */
$def_libavcodec
-$def_libavcodec_a
-$def_libavcodec_so
$def_libavformat
-$def_libavformat_a
-$def_libavformat_so
$def_libavutil
-$def_libavutil_a
-$def_libavutil_so
$def_libpostproc
-$def_libpostproc_a
-$def_libpostproc_so
$def_libswscale
-$def_libswscale_a
-$def_libswscale_so
+$def_libavcodec_internals
+$def_libswscale_internals
#define CONFIG_DECODERS 1
#define CONFIG_ENCODERS 1
@@ -9142,7 +8508,6 @@ $def_dcbzl
$def_dos_paths
$def_fast_64bit
$def_fast_unaligned
-$def_libavcodec_mpegaudio_hp
$def_memalign_hack
$def_mlib
$def_mkstemp
@@ -9157,29 +8522,19 @@ $def_yasm
#define CONFIG_FFSERVER 0
#define CONFIG_GPL 1
#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
#define CONFIG_LIBVORBIS 0
#define CONFIG_POWERPC_PERF 0
#define CONFIG_SMALL 0
#define CONFIG_SWSCALE 1
#define CONFIG_SWSCALE_ALPHA 1
-#if defined(HAVE_AF_INET6) && (!defined(_WIN32) || defined(__CYGWIN__))
-#define CONFIG_IPV6 1
-#else
-#define CONFIG_IPV6 0
-#endif
-
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
#define HAVE_ATTRIBUTE_PACKED 1
#define HAVE_GETHRTIME 0
#define HAVE_INLINE_ASM 1
#define HAVE_LDBRX 0
#define HAVE_POLL_H 1
#define HAVE_PPC4XX 0
-#define HAVE_SETMODE 0
-#define HAVE_STRUCT_IPV6_MREQ 1
-#define HAVE_STRUCT_SOCKADDR_IN6 1
-#define HAVE_SYS_SELECT_H 0
#define HAVE_VFP_ARGS 1
#define HAVE_VIRTUALALLOC 0
@@ -9199,28 +8554,12 @@ $def_ebx_available
#define HAVE_EBP_AVAILABLE 0
#endif
-#define FFMPEG_CONFIGURATION "--enable-gpl --enable-postproc"
-#define FFMPEG_LICENSE "GPL version 2 or later"
-
-/* External libraries used through libavcodec. */
-$def_faac_lavc
-$def_libdirac_lavc
-$def_libopencore_amrnb
-$def_libopencore_amrwb
-$def_libopenjpeg
-$def_libschroedinger_lavc
-$def_mp3lame_lavc
-$def_x264_lavc
-$def_xvid_lavc
-
-$(ff_config_enable "$_libavdecoders_all" "$_libavdecoders")
-$(ff_config_enable "$_libavencoders_all" "$_libavencoders")
-$(ff_config_enable "$_libavparsers_all" "$_libavparsers")
-$(ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers")
-$(ff_config_enable "$_libavmuxers_all" "$_libavmuxers")
-$(ff_config_enable "$_libavprotocols_all" "$_libavprotocols")
-$(ff_config_enable "$_libavbsfs_all" "$_libavbsfs")
-$(ff_config_enable "$_libavhwaccels_all" "$_libavhwaccels")
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
#endif /* MPLAYER_CONFIG_H */
EOF
@@ -9228,22 +8567,10 @@ EOF
# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
-############################################################################
-
-# Create avconfig.h for FFmpeg.
-cat > "$TMPH" << EOF
-/* Generated by mpconfigure */
-#ifndef AVUTIL_AVCONFIG_H
-#define AVUTIL_AVCONFIG_H
-$def_av_bigendian
-#endif /* AVUTIL_AVCONFIG_H */
-EOF
-
-# Do not overwrite an unchanged avconfig.h to avoid superfluous rebuilds.
-cmp -s "$TMPH" libavutil/avconfig.h || mv -f "$TMPH" libavutil/avconfig.h
-
#############################################################################
+./version.sh `$_cc -dumpversion`
+
cat << EOF
Config files successfully generated by ./configure $_configuration !
@@ -9256,7 +8583,7 @@ Config files successfully generated by ./configure $_configuration !
Optimizing for: $_optimizing
Languages:
- Messages/GUI: $language_msg
+ Messages: $language_msg
Manual pages: $language_man
Documentation: $language_doc
@@ -9306,7 +8633,7 @@ skipping autodetection. This behavior is unlike what you may be used to from
autoconf-based configure scripts that can decide to override you. This greater
level of control comes at a price. You may have to provide the correct compiler
and linker flags yourself.
-If you used one of these options (except --enable-gui and similar ones that
+If you used one of these options (except --enable-menu and similar ones that
turn on internal features) and experience a compilation or linking failure,
make sure you have passed the necessary compiler/linker flags to configure.
diff --git a/cpudetect.h b/cpudetect.h
index 7c0f7e7cd0..cf39819d0b 100644
--- a/cpudetect.h
+++ b/cpudetect.h
@@ -26,7 +26,7 @@
#define CPUTYPE_I586 5
#define CPUTYPE_I686 6
-#include "libavutil/x86_cpu.h"
+#include "ffmpeg_files/x86_cpu.h"
typedef struct cpucaps_s {
int cpuType;
diff --git a/debian/README.debian b/debian/README.debian
index 23fc3ea415..80874c8de6 100644
--- a/debian/README.debian
+++ b/debian/README.debian
@@ -8,9 +8,9 @@ mplayer for Debian
directory
In case you would like to pass some parameters to ./configure, set variable
- DEB_BUILD_OPTIONS like that:
+ DEB_BUILD_CONFIGURE like that:
- eyck@ghost$ DEB_BUILD_OPTIONS="--enable-streaming" fakeroot debian/rules binary
+ eyck@ghost$ DEB_BUILD_CONFIGURE"--enable-streaming" fakeroot debian/rules binary
Dariush Pietrzak <eyck@ghost.anime.pl> Sat Jan 5 20:28:23 CET 2002
diff --git a/debian/TODO.Debian b/debian/TODO.Debian
index 4f73f9ba38..8b13789179 100644
--- a/debian/TODO.Debian
+++ b/debian/TODO.Debian
@@ -1 +1 @@
-- Figure out why /etc/mplayer/mplayer.config.1 gets created and fix this.
+
diff --git a/debian/changelog b/debian/changelog
index 8b16dbce63..ace71aa772 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mplayer (1.0git) unstable; urgency=low
+
+ * change version name to git.
+ * update standards version to 3.8.2
+
+ -- Anton Khirnov <wyskas@gmail.com> Sat, 08 Aug 2009 13:15:57 +0200
+
mplayer (1.0svn) unstable; urgency=low
* change version naming from cvs to svn.
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/config b/debian/config
deleted file mode 100755
index ab3c8c1b5b..0000000000
--- a/debian/config
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-CONFIGFILE=/etc/mplayer/mplayer.conf
-
-set -e
-
-# Source debconf library.
-. /usr/share/debconf/confmodule
-
-if test -r $CONFIGFILE && ! grep -q '### mplayer DEBCONF AREA' $CONFIGFILE
-then
- db_input medium 'mplayer/replace-existing-files' || true
- db_go || true
- if [ "$RET" != "true" ]; then
- exit 0
- fi
- db_get 'mplayer/replace-existing-files' || true
-fi
-
-########################################## find fonts
-#default font (if available)
-BESTFONT=/usr/share/fonts/truetype/Arial.ttf
-[ -r $BESTFONT ] || BESTFONT=/usr/share/fonts/truetype/freefont/FreeSans.ttf
-
-t=$(tempfile -p fonts )
-find /usr/share/fonts/ /?/?in*/?ont* -type f -iname '*.ttf' -maxdepth 3 2> /dev/null > $t || true
-
-if test -s $t
-then
- fonts=$( awk '{print a $0;a=", "}' $t || true )
- db_subst "mplayer/ttfont" ttfontchoices $fonts || true
- ## suppose the question is skipped: give a default
- a=$BESTFONT
- [ -r $BESTFONT ] || a=$(head -1 $t)
- db_subst "mplayer/ttfont" ttfontdefault $a || true
-
- db_input medium mplayer/ttfont || true
- if [ "$?" = 30 ] ; then
- db_set mplayer/ttfont $a || true
- fi
-else
- db_input medium "mplayer/no-ttfont" || true
-fi
-
-rm $t
-
-db_go || true
-
-############################################################
-
-
-exit 0
diff --git a/debian/control b/debian/control
index f8a5704f54..fb578fee1c 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,8 @@ Source: mplayer
Section: misc
Priority: optional
Maintainer: Diego Biurrun <diego@biurrun.de>
-Standards-Version: 3.2.1
-Build-Depends: libgtk1.2-dev | libgtk2.0-dev, libpng12-dev, zlib1g-dev, x11proto-core-dev, libx11-dev, libxext-dev, libxinerama-dev, libxv-dev, debhelper (>= 2)
+Standards-Version: 3.8.2
+Build-Depends: libpng12-dev, zlib1g-dev, x11proto-core-dev, libx11-dev, libxext-dev, libxinerama-dev, libxv-dev, debhelper (>= 7)
Package: mplayer
Architecture: any
diff --git a/debian/menu b/debian/menu
deleted file mode 100644
index 06a7c7f583..0000000000
--- a/debian/menu
+++ /dev/null
@@ -1,6 +0,0 @@
-?package(mplayer):\
- needs="X11"\
- section="Apps/Viewers"\
- title="MPlayer"\
- command="/usr/bin/gmplayer"\
- icon="/usr/share/pixmaps/mplayer.xpm"
diff --git a/debian/postrm b/debian/postrm
deleted file mode 100644
index 5cfa18c857..0000000000
--- a/debian/postrm
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "purge" ]; then
- if [ -e /usr/share/debconf/confmodule ]; then
- # Source debconf library.
- . /usr/share/debconf/confmodule
- # Remove my changes to the db.
- db_purge
- fi
-
- if [ -d /etc/mplayer/ ]; then
- rm -rf /etc/mplayer/
- fi
-fi
-
-#DEBHELPER#
diff --git a/debian/rules b/debian/rules
index 17c06b0621..5a775b8906 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,8 +2,10 @@
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
#export DH_VERBOSE=1
-# This is the debhelper compatability version to use.
-export DH_COMPAT=4
+
+# do not run the actual rules of this makefile in parallel. sub-makes
+# can go in parallel
+.NOTPARALLEL:
package := mplayer
prefix := $(shell pwd)/debian/$(package)
@@ -14,6 +16,11 @@ arch := $(shell dpkg --print-architecture)
# https://wiki.ubuntu.com/DistCompilerFlags
CLEAN_ENV=env -u CFLAGS -u CPPFLAGS -u LDFLAGS -u FFLAGS -u CXXFLAGS
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif
+
configure: configure-stamp
configure-stamp:
dh_testdir
@@ -23,7 +30,7 @@ configure-stamp:
# you may want to add the "--enable-runtime-cpudetection" option to
# the line below, but beware: the resulting binary will run slower
$(CLEAN_ENV) \
- ./configure --prefix=/usr --confdir=/etc/mplayer $(DEB_BUILD_OPTIONS)
+ ./configure --prefix=/usr --confdir=/etc/mplayer $(DEB_BUILD_CONFIGURE)
touch configure-stamp
@@ -44,7 +51,6 @@ clean:
# commands to clean up after the build process.
-$(MAKE) distclean
- rm -f help_mp.h config.h config.mak
dh_clean
# Build architecture-independent files here.
@@ -61,14 +67,9 @@ binary-arch: build
# commands to install the package into debian/<packagename>
$(MAKE) prefix=$(prefix)/usr BINDIR=$(prefix)/usr/bin CONFDIR=$(prefix)/etc/mplayer LIBDIR=$(prefix)/usr/lib DATADIR=$(prefix)/usr/share/mplayer MANDIR=$(prefix)/usr/share/man install
- dh_link usr/bin/mplayer usr/bin/gmplayer \
- usr/share/man/man1/mplayer.1.gz usr/share/man/man1/gmplayer.1.gz
-
-
- dh_installdebconf
+ install -D -m 644 etc/example.conf $(prefix)/etc/mplayer/mplayer.conf
dh_installdocs -X.svn -Xmplayer.1 DOCS/*
dh_installexamples etc/example.conf etc/dvb-menu.conf etc/input.conf etc/menu.conf
- dh_installmenu
dh_installmime
dh_installinfo
dh_installchangelogs
diff --git a/debian/templates b/debian/templates
deleted file mode 100644
index 8fc8ca072b..0000000000
--- a/debian/templates
+++ /dev/null
@@ -1,26 +0,0 @@
-Template: mplayer/replace-existing-files
-Type: boolean
-Default: true
-Description: Upgrade existing system?
- It looks like you've configured MPlayer already. If you'd like to
- configure it with this program, the old configuration
- /etc/mplayer/mplayer.conf will be deleted. Do you want to continue
- configuration with this program? If you say "Yes", your old
- configuration will be deleted and you can create it anew with this
- program. If you say "No" your existing files will be kept. If you
- change your mind later, you can run 'dpkg-reconfigure mplayer'.
-
-Template: mplayer/ttfont
-Type: select
-Choices: ${ttfontchoices}
-Default: ${ttfontdefault}
-Description: MPlayer fonts
- MPlayer can use TrueType fonts to render the OSD and subtitles.
- Choose your favorite.
-
-Template: mplayer/no-ttfont
-Type: note
-Description: MPlayer cannot find TrueType fonts
- You should install a package providing TrueType fonts (such as
- 'ttf-freefont' or 'ttf-bitstream-vera' or 'msttcorefonts' )
- and reconfigure mplayer.
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index f02e397260..0000000000
--- a/debian/watch
+++ /dev/null
@@ -1,3 +0,0 @@
-# Site Directory Pattern Version Script
-version=2
-http://www.mplayerhq.hu /MPlayer/releases/ MPlayer-(.*)\.tar\.bz2 debian uupdate
diff --git a/defaultopts.c b/defaultopts.c
new file mode 100644
index 0000000000..b5917c53a7
--- /dev/null
+++ b/defaultopts.c
@@ -0,0 +1,62 @@
+#include <stddef.h>
+
+#include "config.h"
+#include "defaultopts.h"
+#include "options.h"
+
+void set_default_mplayer_options(struct MPOpts *opts)
+{
+ *opts = (const struct MPOpts){
+ .audio_driver_list = NULL,
+ .video_driver_list = NULL,
+ .fixed_vo = 1,
+ .monitor_pixel_aspect = 1.0,
+ .vo_panscanrange = 1.0,
+ .vo_gamma_gamma = 1000,
+ .vo_gamma_brightness = 1000,
+ .vo_gamma_contrast = 1000,
+ .vo_gamma_saturation = 1000,
+ .vo_gamma_hue = 1000,
+ .osd_level = 1,
+ .osd_duration = 1000,
+ .loop_times = -1,
+ .ordered_chapters = 1,
+ .edition_id = -1,
+ .user_correct_pts = -1,
+ .key_fifo_size = 7,
+ .doubleclick_time = 300,
+ .audio_id = -1,
+ .video_id = -1,
+ .sub_id = -1,
+ .playback_speed = 1.,
+ .movie_aspect = -1.,
+ .flip = -1,
+ .vd_use_slices = 1,
+ .lavc_param = {
+ .workaround_bugs = 1, // autodetect
+ .error_resilience = 2,
+ .error_concealment = 3,
+ .threads = 1,
+ },
+ .input = {
+ .config_file = "input.conf",
+ .ar_delay = 100,
+ .ar_rate = 8,
+ .use_joystick = 1,
+ .use_lirc = 1,
+ .use_lircc = 1,
+#ifdef CONFIG_APPLE_REMOTE
+ .use_ar = 1,
+#else
+ .use_ar = 0,
+#endif
+ .default_bindings = 1,
+ }
+ };
+}
+
+void set_default_mencoder_options(struct MPOpts *opts)
+{
+ set_default_mplayer_options(opts);
+ opts->user_correct_pts = 0;
+}
diff --git a/defaultopts.h b/defaultopts.h
new file mode 100644
index 0000000000..15067204a7
--- /dev/null
+++ b/defaultopts.h
@@ -0,0 +1,3 @@
+struct MPOpts;
+void set_default_mplayer_options(struct MPOpts *opts);
+void set_default_mencoder_options(struct MPOpts *opts);
diff --git a/drivers/radeon_vid.c b/drivers/radeon_vid.c
index 222f03b375..9367d4b36a 100644
--- a/drivers/radeon_vid.c
+++ b/drivers/radeon_vid.c
@@ -1547,4 +1547,3 @@ void __exit cleanup_module(void)
radeon_ram_size*0x100000);
#endif /* CONFIG_MTRR */
}
-
diff --git a/edl.c b/edl.c
index 6711c1f2e5..f20ee3d049 100644
--- a/edl.c
+++ b/edl.c
@@ -37,7 +37,7 @@ static edl_record_ptr edl_alloc_new(edl_record_ptr next_edl_record)
{
edl_record_ptr new_record = calloc(1, sizeof(struct edl_record));
if (!new_record) {
- mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_EdlOutOfMem);
+ mp_tmsg(MSGT_CPLAYER, MSGL_FATAL, "Can't allocate enough memory to hold EDL data.\n");
exit(1);
}
@@ -96,24 +96,26 @@ edl_record_ptr edl_parse_file(void)
if ((sscanf(line, "%f %f %d", &start, &stop, &action))
!= 3)
{
- mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadlyFormattedLine,
+ mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Badly formatted EDL line [%d], discarding.\n",
lineCount);
continue;
}
if (next_edl_record && start <= next_edl_record->stop_sec)
{
- mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine, line);
- mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadLineOverlap,
+ mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Invalid EDL line: %s\n", line);
+ mp_tmsg(MSGT_CPLAYER, MSGL_WARN,
+ "Last stop position was [%f]; next start is [%f].\n"\
+ "Entries must be in chronological order, cannot overlap. Discarding.\n",
next_edl_record->stop_sec, start);
continue;
}
if (stop <= start)
{
- mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine,
+ mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Invalid EDL line: %s\n",
line);
- mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadLineBadStop);
+ mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Stop time has to be after start time.\n");
continue;
}
@@ -149,9 +151,9 @@ edl_record_ptr edl_parse_file(void)
}
if (edl_records)
- mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdlRecordsNo, record_count);
+ mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Read %d EDL actions.\n", record_count);
else
- mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdlQueueEmpty);
+ mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "There are no EDL actions to take care of.\n");
return edl_records;
}
diff --git a/etc/codecs.conf b/etc/codecs.conf
index d018d2d0a2..fffb1e0c2f 100644
--- a/etc/codecs.conf
+++ b/etc/codecs.conf
@@ -102,37 +102,6 @@ videocodec blackmagic
out BGR32,RGB32
; MPEG-1/2 decoding:
-; Note: mpegpes is preferred for hw decoders:
-
-videocodec mpegpes
- info "MPEG-PES output (.mpg or DXR3/IVTV/DVB/V4L2 card)"
- comment "for hardware decoding"
- status working
- format 0x10000001 ; mpeg 1
- format 0x10000002 ; mpeg 2
- fourcc mpg1,MPG1,mpg2,MPG2
- fourcc MPEG
- fourcc hdv1,hdv2,hdv3
- fourcc hdv5
- fourcc hdv6,hdv7,hdv8
- fourcc xdv1,xdv2,xdv3
- fourcc xdv4,xdv5,xdv6
- fourcc xdv7,xdv8,xdv9
- fourcc xdva,xdvb,xdvc
- fourcc xdvd,xdve,xdvf
- fourcc xd5a,xd5b,xd5c
- fourcc xd5d,xd5e,xd5f
- fourcc xd59
- fourcc mx5n,mx4n,mx4p
- fourcc mx3n,mx3p
- fourcc AVmp
- fourcc mp2v,mpgv
- fourcc m2v1,m1v1
- fourcc PIM1 ; Pinnacle hardware-MPEG-1
- fourcc PIM2 ; Pinnacle hardware-MPEG-2
- fourcc LMP2 ; Lead mpeg2 in avi
- driver mpegpes
- out MPES
videocodec ffmpeg1
info "FFmpeg MPEG-1"
@@ -333,6 +302,36 @@ videocodec ffmpeg12vdpau
out VDPAU_MPEG1
out VDPAU_MPEG2
+videocodec mpegpes
+ info "MPEG-PES output (.mpg or DXR3/IVTV/DVB/V4L2 card)"
+ comment "for hardware decoding"
+ status working
+ format 0x10000001 ; mpeg 1
+ format 0x10000002 ; mpeg 2
+ fourcc mpg1,MPG1,mpg2,MPG2
+ fourcc MPEG
+ fourcc hdv1,hdv2,hdv3
+ fourcc hdv5
+ fourcc hdv6,hdv7,hdv8
+ fourcc xdv1,xdv2,xdv3
+ fourcc xdv4,xdv5,xdv6
+ fourcc xdv7,xdv8,xdv9
+ fourcc xdva,xdvb,xdvc
+ fourcc xdvd,xdve,xdvf
+ fourcc xd5a,xd5b,xd5c
+ fourcc xd5d,xd5e,xd5f
+ fourcc xd59
+ fourcc mx5n,mx4n,mx4p
+ fourcc mx3n,mx3p
+ fourcc AVmp
+ fourcc mp2v,mpgv
+ fourcc m2v1,m1v1
+ fourcc PIM1 ; Pinnacle hardware-MPEG-1
+ fourcc PIM2 ; Pinnacle hardware-MPEG-2
+ fourcc LMP2 ; Lead mpeg2 in avi
+ driver mpegpes
+ out MPES
+
; we have only native open source codecs for these:
videocodec ffnuv
@@ -2101,7 +2100,7 @@ videocodec ffvp6a
videocodec ffvp6f
info "FFmpeg VP6 Flash"
status working
- fourcc VP6F
+ fourcc VP6F,FLV4
driver ffmpeg
dll "vp6f"
out YV12
diff --git a/etc/input.conf b/etc/input.conf
index 8efa099002..3ed118018f 100644
--- a/etc/input.conf
+++ b/etc/input.conf
@@ -78,18 +78,6 @@ n tv_step_norm
b tv_step_chanlist
##
-## GUI
-##
-
-#l gui_loadfile
-#t gui_loadsubtitle
-#a gui_about
-#s gui_stop
-#p gui_playlist
-#r gui_preferences
-#c gui_skinbrowser
-
-##
## Joystick section
## WARNING: joystick support has to be explicitly enabled at
## compiletime with --enable-joystick
diff --git a/etc/menu.conf b/etc/menu.conf
index 8aa273bcb7..635a2f2a1c 100644
--- a/etc/menu.conf
+++ b/etc/menu.conf
@@ -149,5 +149,3 @@
<e name="Console" ok="set_menu console0"/>
<e name="Quit" ok="quit"/>
</cmdlist>
-
-
diff --git a/ffmpeg_files/arm/bswap.h b/ffmpeg_files/arm/bswap.h
new file mode 100644
index 0000000000..98147449b1
--- /dev/null
+++ b/ffmpeg_files/arm/bswap.h
@@ -0,0 +1,72 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef MP_AVUTIL_ARM_BSWAP_H
+#define MP_AVUTIL_ARM_BSWAP_H
+
+#include <stdint.h>
+#include "config.h"
+#include "libavutil/common.h"
+
+#ifdef __ARMCC_VERSION
+
+#if HAVE_ARMV6
+#define bswap_16 bswap_16
+static av_always_inline av_const uint16_t bswap_16(uint16_t x)
+{
+ __asm { rev16 x, x }
+ return x;
+}
+
+#define bswap_32 bswap_32
+static av_always_inline av_const uint32_t bswap_32(uint32_t x)
+{
+ return __rev(x);
+}
+#endif /* HAVE_ARMV6 */
+
+#elif HAVE_INLINE_ASM
+
+#if HAVE_ARMV6
+#define bswap_16 bswap_16
+static av_always_inline av_const uint16_t bswap_16(uint16_t x)
+{
+ __asm__("rev16 %0, %0" : "+r"(x));
+ return x;
+}
+#endif
+
+#define bswap_32 bswap_32
+static av_always_inline av_const uint32_t bswap_32(uint32_t x)
+{
+#if HAVE_ARMV6
+ __asm__("rev %0, %0" : "+r"(x));
+#else
+ uint32_t t;
+ __asm__ ("eor %1, %0, %0, ror #16 \n\t"
+ "bic %1, %1, #0xFF0000 \n\t"
+ "mov %0, %0, ror #8 \n\t"
+ "eor %0, %0, %1, lsr #8 \n\t"
+ : "+r"(x), "=&r"(t));
+#endif /* HAVE_ARMV6 */
+ return x;
+}
+
+#endif /* __ARMCC_VERSION */
+
+#endif /* AVUTIL_ARM_BSWAP_H */
diff --git a/ffmpeg_files/arm/intreadwrite.h b/ffmpeg_files/arm/intreadwrite.h
new file mode 100644
index 0000000000..34b5ec8e4a
--- /dev/null
+++ b/ffmpeg_files/arm/intreadwrite.h
@@ -0,0 +1,78 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef MP_AVUTIL_ARM_INTREADWRITE_H
+#define MP_AVUTIL_ARM_INTREADWRITE_H
+
+#include <stdint.h>
+#include "config.h"
+
+#if HAVE_FAST_UNALIGNED && HAVE_INLINE_ASM
+
+#define AV_RN16 AV_RN16
+static inline uint16_t AV_RN16(const void *p)
+{
+ uint16_t v;
+ __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)p));
+ return v;
+}
+
+#define AV_WN16 AV_WN16
+static inline void AV_WN16(void *p, uint16_t v)
+{
+ __asm__ ("strh %1, %0" : "=m"(*(uint16_t *)p) : "r"(v));
+}
+
+#define AV_RN32 AV_RN32
+static inline uint32_t AV_RN32(const void *p)
+{
+ uint32_t v;
+ __asm__ ("ldr %0, %1" : "=r"(v) : "m"(*(const uint32_t *)p));
+ return v;
+}
+
+#define AV_WN32 AV_WN32
+static inline void AV_WN32(void *p, uint32_t v)
+{
+ __asm__ ("str %1, %0" : "=m"(*(uint32_t *)p) : "r"(v));
+}
+
+#define AV_RN64 AV_RN64
+static inline uint64_t AV_RN64(const void *p)
+{
+ union { uint64_t v; uint32_t hl[2]; } v;
+ __asm__ ("ldr %0, %2 \n\t"
+ "ldr %1, %3 \n\t"
+ : "=r"(v.hl[0]), "=r"(v.hl[1])
+ : "m"(*(const uint32_t*)p), "m"(*((const uint32_t*)p+1)));
+ return v.v;
+}
+
+#define AV_WN64 AV_WN64
+static inline void AV_WN64(void *p, uint64_t v)
+{
+ union { uint64_t v; uint32_t hl[2]; } vv = { v };
+ __asm__ ("str %2, %0 \n\t"
+ "str %3, %1 \n\t"
+ : "=m"(*(uint32_t*)p), "=m"(*((uint32_t*)p+1))
+ : "r"(vv.hl[0]), "r"(vv.hl[1]));
+}
+
+#endif /* HAVE_INLINE_ASM */
+
+#endif /* AVUTIL_ARM_INTREADWRITE_H */
diff --git a/ffmpeg_files/bfin/bswap.h b/ffmpeg_files/bfin/bswap.h
new file mode 100644
index 0000000000..0f7e5a26eb
--- /dev/null
+++ b/ffmpeg_files/bfin/bswap.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2007 Marc Hoffman
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavutil/bfin/bswap.h
+ * byte swapping routines
+ */
+
+#ifndef MP_AVUTIL_BFIN_BSWAP_H
+#define MP_AVUTIL_BFIN_BSWAP_H
+
+#include <stdint.h>
+#include "config.h"
+#include "libavutil/common.h"
+
+#define bswap_32 bswap_32
+static av_always_inline av_const uint32_t bswap_32(uint32_t x)
+{
+ unsigned tmp;
+ __asm__("%1 = %0 >> 8 (V); \n\t"
+ "%0 = %0 << 8 (V); \n\t"
+ "%0 = %0 | %1; \n\t"
+ "%0 = PACK(%0.L, %0.H); \n\t"
+ : "+d"(x), "=&d"(tmp));
+ return x;
+}
+
+#endif /* AVUTIL_BFIN_BSWAP_H */
diff --git a/ffmpeg_files/bswap.h b/ffmpeg_files/bswap.h
new file mode 100644
index 0000000000..3bfa6aa631
--- /dev/null
+++ b/ffmpeg_files/bswap.h
@@ -0,0 +1,103 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+// This file in MPlayer is otherwise the same as in FFmpeg, except it
+// includes "libavutil/common.h" instead of "common.h".
+
+/**
+ * @file libavutil/bswap.h
+ * byte swapping routines
+ */
+
+#ifndef MP_AVUTIL_BSWAP_H
+#define MP_AVUTIL_BSWAP_H
+
+#include <stdint.h>
+#include "libavutil/common.h"
+#include "config.h"
+
+#if ARCH_ARM
+# include "arm/bswap.h"
+#elif ARCH_BFIN
+# include "bfin/bswap.h"
+#elif ARCH_SH4
+# include "sh4/bswap.h"
+#elif ARCH_X86
+# include "x86/bswap.h"
+#endif
+
+#ifndef bswap_16
+static av_always_inline av_const uint16_t bswap_16(uint16_t x)
+{
+ x= (x>>8) | (x<<8);
+ return x;
+}
+#endif
+
+#ifndef bswap_32
+static av_always_inline av_const uint32_t bswap_32(uint32_t x)
+{
+ x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
+ x= (x>>16) | (x<<16);
+ return x;
+}
+#endif
+
+#ifndef bswap_64
+static inline uint64_t av_const bswap_64(uint64_t x)
+{
+#if 0
+ x= ((x<< 8)&0xFF00FF00FF00FF00ULL) | ((x>> 8)&0x00FF00FF00FF00FFULL);
+ x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL);
+ return (x>>32) | (x<<32);
+#else
+ union {
+ uint64_t ll;
+ uint32_t l[2];
+ } w, r;
+ w.ll = x;
+ r.l[0] = bswap_32 (w.l[1]);
+ r.l[1] = bswap_32 (w.l[0]);
+ return r.ll;
+#endif
+}
+#endif
+
+// be2me ... big-endian to machine-endian
+// le2me ... little-endian to machine-endian
+
+#ifdef WORDS_BIGENDIAN
+#define be2me_16(x) (x)
+#define be2me_32(x) (x)
+#define be2me_64(x) (x)
+#define le2me_16(x) bswap_16(x)
+#define le2me_32(x) bswap_32(x)
+#define le2me_64(x) bswap_64(x)
+#else
+#define be2me_16(x) bswap_16(x)
+#define be2me_32(x) bswap_32(x)
+#define be2me_64(x) bswap_64(x)
+#define le2me_16(x) (x)
+#define le2me_32(x) (x)
+#define le2me_64(x) (x)
+#endif
+
+#endif /* AVUTIL_BSWAP_H */
diff --git a/ffmpeg_files/intreadwrite.h b/ffmpeg_files/intreadwrite.h
new file mode 100644
index 0000000000..bc61ccceb7
--- /dev/null
+++ b/ffmpeg_files/intreadwrite.h
@@ -0,0 +1,268 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef MP_AVUTIL_INTREADWRITE_H
+#define MP_AVUTIL_INTREADWRITE_H
+
+#include <stdint.h>
+#include "config.h"
+#include "bswap.h"
+
+/*
+ * Arch-specific headers can provide any combination of
+ * AV_[RW][BLN](16|32|64) macros. Preprocessor symbols must be
+ * defined, even if these are implemented as inline functions.
+ */
+
+#if ARCH_ARM
+# include "arm/intreadwrite.h"
+#elif ARCH_MIPS
+# include "mips/intreadwrite.h"
+#elif ARCH_PPC
+# include "ppc/intreadwrite.h"
+#endif
+
+/*
+ * Define AV_[RW]N helper macros to simplify definitions not provided
+ * by per-arch headers.
+ */
+
+#if defined(__GNUC__)
+
+struct unaligned_64 { uint64_t l; } __attribute__((packed));
+struct unaligned_32 { uint32_t l; } __attribute__((packed));
+struct unaligned_16 { uint16_t l; } __attribute__((packed));
+
+# define AV_RN(s, p) (((const struct unaligned_##s *) (p))->l)
+# define AV_WN(s, p, v) (((struct unaligned_##s *) (p))->l) = (v)
+
+#elif defined(__DECC)
+
+# define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
+# define AV_WN(s, p, v) *((__unaligned uint##s##_t*)(p)) = (v)
+
+#elif HAVE_FAST_UNALIGNED
+
+# define AV_RN(s, p) (*((const uint##s##_t*)(p)))
+# define AV_WN(s, p, v) *((uint##s##_t*)(p)) = (v)
+
+#else
+
+#ifndef AV_RB16
+#define AV_RB16(x) ((((const uint8_t*)(x))[0] << 8) | \
+ ((const uint8_t*)(x))[1])
+#endif
+#ifndef AV_WB16
+#define AV_WB16(p, d) do { \
+ ((uint8_t*)(p))[1] = (d); \
+ ((uint8_t*)(p))[0] = (d)>>8; } while(0)
+#endif
+
+#ifndef AV_RL16
+#define AV_RL16(x) ((((const uint8_t*)(x))[1] << 8) | \
+ ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL16
+#define AV_WL16(p, d) do { \
+ ((uint8_t*)(p))[0] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; } while(0)
+#endif
+
+#ifndef AV_RB32
+#define AV_RB32(x) ((((const uint8_t*)(x))[0] << 24) | \
+ (((const uint8_t*)(x))[1] << 16) | \
+ (((const uint8_t*)(x))[2] << 8) | \
+ ((const uint8_t*)(x))[3])
+#endif
+#ifndef AV_WB32
+#define AV_WB32(p, d) do { \
+ ((uint8_t*)(p))[3] = (d); \
+ ((uint8_t*)(p))[2] = (d)>>8; \
+ ((uint8_t*)(p))[1] = (d)>>16; \
+ ((uint8_t*)(p))[0] = (d)>>24; } while(0)
+#endif
+
+#ifndef AV_RL32
+#define AV_RL32(x) ((((const uint8_t*)(x))[3] << 24) | \
+ (((const uint8_t*)(x))[2] << 16) | \
+ (((const uint8_t*)(x))[1] << 8) | \
+ ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL32
+#define AV_WL32(p, d) do { \
+ ((uint8_t*)(p))[0] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; \
+ ((uint8_t*)(p))[2] = (d)>>16; \
+ ((uint8_t*)(p))[3] = (d)>>24; } while(0)
+#endif
+
+#ifndef AV_RB64
+#define AV_RB64(x) (((uint64_t)((const uint8_t*)(x))[0] << 56) | \
+ ((uint64_t)((const uint8_t*)(x))[1] << 48) | \
+ ((uint64_t)((const uint8_t*)(x))[2] << 40) | \
+ ((uint64_t)((const uint8_t*)(x))[3] << 32) | \
+ ((uint64_t)((const uint8_t*)(x))[4] << 24) | \
+ ((uint64_t)((const uint8_t*)(x))[5] << 16) | \
+ ((uint64_t)((const uint8_t*)(x))[6] << 8) | \
+ (uint64_t)((const uint8_t*)(x))[7])
+#endif
+#ifndef AV_WB64
+#define AV_WB64(p, d) do { \
+ ((uint8_t*)(p))[7] = (d); \
+ ((uint8_t*)(p))[6] = (d)>>8; \
+ ((uint8_t*)(p))[5] = (d)>>16; \
+ ((uint8_t*)(p))[4] = (d)>>24; \
+ ((uint8_t*)(p))[3] = (d)>>32; \
+ ((uint8_t*)(p))[2] = (d)>>40; \
+ ((uint8_t*)(p))[1] = (d)>>48; \
+ ((uint8_t*)(p))[0] = (d)>>56; } while(0)
+#endif
+
+#ifndef AV_RL64
+#define AV_RL64(x) (((uint64_t)((const uint8_t*)(x))[7] << 56) | \
+ ((uint64_t)((const uint8_t*)(x))[6] << 48) | \
+ ((uint64_t)((const uint8_t*)(x))[5] << 40) | \
+ ((uint64_t)((const uint8_t*)(x))[4] << 32) | \
+ ((uint64_t)((const uint8_t*)(x))[3] << 24) | \
+ ((uint64_t)((const uint8_t*)(x))[2] << 16) | \
+ ((uint64_t)((const uint8_t*)(x))[1] << 8) | \
+ (uint64_t)((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL64
+#define AV_WL64(p, d) do { \
+ ((uint8_t*)(p))[0] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; \
+ ((uint8_t*)(p))[2] = (d)>>16; \
+ ((uint8_t*)(p))[3] = (d)>>24; \
+ ((uint8_t*)(p))[4] = (d)>>32; \
+ ((uint8_t*)(p))[5] = (d)>>40; \
+ ((uint8_t*)(p))[6] = (d)>>48; \
+ ((uint8_t*)(p))[7] = (d)>>56; } while(0)
+#endif
+
+#ifdef WORDS_BIGENDIAN
+# define AV_RN(s, p) AV_RB##s(p)
+# define AV_WN(s, p, v) AV_WB##s(p, v)
+#else
+# define AV_RN(s, p) AV_RL##s(p)
+# define AV_WN(s, p, v) AV_WL##s(p, v)
+#endif
+
+#endif /* HAVE_FAST_UNALIGNED */
+
+#ifndef AV_RN16
+# define AV_RN16(p) AV_RN(16, p)
+#endif
+
+#ifndef AV_RN32
+# define AV_RN32(p) AV_RN(32, p)
+#endif
+
+#ifndef AV_RN64
+# define AV_RN64(p) AV_RN(64, p)
+#endif
+
+#ifndef AV_WN16
+# define AV_WN16(p, v) AV_WN(16, p, v)
+#endif
+
+#ifndef AV_WN32
+# define AV_WN32(p, v) AV_WN(32, p, v)
+#endif
+
+#ifndef AV_WN64
+# define AV_WN64(p, v) AV_WN(64, p, v)
+#endif
+
+#ifdef WORDS_BIGENDIAN
+# define AV_RB(s, p) AV_RN(s, p)
+# define AV_WB(s, p, v) AV_WN(s, p, v)
+# define AV_RL(s, p) bswap_##s(AV_RN(s, p))
+# define AV_WL(s, p, v) AV_WN(s, p, bswap_##s(v))
+#else
+# define AV_RB(s, p) bswap_##s(AV_RN(s, p))
+# define AV_WB(s, p, v) AV_WN(s, p, bswap_##s(v))
+# define AV_RL(s, p) AV_RN(s, p)
+# define AV_WL(s, p, v) AV_WN(s, p, v)
+#endif
+
+#define AV_RB8(x) (((const uint8_t*)(x))[0])
+#define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0)
+
+#define AV_RL8(x) AV_RB8(x)
+#define AV_WL8(p, d) AV_WB8(p, d)
+
+#ifndef AV_RB16
+# define AV_RB16(p) AV_RB(16, p)
+#endif
+#ifndef AV_WB16
+# define AV_WB16(p, v) AV_WB(16, p, v)
+#endif
+
+#ifndef AV_RL16
+# define AV_RL16(p) AV_RL(16, p)
+#endif
+#ifndef AV_WL16
+# define AV_WL16(p, v) AV_WL(16, p, v)
+#endif
+
+#ifndef AV_RB32
+# define AV_RB32(p) AV_RB(32, p)
+#endif
+#ifndef AV_WB32
+# define AV_WB32(p, v) AV_WB(32, p, v)
+#endif
+
+#ifndef AV_RL32
+# define AV_RL32(p) AV_RL(32, p)
+#endif
+#ifndef AV_WL32
+# define AV_WL32(p, v) AV_WL(32, p, v)
+#endif
+
+#ifndef AV_RB64
+# define AV_RB64(p) AV_RB(64, p)
+#endif
+#ifndef AV_WB64
+# define AV_WB64(p, v) AV_WB(64, p, v)
+#endif
+
+#ifndef AV_RL64
+# define AV_RL64(p) AV_RL(64, p)
+#endif
+#ifndef AV_WL64
+# define AV_WL64(p, v) AV_WL(64, p, v)
+#endif
+
+#define AV_RB24(x) ((((const uint8_t*)(x))[0] << 16) | \
+ (((const uint8_t*)(x))[1] << 8) | \
+ ((const uint8_t*)(x))[2])
+#define AV_WB24(p, d) do { \
+ ((uint8_t*)(p))[2] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; \
+ ((uint8_t*)(p))[0] = (d)>>16; } while(0)
+
+#define AV_RL24(x) ((((const uint8_t*)(x))[2] << 16) | \
+ (((const uint8_t*)(x))[1] << 8) | \
+ ((const uint8_t*)(x))[0])
+#define AV_WL24(p, d) do { \
+ ((uint8_t*)(p))[0] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; \
+ ((uint8_t*)(p))[2] = (d)>>16; } while(0)
+
+#endif /* AVUTIL_INTREADWRITE_H */
diff --git a/ffmpeg_files/sh4/bswap.h b/ffmpeg_files/sh4/bswap.h
new file mode 100644
index 0000000000..47b91397ea
--- /dev/null
+++ b/ffmpeg_files/sh4/bswap.h
@@ -0,0 +1,48 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavutil/sh4/bswap.h
+ * byte swapping routines
+ */
+
+#ifndef MP_AVUTIL_SH4_BSWAP_H
+#define MP_AVUTIL_SH4_BSWAP_H
+
+#include <stdint.h>
+#include "config.h"
+#include "libavutil/common.h"
+
+#define bswap_16 bswap_16
+static av_always_inline av_const uint16_t bswap_16(uint16_t x)
+{
+ __asm__("swap.b %0,%0" : "+r"(x));
+ return x;
+}
+
+#define bswap_32 bswap_32
+static av_always_inline av_const uint32_t bswap_32(uint32_t x)
+{
+ __asm__("swap.b %0,%0\n"
+ "swap.w %0,%0\n"
+ "swap.b %0,%0\n"
+ : "+r"(x));
+ return x;
+}
+
+#endif /* AVUTIL_SH4_BSWAP_H */
diff --git a/ffmpeg_files/taglists.c b/ffmpeg_files/taglists.c
new file mode 100644
index 0000000000..ad2e78c557
--- /dev/null
+++ b/ffmpeg_files/taglists.c
@@ -0,0 +1,339 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+/* This file contains:
+ * - the tables ff_codec_bmp_tags and ff_codec_wav_tags from FFmpeg's
+ * libavformat/riff.c, renamed to have an extra mp_ prefix
+ * - an implementation of av_codec_get_tag and av_codec_get_id from
+ * libavformat/utils.c, renamed to have an extra mp_ prefix
+ */
+
+
+const struct mp_AVCodecTag mp_ff_codec_bmp_tags[] = {
+ { CODEC_ID_H264, MKTAG('H', '2', '6', '4') },
+ { CODEC_ID_H264, MKTAG('h', '2', '6', '4') },
+ { CODEC_ID_H264, MKTAG('X', '2', '6', '4') },
+ { CODEC_ID_H264, MKTAG('x', '2', '6', '4') },
+ { CODEC_ID_H264, MKTAG('a', 'v', 'c', '1') },
+ { CODEC_ID_H264, MKTAG('V', 'S', 'S', 'H') },
+ { CODEC_ID_H263, MKTAG('H', '2', '6', '3') },
+ { CODEC_ID_H263, MKTAG('X', '2', '6', '3') },
+ { CODEC_ID_H263, MKTAG('T', '2', '6', '3') },
+ { CODEC_ID_H263, MKTAG('L', '2', '6', '3') },
+ { CODEC_ID_H263, MKTAG('V', 'X', '1', 'K') },
+ { CODEC_ID_H263, MKTAG('Z', 'y', 'G', 'o') },
+ { CODEC_ID_H263P, MKTAG('H', '2', '6', '3') },
+ { CODEC_ID_H263I, MKTAG('I', '2', '6', '3') }, /* intel h263 */
+ { CODEC_ID_H261, MKTAG('H', '2', '6', '1') },
+ { CODEC_ID_H263P, MKTAG('U', '2', '6', '3') },
+ { CODEC_ID_H263P, MKTAG('v', 'i', 'v', '1') },
+ { CODEC_ID_MPEG4, MKTAG('F', 'M', 'P', '4') },
+ { CODEC_ID_MPEG4, MKTAG('D', 'I', 'V', 'X') },
+ { CODEC_ID_MPEG4, MKTAG('D', 'X', '5', '0') },
+ { CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D') },
+ { CODEC_ID_MPEG4, MKTAG('M', 'P', '4', 'S') },
+ { CODEC_ID_MPEG4, MKTAG('M', '4', 'S', '2') },
+ { CODEC_ID_MPEG4, MKTAG( 4 , 0 , 0 , 0 ) }, /* some broken avi use this */
+ { CODEC_ID_MPEG4, MKTAG('D', 'I', 'V', '1') },
+ { CODEC_ID_MPEG4, MKTAG('B', 'L', 'Z', '0') },
+ { CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 'v') },
+ { CODEC_ID_MPEG4, MKTAG('U', 'M', 'P', '4') },
+ { CODEC_ID_MPEG4, MKTAG('W', 'V', '1', 'F') },
+ { CODEC_ID_MPEG4, MKTAG('S', 'E', 'D', 'G') },
+ { CODEC_ID_MPEG4, MKTAG('R', 'M', 'P', '4') },
+ { CODEC_ID_MPEG4, MKTAG('3', 'I', 'V', '2') },
+ { CODEC_ID_MPEG4, MKTAG('F', 'F', 'D', 'S') },
+ { CODEC_ID_MPEG4, MKTAG('F', 'V', 'F', 'W') },
+ { CODEC_ID_MPEG4, MKTAG('D', 'C', 'O', 'D') },
+ { CODEC_ID_MPEG4, MKTAG('M', 'V', 'X', 'M') },
+ { CODEC_ID_MPEG4, MKTAG('P', 'M', '4', 'V') },
+ { CODEC_ID_MPEG4, MKTAG('S', 'M', 'P', '4') },
+ { CODEC_ID_MPEG4, MKTAG('D', 'X', 'G', 'M') },
+ { CODEC_ID_MPEG4, MKTAG('V', 'I', 'D', 'M') },
+ { CODEC_ID_MPEG4, MKTAG('M', '4', 'T', '3') },
+ { CODEC_ID_MPEG4, MKTAG('G', 'E', 'O', 'X') },
+ { CODEC_ID_MPEG4, MKTAG('H', 'D', 'X', '4') }, /* flipped video */
+ { CODEC_ID_MPEG4, MKTAG('D', 'M', 'K', '2') },
+ { CODEC_ID_MPEG4, MKTAG('D', 'I', 'G', 'I') },
+ { CODEC_ID_MPEG4, MKTAG('I', 'N', 'M', 'C') },
+ { CODEC_ID_MPEG4, MKTAG('E', 'P', 'H', 'V') }, /* Ephv MPEG-4 */
+ { CODEC_ID_MPEG4, MKTAG('E', 'M', '4', 'A') },
+ { CODEC_ID_MPEG4, MKTAG('M', '4', 'C', 'C') }, /* Divio MPEG-4 */
+ { CODEC_ID_MPEG4, MKTAG('S', 'N', '4', '0') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '3') }, /* default signature when using MSMPEG4 */
+ { CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', '4', '3') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', 'G', '3') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '5') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '6') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '4') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('D', 'V', 'X', '3') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('A', 'P', '4', '1') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('C', 'O', 'L', '1') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('C', 'O', 'L', '0') },
+ { CODEC_ID_MSMPEG4V2, MKTAG('M', 'P', '4', '2') },
+ { CODEC_ID_MSMPEG4V2, MKTAG('D', 'I', 'V', '2') },
+ { CODEC_ID_MSMPEG4V1, MKTAG('M', 'P', 'G', '4') },
+ { CODEC_ID_MSMPEG4V1, MKTAG('M', 'P', '4', '1') },
+ { CODEC_ID_WMV1, MKTAG('W', 'M', 'V', '1') },
+ { CODEC_ID_WMV2, MKTAG('W', 'M', 'V', '2') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 's', 'd') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', 'd') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', '1') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 's', 'l') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', '2', '5') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', '5', '0') },
+ { CODEC_ID_DVVIDEO, MKTAG('c', 'd', 'v', 'c') }, /* Canopus DV */
+ { CODEC_ID_DVVIDEO, MKTAG('C', 'D', 'V', 'H') }, /* Canopus DV */
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'c', ' ') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'c', 's') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', '1') },
+ { CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '1') },
+ { CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '2') },
+ { CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', 'g', '2') },
+ { CODEC_ID_MPEG2VIDEO, MKTAG('M', 'P', 'E', 'G') },
+ { CODEC_ID_MPEG1VIDEO, MKTAG('P', 'I', 'M', '1') },
+ { CODEC_ID_MPEG2VIDEO, MKTAG('P', 'I', 'M', '2') },
+ { CODEC_ID_MPEG1VIDEO, MKTAG('V', 'C', 'R', '2') },
+ { CODEC_ID_MPEG1VIDEO, MKTAG( 1 , 0 , 0 , 16) },
+ { CODEC_ID_MPEG2VIDEO, MKTAG( 2 , 0 , 0 , 16) },
+ { CODEC_ID_MPEG4, MKTAG( 4 , 0 , 0 , 16) },
+ { CODEC_ID_MPEG2VIDEO, MKTAG('D', 'V', 'R', ' ') },
+ { CODEC_ID_MPEG2VIDEO, MKTAG('M', 'M', 'E', 'S') },
+ { CODEC_ID_MPEG2VIDEO, MKTAG('L', 'M', 'P', '2') }, /* Lead MPEG2 in avi */
+ { CODEC_ID_MPEG2VIDEO, MKTAG('s', 'l', 'i', 'f') },
+ { CODEC_ID_MPEG2VIDEO, MKTAG('E', 'M', '2', 'V') },
+ { CODEC_ID_MJPEG, MKTAG('M', 'J', 'P', 'G') },
+ { CODEC_ID_MJPEG, MKTAG('L', 'J', 'P', 'G') },
+ { CODEC_ID_MJPEG, MKTAG('d', 'm', 'b', '1') },
+ { CODEC_ID_MJPEG, MKTAG('m', 'j', 'p', 'a') },
+ { CODEC_ID_LJPEG, MKTAG('L', 'J', 'P', 'G') },
+ { CODEC_ID_MJPEG, MKTAG('J', 'P', 'G', 'L') }, /* Pegasus lossless JPEG */
+ { CODEC_ID_JPEGLS, MKTAG('M', 'J', 'L', 'S') }, /* JPEG-LS custom FOURCC for avi - encoder */
+ { CODEC_ID_MJPEG, MKTAG('M', 'J', 'L', 'S') }, /* JPEG-LS custom FOURCC for avi - decoder */
+ { CODEC_ID_MJPEG, MKTAG('j', 'p', 'e', 'g') },
+ { CODEC_ID_MJPEG, MKTAG('I', 'J', 'P', 'G') },
+ { CODEC_ID_MJPEG, MKTAG('A', 'V', 'R', 'n') },
+ { CODEC_ID_MJPEG, MKTAG('A', 'C', 'D', 'V') },
+ { CODEC_ID_MJPEG, MKTAG('Q', 'I', 'V', 'G') },
+ { CODEC_ID_MJPEG, MKTAG('S', 'L', 'M', 'J') }, /* SL M-JPEG */
+ { CODEC_ID_MJPEG, MKTAG('C', 'J', 'P', 'G') }, /* Creative Webcam JPEG */
+ { CODEC_ID_MJPEG, MKTAG('I', 'J', 'L', 'V') }, /* Intel JPEG Library Video Codec */
+ { CODEC_ID_MJPEG, MKTAG('M', 'V', 'J', 'P') }, /* Midvid JPEG Video Codec */
+ { CODEC_ID_MJPEG, MKTAG('A', 'V', 'I', '1') },
+ { CODEC_ID_MJPEG, MKTAG('A', 'V', 'I', '2') },
+ { CODEC_ID_MJPEG, MKTAG('M', 'T', 'S', 'J') },
+ { CODEC_ID_MJPEG, MKTAG('Z', 'J', 'P', 'G') }, /* Paradigm Matrix M-JPEG Codec */
+ { CODEC_ID_HUFFYUV, MKTAG('H', 'F', 'Y', 'U') },
+ { CODEC_ID_FFVHUFF, MKTAG('F', 'F', 'V', 'H') },
+ { CODEC_ID_CYUV, MKTAG('C', 'Y', 'U', 'V') },
+ { CODEC_ID_RAWVIDEO, MKTAG( 0 , 0 , 0 , 0 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG( 3 , 0 , 0 , 0 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('I', '4', '2', '0') },
+ { CODEC_ID_RAWVIDEO, MKTAG('Y', 'U', 'Y', '2') },
+ { CODEC_ID_RAWVIDEO, MKTAG('Y', '4', '2', '2') },
+ { CODEC_ID_RAWVIDEO, MKTAG('V', '4', '2', '2') },
+ { CODEC_ID_RAWVIDEO, MKTAG('Y', 'U', 'N', 'V') },
+ { CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'N', 'V') },
+ { CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'N', 'Y') },
+ { CODEC_ID_RAWVIDEO, MKTAG('u', 'y', 'v', '1') },
+ { CODEC_ID_RAWVIDEO, MKTAG('2', 'V', 'u', '1') },
+ { CODEC_ID_RAWVIDEO, MKTAG('2', 'v', 'u', 'y') },
+ { CODEC_ID_RAWVIDEO, MKTAG('P', '4', '2', '2') },
+ { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', '1', '2') },
+ { CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'V', 'Y') },
+ { CODEC_ID_RAWVIDEO, MKTAG('V', 'Y', 'U', 'Y') },
+ { CODEC_ID_RAWVIDEO, MKTAG('I', 'Y', 'U', 'V') },
+ { CODEC_ID_RAWVIDEO, MKTAG('Y', '8', '0', '0') },
+ { CODEC_ID_RAWVIDEO, MKTAG('H', 'D', 'Y', 'C') },
+ { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', 'U', '9') },
+ { CODEC_ID_FRWU, MKTAG('F', 'R', 'W', 'U') },
+ { CODEC_ID_R210, MKTAG('r', '2', '1', '0') },
+ { CODEC_ID_V210, MKTAG('v', '2', '1', '0') },
+ { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') },
+ { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '2') },
+ { CODEC_ID_INDEO4, MKTAG('I', 'V', '4', '1') },
+ { CODEC_ID_INDEO5, MKTAG('I', 'V', '5', '0') },
+ { CODEC_ID_VP3, MKTAG('V', 'P', '3', '1') },
+ { CODEC_ID_VP3, MKTAG('V', 'P', '3', '0') },
+ { CODEC_ID_VP5, MKTAG('V', 'P', '5', '0') },
+ { CODEC_ID_VP6, MKTAG('V', 'P', '6', '0') },
+ { CODEC_ID_VP6, MKTAG('V', 'P', '6', '1') },
+ { CODEC_ID_VP6, MKTAG('V', 'P', '6', '2') },
+ { CODEC_ID_ASV1, MKTAG('A', 'S', 'V', '1') },
+ { CODEC_ID_ASV2, MKTAG('A', 'S', 'V', '2') },
+ { CODEC_ID_VCR1, MKTAG('V', 'C', 'R', '1') },
+ { CODEC_ID_FFV1, MKTAG('F', 'F', 'V', '1') },
+ { CODEC_ID_XAN_WC4, MKTAG('X', 'x', 'a', 'n') },
+ { CODEC_ID_MIMIC, MKTAG('L', 'M', '2', '0') },
+ { CODEC_ID_MSRLE, MKTAG('m', 'r', 'l', 'e') },
+ { CODEC_ID_MSRLE, MKTAG( 1 , 0 , 0 , 0 ) },
+ { CODEC_ID_MSRLE, MKTAG( 2 , 0 , 0 , 0 ) },
+ { CODEC_ID_MSVIDEO1, MKTAG('M', 'S', 'V', 'C') },
+ { CODEC_ID_MSVIDEO1, MKTAG('m', 's', 'v', 'c') },
+ { CODEC_ID_MSVIDEO1, MKTAG('C', 'R', 'A', 'M') },
+ { CODEC_ID_MSVIDEO1, MKTAG('c', 'r', 'a', 'm') },
+ { CODEC_ID_MSVIDEO1, MKTAG('W', 'H', 'A', 'M') },
+ { CODEC_ID_MSVIDEO1, MKTAG('w', 'h', 'a', 'm') },
+ { CODEC_ID_CINEPAK, MKTAG('c', 'v', 'i', 'd') },
+ { CODEC_ID_TRUEMOTION1, MKTAG('D', 'U', 'C', 'K') },
+ { CODEC_ID_TRUEMOTION1, MKTAG('P', 'V', 'E', 'Z') },
+ { CODEC_ID_MSZH, MKTAG('M', 'S', 'Z', 'H') },
+ { CODEC_ID_ZLIB, MKTAG('Z', 'L', 'I', 'B') },
+ { CODEC_ID_SNOW, MKTAG('S', 'N', 'O', 'W') },
+ { CODEC_ID_4XM, MKTAG('4', 'X', 'M', 'V') },
+ { CODEC_ID_FLV1, MKTAG('F', 'L', 'V', '1') },
+ { CODEC_ID_FLASHSV, MKTAG('F', 'S', 'V', '1') },
+ { CODEC_ID_VP6F, MKTAG('V', 'P', '6', 'F') },
+ { CODEC_ID_SVQ1, MKTAG('s', 'v', 'q', '1') },
+ { CODEC_ID_TSCC, MKTAG('t', 's', 'c', 'c') },
+ { CODEC_ID_ULTI, MKTAG('U', 'L', 'T', 'I') },
+ { CODEC_ID_VIXL, MKTAG('V', 'I', 'X', 'L') },
+ { CODEC_ID_QPEG, MKTAG('Q', 'P', 'E', 'G') },
+ { CODEC_ID_QPEG, MKTAG('Q', '1', '.', '0') },
+ { CODEC_ID_QPEG, MKTAG('Q', '1', '.', '1') },
+ { CODEC_ID_WMV3, MKTAG('W', 'M', 'V', '3') },
+ { CODEC_ID_VC1, MKTAG('W', 'V', 'C', '1') },
+ { CODEC_ID_VC1, MKTAG('W', 'M', 'V', 'A') },
+ { CODEC_ID_LOCO, MKTAG('L', 'O', 'C', 'O') },
+ { CODEC_ID_WNV1, MKTAG('W', 'N', 'V', '1') },
+ { CODEC_ID_AASC, MKTAG('A', 'A', 'S', 'C') },
+ { CODEC_ID_INDEO2, MKTAG('R', 'T', '2', '1') },
+ { CODEC_ID_FRAPS, MKTAG('F', 'P', 'S', '1') },
+ { CODEC_ID_THEORA, MKTAG('t', 'h', 'e', 'o') },
+ { CODEC_ID_TRUEMOTION2, MKTAG('T', 'M', '2', '0') },
+ { CODEC_ID_CSCD, MKTAG('C', 'S', 'C', 'D') },
+ { CODEC_ID_ZMBV, MKTAG('Z', 'M', 'B', 'V') },
+ { CODEC_ID_KMVC, MKTAG('K', 'M', 'V', 'C') },
+ { CODEC_ID_CAVS, MKTAG('C', 'A', 'V', 'S') },
+ { CODEC_ID_JPEG2000, MKTAG('M', 'J', '2', 'C') },
+ { CODEC_ID_VMNC, MKTAG('V', 'M', 'n', 'c') },
+ { CODEC_ID_TARGA, MKTAG('t', 'g', 'a', ' ') },
+ { CODEC_ID_PNG, MKTAG('M', 'P', 'N', 'G') },
+ { CODEC_ID_PNG, MKTAG('P', 'N', 'G', '1') },
+ { CODEC_ID_CLJR, MKTAG('c', 'l', 'j', 'r') },
+ { CODEC_ID_DIRAC, MKTAG('d', 'r', 'a', 'c') },
+ { CODEC_ID_RPZA, MKTAG('a', 'z', 'p', 'r') },
+ { CODEC_ID_RPZA, MKTAG('R', 'P', 'Z', 'A') },
+ { CODEC_ID_RPZA, MKTAG('r', 'p', 'z', 'a') },
+ { CODEC_ID_SP5X, MKTAG('S', 'P', '5', '4') },
+ { CODEC_ID_AURA, MKTAG('A', 'U', 'R', 'A') },
+ { CODEC_ID_AURA2, MKTAG('A', 'U', 'R', '2') },
+ { CODEC_ID_DPX, MKTAG('d', 'p', 'x', ' ') },
+ { CODEC_ID_NONE, 0 }
+};
+
+const struct mp_AVCodecTag mp_ff_codec_wav_tags[] = {
+ { CODEC_ID_PCM_S16LE, 0x0001 },
+ { CODEC_ID_PCM_U8, 0x0001 }, /* must come after s16le in this list */
+ { CODEC_ID_PCM_S24LE, 0x0001 },
+ { CODEC_ID_PCM_S32LE, 0x0001 },
+ { CODEC_ID_ADPCM_MS, 0x0002 },
+ { CODEC_ID_PCM_F32LE, 0x0003 },
+ { CODEC_ID_PCM_F64LE, 0x0003 }, /* must come after f32le in this list */
+ { CODEC_ID_PCM_ALAW, 0x0006 },
+ { CODEC_ID_PCM_MULAW, 0x0007 },
+ { CODEC_ID_WMAVOICE, 0x000A },
+ { CODEC_ID_ADPCM_IMA_WAV, 0x0011 },
+ { CODEC_ID_PCM_ZORK, 0x0011 }, /* must come after adpcm_ima_wav in this list */
+ { CODEC_ID_ADPCM_YAMAHA, 0x0020 },
+ { CODEC_ID_TRUESPEECH, 0x0022 },
+ { CODEC_ID_GSM_MS, 0x0031 },
+ { CODEC_ID_ADPCM_G726, 0x0045 },
+ { CODEC_ID_MP2, 0x0050 },
+ { CODEC_ID_MP3, 0x0055 },
+ { CODEC_ID_AMR_NB, 0x0057 },
+ { CODEC_ID_AMR_WB, 0x0058 },
+ { CODEC_ID_ADPCM_IMA_DK4, 0x0061 }, /* rogue format number */
+ { CODEC_ID_ADPCM_IMA_DK3, 0x0062 }, /* rogue format number */
+ { CODEC_ID_ADPCM_IMA_WAV, 0x0069 },
+ { CODEC_ID_VOXWARE, 0x0075 },
+ { CODEC_ID_AAC, 0x00ff },
+ { CODEC_ID_SIPR, 0x0130 },
+ { CODEC_ID_WMAV1, 0x0160 },
+ { CODEC_ID_WMAV2, 0x0161 },
+ { CODEC_ID_WMAPRO, 0x0162 },
+ { CODEC_ID_WMALOSSLESS, 0x0163 },
+ { CODEC_ID_ADPCM_CT, 0x0200 },
+ { CODEC_ID_ATRAC3, 0x0270 },
+ { CODEC_ID_IMC, 0x0401 },
+ { CODEC_ID_AC3, 0x2000 },
+ { CODEC_ID_DTS, 0x2001 },
+ { CODEC_ID_SONIC, 0x2048 },
+ { CODEC_ID_SONIC_LS, 0x2048 },
+ { CODEC_ID_PCM_MULAW, 0x6c75 },
+ { CODEC_ID_AAC, 0x706d },
+ { CODEC_ID_AAC, 0x4143 },
+ { CODEC_ID_FLAC, 0xF1AC },
+ { CODEC_ID_ADPCM_SWF, ('S'<<8)+'F' },
+ { CODEC_ID_VORBIS, ('V'<<8)+'o' }, //HACK/FIXME, does vorbis in WAV/AVI have an (in)official id?
+
+ /* FIXME: All of the IDs below are not 16 bit and thus illegal. */
+ // for NuppelVideo (nuv.c)
+ { CODEC_ID_PCM_S16LE, MKTAG('R', 'A', 'W', 'A') },
+ { CODEC_ID_MP3, MKTAG('L', 'A', 'M', 'E') },
+ { CODEC_ID_MP3, MKTAG('M', 'P', '3', ' ') },
+ { CODEC_ID_NONE, 0 },
+};
+
+static unsigned int ff_codec_get_tag(const struct mp_AVCodecTag *tags, int id)
+{
+ while (tags->id != CODEC_ID_NONE) {
+ if (tags->id == id)
+ return tags->tag;
+ tags++;
+ }
+ return 0;
+}
+
+static enum CodecID ff_codec_get_id(const struct mp_AVCodecTag *tags, unsigned int tag)
+{
+ int i;
+ for(i=0; tags[i].id != CODEC_ID_NONE;i++) {
+ if(tag == tags[i].tag)
+ return tags[i].id;
+ }
+ for(i=0; tags[i].id != CODEC_ID_NONE; i++) {
+ if( toupper((tag >> 0)&0xFF) == toupper((tags[i].tag >> 0)&0xFF)
+ && toupper((tag >> 8)&0xFF) == toupper((tags[i].tag >> 8)&0xFF)
+ && toupper((tag >>16)&0xFF) == toupper((tags[i].tag >>16)&0xFF)
+ && toupper((tag >>24)&0xFF) == toupper((tags[i].tag >>24)&0xFF))
+ return tags[i].id;
+ }
+ return CODEC_ID_NONE;
+}
+
+unsigned int mp_av_codec_get_tag(const struct mp_AVCodecTag * const *tags, enum CodecID id)
+{
+ int i;
+ for(i=0; tags && tags[i]; i++){
+ int tag= ff_codec_get_tag(tags[i], id);
+ if(tag) return tag;
+ }
+ return 0;
+}
+
+enum CodecID mp_av_codec_get_id(const struct mp_AVCodecTag * const *tags, unsigned int tag)
+{
+ int i;
+ for(i=0; tags && tags[i]; i++){
+ enum CodecID id= ff_codec_get_id(tags[i], tag);
+ if(id!=CODEC_ID_NONE) return id;
+ }
+ return CODEC_ID_NONE;
+}
diff --git a/ffmpeg_files/taglists.h b/ffmpeg_files/taglists.h
new file mode 100644
index 0000000000..4c8f9bfdbd
--- /dev/null
+++ b/ffmpeg_files/taglists.h
@@ -0,0 +1,9 @@
+#include "libavcodec/avcodec.h"
+
+struct mp_AVCodecTag {
+ int id;
+ unsigned int tag;
+};
+
+unsigned int mp_av_codec_get_tag(const struct mp_AVCodecTag * const *tags, enum CodecID id);
+enum CodecID mp_av_codec_get_id(const struct mp_AVCodecTag * const *tags, unsigned int tag);
diff --git a/ffmpeg_files/x86/bswap.h b/ffmpeg_files/x86/bswap.h
new file mode 100644
index 0000000000..62238d178a
--- /dev/null
+++ b/ffmpeg_files/x86/bswap.h
@@ -0,0 +1,61 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavutil/x86/bswap.h
+ * byte swapping routines
+ */
+
+#ifndef MP_AVUTIL_X86_BSWAP_H
+#define MP_AVUTIL_X86_BSWAP_H
+
+#include <stdint.h>
+#include "config.h"
+#include "libavutil/common.h"
+
+#define bswap_16 bswap_16
+static av_always_inline av_const uint16_t bswap_16(uint16_t x)
+{
+ __asm__("rorw $8, %0" : "+r"(x));
+ return x;
+}
+
+#define bswap_32 bswap_32
+static av_always_inline av_const uint32_t bswap_32(uint32_t x)
+{
+#if HAVE_BSWAP
+ __asm__("bswap %0" : "+r" (x));
+#else
+ __asm__("rorw $8, %w0 \n\t"
+ "rorl $16, %0 \n\t"
+ "rorw $8, %w0"
+ : "+r"(x));
+#endif
+ return x;
+}
+
+#if ARCH_X86_64
+#define bswap_64 bswap_64
+static inline uint64_t av_const bswap_64(uint64_t x)
+{
+ __asm__("bswap %0": "=r" (x) : "0" (x));
+ return x;
+}
+#endif
+
+#endif /* AVUTIL_X86_BSWAP_H */
diff --git a/ffmpeg_files/x86_cpu.h b/ffmpeg_files/x86_cpu.h
new file mode 100644
index 0000000000..49a5b28a35
--- /dev/null
+++ b/ffmpeg_files/x86_cpu.h
@@ -0,0 +1,76 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef MP_AVUTIL_X86_CPU_H
+#define MP_AVUTIL_X86_CPU_H
+
+#include <stdint.h>
+#include "config.h"
+
+#if ARCH_X86_64
+# define REG_a "rax"
+# define REG_b "rbx"
+# define REG_c "rcx"
+# define REG_d "rdx"
+# define REG_D "rdi"
+# define REG_S "rsi"
+# define PTR_SIZE "8"
+typedef int64_t x86_reg;
+
+# define REG_SP "rsp"
+# define REG_BP "rbp"
+# define REGBP rbp
+# define REGa rax
+# define REGb rbx
+# define REGc rcx
+# define REGd rdx
+# define REGSP rsp
+
+#elif ARCH_X86_32
+
+# define REG_a "eax"
+# define REG_b "ebx"
+# define REG_c "ecx"
+# define REG_d "edx"
+# define REG_D "edi"
+# define REG_S "esi"
+# define PTR_SIZE "4"
+typedef int32_t x86_reg;
+
+# define REG_SP "esp"
+# define REG_BP "ebp"
+# define REGBP ebp
+# define REGa eax
+# define REGb ebx
+# define REGc ecx
+# define REGd edx
+# define REGSP esp
+#else
+typedef int x86_reg;
+#endif
+
+#define HAVE_7REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE && HAVE_EBP_AVAILABLE))
+#define HAVE_6REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE || HAVE_EBP_AVAILABLE))
+
+#if ARCH_X86_64 && defined(PIC)
+# define BROKEN_RELOCATIONS 1
+#endif
+
+#endif /* AVUTIL_X86_CPU_H */
diff --git a/find_sub.c b/find_sub.c
index dcd045eb60..7b7e0493ce 100644
--- a/find_sub.c
+++ b/find_sub.c
@@ -69,7 +69,7 @@ void step_sub(sub_data *subd, float pts, int movement) {
sub_delay = subs[current_sub].start / (subd->sub_uses_time ? 100 : sub_fps) - pts;
}
-void find_sub(sub_data* subd,int key){
+void find_sub(struct MPContext *mpctx, sub_data* subd,int key){
subtitle *subs;
subtitle *new_sub = NULL;
int i,j;
@@ -174,5 +174,5 @@ void find_sub(sub_data* subd,int key){
new_sub=NULL; // no sub here
update:
- set_osd_subtitle(new_sub);
+ set_osd_subtitle(mpctx, new_sub);
}
diff --git a/gui/app.c b/gui/app.c
deleted file mode 100644
index a389013c98..0000000000
--- a/gui/app.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "config.h"
-#include "mp_msg.h"
-#include "help_mp.h"
-
-#include "app.h"
-#include "wm/wskeys.h"
-#include "skin/skin.h"
-#include "mplayer/gmplayer.h"
-#include "interface.h"
-
-static const evName evNames[] =
- {
- { evNone, "evNone" },
- { evPlay, "evPlay" },
- { evStop, "evStop" },
- { evPause, "evPause" },
- { evPrev, "evPrev" },
- { evNext, "evNext" },
- { evLoad, "evLoad" },
- { evEqualizer, "evEqualizer" },
- { evEqualizer, "evEqualeaser" },
- { evPlayList, "evPlaylist" },
- { evExit, "evExit" },
- { evIconify, "evIconify" },
- { evIncBalance, "evIncBalance" },
- { evDecBalance, "evDecBalance" },
- { evFullScreen, "evFullScreen" },
- { evFName, "evFName" },
- { evMovieTime, "evMovieTime" },
- { evAbout, "evAbout" },
- { evLoadPlay, "evLoadPlay" },
- { evPreferences, "evPreferences" },
- { evSkinBrowser, "evSkinBrowser" },
- { evBackward10sec, "evBackward10sec" },
- { evForward10sec, "evForward10sec" },
- { evBackward1min, "evBackward1min" },
- { evForward1min, "evForward1min" },
- { evBackward10min, "evBackward10min" },
- { evForward10min, "evForward10min" },
- { evIncVolume, "evIncVolume" },
- { evDecVolume, "evDecVolume" },
- { evMute, "evMute" },
- { evIncAudioBufDelay, "evIncAudioBufDelay" },
- { evDecAudioBufDelay, "evDecAudioBufDelay" },
- { evPlaySwitchToPause, "evPlaySwitchToPause" },
- { evPauseSwitchToPlay, "evPauseSwitchToPlay" },
- { evNormalSize, "evHalfSize" },
- { evNormalSize, "evNormalSize" },
- { evDoubleSize, "evDoubleSize" },
- { evSetMoviePosition, "evSetMoviePosition" },
- { evSetVolume, "evSetVolume" },
- { evSetBalance, "evSetBalance" },
- { evHelp, "evHelp" },
- { evLoadSubtitle, "evLoadSubtitle" },
- { evPlayDVD, "evPlayDVD" },
- { evPlayVCD, "evPlayVCD" },
- { evSetURL, "evSetURL" },
- { evLoadAudioFile, "evLoadAudioFile" },
- { evDropSubtitle, "evDropSubtitle" },
- { evSetAspect, "evSetAspect" }
- };
-
-static const int evBoxs = sizeof( evNames ) / sizeof( evName );
-
-// ---
-
-listItems appMPlayer;
-
-/* FIXME: Eventually remove the obsolete directory names. */
-char * skinDirInHome=NULL;
-char * skinDirInHome_obsolete=NULL;
-char * skinMPlayerDir=NULL;
-char * skinMPlayerDir_obsolete=NULL;
-char * skinName = NULL;
-
-void appClearItem( wItem * item )
-{
- item->type=0;
-// ---
- item->x=0; item->y=0; item->width=0; item->height=0;
-// ---
- item->px=0; item->py=0; item->psx=0; item->psy=0;
-// ---
- item->msg=0; item->msg2=0;
- item->pressed=btnReleased;
- item->tmp=0;
- item->key=0; item->key2=0;
- item->Bitmap.Width=0; item->Bitmap.Height=0; item->Bitmap.BPP=0; item->Bitmap.ImageSize=0;
- if ( item->Bitmap.Image ) free( item->Bitmap.Image );
- item->Bitmap.Image=NULL;
-// ---
- item->fontid=0;
- if ( item->label ) free( item->label ); item->label=NULL;
- item->event=0;
-}
-
-void appCopy( listItems * dest,listItems * source )
-{
- dest->NumberOfItems=source->NumberOfItems;
- memcpy( &dest->Items,&source->Items,128 * sizeof( wItem ) );
-
- dest->NumberOfMenuItems=source->NumberOfMenuItems;
- memcpy( &dest->MenuItems,&source->MenuItems,32 * sizeof( wItem ) );
-
- memcpy( &dest->main,&source->main,sizeof( wItem ) );
- memcpy( &dest->sub,&source->sub,sizeof( wItem ) );
- memcpy( &dest->menuBase,&source->menuBase,sizeof( wItem ) );
- memcpy( &dest->menuSelected,&source->menuSelected,sizeof( wItem ) );
-}
-
-void appInitStruct( listItems * item )
-{
- int i;
- for ( i=0;i<item->NumberOfItems;i++ )
- appClearItem( &item->Items[i] );
- for ( i=0;i<item->NumberOfMenuItems;i++ )
- appClearItem( &item->MenuItems[i] );
- for ( i=0;i<item->NumberOfBarItems;i++ )
- appClearItem( &item->barItems[i] );
-
- item->NumberOfItems=-1;
- memset( item->Items,0,256 * sizeof( wItem ) );
- item->NumberOfMenuItems=-1;
- memset( item->MenuItems,0,64 * sizeof( wItem ) );
- item->NumberOfBarItems=-1;
- memset( item->barItems,0,256 * sizeof( wItem ) );
-
- appClearItem( &item->main );
- item->mainDecoration=0;
- appClearItem( &item->sub );
- item->sub.width=0; item->sub.height=0;
- item->sub.x=-1; item->sub.y=-1;
- appClearItem( &item->menuBase );
- appClearItem( &item->menuSelected );
- item->sub.R=item->sub.G=item->sub.B=0;
- item->bar.R=item->bar.G=item->bar.B=0;
- item->main.R=item->main.G=item->main.B=0;
- item->barIsPresent=0;
- item->menuIsPresent=0;
-}
-
-int appFindKey( unsigned char * name )
-{
- int i;
- for ( i=0;i<wsKeyNumber;i++ )
- if ( !strcmp( wsKeyNames[i].name,name ) ) return wsKeyNames[i].code;
- return -1;
-}
-
-int appFindMessage( unsigned char * str )
-{
- int i;
- for ( i=0;i<evBoxs;i++ )
- if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg;
- return -1;
-}
-
-void btnModify( int event,float state )
-{
- int j;
- for ( j=0;j < appMPlayer.NumberOfItems + 1;j++ )
- if ( appMPlayer.Items[j].msg == event )
- {
- switch ( appMPlayer.Items[j].type )
- {
- case itButton:
- appMPlayer.Items[j].pressed=(int)state;
- appMPlayer.Items[j].tmp=(int)state;
- break;
- case itPotmeter:
- case itVPotmeter:
- case itHPotmeter:
- if ( state < 0.0f ) state=0.0f;
- if ( state > 100.f ) state=100.0f;
- appMPlayer.Items[j].value=state;
- break;
- }
- }
-
- for ( j=0;j < appMPlayer.NumberOfBarItems + 1;j++ )
- if ( appMPlayer.barItems[j].msg == event )
- {
- switch ( appMPlayer.barItems[j].type )
- {
- case itButton:
- appMPlayer.barItems[j].pressed=(int)state;
- appMPlayer.barItems[j].tmp=(int)state;
- break;
- case itPotmeter:
- case itVPotmeter:
- case itHPotmeter:
- if ( state < 0.0f ) state=0.0f;
- if ( state > 100.f ) state=100.0f;
- appMPlayer.barItems[j].value=state;
- break;
- }
- }
-}
-
-float btnGetValue( int event )
-{
- int j;
- for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
- if ( appMPlayer.Items[j].msg == event ) return appMPlayer.Items[j].value;
- return 0;
-}
-
-void btnSet( int event,int set )
-{
- int j;
- for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
- if ( appMPlayer.Items[j].msg == event )
- { appMPlayer.Items[j].pressed=set; appMPlayer.barItems[j].tmp=0; }
- for ( j=0;j<appMPlayer.NumberOfBarItems + 1;j++ )
- if ( appMPlayer.barItems[j].msg == event )
- { appMPlayer.barItems[j].pressed=set; appMPlayer.barItems[j].tmp=0; }
-}
diff --git a/gui/app.h b/gui/app.h
deleted file mode 100644
index fd924ffcbc..0000000000
--- a/gui/app.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef MPLAYER_GUI_APP_H
-#define MPLAYER_GUI_APP_H
-
-#include "bitmap.h"
-#include "wm/ws.h"
-#include "wm/wskeys.h"
-
-// --- User events ------
-
-#define evNone 0
-#define evPlay 1
-#define evStop 2
-#define evPause 3
-#define evPrev 6
-#define evNext 7
-#define evLoad 8
-#define evEqualizer 9
-#define evPlayList 10
-#define evIconify 11
-#define evAbout 12
-#define evLoadPlay 13
-#define evPreferences 14
-#define evSkinBrowser 15
-#define evPlaySwitchToPause 16
-#define evPauseSwitchToPlay 17
-
-#define evBackward10sec 18
-#define evForward10sec 19
-#define evBackward1min 20
-#define evForward1min 21
-#define evBackward10min 22
-#define evForward10min 23
-
-#define evHalfSize 301
-#define evNormalSize 24
-#define evDoubleSize 25
-#define evFullScreen 26
-
-#define evSetMoviePosition 27
-#define evSetVolume 28
-#define evSetBalance 29
-#define evMute 30
-
-#define evIncVolume 31
-#define evDecVolume 32
-#define evIncAudioBufDelay 33
-#define evDecAudioBufDelay 34
-#define evIncBalance 35
-#define evDecBalance 36
-
-#define evHelp 37
-
-#define evLoadSubtitle 38
-#define evDropSubtitle 43
-#define evPlayDVD 39
-#define evPlayVCD 40
-#define evPlayNetwork 41
-#define evLoadAudioFile 42
-#define evSetAspect 44
-#define evSetAudio 45
-#define evSetVideo 46
-#define evSetSubtitle 47
-// 48 ...
-
-#define evExit 1000
-
-// --- General events ---
-
-#define evFileLoaded 5000
-#define evHideMouseCursor 5001
-#define evMessageBox 5002
-#define evGeneralTimer 5003
-#define evGtkIsOk 5004
-#define evShowPopUpMenu 5005
-#define evHidePopUpMenu 5006
-#define evSetDVDAudio 5007
-#define evSetDVDSubtitle 5008
-#define evSetDVDTitle 5009
-#define evSetDVDChapter 5010
-#define evSubtitleLoaded 5011
-#define evSetVCDTrack 5012
-#define evSetURL 5013
-
-#define evFName 7000
-#define evMovieTime 7001
-#define evRedraw 7002
-#define evHideWindow 7003
-#define evShowWindow 7004
-#define evFirstLoad 7005
-
-// ----------------------
-
-typedef struct
-{
- int msg;
- const char * name;
-} evName;
-
-#define itNULL 0
-#define itButton 101 // button
-#define itHPotmeter 102 // horizontal potmeter
-#define itVPotmeter 103 // vertical potmeter
-#define itSLabel 104 // static label
-#define itDLabel 105 // dynamic label
-#define itBase 106
-#define itPotmeter 107
-#define itFont 108
-// ---
-#define btnPressed 0
-#define btnReleased 1
-#define btnDisabled 2
-// ---
-typedef struct
-{
- int type;
-// ---
- int x,y;
- int width,height;
-// ---
- int px,py,psx,psy;
-// ---
- int msg,msg2;
- int pressed,tmp;
- int key,key2;
- int phases;
- float value;
- txSample Bitmap;
- txSample Mask;
-// ---
- int fontid;
- int align;
- char * label;
-// ---
- int event;
-// ---
- int R,G,B;
-} wItem;
-
-typedef struct
-{
- wItem main;
- wsTWindow mainWindow;
- int mainDecoration;
-
- wItem sub;
- wsTWindow subWindow;
-
- wItem bar;
- wsTWindow barWindow;
- int barIsPresent;
-
- wItem menuBase;
- wItem menuSelected;
- wsTWindow menuWindow;
- int menuIsPresent;
-
-// ---
- int NumberOfItems;
- wItem Items[256];
-// ---
- int NumberOfMenuItems;
- wItem MenuItems[64];
-// ---
- int NumberOfBarItems;
- wItem barItems[256];
-} listItems;
-
-extern listItems appMPlayer;
-
-extern char * skinDirInHome;
-extern char * skinDirInHome_obsolete;
-extern char * skinMPlayerDir;
-extern char * skinMPlayerDir_obsolete;
-extern char * skinName;
-
-void appInitStruct( listItems * item );
-void appClearItem( wItem * item );
-void appCopy( listItems * item1, listItems * item2 );
-int appFindMessage( unsigned char * str );
-int appFindKey( unsigned char * name );
-
-void btnModify( int event, float state );
-float btnGetValue( int event );
-void btnSet( int event, int set );
-
-#endif /* MPLAYER_GUI_APP_H */
diff --git a/gui/bitmap.c b/gui/bitmap.c
deleted file mode 100644
index b61c3c90cf..0000000000
--- a/gui/bitmap.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "mp_msg.h"
-#include "help_mp.h"
-#include "bitmap.h"
-#include "libavcodec/avcodec.h"
-#include "libavutil/intreadwrite.h"
-#include "libvo/fastmemcpy.h"
-
-static int pngRead( unsigned char * fname,txSample * bf )
-{
- int decode_ok;
- void *data;
- int len;
- AVCodecContext *avctx;
- AVFrame *frame;
-
- FILE *fp=fopen( fname,"rb" );
- if ( !fp )
- {
- mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] file read error ( %s )\n",fname );
- return 1;
- }
-
- fseek(fp, 0, SEEK_END);
- len = ftell(fp);
- if (len > 50 * 1024 * 1024) return 2;
- data = av_malloc(len + FF_INPUT_BUFFER_PADDING_SIZE);
- fseek(fp, 0, SEEK_SET);
- fread(data, len, 1, fp);
- fclose(fp);
- avctx = avcodec_alloc_context();
- frame = avcodec_alloc_frame();
- avcodec_register_all();
- avcodec_open(avctx, avcodec_find_decoder(CODEC_ID_PNG));
- avcodec_decode_video(avctx, frame, &decode_ok, data, len);
- memset(bf, 0, sizeof(*bf));
- switch (avctx->pix_fmt) {
- case PIX_FMT_GRAY8: bf->BPP = 8; break;
- case PIX_FMT_GRAY16BE: bf->BPP = 16; break;
- case PIX_FMT_RGB24: bf->BPP = 24; break;
- case PIX_FMT_BGRA:
- case PIX_FMT_ARGB: bf->BPP = 32; break;
- default: bf->BPP = 0; break;
- }
- if (decode_ok && bf->BPP) {
- int bpl;
- bf->Width = avctx->width; bf->Height = avctx->height;
- bpl = bf->Width * (bf->BPP / 8);
- bf->ImageSize = bpl * bf->Height;
- bf->Image = malloc(bf->ImageSize);
- memcpy_pic(bf->Image, frame->data[0], bpl, bf->Height, bpl, frame->linesize[0]);
- }
- avcodec_close(avctx);
- av_freep(&frame);
- av_freep(&avctx);
- av_freep(&data);
-
- mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] filename: %s.\n",fname );
- mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP );
- mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] imagesize: %lu\n",bf->ImageSize );
- return !(decode_ok && bf->BPP);
-}
-
-static int conv24to32( txSample * bf )
-{
- unsigned char * tmpImage;
- int i,c;
-
- if ( bf->BPP == 24 )
- {
- tmpImage=bf->Image;
- bf->ImageSize=bf->Width * bf->Height * 4;
- bf->BPP=32;
- if ( ( bf->Image=calloc( 1, bf->ImageSize ) ) == NULL )
- {
- free( tmpImage );
- mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] not enough memory for image\n" );
- return 1;
- }
- for ( c=0,i=0; c < bf->ImageSize; c += 4, i += 3)
- {
- *(uint32_t *)&bf->Image[c] = AV_RB24(&tmpImage[i]);
- }
- free( tmpImage );
- }
- return 0;
-}
-
-static void Normalize( txSample * bf )
-{
- int i;
-#if !HAVE_BIGENDIAN
- for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0;
-#else
- for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i]=0;
-#endif
-}
-
-static unsigned char tmp[512];
-
-static unsigned char * fExist( unsigned char * fname )
-{
- FILE * fl;
- unsigned char ext[][6] = { ".png\0",".PNG\0" };
- int i;
-
- fl=fopen( fname,"rb" );
- if ( fl != NULL )
- {
- fclose( fl );
- return fname;
- }
- for ( i=0;i<2;i++ )
- {
- snprintf( tmp,511,"%s%s",fname,ext[i] );
- fl=fopen( tmp,"rb" );
- if ( fl != NULL )
- {
- fclose( fl );
- return tmp;
- }
- }
- return NULL;
-}
-
-int bpRead( char * fname, txSample * bf )
-{
- fname=fExist( fname );
- if ( fname == NULL ) return -2;
- if ( pngRead( fname,bf ) )
- {
- mp_dbg( MSGT_GPLAYER,MSGL_FATAL,"[bitmap] unknown file type ( %s )\n",fname );
- return -5;
- }
- if ( bf->BPP < 24 )
- {
- mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Sorry, only 24 and 32 bpp bitmaps are supported.\n" );
- return -1;
- }
- if ( conv24to32( bf ) ) return -8;
- Normalize( bf );
- return 0;
-}
-
-void Convert32to1( txSample * in,txSample * out,int adaptivlimit )
-{
- out->Width=in->Width;
- out->Height=in->Height;
- out->BPP=1;
- out->ImageSize=(out->Width * out->Height + 7) / 8;
- mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize );
- out->Image=calloc( 1,out->ImageSize );
- if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotEnoughMemoryC32To1 );
- {
- int i,b,c=0; unsigned int * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1;
- buf=(unsigned int *)in->Image;
- for ( b=0,i=0;i < (int)(out->Width * out->Height);i++ )
- {
- if ( (int)buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128;
- else { tmp=tmp >> 1; buf[i]=nothaveshape=0; }
- if ( b++ == 7 ) { out->Image[c++]=tmp; tmp=b=0; }
- }
- if ( b ) out->Image[c]=tmp;
- if ( nothaveshape ) { free( out->Image ); out->Image=NULL; }
- }
-}
diff --git a/gui/bitmap.h b/gui/bitmap.h
deleted file mode 100644
index 67e7fabb43..0000000000
--- a/gui/bitmap.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef MPLAYER_GUI_BITMAP_H
-#define MPLAYER_GUI_BITMAP_H
-
-typedef struct txSample
-{
- unsigned long Width;
- unsigned long Height;
- unsigned int BPP;
- unsigned long ImageSize;
- char * Image;
-} txSample;
-
-int bpRead( char * fname, txSample * bf );
-void Convert32to1( txSample * in,txSample * out,int adaptivlimit );
-
-#endif /* MPLAYER_GUI_BITMAP_H */
diff --git a/gui/cfg.c b/gui/cfg.c
deleted file mode 100644
index 3d54f7aad7..0000000000
--- a/gui/cfg.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "config.h"
-#include "mp_msg.h"
-#include "help_mp.h"
-#include "mixer.h"
-#include "mplayer.h"
-#include "m_config.h"
-#include "m_option.h"
-#include "get_path.h"
-#include "libvo/sub.h"
-#include "libvo/video_out.h"
-#include "stream/stream.h"
-#include "libmpdemux/demuxer.h"
-#include "libass/ass_mp.h"
-
-#include "cfg.h"
-#include "app.h"
-#include "interface.h"
-#include "mplayer/play.h"
-
-// --- params
-
-int gtkEnableAudioEqualizer = 0;
-
-int gtkVfPP = 0;
-#ifdef CONFIG_LIBAVCODEC
- int gtkVfLAVC = 0;
-#endif
-
-int gtkAONorm = 0;
-int gtkAOSurround = 0;
-int gtkAOExtraStereo = 0;
-float gtkAOExtraStereoMul = 1.0;
-#ifdef CONFIG_OSS_AUDIO
-char * gtkAOOSSMixer;
-char * gtkAOOSSMixerChannel;
-char * gtkAOOSSDevice;
-#endif
-#ifdef CONFIG_ALSA
-char * gtkAOALSAMixer;
-char * gtkAOALSAMixerChannel;
-char * gtkAOALSADevice;
-#endif
-#ifdef CONFIG_SDL
-char * gtkAOSDLDriver;
-#endif
-#ifdef CONFIG_ESD
-char * gtkAOESDDevice;
-#endif
-
-int gtkCacheOn = 0;
-int gtkCacheSize = 2048;
-
-int gtkAutoSyncOn = 0;
-int gtkAutoSync = 0;
-
-#ifdef CONFIG_DXR3
- char * gtkDXR3Device;
-#endif
-
-int gtkSubDumpMPSub = 0;
-int gtkSubDumpSrt = 0;
-
-int gtkLoadFullscreen = 0;
-int gtkShowVideoWindow = 1;
-int gtkEnablePlayBar = 1;
-
-int gui_save_pos = 1;
-int gui_main_pos_x = -2;
-int gui_main_pos_y = -2;
-int gui_sub_pos_x = -1;
-int gui_sub_pos_y = -1;
-
-#ifdef CONFIG_ASS
-gtkASS_t gtkASS;
-#endif
-// ---
-
-extern int stop_xscreensaver;
-extern int disable_gui_conf;
-int m_config_parse_config_file(m_config_t* config, char *conffile);
-
-static m_config_t * gui_conf;
-static const m_option_t gui_opts[] =
-{
- { "enable_audio_equ",&gtkEnableAudioEqualizer,CONF_TYPE_FLAG,0,0,1,NULL },
-
- { "vo_driver",&video_driver_list,CONF_TYPE_STRING_LIST,0,0,0,NULL },
- { "vo_panscan",&vo_panscan,CONF_TYPE_FLOAT,CONF_RANGE,0.0,1.0,NULL },
- { "vo_doublebuffering",&vo_doublebuffering,CONF_TYPE_FLAG,0,0,1,NULL },
- { "vo_direct_render",&vo_directrendering,CONF_TYPE_FLAG,0,0,1,NULL },
-#ifdef CONFIG_DXR3
- { "vo_dxr3_device",&gtkDXR3Device,CONF_TYPE_STRING,0,0,0,NULL },
-#endif
-
- { "v_framedrop",&frame_dropping,CONF_TYPE_INT,CONF_RANGE,0,2,NULL },
- { "v_flip",&flip,CONF_TYPE_INT,CONF_RANGE,-1,1,NULL },
- { "v_ni",&force_ni,CONF_TYPE_FLAG,0,0,1,NULL },
- { "v_idx",&index_mode,CONF_TYPE_INT,CONF_RANGE,-1,2,NULL },
- { "v_vfm",&video_fm_list,CONF_TYPE_STRING_LIST,0,0,0,NULL },
- { "a_afm",&audio_fm_list,CONF_TYPE_STRING_LIST,0,0,0,NULL },
-
- { "vf_pp",&gtkVfPP,CONF_TYPE_FLAG,0,0,1,NULL },
- { "vf_autoq",&auto_quality,CONF_TYPE_INT,CONF_RANGE,0,100,NULL },
-#ifdef CONFIG_LIBAVCODEC
- { "vf_lavc",&gtkVfLAVC,CONF_TYPE_FLAG,0,0,1,NULL },
-#endif
-
- { "ao_driver",&audio_driver_list,CONF_TYPE_STRING_LIST,0,0,0,NULL },
- { "ao_volnorm",&gtkAONorm,CONF_TYPE_FLAG,0,0,1,NULL },
- { "softvol",&soft_vol,CONF_TYPE_FLAG,0,0,1,NULL },
- { "ao_surround",&gtkAOSurround,CONF_TYPE_FLAG,0,0,1,NULL },
- { "ao_extra_stereo",&gtkAOExtraStereo,CONF_TYPE_FLAG,0,0,1,NULL },
- { "ao_extra_stereo_coefficient",&gtkAOExtraStereoMul,CONF_TYPE_FLOAT,CONF_RANGE,-10,10,NULL },
-#ifdef CONFIG_OSS_AUDIO
- { "ao_oss_mixer",&gtkAOOSSMixer,CONF_TYPE_STRING,0,0,0,NULL },
- { "ao_oss_mixer_channel",&gtkAOOSSMixerChannel,CONF_TYPE_STRING,0,0,0,NULL },
- { "ao_oss_device",&gtkAOOSSDevice,CONF_TYPE_STRING,0,0,0,NULL },
-#endif
-#ifdef CONFIG_ALSA
- { "ao_alsa_mixer",&gtkAOALSAMixer,CONF_TYPE_STRING,0,0,0,NULL },
- { "ao_alsa_mixer_channel",&gtkAOALSAMixerChannel,CONF_TYPE_STRING,0,0,0,NULL },
- { "ao_alsa_device",&gtkAOALSADevice,CONF_TYPE_STRING,0,0,0,NULL },
-#endif
-#ifdef CONFIG_SDL
- { "ao_sdl_subdriver",&gtkAOSDLDriver,CONF_TYPE_STRING,0,0,0,NULL },
-#endif
-#ifdef CONFIG_ESD
- { "ao_esd_device",&gtkAOESDDevice,CONF_TYPE_STRING,0,0,0,NULL },
-#endif
-
- { "dvd_device",&dvd_device,CONF_TYPE_STRING,0,0,0,NULL },
- { "cdrom_device",&cdrom_device,CONF_TYPE_STRING,0,0,0,NULL },
-
- { "osd_level",&osd_level,CONF_TYPE_INT,CONF_RANGE,0,3,NULL },
- { "sub_auto_load",&sub_auto,CONF_TYPE_FLAG,0,0,1,NULL },
- { "sub_unicode",&sub_unicode,CONF_TYPE_FLAG,0,0,1,NULL },
-#ifdef CONFIG_ASS
- { "ass_enabled",&ass_enabled,CONF_TYPE_FLAG,0,0,1,NULL },
- { "ass_use_margins",&ass_use_margins,CONF_TYPE_FLAG,0,0,1,NULL },
- { "ass_top_margin",&ass_top_margin,CONF_TYPE_INT,CONF_RANGE,0,512,NULL },
- { "ass_bottom_margin",&ass_bottom_margin,CONF_TYPE_INT,CONF_RANGE,0,512,NULL },
-#endif
- { "sub_pos",&sub_pos,CONF_TYPE_INT,CONF_RANGE,0,200,NULL },
- { "sub_overlap",&suboverlap_enabled,CONF_TYPE_FLAG,0,0,0,NULL },
-#ifdef CONFIG_ICONV
- { "sub_cp",&sub_cp,CONF_TYPE_STRING,0,0,0,NULL },
-#endif
- { "font_factor",&font_factor,CONF_TYPE_FLOAT,CONF_RANGE,0.0,10.0,NULL },
- { "font_name",&font_name,CONF_TYPE_STRING,0,0,0,NULL },
-#ifdef CONFIG_FREETYPE
- { "font_encoding",&subtitle_font_encoding,CONF_TYPE_STRING,0,0,0,NULL },
- { "font_text_scale",&text_font_scale_factor,CONF_TYPE_FLOAT,CONF_RANGE,0,100,NULL },
- { "font_osd_scale",&osd_font_scale_factor,CONF_TYPE_FLOAT,CONF_RANGE,0,100,NULL },
- { "font_blur",&subtitle_font_radius,CONF_TYPE_FLOAT,CONF_RANGE,0,8,NULL },
- { "font_outline",&subtitle_font_thickness,CONF_TYPE_FLOAT,CONF_RANGE,0,8,NULL },
- { "font_autoscale",&subtitle_autoscale,CONF_TYPE_INT,CONF_RANGE,0,3,NULL },
-#endif
-
- { "cache",&gtkCacheOn,CONF_TYPE_FLAG,0,0,1,NULL },
- { "cache_size",&gtkCacheSize,CONF_TYPE_INT,CONF_RANGE,-1,65535,NULL },
-
- { "playbar",&gtkEnablePlayBar,CONF_TYPE_FLAG,0,0,1,NULL },
- { "load_fullscreen",&gtkLoadFullscreen,CONF_TYPE_FLAG,0,0,1,NULL },
- { "show_videowin", &gtkShowVideoWindow,CONF_TYPE_FLAG,0,0,1,NULL },
- { "stopxscreensaver",&stop_xscreensaver,CONF_TYPE_FLAG,0,0,1,NULL },
-
- { "autosync",&gtkAutoSyncOn,CONF_TYPE_FLAG,0,0,1,NULL },
- { "autosync_size",&gtkAutoSync,CONF_TYPE_INT,CONF_RANGE,0,10000,NULL },
-
- { "gui_skin",&skinName,CONF_TYPE_STRING,0,0,0,NULL },
-
- { "gui_save_pos", &gui_save_pos, CONF_TYPE_FLAG,0,0,1,NULL},
- { "gui_main_pos_x", &gui_main_pos_x, CONF_TYPE_INT,0,0,0,NULL},
- { "gui_main_pos_y", &gui_main_pos_y, CONF_TYPE_INT,0,0,0,NULL},
- { "gui_video_out_pos_x", &gui_sub_pos_x, CONF_TYPE_INT,0,0,0,NULL},
- { "gui_video_out_pos_y", &gui_sub_pos_y, CONF_TYPE_INT,0,0,0,NULL},
-
- { "equ_channel_1",&gtkEquChannel1,CONF_TYPE_STRING,0,0,0,NULL },
- { "equ_channel_2",&gtkEquChannel2,CONF_TYPE_STRING,0,0,0,NULL },
- { "equ_channel_3",&gtkEquChannel3,CONF_TYPE_STRING,0,0,0,NULL },
- { "equ_channel_4",&gtkEquChannel4,CONF_TYPE_STRING,0,0,0,NULL },
- { "equ_channel_5",&gtkEquChannel5,CONF_TYPE_STRING,0,0,0,NULL },
- { "equ_channel_6",&gtkEquChannel6,CONF_TYPE_STRING,0,0,0,NULL },
-
-#if 1
-#define audio_equ_row( i,j ) { "equ_band_"#i#j,&gtkEquChannels[i][j],CONF_TYPE_FLOAT,CONF_RANGE,-15.0,15.0,NULL },
- audio_equ_row( 0,0 ) audio_equ_row( 0,1 ) audio_equ_row( 0,2 ) audio_equ_row( 0,3 ) audio_equ_row( 0,4 ) audio_equ_row( 0,5 ) audio_equ_row( 0,6 ) audio_equ_row( 0,7 ) audio_equ_row( 0,8 ) audio_equ_row( 0,9 )
- audio_equ_row( 1,0 ) audio_equ_row( 1,1 ) audio_equ_row( 1,2 ) audio_equ_row( 1,3 ) audio_equ_row( 1,4 ) audio_equ_row( 1,5 ) audio_equ_row( 1,6 ) audio_equ_row( 1,7 ) audio_equ_row( 1,8 ) audio_equ_row( 1,9 )
- audio_equ_row( 2,0 ) audio_equ_row( 2,1 ) audio_equ_row( 2,2 ) audio_equ_row( 2,3 ) audio_equ_row( 2,4 ) audio_equ_row( 2,5 ) audio_equ_row( 2,6 ) audio_equ_row( 2,7 ) audio_equ_row( 2,8 ) audio_equ_row( 2,9 )
- audio_equ_row( 3,0 ) audio_equ_row( 3,1 ) audio_equ_row( 3,2 ) audio_equ_row( 3,3 ) audio_equ_row( 3,4 ) audio_equ_row( 3,5 ) audio_equ_row( 3,6 ) audio_equ_row( 3,7 ) audio_equ_row( 3,8 ) audio_equ_row( 3,9 )
- audio_equ_row( 4,0 ) audio_equ_row( 4,1 ) audio_equ_row( 4,2 ) audio_equ_row( 4,3 ) audio_equ_row( 4,4 ) audio_equ_row( 4,5 ) audio_equ_row( 4,6 ) audio_equ_row( 4,7 ) audio_equ_row( 4,8 ) audio_equ_row( 4,9 )
- audio_equ_row( 5,0 ) audio_equ_row( 5,1 ) audio_equ_row( 5,2 ) audio_equ_row( 5,3 ) audio_equ_row( 5,4 ) audio_equ_row( 5,5 ) audio_equ_row( 5,6 ) audio_equ_row( 5,7 ) audio_equ_row( 5,8 ) audio_equ_row( 5,9 )
-#undef audio_equ_row
-#endif
-
- { NULL, NULL, 0, 0, 0, 0, NULL }
-};
-
-char * gfgets( char * str, int size, FILE * f )
-{
- char * s = fgets( str,size,f );
- char c;
- if ( s )
- {
- c=s[ strlen( s ) - 1 ]; if ( c == '\n' || c == '\r' ) s[ strlen( s ) - 1 ]=0;
- c=s[ strlen( s ) - 1 ]; if ( c == '\n' || c == '\r' ) s[ strlen( s ) - 1 ]=0;
- }
- return s;
-}
-
-int cfg_read( void )
-{
- char * cfg = get_path( "gui.conf" );
- FILE * f;
-
-// -- read configuration
- mp_msg( MSGT_GPLAYER,MSGL_V,"[cfg] reading config file: %s\n",cfg );
- gui_conf=m_config_new();
- m_config_register_options( gui_conf,gui_opts );
- if ( !disable_gui_conf && m_config_parse_config_file( gui_conf,cfg ) < 0 )
- {
- mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_ConfigFileError );
-// exit( 1 );
- }
- free( cfg );
-
-// -- read pl
- cfg=get_path( "gui.pl" );
- if ( (f=fopen( cfg,"rt" )) )
- {
- while ( !feof( f ) )
- {
- char tmp[512]; plItem * item;
- if ( gfgets( tmp,512,f ) == NULL ) continue;
- item=calloc( 1,sizeof( plItem ) );
- item->path=strdup( tmp );
- gfgets( tmp,512,f );
- item->name=strdup( tmp );
- gtkSet( gtkAddPlItem,0,(void*)item );
- }
- fclose( f );
- }
- free( cfg );
-
- //-- read previously visited urls
- cfg=get_path( "gui.url" );
- if ( (f=fopen( cfg,"rt" )) )
- {
- while ( !feof( f ) )
- {
- char tmp[512]; URLItem * item;
- if ( gfgets( tmp,512,f ) == NULL ) continue;
- item=calloc( 1,sizeof( URLItem ) );
- item->url=strdup( tmp );
- gtkSet( gtkAddURLItem,0,(void*)item );
- }
- fclose( f );
- }
- free( cfg );
-
-// -- reade file loader history
- cfg=get_path( "gui.history" );
- if ( (f=fopen( cfg,"rt+" )) )
- {
- int i = 0;
- while ( !feof( f ) )
- {
- char tmp[512];
- if ( gfgets( tmp,512,f ) == NULL ) continue;
- fsHistory[i++]=gstrdup( tmp );
- }
- fclose( f );
- }
- free( cfg );
-
- return 0;
-}
-
-int cfg_write( void )
-{
- char * cfg = get_path( "gui.conf" );
- FILE * f;
- int i;
-
-// -- save configuration
- if ( (f=fopen( cfg,"wt+" )) )
- {
- for ( i=0;gui_opts[i].name;i++ )
- {
- char* v = m_option_print(&gui_opts[i],gui_opts[i].p);
- if(v == (char *)-1) {
- mp_msg(MSGT_GPLAYER,MSGL_WARN,MSGTR_UnableToSaveOption, gui_opts[i].name);
- v = NULL;
- }
- if(v) {
- fprintf( f,"%s = \"%s\"\n",gui_opts[i].name, v);
- free(v);
- }
- }
- fclose( f );
- }
- free( cfg );
-
-// -- save playlist
- cfg=get_path( "gui.pl" );
- if ( (f=fopen( cfg,"wt+" )) )
- {
- plCurrent=plList;
- while ( plCurrent )
- {
- if ( plCurrent->path && plCurrent->name )
- {
- fprintf( f,"%s\n",plCurrent->path );
- fprintf( f,"%s\n",plCurrent->name );
- }
- plCurrent=plCurrent->next;
- }
- fclose( f );
- }
- free( cfg );
-
-// -- save URL's
- cfg=get_path( "gui.url" );
- if ( (f=fopen( cfg,"wt+" )) )
- {
- while ( URLList )
- {
- if ( URLList->url ) fprintf( f,"%s\n",URLList->url );
- URLList=URLList->next;
- }
- fclose( f );
- }
- free( cfg );
-
-// -- save file loader history
- cfg=get_path( "gui.history" );
- if ( (f=fopen( cfg,"wt+" )) )
- {
- int i = 0;
-// while ( fsHistory[i] != NULL )
- for ( i=0;i < 5; i++)
- if( fsHistory[i] ) fprintf( f,"%s\n",fsHistory[i] );
- fclose( f );
- }
- free( cfg );
-
- return 0;
-}
-
diff --git a/gui/cfg.h b/gui/cfg.h
deleted file mode 100644
index 82eb36122a..0000000000
--- a/gui/cfg.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef MPLAYER_GUI_CFG_H
-#define MPLAYER_GUI_CFG_H
-
-#include "config.h"
-
-extern int gtkEnableAudioEqualizer;
-
-extern int gtkVfPP;
-extern int gtkVfLAVC;
-
-extern int gtkAONorm;
-extern int gtkAOFakeSurround;
-extern int gtkAOExtraStereo;
-extern float gtkAOExtraStereoMul;
-extern char * gtkAOOSSMixer;
-extern char * gtkAOOSSMixerChannel;
-extern char * gtkAOOSSDevice;
-extern char * gtkAOALSAMixer;
-extern char * gtkAOALSAMixerChannel;
-extern char * gtkAOALSADevice;
-extern char * gtkAOSDLDriver;
-extern char * gtkAOESDDevice;
-extern char * gtkDXR3Device;
-
-extern int gtkCacheOn;
-extern int gtkCacheSize;
-
-extern int gtkAutoSyncOn;
-extern int gtkAutoSync;
-
-extern int gtkSubDumpMPSub;
-extern int gtkSubDumpSrt;
-
-extern char * gtkEquChannel1;
-extern char * gtkEquChannel2;
-extern char * gtkEquChannel3;
-extern char * gtkEquChannel4;
-extern char * gtkEquChannel5;
-extern char * gtkEquChannel6;
-extern int gtkLoadFullscreen;
-extern int gtkShowVideoWindow;
-extern int gtkEnablePlayBar;
-
-extern int gui_save_pos;
-extern int gui_main_pos_x;
-extern int gui_main_pos_y;
-extern int gui_sub_pos_x;
-extern int gui_sub_pos_y;
-
-#ifdef CONFIG_ASS
-typedef struct {
- int enabled;
- int use_margins;
- int top_margin;
- int bottom_margin;
-} gtkASS_t;
-extern gtkASS_t gtkASS;
-#endif
-
-int cfg_read( void );
-int cfg_write( void );
-
-#endif /* MPLAYER_GUI_CFG_H */
diff --git a/gui/interface.c b/gui/interface.c
deleted file mode 100644
index 3351656d87..0000000000
--- a/gui/interface.c
+++ /dev/null
@@ -1,1312 +0,0 @@
-/*
- * 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.
- */
-
-#include <inttypes.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include "wm/ws.h"
-#include "wm/wsxdnd.h"
-#include "interface.h"
-#include "skin/skin.h"
-
-#include "mplayer/gtk/eq.h"
-#include "mplayer/widgets.h"
-#include "mplayer/gmplayer.h"
-#include "mplayer/play.h"
-
-#include "access_mpcontext.h"
-#include "app.h"
-#include "cfg.h"
-#include "help_mp.h"
-#include "get_path.h"
-#include "libvo/x11_common.h"
-#include "libvo/video_out.h"
-#include "libvo/font_load.h"
-#include "libvo/sub.h"
-#include "input/input.h"
-#include "libao2/audio_out.h"
-#include "mixer.h"
-#include "libaf/af.h"
-#include "libaf/equalizer.h"
-#include "libass/ass_mp.h"
-
-extern af_cfg_t af_cfg;
-
-#ifdef CONFIG_ICONV
-#include <iconv.h>
-#endif
-
-#include "stream/stream.h"
-#include "libmpdemux/demuxer.h"
-#include "libmpdemux/stheader.h"
-#include "libmpcodecs/dec_video.h"
-
-#ifdef CONFIG_DVDREAD
-#include "stream/stream_dvd.h"
-#endif
-
-int vcd_seek_to_track(void *vcd, int track);
-
-#include "m_config.h"
-#include "m_option.h"
-
-
-guiInterface_t guiIntfStruct;
-int guiWinID=-1;
-
-char * gstrcat( char ** dest,const char * src )
-{
- char * tmp = NULL;
-
- if ( !src ) return NULL;
-
- if ( *dest )
- {
- tmp=malloc( strlen( *dest ) + strlen( src ) + 1 );
-
- if ( tmp ) /* TODO: advanced error handling */
- {
- strcpy( tmp,*dest ); strcat( tmp,src ); free( *dest );
- }
- }
- else
- { tmp=malloc( strlen( src ) + 1 ); strcpy( tmp,src ); }
- *dest=tmp;
- return tmp;
-}
-
-int gstrcmp( const char * a,const char * b )
-{
- if ( !a && !b ) return 0;
- if ( !a || !b ) return -1;
- return strcmp( a,b );
-}
-
-int gstrncmp( const char * a,const char * b,int size )
-{
- if ( !a && !b ) return 0;
- if ( !a || !b ) return -1;
- return strncmp( a,b,size );
-}
-
-char * gstrdup( const char * str )
-{
- if ( !str ) return NULL;
- return strdup( str );
-}
-
-char * gstrchr( char * str,int c )
-{
- if ( !str ) return NULL;
- return strchr( str,c );
-}
-
-void gfree( void ** p )
-{
- if ( *p == NULL ) return;
- free( *p ); *p=NULL;
-}
-
-void gset( char ** str, const char * what )
-{
- if ( *str ) { if ( !strstr( *str,what ) ) { gstrcat( str,"," ); gstrcat( str,what ); }}
- else gstrcat( str,what );
-}
-
-/**
- * \brief this actually creates a new list containing only one element...
- */
-void gaddlist( char *** list,const char * entry )
-{
- int i;
-
- if ( (*list) )
- {
- for ( i=0;(*list)[i];i++ ) free( (*list)[i] );
- free( (*list) );
- }
-
- (*list)=malloc( 2 * sizeof(char **) );
- (*list)[0]=gstrdup( entry );
- (*list)[1]=NULL;
-}
-
-/**
- * \brief this replaces a string starting with search by replace.
- * If not found, replace is appended.
- */
-void greplace(char ***list, const char *search, const char *replace)
-{
- int i = 0;
- int len = (search) ? strlen(search) : 0;
-
- if (*list) {
- for (i = 0; (*list)[i]; i++) {
- if (search && (strncmp((*list)[i], search, len) == 0)) {
- free((*list)[i]);
- (*list)[i] = gstrdup(replace);
- return;
- }
- }
- *list = realloc(*list, (i + 2) * sizeof(char *));
- }
- else
- *list = malloc(2 * sizeof(char *));
-
- (*list)[i] = gstrdup(replace);
- (*list)[i + 1] = NULL;
-}
-
-void guiInit( void )
-{
- int i;
-
- memset( &guiIntfStruct,0,sizeof( guiIntfStruct ) );
- guiIntfStruct.Balance=50.0f;
- guiIntfStruct.StreamType=-1;
-
- memset( &gtkEquChannels,0,sizeof( gtkEquChannels ) );
-#ifdef CONFIG_DXR3
- if ( !gtkDXR3Device ) gtkDXR3Device=strdup( "/dev/em8300-0" );
-#endif
- if ( stream_cache_size > 0 ) { gtkCacheOn=1; gtkCacheSize=stream_cache_size; }
- else if ( stream_cache_size == 0 ) gtkCacheOn = 0;
- if ( autosync && autosync != gtkAutoSync ) { gtkAutoSyncOn=1; gtkAutoSync=autosync; }
-
-#ifdef CONFIG_ASS
- gtkASS.enabled = ass_enabled;
- gtkASS.use_margins = ass_use_margins;
- gtkASS.top_margin = ass_top_margin;
- gtkASS.bottom_margin = ass_bottom_margin;
-#endif
-
- gtkInit();
-// --- initialize X
- wsXInit( (void *)mDisplay );
-// --- load skin
- skinDirInHome=get_path("skins");
- skinDirInHome_obsolete=get_path("Skin");
- skinMPlayerDir=MPLAYER_DATADIR "/skins";
- skinMPlayerDir_obsolete=MPLAYER_DATADIR "/Skin";
- mp_msg( MSGT_GPLAYER,MSGL_V,"SKIN dir 1: '%s'\n",skinDirInHome);
- mp_msg( MSGT_GPLAYER,MSGL_V,"SKIN dir 1 (obsolete): '%s'\n",skinDirInHome_obsolete);
- mp_msg( MSGT_GPLAYER,MSGL_V,"SKIN dir 2: '%s'\n",skinMPlayerDir);
- mp_msg( MSGT_GPLAYER,MSGL_V,"SKIN dir 2 (obsolete): '%s'\n",skinMPlayerDir_obsolete);
- if ( !skinName ) skinName=strdup( "default" );
- i = skinRead( skinName );
- if ((i == -1) && strcmp(skinName,"default"))
- {
- mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_SKIN_SKINCFG_SelectedSkinNotFound, skinName);
- skinName=strdup( "default" );
- i = skinRead( skinName );
- }
- switch (i) {
- case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 );
- case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 );
- }
-// --- initialize windows
- if ( ( mplDrawBuffer = malloc( appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
- {
- fprintf( stderr,MSGTR_NEMDB );
- exit( 0 );
- }
-
- if ( gui_save_pos )
- {
- appMPlayer.main.x = gui_main_pos_x;
- appMPlayer.main.y = gui_main_pos_y;
- appMPlayer.sub.x = gui_sub_pos_x;
- appMPlayer.sub.y = gui_sub_pos_y;
- }
-
- if (WinID>0)
- {
- appMPlayer.subWindow.Parent=WinID;
- appMPlayer.sub.x=0;
- appMPlayer.sub.y=0;
- }
- if (guiWinID>=0) appMPlayer.mainWindow.Parent=guiWinID;
-
- wsCreateWindow( &appMPlayer.subWindow,
- appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height,
- wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"MPlayer - Video" );
-
- wsDestroyImage( &appMPlayer.subWindow );
- wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
- wsXDNDMakeAwareness(&appMPlayer.subWindow);
-
- mplMenuInit();
- mplPBInit();
-
- vo_setwindow( appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC );
-
-// i=wsHideFrame|wsMaxSize|wsHideWindow;
-// if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
- i=wsShowFrame|wsMaxSize|wsHideWindow;
- wsCreateWindow( &appMPlayer.mainWindow,
- appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height,
- wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,i,"MPlayer" );
-
- wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
- wsXDNDMakeAwareness(&appMPlayer.mainWindow);
-
-#ifdef DEBUG
- mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] depth on screen: %d\n",wsDepthOnScreen );
- mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID );
- mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID );
-#endif
-
- appMPlayer.mainWindow.ReDraw=(void *)mplMainDraw;
- appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle;
- appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle;
- appMPlayer.mainWindow.DandDHandler=mplDandDHandler;
-
- appMPlayer.subWindow.ReDraw=(void *)mplSubDraw;
- appMPlayer.subWindow.MouseHandler=mplSubMouseHandle;
- appMPlayer.subWindow.KeyHandler=mplMainKeyHandle;
- appMPlayer.subWindow.DandDHandler=mplDandDHandler;
-
- wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
- wsClearWindow( appMPlayer.subWindow );
- if ( appMPlayer.sub.Bitmap.Image ) wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize );
-
- btnModify( evSetVolume,guiIntfStruct.Volume );
- btnModify( evSetBalance,guiIntfStruct.Balance );
- btnModify( evSetMoviePosition,guiIntfStruct.Position );
-
- wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask );
- wsSetIcon( wsDisplay,appMPlayer.subWindow.WindowID,guiIcon,guiIconMask );
-
- guiIntfStruct.Playing=0;
-
- if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 );
-
- wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
-#if 0
- wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
-
- {
- XEvent xev;
- do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID );
- appMPlayer.subWindow.Mapped=wsMapped;
- }
-
- if ( !fullscreen ) fullscreen=gtkLoadFullscreen;
- if ( fullscreen )
- {
- mplFullScreen();
- btnModify( evFullScreen,btnPressed );
- }
-#else
- if ( !fullscreen ) fullscreen=gtkLoadFullscreen;
- if ( gtkShowVideoWindow )
- {
- wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
- {
- XEvent xev;
- do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID );
- appMPlayer.subWindow.Mapped=wsMapped;
- }
-
- if ( fullscreen )
- {
- mplFullScreen();
- btnModify( evFullScreen,btnPressed );
- }
- }
- else
- {
- if ( fullscreen )
- {
- wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
- {
- XEvent xev;
- do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID );
- appMPlayer.subWindow.Mapped=wsMapped;
- }
- wsVisibleWindow( &appMPlayer.subWindow, wsShowWindow );
-
- mplFullScreen();
- btnModify( evFullScreen,btnPressed );
- }
- }
-#endif
- mplSubRender=1;
-// ---
-
- if ( filename ) mplSetFileName( NULL,filename,STREAMTYPE_FILE );
- if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
- if ( subdata ) guiSetFilename( guiIntfStruct.Subtitlename, subdata->filename );
- guiLoadFont();
-}
-
-void guiDone( void )
-{
- mplMainRender=0;
- mp_msg( MSGT_GPLAYER,MSGL_V,"[GUI] done.\n" );
-
- if ( gui_save_pos )
- {
- gui_main_pos_x=appMPlayer.mainWindow.X; gui_main_pos_y=appMPlayer.mainWindow.Y;
- gui_sub_pos_x=appMPlayer.subWindow.X; gui_sub_pos_y=appMPlayer.subWindow.Y;
- }
-
-#ifdef CONFIG_ASS
- ass_enabled = gtkASS.enabled;
- ass_use_margins = gtkASS.use_margins;
- ass_top_margin = gtkASS.top_margin;
- ass_bottom_margin = gtkASS.bottom_margin;
-#endif
-
- cfg_write();
- wsXDone();
-}
-
-int guiCMDArray[] =
- {
- evLoadPlay,
- evLoadSubtitle,
- evAbout,
- evPlay,
- evStop,
- evPlayList,
- evPreferences,
- evFullScreen,
- evSkinBrowser
- };
-
-extern int stream_dump_type;
-extern int vcd_track;
-extern m_obj_settings_t * vf_settings;
-
-void guiLoadFont( void )
-{
-#ifdef CONFIG_FREETYPE
- load_font_ft(vo_image_width, vo_image_height, &vo_font, font_name, osd_font_scale_factor);
-#else
- if ( vo_font )
- {
- int i;
- if ( vo_font->name ) free( vo_font->name );
- if ( vo_font->fpath ) free( vo_font->fpath );
- for ( i=0;i<16;i++ )
- if ( vo_font->pic_a[i] )
- {
- if ( vo_font->pic_a[i]->bmp ) free( vo_font->pic_a[i]->bmp );
- if ( vo_font->pic_a[i]->pal ) free( vo_font->pic_a[i]->pal );
- }
- for ( i=0;i<16;i++ )
- if ( vo_font->pic_b[i] )
- {
- if ( vo_font->pic_b[i]->bmp ) free( vo_font->pic_b[i]->bmp );
- if ( vo_font->pic_b[i]->pal ) free( vo_font->pic_b[i]->pal );
- }
- free( vo_font ); vo_font=NULL;
- }
- if ( font_name )
- {
- vo_font=read_font_desc( font_name,font_factor,0 );
- if ( !vo_font ) mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadFont,font_name );
- }
- else
- {
- font_name=gstrdup( get_path( "font/font.desc" ) );
- vo_font=read_font_desc( font_name,font_factor,0 );
- if ( !vo_font )
- {
- gfree( (void **)&font_name ); font_name=gstrdup(MPLAYER_DATADIR "/font/font.desc" );
- vo_font=read_font_desc( font_name,font_factor,0 );
- }
- }
-#endif
-}
-
-extern mp_osd_obj_t* vo_osd_list;
-
-extern char **sub_name;
-
-void guiLoadSubtitle( char * name )
-{
- if ( guiIntfStruct.Playing == 0 )
- {
- guiIntfStruct.SubtitleChanged=1; //what is this for? (mw)
- return;
- }
- if ( subdata )
- {
- mp_msg( MSGT_GPLAYER,MSGL_INFO,MSGTR_DeletingSubtitles );
- sub_free( subdata );
- subdata=NULL;
- vo_sub=NULL;
- if ( vo_osd_list )
- {
- int len;
- mp_osd_obj_t * osd = vo_osd_list;
- while ( osd )
- {
- if ( osd->type == OSDTYPE_SUBTITLE ) break;
- osd=osd->next;
- }
- if ( osd && osd->flags&OSDFLAG_VISIBLE )
- {
- len=osd->stride * ( osd->bbox.y2 - osd->bbox.y1 );
- memset( osd->bitmap_buffer,0,len );
- memset( osd->alpha_buffer,0,len );
- }
- }
- }
- if ( name )
- {
- mp_msg( MSGT_GPLAYER,MSGL_INFO,MSGTR_LoadingSubtitles,name );
- subdata=sub_read_file( name, guiIntfStruct.FPS );
- if ( !subdata ) mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_CantLoadSub,name );
- sub_name = (malloc(2 * sizeof(char*))); //when mplayer will be restarted
- sub_name[0] = strdup(name); //sub_name[0] will be read
- sub_name[1] = NULL;
- }
- update_set_of_subtitles();
-
-}
-
-static void add_vf( char * str )
-{
- mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_AddingVideoFilter,str );
- if ( vf_settings )
- {
- int i = 0;
- while ( vf_settings[i].name ) if ( !gstrcmp( vf_settings[i++].name,str ) ) { i=-1; break; }
- if ( i != -1 )
- { vf_settings=realloc( vf_settings,( i + 2 ) * sizeof( m_obj_settings_t ) ); vf_settings[i].name=strdup( str );vf_settings[i].attribs = NULL; vf_settings[i+1].name=NULL; }
- } else { vf_settings=malloc( 2 * sizeof( m_obj_settings_t ) ); vf_settings[0].name=strdup( str );vf_settings[0].attribs = NULL; vf_settings[1].name=NULL; }
-}
-
-static void remove_vf( char * str )
-{
- int n = 0;
-
- if ( !vf_settings ) return;
-
- mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_RemovingVideoFilter,str );
-
- while ( vf_settings[n++].name ); n--;
- if ( n > -1 )
- {
- int i = 0,m = -1;
- while ( vf_settings[i].name ) if ( !gstrcmp( vf_settings[i++].name,str ) ) { m=i - 1; break; }
- i--;
- if ( m > -1 )
- {
- if ( n == 1 ) { free( vf_settings[0].name );free( vf_settings[0].attribs ); free( vf_settings ); vf_settings=NULL; }
- else { free( vf_settings[i].name );free( vf_settings[i].attribs ); memcpy( &vf_settings[i],&vf_settings[i + 1],( n - i ) * sizeof( m_obj_settings_t ) ); }
- }
- }
-}
-
-int guiGetEvent( int type,char * arg )
-{
- const ao_functions_t *audio_out = NULL;
- const vo_functions_t *video_out = NULL;
- mixer_t *mixer = NULL;
-
- stream_t * stream = (stream_t *) arg;
-#ifdef CONFIG_DVDREAD
- dvd_priv_t * dvdp = (dvd_priv_t *) arg;
-#endif
-
- if (guiIntfStruct.mpcontext) {
- audio_out = mpctx_get_audio_out(guiIntfStruct.mpcontext);
- video_out = mpctx_get_video_out(guiIntfStruct.mpcontext);
- mixer = mpctx_get_mixer(guiIntfStruct.mpcontext);
- }
-
- switch ( type )
- {
- case guiXEvent:
- guiIntfStruct.event_struct=(void *)arg;
- wsEvents( wsDisplay,(XEvent *)arg,NULL );
- gtkEventHandling();
- break;
- case guiCEvent:
- switch ( (int)arg )
- {
- case guiSetPlay:
- guiIntfStruct.Playing=1;
-// if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
- break;
- case guiSetStop:
- guiIntfStruct.Playing=0;
-// if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
- break;
- case guiSetPause: guiIntfStruct.Playing=2; break;
- }
- mplState();
- break;
- case guiSetState:
- mplState();
- break;
- case guiSetFileName:
- if ( arg ) guiSetFilename( guiIntfStruct.Filename,arg );
- break;
- case guiSetAudioOnly:
- guiIntfStruct.AudioOnly=(int)arg;
- if ( (int)arg ) { guiIntfStruct.NoWindow=True; wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); }
- else wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
- break;
- case guiSetContext:
- guiIntfStruct.mpcontext=(void *)arg;
- case guiSetDemuxer:
- guiIntfStruct.demuxer=(void *)arg;
- break;
- case guiSetAfilter:
- guiIntfStruct.afilter=(void *)arg;
- break;
- case guiSetShVideo:
- {
- if ( !appMPlayer.subWindow.isFullScreen )
- {
- wsResizeWindow( &appMPlayer.subWindow,vo_dwidth,vo_dheight );
- wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
- }
- guiIntfStruct.MovieWidth=vo_dwidth;
- guiIntfStruct.MovieHeight=vo_dheight;
- if (guiWinID>=0)
- wsMoveWindow( &appMPlayer.mainWindow,0,0, vo_dheight);
- }
- break;
-#ifdef CONFIG_DVDREAD
- case guiSetDVD:
- guiIntfStruct.DVD.titles=dvdp->vmg_file->tt_srpt->nr_of_srpts;
- guiIntfStruct.DVD.chapters=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts;
- guiIntfStruct.DVD.angles=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles;
- guiIntfStruct.DVD.nr_of_audio_channels=dvdp->nr_of_channels;
- memcpy( guiIntfStruct.DVD.audio_streams,dvdp->audio_streams,sizeof( dvdp->audio_streams ) );
- guiIntfStruct.DVD.nr_of_subtitles=dvdp->nr_of_subtitles;
- memcpy( guiIntfStruct.DVD.subtitles,dvdp->subtitles,sizeof( dvdp->subtitles ) );
- guiIntfStruct.DVD.current_title=dvd_title + 1;
- guiIntfStruct.DVD.current_chapter=dvd_chapter + 1;
- guiIntfStruct.DVD.current_angle=dvd_angle + 1;
- guiIntfStruct.Track=dvd_title + 1;
- break;
-#endif
- case guiSetStream:
- guiIntfStruct.StreamType=stream->type;
- switch( stream->type )
- {
-#ifdef CONFIG_DVDREAD
- case STREAMTYPE_DVD:
- guiGetEvent( guiSetDVD,(char *)stream->priv );
- break;
-#endif
-#ifdef CONFIG_VCD
- case STREAMTYPE_VCD:
- {
- int i;
-
- if (!stream->priv)
- {
- guiIntfStruct.VCDTracks=0;
- break;
- }
- for ( i=1;i < 100;i++ )
- if ( vcd_seek_to_track( stream->priv,i ) < 0 ) break;
- vcd_seek_to_track( stream->priv,vcd_track );
- guiIntfStruct.VCDTracks=--i;
- break;
- }
-#endif
- default: break;
- }
- break;
- case guiIEvent:
- mp_msg( MSGT_GPLAYER,MSGL_V,"cmd: %d\n",(int)arg );
- switch( (int)arg )
- {
- case MP_CMD_QUIT:
- mplEventHandling( evExit,0 );
- break;
- case MP_CMD_VO_FULLSCREEN:
- mplEventHandling( evFullScreen,0 );
- break;
- default:
- mplEventHandling( guiCMDArray[ (int)arg - MP_CMD_GUI_EVENTS - 1 ],0 );
- }
- break;
- case guiReDraw:
- mplEventHandling( evRedraw,0 );
- break;
- case guiSetVolume:
- if ( audio_out )
- {
- float l,r;
- mixer_getvolume( mixer,&l,&r );
- guiIntfStruct.Volume=(r>l?r:l);
- if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f;
- else guiIntfStruct.Balance=50.0f;
- btnModify( evSetVolume,guiIntfStruct.Volume );
- btnModify( evSetBalance,guiIntfStruct.Balance );
- }
- break;
- case guiSetFileFormat:
- guiIntfStruct.FileFormat=(int)arg;
- break;
- case guiSetValues:
-// -- video
- guiIntfStruct.sh_video=arg;
- if ( arg )
- {
- sh_video_t * sh = (sh_video_t *)arg;
- guiIntfStruct.FPS=sh->fps;
- }
-
- if ( guiIntfStruct.NoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
-
- if ( guiIntfStruct.StreamType == STREAMTYPE_STREAM ) btnSet( evSetMoviePosition,btnDisabled );
- else btnSet( evSetMoviePosition,btnReleased );
-
-// -- audio
- if ( audio_out )
- {
- float l,r;
- mixer_getvolume( mixer,&l,&r );
- guiIntfStruct.Volume=(r>l?r:l);
- if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f;
- else guiIntfStruct.Balance=50.0f;
- btnModify( evSetVolume,guiIntfStruct.Volume );
- btnModify( evSetBalance,guiIntfStruct.Balance );
- }
-
- if ( gtkEnableAudioEqualizer )
- {
- equalizer_t eq;
- int i,j;
- for ( i=0;i<6;i++ )
- for ( j=0;j<10;j++ )
- {
- eq.channel=i; eq.band=j; eq.gain=gtkEquChannels[i][j];
- gtkSet( gtkSetEqualizer,0,&eq );
- }
- }
-// -- subtitle
-#ifdef CONFIG_DXR3
- if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS
-#ifdef CONFIG_LIBAVCODEC
- && !gtkVfLAVC
-#endif
- )
- {
- gtkMessageBox( GTK_MB_FATAL,MSGTR_NEEDLAVC );
- guiIntfStruct.Playing=0;
- return True;
- }
-#endif
- break;
- case guiSetDefaults:
-// if ( guiIntfStruct.Playing == 1 && guiIntfStruct.FilenameChanged )
- if ( guiIntfStruct.FilenameChanged )
- {
- audio_id=-1;
- video_id=-1;
- dvdsub_id=-1;
- vobsub_id=-1;
- stream_cache_size=-1;
- autosync=0;
- vcd_track=0;
- dvd_title=0;
- force_fps=0;
- }
- guiIntfStruct.demuxer=NULL;
- guiIntfStruct.sh_video=NULL;
- wsPostRedisplay( &appMPlayer.subWindow );
- break;
- case guiSetParameters:
- guiGetEvent( guiSetDefaults,NULL );
- switch ( guiIntfStruct.StreamType )
- {
- case STREAMTYPE_PLAYLIST:
- break;
-#ifdef CONFIG_VCD
- case STREAMTYPE_VCD:
- {
- char tmp[512];
- sprintf( tmp,"vcd://%d",guiIntfStruct.Track + 1 );
- guiSetFilename( guiIntfStruct.Filename,tmp );
- }
- break;
-#endif
-#ifdef CONFIG_DVDREAD
- case STREAMTYPE_DVD:
- {
- char tmp[512];
- sprintf( tmp,"dvd://%d",guiIntfStruct.Title );
- guiSetFilename( guiIntfStruct.Filename,tmp );
- }
- dvd_chapter=guiIntfStruct.Chapter;
- dvd_angle=guiIntfStruct.Angle;
- break;
-#endif
- }
- //if ( guiIntfStruct.StreamType != STREAMTYPE_PLAYLIST ) // Does not make problems anymore!
- {
- if ( guiIntfStruct.Filename ) filename=gstrdup( guiIntfStruct.Filename );
- else if ( filename ) guiSetFilename( guiIntfStruct.Filename,filename );
- }
-// --- video opts
-
- if ( !video_driver_list )
- {
- int i = 0;
- while ( video_out_drivers[i++] )
- if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE )
- {
- gaddlist( &video_driver_list,(char *)video_out_drivers[i - 1]->info->short_name );
- break;
- }
- }
-
- if ( !video_driver_list && !video_driver_list[0] ) { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); }
-
- {
- int i = 0;
- guiIntfStruct.NoWindow=False;
- while ( video_out_drivers[i++] )
- if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE )
- {
- if ( ( video_driver_list && !gstrcmp( video_driver_list[0],(char *)video_out_drivers[i - 1]->info->short_name ) )&&( video_out_drivers[i - 1]->control( VOCTRL_GUI_NOWINDOW,NULL ) == VO_TRUE ) )
- { guiIntfStruct.NoWindow=True; break; }
- }
- }
-
-#ifdef CONFIG_DXR3
-#ifdef CONFIG_LIBAVCODEC
- remove_vf( "lavc" );
-#endif
- if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) )