BelledonneCommunications / linphone-desktop

Linphone is a free VoIP and video softphone based on the SIP protocol. Mirror of git://git.linphone.org/linphone-desktop.git
https://linphone.org/
GNU General Public License v3.0
391 stars 200 forks source link

qml show video help #827

Closed yuexiajiayan closed 3 months ago

yuexiajiayan commented 3 months ago

When I follow the following process to set up: 1、linphone_core_set_video_display_filter(lc,"MSQOGL"); 2、when Streams running start show video like this

loader1.active=true;

// ============================================================================= qml: Rectangle{ width: 1000 height: 500 color: "#000000" Loader{ id:loader1 x:0 y:0 width: 500 height: 500 sourceComponent:camera active:false } Loader{ id:loader2 x:500 y:0 width: 500 height: 500 sourceComponent:camera active:loader1.active onLoaded: item.isPreview = false } }

    Component{
        id:camera

        Camera{
            width: 300
            height: 300
        }

    }

class:

Camera::Camera (QQuickItem *parent) : QQuickFramebufferObject(parent) { // The fbo content must be y-mirrored because the ms rendering is y-inverted. setMirrorVertically(true);

mRefreshTimer = new QTimer(this);
mRefreshTimer->setInterval(1000 / MaxFps);

QObject::connect(
            mRefreshTimer, &QTimer::timeout,
            this, &QQuickFramebufferObject::update,
            Qt::DirectConnection
            );

 mRefreshTimer->start();

}

QQuickFramebufferObject::Renderer Camera::createRenderer () const { QQuickFramebufferObject::Renderer renderer = NULL; LinphoneCore* lc=Qtlinphone::getCInstance();// Reset

if(mIsPreview){

qDebug()<<"222222011"; // QQuickFramebufferObject::Renderer oldRenderer =(QQuickFramebufferObject::Renderer )linphone_core_get_native_preview_window_id (lc) ; //if (oldRenderer){ linphone_core_set_native_video_window_id(lc,NULL); } renderer=(QQuickFramebufferObject::Renderer *)linphone_core_create_native_preview_window_id(lc); if(renderer) { linphone_core_set_native_video_window_id(lc,renderer); }

}else{  qDebug()<<"22222201";
    LinphoneCall *curentcall = linphone_core_get_current_call(lc);
    if(curentcall){
    //   QQuickFramebufferObject::Renderer * oldRenderer =(QQuickFramebufferObject::Renderer *)  linphone_call_create_native_video_window_id(curentcall);
//    if(oldRenderer)  linphone_call_set_native_video_window_id(curentcall,NULL);

             renderer=(QQuickFramebufferObject::Renderer *)  linphone_call_create_native_video_window_id(curentcall);
         if(renderer)  linphone_call_set_native_video_window_id(curentcall,renderer);

    }else{

renderer=(QQuickFramebufferObject::Renderer *)linphone_core_create_native_preview_window_id(lc); if(renderer)linphone_core_set_native_video_window_id(lc,renderer);

    }
}
if(renderer){  qDebug()<<"111111111122331";
    return renderer;
    }
else{
         qDebug()<<"111111111121";
    return new SafeFramebuffer();
    }

}

bool Camera::getIsPreview () const { return mIsPreview; }

void Camera::setIsPreview (bool status) { if (mIsPreview != status) { mIsPreview = status; update();

    Q_EMIT isPreviewChanged(status);
}

}

result: Unable to see video and crashed qt Is there a problem with the process

avalanche15 commented 2 weeks ago

你好,linphone自带的api函数显示并不存在 MSQOGL这个过滤器,这是需要额外的操作去加载这个MSQOGL吗