AVWrapper.cpp (ssr-0.3.10) | : | AVWrapper.cpp (ssr-0.3.11) | ||
---|---|---|---|---|
skipping to change at line 22 | skipping to change at line 22 | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU General Public License for more details. | GNU General Public License for more details. | |||
You should have received a copy of the GNU General Public License | You should have received a copy of the GNU General Public License | |||
along with SimpleScreenRecorder. If not, see <http://www.gnu.org/licenses/>. | along with SimpleScreenRecorder. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | */ | |||
#include "AVWrapper.h" | #include "AVWrapper.h" | |||
#if !SSR_USE_AV_LOCKMGR_REGISTER_DEPRECATED | ||||
int lock_manager(void** m, AVLockOp op) { | int lock_manager(void** m, AVLockOp op) { | |||
std::mutex *&mutex = *(std::mutex**) m; | std::mutex *&mutex = *(std::mutex**) m; | |||
switch(op) { | switch(op) { | |||
case AV_LOCK_CREATE: mutex = new std::mutex(); break; | case AV_LOCK_CREATE: mutex = new std::mutex(); break; | |||
case AV_LOCK_DESTROY: delete mutex; break; | case AV_LOCK_DESTROY: delete mutex; break; | |||
case AV_LOCK_OBTAIN: mutex->lock(); break; | case AV_LOCK_OBTAIN: mutex->lock(); break; | |||
case AV_LOCK_RELEASE: mutex->unlock(); break; | case AV_LOCK_RELEASE: mutex->unlock(); break; | |||
} | } | |||
return 0; | return 0; | |||
} | } | |||
#endif | ||||
void DeleteFrameDataPointer(void* opaque, uint8_t* data) { | void DeleteFrameDataPointer(void* opaque, uint8_t* data) { | |||
Q_UNUSED(data); | Q_UNUSED(data); | |||
std::shared_ptr<AVFrameData> *ptr = (std::shared_ptr<AVFrameData>*) opaqu e; | std::shared_ptr<AVFrameData> *ptr = (std::shared_ptr<AVFrameData>*) opaqu e; | |||
delete ptr; | delete ptr; | |||
} | } | |||
class AVGlobal { | class AVGlobal { | |||
public: | public: | |||
AVGlobal() { | AVGlobal() { | |||
#if !SSR_USE_AV_REGISTER_ALL_DEPRECATED | ||||
av_register_all(); | av_register_all(); | |||
#endif | ||||
#if !SSR_USE_AV_LOCKMGR_REGISTER_DEPRECATED | ||||
av_lockmgr_register(&lock_manager); | av_lockmgr_register(&lock_manager); | |||
#endif | ||||
#if SSR_USE_AVFORMAT_NETWORK_INIT | #if SSR_USE_AVFORMAT_NETWORK_INIT | |||
avformat_network_init(); | avformat_network_init(); | |||
#endif | #endif | |||
} | } | |||
} g_av_global; | } g_av_global; | |||
AVFrameWrapper::AVFrameWrapper(const std::shared_ptr<AVFrameData>& refcounted_da ta) { | AVFrameWrapper::AVFrameWrapper(const std::shared_ptr<AVFrameData>& refcounted_da ta) { | |||
m_refcounted_data = refcounted_data; | m_refcounted_data = refcounted_data; | |||
#if SSR_USE_AV_FRAME_ALLOC | #if SSR_USE_AV_FRAME_ALLOC | |||
m_frame = av_frame_alloc(); | m_frame = av_frame_alloc(); | |||
End of changes. 5 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added |