summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tvi_v4l2: let libv4l2 convert to a known pixel formatbugmen0t2013-11-132-47/+77
| | | | | | | | | | | Signed-off-by: wm4 <wm4@nowhere> Significant modifications over the original patch by not overriding syscalls with macros ("#define open v4l2open") for fallback, but the other way around ("#define v4l2open open"). As consequence, the calls have to be replaced throughout the file. Untested, although the original patch probably was tested.
* stream: don't include linux/types.h in some fileswm42013-11-133-4/+0
| | | | | | Apparently this is not portable to FreeBSD. It turns out that we (probably) don't use any symbols defined by this header directly, so the includes are not needed.
* m_option: handle audio/filter filters with old option parsingwm42013-11-131-3/+9
| | | | | | | | | These use the _oldargs_ hack, which failed in combination with playback resume. Make it work. It would be better to port all filters to new option parsing, but that's obviously too much work, and most filters will probably be deleted and replaced by libavfilter in the long run.
* ao_null: add untimed sub-optionwm42013-11-132-3/+24
|
* ao_null: support pausing properlywm42013-11-131-4/+14
| | | | | | ao_null should simulate a "perfect" AO, but framestepping behaved quite badly with it. Framstepping usually exposes problems with AOs dropping their buffers on pause, and that's what happened here.
* mf: silence compilation warningwm42013-11-132-3/+3
|
* ao_lavc: support non-interleaved audiowm42013-11-133-232/+42
|
* wayland: create xkbcommon keymap from stringAlexander Preisinger2013-11-131-2/+1
| | | | Fixes a problem where the passed size doesn't match the actuall string.
* Merge branch 'planar_audio'wm42013-11-1265-1489/+1549
|\ | | | | | | | | Conflicts: audio/out/ao_lavc.c
| * audio: add support for using non-interleaved audio from decoders directlywm42013-11-1210-495/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most libavcodec decoders output non-interleaved audio. Add direct support for this, and remove the hack that repacked non-interleaved audio back to packed audio. Remove the minlen argument from the decoder callback. Instead of forcing every decoder to have its own decode loop to fill the buffer until minlen is reached, leave this to the caller. So if a decoder doesn't return enough data, it's simply called again. (In future, I even want to change it so that decoders don't read packets directly, but instead the caller has to pass packets to the decoders. This fits well with this change, because now the decoder callback typically decodes at most one packet.) ad_mpg123.c receives some heavy refactoring. The main problem is that it wanted to handle format changes when there was no data in the decode output buffer yet. This sounds reasonable, but actually it would write data into a buffer prepared for old data, since the caller doesn't know about the format change yet. (I.e. the best place for a format change would be _after_ writing the last sample to the output buffer.) It's possible that this code was not perfectly sane before this commit, and perhaps lost one frame of data after a format change, but I didn't confirm this. Trying to fix this, I ended up rewriting the decoding and also the probing.
| * ad_mpg123: reduce ifdefferywm42013-11-122-50/+3
| | | | | | | | Drop support for anything before 1.14.0.
| * dec_audio: fix behavior on format changeswm42013-11-121-3/+1
| | | | | | | | | | Decoder overwrites parameters in sh_audio, but we still have old audio in the old format to filter.
| * mp_audio: use av_malloc (cargo cult for libav*)wm42013-11-122-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libav* is generally freaking horrible, and might do bad things if the data pointer passed to it are not aligned. One way to be sure that the alignment is correct is allocating all pointers using av_malloc(). It's possible that this is not needed at all, though. For now it might be better to keep this, since the mp_audio code is intended to replace another buffer in dec_audio.c, which is currently av_malloc() allocated. The original reason why this uses av_malloc() is apparently because libavcodec used to directly encode into mplayer buffers, which is not the case anymore, and thus (probably) doesn't make sense anymore. (The commit subject uses the word "cargo cult", after all.)
| * ao_jack: switch from interleaved to planar audioWilliam Light2013-11-121-95/+92
| |
| * ao_jack: refactoring, also fix "no-connect" optionWilliam Light2013-11-121-57/+97
| |
| * af_lavcac3enc: use planar formatswm42013-11-121-134/+82
| | | | | | | | | | | | | | | | | | | | | | Remove the awkward planarization. It had to be done because the AC3 encoder requires planar formats, but now we support them natively. Try to simplify buffer management with mp_audio_buffer. Improve checking for buffer overflows and out of bound writes. In theory, these shouldn't happen due to AC3 fixed frame sizes, but being paranoid is better.
| * af_lavcac3enc: simplify format negotiationwm42013-11-121-28/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | The format negotiation is the same, except don't confusingly copy the input format into af->data, just to overwrite it later. af->data should alwass contain the output format, and the existing code was just a very misguided use of the af_test_output() helper function. Just set af->data to the output format immediately, and modify the input format properly. Also, if format negotiation fails (and needs another iteration), don't initialize the libavcodec encoder.
| * audio/filter: fix mul/delay scale and valueswm42013-11-1229-56/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the af_instance->mul/delay values were in bytes. Using bytes is confusing for non-interleaved audio, so switch mul to samples, and delay to seconds. For delay, seconds are more intuitive than bytes or samples, because it's used for the latency calculation. We also might want to replace the delay mechanism with real PTS tracking inside the filter chain some time in the future, and PTS will also require time-adjustments to be done in seconds. For most filters, we just remove the redundant mul=1 initialization. (Setting this used to be required, but not anymore.)
| * ao_openal: support non-interleaved outputwm42013-11-121-18/+11
| | | | | | | | | | | | Since ao_openal simulates multi-channel audio by placing a bunch of mono-sources in 3D space, non-interleaved audio is a perfect match for it. We just have to remove the interleaving code.
| * ao_alsa: support non-interleaved audiowm42013-11-121-25/+23
| | | | | | | | | | | | | | | | ALSA supports non-interleaved audio natively using a separate API function for writing audio. (Though you have to tell it about this on initialization.) ALSA doesn't have separate sample formats for this, so just pretend to negotiate the interleaved format, and assume that all non-interleaved formats have an interleaved companion format.
| * ao_null: support non-interleaved audiowm42013-11-121-17/+20
| | | | | | | | Simply change internals from using byte counts to sample counts.
| * audio: switch output to mp_audio_bufferwm42013-11-126-113/+112
| | | | | | | | | | | | Replace the code that used a single buffer with mp_audio_buffer. This also enables non-interleaved output operation, although it's still disabled, and no AO supports it yet.
| * audio: add mp_audio_bufferwm42013-11-123-0/+197
| | | | | | | | | | | | Implementation wise, this could be much improved, such as using a ringbuffer that doesn't require copying data all the time. This is why we don't use mp_audio directly instead of mp_audio_buffer.
| * audio/out: prepare for non-interleaved audiowm42013-11-1217-85/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This comes with two internal AO API changes: 1. ao_driver.play now can take non-interleaved audio. For this purpose, the data pointer is changed to void **data, where data[0] corresponds to the pointer in the old API. Also, the len argument as well as the return value are now in samples, not bytes. "Sample" in this context means the unit of the smallest possible audio frame, i.e. sample_size * channels. 2. ao_driver.get_space now returns samples instead of bytes. (Similar to the play function.) Change all AOs to use the new API. The AO API as exposed to the rest of the player still uses the old API. It's emulated in ao.c. This is purely to split the commits changing all AOs and the commits adding actual support for outputting N-I audio.
| * af: don't require filters to allocate af_instance->data, redo bufferswm42013-11-1227-211/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | Allocate af_instance->data in generic code before filter initialization. Every filter needs af->data (since it contains the output configuration), so there's no reason why every filter should allocate and free it. Remove RESIZE_LOCAL_BUFFER(), and replace it with mp_audio_realloc_min(). Interestingly, most code becomes simpler, because the new function takes the size in samples, and not in bytes. There are larger change in af_scaletempo.c and af_lavcac3enc.c, because these had copied and modified versions of the RESIZE_LOCAL_BUFFER macro/function.
| * af_lavfi: add support for non-interleaved audiowm42013-11-121-30/+24
| |
| * af_volume: add support for non-interleaved audiowm42013-11-121-16/+25
| |
| * af_lavrresample: add support for non-interleaved audiowm42013-11-121-27/+45
| |
| * audio/out: reject non-interleaved formatswm42013-11-1213-1/+25
| | | | | | | | | | | | | | | | | | | | No AO can handle these, so it would be a problem if they get added later, and non-interleaved formats get accepted erroneously. Let them gracefully fall back to other formats. Most AOs actually would fall back, but to an unrelated formats. This is covered by this commit too, and if possible they should pick the interleaved variant if a non-interleaved format is requested.
| * audio/filter: prepare filter chain for non-interleaved audiowm42013-11-1228-177/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on earlier work by Stefano Pigozzi. There are 2 changes: 1. Instead of mp_audio.audio, mp_audio.planes[0] must be used. 2. mp_audio.len used to contain the size of the audio in bytes. Now mp_audio.samples must be used. (Where 1 sample is the smallest unit of audio that covers all channels.) Also, some filters need changes to reject non-interleaved formats properly. Nothing uses the non-interleaved features yet, but this is needed so that things don't just break when doing so.
| * audio/format: add non-interleaved audio formatswm42013-11-123-2/+75
| |
* | waylad: implement functionality for window-scalingAlexander Preisinger2013-11-121-0/+12
| |
* | demux: kill libmng supportwm42013-11-114-596/+0
| | | | | | | | It's a dead format that was never used anywhere.
* | demux_mf: use tallocwm42013-11-113-55/+30
| |
* | demux_mf: uncrustifywm42013-11-113-215/+213
| |
* | demux_mkv: support some raw PCM variantswm42013-11-114-26/+15
| | | | | | | | | | | | | | | | | | | | This affects 64 bit floats and big endian integer PCM variants (basically crap nobody uses). Possibly not all MS-muxed files work, but I couldn't get or produce any samples. Remove a bunch of format tags that are not needed anymore. Most of these were used by demux_mov, which is long gone. Repurpose/abuse 'twos' as mpv-internal tag for dealing with the PCM variants mentioned above.
* | ao_lavc: remove audio offset hack to ease supporting planar audio.Rudolf Polzer2013-11-111-66/+11
| | | | | | | | | | | | | | | | Now to shift audio pts when outputting to e.g. avi, you need an explicit facility to insert/remove initial samples, to avoid initial regions of the video to be sped up/slowed down. One such facility is the delay filter in libavfilter.
* | vo_lavc: fix -ovoffset.Rudolf Polzer2013-11-111-1/+3
|/ | | | Previously, using it led to no single frame being output, ever.
* ao: add ao_play_silence, use for ao_alsa and ao_osswm42013-11-106-13/+31
| | | | | Also add a corresponding function to audio/format.c, which fills an audio block with silence.
* af: don't skip filtering if there's no more audiowm42013-11-102-3/+5
| | | | | | | | | | | | | | My main problem with this is that the output format will be incorrect. (This doesn't matter right, because there are no samples output.) This assumes all audio filters can deal with len==0 passed in for filtering (though I wouldn't see why not). A filter can still signal an error by returning NULL. af_lavrresample has to be fixed, since resampling 0 samples makes libavresample fail and return a negative error code. (Even though it's not documented to return an error code!)
* vo_opengl: fix alpha values written to the framebufferwm42013-11-103-5/+16
| | | | | | | | | | | | | | | | | | | | | | | When blending OSD and subtitles onto the video, we write bogus alpha values. This doesn't normally matter, because these values are normally unused and discarded. But at least on Wayland, the alpha values are used by the compositor and leads to transparent windows even with opaque video on places where the OSD happens to use transparency. (Also see github issue #338.) Until now, the alpha basically contained garbage. The source factor GL_SRC_ALPHA meant that alpha was multiplied with itself. Use GL_ONE instead (which is why we have to use glBlendFuncSeparate()). This should give correct results, even with video that has alpha. (Or at least it's something close to correct, I haven't thought too hard how the compositor will blend it, and in fact I couldn't manage to test it.) If glBlendFuncSeparate() is not available, fall back to glBlendFunc(), which does the same as the code did before this commit. Technically, we support GL 1.1, but glBlendFuncSeparate is 1.4, and I guess we should try not to crash if vo_opengl_old runs on a system with GL 1.1 drivers only.
* ad_spdif: change API usage so that it works on Libavwm42013-11-101-3/+9
| | | | | | | | | | | Apparently we were using FFmpeg-specific APIs. I have no idea whether this code is correct on both FFmpeg and Libav (no examples, bad doxygen... why do they even complaint aht people are using their APIs incorrectly?), but it appears to work on FFmpeg. That was also the case before commit ebc4ccb though, where it used internal libavformat symbols. Untested on Libav, Travis will tell us.
* player: set PulseAudio stream title to window titlewm42013-11-107-10/+39
| | | | | | | Set the PulseAudio stream title, just like the VO window title is set. Refactor update_vo_window_title() so that we can use it for AOs too. The ao_pulse.c bit is stolen from MPlayer.
* gl_hwdec_vdpau: silence warning caused by buggy GL_NV_vdpau_interop specwm42013-11-091-2/+6
| | | | | VDPAU handles are integers, but for some reasons the VDPAU GL extension expects them as void*.
* af_volume: use only one volume setting for all channelswm42013-11-092-34/+22
| | | | | | | | In theory, af_volume could use separate volume levels for each channel. But this was never used anywhere. MPlayer implemented something similar before (svn r36498), but kept the old path for some reason.
* ao_alsa: use correct magic spdif flagswm42013-11-091-14/+11
| | | | | I accidentally copied the AES4/ORIGFS constants from the ALSA headers, instead of the AES3/FS ones. The difference is probably important.
* Remove sh_audio->samplesizewm42013-11-099-25/+9
| | | | | | | | | This member was redundant. sh_audio->sample_format indicates the sample size already. The TV code is a bit strange: the redundant sample size was part of the internal TV interface. Assume it's really redundant and not something else. The PCM decoder ignores the sample size anyway.
* af_scaletempo: uncrustifywm42013-11-091-404/+388
| | | | | | | | | Also do some cosmetic changes, like merging definition and initialization of local variables. Remove an annoying debug mp_msg() from af_open(). It just printed the command line parameters; if this is really needed, it could be added to af.c instead (similar as to what vf.c does).
* af_lavrresample: reconfigure libavresample only on successful initwm42013-11-091-7/+6
| | | | | If filter initialization fails anyway, we don't need to reconfigure libavresample.
* af_lavrresample: move libavresample setup to separate functionwm42013-11-091-90/+98
| | | | | | | Helps with readability. Also remove the ctx_opt_set_* helper macros and use av_opt_set_* directly (I think these macros were used because the lines ended up too long, but this commit removes two indentation levels, giving more space).
* af_convert24: fix complicated and incorrect format negotiationwm42013-11-091-9/+4
| | | | | The conversion works for native endian only. The correct check lists supported format combination explicitly, but is also much simpler.
* af_surround: fix format negotiationwm42013-11-091-12/+9
| | | | This did strange things; perhaps caused by the channel layout changes.
* af: allow filters to return AF_OK, even if format doesn't matchwm42013-11-091-0/+2
| | | | | | | This should allow to make format negotiation much simpler, since it takes the responsibility to compare actual input and accepted input formats from the filters. It's also backwards compatible. Filters which have expensive initialization still can use the old method.
* ao: print requested audio format on initwm42013-11-093-6/+4
| | | | Also remove the rather bad/incomplete log calls from ao_alsa and ao_oss.
* ao_alsa: add magic spdif parameterswm42013-11-091-1/+25
| | | | | | | | | | | | | | I have no idea what these do, but apparently they are needed to inform ALSA about spdif configuration. First, replace the literal constant "6" for the AES0 parameter with the symbolic constants from the ALSA headers (the final value is the same). Second, copy paste some funky looking parameter setup from VLC's alsa output for setting the AES1, AES2, AES3 parameters. (The code is actually not literally copy-pasted, but does exactly the same.) My small but non-zero hope is that this could make DTS-HD work, or at least work into that direction. I can't test spdif stuff though, and for DTS-HD not even opening the ALSA device succeeds on my system.
* ao_alsa: redo the way parameters are added in the spdif casewm42013-11-091-38/+24
| | | | | | | | | | | Using spdif with alsa requires adding magic parameters to the device name, and the existing code tried to deal with the situation when the user wanted to add parameters too. Rewrite this code, in particular remove the duplicated parameter string as preparation for the next commit. The new code is a bit stricter, e.g. it doesn't skip space