Commit Graph

18 Commits (36bac353df3ccf0b6d21d591a994ac4922b367e6)

Author SHA1 Message Date
Gleb Mazovetskiy 36bac353df AV: Handle varying video frame dimensions 3 years ago
Gleb Mazovetskiy eb93fdfbea Use unique_ptr with custom deleter for VideoPicture::rgbaFrame 3 years ago
Gleb Mazovetskiy b7076549a3 osg-ffmpeg-videoplayer: Fix crash on ARM
osg-ffmpeg-videoplayer handled frame allocation incorrectly.

It used a `vector<uint8_t>` as its buffer, meaning the addresses could
did not respect alignment.

Instead, changes it to use `AVFrame` as buffers, allocated via `av_image_alloc`.

We also now only allocate the buffer once, instead of on every frame,
which should improve the framerate of videos.

Fixes the following crash on startup on ARM:

> Invalid address alignment (signal 7)

Fixes #5807
3 years ago
Andrei Kortunov 8084a336b5 Replace zeroes and nulls by nullptrs 4 years ago
elsid 40ad87bc4d
Replace OpenThreads by std types 4 years ago
Andrei Kortunov 454bae2c43 Make PacketQueue fields atomic to avoid data races (e.g. with ParseThread) 5 years ago
Ilya Zhuravlev 07e9ce84b3 Replace volatile bools with std::atomic<bool> 5 years ago
Stanislaw Halik 59d96d808e fix missing include 6 years ago
Andrei Kortunov f88d5e808c Rewrite media decoder to use FFMpeg 3.2+ API (task #4686) 6 years ago
Bret Curtis d785344fad purge all instances of <boost/shared_ptr.hpp>, clean up unused headers 7 years ago
Bret Curtis 07f75e1104 replace boost::shared_ptr in extern and components 7 years ago
Ewan Higgs 38a2de3c51 convert std::autor_ptr to std::unique_ptr, originally by Ewan Higgs and updated by Bret Curtis 7 years ago
scrawl 530fb61ad0 Use OpenThreads instead of boost thread
This should allow OpenMW to work better with git versions of openscenegraph. OSG dev version 3.5.5 added the setting of thread affinity for the main thread. The problem is that in the boost/standard threading libraries, the affinity of a thread is inherited by any further threads launched from that thread, leading to these threads always running on the same core as the main thread unless you tell them not to.

With OpenThreads, the default affinity of a thread is none, no matter what parent thread it was launched from.

So, when using custom threading with OSG 3.6+, we have these options:
1. explicitely tell OSG to *not* set the thread affinity
or 2. explicitely set the thread affinity of additional threads created (possible with boost, but not possible with std::thread)
or 3. use OpenThreads
or 4. accept the suboptimal performance of non-OSG threads (in OpenMW's case the sound streaming & video threads) running on the same core as the main thread

This patch opts for 3.)

Reference: http://forum.openscenegraph.org/viewtopic.php?t=16158
8 years ago
scrawl cd2e6d4436 Move the __STDC_CONSTANT_MACROS define to cmakelists 9 years ago
scrawl e6ecb39d94 Potential include fix 9 years ago
scrawl 7991ea25c0 Potentially missing includes 9 years ago
scrawl 00f4f78717 Give a name to video streams for logging purposes 9 years ago
scrawl 92ef9b1c57 Rename to osg-ffmpeg-videoplayer 9 years ago