Skip to content

Commit

Permalink
widgets: build error. remove internal header. move id to avwidgets
Browse files Browse the repository at this point in the history
id in avwidgets ensures app will link to qtavwidgets
  • Loading branch information
wang-bin committed Jan 9, 2015
1 parent 9314cd3 commit 941f8d6
Show file tree
Hide file tree
Showing 23 changed files with 67 additions and 89 deletions.
4 changes: 2 additions & 2 deletions examples/filters/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
Simple Player: this file is part of QtAV examples
Copyright (C) 2012-2013 Wang Bin <[email protected]>
Copyright (C) 2012-2015 Wang Bin <[email protected]>
* This file is part of QtAV
Expand Down Expand Up @@ -28,7 +28,7 @@
#include <QMessageBox>

#include <QtAV/AVPlayer.h>
#include <QtAV/VideoRendererTypes.h>
#include <QtAVWidgets/QtAVWidgets.h>
#include "SimpleFilter.h"

using namespace QtAV;
Expand Down
2 changes: 1 addition & 1 deletion examples/player/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <QtAV/AVPlayer.h>
#include <QtAV/VideoRendererTypes.h>
#include <QtAV/VideoOutput.h>

#include <QtAVWidgets/QtAVWidgets.h>
#include "MainWindow.h"
#include "../common/common.h"

Expand Down
29 changes: 1 addition & 28 deletions examples/sharedoutput/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,12 @@

#include "widget.h"
#include <QtAV/AVPlayer.h>
#include <QtAV/WidgetRenderer.h>
#include <QtAVWidgets/QtAVWidgets.h>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QFileDialog>
#include <QTimer>

/*
rtsp://122.192.35.80:554/live/tv01 江苏城市
rtsp://122.192.35.80:554/live/tv02 江苏卫视
rtsp://122.192.35.80:554/live/tv03 江苏综艺
rtsp://122.192.35.80:554/live/tv07 CCTV4
rtsp://122.192.35.80:554/live/tv08 旅游卫视
rtsp://122.192.35.80:554/live/tv08 NJTV新闻综合
rtsp://122.192.35.80:554/live/tv10 湖南卫视
rtsp://122.192.35.80:554/live/tv11 东方卫视
rtsp://122.192.35.80:554/live/tv12 档案(北京)
rtsp://122.192.35.80:554/live/tv14 CCTV1
rtsp://122.192.35.80:554/live/tv16 辽宁卫视
rtsp://122.192.35.80:554/live/tv20 MursTv
rtsp://122.192.35.80:554/live/tv28 幸福Tv
rtsp://122.192.35.80:554/live/tv30 CCTV3
rtsp://122.192.35.80:554/live/tv31 CCTV6
rtsp://122.192.35.80:554/live/tv50 靓妆
rtsp://122.192.35.80:554/live/tv51 江苏公共
rtsp://122.192.35.80:554/live/tv60 新闻综合(江苏)
rtsp://122.192.35.80:554/live/tv61 新闻
rtsp://122.192.35.80:554/live/tv62 盐城
rtsp://122.192.35.80:554/live/tv63
rtsp://122.192.35.80:554/live/tv73 新闻综合
rtmp://mirtv.cdnvideo.ru/mirtv-live/mirtv300.sdp
*/

using namespace QtAV;

Widget::Widget(QWidget *parent) :
Expand Down
4 changes: 2 additions & 2 deletions examples/videocapture/playerwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <QLayout>
#include <QMessageBox>
#include <QFileDialog>

#include <QtAVWidgets/QtAVWidgets.h>
using namespace QtAV;

