加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
myvideoproducer.h 987 Bytes
一键复制 编辑 原始数据 按行查看 历史
心尘 提交于 2018-09-28 14:44 . first commit
#ifndef MYVIDEOPRODUCER_H
#define MYVIDEOPRODUCER_H
#include <QObject>
#include <QVideoSurfaceFormat>
#include <QAbstractVideoSurface>
class MyVideoProducer : public QObject
{
Q_OBJECT
Q_PROPERTY(QAbstractVideoSurface *videoSurface READ videoSurface WRITE setVideoSurface)
public:
QAbstractVideoSurface* videoSurface() const { return m_surface; }
void setVideoSurface(QAbstractVideoSurface *surface)
{
// if (m_surface != surface && m_surface && m_surface->isActive()) {
// m_surface->stop();
// }
m_surface = surface;
// if (m_surface)
// m_surface->start(m_format);
}
// ...
// public slots:
// void onNewVideoContentReceived(const QVideoFrame &frame)
// {
// if (m_surface)
// m_surface->present(frame);
// }
private:
QAbstractVideoSurface *m_surface;
QVideoSurfaceFormat m_format;
};
#endif // MYVIDEOPRODUCER_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化