100 Commits

Author SHA1 Message Date
Chris Robinson
d137ee02a8 Constify the AVCodec* returned by avcodec_find_decoder 2022-02-19 17:49:06 -08:00
Chris Robinson
f3aa08aad9 Make sure alffplay properly stops when quiting
The parser thread could be waiting on the threads to join after queueing all
packets, so it wouldn't see mQuit to flush the queue. So make a stop method
that forces a flush when setting mQuit.
2021-12-27 15:26:11 -08:00
Chris Robinson
21e2b9aeea Heavily update alffplay packet handling
Avoid deprecated use of raw AVPacket objects, and use a separate thread to send
packets than receives the decoded frames.
2021-12-26 21:24:56 -08:00
Chris Robinson
a45e02791d Remove unnecessary ifdefs from alffplay
We already assume OpenAL Soft's alext.h, which these are part of now.
2021-12-24 17:50:47 -08:00
Chris Robinson
0886d8efa7 Use the audio clock as the default in alffplay 2021-12-24 14:48:58 -08:00
Chris Robinson
a051909c35 Add an option to use Super Stereo in alffplay 2021-12-15 02:54:15 -08:00
Chris Robinson
bbff1efa2a Update some in-progress extension types 2021-11-10 01:21:49 -08:00
Chris Robinson
0ec549ae7a Fix short initial packet preparation in alffplay 2021-05-20 23:48:43 -07:00
Chris Robinson
c7f3a02956 Add an option to decode stereo as UHJ in alffplay 2021-04-02 07:21:17 -07:00
Chris Robinson
267d9caac4 Check for the right extension string in alffplay 2020-10-26 12:21:42 -07:00
Chris Robinson
be0798b56d Finalize AL_SOFT_events 2020-10-26 10:57:48 -07:00
Chris Robinson
0dc9ae0998 Update event enum values
To keep them less spread out from other OpenAL Soft extensions.
2020-10-07 20:13:52 -07:00
Chris Robinson
191150d9a8 Remove deprecated, performance, and error event types
These would be better served with a proper debug API, rather than a general
audio event API.
2020-09-20 04:11:52 -07:00
Chris Robinson
476e9d7522 Cleanup some warnings with ffmpeg/alffplay 2020-08-12 17:39:08 -07:00
Chris Robinson
529049dc59 Remove an unused variable 2020-08-11 10:06:12 -07:00
Chris Robinson
972869f76f Dump the ffmpeg file info on the main thread 2020-04-29 21:32:09 -07:00
Chris Robinson
f6a0b004e0 Update to C++14 2020-03-22 08:05:22 -07:00
Chris Robinson
8554e6cde2 Remove AL_SOFT_map_buffer from alffplay and add AL_SOFT_callback_buffer
The former doesn't really help too much since buffers still need to be
(re)filled and (de)queued individually. A callback buffer, on the other hand,
allows for greater efficiency since it just needs to write into a ring buffer
that the mixer will directly read from.
2020-02-23 06:28:39 -08:00
Chris Robinson
aca1d02024 Get the audio sync once per update in alffplay 2020-01-13 17:31:35 -08:00
Chris Robinson
6ed8061cbf Finalize AL_SOFT_bformat_ex 2020-01-05 03:45:35 -08:00
Chris Robinson
137394c2cf Make the new direct channel remix extension public 2019-12-28 16:40:10 -08:00
Chris Robinson
bbe1c4c64e Test the B-Format buffer extension in alffplay 2019-12-02 13:04:44 -08:00
Chris Robinson
4c76f32dda Avoid implicit conversions with the examples and utils 2019-09-12 03:22:34 -07:00
Chris Robinson
40e937c63a Cleanup the examples' includes 2019-07-29 08:21:38 -07:00
Chris Robinson
b22ecc45c9 Increase the video picture queue size to 24 2019-07-26 03:44:46 -07:00
Chris Robinson
18f1139de8 Only redraw the image when necessary 2019-07-23 12:51:14 -07:00
Chris Robinson
b8ac4b79e4 Only send packets as needed 2019-07-23 02:38:07 -07:00
Chris Robinson
8a9434c623 Use a local variable to track the decoded pts 2019-07-20 18:46:43 -07:00
Chris Robinson
f0ed35d3d0 Set the initial clock time closer to starting playback 2019-07-20 01:10:14 -07:00
Chris Robinson
9959d661a0 Restructure codec send/receive calls
In particular, after an initial fill of the codec's internal buffer, each
receive_frame call is followed by one or more send_packet calls. For
asynchronous codecs, this has the effect of letting the codec work while the
handler thread is waiting for an AVFrame structure to become available or
waiting for more decoded data to be needed. For synchronous codecs, this
makes the send_packet calls use up time that would be spent waiting.
2019-07-19 22:55:20 -07:00
Chris Robinson
2b21a08f89 Receive video frames in a loop 2019-07-16 20:20:25 -07:00
Chris Robinson
4ff7bfd2d8 Use atomics for the picture queue 2019-07-14 03:59:57 -07:00
Chris Robinson
ac7eeeae79 Don't use the same mutex for the video clock 2019-07-14 03:59:57 -07:00
Chris Robinson
93c53e33f0 Receive frames directly into the picture's AVFrame 2019-07-14 03:59:57 -07:00
Chris Robinson
e7e734f8b9 Don't use one texture per picture in alffplay 2019-07-14 03:59:56 -07:00
Chris Robinson
f99474c913 Handle alffplay video using continuous rendering 2019-07-12 23:34:21 -07:00
Chris Robinson
2e6c7808b0 Try to improve alffplay timing again 2019-07-11 03:54:26 -07:00
Chris Robinson
426c4587cc Some clean up to use uniform initialization 2019-07-10 02:13:28 -07:00
Chris Robinson
159024acc9 Improve alffplay video clock timing 2019-07-09 22:15:05 -07:00
Chris Robinson
3ffb6867a3 Rework packet handling in alffplay
Turns out avcodec_send_packet is what can invoke the decode for serialized
codecs, so don't call that in the parse handler thread. The packet queue is
used to get the compressed data from the parse handler to the audio/video
threads.

