2

私は、ウィンドウシステムなしで、olimex a13ボード上で作業しています。eglfsこのため、ビデオとカメラは必要な用途として機能しQt Multimediaていません。だから私はここにあるライブラリを使用しています。QtGstreamerXQtGstreamer

に従って、期待どおりに動作するメディア プレーヤーを作成しました。今、私はカメラをやりたいと思っており、camerabin2これは悪いプラグインからのものです。

これは私のコードです:

//init QGst
QGst::init(&argc, &argv);
//create video surface
QGst::Quick::VideoSurface* videoSurface = new QGst::Quick::VideoSurface(&engine);

CameraPlayer player;
player.setVideoSink(videoSurface->videoSink());

//cameraplayer.cpp

void open() 
{
    if (!m_pipeline) {
        m_pipeline = QGst::ElementFactory::make("camerabin").dynamicCast<QGst::Pipeline>();
        if (m_pipeline) {
            m_pipeline->setProperty("video-sink", m_videoSink);
            //watch the bus for messages
            QGst::BusPtr bus = m_pipeline->bus();
            bus->addSignalWatch();
            QGlib::connect(bus, "message", this, &CameraPlayer::onBusMessage);
            //QGlib::connect(bus, "image-done", this, &CameraPlayer::onImageDone);
        } else {
            qCritical() << "Failed to create the pipeline";
        }
    }
}
//-----------------------------------
void CameraPlayer::setVideoSink(const QGst::ElementPtr & sink)
{
    m_videoSink = sink;
}

//-----------------------------------
void CameraPlayer::start()
{
    m_pipeline->setState(QGst::StateReady);
    m_pipeline->setState(QGst::StatePlaying);
}

cameraPlayer.start()次に、機能していないもの、つまりビデオがないものを呼び出します。ここで何か不足していますか?誰かがQtGstreamerウェブカメラをストリーミングしていましたか? 前もって感謝します。

4

1 に答える 1