Commit Graph

9 Commits

Author SHA1 Message Date
Jonathan Li ac78688a32 gsdx: Make GSJobQueue non-inheritable
In the previous code, the threads were created and destroyed in the base
class constructor and destructor, so the threads could potentially be
active while the object is in a partially constructed or destroyed state.
The thread however, relies on a virtual function to process the queue
items, and the vtable might not be in the desired state when the object
is partially constructed or destroyed.

This probably only matters during object destruction - no items are in
the queue during object construction so the virtual function won't be
called, but items may still be queued up when the destructor is called,
so the virtual function can be called. It wasn't an issue because all
uses of the thread explicitly waited for the queues to be empty before
invoking the destructor.

Adjust the constructor to take a std::function parameter, which the
thread will use instead to process queue items, and avoid inheriting
from the GSJobQueue class. This will also eliminate the need to
explicitly wait for all jobs to finish (unless there are other external
factors, of course), which would probably make future code safer.
2016-12-08 01:18:17 +00:00
Jonathan Li cdeed349e3 gsdx: Replace platform-specific threads with std::thread
GSThread now doesn't seem to have a purpose, so it's been removed.
2016-12-08 00:36:32 +00:00
Jonathan Li 6b950d0408 gsdx: Allow dump and capture PNG compression to be changed
Valid values for png_compression_level are from 0 (no compression) to 9
(max compression). The default is 1.

v2: Use zlib Z_BEST_SPEED (1) and Z_BEST_COMPRESSION (9) defines.
2016-03-02 22:58:45 +00:00
Jonathan Li cf939620ea gsdx-ogl: Save depth image as RGB and alpha images 2016-03-02 22:57:16 +00:00
Jonathan Li 87dcfbc645 gsdx-png: Use libpng directly instead of via png++
v2: Increase compression to maximum
v3: Add zlib to GSdx build dependencies
v4: Reduce memory usage
2016-03-02 22:48:54 +00:00
Gregory Hainaut a4d6722b26 gsdx-thread: add a CAPACITY parameter to GSJobQueue 2015-05-18 17:08:18 +02:00
Gregory Hainaut cff168e002 gsdx-linux-recorder: implement multithread to save the image
Currently only a dedicated thread. It is still too slow!
2015-05-18 16:56:44 +02:00
Gregory Hainaut 98dde32dc0 gsdx-replayer-linux: use new code to allow loading of .gs.xz dump
A bit slower at startup but it saves a lots of disk space!

Reduce the size of my gs collection of 11GB :)
2015-05-17 22:08:10 +02:00
Gregory Hainaut cab59587e8 gsdx: add a PNG wrapper
Normally it supports all formats but I didn't have luck with 16 bits depth gray
2015-05-16 12:32:05 +02:00