PlayerWindow::PlayerWindow(QWidget *parent) : QWidget(parent)
Expand All @@ -34,7 +34,7 @@ PlayerWindow::PlayerWindow(QWidget *parent) : QWidget(parent)
m_player = new AVPlayer(this);
QVBoxLayout *vl = new QVBoxLayout();
setLayout(vl);
m_vo = new VideoOutput(this);
m_vo = new VideoOutput(VideoRendererId_GLWidget2, this);
if (!m_vo->widget()) {
QMessageBox::warning(0, "QtAV error", "Can not create video renderer");
return;
Expand Down
4 changes: 2 additions & 2 deletions examples/videogroup/videogroup.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
VideoGroup: this file is part of QtAV examples
Copyright (C) 2012-2013 Wang Bin <[email protected]>
Copyright (C) 2012-2015 Wang Bin <[email protected]>
* This file is part of QtAV
Expand All @@ -26,7 +26,7 @@
#include <QGridLayout>
#include <QtCore/QUrl>
#include <QtAV/AudioOutput.h>
#include <QtAV/VideoRendererTypes.h>
#include <QtAVWidgets/QtAVWidgets.h>

using namespace QtAV;

Expand Down
4 changes: 2 additions & 2 deletions examples/videowall/VideoWall.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
VideoWall: this file is part of QtAV examples
Copyright (C) 2012-2014 Wang Bin <[email protected]>
Copyright (C) 2012-2015 Wang Bin <[email protected]>
* This file is part of QtAV
Expand Down Expand Up @@ -31,7 +31,7 @@
#include <QMimeData>
#include <QtCore/QUrl>
#include <QtAV/AudioOutput.h>
#include <QtAV/VideoRendererTypes.h>
#include <QtAVWidgets/QtAVWidgets.h>

using namespace QtAV;
const int kSyncInterval = 2000;
Expand Down
4 changes: 3 additions & 1 deletion src/QtAV/VideoOutput.h
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
Expand Down Expand Up @@ -55,6 +55,8 @@ class Q_AV_EXPORT VideoOutput : public QObject, public VideoRenderer
* Create a renderer with given rendererId. MUST check VideoOutput::isAvailable() later!
*/
VideoOutput(VideoRendererId rendererId, QObject *parent = 0);
/// rendererIds: an array ends with 0
VideoOutput(VideoRendererId* rendererIds, QObject *parent = 0);
~VideoOutput();
VideoRendererId id() const;

Expand Down
10 changes: 1 addition & 9 deletions src/QtAV/VideoRendererTypes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
VideoRendererTypes: type id and manually id register function
Copyright (C) 2013 Wang Bin <[email protected]>
Copyright (C) 2013-2015 Wang Bin <[email protected]>
* This file is part of QtAV
Expand Down Expand Up @@ -28,15 +28,7 @@ namespace QtAV {

//Q_AV_EXPORT(dllexport/import) is needed if used out of the library
//TODO graphics item?
extern Q_AV_EXPORT VideoRendererId VideoRendererId_Widget;
extern Q_AV_EXPORT VideoRendererId VideoRendererId_GraphicsItem;
extern Q_AV_EXPORT VideoRendererId VideoRendererId_GLWidget;
extern Q_AV_EXPORT VideoRendererId VideoRendererId_GDI;
extern Q_AV_EXPORT VideoRendererId VideoRendererId_Direct2D;
extern Q_AV_EXPORT VideoRendererId VideoRendererId_XV;
extern Q_AV_EXPORT VideoRendererId VideoRendererId_GLWidget2;
extern Q_AV_EXPORT VideoRendererId VideoRendererId_OpenGLWindow;
extern Q_AV_EXPORT VideoRendererId VideoRendererId_OpenGLWidget;

Q_AV_EXPORT void VideoRenderer_RegisterAll();

Expand Down
16 changes: 10 additions & 6 deletions src/libQtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,15 @@ config_avresample {
config_avdevice { #may depends on avfilter
DEFINES += QTAV_HAVE_AVDEVICE=1
LIBS *= -lavdevice
static_ffmpeg: mac:!ios { # static ffmpeg
LIBS += -framework Foundation -framework QTKit -framework CoreMedia -framework QuartzCore -framework CoreGraphics \
-framework AVFoundation
# assume avdevice targets to the same version as Qt and always >= 10.6
!isEqual(QMAKE_MACOSX_DEPLOYMENT_TARGET, 10.6): LIBS += -framework AVFoundation
static_ffmpeg {
win32 {
LIBS *= -lgdi32
} else:mac:!ios { # static ffmpeg
LIBS += -framework Foundation -framework QTKit -framework CoreMedia -framework QuartzCore -framework CoreGraphics \
-framework AVFoundation
# assume avdevice targets to the same version as Qt and always >= 10.6
!isEqual(QMAKE_MACOSX_DEPLOYMENT_TARGET, 10.6): LIBS += -framework AVFoundation
}
}
}
config_avfilter {
Expand Down Expand Up @@ -253,7 +257,7 @@ config_libass {
LIBS *= -L$$[QT_INSTALL_LIBS] -lavcodec -lavformat -lswscale -lavutil
win32 {
#dynamicgl: __impl__GetDC __impl_ReleaseDC __impl_GetDesktopWindow
LIBS += -luser32 -lgdi32
LIBS += -luser32
}
# compat with old system
# use old libva.so to link against
Expand Down
3 changes: 1 addition & 2 deletions src/output/video/Direct2DRenderer.cpp
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
Expand Down Expand Up @@ -43,7 +43,6 @@
//performance: http://msdn.microsoft.com/en-us/library/windows/desktop/dd372260(v=vs.85).aspx
//vlc is helpful
//layer(opacity): http://www.cnblogs.com/graphics/archive/2013/04/15/2781969.html
#include "utils/Logger.h"

namespace QtAV {

Expand Down
3 changes: 1 addition & 2 deletions src/output/video/GDIRenderer.cpp
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
Expand All @@ -26,7 +26,6 @@
#include <gdiplus.h>
#include <QResizeEvent>
#include "QtAV/private/prepost.h"
#include "utils/Logger.h"

#define USE_GRAPHICS 0

Expand Down
3 changes: 1 addition & 2 deletions src/output/video/GLWidgetRenderer.cpp
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
Expand Down Expand Up @@ -44,7 +44,6 @@

#include "QtAV/ColorTransform.h"
#include "QtAV/FilterContext.h"
#include "utils/Logger.h"

#define UPLOAD_ROI 0
#define ROI_TEXCOORDS 1
Expand Down
3 changes: 1 addition & 2 deletions src/output/video/GraphicsItemRenderer.cpp
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
Expand Down Expand Up @@ -31,7 +31,6 @@
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QSurface>
#endif
#include "utils/Logger.h"

namespace QtAV {

Expand Down
3 changes: 1 addition & 2 deletions src/output/video/OpenGLWidgetRenderer.cpp
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
Expand All @@ -22,7 +22,6 @@
#include "QtAV/OpenGLWidgetRenderer.h"
#include "QtAV/private/OpenGLRendererBase_p.h"
#include <QResizeEvent>
#include "utils/Logger.h"

namespace QtAV {

Expand Down
10 changes: 5 additions & 5 deletions src/output/video/VideoOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class VideoOutputPrivate : public VideoRendererPrivate
impl = VideoRendererFactory::create(rendererId);
if (!impl && !force) {
const VideoRendererId vo_ids[] = {
VideoRendererId_OpenGLWidget, // Qt >= 5.4
VideoRendererId_GLWidget2,
VideoRendererId_GLWidget,
VideoRendererId_Widget,
//VideoRendererId_OpenGLWidget, // Qt >= 5.4
//VideoRendererId_GLWidget2,
//VideoRendererId_GLWidget,
//VideoRendererId_Widget,
0
};
for (int i = 0; vo_ids[i]; ++i) {
Expand Down Expand Up @@ -83,7 +83,7 @@ class VideoOutputPrivate : public VideoRendererPrivate

VideoOutput::VideoOutput(QObject *parent)
: QObject(parent)
, VideoRenderer(*new VideoOutputPrivate(VideoRendererId_OpenGLWidget, false))
, VideoRenderer(*new VideoOutputPrivate(0, false))
{
}

Expand Down
1 change: 0 additions & 1 deletion src/output/video/VideoOutputEventFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <QtCore/QEvent>
#include <QKeyEvent>
#include <QWidget>
#include "utils/Logger.h"

namespace QtAV {

Expand Down
8 changes: 0 additions & 8 deletions src/output/video/VideoRendererTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,7 @@ namespace QtAV {

FACTORY_DEFINE(VideoRenderer)

VideoRendererId VideoRendererId_Widget = mkid::id32base36_6<'W', 'i', 'd', 'g', 'e', 't'>::value;
VideoRendererId VideoRendererId_GraphicsItem = mkid::id32base36_6<'Q', 'G', 'r', 'a', 'p', 'h'>::value;
VideoRendererId VideoRendererId_GLWidget = mkid::id32base36_6<'Q', 'G', 'L', 'W', 't', '1'>::value;
VideoRendererId VideoRendererId_GDI = mkid::id32base36_3<'G', 'D', 'I'>::value;
VideoRendererId VideoRendererId_Direct2D = mkid::id32base36_3<'D', '2', 'D'>::value;
VideoRendererId VideoRendererId_XV = mkid::id32base36_6<'X', 'V', 'i', 'd', 'e', 'o'>::value;
VideoRendererId VideoRendererId_GLWidget2 = mkid::id32base36_6<'Q', 'G', 'L', 'W', 't', '2'>::value;
VideoRendererId VideoRendererId_OpenGLWindow = mkid::id32base36_6<'Q', 'O', 'G', 'L', 'W', 'w'>::value;
VideoRendererId VideoRendererId_OpenGLWidget = mkid::id32base36_6<'Q', 'O', 'G', 'L', 'W', 't'>::value;

#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
FACTORY_REGISTER_ID_AUTO(VideoRenderer, OpenGLWindow, "OpenGLWindow")
Expand Down
3 changes: 1 addition & 2 deletions src/output/video/WidgetRenderer.cpp
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
Expand All @@ -26,7 +26,6 @@
#include <QApplication>
#include <QResizeEvent>
#include "QtAV/Filter.h"
#include "utils/Logger.h"

namespace QtAV {

Expand Down
4 changes: 1 addition & 3 deletions src/output/video/XVRenderer.cpp
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
Expand Down Expand Up @@ -34,8 +34,6 @@
#include <X11/extensions/Xvlib.h>
#include "QtAV/private/prepost.h"

#include "utils/Logger.h"

//http://huangbster.i.sohu.com/blog/view/256490057.htm

namespace QtAV {
Expand Down
2 changes: 1 addition & 1 deletion tests/extract/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <QApplication>
#include <QWidget>
#include <QtAV/VideoRenderer.h>
#include <QtAV/VideoRendererTypes.h>
#include <QtAVWidgets/QtAVWidgets.h>
#include <QtDebug>
#include <QtCore/QElapsedTimer>

Expand Down
13 changes: 11 additions & 2 deletions widgets/QtAVWidgets/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef QTAVWIDGETS_GLOBAL_H
#define QTAVWIDGETS_GLOBAL_H

#include <QtCore/qglobal.h>
#include <QtAV/VideoRendererTypes.h>

#if defined(BUILD_QTAVWIDGETS_LIB)
# undef Q_AVWIDGETS_EXPORT
Expand All @@ -32,9 +32,18 @@
# undef Q_AVWIDGETS_EXPORT
# define Q_AVWIDGETS_EXPORT Q_DECL_IMPORT //only for vc?
#endif
#define Q_AVWIDGETS_PRIVATE_EXPORT Q_AV_EXPORT
#define Q_AVWIDGETS_PRIVATE_EXPORT Q_AVWIDGETS_EXPORT

namespace QtAV {
extern Q_AVWIDGETS_EXPORT VideoRendererId VideoRendererId_Widget;
extern Q_AVWIDGETS_EXPORT VideoRendererId VideoRendererId_GraphicsItem;
extern Q_AVWIDGETS_EXPORT VideoRendererId VideoRendererId_GLWidget;
extern Q_AVWIDGETS_EXPORT VideoRendererId VideoRendererId_GDI;
extern Q_AVWIDGETS_EXPORT VideoRendererId VideoRendererId_Direct2D;
extern Q_AVWIDGETS_EXPORT VideoRendererId VideoRendererId_XV;
extern Q_AVWIDGETS_EXPORT VideoRendererId VideoRendererId_GLWidget2;
extern Q_AVWIDGETS_EXPORT VideoRendererId VideoRendererId_OpenGLWidget;

//popup a dialog
Q_AVWIDGETS_EXPORT void about();
Q_AVWIDGETS_EXPORT void aboutFFmpeg();
Expand Down
Loading

0 comments on commit 941f8d6

Please sign in to comment.