当前位置: 首页>>代码示例>>C++>>正文


C++ QMediaPlayer::setVideoOutput方法代码示例

本文整理汇总了C++中QMediaPlayer::setVideoOutput方法的典型用法代码示例。如果您正苦于以下问题:C++ QMediaPlayer::setVideoOutput方法的具体用法?C++ QMediaPlayer::setVideoOutput怎么用?C++ QMediaPlayer::setVideoOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QMediaPlayer的用法示例。


在下文中一共展示了QMediaPlayer::setVideoOutput方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char *argv[])
{
	QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
	QApplication a(argc, argv);

	const QString fileAbsPath = a.arguments().at(1);
	qDebug("Opening %s...", qPrintable(fileAbsPath));

	QMediaPlayer p;
	p.setMedia(QMediaContent(QUrl(fileAbsPath)));

	QGraphicsVideoItem* item = new QGraphicsVideoItem;
	QGraphicsScene* scene = new QGraphicsScene;
	scene->addText("TEST");
	p.setVideoOutput(item);
	scene->addItem(item);
	scene->addRect(0, 0, 100, 100, QPen(Qt::red), QBrush(Qt::red));
	item->setPos(0, 0);

	//QImage image(1920, 1080, QImage::Format_ARGB32);
	//image.fill(Qt::blue);

	//QPainter painter(&image);
	//painter.setRenderHint(QPainter::Antialiasing);
	//scene->render(&painter);

	QGraphicsView view(scene);
	//view.scene()->addItem(item);
	view.setViewport(new QOpenGLWidget);
	view.show();

	p.play();

	return a.exec();
}
开发者ID:carlonluca,项目名称:pi,代码行数:35,代码来源:main.cpp

示例2: main

int             main(int argc, char *argv[])
{
    QApplication    a(argc, argv);
    QVideoWidget    *videoOutputWidget = new QVideoWidget();
    QMediaPlayer    *player = new QMediaPlayer();
    QVideoProbe     *probe = new QVideoProbe();
    DemoCoq*        demo = new DemoCoq();
    QTimer*         timer = new QTimer();

    probe->setSource(player);
    player->setMedia(QUrl::fromLocalFile("C:/Users/louis/Desktop/Cinefeel/Video.avi"));

    player->setVideoOutput(videoOutputWidget);

    videoOutputWidget->show();

    player->play();

    demo->connect(timer, SIGNAL(timeout()), SLOT(updateColor()));
    timer->start(1000 / 10);
    demo->addAPIConnector(new APIConnector("192.168.43.254:34000"));
//    demo->addAPIConnector(new APIConnector("192.168.43.254:34000"));
//    demo->addAPIConnector(new APIConnector("192.168.43.254:34000"));
//    demo->addAPIConnector(new APIConnector("192.168.43.254:34000"));
    //demo.launch();

    VideoDebugger   *videoDebugger = new VideoDebugger((QObject *)0, true);
    QObject::connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), videoDebugger, SLOT(mediaCheck(QMediaPlayer::MediaStatus)));
    QObject::connect(probe, SIGNAL(videoFrameProbed(QVideoFrame)), videoDebugger, SLOT(processFrame(QVideoFrame)));
    return a.exec();
}
开发者ID:skanight,项目名称:Cinefeel,代码行数:31,代码来源:main.cpp

示例3: main

int main(int argc, char *argv[])
{
    QMediaPlayer player;

    QVideoWidget videoWidget;
    player->setVideoOutput(videoWidget);

    videoWidget->show();
    player.setMedia(QUrl::fromLocalFile());
    player->play();

    return a.exec();
}
开发者ID:amapig,项目名称:QtPractice,代码行数:13,代码来源:main.cpp


注:本文中的QMediaPlayer::setVideoOutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。