21765 Commits

Author SHA1 Message Date
rdb
0bb81a43c9 express: make a thread safe weak pointer implementation (#321)
To access a WeakPointerTo in a thread-safe way, use something like this:

    if (auto ptr = weak_ptr.lock()) {
      ..use ptr as regular PointerTo
    }

The new implementation no longer needs a reference to be stored to all weak pointers on the WeakReferenceList; a mere count of weak pointers is sufficient.  Therefore, callbacks theoretically no longer require a WeakPointerTo to be constructed.

The WeakPointerTo class is not actually atomic; it could be made so, but I don't believe it's worth it at this time.
2018-05-15 13:40:21 +02:00
Sam Edwards
47f7d3f297 general: Add headers explaining the renamed config_*.h 2018-05-14 02:36:42 -06:00
Sam Edwards
c81229c1a8 pfmprogs: Rename config_pfm to config_pfmprogs 2018-05-14 02:36:42 -06:00
Sam Edwards
52e7c952b3 putil: Rename config_util to config_putil 2018-05-14 02:36:42 -06:00
Sam Edwards
87c11d8018 pstatclient: Rename config_pstats to config_pstatclient 2018-05-14 02:36:42 -06:00
rdb
6175e79c57 cppparser: fix infinite recursion stack overflow with enum classes 2018-05-06 22:21:24 +02:00
rdb
666591ff48 cppparser: fix compile warnings on MSVC 2018-05-06 22:19:33 +02:00
rdb
ed54856e9f makepanda: don't fail building Windows installer if Pmw is missing 2018-05-06 22:18:30 +02:00
rdb
549301d0f0 putil: keep reference to objects queued for writing
This prevents a crash when a reference counted object is destroyed right after a write_pointer call.

Fixes #310
2018-05-05 23:10:41 +02:00
rdb
8a98bf42a3 general: enable use of tie and tuple on macOS (from TR1, for now) 2018-05-05 23:09:39 +02:00
rdb
71eee6df3f showbase: make iris/fade/letterbox transitions awaitable
This allows using a coroutine to build up a more complex sequence including transitions (eg. scripted cutscene), as well as provide a standard way to register callbacks upon completion of the transition.
2018-05-05 23:05:50 +02:00
rdb
cf58de4d04 showbase: make base.movie() awaitable (by returning a future) 2018-05-05 23:02:11 +02:00
rdb
11e21af52c showbase: fix iris/fade transitions for extreme aspect ratios
Fixes #311
2018-05-05 22:08:52 +02:00
rdb
b45726001e task: fix double free when failing to retrieve coroutine exception 2018-05-05 20:53:04 +02:00
rdb
9db74bca1d task: use consistent ordering for tasks with same sort value
We don't guarantee a specific order in this case, especially because they can be run in either order if there is more than one thread, but it is still useful to have a defined order for single-threaded task chains.  To that end, tasks
are now run in the order in which they were added to taskMgr.add (in absence of any other ordering constraints).

Fixes #309
2018-05-01 15:06:27 +02:00
rdb
3b4d4b0804 glgsg: fix broken upload of downscaled texture without mipmaps
Fixes #306
2018-04-30 19:13:54 -04:00
rdb
f986f8de1b showbase: add back clampScalar and PriorityCallbacks to PythonUtil
These were removed by 88dbb31daa02779405ef5326677eefb5cf93f3c8 under the assumption that they were not used, but it has recently come to my attention that there is still code out there that uses these.

PriorityCallbacks has been updated to be compatible with Python 3 by only comparing the priority, rather than the (priority, callback) tuple. This also has the side-effect of ditching the bisect dependency.

Also moves testing code from the source to the unit tests.
2018-04-21 11:43:46 +02:00
Donny Lawrence
574000aedd Add getter and setter for Content-Type header
Fixes #296
Closes #305
2018-04-21 11:20:18 +02:00
deflected
1ac351d594 bullet: Allow intractions with bullet world during tick callbacks
- Release the global lock during the user tick callback
        and allow interactions with bullet world
        - Acquire the lock again after the callback

Signed-off-by: deflected <deflected@users.noreply.github.com>
2018-04-20 21:29:08 +03:00
rdb
e6e39cce0e bullet: fix deadlock in get_manifold 2018-04-20 12:51:26 +02:00
rdb
fc172f8918 tests: fix unit test on 32-bit Ubuntu due to float imprecision 2018-04-20 12:48:26 +02:00
rdb
4877e8350d tests: fix unit test on 64-bit Ubuntu due to float imprecision
[skip ci]
2018-04-18 18:25:29 +02:00
rdb
f979c4d312 makepanda: don't use pkg-config for assimp
It seems that they removed the -I option, which we need to build with.  This commit is intended to fix the Ubuntu Bionic build.
2018-04-11 17:41:16 +02:00
rdb
0cef19fd90 putil: more validation in DatagramInputFile::get_datagram
Intended to fix test_file_corrupt for 32-bit platforms.

See discussion in 89be2c19af74c62b57961469c779b324c69979f1
2018-04-11 17:29:49 +02:00
rdb
e1675f1a53 makepanda: fix compile error on Windows with some versions of flex 2018-04-10 15:31:48 +02:00
rdb
607af9ff49 flt: fix compile error on macOS 10.6 (which has no strnlen) 2018-04-10 15:29:43 +02:00
Younguk Kim
9ca0d089a6 event: fix a crash when removing a task is not owned by user 2018-04-10 19:45:54 +09:00
rdb
753ae39740 readme: use MSVC 2015 instead of 2010 (see #288)
[skip ci]
2018-04-08 13:51:52 +02:00
rdb
d13464104c Fix compilation issue with --nothing on MSVC
I have no idea why this error happens, but it does not seem worth the effort to investigate further, so I'm just reverting the previous change to this file.
2018-04-06 20:50:31 +02:00
rdb
22f933a419 tests: disable datagram bytes() test on Python 2
See #297
2018-04-06 20:34:48 +02:00
rdb
b4d29e6096 express: allow using bytes() on Datagram
Closes: #297
2018-04-06 17:42:59 +02:00
rdb
de6d753f79 net: don't use get_message() when constructing datagram header
This is causing an unnecessary copy operation.
2018-04-06 17:17:04 +02:00
rdb
7125a3e587 interrogate: allow passing None for args that have NULL as default value 2018-04-05 20:49:13 +02:00
rdb
552a649ef3 interrogate: add back NULL definition, fixes some keyword arguments
I am not sure why the definition of NULL was removed; it might have been by mistake, but in any case it broke code like this:

    img = PNMImage(w, h, color_space=CS_srgb)

since it would not understand the default value (NULL) for the argument preceding color_space.
2018-04-04 21:50:02 +02:00
rdb
94476fd1f0 glgsg: fix invalid operation error with multisample FBO
Panda is forgetting to reset the current FBO when resolving multisamples.
2018-04-04 21:46:01 +02:00
rdb
7cbdd3b6c4 gobj: release GIL for (un)compress_ram_image 2018-04-04 21:36:26 +02:00
rdb
e9ae7dcc40 Use vector_uchar instead of string for binary network/file data
This distinction allows us to better support Python 3, since it will raise exceptions when trying to put arbitrary binary data in a str object.

This also adds some convenience functions for efficiently initializing a Datagram or PTA_uchar from a vector_uchar.
2018-04-02 23:17:14 +02:00
Sam Edwards
fadbcd91e5 ffmpeg: Bump supported minimums lower for libav 9.20
We need to support this because Ubuntu 14.04 ships with this
version, and has no "backports" option to bring in a newer version
(without use of a PPA or compiling it yourself).

We can consider raising the minimums again once Trusty is EOL.
2018-03-31 05:53:45 -06:00
Sam Edwards
bb6e0abeba ffmpeg: Switch the video cursor to the new decoding API 2018-03-31 04:17:07 -06:00
Sam Edwards
8d36908556 ffmpeg: Use avcodec_flush_buffers when seeking
Previously this would close and reopen the codec context;
that's entirely unnecessary, as all supported versions of
libavcodec support flushing the buffers instead.
2018-03-31 04:17:07 -06:00
Sam Edwards
e430428703 ffmpeg: Add async audio decoding loop
This leverages libavcodec >= 57.37.100's new asynchronous API,
which both allows decoding in hardware and in a separate thread,
and in any case would free up more CPU time for Panda's app loop.

This also avoids use of the now-deprecated `avcodec_decode_audio4`
2018-03-31 04:17:07 -06:00
Sam Edwards
62f9de101a ffmpeg: Tell swresample the channel count 2018-03-31 04:17:07 -06:00
Sam Edwards
4ffd364415 ffmpeg: Simplify ffmpegAudioCursor.cxx a little
This refactors the `reload_buffer` loop so all of the decode
logic is inside the loop, and all of the resampling logic is
outside.
2018-03-31 04:17:07 -06:00
Sam Edwards
eb591674e0 ffmpeg: Prefer av_packet_alloc over allocating AVPacket ourselves
av_packet_alloc/av_packet_free will know the correct size of AVPacket,
even if the ABI should change. So, we use it when it's available.
2018-03-31 04:17:07 -06:00
Sam Edwards
9596095294 ffmpeg: Use AVStream.codecpar
AVStream.codec is deprecated as of libavformat version 57.41.100,
so if this version is detected, we switch to AVStream.codecpar instead.

Note this also makes it necessary to construct and use our own codec
context - but doing that is a cleaner approach anyway.
2018-03-31 04:17:07 -06:00
Sam Edwards
cc77c5dbe2 ffmpeg: Clean up ffmpeg_prefer_libvpx implementation 2018-03-31 04:17:07 -06:00
Sam Edwards
148010c5f0 ffmpeg: Remove code to support deprecated versions
See previous commit; now that we're enforcing explicit minimums, any
code to support anything older than those minimums is trivially dead.
2018-03-31 04:17:07 -06:00
Sam Edwards
a19e9aea63 ffmpeg: Enforce minimum supported versions of ffmpeg
lavcodec:  54.86.100
lavformat: 54.59.106
lavutil:   52.13.100

These are the versions included in FFmpeg 1.1, which is the oldest
release that works with Panda already: we've been using
`av_opt_set_sample_fmt` (introduced in FFmpeg 1.1) since
03e96d8c4a903be7222365b40613429768659892 (August 2013) and nobody has
complained since. In other words, I'm not dropping support for anything
here, I'm just making the supported versions explicit.
2018-03-31 04:17:07 -06:00
Sam Edwards
65210a5e49 ffmpeg: Fix a typo in version detection
See f0b3e08e9c75e5cdcd98c0f3142469918d1d2fd5
2018-03-31 04:17:07 -06:00
Tohka
0b1ad67e13 distributed: Fix DC file reading regression (#295) 2018-03-31 04:01:35 -06:00