Additionally, don't serialize the video frame preparation with the decode
thread.
2019-07-08 13:18:10 -07:00
Chris Robinson
2783b4c04b Somewhat simplify alffplay playback timing 2019-07-06 22:18:52 -07:00
Chris Robinson
0aeaf06173 Properly set DisableVideo to true 2019-06-30 22:02:40 -07:00
Chris Robinson
e9bf7e4b15 Add an option to disable video in alffplay 2019-06-30 18:17:23 -07:00
Chris Robinson
0aa0f24dd7 Use a proper flag to indicate audio is prepared in alffplay 2019-03-01 22:46:56 -08:00
Chris Robinson
8a34bd59b0 Unlock the audio decoder mutex before disabling events in alffplay
The callback may be waiting on the mutex, but disabling the callback needs any
current invocation to finish first.
2019-02-25 02:03:43 -08:00
Chris Robinson
b7b4cfae2b Fixed alffplay underrun recovery timing 2019-02-04 21:22:43 -08:00
Chris Robinson
e55f9b42e9 Partially handle ambisonics in alffplay
This is currently really only applicable to Opus-encoded files. It assumes
AmbiX (SN3D normalization, ACN ordering) and only comes into play when the
channel layout is blank. FFmpeg/libavcodec doesn't have a way to detect
B-Format input or what normalization and ordering it uses. Note in particular
.amb files do not play correctly (libavcodec seems to apply a default channel
layout for 4-channel wav-type files, regardless of its channel mask value).
2019-01-27 14:53:46 -08:00
Chris Robinson
d7eee03272 Replace a couple more C-style casts 2019-01-08 19:08:03 -08:00
Filip Gawin
0d3a0635d9 Avoid using old style casts
To think about:
examples/alffplay.cpp:600
OpenAL32/Include/alMain.h:295
2019-01-08 19:42:44 +01:00
Filip Gawin
0537414baf Use nullptr in cpp files 2019-01-07 12:37:13 +01:00