78 Commits

Author SHA1 Message Date
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
Chris Robinson
dc8ef8264a Try to improve alffplay underrun device time adjustment 2018-11-20 12:32:42 -08:00
Chris Robinson
de13f30e28 Improve audio underrun recordery in alffplay
Now it has a better idea to skip samples during refill instead of after
restarting.
2018-11-18 05:38:03 -08:00
Chris Robinson
31b9c50721 Use the common init/close functions for alffplay 2018-10-10 16:16:00 -07:00
Chris Robinson
f589244fb6 Allow building alffplay without experimental extensions 2018-10-08 15:03:49 -07:00
Chris Robinson
cd2fd126c4 Add an alffplay option to play stereo streams with wide angles 2018-05-17 03:54:32 -07:00
Henri Hyyryläinen
a7da29804d Added missing string include to alffplay 2018-03-30 01:53:55 +03:00
Alexey Elymanov
d7d043a5ef
fix building on freebsd (clang)
fixes error: 'pow' is not a member of 'std'
2018-02-20 11:53:55 +03:00
Chris Robinson
e49607078e Handle disconnected events in alffplay 2018-02-03 11:27:03 -08:00
Chris Robinson
7a538141c9 Signal a condition variable when a buffer completes in alffplay 2018-02-01 02:24:44 -08:00
Chris Robinson
833eface38 Don't print buffer completed events in alffplay 2018-01-31 20:27:14 -08:00
Chris Robinson
782eb650c7 Use std::array instead of a plain array in alffplay 2018-01-28 13:18:33 -08:00
Chris Robinson
932939c5a8 Enable events in alffplay 2018-01-24 20:04:57 -08:00
Chris Robinson
2ac0adaebb Use a new proper buffer function with a flags parameter
Rather than hackily combining bit flags with the format, to increase the number
of potential flags. alBufferData now behaves as if calling alBufferStorageSOFT
with a flags value of 0.
2018-01-23 14:33:30 -08:00
Chris Robinson
4ebb97bf73 Test mapped buffers in alffplay 2018-01-23 11:15:25 -08:00
Chris Robinson
5acb2e5165 Remove alffplay's duplicate ALC_SOFT_device_clock declarations 2018-01-15 07:14:35 -08:00
Chris Robinson
682205a3d4 Finalize ALC_SOFT_device_clock 2018-01-15 06:45:53 -08:00
Chris Robinson
c8a30592e8 Only print the time in alffplay when it changes 2018-01-07 17:23:51 -08:00
Chris Robinson
0e1fd34c89 Fix a temp buffer leak in alffplay 2018-01-05 20:41:55 -08:00
Chris Robinson
10f2531b6c Handle the audio clock diff as nanoseconds in alffplay 2018-01-05 05:41:57 -08:00
Chris Robinson
fd8143fea0 Use a non-recursive mutex for alffplay's source lock 2018-01-03 19:05:25 -08:00
Chris Robinson
9d61f429a5 Use ALC_SOFT_device_clock in alffplay 2018-01-02 19:32:28 -08:00
Chris Robinson
dcc0f6e25d Improve starting synchronization in alffplay
It waits until the internal buffers are filled before starting playback, then
triggering the audio and video to start as close together as possible.
2018-01-02 03:31:12 -08:00