aboutsummaryrefslogtreecommitdiffhomepage
path: root/audio/out/ao_coreaudio.c
Commit message (Collapse)AuthorAge
...
* ao_coreaudio: change all ++var to var++Gravatar Stefano Pigozzi2013-07-22
| | | | | Luckily they all were inside for loops so the functionality does not actually change.
* ao_coreaudio: change private vars names to match mpv conventionsGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: remove packetSize private variableGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: refactor play/pauseGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: refactor uninitGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: remove a fixme since that seems fixedGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: ca_msg: add trailing \n where missingGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: refactor playGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: extract mixmode set/unset in utility functionsGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: move AudioStreamChangeFormat to common file and refactorGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: extract methods to lock/unlock device for digital outputGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: lpcm: remove buffer size calculation depending on audio unitGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: refactor initializationGravatar Stefano Pigozzi2013-07-22
| | | | | | | | | | | | | The initialization is split more clearly between compressed and lpcm case. For the compressed case, format selection is simplified a lot and negotiation removed. The way it was written it just passed back to the core the original requested format, not what was found available on hardware. Since this is most likely useless for the compressed case, I didn't bother with this. In the future I'd like to split this AO in two one that only uses the AUHAL and the other with direct access to the hardware so that even passthrough of lcpm can be possible. This would decrease the latency, audiophiles would like that.
* ao_coreaudio: refactor print_helpGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: split out some utility functions and refactor themGravatar Stefano Pigozzi2013-07-22
| | | | | | | Split out some utility functions that use the CoreAudio API but are not related the main task of the AOs (which is to move data correctly to the ringbuffer). These are mainly need for the verbosity of the CoreAudio API and are just obscuring the 'real' code.
* ao_coreaudio: make variable names shorterGravatar Stefano Pigozzi2013-07-22
| | | | property_address -> p_addr
* ao_coreaudio: add error check function and macroGravatar Stefano Pigozzi2013-07-22
| | | | WIP
* ao_coreaudio: dry up ca_msg and use it everywhereGravatar Stefano Pigozzi2013-07-22
| | | | | Change the ca_msg macro to pass along MSGT_AO automatically. Also use it for every output for consistency.
* ao_coreaudio: simplify digital render callbackGravatar Stefano Pigozzi2013-07-22
| | | | | It was reported that it also works by not setting the read size in the AudioBuffer (now idea how, but I will discover it later).
* ao_coreaudio: rewrite spdif render callbackGravatar Stefano Pigozzi2013-07-22
|
* ao_coreaudio: simplify render callbackGravatar Stefano Pigozzi2013-07-22
| | | | | | | Read only the requested amount by the AUHAL (instead of all the buffered data). No idea what the deal is with pausing the audio units if there is no audio to play, maybe to avoid underruns of some sort. Anyway from my tests this condition never occurred so I'm removing it all.
* audio/out: remove ao->outburst/buffersize fieldsGravatar wm42013-06-16
| | | | | | | | | | | | | | | The core didn't use these fields, and use of them was inconsistent accross AOs. Some didn't use them at all. Some only set them; the values were completely unused by the core. Some made full use of them. Remove these fields. In places where they are still needed, make them private AO state. Remove the --abs option. It set the buffer size for ao_oss and ao_dsound (being ignored by all other AOs), and was already marked as obsolete. If it turns out that it's still needed for ao_oss or ao_dsound, their default buffer sizes could be adjusted, and if even that doesn't help, AO suboptions could be added in these cases.
* audio: fix af_fmt_seconds_to_bytesGravatar Stefano Pigozzi2013-06-16
| | | | Was missing samplerate
* core: add a spsc ringbuffer implementationGravatar Stefano Pigozzi2013-06-16
| | | | | | | | | | | | | | | | | Currently every single AO was implementing it's own ringbuffer, many times with slightly different semantics. This is an attempt to fix the problem. I stole some good ideas from ao_portaudio's ringbuffer and went from there. The main difference is this one stores wpos and rpos which are absolute positions in an "infinite" buffer. To find the actual position for writing / reading just apply modulo size. The producer only modifies wpos while the consumer only modifies rpos. This makes it pretty easy to reason about and make the operations thread safe by using barriers (thread safety is guaranteed only in the Single-Producer/Single- Consumer case). Also adapted ao_coreaudio to use this ringbuffer.
* ao_coreaudio: fix output with spdifGravatar Stefano Pigozzi2013-06-16
| | | | The mute condition was inverted...
* ao_coreaudio: split ringbuffer in it's own fileGravatar Stefano Pigozzi2013-06-16
| | | | | | | | | This is hopefully the start of something good. ca_ringbuffer_read and ca_ringbuffer_write can probably cleaned up from all the NULL checks once ao_coreaudio.c gets simplyfied. Conflicts: audio/out/ao_coreaudio.c
* ao_coreaudio: move to new libao APIGravatar Stefano Pigozzi2013-06-16
| | | | | This is just a first pass and the bare minimum to make it compile and work. SPDIF is untested for lack of hardware.
* ao_coreaudio: uncrustifyGravatar Stefano Pigozzi2013-06-16
| | | | | uncrustify -l C -c TOOLS/uncrustify.cfg --no-backup --replace \ audio/out/ao_coreaudio.c
* Replace calls to usec_sleep()Gravatar wm42013-05-26
| | | | | | This is just dumb sed replacement to mp_sleep_us(). Also remove the now unused usec_sleep() wrapper.
* ao_coreaudio: fix switched parametersGravatar wm42013-05-12
|
* Merge branch 'audio_changes'Gravatar wm42013-05-12
|\ | | | | | | | | Conflicts: audio/out/ao_lavc.c
| * audio/out: channel map selectionGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | Make all AOs use what has been introduced in the previous commit. Note that even AOs which can handle all possible layouts (like ao_null) use the new functions. This might be important if in the future ao_select_champ() possibly honors global user options about downmixing and so on.
| * ao_coreaudio: switch to WAVEEXT channel orderGravatar wm42013-05-12
| | | | | | | | | | This used ALSA order, which was not correct. Most likely this has been wrong since forever.
| * audio/out: switch to channel mapGravatar wm42013-05-12
| | | | | | | | | | | | This actually breaks audio for 5/6/8 channels. There's no reordering done yet. The actual reordering will be done inside of af_lavrresample and has to be made part of the format negotiation.
* | OSX: use native Cocoa's event loopGravatar Stefano Pigozzi2013-05-12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Schedule mpv's playloop as a high frequency timer inside the main Cocoa event loop. This has the benefit to allow accessing menus as well as resizing the window without the playback being blocked and allows to remove countless hacks from the code that involved manually pumping the event loop as well simulating manually some of the Cocoa default behaviours. A huge improvement consists in removing NSApplicationLoad. This is a C function defined in the Cocoa header and implements a minimal OSX application under ther hood so that you can use the Cocoa GUI toolkit from C/C++ without having to respect the Cocoa standards in terms of application initialization. This was bad because the behaviour implemented by NSApplicationLoad was hard to customize and had several gotchas especially in the menu department. mpv was changed to be just a nib-less application. All the Cocoa part is still generated in code but the event handling is now not dissimilar to what is present in a stock Mac application. As a part of reviewing the initialization process, I also removed all of `osdep/macosx_finder_args`. The useful parts of the code were moved to `osdep/macosx_appication` which has the broaded responsibility of managing the full lifecycle of the Cocoa application. By consequence the `--enable-macosx-finder` configure switch was killed as well, as this feature is always enabled. Another change the users will notice is that when using a bundle the `--quiet` option will be inserted much earlier in the initializaion process. This results in mpv not spamming mpv.log anymore with all the initialization outputs.
* ao_coreaudio: use 0 as timeout for CFRunLoopRunInModeGravatar Mad Fish2013-01-20
| | | | | | | Handle all pending events and exit instead of waiting. When there are lots of input events (for example, scrolling with trackpad), timeout can add up to make a huge frame delay. In my tests, if I scroll fast enough, that loop would never exit.
* ao_coreaudio: fix deprecation warningsGravatar Stefano Pigozzi2012-11-13
|
* Rename directories, move files (step 2 of 2)Gravatar wm42012-11-12
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* Rename directories, move files (step 1 of 2) (does not compile)Gravatar wm42012-11-12
Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.