diff --git a/examples/filters/main.cpp b/examples/filters/main.cpp index c4422ada4..756f22153 100644 --- a/examples/filters/main.cpp +++ b/examples/filters/main.cpp @@ -1,6 +1,6 @@ /****************************************************************************** Simple Player: this file is part of QtAV examples - Copyright (C) 2012-2013 Wang Bin + Copyright (C) 2012-2015 Wang Bin * This file is part of QtAV @@ -28,7 +28,7 @@ #include #include -#include +#include #include "SimpleFilter.h" using namespace QtAV; diff --git a/examples/player/main.cpp b/examples/player/main.cpp index 59d08b682..5b50ae2fd 100644 --- a/examples/player/main.cpp +++ b/examples/player/main.cpp @@ -28,7 +28,7 @@ #include #include #include - +#include #include "MainWindow.h" #include "../common/common.h" diff --git a/examples/sharedoutput/widget.cpp b/examples/sharedoutput/widget.cpp index 82864d981..0ee3ed7f8 100644 --- a/examples/sharedoutput/widget.cpp +++ b/examples/sharedoutput/widget.cpp @@ -20,39 +20,12 @@ #include "widget.h" #include -#include +#include #include #include #include #include -/* - 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) : diff --git a/examples/videocapture/playerwindow.cpp b/examples/videocapture/playerwindow.cpp index 4d7136263..f29520578 100644 --- a/examples/videocapture/playerwindow.cpp +++ b/examples/videocapture/playerwindow.cpp @@ -25,7 +25,7 @@ #include #include #include - +#include using namespace QtAV; PlayerWindow::PlayerWindow(QWidget *parent) : QWidget(parent) @@ -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; diff --git a/examples/videogroup/videogroup.cpp b/examples/videogroup/videogroup.cpp index e5008dfef..bda06f70b 100644 --- a/examples/videogroup/videogroup.cpp +++ b/examples/videogroup/videogroup.cpp @@ -1,6 +1,6 @@ /****************************************************************************** VideoGroup: this file is part of QtAV examples - Copyright (C) 2012-2013 Wang Bin + Copyright (C) 2012-2015 Wang Bin * This file is part of QtAV @@ -26,7 +26,7 @@ #include #include #include -#include +#include using namespace QtAV; diff --git a/examples/videowall/VideoWall.cpp b/examples/videowall/VideoWall.cpp index 8600a08c9..f2e2e2fa9 100644 --- a/examples/videowall/VideoWall.cpp +++ b/examples/videowall/VideoWall.cpp @@ -1,6 +1,6 @@ /****************************************************************************** VideoWall: this file is part of QtAV examples - Copyright (C) 2012-2014 Wang Bin + Copyright (C) 2012-2015 Wang Bin * This file is part of QtAV @@ -31,7 +31,7 @@ #include #include #include -#include +#include using namespace QtAV; const int kSyncInterval = 2000; diff --git a/src/QtAV/VideoOutput.h b/src/QtAV/VideoOutput.h index db74c8805..628e279a5 100644 --- a/src/QtAV/VideoOutput.h +++ b/src/QtAV/VideoOutput.h @@ -1,6 +1,6 @@ /****************************************************************************** QtAV: Media play library based on Qt and FFmpeg - Copyright (C) 2014 Wang Bin + Copyright (C) 2014-2015 Wang Bin * This file is part of QtAV @@ -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; diff --git a/src/QtAV/VideoRendererTypes.h b/src/QtAV/VideoRendererTypes.h index 25551b216..152935c38 100644 --- a/src/QtAV/VideoRendererTypes.h +++ b/src/QtAV/VideoRendererTypes.h @@ -1,6 +1,6 @@ /****************************************************************************** VideoRendererTypes: type id and manually id register function - Copyright (C) 2013 Wang Bin + Copyright (C) 2013-2015 Wang Bin * This file is part of QtAV @@ -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(); diff --git a/src/libQtAV.pro b/src/libQtAV.pro index 908b5c389..b79bfded8 100644 --- a/src/libQtAV.pro +++ b/src/libQtAV.pro @@ -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 { @@ -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 diff --git a/src/output/video/Direct2DRenderer.cpp b/src/output/video/Direct2DRenderer.cpp index 8163deaf4..c1baabf83 100644 --- a/src/output/video/Direct2DRenderer.cpp +++ b/src/output/video/Direct2DRenderer.cpp @@ -1,6 +1,6 @@ /****************************************************************************** QtAV: Media play library based on Qt and FFmpeg - Copyright (C) 2012-2014 Wang Bin + Copyright (C) 2012-2015 Wang Bin * This file is part of QtAV @@ -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 { diff --git a/src/output/video/GDIRenderer.cpp b/src/output/video/GDIRenderer.cpp index 43b89c7b7..c99972080 100644 --- a/src/output/video/GDIRenderer.cpp +++ b/src/output/video/GDIRenderer.cpp @@ -1,6 +1,6 @@ /****************************************************************************** QtAV: Media play library based on Qt and FFmpeg - Copyright (C) 2012-2014 Wang Bin + Copyright (C) 2012-2015 Wang Bin * This file is part of QtAV @@ -26,7 +26,6 @@ #include #include #include "QtAV/private/prepost.h" -#include "utils/Logger.h" #define USE_GRAPHICS 0 diff --git a/src/output/video/GLWidgetRenderer.cpp b/src/output/video/GLWidgetRenderer.cpp index 9c98d186a..3e24a065c 100644 --- a/src/output/video/GLWidgetRenderer.cpp +++ b/src/output/video/GLWidgetRenderer.cpp @@ -1,6 +1,6 @@ /****************************************************************************** QtAV: Media play library based on Qt and FFmpeg - Copyright (C) 2012-2014 Wang Bin + Copyright (C) 2012-2015 Wang Bin * This file is part of QtAV @@ -44,7 +44,6 @@ #include "QtAV/ColorTransform.h" #include "QtAV/FilterContext.h" -#include "utils/Logger.h" #define UPLOAD_ROI 0 #define ROI_TEXCOORDS 1 diff --git a/src/output/video/GraphicsItemRenderer.cpp b/src/output/video/GraphicsItemRenderer.cpp index 20ded8fa0..2becbc0c9 100644 --- a/src/output/video/GraphicsItemRenderer.cpp +++ b/src/output/video/GraphicsItemRenderer.cpp @@ -1,6 +1,6 @@ /****************************************************************************** QtAV: Media play library based on Qt and FFmpeg - Copyright (C) 2012-2014 Wang Bin + Copyright (C) 2012-2015 Wang Bin * This file is part of QtAV @@ -31,7 +31,6 @@ #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include #endif -#include "utils/Logger.h" namespace QtAV { diff --git a/src/output/video/OpenGLWidgetRenderer.cpp b/src/output/video/OpenGLWidgetRenderer.cpp index 86f66173a..26bbf3420 100644 --- a/src/output/video/OpenGLWidgetRenderer.cpp +++ b/src/output/video/OpenGLWidgetRenderer.cpp @@ -1,6 +1,6 @@ /****************************************************************************** QtAV: Media play library based on Qt and FFmpeg - Copyright (C) 2014 Wang Bin + Copyright (C) 2014-2015 Wang Bin * This file is part of QtAV @@ -22,7 +22,6 @@ #include "QtAV/OpenGLWidgetRenderer.h" #include "QtAV/private/OpenGLRendererBase_p.h" #include -#include "utils/Logger.h" namespace QtAV { diff --git a/src/output/video/VideoOutput.cpp b/src/output/video/VideoOutput.cpp index 51dd4c4a0..1473c2ee7 100644 --- a/src/output/video/VideoOutput.cpp +++ b/src/output/video/VideoOutput.cpp @@ -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) { @@ -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)) { } diff --git a/src/output/video/VideoOutputEventFilter.cpp b/src/output/video/VideoOutputEventFilter.cpp index 5042649c8..453ff9e12 100644 --- a/src/output/video/VideoOutputEventFilter.cpp +++ b/src/output/video/VideoOutputEventFilter.cpp @@ -24,7 +24,6 @@ #include #include #include -#include "utils/Logger.h" namespace QtAV { diff --git a/src/output/video/VideoRendererTypes.cpp b/src/output/video/VideoRendererTypes.cpp index 711750cd7..fb90d271d 100644 --- a/src/output/video/VideoRendererTypes.cpp +++ b/src/output/video/VideoRendererTypes.cpp @@ -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") diff --git a/src/output/video/WidgetRenderer.cpp b/src/output/video/WidgetRenderer.cpp index 343648a2c..652a186a7 100644 --- a/src/output/video/WidgetRenderer.cpp +++ b/src/output/video/WidgetRenderer.cpp @@ -1,6 +1,6 @@ /****************************************************************************** QtAV: Media play library based on Qt and FFmpeg - Copyright (C) 2012-2014 Wang Bin + Copyright (C) 2012-2015 Wang Bin * This file is part of QtAV @@ -26,7 +26,6 @@ #include #include #include "QtAV/Filter.h" -#include "utils/Logger.h" namespace QtAV { diff --git a/src/output/video/XVRenderer.cpp b/src/output/video/XVRenderer.cpp index 229a14b03..c9d63a618 100644 --- a/src/output/video/XVRenderer.cpp +++ b/src/output/video/XVRenderer.cpp @@ -1,6 +1,6 @@ /****************************************************************************** QtAV: Media play library based on Qt and FFmpeg - Copyright (C) 2012-2014 Wang Bin + Copyright (C) 2012-2015 Wang Bin * This file is part of QtAV @@ -34,8 +34,6 @@ #include #include "QtAV/private/prepost.h" -#include "utils/Logger.h" - //http://huangbster.i.sohu.com/blog/view/256490057.htm namespace QtAV { diff --git a/tests/extract/main.cpp b/tests/extract/main.cpp index ce78f1fb4..ed7bb82df 100644 --- a/tests/extract/main.cpp +++ b/tests/extract/main.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/widgets/QtAVWidgets/global.h b/widgets/QtAVWidgets/global.h index 89afd62ef..9195c89c5 100644 --- a/widgets/QtAVWidgets/global.h +++ b/widgets/QtAVWidgets/global.h @@ -23,7 +23,7 @@ #ifndef QTAVWIDGETS_GLOBAL_H #define QTAVWIDGETS_GLOBAL_H -#include +#include #if defined(BUILD_QTAVWIDGETS_LIB) # undef Q_AVWIDGETS_EXPORT @@ -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(); diff --git a/widgets/global.cpp b/widgets/global.cpp index 15255323d..9fb59f75c 100644 --- a/widgets/global.cpp +++ b/widgets/global.cpp @@ -45,6 +45,15 @@ namespace QtAV { +VideoRendererId VideoRendererId_Widget = mkid::id32base36_6<'W', 'i', 'd', 'g', 'e', 't'>::value; +VideoRendererId VideoRendererId_OpenGLWidget = mkid::id32base36_6<'Q', 'O', 'G', 'L', 'W', 't'>::value; +VideoRendererId VideoRendererId_GLWidget2 = mkid::id32base36_6<'Q', 'G', 'L', 'W', 't', '2'>::value; +VideoRendererId VideoRendererId_GLWidget = mkid::id32base36_6<'Q', 'G', 'L', 'W', 't', '1'>::value; +VideoRendererId VideoRendererId_GraphicsItem = mkid::id32base36_6<'Q', 'G', 'r', 'a', 'p', 'h'>::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; + //QPainterRenderer is abstract. So can not register(operator new will needed) FACTORY_REGISTER_ID_AUTO(VideoRenderer, Widget, "QWidegt") diff --git a/widgets/libQtAVWidgets.pro b/widgets/libQtAVWidgets.pro index a0e4bde9e..391c98ce3 100644 --- a/widgets/libQtAVWidgets.pro +++ b/widgets/libQtAVWidgets.pro @@ -26,7 +26,7 @@ preparePaths($$OUT_PWD/../out) QTAVSRC=$$PROJECTROOT/src !rc_file { - RC_ICONS = QtAV.ico + RC_ICONS = $$PROJECTROOT/src/QtAV.ico QMAKE_TARGET_COMPANY = "Shanghai University->S3 Graphics->Deepin | wbsecg1@gmail.com" QMAKE_TARGET_DESCRIPTION = "QtAVWidgets module. QtAV Multimedia playback framework. http://www.qtav.org" QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2012-2015 WangBin, wbsecg1@gmail.com" @@ -48,6 +48,11 @@ QTAVSRC=$$PROJECTROOT/src OTHER_FILES += $$RC_FILE $$QTAVSRC/QtAV.svg #TRANSLATIONS = i18n/QtAV_zh_CN.ts +win32 { +#dynamicgl: __impl__GetDC __impl_ReleaseDC + LIBS += -luser32 +} + SDK_HEADERS *= \ QtAVWidgets/QtAVWidgets.h \ QtAVWidgets/global.h \ @@ -67,9 +72,10 @@ config_gl { SOURCES += $$QTAVSRC/output/video/GLWidgetRenderer2.cpp SDK_HEADERS += $$QTAVSRC/QtAV/GLWidgetRenderer2.h !contains(QT_CONFIG, dynamicgl) { #dynamicgl does not support old gl1 functions which used in GLWidgetRenderer - DEFINES *= QTAV_HAVE_GL1 - SOURCES += $$QTAVSRC/output/video/GLWidgetRenderer.cpp - SDK_HEADERS += $$QTAVSRC/QtAV/GLWidgetRenderer.h +#GLWidgetRenderer depends on internal functions of QtAV + #DEFINES *= QTAV_HAVE_GL1 + #SOURCES += $$QTAVSRC/output/video/GLWidgetRenderer.cpp + #SDK_HEADERS += $$QTAVSRC/QtAV/GLWidgetRenderer.h } } config_opengl {