forked from wang-bin/QtAV
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes: You have to include <QtAVWidgets/QtAVWidgets.h> to use built-in widget renderers Link against QtAVWidgets TODO: QT = avwidgets not available move ids to widgets module?
- Loading branch information
Showing
33 changed files
with
280 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2012-2014 Wang Bin <[email protected]> | ||
Copyright (C) 2012-2015 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
|
@@ -29,9 29,6 @@ | |
#include <QtCore/QIODevice> | ||
#include <QtCore/QThreadPool> | ||
#include <QtCore/QTimer> | ||
#if QTAV_HAVE(WIDGETS) | ||
#include <QWidget> | ||
#endif //QTAV_HAVE(WIDGETS) | ||
#include "QtAV/AVDemuxer.h" | ||
#include "QtAV/Packet.h" | ||
#include "QtAV/AudioDecoder.h" | ||
|
@@ -44,7 41,6 @@ | |
#include "QtAV/AudioOutputTypes.h" | ||
#include "filter/FilterManager.h" | ||
#include "output/OutputSet.h" | ||
#include "output/video/VideoOutputEventFilter.h" | ||
#include "AudioThread.h" | ||
#include "VideoThread.h" | ||
#include "AVDemuxThread.h" | ||
|
@@ -114,15 110,6 @@ void AVPlayer::addVideoRenderer(VideoRenderer *renderer) | |
return; | ||
} | ||
renderer->setStatistics(&d->statistics); | ||
#if QTAV_HAVE(WIDGETS) | ||
QObject *voo = renderer->widget(); | ||
if (voo) { | ||
//TODO: how to delete filter if no parent? | ||
//the filtering object must be in the same thread as this object. | ||
if (renderer->widget()) | ||
voo->installEventFilter(new VideoOutputEventFilter(renderer)); | ||
} | ||
#endif //QTAV_HAVE(WIDGETS) | ||
d->vos->addOutput(renderer); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2012-2014 Wang Bin <[email protected]> | ||
Copyright (C) 2012-2015 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
|
@@ -22,6 22,7 @@ | |
#ifndef QTAV_GLWIDGETRENDERER_H | ||
#define QTAV_GLWIDGETRENDERER_H | ||
|
||
#include <QtAVWidgets/global.h> | ||
#include <QtAV/VideoRenderer.h> | ||
#include <QtOpenGL/QGLWidget> | ||
// TODO: QGLFunctions is in Qt4.8 . meego is 4.7 | ||
|
@@ -32,7 33,7 @@ | |
namespace QtAV { | ||
|
||
class GLWidgetRendererPrivate; | ||
class Q_AV_EXPORT GLWidgetRenderer : public QGLWidget, public VideoRenderer | ||
class Q_AVWIDGETS_EXPORT GLWidgetRenderer : public QGLWidget, public VideoRenderer | ||
#if QTAV_HAVE(QGLFUNCTIONS) //TODO: why use QT_VERSION will result in moc error? | ||
, public QGLFunctions | ||
#endif //QTAV_HAVE(QGLFUNCTIONS) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2014 Wang Bin <[email protected]> | ||
Copyright (C) 2014-2015 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
|
@@ -22,6 22,7 @@ | |
#ifndef QTAV_GLWIDGETRENDERER2_H | ||
#define QTAV_GLWIDGETRENDERER2_H | ||
|
||
#include <QtAVWidgets/global.h> | ||
#include <QtOpenGL/QGLWidget> | ||
#include <QtAV/OpenGLRendererBase.h> | ||
|
||
|
@@ -33,7 34,7 @@ class GLWidgetRenderer2Private; | |
* Renderering video frames using GLSL. A more generic high level class OpenGLVideo is used internally. | ||
* TODO: for Qt5, no QtOpenGL, use QWindow instead. | ||
*/ | ||
class Q_AV_EXPORT GLWidgetRenderer2 : public QGLWidget, public OpenGLRendererBase | ||
class Q_AVWIDGETS_EXPORT GLWidgetRenderer2 : public QGLWidget, public OpenGLRendererBase | ||
{ | ||
Q_OBJECT | ||
DPTR_DECLARE_PRIVATE(GLWidgetRenderer2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2012-2014 Wang Bin <[email protected]> | ||
Copyright (C) 2012-2015 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
|
@@ -22,6 22,7 @@ | |
#ifndef QAV_GRAPHICSITEMRENDERER_H | ||
#define QAV_GRAPHICSITEMRENDERER_H | ||
|
||
#include <QtAVWidgets/global.h> | ||
#include <QtAV/QPainterRenderer.h> | ||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) | ||
#include <QtWidgets/QGraphicsWidget> | ||
|
@@ -40,7 41,7 @@ | |
namespace QtAV { | ||
|
||
class GraphicsItemRendererPrivate; | ||
class Q_AV_EXPORT GraphicsItemRenderer : public GraphicsWidget, public QPainterRenderer | ||
class Q_AVWIDGETS_EXPORT GraphicsItemRenderer : public GraphicsWidget, public QPainterRenderer | ||
{ | ||
Q_OBJECT | ||
DPTR_DECLARE_PRIVATE(GraphicsItemRenderer) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2014 Wang Bin <[email protected]> | ||
Copyright (C) 2014-2015 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
|
@@ -22,13 22,14 @@ | |
#ifndef QTAV_OPENGLWIDGETRENDERER_H | ||
#define QTAV_OPENGLWIDGETRENDERER_H | ||
|
||
#include <QtAVWidgets/global.h> | ||
#include <QtWidgets/QOpenGLWidget> | ||
#include <QtAV/OpenGLRendererBase.h> | ||
|
||
namespace QtAV { | ||
|
||
class OpenGLWidgetRendererPrivate; | ||
class Q_AV_EXPORT OpenGLWidgetRenderer : public QOpenGLWidget, public OpenGLRendererBase | ||
class Q_AVWIDGETS_EXPORT OpenGLWidgetRenderer : public QOpenGLWidget, public OpenGLRendererBase | ||
{ | ||
DPTR_DECLARE_PRIVATE(OpenGLWidgetRenderer) | ||
public: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2012-2014 Wang Bin <[email protected]> | ||
Copyright (C) 2012-2015 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
|
@@ -61,10 61,6 @@ | |
#include <QtAV/VideoOutput.h> | ||
//The following renderer headers can be removed | ||
#include <QtAV/QPainterRenderer.h> | ||
#include <QtAV/GraphicsItemRenderer.h> | ||
#include <QtAV/WidgetRenderer.h> | ||
#include <QtAV/GLWidgetRenderer.h> | ||
#include <QtAV/GLWidgetRenderer2.h> | ||
|
||
#include <QtAV/Subtitle.h> | ||
#include <QtAV/SubtitleFilter.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2012-2014 Wang Bin <[email protected]> | ||
Copyright (C) 2012-2015 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
|
@@ -49,11 49,8 @@ enum LogLevel { | |
LogFatal, // log fatal | ||
LogAll | ||
}; | ||
Q_AV_EXPORT void about(); //popup a dialog | ||
Q_AV_EXPORT void aboutFFmpeg(); | ||
Q_AV_EXPORT QString aboutFFmpeg_PlainText(); | ||
Q_AV_EXPORT QString aboutFFmpeg_HTML(); | ||
Q_AV_EXPORT void aboutQtAV(); | ||
Q_AV_EXPORT QString aboutQtAV_PlainText(); | ||
Q_AV_EXPORT QString aboutQtAV_HTML(); | ||
/*! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2012-2014 Wang Bin <[email protected]> | ||
Copyright (C) 2012-2015 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
|
@@ -22,6 22,7 @@ | |
#ifndef QTAV_WIDGETRENDERER_H | ||
#define QTAV_WIDGETRENDERER_H | ||
|
||
#include <QtAVWidgets/global.h> | ||
#include <QtAV/QPainterRenderer.h> | ||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) | ||
#include <QtWidgets/QWidget> | ||
|
@@ -32,7 33,7 @@ | |
namespace QtAV { | ||
|
||
class WidgetRendererPrivate; | ||
class Q_AV_EXPORT WidgetRenderer : public QWidget, public QPainterRenderer | ||
class Q_AVWIDGETS_EXPORT WidgetRenderer : public QWidget, public QPainterRenderer | ||
{ | ||
Q_OBJECT | ||
DPTR_DECLARE_PRIVATE(WidgetRenderer) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2012-2014 Wang Bin <[email protected]> | ||
Copyright (C) 2012-2015 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
|
@@ -20,22 20,8 @@ | |
******************************************************************************/ | ||
|
||
#include "QtAV/QtAV_Global.h" | ||
// TODO: move to an internal header | ||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) || defined(QT_WIDGETS_LIB) | ||
#ifndef QTAV_HAVE_WIDGETS | ||
#define QTAV_HAVE_WIDGETS 1 | ||
#endif //QTAV_HAVE_WIDGETS | ||
#endif | ||
|
||
#include <QtCore/QObject> | ||
#include <QtCore/QRegExp> | ||
#if QTAV_HAVE(WIDGETS) | ||
#include <QBoxLayout> | ||
#include <QMessageBox> | ||
#include <QPushButton> | ||
#include <QTableWidget> | ||
#include <QTextBrowser> | ||
#endif //QTAV_HAVE(WIDGETS) | ||
#include "QtAV/version.h" | ||
#include "QtAV/private/AVCompat.h" | ||
#include "utils/Logger.h" | ||
|
@@ -71,46 57,6 @@ bool isLogLevelSet() { return gLogLevelSet;} | |
} //namespace Internal | ||
|
||
//TODO: auto add new depend libraries information | ||
void about() | ||
{ | ||
#if QTAV_HAVE(WIDGETS) | ||
//we should use new because a qobject will delete it's children | ||
QTextBrowser *viewQtAV = new QTextBrowser; | ||
QTextBrowser *viewFFmpeg = new QTextBrowser; | ||
viewQtAV->setOpenExternalLinks(true); | ||
viewFFmpeg->setOpenExternalLinks(true); | ||
viewQtAV->setHtml(aboutQtAV_HTML()); | ||
viewFFmpeg->setHtml(aboutFFmpeg_HTML()); | ||
QTabWidget *tab = new QTabWidget; | ||
tab->addTab(viewQtAV, "QtAV"); | ||
tab->addTab(viewFFmpeg, "FFmpeg"); | ||
QPushButton *btn = new QPushButton(QObject::tr("Ok")); | ||
QHBoxLayout *btnLayout = new QHBoxLayout; | ||
btnLayout->addStretch(); | ||
btnLayout->addWidget(btn); | ||
QDialog dialog; | ||
dialog.setWindowTitle(QObject::tr("About") " QtAV"); | ||
QVBoxLayout *layout = new QVBoxLayout; | ||
dialog.setLayout(layout); | ||
layout->addWidget(tab); | ||
layout->addLayout(btnLayout); | ||
QObject::connect(btn, SIGNAL(clicked()), &dialog, SLOT(accept())); | ||
dialog.exec(); | ||
#else | ||
aboutQtAV(); | ||
aboutFFmpeg(); | ||
#endif //QTAV_HAVE(WIDGETS) | ||
} | ||
|
||
void aboutFFmpeg() | ||
{ | ||
#if QTAV_HAVE(WIDGETS) | ||
QMessageBox::about(0, QObject::tr("About FFmpeg"), aboutFFmpeg_HTML()); | ||
#else | ||
qDebug() << aboutFFmpeg_PlainText(); | ||
#endif | ||
} | ||
|
||
QString aboutFFmpeg_PlainText() | ||
{ | ||
return aboutFFmpeg_HTML().remove(QRegExp("<[^>]*>")); | ||
|
@@ -214,15 160,6 @@ QString aboutFFmpeg_HTML() | |
return text; | ||
} | ||
|
||
void aboutQtAV() | ||
{ | ||
#if QTAV_HAVE(WIDGETS) | ||
QMessageBox::about(0, QObject::tr("About QtAV"), aboutQtAV_HTML()); | ||
#else | ||
qDebug() << aboutQtAV_PlainText(); | ||
#endif //QTAV_HAVE(WIDGETS) | ||
} | ||
|
||
QString aboutQtAV_PlainText() | ||
{ | ||
return aboutQtAV_HTML().remove(QRegExp("<[^>]*>")); | ||
|
Oops, something went wrong.