Skip to content
Snippets Groups Projects
Select Git revision
  • 0cbecf88fb4b3e71b8b31ec519f7e614da1d89be
  • master default protected
  • release/202005
  • release/202001
  • release/201912
  • release/201911
  • release/releaseWindowsTestOne
  • release/releaseTest
  • release/releaseWindowsTest
  • release/windowsReleaseTest
  • release/201910
  • release/qt/201910
  • release/windows-test/201910
  • release/201908
  • release/201906
  • release/201905
  • release/201904
  • release/201903
  • release/201902
  • release/201901
  • release/201812
  • 1.0.0
  • 0.3.0
  • 0.2.1
  • 0.2.0
  • 0.1.0
26 results

videomanager_wrap.cpp

Blame
    • Alexandre Lision's avatar
      0cbecf88
      video: fix deadlock · 0cbecf88
      Alexandre Lision authored
      stopDecoding was blocking when making a conference because no semaphore were
      available. Semaphore shouldn't have been placed here in the first place
      
      Issue: #81116
      Change-Id: Ia686601f40c430ba716c91b2667268e4fb108446
      0cbecf88
      History
      video: fix deadlock
      Alexandre Lision authored
      stopDecoding was blocking when making a conference because no semaphore were
      available. Semaphore shouldn't have been placed here in the first place
      
      Issue: #81116
      Change-Id: Ia686601f40c430ba716c91b2667268e4fb108446
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    videomanager_wrap.cpp 3.48 KiB
    /******************************************************************************
     *   Copyright (C) 2014 by Savoir-Faire Linux                                 *
     *   Author : Philippe Groarke <philippe.groarke@savoirfairelinux.com>        *
     *   Author : Alexandre Lision <alexandre.lision@savoirfairelinux.com>        *
     *                                                                            *
     *   This library is free software; you can redistribute it and/or            *
     *   modify it under the terms of the GNU Lesser General Public               *
     *   License as published by the Free Software Foundation; either             *
     *   version 2.1 of the License, or (at your option) any later version.       *
     *                                                                            *
     *   This library is distributed in the hope that it will be useful,          *
     *   but WITHOUT ANY WARRANTY; without even the implied warranty of           *
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
     *   Lesser General Public License for more details.                          *
     *                                                                            *
     *   You should have received a copy of the Lesser GNU General Public License *
     *   along with this program.  If not, see <http://www.gnu.org/licenses/>.    *
     *****************************************************************************/
     #include "videomanager_wrap.h"
    
    VideoManagerInterface::VideoManagerInterface()
    {
    #ifdef ENABLE_VIDEO
    
        proxy = new VideoManagerSignalProxy(this);
        sender = new VideoManagerProxySender();
    
        QObject::connect(sender,&VideoManagerProxySender::deviceEvent,proxy,&VideoManagerSignalProxy::slotDeviceEvent);
        QObject::connect(sender,&VideoManagerProxySender::startedDecoding,proxy,&VideoManagerSignalProxy::slotStartedDecoding);
        QObject::connect(sender,&VideoManagerProxySender::stoppedDecoding,proxy,&VideoManagerSignalProxy::slotStoppedDecoding);
    
    
        using DRing::exportable_callback;
        using DRing::VideoSignal;
        videoHandlers = {
            exportable_callback<VideoSignal::DeviceEvent>(
                [this] () {
                    emit sender->deviceEvent();
            }),
            exportable_callback<VideoSignal::DecodingStarted>(
                [this] (const std::string &id, const std::string &shmPath, int width, int height, bool isMixer) {
                    emit sender->startedDecoding(QString(id.c_str()), QString(shmPath.c_str()), width, height, isMixer);
            }),
            exportable_callback<VideoSignal::DecodingStopped>(
                [this] (const std::string &id, const std::string &shmPath, bool isMixer) {
                    emit sender->stoppedDecoding(QString(id.c_str()), QString(shmPath.c_str()), isMixer);
            })
        };
    #endif
    }
    
    VideoManagerInterface::~VideoManagerInterface()
    {
    
    }
    
    VideoManagerSignalProxy::VideoManagerSignalProxy(VideoManagerInterface* parent) : QObject(parent),
    m_pParent(parent)
    {}
    
    void VideoManagerSignalProxy::slotDeviceEvent()
    {
        QTimer::singleShot(0, [=] {
            emit m_pParent->deviceEvent();
        });
    }
    
    void VideoManagerSignalProxy::slotStartedDecoding(const QString &id, const QString &shmPath, int width, int height, bool isMixer)
    {
        QTimer::singleShot(0, [=] {
            emit m_pParent->startedDecoding(id,shmPath,width,height,isMixer);
        });
    }
    
    void VideoManagerSignalProxy::slotStoppedDecoding(const QString &id, const QString &shmPath, bool isMixer)
    {
        QTimer::singleShot(0, [=] {
            emit m_pParent->stoppedDecoding(id,shmPath,isMixer);
        });
    }