[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[651] mplayerxp
Brought to you by:
olov
|
From: <nic...@us...> - 2013-06-11 14:37:55
|
Revision: 651
http://sourceforge.net/p/mplayerxp/code/651
Author: nickols_k
Date: 2013-06-11 14:37:50 +0000 (Tue, 11 Jun 2013)
Log Message:
-----------
convert libmpcodecs into class (note: doesn't work for me)
about illegal-patch
====================
Log shows that it is working code, but it doesn't work for me due illegal-patch
$sudo ./mplayerxp -vo fbdev -ao alsa /...path.../trassa e95.avi -v -v -v
---------------------- 8< --------------------- 8< ------------------------
*** Antiviral protection was inited ***!!!
MPlayerXP svn.650 2002 Nickols_K 2000-2002 Arpad Gereoffy (?\209?\129?\208?\188. DOCS!)
Can't open input config file /root/.mplayerxp/input.conf : No such file or directory
Can't open input config file /usr/local/share/mplayerxp/input.conf : No such file or directory
Falling back on default (hardcoded) input config
Opening joystick device:/dev/input/js0
Can't open joystick device: /dev/input/js0 : No such file or directory
Can't init input joystick with using: /dev/input/js0
CPU: Advanced Micro Devices
(Type: 9, Stepping: 3)
extended cpuid-level: 26
extended cache-info: 33587520
Detected cache-line size is 64 bytes
cpudetect: MMX=1 MMX2=1 3DNow=1 3DNow2=1 SSE=1 SSE2=1 SSE3=1 SSSE3=0 SSE41=0 SSE42=0 AES=0 AVX=0 FMA=0
User corrected CPU flags: MMX=1 MMX2=1 3DNow=1 3DNow2=1 SSE=1 SSE2=1 SSE3=1 SSSE3=0 SSE41=0 SSE42=0 AES=0 AVX=0 FMA=0
mpxp_context().mplayer_accel=4160749568
Environment:
HOME => /root
LANG => ru_RU.UTF-8
LOGNAME => root
MAIL => /var/mail/root
PATH => /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl
SHELL => /bin/bash
SUDO_COMMAND => ./mplayerxp -vo fbdev -ao alsa /...path.../trassa e95.avi -v -v -v
SUDO_GID => 1000
SUDO_UID => 1000
SUDO_USER => kas
TERM => linux
USER => root
USERNAME => root
CommandLine: '-vo' 'fbdev' '-ao' 'alsa' '/...path.../trassa e95.avi' '-v' '-v' '-v'
font: can't open file: /root/.mplayerxp/font/font.desc
font: can't open file: /usr/local/share/mplayerxp/font/font.desc
Menu init failed
fbdev: using /dev/fb0
?\208?\146?\208?\190?\209?\129?\208?\191?\209?\128?\208?\190?\208?\184?\208?\183?\208?\178?\208?\181?\208?\180?\208?\181?\208?\189?\208?\184?\208?\181 /...path.../trassa e95.avi
Filename for url is now /...path.../trassa%20e95.avi
Not an URL!
[Stream]: Opening *:// ... False
[Demuxer]: Probing RAW audio parser ...:False
[Demuxer]: Probing RAW video parser ...:False
[Demuxer]: Probing AVI - Audio Video Interleaved parser ...:Ok
DEMUX: LIST 'hdrl' len=8830
DEMUX: list_end=0x2292
DEMUX: CHUNK 'avih' len=56
DEMUX: ======= AVI Header =======
us/frame: 40000 (fps=25.000)
max bytes/sec: 0
padding: 0
DEMUX: MainAVIHeader.dwFlags: (272) HAS_INDEX IS_INTERLEAVED
DEMUX: frames total: 6198 initial: 0
streams: 2
Suggested BufferSize: 0
Size: 352 x 288
DEMUX: list_end=0x2292 pos=0x58 chunksize=0x0 next=0x58
DEMUX: LIST 'strl' len=4244
DEMUX: list_end=0x10F4
DEMUX: CHUNK 'strh' len=56
[Demuxer]: ==> Found video stream: 0
[Demuxer]: ID_VIDEO_ID=0
DEMUX: ======= STREAM Header =======
Type: vids FCC: div3 (33766964)
Flags: 0
Priority: 0 Language: 0
InitialFrames: 0
Rate: 25000/1000 = 25.000
Start: 0 Len: 6198
Suggested BufferSize: 21412
Quality 10000
Sample size: 0
DEMUX: list_end=0x10F4 pos=0xA4 chunksize=0x0 next=0xA4
DEMUX: CHUNK 'strf' len=40
DEMUX: found 'bih', 40 bytes of 40
DEMUX: ======= VIDEO Format (chunk size: 40 )======
biSize 40
biWidth 352
biHeight 288
biPlanes 1
biBitCount 24
biCompression 33564944='DIV3'
biSizeImage 304128
biXPelPerMeter 0
biYPelPerMeter 0
biClrUsed 0
biClrIpmortant 0
DEMUX: ======= End of Video Format =======
DEMUX: Regenerating keyframe table for DIVX 3 video
DEMUX: list_end=0x10F4 pos=0xD4 chunksize=0x0 next=0xD4
DEMUX: CHUNK 'JUNK' len=4120
DEMUX: list_end=0x10F4 pos=0x10F4 chunksize=0x0 next=0x10F4
DEMUX: LIST 'strl' len=4234
DEMUX: list_end=0x2186
DEMUX: CHUNK 'strh' len=56
DEMUX: avi: Found audio stream
Demuxer: ==> Found audio stream: 1
Demuxer: ID_AUDIO_ID=1
DEMUX: ======= STREAM Header =======
Type: auds FCC: (0)
Flags: 0
Priority: 0 Language: 0
InitialFrames: 1
Rate: 15963/1 = 15963.000
Start: 0 Len: 3957330
Suggested BufferSize: 7467
Quality -1
Sample size: 1
DEMUX: list_end=0x2186 pos=0x1140 chunksize=0x0 next=0x1140
DEMUX: CHUNK 'strf' len=30
DEMUX: found 'wf', 30 bytes of 18
DEMUX: ======= WAVE Format (chunk size: 30 )=======
Format Tag: 85 (0x55)
Channels: 2
Samplerate: 44100
avg byte/sec: 15963
Block align: 1
bits/sample: 0
cbSize: 12
DEMUX: mp3.wID=1
mp3.fdwFlags=0x2
mp3.nBlockSize=417
mp3.nFramesPerBlock=1
mp3.nCodecDelay=1393
DEMUX: ======= End of WAVE Format =======
DEMUX: list_end=0x2186 pos=0x1166 chunksize=0x0 next=0x1166
DEMUX: CHUNK 'JUNK' len=4120
DEMUX: list_end=0x2186 pos=0x2186 chunksize=0x0 next=0x2186
DEMUX: LIST 'odml' len=260
DEMUX: list_end=0x2292
DEMUX: CHUNK 'dmlh' len=248
DEMUX: Found ODML header 248 frames 6198
DEMUX: list_end=0x2292 pos=0x2292 chunksize=0x0 next=0x2292
DEMUX: CHUNK 'JUNK' len=1382
DEMUX: list_end=0x2292 pos=0x2800 chunksize=0x0 next=0x2800
DEMUX: Broken chunk? chunksize=0 (id=JUNK)
DEMUX: CHUNK 'JUNK' len=1382
DEMUX: list_end=0x0 pos=0x2800 chunksize=0x0 next=0x2800
DEMUX: LIST 'movi' len=23710356
DEMUX: list_end=0x169F29C
DEMUX: Found movie at 0x280C - 0x169F29C
DEMUX: CHUNK 'idx1' len=198144
DEMUX: Reading INDEX block, 12384 chunks for 6198 frames
DEMUX: 0: 01wb 10 00000004 len: 7467 pos: 0-> 0.000 0-> 0.000
DEMUX: 1: 00dc 10 00001D38 len: 556 pos: 0-> 0.000 0-> 0.000
DEMUX: 2: 01wb 10 00001F6C len: 419 pos: 7467-> 0.398 1-> 0.042
[snip] ... [/snip]
DEMUX: 12381: 00dc 0 0169C7E6 len: 122 pos:19647058->1048.011 6195->258.383
DEMUX: 12382: 00dc 0 0169C868 len: 247 pos:19647180->1048.017 6196->258.425
DEMUX: 12383: 00dc 0 0169C968 len: 292 pos:19647427->1048.031 6197->258.467
DEMUX: list_end=0x0 pos=0x16CF8A4 chunksize=0x0 next=0x16CF8A4
DEMUX: CHUNK 'JUNK' len=1876
DEMUX: list_end=0x0 pos=0x16D0000 chunksize=0x0 next=0x16D0000
DEMUX: AVI index offset: 0x2808 (movi=0x280C idx0=0x4 idx1=0x1D38)
DEMUX: Auto-selected AVI audio ID = 1
DEMUX: Auto-selected AVI video ID = 0
ds_fill_buffer(d_video) called
DEMUX: demux_avi.read_packet: 62773130
DEMUX: DEMUX_AVI: Read 7467 data bytes from packet 62773130
DEMUX: Append packet: len=7467 pts=0 pos=0 [_packs: A=1 V=0]
ds_read_packet(7467,0,0,0)
DEMUX: DEMUX_AVI: Skipping 1 bytes from packet 62773130
DEMUX: demux_avi.read_packet: 63643030
DEMUX: DEMUX_AVI: Read 556 data bytes from packet 63643030
DEMUX: Append packet: len=556 pts=0 pos=1 [_packs: A=1 V=1]
ds_read_packet(556,0,0,0)
DEMUX: AVI: Searching for audio stream (id:1)
ds_fill_buffer(d_audio) called
DEMUX: AVI video size=19647719 (6198) audio size=3957330 (3957330)
DEMUX: VIDEO: [DIV3] 352x288 24bpp 25.00 fps
[Demuxer]: Using: AVI - Audio Video Interleaved parser
[Stream]:Video=DIV3 Audio=00000055
[V] filefmt:6fourcc:0x33564944 size:160x120 fps:25 ftime:=0.04
MPSUB: SPU: Display only forced subs now disabled
[codec_ld] ?\208?\145?\208?\184?\208?\177?\208?\187?\208?\184?\208?\190?\209?\130?\208?\181?\208?\186?\208?\176 ?\208?\183?\208?\176?\208?\179?\209?\128?\209?\131?\208?\182?\208?\181?\208?\189?\208?\176 ?\209?\131?\209?\129?\208?\191?\208?\181?\209?\136?\208?\189?\208?\190:libmpg123.so
initial_apts from: stream_pts=0 pts_bytes=7467 got_bytes=7467 i_bps=15963
initial_apts is: 0
mpg123_init: MPEG-1.0 [Layer:III (CBR)], Hz=44100 128-kbit Joint-Stereo, BPF=417 Out=32-bit
mpg123_init: Copyrght=No Orig=Yes CRC=No Priv=No Emphas=0 Optimiz=x86-64
Probing: mp3libok
Driver: mp3lib supports these outfmt for 00000055
100000 10 0
Using SSE2 optimized memcpy
fast_memcpy(0x3dc27a0, 0x7fff2f5dbf88, 64) [cl_size=64]
dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer
[AC] Selecting drv:mp3lib.libmpg123.so ratio 15963->352800
alsa-init: compiled for ALSA-1.0.27.1
alsa-init: got device=0, subdevice=0
alsa-init: Testing & bugs are welcome. Found 1 cards, use: hw:0,0
alsa-init: pcm opend in block-mode
snd_pcm_hw_params_any()
snd_pcm_hw_params_set_access(SND_PCM_ACCESS_RW_INTERLEAVED)
Initializing audio codec...
AUDIO: srate=ac44 chans=2 bps=4 sfmt=0x100000 ratio: 3e5b->0
POSTPR: vo2(NULL, NULL)
Probing: raw
failed
Probing: nuv
failed
Probing: mpeg2
failed
Probing: xvid
failed
Probing: mpegpes
failed
Probing: huffyuv
failed
Probing: divx
[codec_ld] ?\208?\157?\208?\181 ?\208?\188?\208?\190?\208?\179?\209?\131 ?\208?\183?\208?\176?\208?\179?\209?\128?\209?\131?\208?\183?\208?\184?\209?\130?\209?\140 ?\208?\177?\208?\184?\208?\177?\208?\187?\208?\184?\208?\190?\209?\130?\208?\181?\208?\186?\209?\131:libdivx.so {libdivx.so: cannot open shared object file: No such file or directory}
[codec_ld] ?\208?\159?\208?\190?\208?\191?\209?\139?\209?\130?\208?\176?\208?\185?\209?\130?\208?\181?\209?\129?\209?\140 ?\208?\191?\208?\190?\208?\187?\209?\131?\209?\135?\208?\184?\209?\130?\209?\140 ?\209?\141?\209?\130?\208?\190?\209?\130 ?\208?\186?\208?\190?\208?\180?\208?\181?\208?\186 ?\209?\129:http://labs.divx.com/DivXLinuxCodec
failed
Probing: realvid
failed
Probing: xanim
failed
Probing: theora
failed
Probing: libdv
failed
Probing: lavc
libavcodec.size: 352 x 288
Using 4 threads in lavc
INFO: libavcodec.so (0) video codec[DIV3] init OK!
VDec: vo config request - 352 x 288
dri_vo_dbg: vo_query_format(00000000)
dri_vo: request for Unknown 0x0000 fourcc: 0
[vf_vo2] 0=query_format(Unknown 0x0000)
vf_vo2->config(352,288,352,288,4,Unknown 0x0000)
dri_vo_dbg: vo_config
priv.video_out->config(352,288,352,288, 0x4,'MPlayerXP',Unknown 0x0000)
fbdev: Can't set graphics mode: Inappropriate ioctl for device
fbdev: var info:
fbdev: xres: 1920
fbdev: yres: 1200
fbdev: xres_virtual: 1920
fbdev: yres_virtual: 1200
fbdev: xoffset: 0
fbdev: yoffset: 0
fbdev: bits_per_pixel: 32
fbdev: grayscale: 0
fbdev: red: 16 8 0
fbdev: green: 8 8 0
fbdev: blue: 0 8 0
fbdev: transp: 24 8 0
fbdev: nonstd: 0
fbdev: activate: 0
fbdev: height: 4294967295
fbdev: width: 4294967295
fbdev: accel_flags: 1
fbdev: timing:
fbdev: pixclock: 0
fbdev: left_margin: 0
fbdev: right_margin: 0
fbdev: upper_margin: 0
fbdev: lower_margin: 0
fbdev: hsync_len: 0
fbdev: vsync_len: 0
fbdev: sync: 0
fbdev: vmode: 0
fbdev: fix info:
fbdev: framebuffer size: 9216000 bytes
fbdev: type: 0
fbdev: type_aux: 0
fbdev: visual: 2
fbdev: line_length: 7680 bytes
fbdev: id: radeondrmfb
fbdev: smem_start: 0xc0142000
fbdev: xpanstep: 1
fbdev: ypanstep: 1
fbdev: ywrapstep: 0
fbdev: mmio_start: 0
fbdev: mmio_len: 0 bytes
fbdev: accel: 0
fbdev: priv.bpp: 32
fbdev: priv.real_bpp: 24
fbdev: priv.pixel_size: 4 bytes
fbdev: other:
fbdev: priv.in_width: 352
fbdev: priv.in_height: 288
fbdev: priv.out_width: 352
fbdev: priv.out_height: 288
fbdev: priv.last_row: 816
fbdev: frame_buffer @ 7f7549c01000
fbdev: L123123875 @ 7f7549f58c40
fbdev: pixel per line: 1920
fbdev: vt_set_textarea(330,4b0): 34,4b
POSTPR: [stream: vf_reinit_vo]: 0x3de51c0
POSTPR: Call vf_reinit_vo <vo2: 352x288@Unknown 0x0000> -> <vo: 352x288@BGRA>
POSTPR: vf->first: 352x288@Unknown 0x0000
POSTPR: [352x288@Unknown 0x0000](NULL<-vo2->NULL)
POSTPR: Using(first:vo2) 352x288@Unknown 0x0000
POSTPR: vf_reinit->config_vf 352 288 Unknown 0x0000=> 352 288 BGRA
POSTPR: Open video filter: [fmtcvt] <352x288 Unknown 0x0000>
POSTPR: SwScale params: -1 x -1 (-1=no scaling)
dri_vo_dbg: vo_query_format(51343434)
dri_vo: request for Planar 444P 16-bit little-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 444P 16-bit little-endian)
POSTPR: scale: query(Planar 444P 16-bit little-endian) -> 0
dri_vo_dbg: vo_query_format(34343451)
dri_vo: request for Planar 444P 16-bit big-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 444P 16-bit big-endian)
POSTPR: scale: query(Planar 444P 16-bit big-endian) -> 0
dri_vo_dbg: vo_query_format(51323234)
dri_vo: request for Planar 422P 16-bit little-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 422P 16-bit little-endian)
POSTPR: scale: query(Planar 422P 16-bit little-endian) -> 0
dri_vo_dbg: vo_query_format(34323251)
dri_vo: request for Planar 422P 16-bit big-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 422P 16-bit big-endian)
POSTPR: scale: query(Planar 422P 16-bit big-endian) -> 0
dri_vo_dbg: vo_query_format(51303234)
dri_vo: request for Planar 420P 16-bit little-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 420P 16-bit little-endian)
POSTPR: scale: query(Planar 420P 16-bit little-endian) -> 0
dri_vo_dbg: vo_query_format(34323051)
dri_vo: request for Planar 420P 16-bit big-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 420P 16-bit big-endian)
POSTPR: scale: query(Planar 420P 16-bit big-endian) -> 0
dri_vo_dbg: vo_query_format(41303234)
dri_vo: request for Planar YV12 with alpha fourcc: 0
[vf_vo2] 0=query_format(Planar YV12 with alpha)
POSTPR: scale: query(Planar YV12 with alpha) -> 0
dri_vo_dbg: vo_query_format(50343434)
dri_vo: request for Planar 444P fourcc: 0
[vf_vo2] 0=query_format(Planar 444P)
POSTPR: scale: query(Planar 444P) -> 0
dri_vo_dbg: vo_query_format(50323234)
dri_vo: request for Planar 422P fourcc: 0
[vf_vo2] 0=query_format(Planar 422P)
POSTPR: scale: query(Planar 422P) -> 0
dri_vo_dbg: vo_query_format(32315659)
dri_vo: request for Planar YV12 fourcc: 0
[vf_vo2] 0=query_format(Planar YV12)
POSTPR: scale: query(Planar YV12) -> 0
dri_vo_dbg: vo_query_format(30323449)
dri_vo: request for Planar I420 fourcc: 0
[vf_vo2] 0=query_format(Planar I420)
POSTPR: scale: query(Planar I420) -> 0
dri_vo_dbg: vo_query_format(56555949)
dri_vo: request for Planar IYUV fourcc: 0
[vf_vo2] 0=query_format(Planar IYUV)
POSTPR: scale: query(Planar IYUV) -> 0
dri_vo_dbg: vo_query_format(39555659)
dri_vo: request for Planar YVU9 fourcc: 0
[vf_vo2] 0=query_format(Planar YVU9)
POSTPR: scale: query(Planar YVU9) -> 0
dri_vo_dbg: vo_query_format(39304649)
dri_vo: request for Planar IF09 fourcc: 0
[vf_vo2] 0=query_format(Planar IF09)
POSTPR: scale: query(Planar IF09) -> 0
dri_vo_dbg: vo_query_format(50313134)
dri_vo: request for Planar 411P fourcc: 0
[vf_vo2] 0=query_format(Planar 411P)
POSTPR: scale: query(Planar 411P) -> 0
dri_vo_dbg: vo_query_format(32595559)
dri_vo: request for Packed YUY2 fourcc: 0
[vf_vo2] 0=query_format(Packed YUY2)
POSTPR: scale: query(Packed YUY2) -> 0
dri_vo_dbg: vo_query_format(59565955)
dri_vo: request for Packed UYVY fourcc: 0
[vf_vo2] 0=query_format(Packed UYVY)
POSTPR: scale: query(Packed UYVY) -> 0
dri_vo_dbg: vo_query_format(52474230)
dri_vo: request for RGB 48-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 48-bit)
POSTPR: scale: query(RGB 48-bit) -> 0
dri_vo_dbg: vo_query_format(524742b0)
dri_vo: request for BGR 48-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 48-bit)
POSTPR: scale: query(BGR 48-bit) -> 0
dri_vo_dbg: vo_query_format(42475220)
dri_vo: request for BGRA fourcc: 1
[vf_vo2] 1=query_format(BGRA)
POSTPR: scale: query(BGRA) -> 1
dri_vo_dbg: vo_query_format(52474220)
dri_vo: request for RGBA fourcc: 0
[vf_vo2] 0=query_format(RGBA)
POSTPR: scale: query(RGBA) -> 0
dri_vo_dbg: vo_query_format(42475218)
dri_vo: request for BGR 24-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 24-bit)
POSTPR: scale: query(BGR 24-bit) -> 0
dri_vo_dbg: vo_query_format(52474218)
dri_vo: request for RGB 24-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 24-bit)
POSTPR: scale: query(RGB 24-bit) -> 0
dri_vo_dbg: vo_query_format(42475210)
dri_vo: request for BGR 16-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 16-bit)
POSTPR: scale: query(BGR 16-bit) -> 0
dri_vo_dbg: vo_query_format(52474210)
dri_vo: request for RGB 16-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 16-bit)
POSTPR: scale: query(RGB 16-bit) -> 0
dri_vo_dbg: vo_query_format(4247520f)
dri_vo: request for BGR 15-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 15-bit)
POSTPR: scale: query(BGR 15-bit) -> 0
dri_vo_dbg: vo_query_format(5247420f)
dri_vo: request for RGB 15-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 15-bit)
POSTPR: scale: query(RGB 15-bit) -> 0
dri_vo_dbg: vo_query_format(30303859)
dri_vo: request for Planar Y800 fourcc: 0
[vf_vo2] 0=query_format(Planar Y800)
POSTPR: scale: query(Planar Y800) -> 0
dri_vo_dbg: vo_query_format(20203859)
dri_vo: request for Planar Y8 fourcc: 0
[vf_vo2] 0=query_format(Planar Y8)
POSTPR: scale: query(Planar Y8) -> 0
dri_vo_dbg: vo_query_format(42475208)
dri_vo: request for BGR 8-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 8-bit)
POSTPR: scale: query(BGR 8-bit) -> 0
dri_vo_dbg: vo_query_format(52474208)
dri_vo: request for RGB 8-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 8-bit)
POSTPR: scale: query(RGB 8-bit) -> 0
dri_vo_dbg: vo_query_format(42475204)
dri_vo: request for BGR 4-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 4-bit)
POSTPR: scale: query(BGR 4-bit) -> 0
dri_vo_dbg: vo_query_format(52474204)
dri_vo: request for RGB 4-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 4-bit)
POSTPR: scale: query(RGB 4-bit) -> 0
dri_vo_dbg: vo_query_format(42475284)
dri_vo: request for BGR 4-bit per byte fourcc: 0
[vf_vo2] 0=query_format(BGR 4-bit per byte)
POSTPR: scale: query(BGR 4-bit per byte) -> 0
dri_vo_dbg: vo_query_format(52474284)
dri_vo: request for RGB 4-bit per byte fourcc: 0
[vf_vo2] 0=query_format(RGB 4-bit per byte)
POSTPR: scale: query(RGB 4-bit per byte) -> 0
dri_vo_dbg: vo_query_format(42475201)
dri_vo: request for BGR 1-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 1-bit)
POSTPR: scale: query(BGR 1-bit) -> 0
dri_vo_dbg: vo_query_format(52474201)
dri_vo: request for RGB 1-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 1-bit)
POSTPR: scale: query(RGB 1-bit) -> 0
dri_vo_dbg: vo_query_format(42475220)
dri_vo: request for BGRA fourcc: 1
[vf_vo2] 1=query_format(BGRA)
POSTPR: vf_scale: 1025=vf_next_query_format(0x56f2010,42475220,352,288);
POSTPR: vf_scale: sws_getFlagsAndFilterFromCmdLine(...);
POSTPR: vf_scale: sws_getContext(352, 288, Unknown 0x0000, 352, 288, BGRA, E0001004);
[swscaler @ 0x56f25e0] (null) is not supported as input pixel format
POSTPR: vf_scale: (nil)=sws_getContext
POSTPR: Couldn't init SwScaler for this setup (nil)
POSTPR: FATAL: ?\208?\157?\208?\181 ?\208?\188?\208?\190?\208?\179?\209?\131 ?\208?\191?\209?\128?\208?\190?\208?\184?\208?\189?\208?\184?\209?\134?\208?\184?\208?\176?\208?\187?\208?\184?\208?\183?\208?\184?\209?\128?\208?\190?\208?\178?\208?\176?\209?\130?\209?\140 ?\208?\178?\208?\184?\208?\180?\208?\181?\208?\190 ?\208?\180?\209?\128?\208?\176?\208?\185?\208?\178?\208?\181?\209?\128!
POSTPR: vf->first: 352x288@Unknown 0x0000
POSTPR: [352x288@Unknown 0x0000](fmtcvt<-vo2->NULL)
dri_vo_caps: driver does support DRI
dri_vo_caps: caps=00000000 fourcc=42475220(BGRA) x,y,w,h(0 0 160 120)
dri_vo_caps: width,height(160,120) strides(580000) priv.dri.bpp=20
dri_vo_src: w,h(160,120) d_w,d_h(160,120
dri_vo_src: flags=00000004 fourcc=00000000(Unknown 0x0000)
dri_vo_dbg: vo_query_format(30323449)
dri_vo: request for Planar I420 fourcc: 0
[vf_vo2] 0=query_format(Planar I420)
vo_debug[step i=0]: query(Planar I420 352x288) returned 0x0 for:
POSTPR: [libvf] Using video filters chain:
POSTPR: VO-CONF: [fbdev] 352x288 => 352x288 Unknown 0x0000 [zoom]
VO: Description: Framebuffer Device
VO: Author: Szabolcs Berecz <sz...@in...>
Can't find colorspace for: 'Planar I420'
Trying -vf fmtcvt...
Open video filter: [fmtcvt] <352x288 Planar I420>
POSTPR: SwScale params: -1 x -1 (-1=no scaling)
POSTPR: vf_scale: query_format(0x56f25e0, 30323449(Planar I420), 352, 288
dri_vo_dbg: vo_query_format(51343434)
dri_vo: request for Planar 444P 16-bit little-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 444P 16-bit little-endian)
POSTPR: scale: query(Planar 444P 16-bit little-endian) -> 0
dri_vo_dbg: vo_query_format(34343451)
dri_vo: request for Planar 444P 16-bit big-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 444P 16-bit big-endian)
POSTPR: scale: query(Planar 444P 16-bit big-endian) -> 0
dri_vo_dbg: vo_query_format(51323234)
dri_vo: request for Planar 422P 16-bit little-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 422P 16-bit little-endian)
POSTPR: scale: query(Planar 422P 16-bit little-endian) -> 0
dri_vo_dbg: vo_query_format(34323251)
dri_vo: request for Planar 422P 16-bit big-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 422P 16-bit big-endian)
POSTPR: scale: query(Planar 422P 16-bit big-endian) -> 0
dri_vo_dbg: vo_query_format(51303234)
dri_vo: request for Planar 420P 16-bit little-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 420P 16-bit little-endian)
POSTPR: scale: query(Planar 420P 16-bit little-endian) -> 0
dri_vo_dbg: vo_query_format(34323051)
dri_vo: request for Planar 420P 16-bit big-endian fourcc: 0
[vf_vo2] 0=query_format(Planar 420P 16-bit big-endian)
POSTPR: scale: query(Planar 420P 16-bit big-endian) -> 0
dri_vo_dbg: vo_query_format(41303234)
dri_vo: request for Planar YV12 with alpha fourcc: 0
[vf_vo2] 0=query_format(Planar YV12 with alpha)
POSTPR: scale: query(Planar YV12 with alpha) -> 0
dri_vo_dbg: vo_query_format(50343434)
dri_vo: request for Planar 444P fourcc: 0
[vf_vo2] 0=query_format(Planar 444P)
POSTPR: scale: query(Planar 444P) -> 0
dri_vo_dbg: vo_query_format(50323234)
dri_vo: request for Planar 422P fourcc: 0
[vf_vo2] 0=query_format(Planar 422P)
POSTPR: scale: query(Planar 422P) -> 0
dri_vo_dbg: vo_query_format(32315659)
dri_vo: request for Planar YV12 fourcc: 0
[vf_vo2] 0=query_format(Planar YV12)
POSTPR: scale: query(Planar YV12) -> 0
dri_vo_dbg: vo_query_format(30323449)
dri_vo: request for Planar I420 fourcc: 0
[vf_vo2] 0=query_format(Planar I420)
POSTPR: scale: query(Planar I420) -> 0
dri_vo_dbg: vo_query_format(56555949)
dri_vo: request for Planar IYUV fourcc: 0
[vf_vo2] 0=query_format(Planar IYUV)
POSTPR: scale: query(Planar IYUV) -> 0
dri_vo_dbg: vo_query_format(39555659)
dri_vo: request for Planar YVU9 fourcc: 0
[vf_vo2] 0=query_format(Planar YVU9)
POSTPR: scale: query(Planar YVU9) -> 0
dri_vo_dbg: vo_query_format(39304649)
dri_vo: request for Planar IF09 fourcc: 0
[vf_vo2] 0=query_format(Planar IF09)
POSTPR: scale: query(Planar IF09) -> 0
dri_vo_dbg: vo_query_format(50313134)
dri_vo: request for Planar 411P fourcc: 0
[vf_vo2] 0=query_format(Planar 411P)
POSTPR: scale: query(Planar 411P) -> 0
dri_vo_dbg: vo_query_format(32595559)
dri_vo: request for Packed YUY2 fourcc: 0
[vf_vo2] 0=query_format(Packed YUY2)
POSTPR: scale: query(Packed YUY2) -> 0
dri_vo_dbg: vo_query_format(59565955)
dri_vo: request for Packed UYVY fourcc: 0
[vf_vo2] 0=query_format(Packed UYVY)
POSTPR: scale: query(Packed UYVY) -> 0
dri_vo_dbg: vo_query_format(52474230)
dri_vo: request for RGB 48-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 48-bit)
POSTPR: scale: query(RGB 48-bit) -> 0
dri_vo_dbg: vo_query_format(524742b0)
dri_vo: request for BGR 48-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 48-bit)
POSTPR: scale: query(BGR 48-bit) -> 0
dri_vo_dbg: vo_query_format(42475220)
dri_vo: request for BGRA fourcc: 1
[vf_vo2] 1=query_format(BGRA)
POSTPR: scale: query(BGRA) -> 1
dri_vo_dbg: vo_query_format(52474220)
dri_vo: request for RGBA fourcc: 0
[vf_vo2] 0=query_format(RGBA)
POSTPR: scale: query(RGBA) -> 0
dri_vo_dbg: vo_query_format(42475218)
dri_vo: request for BGR 24-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 24-bit)
POSTPR: scale: query(BGR 24-bit) -> 0
dri_vo_dbg: vo_query_format(52474218)
dri_vo: request for RGB 24-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 24-bit)
POSTPR: scale: query(RGB 24-bit) -> 0
dri_vo_dbg: vo_query_format(42475210)
dri_vo: request for BGR 16-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 16-bit)
POSTPR: scale: query(BGR 16-bit) -> 0
dri_vo_dbg: vo_query_format(52474210)
dri_vo: request for RGB 16-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 16-bit)
POSTPR: scale: query(RGB 16-bit) -> 0
dri_vo_dbg: vo_query_format(4247520f)
dri_vo: request for BGR 15-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 15-bit)
POSTPR: scale: query(BGR 15-bit) -> 0
dri_vo_dbg: vo_query_format(5247420f)
dri_vo: request for RGB 15-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 15-bit)
POSTPR: scale: query(RGB 15-bit) -> 0
dri_vo_dbg: vo_query_format(30303859)
dri_vo: request for Planar Y800 fourcc: 0
[vf_vo2] 0=query_format(Planar Y800)
POSTPR: scale: query(Planar Y800) -> 0
dri_vo_dbg: vo_query_format(20203859)
dri_vo: request for Planar Y8 fourcc: 0
[vf_vo2] 0=query_format(Planar Y8)
POSTPR: scale: query(Planar Y8) -> 0
dri_vo_dbg: vo_query_format(42475208)
dri_vo: request for BGR 8-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 8-bit)
POSTPR: scale: query(BGR 8-bit) -> 0
dri_vo_dbg: vo_query_format(52474208)
dri_vo: request for RGB 8-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 8-bit)
POSTPR: scale: query(RGB 8-bit) -> 0
dri_vo_dbg: vo_query_format(42475204)
dri_vo: request for BGR 4-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 4-bit)
POSTPR: scale: query(BGR 4-bit) -> 0
dri_vo_dbg: vo_query_format(52474204)
dri_vo: request for RGB 4-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 4-bit)
POSTPR: scale: query(RGB 4-bit) -> 0
dri_vo_dbg: vo_query_format(42475284)
dri_vo: request for BGR 4-bit per byte fourcc: 0
[vf_vo2] 0=query_format(BGR 4-bit per byte)
POSTPR: scale: query(BGR 4-bit per byte) -> 0
dri_vo_dbg: vo_query_format(52474284)
dri_vo: request for RGB 4-bit per byte fourcc: 0
[vf_vo2] 0=query_format(RGB 4-bit per byte)
POSTPR: scale: query(RGB 4-bit per byte) -> 0
dri_vo_dbg: vo_query_format(42475201)
dri_vo: request for BGR 1-bit fourcc: 0
[vf_vo2] 0=query_format(BGR 1-bit)
POSTPR: scale: query(BGR 1-bit) -> 0
dri_vo_dbg: vo_query_format(52474201)
dri_vo: request for RGB 1-bit fourcc: 0
[vf_vo2] 0=query_format(RGB 1-bit)
POSTPR: scale: query(RGB 1-bit) -> 0
dri_vo_dbg: vo_query_format(42475220)
dri_vo: request for BGRA fourcc: 1
[vf_vo2] 1=query_format(BGRA)
POSTPR: [sw_scale] BGRA supported on vo2 like 1025
POSTPR: [sw_scale] returning: 1089
vo_debug[step i=0]: query(Planar I420 160x120) returned 0x441 for:
POSTPR: [libvf] Using video filters chain:
POSTPR: [vf_fmtcvt]: video[0x0] in[Unknown 0x0000] -> out[Unknown 0x0000]
POSTPR: VO-CONF: [fbdev] 352x288 => 352x288 Unknown 0x0000 [zoom]
VO: Description: Framebuffer Device
VO: Author: Szabolcs Berecz <sz...@in...>
---------------------- 8< --------------------- 8< ------------------------
since this commit mplayerxp doesn't call exit() function at all. Therefore it's output
without illegal-patch cannot be terminated here.
Modified Paths:
--------------
mplayerxp/input2/input.cpp
mplayerxp/libmpcodecs/Makefile
mplayerxp/libmpcodecs/ad.cpp
mplayerxp/libmpcodecs/ad.h
mplayerxp/libmpcodecs/ad_a52.cpp
mplayerxp/libmpcodecs/ad_dca.cpp
mplayerxp/libmpcodecs/ad_dvdpcm.cpp
mplayerxp/libmpcodecs/ad_faad.cpp
mplayerxp/libmpcodecs/ad_internal.h
mplayerxp/libmpcodecs/ad_lavc.cpp
mplayerxp/libmpcodecs/ad_libdv.cpp
mplayerxp/libmpcodecs/ad_mp3.cpp
mplayerxp/libmpcodecs/ad_null.cpp
mplayerxp/libmpcodecs/ad_pcm.cpp
mplayerxp/libmpcodecs/ad_real.cpp
mplayerxp/libmpcodecs/ad_vorbis.cpp
mplayerxp/libmpcodecs/dec_audio.cpp
mplayerxp/libmpcodecs/dec_audio.h
mplayerxp/libmpcodecs/dec_video.cpp
mplayerxp/libmpcodecs/dec_video.h
mplayerxp/libmpcodecs/vd.cpp
mplayerxp/libmpcodecs/vd.h
mplayerxp/libmpcodecs/vd_divx4.cpp
mplayerxp/libmpcodecs/vd_huffyuv.cpp
mplayerxp/libmpcodecs/vd_internal.h
mplayerxp/libmpcodecs/vd_lavc.cpp
mplayerxp/libmpcodecs/vd_libdv.cpp
mplayerxp/libmpcodecs/vd_libmpeg2.cpp
mplayerxp/libmpcodecs/vd_mpegpes.cpp
mplayerxp/libmpcodecs/vd_null.cpp
mplayerxp/libmpcodecs/vd_nuv.cpp
mplayerxp/libmpcodecs/vd_raw.cpp
mplayerxp/libmpcodecs/vd_real.cpp
mplayerxp/libmpcodecs/vd_theora.cpp
mplayerxp/libmpcodecs/vd_xanim.cpp
mplayerxp/libmpcodecs/vd_xvid.cpp
mplayerxp/libmpconf/cfgparser.cpp
mplayerxp/libmpdemux/demux_dv.cpp
mplayerxp/libmpdemux/demux_ogg.cpp
mplayerxp/main.cpp
mplayerxp/mplayerxp.h
mplayerxp/osdep/mplib.cpp
mplayerxp/osdep/mplib.h
mplayerxp/postproc/af.h
mplayerxp/postproc/vf.cpp
mplayerxp/xmpcore/xmp_context.cpp
Removed Paths:
-------------
mplayerxp/libmpcodecs/ad_hwac3.cpp
Modified: mplayerxp/input2/input.cpp
===================================================================
--- mplayerxp/input2/input.cpp 2013-06-10 07:27:20 UTC (rev 650)
+++ mplayerxp/input2/input.cpp 2013-06-11 14:37:50 UTC (rev 651)
@@ -26,6 +26,7 @@
#include "libmpconf/cfgparser.h"
#include "in_msg.h"
+#include "mpxp_help.h"
#ifdef HAVE_LIRC
#include "lirc.h"
@@ -1360,7 +1361,7 @@
static int mp_input_print_key_list(libinput_t& handle) {
mp_input_print_keys(handle);
- exit(0);
+ exit_player(MSGTR_Exit_quit);
}
void mp_input_print_binds(libinput_t& handle) {
@@ -1406,7 +1407,7 @@
static int mp_input_print_cmd_list(libinput_t& handle) {
mp_input_print_cmds(handle);
- exit(0);
+ exit_player(MSGTR_Exit_quit);
}
MPXP_Rc mp_input_check_interrupt(libinput_t& handle,int tim) {
Modified: mplayerxp/libmpcodecs/Makefile
===================================================================
--- mplayerxp/libmpcodecs/Makefile 2013-06-10 07:27:20 UTC (rev 650)
+++ mplayerxp/libmpcodecs/Makefile 2013-06-11 14:37:50 UTC (rev 651)
@@ -6,7 +6,7 @@
DO_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done
CXXSRCS=dec_video.cpp vd.cpp ad.cpp dec_audio.cpp
-CXXSRCS+=ad_a52.cpp ad_hwac3.cpp
+CXXSRCS+=ad_a52.cpp
CXXSRCS+=vd_lavc.cpp \
Modified: mplayerxp/libmpcodecs/ad.cpp
===================================================================
--- mplayerxp/libmpcodecs/ad.cpp 2013-06-10 07:27:20 UTC (rev 650)
+++ mplayerxp/libmpcodecs/ad.cpp 2013-06-11 14:37:50 UTC (rev 651)
@@ -16,100 +16,106 @@
#include "ad_msg.h"
/* Missed vorbis, mad, dshow */
+namespace usr {
-extern const ad_functions_t mpcodecs_ad_null;
-extern const ad_functions_t mpcodecs_ad_mp3;
-extern const ad_functions_t mpcodecs_ad_lavc;
-extern const ad_functions_t mpcodecs_ad_a52;
-extern const ad_functions_t mpcodecs_ad_dca;
-extern const ad_functions_t mpcodecs_ad_hwac3;
-extern const ad_functions_t mpcodecs_ad_pcm;
-extern const ad_functions_t mpcodecs_ad_libdv;
-extern const ad_functions_t mpcodecs_ad_dvdpcm;
-extern const ad_functions_t mpcodecs_ad_dshow;
-extern const ad_functions_t mpcodecs_ad_msacm;
-extern const ad_functions_t mpcodecs_ad_faad;
-extern const ad_functions_t mpcodecs_ad_vorbis;
-extern const ad_functions_t mpcodecs_ad_real;
-extern const ad_functions_t mpcodecs_ad_twin;
-extern const ad_functions_t mpcodecs_ad_dmo;
-extern const ad_functions_t mpcodecs_ad_qtaudio;
+extern const ad_info_t ad_null_info;
+extern const ad_info_t ad_mp3_info;
+extern const ad_info_t ad_lavc_info;
+extern const ad_info_t ad_a52_info;
+extern const ad_info_t ad_dca_info;
+extern const ad_info_t ad_pcm_info;
+extern const ad_info_t ad_libdv_info;
+extern const ad_info_t ad_dvdpcm_info;
+extern const ad_info_t ad_dshow_info;
+extern const ad_info_t ad_msacm_info;
+extern const ad_info_t ad_faad_info;
+extern const ad_info_t ad_vorbis_info;
+extern const ad_info_t ad_real_info;
+extern const ad_info_t ad_twin_info;
+extern const ad_info_t ad_dmo_info;
+extern const ad_info_t ad_qtaudio_info;
-static const ad_functions_t* mpcodecs_ad_drivers[] = {
- &mpcodecs_ad_mp3,
- &mpcodecs_ad_a52,
- &mpcodecs_ad_dca,
- &mpcodecs_ad_hwac3,
- &mpcodecs_ad_pcm,
- &mpcodecs_ad_dvdpcm,
- &mpcodecs_ad_faad,
+static const ad_info_t* mpcodecs_ad_drivers[] = {
+ &ad_mp3_info,
+ &ad_a52_info,
+ &ad_dca_info,
+ &ad_pcm_info,
+ &ad_dvdpcm_info,
+ &ad_faad_info,
#ifdef HAVE_LIBVORBIS
- &mpcodecs_ad_vorbis,
+ &ad_vorbis_info,
#endif
#ifdef HAVE_LIBDV
- &mpcodecs_ad_libdv,
+ &ad_libdv_info,
#endif
#ifndef ENABLE_GPL_ONLY
- &mpcodecs_ad_real,
+ &ad_real_info,
#endif
- &mpcodecs_ad_lavc,
- &mpcodecs_ad_null,
-
+ &ad_lavc_info,
+ &ad_null_info
};
-static unsigned int nddrivers=sizeof(mpcodecs_ad_drivers)/sizeof(ad_functions_t*);
-
void libmpcodecs_ad_register_options(M_Config& cfg)
{
unsigned i;
- for(i=0;i<nddrivers;i++) {
- if(mpcodecs_ad_drivers[i])
- if(mpcodecs_ad_drivers[i]->options)
- cfg.register_options(mpcodecs_ad_drivers[i]->options);
- if(mpcodecs_ad_drivers[i]==&mpcodecs_ad_null) break;
+ for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) {
+ if(mpcodecs_ad_drivers[i]->options)
+ cfg.register_options(mpcodecs_ad_drivers[i]->options);
}
}
-const ad_functions_t* afm_find_driver(const std::string& name) {
+const ad_info_t* afm_find_driver(const std::string& name) {
unsigned i;
- for (i=0; mpcodecs_ad_drivers[i] != &mpcodecs_ad_null; i++) {
- if(name==mpcodecs_ad_drivers[i]->info->driver_name){
+ for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) {
+ if(name==mpcodecs_ad_drivers[i]->driver_name)
return mpcodecs_ad_drivers[i];
- }
}
return NULL;
}
-const audio_probe_t* afm_probe_driver(Opaque& ctx,sh_audio_t *sh,audio_filter_info_t& afi) {
+Audio_Decoder* afm_probe_driver(sh_audio_t& sh,audio_filter_info_t& afi) {
unsigned i;
- const audio_probe_t* probe;
- for (i=0; mpcodecs_ad_drivers[i] != &mpcodecs_ad_null; i++) {
- mpxp_v<<"Probing: "<<mpcodecs_ad_drivers[i]->info->driver_name<<std::endl;
- if((probe=mpcodecs_ad_drivers[i]->probe(sh->wtag))!=NULL) {
- Opaque* priv=mpcodecs_ad_drivers[i]->preinit(*probe,sh,afi);
- mpxp_v<<"Driver: "<<mpcodecs_ad_drivers[i]->info->driver_name<<" supports these outfmt for ";
- fourcc(mpxp_v,sh->wtag);
+ Audio_Decoder* drv=NULL;
+ for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) {
+ mpxp_v<<"Probing: "<<mpcodecs_ad_drivers[i]->driver_name;
+ try {
+ /* Set up some common usefull defaults. ad->preinit() can override these: */
+#ifdef WORDS_BIGENDIAN
+ sh.afmt=AFMT_S16_BE;
+#else
+ sh.afmt=AFMT_S16_LE;
+#endif
+ sh.rate=0;
+ sh.o_bps=0;
+ drv=mpcodecs_ad_drivers[i]->query_interface(sh,afi,sh.wtag);
+ mpxp_v<<"ok"<<std::endl;
+ mpxp_v<<"Driver: "<<mpcodecs_ad_drivers[i]->driver_name<<" supports these outfmt for ";
+ fourcc(mpxp_v,sh.wtag);
mpxp_v<<std::endl;
+ audio_probe_t probe=drv->get_probe_information();
for(i=0;i<Audio_MaxOutSample;i++) {
- mpxp_v<<std::hex<<probe->sample_fmt[i]<<" ";
- if(probe->sample_fmt[i]==-1||probe->sample_fmt[i]==0) break;
+ mpxp_v<<std::hex<<probe.sample_fmt[i]<<" ";
+ if(probe.sample_fmt[i]==unsigned(-1)||probe.sample_fmt[i]==0) break;
}
mpxp_v<<std::endl;
- mpcodecs_ad_drivers[i]->uninit(*priv);
- delete priv;
- return probe;
+ break;
+ } catch (const bad_format_exception& ) {
+ mpxp_v<<"failed"<<std::endl;
+ delete drv; drv=NULL;
+ continue;
}
}
- return NULL;
+ return drv;
}
-void afm_help(void) {
- unsigned i;
- mpxp_info<<"Available audio codec families/drivers:"<<std::endl;
- for(i=0;i<nddrivers;i++) {
- if(mpcodecs_ad_drivers[i])
- if(mpcodecs_ad_drivers[i]->options)
- mpxp_info<<"\t"<<std::left<<std::setw(10)<<mpcodecs_ad_drivers[i]->info->driver_name<<" "<<mpcodecs_ad_drivers[i]->info->descr<<std::endl;
- }
- mpxp_info<<std::endl;
+void afm_help() {
+ unsigned i;
+ mpxp_info<<"Available audio codec families/drivers:"<<std::endl;
+ for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) {
+ if(mpcodecs_ad_drivers[i])
+ if(mpcodecs_ad_drivers[i]->options)
+ mpxp_info<<"\t"<<std::left<<std::setw(10)<<mpcodecs_ad_drivers[i]->driver_name<<" "<<mpcodecs_ad_drivers[i]->descr<<std::endl;
+ }
+ mpxp_info<<std::endl;
}
+} //namespace usr
\ No newline at end of file
Modified: mplayerxp/libmpcodecs/ad.h
===================================================================
--- mplayerxp/libmpcodecs/ad.h 2013-06-10 07:27:20 UTC (rev 650)
+++ mplayerxp/libmpcodecs/ad.h 2013-06-11 14:37:50 UTC (rev 651)
@@ -8,57 +8,59 @@
#include "xmpcore/xmp_enums.h"
#include "libao3/afmt.h"
-struct ad_info_t {
- const char *descr; /* driver description ("Autodesk FLI/FLC Animation decoder" */
- const char *driver_name; /* driver name ("dshow") */
- const char *author; /* interface author/maintainer */
- const char *url; /* URL of homepage */
-};
+namespace usr {
+ struct mpxp_options_t;
+ enum {
+ ADCTRL_RESYNC_STREAM=0,
+ ADCTRL_SKIP_FRAME =1
+ };
-enum {
- ADCTRL_RESYNC_STREAM=0,
- ADCTRL_SKIP_FRAME =1
-};
+ enum {
+ Audio_MaxOutSample =16,
+ };
-enum {
- Audio_MaxOutSample =16,
-};
+ typedef enum {
+ ACodecStatus_Working =3,
+ ACodecStatus_Problems =2,
+ ACodecStatus_Untested =1,
+ ACodecStatus_NotWorking =0,
+ }acodec_status_e;
-typedef enum {
- ACodecStatus_Working =3,
- ACodecStatus_Problems =2,
- ACodecStatus_Untested =1,
- ACodecStatus_NotWorking =0,
-}acodec_status_e;
+ struct audio_probe_t {
+ const char* driver;
+ const char* codec_dll;
+ uint32_t wtag;
+ acodec_status_e status;
+ unsigned sample_fmt[Audio_MaxOutSample];
+ };
-struct audio_probe_t {
- const char* driver;
- const char* codec_dll;
- uint32_t wtag;
- acodec_status_e status;
- unsigned sample_fmt[Audio_MaxOutSample];
-};
+ struct audio_filter_info_t {
+ af_stream_t* afilter;
+ int afilter_inited;
+ };
-struct audio_filter_info_t {
- af_stream_t* afilter;
- int afilter_inited;
-};
+ class Audio_Decoder : public Opaque {
+ public:
+ Audio_Decoder(sh_audio_t&,audio_filter_info_t&,uint32_t wtag) { UNUSED(wtag); }
+ virtual ~Audio_Decoder() {}
-/* interface of video decoder drivers */
-struct ad_functions_t
-{
- const ad_info_t* info;
- const mpxp_option_t* options;/**< Optional: MPlayerXP's option related */
- const audio_probe_t*(* __FASTCALL__ probe)(uint32_t wtag);
- Opaque* (* __FASTCALL__ preinit)(const audio_probe_t&,sh_audio_t*,audio_filter_info_t&);
- MPXP_Rc (* __FASTCALL__ init)(Opaque& ctx);
- void (* __FASTCALL__ uninit)(Opaque& ctx);
- MPXP_Rc (*control_ad)(Opaque& ctx,int cmd,any_t* arg, ...);
- unsigned (* __FASTCALL__ decode)(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts);
-};
+ virtual unsigned run(unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) = 0;
+ virtual MPXP_Rc ctrl(int cmd,any_t* arg) = 0;
+ virtual audio_probe_t get_probe_information() const = 0;
+ };
-extern const ad_functions_t* afm_find_driver(const std::string& name);
-extern const audio_probe_t* afm_probe_driver(Opaque& ctx,sh_audio_t*sh,audio_filter_info_t& afi);
-inline float FIX_APTS(sh_audio_t* sh_audio,float& pts,unsigned in_size) { return sh_audio->i_bps?(pts+float(in_size))/float(sh_audio->i_bps):pts; }
+ struct ad_info_t {
+ const char* descr; /* driver description ("Autodesk FLI/FLC Animation decoder" */
+ const char* driver_name; /* driver name ("dshow") */
+ const char* author; /* interface author/maintainer */
+ const char* url; /* URL of homepage */
+ Audio_Decoder* (*query_interface)(sh_audio_t&,audio_filter_info_t&,uint32_t wtag);
+ const mpxp_option_t* options;
+ };
+ const ad_info_t* afm_find_driver(const std::string& name);
+ Audio_Decoder* afm_probe_driver(sh_audio_t& sh,audio_filter_info_t& afi);
+ inline float FIX_APTS(sh_audio_t& sh_audio,float& pts,unsigned in_size) { return sh_audio.i_bps?(pts+float(in_size))/float(sh_audio.i_bps):pts; }
+} //namespace usr
+
#endif
Modified: mplayerxp/libmpcodecs/ad_a52.cpp
===================================================================
--- mplayerxp/libmpcodecs/ad_a52.cpp 2013-06-10 07:27:20 UTC (rev 650)
+++ mplayerxp/libmpcodecs/ad_a52.cpp 2013-06-11 14:37:50 UTC (rev 651)
@@ -8,6 +8,7 @@
#include <assert.h>
#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */
#include "ad_internal.h"
+#include "liba52/a52.h"
#include "codecs_ld.h"
#include "mplayerxp.h"
@@ -17,41 +18,32 @@
#include "osdep/mm_accel.h"
#include "mplayerxp.h"
-#include "liba52/a52.h"
#include "libao3/afmt.h"
#include "libao3/audio_out.h"
#include "postproc/af.h"
-struct a52_private_t : public Opaque {
- a52_private_t();
- virtual ~a52_private_t();
+namespace usr {
+ class a52_decoder : public Audio_Decoder {
+ public:
+ a52_decoder(sh_audio_t&,audio_filter_info_t&,uint32_t wtag);
+ virtual ~a52_decoder();
- sh_audio_t* sh;
- float last_pts;
-};
-a52_private_t::a52_private_t() {}
-a52_private_t::~a52_private_t() {}
+ virtual unsigned run(unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts);
+ virtual MPXP_Rc ctrl(int cmd,any_t* arg);
+ virtual audio_probe_t get_probe_information() const;
+ private:
+ int printinfo() const;
+ int fillbuffer(float& pts);
-static const int MAX_AC3_FRAME=3840;
+ a52_state_t* mpxp_a52_state;
+ uint32_t mpxp_a52_accel;
+ uint32_t mpxp_a52_flags;
+ sh_audio_t& sh;
+ float last_pts;
+ const audio_probe_t* probe;
+ static const int MAX_AC3_FRAME=3840;
+ };
-a52_state_t* mpxp_a52_state;
-uint32_t mpxp_a52_accel=0;
-uint32_t mpxp_a52_flags=0;
-
-static const ad_info_t info =
-{
- "liba52 AC3 driver",
- "liba52",
- "Nickols_K",
- "build-in"
-};
-
-static const mpxp_option_t options[] = {
- { NULL, NULL, 0, 0, 0, 0, NULL}
-};
-
-LIBAD_EXTERN(a52)
-
static const audio_probe_t probes[] = {
{ "liba52", "liba52", 0x2000, ACodecStatus_Working, {AFMT_FLOAT32, AFMT_S16_LE} },
{ "liba52", "liba52", 0x20736D, ACodecStatus_Working, {AFMT_FLOAT32, AFMT_S16_LE} },
@@ -61,56 +53,47 @@
{ NULL, NULL, 0x0, ACodecStatus_NotWorking, {AFMT_S8}}
};
-static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) {
- unsigned i;
- for(i=0;probes[i].driver;i++)
- if(wtag==probes[i].wtag)
- return &probes[i];
- return NULL;
-}
-
-int a52_fillbuff(a52_private_t& priv,float& pts){
+int a52_decoder::fillbuffer(float& pts){
int length=0;
int flags=0;
int sample_rate=0;
int bit_rate=0;
float apts=0.,null_pts;
- sh_audio_t* sh_audio = priv.sh;
- sh_audio->a_in_buffer_len=0;
+ sh.a_in_buffer_len=0;
/* sync frame:*/
while(1){
- while(sh_audio->a_in_buffer_len<8){
- int c=demux_getc_r(*sh_audio->ds,apts?null_pts:apts);
- if(c<0) { priv.last_pts=pts=apts; return -1; } /* EOF*/
- sh_audio->a_in_buffer[sh_audio->a_in_buffer_len++]=c;
+ while(sh.a_in_buffer_len<8){
+ int c=demux_getc_r(*sh.ds,apts?null_pts:apts);
+ if(c<0) { last_pts=pts=apts; return -1; } /* EOF*/
+ sh.a_in_buffer[sh.a_in_buffer_len++]=c;
}
- if(sh_audio->wtag!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8);
- length = a52_syncinfo ((uint8_t*)sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate);
+ if(sh.wtag!=0x2000) swab(sh.a_in_buffer,sh.a_in_buffer,8);
+ length = a52_syncinfo ((uint8_t*)sh.a_in_buffer, &flags, &sample_rate, &bit_rate);
if(length>=7 && length<=MAX_AC3_FRAME) break; /* we're done.*/
/* bad file => resync*/
- if(sh_audio->wtag!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8);
- memmove(sh_audio->a_in_buffer,sh_audio->a_in_buffer+1,7);
- --sh_audio->a_in_buffer_len;
+ if(sh.wtag!=0x2000) swab(sh.a_in_buffer,sh.a_in_buffer,8);
+ memmove(sh.a_in_buffer,sh.a_in_buffer+1,7);
+ --sh.a_in_buffer_len;
apts=0;
}
- MSG_DBG2("a52: len=%d flags=0x%X %d Hz %d bit/s\n",length,flags,sample_rate,bit_rate);
- sh_audio->rate=sample_rate;
- sh_audio->i_bps=bit_rate/8;
- demux_read_data_r(*sh_audio->ds,(uint8_t*)sh_audio->a_in_buffer+8,length-8,apts?null_pts:apts);
- if(sh_audio->wtag!=0x2000) swab(sh_audio->a_in_buffer+8,sh_audio->a_in_buffer+8,length-8);
- priv.last_pts=pts=apts;
- if(crc16_block((uint8_t*)sh_audio->a_in_buffer+2,length-2)!=0)
- MSG_STATUS("a52: CRC check failed! \n");
+ mpxp_dbg2<<"a52: len="<<length<<" flags=0x"<<std::hex<<flags<<" "<<sample_rate<<" Hz "<<bit_rate<<" bit/s"<<std::endl;
+ sh.rate=sample_rate;
+ sh.i_bps=bit_rate/8;
+ demux_read_data_r(*sh.ds,(uint8_t*)sh.a_in_buffer+8,length-8,apts?null_pts:apts);
+ if(sh.wtag!=0x2000) swab(sh.a_in_buffer+8,sh.a_in_buffer+8,length-8);
+ last_pts=pts=apts;
+ if(crc16_block((uint8_t*)sh.a_in_buffer+2,length-2)!=0)
+ mpxp_status<<"a52: CRC check failed!"<<std::endl;
return length;
}
/* returns: number of available channels*/
-static int a52_printinfo(sh_audio_t *sh_audio){
+int a52_decoder::printinfo() const {
int flags, sample_rate, bit_rate;
const char* mode="unknown";
int channels=0;
- a52_syncinfo ((uint8_t*)sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate);
+ a52_syncinfo ((uint8_t*)sh.a_in_buffer, &flags, &sample_rate, &bit_rate);
switch(flags&A52_CHANNEL_MASK){
case A52_CHANNEL: mode="channel"; channels=2; break;
case A52_MONO: mode="mono"; channels=1; break;
@@ -124,20 +107,22 @@
case A52_CHANNEL2: mode="channel2"; channels=2; break;
case A52_DOLBY: mode="dolby"; channels=2; break;
}
- MSG_INFO("AC3: %d.%d (%s%s) %d Hz %3.1f kbit/s Out: %u-bit\n",
- channels, (flags&A52_LFE)?1:0,
- mode, (flags&A52_LFE)?"+lfe":"",
- sample_rate, bit_rate*0.001f,
- afmt2bps(sh_audio->afmt)*8);
- return (flags&A52_LFE) ? (channels+1) : channels;
+ mpxp_info<<"AC3: "<<channels<<"."<<((flags&A52_LFE)?1:0)<<" ("<<mode<<((flags&A52_LFE)?"+lfe":"")<<") "<<sample_rate<<" Hz "<<(bit_rate*0.001f)<<"f kbit/s Out: "<<(afmt2bps(sh.afmt)*8)<<"-bit"<<std::endl;
+ return (flags&A52_LFE) ? (channels+1) : channels;
}
-Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh,audio_filter_info_t& afi)
+a52_decoder::a52_decoder(sh_audio_t& _sh,audio_filter_info_t& afi,uint32_t wtag)
+ :Audio_Decoder(_sh,afi,wtag)
+ ,sh(_sh)
{
- UNUSED(probe);
- a52_private_t* ctx=new(zeromem) a52_private_t;
- /* Dolby AC3 audio: */
- /* however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */
+ unsigned i;
+ for(i=0;probes[i].driver;i++)
+ if(wtag==probes[i].wtag)
+ probe=&probes[i];
+ if(!probe) throw bad_format_exception();
+
+ /* Dolby AC3 audio: */
+ /* however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */
#ifdef WORDS_BIGENDIAN
#define A52_FMT32 AFMT_S32_BE
#define A52_FMT24 AFMT_S24_BE
@@ -145,41 +130,26 @@
#define A52_FMT32 AFMT_S32_LE
#define A52_FMT24 AFMT_S24_LE
#endif
- sh->afmt=bps2afmt(2);
- if(af_query_fmt(afi.afilter,mpaf_format_e(AFMT_FLOAT32)) == MPXP_Ok||
- af_query_fmt(afi.afilter,mpaf_format_e(A52_FMT32)) == MPXP_Ok ||
- af_query_fmt(afi.afilter,mpaf_format_e(A52_FMT24)) == MPXP_Ok) {
- sh->afmt=AFMT_FLOAT32;
- }
- sh->audio_out_minsize=mp_conf.ao_channels*afmt2bps(sh->afmt)*256*6;
- sh->audio_in_minsize=MAX_AC3_FRAME;
- ctx->sh=sh;
- return ctx;
-}
+ sh.afmt=bps2afmt(2);
+ if(af_query_fmt(afi.afilter,mpaf_format_e(AFMT_FLOAT32)) == MPXP_Ok||
+ af_query_fmt(afi.afilter,mpaf_format_e(A52_FMT32)) == MPXP_Ok ||
+ af_query_fmt(afi.afilter,mpaf_format_e(A52_FMT24)) == MPXP_Ok) sh.afmt=AFMT_FLOAT32;
+ sh.audio_out_minsize=mp_conf.ao_channels*afmt2bps(sh.afmt)*256*6;
+ sh.audio_in_minsize=MAX_AC3_FRAME;
-MPXP_Rc init(Opaque& ctx)
-{
- a52_private_t& priv=static_cast<a52_private_t&>(ctx);
- sh_audio_t* sh_audio = priv.sh;
sample_t level=1, bias=384;
float pts;
int flags=0;
/* Dolby AC3 audio:*/
mpxp_a52_accel = mpxp_context().mplayer_accel;
mpxp_a52_state=a52_init (mpxp_a52_accel);
- if (mpxp_a52_state == NULL) {
- MSG_ERR("A52 init failed\n");
- return MPXP_False;
- }
- if(a52_fillbuff(priv,pts)<0){
- MSG_ERR("A52 sync failed\n");
- return MPXP_False;
- }
+ if (mpxp_a52_state == NULL) throw bad_format_exception();
+ if(fillbuffer(pts)<0) throw bad_format_exception();
/* 'a52 cannot upmix' hotfix:*/
- a52_printinfo(priv.sh);
- sh_audio->nch=mp_conf.ao_channels;
- while(sh_audio->nch>0){
- switch(sh_audio->nch){
+ printinfo();
+ sh.nch=mp_conf.ao_channels;
+ while(sh.nch>0){
+ switch(sh.nch){
case 1: mpxp_a52_flags=A52_MONO; break;
/* case 2: mpxp_a52_flags=A52_STEREO; break; */
case 2: mpxp_a52_flags=A52_DOLBY; break;
@@ -191,41 +161,34 @@
}
/* test:*/
flags=mpxp_a52_flags|A52_ADJUST_LEVEL;
- MSG_V("A52 flags before a52_frame: 0x%X\n",flags);
- if (a52_frame (mpxp_a52_state, (uint8_t*)sh_audio->a_in_buffer, &flags, &level, bias)){
- MSG_ERR("a52: error decoding frame -> nosound\n");
- return MPXP_False;
- }
- MSG_V("A52 flags after a52_frame: 0x%X\n",flags);
+ mpxp_v<<"A52 flags before a52_frame: 0x"<<std::hex<<flags<<std::endl;
+ if (a52_frame (mpxp_a52_state, (uint8_t*)sh.a_in_buffer, &flags, &level, bias)) throw bad_format_exception();
+ mpxp_v<<"A52 flags after a52_frame: 0x"<<std::hex<<flags<<std::endl;
/* frame decoded, let's init resampler:*/
- if(afmt2bps(sh_audio->afmt)==4) {
- if(a52_resample_init_float(mpxp_a52_state,mpxp_a52_accel,flags,sh_audio->nch)) break;
+ if(afmt2bps(sh.afmt)==4) {
+ if(a52_resample_init_float(mpxp_a52_state,mpxp_a52_accel,flags,sh.nch)) break;
} else {
- if(a52_resample_init(mpxp_a52_state,mpxp_a52_accel,flags,sh_audio->nch)) break;
+ if(a52_resample_init(mpxp_a52_state,mpxp_a52_accel,flags,sh.nch)) break;
}
- --sh_audio->nch; /* try to decrease no. of channels*/
+ --sh.nch; /* try to decrease no. of channels*/
}
- if(sh_audio->nch<=0){
- MSG_ERR("a52: no resampler. try different channel setup!\n");
- return MPXP_False;
- }
- return MPXP_Ok;
+ if(sh.nch<=0) throw bad_format_exception();
}
-void uninit(Opaque& ctx) { UNUSED(ctx); }
+a52_decoder::~a52_decoder() {}
-MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...)
+audio_probe_t a52_decoder::get_probe_information() const { return *probe; }
+
+MPXP_Rc a52_decoder::ctrl(int cmd,any_t* arg)
{
- a52_private_t& priv=static_cast<a52_private_t&>(ctx);
- sh_audio_t* sh = priv.sh;
UNUSED(arg);
switch(cmd) {
case ADCTRL_RESYNC_STREAM:
- sh->a_in_buffer_len=0; // reset ACM/DShow audio buffer
+ sh.a_in_buffer_len=0; // reset ACM/DShow audio buffer
return MPXP_True;
case ADCTRL_SKIP_FRAME: {
float pts;
- a52_fillbuff(priv,pts); // skip AC3 frame
+ fillbuffer(pts); // skip AC3 frame
return MPXP_True;
}
default:
@@ -234,35 +197,50 @@
return MPXP_Unknown;
}
-unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts)
+unsigned a52_decoder::run(unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts)
{
- a52_private_t& priv=static_cast<a52_private_t&>(ctx);
- sh_audio_t* sh_audio = priv.sh;
sample_t level=1, bias=384;
int flags=mpxp_a52_flags|A52_ADJUST_LEVEL;
unsigned i;
unsigned len=0;
UNUSED(minlen);
UNUSED(maxlen);
- if(!sh_audio->a_in_buffer_len) {
- if(a52_fillbuff(priv,pts)<0) return len; /* EOF */
- } else pts=priv.last_pts;
- sh_audio->a_in_buffer_len=0;
- if (a52_frame (mpxp_a52_state, (uint8_t*)sh_audio->a_in_buffer, &flags, &level, bias)){
- MSG_WARN("a52: error decoding frame\n");
+ if(!sh.a_in_buffer_len) {
+ if(fillbuffer(pts)<0) return len; /* EOF */
+ } else pts=last_pts;
+ sh.a_in_buffer_len=0;
+ if (a52_frame (mpxp_a52_state, (uint8_t*)sh.a_in_buffer, &flags, &level, bias)){
+ mpxp_warn<<"a52: error decoding frame"<<std::endl;
return len;
}
// a52_dynrng(&mpxp_a52_state, NULL, NULL);
len=0;
for (i = 0; i < 6; i++) {
if (a52_block (mpxp_a52_state)){
- MSG_WARN("a52: error at resampling\n");
+ mpxp_warn<<"a52: error at resampling"<<std::endl;
break;
}
- if(afmt2bps(sh_audio->afmt)==4)
+ if(afmt2bps(sh.afmt)==4)
len+=4*a52_resample32(a52_samples(mpxp_a52_state),(float *)&buf[len]);
else
len+=2*a52_resample(a52_samples(mpxp_a52_state),(int16_t *)&buf[len]);
}
return len;
}
+
+static const mpxp_option_t options[] = {
+ { NULL, NULL, 0, 0, 0, 0, NULL}
+};
+
+static Audio_Decoder* query_interface(sh_audio_t& sh,audio_filter_info_t& afi,uint32_t wtag) { return new(zeromem) a52_decoder(sh,afi,wtag); }
+
+extern const ad_info_t ad_a52_info = {
+ "liba52 AC3 driver",
+ "liba52",
+ "Nickols_K",
+ "build-in",
+ query_interface,
+ options
+};
+
+} // namespace usr
\ No newline at end of file
Modified: mplayerxp/libmpcodecs/ad_dca.cpp
===================================================================
--- mplayerxp/libmpcodecs/ad_dca.cpp 2013-06-10 07:27:20 UTC (rev 650)
+++ mplayerxp/libmpcodecs/ad_dca.cpp 2013-06-11 14:37:50 UTC (rev 651)
@@ -22,35 +22,29 @@
#include "libao3/audio_out.h"
#include "postproc/af.h"
-static const unsigned MAX_AC5_FRAME=4096;
+namespace usr {
+ class dca_decoder : public Audio_Decoder {
+ public:
+ dca_decoder(sh_audio_t&,audio_filter_info_t&,uint32_t wtag);
+ virtual ~dca_decoder();
-dca_state_t* mpxp_dca_state;
-uint32_t mpxp_dca_accel=0;
-uint32_t mpxp_dca_flags=0;
+ virtual unsigned run(unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts);
+ virtual MPXP_Rc ctrl(int cmd,any_t* arg);
+ virtual audio_probe_t get_probe_information() const;
+ private:
+ int fillbuffer(float& pts);
+ int printinfo() const;
-struct dca_private_t : public Opaque {
- dca_private_t();
- virtual ~dca_private_t();
+ float last_pts;
+ sh_audio_t& sh;
+ const audio_probe_t*probe;
- float last_pts;
- sh_audio_t* sh;
-};
-dca_private_t::dca_private_t() {}
-dca_private_t::~dca_private_t() {}
+ dca_state_t* mpxp_dca_state;
+ uint32_t mpxp_dca_accel;
+ uint32_t mpxp_dca_flags;
+ static const unsigned MAX_AC5_FRAME=4096;
+ };
-static const ad_info_t info = {
- "DTS Coherent Acoustics",
- "libdca",
- "Nickols_K",
- "build-in"
-};
-
-static const mpxp_option_t options[] = {
- { NULL, NULL, 0, 0, 0, 0, NULL}
-};
-
-LIBAD_EXTERN(dca)
-
static const audio_probe_t probes[] = {
{ "libdca", "libdca", 0x86, ACodecStatus_Working, {AFMT_FLOAT32, AFMT_S24_LE, AFMT_S16_LE} },
{ "libdca", "libdca", 0x2001, ACodecStatus_Working, {AFMT_FLOAT32, AFMT_S24_LE, AFMT_S16_LE} },
@@ -63,51 +57,42 @@
{ NULL, NULL, 0x0, ACodecStatus_NotWorking, {AFMT_S8}}
};
-static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) {
- unsigned i;
- for(i=0;probes[i].driver;i++)
- if(wtag==probes[i].wtag)
- return &probes[i];
- return NULL;
-}
-
-int dca_fillbuff(dca_private_t& priv,float& pts){
+int dca_decoder::fillbuffer(float& pts){
int length=0,flen=0;
int flags=0;
int sample_rate=0;
int bit_rate=0;
float apts=0.,null_pts;
- sh_audio_t* sh_audio=priv.sh;
- sh_audio->a_in_buffer_len=0;
+ sh.a_in_buffer_len=0;
/* sync frame:*/
while(1){
- while(sh_audio->a_in_buffer_len<16){
- int c=demux_getc_r(*sh_audio->ds,apts?null_pts:apts);
- if(c<0) { priv.last_pts=pts=apts; return -1; } /* EOF*/
- sh_audio->a_in_buffer[sh_audio->a_in_buffer_len++]=c;
+ while(sh.a_in_buffer_len<16){
+ int c=demux_getc_r(*sh.ds,apts?null_pts:apts);
+ if(c<0) { last_pts=pts=apts; return -1; } /* EOF*/
+ sh.a_in_buffer[sh.a_in_buffer_len++]=c;
}
- length = dca_syncinfo (mpxp_dca_state,reinterpret_cast<uint8_t*>(sh_audio->a_in_buffer), reinterpret_cast<int *>(&flags), &sample_rate, &bit_rate, &flen);
- if(length>=16 && length<=MAX_AC5_FRAME) break; /* we're done.*/
+ length = dca_syncinfo (mpxp_dca_state,reinterpret_cast<uint8_t*>(sh.a_in_buffer), reinterpret_cast<int *>(&flags), &sample_rate, &bit_rate, &flen);
+ if(length>=16 && length<=int(MAX_AC5_FRAME)) break; /* we're done.*/
/* bad file => resync*/
- memmove(sh_audio->a_in_buffer,sh_audio->a_in_buffer+1,15);
- --sh_audio->a_in_buffer_len;
+ memmove(sh.a_in_buffer,sh.a_in_buffer+1,15);
+ --sh.a_in_buffer_len;
apts=0;
}
- MSG_DBG2("dca[%08X]: len=%d flags=0x%X %d Hz %d bit/s frame=%u\n",*((long *)sh_audio->a_in_buffer),length,flags,sample_rate,bit_rate,flen);
- sh_audio->rate=sample_rate;
- sh_audio->i_bps=bit_rate/8;
- demux_read_data_r(*sh_audio->ds,reinterpret_cast<unsigned char*>(sh_audio->a_in_buffer+16),length-16,apts?null_pts:apts);
- priv.last_pts=pts=apts;
+ mpxp_dbg2<<"dca["<<std::hex<<std::setfill('0')<<std::setw(8)<<(*((long *)sh.a_in_buffer))<<"]: len="<<length<<" flags=0x"<<std::hex<<flags<<" "<<sample_rate<<" Hz "<<bit_rate<<" bit/s frame="<<flen<<std::endl;
+ sh.rate=sample_rate;
+ sh.i_bps=bit_rate/8;
+ demux_read_data_r(*sh.ds,reinterpret_cast<unsigned char*>(sh.a_in_buffer+16),length-16,apts?null_pts:apts);
+ last_pts=pts=apts;
return length;
}
/* returns: number of available channels*/
-static int dca_printinfo(sh_audio_t *sh_audio){
- int flags, sample_rate, bit_rate,flen,length;
+int dca_decoder::printinfo() const {
+ int flags, sample_rate, bit_rate,flen;
const char* mode="unknown";
int channels=0;
- length=dca_syncinfo (mpxp_dca_state,reinterpret_cast<uint8_t*>(sh_audio->a_in_buffer), reinterpret_cast<int*>(&flags), &sample_rate, &bit_rate,&flen);
+ dca_syncinfo (mpxp_dca_state,reinterpret_cast<uint8_t*>(sh.a_in_buffer), reinterpret_cast<int*>(&flags), &sample_rate, &bit_rate,&flen);
switch(flags&DCA_CHANNEL_MASK){
case DCA_CHANNEL: mode="channel"; channels=2; break;
case DCA_MONO: mode="mono"; channels=1; break;
@@ -121,17 +106,19 @@
case DCA_DOLBY: mode="dolby"; channels=2; break;
default: channels=0; break;
}
- MSG_INFO("DCA: %d.%d (%s%s) %d Hz %3.1f kbit/s Out: %u-bit\n",
- channels, (flags&DCA_LFE)?1:0,
- mode, (flags&DCA_LFE)?"+lfe":"",
- sample_rate, bit_rate*0.001f,
- afmt2bps(sh_audio->afmt)*8);
+ mpxp_info<<"DCA: "<<channels<<"."<<((flags&DCA_LFE)?1:0)<<" ("<<mode<<((flags&DCA_LFE)?"+lfe":"")<<") "<<sample_rate<<" Hz "<<bit_rate*0.001f<<" kbit/s Out: "<<(afmt2bps(sh.afmt)*8)<<"-bit"<<std::endl;
return (flags&DCA_LFE) ? (channels+1) : channels;
}
-Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh,audio_filter_info_t& afi)
+dca_decoder::dca_decoder(sh_audio_t& _sh,audio_filter_info_t& afi,uint32_t wtag)
+ :Audio_Decoder(_sh,afi,wtag)
+ ,sh(_sh)
{
- UNUSED(probe);
+ unsigned i;
+ for(i=0;probes[i].driver;i++)
+ if(wtag==probes[i].wtag)
+ probe=&probes[i];
+ if(!probe) throw bad_format_exception();
/* DTS audio:
however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */
#ifdef WORDS_BIGENDIAN
@@ -141,43 +128,29 @@
#define DCA_FMT32 AFMT_S32_LE
#define DCA_FMT24 AFMT_S24_LE
#endif
- sh->afmt=bps2afmt(2);
+ sh.afmt=bps2afmt(2);
if( af_query_fmt(afi.afilter,afmt2mpaf(AFMT_FLOAT32)) == MPXP_Ok||
af_query_fmt(afi.afilter,afmt2mpaf(DCA_FMT32)) == MPXP_Ok ||
- af_query_fmt(afi.afilter,afmt2mpaf(DCA_FMT24)) == MPXP_Ok)
- {
- sh->afmt=AFMT_FLOAT32;
+ af_query_fmt(afi.afilter,afmt2mpaf(DCA_FMT24)) == MPXP_Ok) {
+ sh.afmt=AFMT_FLOAT32;
}
- sh->audio_out_minsize=mp_conf.ao_channels*afmt2bps(sh->afmt)*256*8;
- sh->audio_in_minsize=MAX_AC5_FRAME;
- dca_private_t* priv = new(zeromem) dca_private_t;
- priv->sh = sh;
- return priv;
-}
+ sh.audio_out_minsize=mp_conf.ao_channels*afmt2bps(sh.afmt)*256*8;
+ sh.audio_in_minsize=MAX_AC5_FRAME;
-MPXP_Rc init(Opaque& ctx)
-{
- dca_private_t& priv=static_cast<dca_private_t&>(ctx);
- sh_audio_t* sh_audio = priv.sh;
sample_t level=1, bias=384;
float pts;
int flags=0;
/* Dolby AC3 audio:*/
mpxp_dca_accel = mpxp_context().mplayer_accel;
mpxp_dca_state = dca_init(mpxp_dca_accel);
- if (mpxp_dca_state == NULL) {
- MSG_ERR("dca init failed\n");
- return MPXP_False;
- }
- if(dca_fillbuff(priv,pts)<0){
- MSG_ERR("dca sync failed\n");
- return MPXP_False;
- }
+ if (mpxp_dca_state == NULL) throw bad_format_exception();
+ if(fillbuffer(pts)<0) throw bad_format_exception();
+
/* 'dca cannot upmix' hotfix:*/
- dca_printinfo(sh_audio);
- sh_audio->nch=mp_conf.ao_channels;
- while(sh_audio->nch>0){
- switch(sh_audio->nch){
+ printinfo();
+ sh.nch=mp_conf.ao_channels;
+ while(sh.nch>0){
+ switch(sh.nch){
case 1: mpxp_dca_flags=DCA_MONO; break;
case 2: mpxp_dca_flags=DCA_STEREO; break;
/* case 2: mpxp_dca_flags=DCA_DOLBY; break; */
@@ -189,40 +162,34 @@
}
/* test:*/
flags=mpxp_dca_flags|DCA_ADJUST_LEVEL;
- MSG_V("dca flags before dca_frame: 0x%X\n",flags);
- if (dca_frame (mpxp_dca_state, reinterpret_cast<uint8_t*>(sh_audio->a_in_buffer), reinterpret_cast<int*>(&flags), &level, bias)){
- MSG_ERR("dca: error decoding frame -> nosound\n");
- return MPXP_False;
- }
- MSG_V("dca flags after dca_frame: 0x%X\n",flags);
- if(afmt2bps(sh_audio->afmt)==4) {
- if(dca_resample_init_float(mpxp_dca_state,mpxp_dca_accel,flags,sh_audio->nch)) break;
+ mpxp_v<<"dca flags before dca_frame: 0x"<<std::hex<<flags<<std::endl;
+ if (dca_frame (mpxp_dca_state, reinterpret_cast<uint8_t*>(sh.a_in_buffer), reinterpret_cast<int*>(&flag...
[truncated message content] |