36 |
--------------------------------------------------------------------------------
/src/AudioResamplerFF.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #define BUILD_SWR
23 | #include "AudioResamplerTemplate.cpp"
24 |
--------------------------------------------------------------------------------
/config.tests/direct2d/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/dsound/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/gl/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/avutil/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/avcodec/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/avdevice/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/avformat/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/libcedarv/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/swscale/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/avresample/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/config.tests/swresample/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/src/QtAV.rc:
--------------------------------------------------------------------------------
1 | #include "winver.h"
2 | #include "QtAV/version.h"
3 | IDI_ICON1 ICON DISCARDABLE "QtAV.ico"
4 |
5 | VS_VERSION_INFO VERSIONINFO
6 | FILEVERSION QTAV_MAJOR,QTAV_MINOR,QTAV_PATCH,0
7 | PRODUCTVERSION QTAV_MAJOR,QTAV_MINOR,QTAV_PATCH,0
8 | #ifdef _DEBUG
9 | FILEFLAGS VS_FF_DEBUG
10 | #else
11 | FILEFLAGS 0x0L
12 | #endif
13 | FILEFLAGSMASK 0x3fL
14 | FILEOS VOS_NT_WINDOWS32
15 | FILETYPE VFT_DLL
16 | FILESUBTYPE 0x0L
17 | BEGIN
18 | BLOCK "StringFileInfo"
19 | BEGIN
20 | BLOCK "000004b0"
21 | BEGIN
22 | VALUE "CompanyName", "Shanghai University->S3 Graphics->Deepin | wbsecg1@gmail.com"
23 | VALUE "FileDescription", "QtAV Multimedia playback framework. http://www.qtav.org"
24 | VALUE "FileVersion", QTAV_VERSION_STR ".0"
25 | VALUE "LegalCopyright", "Copyright (C) 2012-2015 WangBin, wbsecg1@gmail.com"
26 | VALUE "InternalName", "QtAV"
27 | VALUE "OriginalFilename", "QtAV.dll"
28 | VALUE "ProductName", "QtAV"
29 | VALUE "ProductVersion", QTAV_VERSION_STR ".0"
30 | END
31 | END
32 | BLOCK "VarFileInfo"
33 | BEGIN
34 | VALUE "Translation", 0x0, 1200
35 | END
36 | END
37 |
--------------------------------------------------------------------------------
/config.tests/gdiplus/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include //vc
22 | #include
23 |
24 | int main()
25 | {
26 | return 0;
27 | }
28 |
--------------------------------------------------------------------------------
/src/AudioResamplerLibav.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 |
23 | #define QTAV_HAVE_SWR_AVR_MAP 1
24 | #define BUILD_AVR
25 | #include "AudioResamplerTemplate.cpp"
26 |
--------------------------------------------------------------------------------
/examples/sharedoutput/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | Shared output: shared renderer test
3 | Copyright (C) 2012-2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #include "widget.h"
22 | #include
23 |
24 | int main(int argc, char *argv[])
25 | {
26 | QApplication a(argc, argv);
27 | Widget w;
28 | w.show();
29 |
30 | return a.exec();
31 | }
32 |
--------------------------------------------------------------------------------
/widgets/QtAVWidgets.rc:
--------------------------------------------------------------------------------
1 | #include "winver.h"
2 | #include "QtAVWidgets/version.h"
3 |
4 | VS_VERSION_INFO VERSIONINFO
5 | FILEVERSION QTAV_MAJOR,QTAV_MINOR,QTAV_PATCH,0
6 | PRODUCTVERSION QTAV_MAJOR,QTAV_MINOR,QTAV_PATCH,0
7 | #ifdef _DEBUG
8 | FILEFLAGS VS_FF_DEBUG
9 | #else
10 | FILEFLAGS 0x0L
11 | #endif
12 | FILEFLAGSMASK 0x3fL
13 | FILEOS VOS_NT_WINDOWS32
14 | FILETYPE VFT_DLL
15 | FILESUBTYPE 0x0L
16 | BEGIN
17 | BLOCK "StringFileInfo"
18 | BEGIN
19 | BLOCK "000004b0"
20 | BEGIN
21 | VALUE "CompanyName", "Shanghai University->S3 Graphics->Deepin | wbsecg1@gmail.com"
22 | VALUE "FileDescription", "QtAVWidgets module. QtAV Multimedia playback framework. http://www.qtav.org"
23 | VALUE "FileVersion", QTAVWIDGETS_VERSION_STR ".0"
24 | VALUE "LegalCopyright", "Copyright (C) 2012-2015 WangBin, wbsecg1@gmail.com"
25 | VALUE "InternalName", "QtAV Widgets"
26 | VALUE "OriginalFilename", "QtAVWidgets.dll"
27 | VALUE "ProductName", "QtAV Widgets"
28 | VALUE "ProductVersion", QTAVWIDGETS_VERSION_STR ".0"
29 | END
30 | END
31 | BLOCK "VarFileInfo"
32 | BEGIN
33 | VALUE "Translation", 0x0, 1200
34 | END
35 | END
36 |
--------------------------------------------------------------------------------
/config.tests/avfilter/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | int main()
24 | {
25 | // avfilter_register_all();
26 | return 0;
27 | }
28 |
--------------------------------------------------------------------------------
/config.tests/vaapi/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 | #include
23 |
24 | int main()
25 | {
26 | vaErrorStr(0);
27 | return 0;
28 | }
29 |
--------------------------------------------------------------------------------
/config.tests/xv/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 | #include
23 | #include
24 |
25 | int main()
26 | {
27 | return 0;
28 | }
29 |
--------------------------------------------------------------------------------
/config.tests/libass/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | extern "C" {
22 | #include
23 | }
24 | int main()
25 | {
26 | ass_library_done(ass_library_init());
27 | return 0;
28 | }
29 |
--------------------------------------------------------------------------------
/doc/NativePaintingInQWidget.md:
--------------------------------------------------------------------------------
1 | Sometimes, we may want paint in QWidget without QPainter, for example, using DirectX api. This document will tell you how to reach it.
2 |
3 | ###0. setAttribute(Qt::WA_PaintOnScreen, true)
4 |
5 | Document says that if you want to use native painting, the attribute should be true. Otherwise you will see the fuck flicker.
6 |
7 | ###1. Let paint engine be 0
8 |
9 | Thus QPainter is disabled. Otherwise you will see the fuck flicker again.
10 | This page is helpful: http://lists.trolltech.com/qt4-preview-feedback/2005-04/thread00609-0.html
11 | It seems that let paintEngine() return 0 is from here.
12 |
13 | ###2. Reimplement `paintEvent`
14 |
15 | Oberviously, you should do something here. You can begin the painting in paintEvent
16 |
17 | ###3. Reimplement `showEvent`
18 |
19 | This is important if you change the `WindowStaysOnTopHint` flag. As far as i know, some paint engines use the resource depend on the window. If window changes, resource must be recreated again. For example, render target in direct2d, device context in gdi+. If the window flag `WindowStaysOnTopHint` changes, the widget will hide then show again, maybe that's the reason. If you forget this step, then the widget will never update again after the `WindowStaysOnTopHint` changes.
20 |
--------------------------------------------------------------------------------
/examples/QMLPlayer/qml/QMLPlayer/DelegateItem.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 | import "utils.js" as Utils
3 |
4 | Rectangle {
5 | id: root
6 | width: Utils.kItemWidth
7 | height: Utils.kItemHeight
8 | property color selectedColor: "#66ddaadd"
9 | property alias text: itemText.text
10 | color: "#99000000"
11 | signal clicked
12 | Text {
13 | id: itemText
14 | color: "white"
15 | font.pixelSize: Utils.kFontSize
16 | anchors.centerIn: parent
17 | horizontalAlignment: Text.AlignHCenter
18 | verticalAlignment: Text.AlignVCenter
19 | }
20 | MouseArea {
21 | anchors.fill: parent
22 | onClicked: {
23 | root.state = "selected"
24 | root.clicked()
25 | }
26 | }
27 | states: [
28 | State {
29 | name: "selected"
30 | PropertyChanges {
31 | target: delegateItem
32 | color: selectedColor
33 | }
34 | }
35 | ]
36 | transitions: [
37 | Transition {
38 | from: "*"; to: "*"
39 | ColorAnimation {
40 | properties: "color"
41 | easing.type: Easing.OutQuart
42 | duration: 500
43 | }
44 | }
45 | ]
46 | }
47 |
--------------------------------------------------------------------------------
/examples/videocapture/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | Simple Player: this file is part of QtAV examples
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 | #include
21 | #include "playerwindow.h"
22 |
23 | int main(int argc, char *argv[])
24 | {
25 | QApplication a(argc, argv);
26 | PlayerWindow player;
27 | player.show();
28 | player.resize(800, 600);
29 | return a.exec();
30 | }
31 |
--------------------------------------------------------------------------------
/config.tests/openal/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #if defined(HEADER_OPENAL_PREFIX)
23 | #include
24 | #include
25 | #else
26 | #include
27 | #include
28 | #endif
29 |
30 | int main()
31 | {
32 | return 0;
33 | }
34 |
--------------------------------------------------------------------------------
/qtc_packaging/debian_generic/player.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Type=Application
3 | Name=QtAV Player
4 | GenericName=QtAV player
5 | Comment=QtAV Multimedia Player
6 | Comment[zh]=多媒体播放器
7 | Icon=QtAV
8 | TryExec=/usr/bin/player
9 | Exec=player -f %U
10 | Terminal=false
11 | Categories=Qt;AudioVideo;Audio;Video;Player;TV;
12 | MimeType=application/ogg;application/x-ogg;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/m4a;audio/x-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg;video/x-mpeg2;video/mp4;video/msvideo;video/x-msvideo;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-avi;video/x-fli;video/x-flv;video/x-theora;video/x-matroska;video/webm;audio/x-flac;audio/x-vorbis+ogg;video/x-ogm+ogg;audio/x-shorten;audio/x-ape;audio/x-wavpack;audio/x-tta;audio/AMR;audio/ac3;video/mp2t;audio/flac;
13 | X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb
14 |
--------------------------------------------------------------------------------
/examples/simpleplayer/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | Simple Player: this file is part of QtAV examples
3 | Copyright (C) 2012-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 | #include
21 | #include "playerwindow.h"
22 | #include
23 |
24 | int main(int argc, char *argv[])
25 | {
26 | QtAV::Widgets::registerRenderers();
27 | QApplication a(argc, argv);
28 | PlayerWindow player;
29 | player.show();
30 | player.resize(800, 600);
31 | return a.exec();
32 | }
33 |
--------------------------------------------------------------------------------
/qtc_packaging/debian_generic/QMLPlayer.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Type=Application
3 | Name=QtAV QML Player
4 | GenericName=QtAV QML player
5 | Comment=QtAV Multimedia Player
6 | Comment[zh]=多媒体播放器
7 | Icon=QtAV
8 | TryExec=/usr/bin/QMLPlayer
9 | Exec=QMLPlayer -f %U
10 | Terminal=false
11 | Categories=Qt;AudioVideo;Audio;Video;Player;TV;
12 | MimeType=application/ogg;application/x-ogg;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/m4a;audio/x-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg;video/x-mpeg2;video/mp4;video/msvideo;video/x-msvideo;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-avi;video/x-fli;video/x-flv;video/x-theora;video/x-matroska;video/webm;audio/x-flac;audio/x-vorbis+ogg;video/x-ogm+ogg;audio/x-shorten;audio/x-ape;audio/x-wavpack;audio/x-tta;audio/AMR;audio/ac3;video/mp2t;audio/flac;
13 | X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb
14 |
--------------------------------------------------------------------------------
/config.tests/sse4_1/sse4_1.pro:
--------------------------------------------------------------------------------
1 | SOURCES = sse4_1.cpp
2 | #SSE4_1_SOURCES = sse4_1.cpp
3 | CONFIG -= qt dylib release debug_and_release
4 | CONFIG += debug console sse4_1
5 |
6 | # for Qt4. we can only detect sse2 in Qt4
7 | #qt5 only has gcc, qcc, vc, linux icc.
8 | win32-icc {
9 | QMAKE_CFLAGS_SSE4_1 = -arch:SSE4.1
10 | } else:*-icc { #mac, linux
11 | QMAKE_CFLAGS_SSE4_1 = -xSSE4.1
12 | } else:*msvc* {
13 | QMAKE_CFLAGS_SSE4_1 = -arch:SSE2
14 | } else {
15 | QMAKE_CFLAGS_SSE4_1 = -msse4.1
16 | }
17 |
18 | sse4_1 {
19 | HEADERS += $$SSE4_1_HEADERS
20 |
21 | sse4_1_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
22 | !contains(QT_CPU_FEATURES, sse4_1):sse4_1_compiler.commands += $$QMAKE_CFLAGS_SSE4_1
23 | sse4_1_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
24 | sse4_1_compiler.dependency_type = TYPE_C
25 | sse4_1_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
26 | sse4_1_compiler.input = SSE4_1_SOURCES
27 | sse4_1_compiler.variable_out = OBJECTS
28 | sse4_1_compiler.name = compiling[sse4_1] ${QMAKE_FILE_IN}
29 | silent:sse4_1_compiler.commands = @echo compiling[sse4_1] ${QMAKE_FILE_IN} && $$sse4_1_compiler.commands
30 | QMAKE_EXTRA_COMPILERS += sse4_1_compiler
31 | }
32 |
33 | isEmpty(QMAKE_CFLAGS_SSE4_1):error("This compiler does not support SSE4.1")
34 | else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_1
35 |
--------------------------------------------------------------------------------
/config.tests/xaudio2/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #include
22 |
23 | #if(_WIN32_WINNT < _WIN32_WINNT_WIN8)
24 | #error "XAudio2 is not from Windows SDK. Use header from June 2010 DXSDK"
25 | #endif // (_WIN32_WINNT < _WIN32_WINNT_WIN8)
26 |
27 | int main()
28 | {
29 | return 0;
30 | }
31 |
--------------------------------------------------------------------------------
/scripts/dll_osx.sh:
--------------------------------------------------------------------------------
1 |
2 |
3 | function fix_qt_path() {
4 | local EXE=$1
5 | local QTEXE=`otool -L $EXE |grep Qt |grep -v ':'`
6 | for Q in $QTEXE
7 | do
8 | if [ -n "`echo $Q |grep framework`" ]; then
9 | echo Q=$Q
10 | OLD=`echo $Q |cut -d ' ' -f 1`
11 | echo OLD=$OLD
12 | REL=`echo $OLD |sed 's,.*\/\(.*\)\(\.framework\/.*\),\1\2,'`
13 | REL_DIR=${REL%/*}
14 | NEW="@rpath/Frameworks/$REL"
15 | #NEW="@rpath/Frameworks/$REL"
16 | install_name_tool -change $OLD $NEW $EXE #$REL
17 | echo install_name_tool -change $OLD $NEW $EXE
18 |
19 | fi
20 | done
21 | }
22 |
23 | function copy_qt() {
24 | local EXE=$1
25 | local QTEXE=`otool -L $EXE |grep Qt |grep -v ':'`
26 | for Q in $QTEXE
27 | do
28 | if [ -n "`echo $Q |grep framework`" ]; then
29 | echo Q=$Q
30 | OLD=`echo $Q |cut -d ' ' -f 1`
31 | echo OLD=$OLD
32 | REL=`echo $OLD |sed 's,.*\/\(.*\)\(\.framework\/.*\),\1\2,'`
33 | REL_DIR=${REL%/*}
34 | mkdir -p $REL_DIR
35 |
36 | if [ -f $REL ]; then
37 | echo "already exists. skip copy. $REL"
38 | else
39 | cp -L $Q $REL
40 | fi
41 | NEW="@rpath/Frameworks/$REL"
42 | install_name_tool -change $OLD $NEW $REL
43 | echo install_name_tool -change $OLD $NEW $EXE
44 | fi
45 | done
46 | }
47 |
48 | [ "$1" = "-c" ] && copy_qt $2 || fix_qt_path $1
49 |
--------------------------------------------------------------------------------
/examples/QMLPlayer/android/src/org/qtav/qmlplayer/QMLPlayerActivity.java:
--------------------------------------------------------------------------------
1 | package org.qtav.qmlplayer;
2 | import org.qtproject.qt5.android.bindings.QtActivity;
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.app.PendingIntent;
6 | import android.util.Log;
7 | import android.os.Bundle;
8 | import android.view.WindowManager;
9 |
10 | public class QMLPlayerActivity extends QtActivity
11 | {
12 | private final static String TAG = "QMLPlayer";
13 | private static String m_request_url;
14 | private static QMLPlayerActivity m_instance;
15 | public QMLPlayerActivity() {
16 | m_instance = this;
17 | }
18 | public static String getUrl() {
19 | return m_instance.m_request_url;
20 | }
21 |
22 | @Override
23 | public void onCreate(Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 | //getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
26 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
27 | Intent intent = getIntent();
28 | String action = intent.getAction();
29 |
30 | Log.i("QMLPlayerActivity", "Action: " + action);
31 | Log.i("QMLPlayerActivity", "Data: " + intent.getDataString());
32 | if (intent.ACTION_VIEW.equals(action)) {
33 | m_request_url = intent.getDataString();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/subtitle/PlainText.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_PLAINTEXT_H
23 | #define QTAV_PLAINTEXT_H
24 |
25 | #include
26 |
27 | namespace QtAV {
28 | namespace PlainText {
29 |
30 | QString fromAss(const char* ass);
31 |
32 | } //namespace PlainText
33 |
34 | } //namespace QtAV
35 | #endif // QTAV_PLAINTEXT_H
36 |
--------------------------------------------------------------------------------
/examples/player/filters/AVFilterSubtitle.h:
--------------------------------------------------------------------------------
1 | #ifndef QTAV_AVFilterSubtitle_H
2 | #define QTAV_AVFilterSubtitle_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | using namespace QtAV;
9 | class AVFilterSubtitle : public LibAVFilterVideo
10 | {
11 | Q_OBJECT
12 | Q_PROPERTY(bool autoLoad READ autoLoad WRITE setAutoLoad NOTIFY autoLoadChanged)
13 | Q_PROPERTY(QString file READ file WRITE setFile NOTIFY fileChanged)
14 | public:
15 | explicit AVFilterSubtitle(QObject *parent = 0);
16 | void setPlayer(AVPlayer* player);
17 | QString setContent(const QString& doc); // return utf8 subtitle path
18 | bool setFile(const QString& filePath);
19 | QString file() const;
20 | bool autoLoad() const;
21 |
22 | signals:
23 | void loaded();
24 | void loadError();
25 | void fileChanged(const QString& path);
26 | void autoLoadChanged(bool value);
27 | public slots:
28 | // TODO: enable changed & autoload=> load
29 | void setAutoLoad(bool value);
30 | void findAndSetFile(const QString& path);
31 | void onPlayerStart();
32 | private slots:
33 | void onStatusChanged();
34 | private:
35 | bool m_auto;
36 | AVPlayer *m_player;
37 | QString m_file;
38 | // convert to utf8 to ensure ffmpeg can open it.
39 | QHash m_u8_files;
40 | };
41 |
42 | #endif // QTAV_AVFilterSubtitle_H
43 |
--------------------------------------------------------------------------------
/qtc_packaging/ifw/packages/com.qtav.product.dev/data/sdk_deploy.bat:
--------------------------------------------------------------------------------
1 | @echo QtAV SDK deployment tool for installer
2 | @echo off
3 | choice /c iu /m "Press 'I' to install QtAV SDK, 'U' to uninstall"
4 | set ACT=%errorlevel%
5 | @echo Input your absolute Qt folder contains bin, include, lib etc.
6 | @echo Or drag Qt folder here
7 | @echo Then press ENTER
8 | @echo example: C:\Qt5.4.1\5.4\mingw32_49
9 |
10 | set /p QTDIR=
11 |
12 | if "%ACT%" == "2" (
13 | goto uninstall
14 | ) else (
15 | goto install
16 | )
17 |
18 | :install
19 | copy /y bin\Qt*AV*.dll %QTDIR%\bin
20 | copy /y bin\av*.dll %QTDIR%\bin
21 | copy /y bin\sw*.dll %QTDIR%\bin
22 | copy /y bin\*openal*.dll %QTDIR%\bin
23 | copy /y bin\*portaudio*.dll %QTDIR%\bin
24 | xcopy /syi include %QTDIR%\include
25 | copy /y lib\*Qt*AV*.lib %QTDIR%\lib
26 | copy /y lib\*Qt*AV*.a %QTDIR%\lib
27 | xcopy /syi qml\QtAV %QTDIR%\qml\QtAV
28 | xcopy /syi mkspecs %QTDIR%\mkspecs
29 | @echo QtAV SDK is installed
30 | goto END
31 |
32 | :uninstall
33 | del %QTDIR%\bin\Qt*AV*.dll
34 | del %QTDIR%\bin\av*.dll
35 | del %QTDIR%\bin\sw*.dll
36 | del %QTDIR%\bin\*openal*.dll
37 | del %QTDIR%\bin\*portaudio*.dll
38 | rd /s /q %QTDIR%\include\QtAV
39 | rd /s /q %QTDIR%\include\QtAVWidgets
40 | del %QTDIR%\lib\*Qt*AV*
41 | del %QTDIR%\mkspecs\modules\qt_lib_av*.pri
42 | del %QTDIR%\mkspecs\features\av*.prf
43 | rd /s /q %QTDIR%\qml\QtAV
44 | @echo QtAV SDK is uninstalled
45 | goto END
46 |
47 | :END
48 | pause
49 | @echo on
50 |
--------------------------------------------------------------------------------
/contrib/d2d1headers/d2dbasetypes.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | d2dbasetypes.h - Header file for the Direct2D API
4 |
5 | No original Microsoft headers were used in the creation of this
6 | file.
7 |
8 | */
9 |
10 | #ifndef _D2DBASETYPES_H
11 | #define _D2DBASETYPES_H
12 | #if __GNUC__ >=3
13 | #pragma GCC system_header
14 | #endif
15 |
16 | #include
17 |
18 | typedef D3DCOLORVALUE D2D_COLOR_F;
19 |
20 | struct D2D_MATRIX_3X2_F {
21 | FLOAT _11;
22 | FLOAT _12;
23 | FLOAT _21;
24 | FLOAT _22;
25 | FLOAT _31;
26 | FLOAT _32;
27 | };
28 |
29 | struct D2D_POINT_2F {
30 | FLOAT x;
31 | FLOAT y;
32 | };
33 |
34 | struct D2D_POINT_2U {
35 | UINT32 x;
36 | UINT32 y;
37 | };
38 |
39 | struct D2D_RECT_F {
40 | FLOAT left;
41 | FLOAT top;
42 | FLOAT right;
43 | FLOAT bottom;
44 | };
45 |
46 | struct D2D_RECT_U {
47 | UINT32 left;
48 | UINT32 top;
49 | UINT32 right;
50 | UINT32 bottom;
51 | };
52 |
53 | struct D2D_SIZE_F {
54 | FLOAT width;
55 | FLOAT height;
56 | };
57 |
58 | struct D2D_SIZE_U {
59 | UINT32 width;
60 | UINT32 height;
61 | };
62 |
63 | typedef D2D_COLOR_F D2D1_COLOR_F;
64 |
65 | typedef struct D2D_POINT_2F D2D1_POINT_2F;
66 |
67 | typedef struct D2D_POINT_2U D2D1_POINT_2U;
68 |
69 | typedef struct D2D_RECT_F D2D1_RECT_F;
70 |
71 | typedef struct D2D_RECT_U D2D1_RECT_U;
72 |
73 | typedef struct D2D_SIZE_F D2D1_SIZE_F;
74 |
75 | typedef struct D2D_SIZE_U D2D1_SIZE_U;
76 |
77 | #endif /* _D2DBASETYPES_H */
78 |
--------------------------------------------------------------------------------
/src/AudioResamplerTypes.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | VideoRendererTypes: type id and manually id register function
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #include "QtAV/AudioResamplerTypes.h"
23 | #include "QtAV/private/mkid.h"
24 |
25 | namespace QtAV {
26 |
27 | AudioResamplerId AudioResamplerId_FF = mkid::id32base36_6<'F', 'F', 'm', 'p', 'e', 'g'>::value;
28 | AudioResamplerId AudioResamplerId_Libav = mkid::id32base36_5<'L', 'i', 'b', 'a', 'v'>::value;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/examples/player/ClickableMenu.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV Player Demo: this file is part of QtAV examples
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 |
22 | #ifndef CLICKABLEMENU_H
23 | #define CLICKABLEMENU_H
24 |
25 | #include
26 |
27 | class ClickableMenu : public QMenu
28 | {
29 | Q_OBJECT
30 | public:
31 | explicit ClickableMenu(QWidget *parent = 0);
32 | explicit ClickableMenu(const QString& title, QWidget *parent = 0);
33 |
34 | protected:
35 | virtual void mouseReleaseEvent(QMouseEvent *);
36 |
37 | };
38 |
39 | #endif // CLICKABLEMENU_H
40 |
--------------------------------------------------------------------------------
/qml/QmlAV/Export.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_QML_EXPORT_H
23 | #define QTAV_QML_EXPORT_H
24 |
25 | #include
26 |
27 | #if defined(BUILD_QMLAV_LIB)
28 | # undef QMLAV_EXPORT
29 | # define QMLAV_EXPORT Q_DECL_EXPORT
30 | #else
31 | # undef QMLAV_EXPORT
32 | # define QMLAV_EXPORT Q_DECL_IMPORT //only for vc?
33 | #endif
34 |
35 | #endif // QTAV_QML_EXPORT_H
36 |
--------------------------------------------------------------------------------
/examples/QMLPlayer/qml/QMLPlayer/ConfigPanel.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 | import "utils.js" as Utils
3 |
4 | Rectangle {
5 | id: root
6 | property string selected: ""
7 | property string selectedUrl
8 | property int selectedX: 0
9 | property int selectedY: 0
10 | color: "#80101010"
11 |
12 | signal clicked
13 |
14 | Menu {
15 | id: menu
16 | anchors.fill: parent
17 | anchors.topMargin: Utils.scaled(40)
18 | itemWidth: root.width - Utils.scaled(2)
19 | spacing: Utils.scaled(1)
20 | model: ListModel {
21 | id: contentModel
22 | // ListElement property value can not be script before Qt5.4. translate here(QT_TR_NOOP) and used in other qml fails
23 | }
24 | onClicked: {
25 | selectedX = x
26 | selectedY = y
27 | selectedUrl = model.get(index).url
28 | root.clicked()
29 | }
30 | }
31 | Component.onCompleted: {
32 | contentModel.append({name: qsTr("Media info"), url: "MediaInfoPage.qml" })
33 | contentModel.append({name: qsTr("Video codec"), url: "VideoCodec.qml" })
34 | contentModel.append({name: qsTr("Subtitle"), url: "SubtitlePage.qml" })
35 | contentModel.append({name: qsTr("Audio"), url: "AudioPage.qml" })
36 | contentModel.append({name: qsTr("Preview"), url: "PreviewPage.qml" })
37 | contentModel.append({name: qsTr("About"), url: "About.qml" })
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/QtAV/AudioResamplerTypes.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | VideoRendererTypes: type id and manually id register function
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 | #ifndef QTAV_AUDIORESAMPLERTYPES_H
22 | #define QTAV_AUDIORESAMPLERTYPES_H
23 |
24 | #include
25 |
26 | namespace QtAV {
27 |
28 | extern Q_AV_EXPORT AudioResamplerId AudioResamplerId_FF;
29 | extern Q_AV_EXPORT AudioResamplerId AudioResamplerId_Libav;
30 |
31 | } //namespace QtAV
32 |
33 | #endif // QTAV_AUDIORESAMPLERTYPES_H
34 |
--------------------------------------------------------------------------------
/scripts/perftest.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | import json
5 | import subprocess
6 | import time
7 | import psutil
8 |
9 | def get_process_info(p):
10 | try:
11 | cpu = int(p.get_cpu_percent(interval=0)) #0: non-blocking
12 | rss, vms = p.get_memory_info()
13 | name = p.name
14 | pid = p.pid
15 | except psutil.error.NoSuchProcess, e:
16 | name = "Invalid process"
17 | pid = 0
18 | rss = 0
19 | vms = 0
20 | cpu = 0
21 | return {'cpu': cpu, 'rss': rss, 'vms': vms}
22 |
23 | def main():
24 | conf_file = open('perftest.json')
25 | conf = json.load(conf_file)
26 | conf_file.close()
27 | cmd = conf['cmd']
28 | # shell == True: process is shell process
29 | proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
30 | p = psutil.Process(proc.pid)
31 | if not p.is_running():
32 | return
33 | name = p.name
34 | pid = p.pid
35 | record = []
36 | print 'recoding...'
37 | while True:
38 | if not p.is_running():
39 | break
40 | record.append(get_process_info(p))
41 | time.sleep(1)
42 |
43 | proc_history = { 'name': name, 'pid': pid, 'history': record }
44 | print proc_history
45 | with open('perftest_result.json', 'wb') as fp:
46 | json.dump(proc_history, fp)
47 | print 'result is saved in perftest_result.json'
48 |
49 | if __name__ == '__main__':
50 | main()
51 |
--------------------------------------------------------------------------------
/qtc_packaging/common/copyright:
--------------------------------------------------------------------------------
1 | This package was debianized by Wang Bin on
2 | Fri, 15 Mar 2013 10:06:55 +0800.
3 |
4 | It was downloaded from
5 |
6 | Upstream Author(s):
7 |
8 | Wang Bin(Lucas Wang) wbsecg1@gmail.com
9 |
10 | Copyright:
11 |
12 | Copyright (C) 2013 Wang Bin(Lucas Wang)
13 |
14 | License:
15 |
16 | This package is free software; you can redistribute it and/or
17 | modify it under the terms of the GNU Lesser General Public
18 | License as published by the Free Software Foundation; either
19 | version 2.1 of the License, or (at your option) any later version.
20 |
21 | This library is distributed in the hope that it will be useful,
22 | but WITHOUT ANY WARRANTY; without even the implied warranty of
23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 | Lesser General Public License for more details.
25 |
26 | You should have received a copy of the GNU Lesser General Public
27 | License along with this library; if not, write to the Free Software
28 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 |
30 | On Debian systems, the complete text of the GNU Lesser General
31 | Public License can be found in `/usr/share/common-licenses/LGPL'.
32 |
33 | The Debian packaging is (C) 2013, Wang Bin and
34 | is licensed under the LGPL, see above.
35 |
36 |
37 | # Please also look if there are files or directories which have a
38 | # different copyright/license attached and list them here.
39 |
--------------------------------------------------------------------------------
/tests/qrc/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | Simple Player: this file is part of QtAV examples
3 | Copyright (C) 2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 | #include
21 |
22 | #include
23 | #include
24 |
25 | int main(int argc, char *argv[])
26 | {
27 | QApplication a(argc, argv);
28 | QtAV::GLWidgetRenderer2 renderer;
29 | renderer.show();
30 | renderer.setWindowTitle("Play video from qrc--QtAV " + QtAV_Version_String_Long() + " wbsecg1@gmail.com");
31 | QtAV::AVPlayer player;
32 | player.setRenderer(&renderer);
33 |
34 | player.play("qrc:/test.mp4");
35 |
36 | return a.exec();
37 | }
38 |
--------------------------------------------------------------------------------
/widgets/QtAVWidgets/QtAVWidgets.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAVWIDGETS_H
23 | #define QTAVWIDGETS_H
24 |
25 | #include
26 | #include
27 | #include
28 | #include
29 | //#include
30 | #include
31 | #include
32 |
33 | #endif // QTAVWIDGETS_H
34 |
--------------------------------------------------------------------------------
/src/io/tst_mediaio.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | using namespace QtAV;
5 | class tst_MediaIO : public QObject
6 | {
7 | Q_OBJECT
8 | private slots:
9 | void create();
10 | void createForProtocol();
11 | void read();
12 | };
13 |
14 | void tst_MediaIO::create() {
15 | MediaIO *in = MediaIO::create("QFile");
16 | QVERIFY(in);
17 | delete in;
18 | in = MediaIO::create("Other");
19 | QVERIFY(!in);
20 | delete in;
21 | }
22 | void tst_MediaIO::createForProtocol() {
23 | MediaIO *in = MediaIO::createForProtocol("qrc");
24 | QVERIFY(in);
25 | delete in;
26 | in = MediaIO::createForProtocol("");
27 | QVERIFY(in);
28 | QCOMPARE(in->name(), QString("QFile"));
29 | QVERIFY(in->protocols().contains("qrc"));
30 | delete in;
31 | in = MediaIO::createForProtocol("xyz");
32 | QVERIFY(!in);
33 | delete in;
34 | }
35 | void tst_MediaIO::read() {
36 | const QString path(":/QtAV.svg");
37 | MediaIO *in = MediaIO::createForProtocol(path.left(path.indexOf(QChar(':'))));
38 | QVERIFY(in);
39 | QVERIFY(in->isSeekable());
40 | in->setUrl(path);
41 | QByteArray data(1024, 0);
42 | in->read(data.data(), data.size());
43 | QFile f(path);
44 | f.open(QIODevice::ReadOnly);
45 | QByteArray data2(1024, 0);
46 | f.read(data2.data(), data2.size());
47 | QCOMPARE(data, data2);
48 | QCOMPARE(in->size(), f.size());
49 | delete in;
50 | }
51 |
52 | QTEST_MAIN(tst_MediaIO)
53 | #include "tst_avinput.moc"
54 |
--------------------------------------------------------------------------------
/examples/player/ClickableMenu.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV Player Demo: this file is part of QtAV examples
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 |
22 | #include "ClickableMenu.h"
23 | #include
24 |
25 | ClickableMenu::ClickableMenu(QWidget *parent) :
26 | QMenu(parent)
27 | {
28 | }
29 |
30 | ClickableMenu::ClickableMenu(const QString &title, QWidget *parent) :
31 | QMenu(title, parent)
32 | {
33 | }
34 |
35 | void ClickableMenu::mouseReleaseEvent(QMouseEvent *e)
36 | {
37 | QAction *action = actionAt(e->pos());
38 | if (action) {
39 | action->activate(QAction::Trigger);
40 | return;
41 | }
42 | QMenu::mouseReleaseEvent(e);
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/src/QtAV/VideoRendererTypes.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | VideoRendererTypes: type id and manually id register function
3 | Copyright (C) 2013-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_VIDEORENDERERTYPES_H
23 | #define QTAV_VIDEORENDERERTYPES_H
24 |
25 | #include
26 |
27 | namespace QtAV {
28 |
29 | //Q_AV_EXPORT(dllexport/import) is needed if used out of the library
30 | //TODO graphics item?
31 | extern Q_AV_EXPORT VideoRendererId VideoRendererId_OpenGLWindow;
32 |
33 | Q_AV_EXPORT void VideoRenderer_RegisterAll();
34 |
35 | } //namespace QtAV
36 |
37 | #endif // QTAV_VIDEORENDERERTYPES_H
38 |
--------------------------------------------------------------------------------
/examples/player/res/help.html:
--------------------------------------------------------------------------------
1 |
37 |
--------------------------------------------------------------------------------
/src/AudioThread.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2012-2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QAV_AUDIOTHREAD_H
23 | #define QAV_AUDIOTHREAD_H
24 |
25 | #include "AVThread.h"
26 |
27 | namespace QtAV {
28 |
29 | class AudioDecoder;
30 | class AudioFrame;
31 | class AudioThreadPrivate;
32 | class AudioThread : public AVThread
33 | {
34 | Q_OBJECT
35 | DPTR_DECLARE_PRIVATE(AudioThread)
36 | public:
37 | explicit AudioThread(QObject *parent = 0);
38 |
39 | protected:
40 | void applyFilters(AudioFrame& frame);
41 | virtual void run();
42 | };
43 |
44 | } //namespace QtAV
45 | #endif // QAV_AUDIOTHREAD_H
46 |
--------------------------------------------------------------------------------
/src/subtitle/CharsetDetector.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_CHARSETDETECTOR_H
23 | #define QTAV_CHARSETDETECTOR_H
24 |
25 | #include
26 |
27 | class CharsetDetector
28 | {
29 | public:
30 | CharsetDetector();
31 | ~CharsetDetector();
32 | bool isAvailable() const;
33 | /*!
34 | * \brief detect
35 | * \param data text to parse
36 | * \return charset name
37 | */
38 | QByteArray detect(const QByteArray& data);
39 | private:
40 | class Private;
41 | Private *priv;
42 | };
43 |
44 | #endif // QTAV_CHARSETDETECTOR_H
45 |
--------------------------------------------------------------------------------
/examples/sharedoutput/widget.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | Shared output: shared renderer test
3 | Copyright (C) 2012-2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #ifndef WIDGET_H
22 | #define WIDGET_H
23 |
24 | #include
25 | #include
26 |
27 | namespace QtAV {
28 | class WidgetRenderer;
29 | class AVPlayer;
30 | }
31 | class Widget : public QWidget
32 | {
33 | Q_OBJECT
34 |
35 | public:
36 | explicit Widget(QWidget *parent = 0);
37 | ~Widget();
38 |
39 | public slots:
40 | void setVideo();
41 | void playVideo();
42 | void testRTSP();
43 |
44 | private:
45 | class
46 | QtAV::WidgetRenderer *renderer;
47 | QtAV::AVPlayer *player[2];
48 | QPushButton *play_btn[2];
49 | QPushButton *file_btn[2];
50 | };
51 |
52 | #endif // WIDGET_H
53 |
--------------------------------------------------------------------------------
/config.tests/dxva/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | extern "C" {
23 | #include //will include d3d9.h, dxva2api.h
24 | }
25 | #define VA_DXVA2_MAX_SURFACE_COUNT (64)
26 |
27 | #include
28 | #include
29 |
30 | #define MS_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
31 | static const GUID name = { l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}
32 | #ifdef __MINGW32__
33 | # include <_mingw.h>
34 | # if defined(__MINGW64_VERSION_MAJOR)
35 | # include
36 | # endif
37 | #endif /* __MINGW32__ */
38 |
39 | int main()
40 | {
41 | return 0;
42 | }
43 |
--------------------------------------------------------------------------------
/examples/player/playlist/PlayListDelegate.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV Player Demo: this file is part of QtAV examples
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 |
22 | #ifndef PLAYLISTDELEGATE_H
23 | #define PLAYLISTDELEGATE_H
24 |
25 | #include
26 |
27 | class PlayListDelegate : public QStyledItemDelegate
28 | {
29 | Q_OBJECT
30 | public:
31 | explicit PlayListDelegate(QObject *parent = 0);
32 |
33 | virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex & index) const;
34 | virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
35 |
36 | private:
37 | mutable int mHighlightRow;
38 | mutable QList mSelectedRows;
39 | };
40 |
41 | #endif // PLAYLISTDELEGATE_H
42 |
--------------------------------------------------------------------------------
/examples/common/common.pro:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------
2 | #
3 | # Project created by QtCreator 2014-01-03T11:07:23
4 | #
5 | #-------------------------------------------------
6 | # Qt4 need QDesktopServices
7 | QT = core gui
8 |
9 | TARGET = common
10 | TEMPLATE = lib
11 | DEFINES += BUILD_QOPT_LIB
12 |
13 | CONFIG *= common-buildlib staticlib
14 | staticlib: DEFINES += BUILD_COMMON_STATIC
15 | #var with '_' can not pass to pri?
16 | PROJECTROOT = $$PWD/../..
17 | !include(libcommon.pri): error("could not find libcommon.pri")
18 | preparePaths($$OUT_PWD/../../out)
19 |
20 | INCLUDEPATH += $$PROJECTROOT/src
21 | # android apk hack
22 | android {
23 | QT += svg
24 | LIBS += -L$$qtLongName($$BUILD_DIR/lib)
25 | isEqual(QT_MAJOR_VERSION, 5):isEqual(QT_MINOR_VERSION, 4):lessThan(QT_PATCH_VERSION, 2) {
26 | LIBS += -lQt5AV
27 | } else {
28 | LIBS += -lQtAV #QML app does not link to libQtAV but we need it. why no QmlAV plugin if remove this?
29 | }
30 | } else {
31 | #include($$PROJECTROOT/libQtAV.pri)
32 | }
33 |
34 | RESOURCES += \
35 | theme/theme.qrc
36 |
37 | #QMAKE_LFLAGS += -u _link_hack
38 |
39 | #SystemParametersInfo
40 | *msvc*: LIBS += -lUser32
41 |
42 | HEADERS = common.h \
43 | Config.h \
44 | qoptions.h \
45 | ScreenSaver.h \
46 | common_export.h
47 |
48 | SOURCES = common.cpp \
49 | Config.cpp \
50 | qoptions.cpp
51 |
52 | !macx: SOURCES += ScreenSaver.cpp
53 | macx:!ios {
54 | #SOURCE is ok
55 | OBJECTIVE_SOURCES += ScreenSaver.cpp
56 | LIBS += -framework CoreServices #-framework ScreenSaver
57 | }
58 |
59 | include($$PROJECTROOT/deploy.pri)
60 |
61 | target.path = $$[QT_INSTALL_BINS]
62 | INSTALLS += target
63 |
64 |
--------------------------------------------------------------------------------
/examples/simpleplayer/playerwindow.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | Simple Player: this file is part of QtAV examples
3 | Copyright (C) 2012-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #ifndef PLAYERWINDOW_H
22 | #define PLAYERWINDOW_H
23 |
24 | #include
25 | #include
26 |
27 | class QSlider;
28 | class QPushButton;
29 | class PlayerWindow : public QWidget
30 | {
31 | Q_OBJECT
32 | public:
33 | explicit PlayerWindow(QWidget *parent = 0);
34 | public Q_SLOTS:
35 | void openMedia();
36 | void seek(int);
37 | void playPause();
38 | private Q_SLOTS:
39 | void updateSlider();
40 | private:
41 | QtAV::VideoOutput *m_vo;
42 | QtAV::AVPlayer *m_player;
43 | QSlider *m_slider;
44 | QPushButton *m_openBtn;
45 | QPushButton *m_playBtn;
46 | QPushButton *m_stopBtn;
47 | };
48 |
49 | #endif // PLAYERWINDOW_H
50 |
--------------------------------------------------------------------------------
/src/utils/internal.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_INTERNAL_H
23 | #define QTAV_INTERNAL_H
24 |
25 | #include
26 | #include
27 | #include
28 | #include "QtAV/private/AVCompat.h"
29 |
30 | namespace QtAV {
31 | namespace Internal {
32 |
33 | QString optionsToString(void* obj);
34 | void setOptionsToFFmpegObj(const QVariant& opt, void* obj);
35 | void setOptionsToDict(const QVariant& opt, AVDictionary** dict);
36 | // set qobject meta properties
37 | void setOptionsForQObject(const QVariant& opt, QObject* obj);
38 | } //namespace Internal
39 | } //namespace QtAV
40 | #endif //QTAV_INTERNAL_H
41 |
--------------------------------------------------------------------------------
/examples/player/TVView.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV Player Demo: this file is part of QtAV examples
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #ifndef TVVIEW_H
22 | #define TVVIEW_H
23 |
24 | #include
25 |
26 |
27 | class QTreeWidget;
28 | class QTreeWidgetItem;
29 |
30 | class TVView : public QWidget
31 | {
32 | Q_OBJECT
33 | public:
34 | explicit TVView(QWidget *parent = 0);
35 |
36 | signals:
37 | void clicked(const QString& key, const QString& value);
38 |
39 | private slots:
40 | void load();
41 | void onItemDoubleClick( QTreeWidgetItem * item, int column);
42 | private:
43 | QTreeWidgetItem* createNodeWithItems(QTreeWidget* view, const QString& name, const QStringList& itemNames, QList* items = 0);
44 |
45 | QTreeWidget *mpView;
46 |
47 | };
48 |
49 | #endif // TVVIEW_H
50 |
--------------------------------------------------------------------------------
/examples/player/config/AVFormatConfigPage.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV Player Demo: this file is part of QtAV examples
3 | Copyright (C) 2012-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 | #ifndef AVFORMATCONFIGPAGE_H
21 | #define AVFORMATCONFIGPAGE_H
22 |
23 | #include "ConfigPageBase.h"
24 | #include
25 |
26 | class QCheckBox;
27 | class QSpinBox;
28 | class QLineEdit;
29 | class AVFormatConfigPage : public ConfigPageBase
30 | {
31 | Q_OBJECT
32 | public:
33 | explicit AVFormatConfigPage(QWidget *parent = 0);
34 | virtual QString name() const;
35 | protected:
36 | virtual void applyToUi();
37 | virtual void applyFromUi();
38 | private:
39 | QCheckBox* m_on;
40 | QCheckBox *m_direct;
41 | QSpinBox *m_probeSize;
42 | QSpinBox *m_analyzeDuration;
43 | QLineEdit *m_extra;
44 | };
45 |
46 | #endif // AVFORMATCONFIGPAGE_H
47 |
--------------------------------------------------------------------------------
/src/QtAV/private/OpenGLRendererBase_p.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_OPENGLRENDERERBASE_P_H
23 | #define QTAV_OPENGLRENDERERBASE_P_H
24 |
25 | #include "private/VideoRenderer_p.h"
26 | #include "QtAV/OpenGLVideo.h"
27 |
28 | namespace QtAV {
29 |
30 | class Q_AV_PRIVATE_EXPORT OpenGLRendererBasePrivate : public VideoRendererPrivate
31 | {
32 | public:
33 | OpenGLRendererBasePrivate(QPaintDevice *pd);
34 | virtual ~OpenGLRendererBasePrivate();
35 | void setupAspectRatio();
36 |
37 | QPainter *painter;
38 | OpenGLVideo glv;
39 | QMatrix4x4 matrix;
40 | };
41 |
42 | } //namespace QtAV
43 |
44 | #endif // QTAV_OpenGLRendererBase_P_H
45 |
--------------------------------------------------------------------------------
/examples/player/config/ConfigPageBase.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV Player Demo: this file is part of QtAV examples
3 | Copyright (C) 2012-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #include "ConfigPageBase.h"
22 |
23 | ConfigPageBase::ConfigPageBase(QWidget *parent) :
24 | QWidget(parent)
25 | , mApplyOnUiChange(true)
26 | {
27 | }
28 |
29 | void ConfigPageBase::applyOnUiChange(bool a)
30 | {
31 | mApplyOnUiChange = a;
32 | }
33 |
34 | bool ConfigPageBase::applyOnUiChange() const
35 | {
36 | return mApplyOnUiChange;
37 | }
38 |
39 | void ConfigPageBase::apply()
40 | {
41 | applyFromUi();
42 | }
43 |
44 | void ConfigPageBase::cancel()
45 | {
46 | applyToUi();
47 | }
48 |
49 | void ConfigPageBase::reset()
50 | {
51 | // NOTE: make sure Config::instance().reset() is called before it. It is called i ConfigDialog.reset()
52 | applyToUi();
53 | }
54 |
--------------------------------------------------------------------------------
/examples/player/config/ConfigDialog.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV Player Demo: this file is part of QtAV examples
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #ifndef CONFIGDIALOG_H
22 | #define CONFIGDIALOG_H
23 |
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | class ConfigPageBase;
30 | class ConfigDialog : public QDialog
31 | {
32 | Q_OBJECT
33 | public:
34 | static void display();
35 |
36 | signals:
37 |
38 | private slots:
39 | void onButtonClicked(QAbstractButton* btn);
40 | void onApply();
41 | void onCancel();
42 | void onReset();
43 |
44 | private:
45 | explicit ConfigDialog(QWidget *parent = 0);
46 | QTabWidget *mpContent;
47 | QDialogButtonBox *mpButtonBox;
48 | QList mPages;
49 | };
50 |
51 | #endif // CONFIGDIALOG_H
52 |
--------------------------------------------------------------------------------
/src/QtAV/private/MediaIO_p.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_MediaIO_P_H
23 | #define QTAV_MediaIO_P_H
24 |
25 | #include "QtAV/QtAV_Global.h"
26 | #include "QtAV/private/AVCompat.h"
27 | #include
28 | #include "QtAV/MediaIO.h"
29 |
30 | namespace QtAV {
31 |
32 | class MediaIO;
33 | class Q_AV_PRIVATE_EXPORT MediaIOPrivate : public DPtrPrivate
34 | {
35 | public:
36 | MediaIOPrivate()
37 | : ctx(0)
38 | , mode(MediaIO::Read)
39 | {}
40 | // TODO: how to manage ctx?
41 | AVIOContext *ctx;
42 | MediaIO::AccessMode mode;
43 | QString url;
44 | };
45 |
46 | } //namespace QtAV
47 | #endif // QTAV_MediaIO_P_H
48 |
--------------------------------------------------------------------------------
/examples/QMLPlayer/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | }
5 |
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.1.0'
8 | }
9 | }
10 |
11 | allprojects {
12 | repositories {
13 | jcenter()
14 | }
15 | }
16 |
17 | apply plugin: 'com.android.application'
18 |
19 | dependencies {
20 | compile fileTree(dir: 'libs', include: ['*.jar'])
21 | }
22 |
23 | android {
24 | /*******************************************************
25 | * The following variables:
26 | * - androidBuildToolsVersion,
27 | * - androidCompileSdkVersion
28 | * - qt5AndroidDir - holds the path to qt android files
29 | * needed to build any Qt application
30 | * on Android.
31 | *
32 | * are defined in gradle.properties file. This file is
33 | * updated by QtCreator and androiddeployqt tools.
34 | * Changing them manually might break the compilation!
35 | *******************************************************/
36 |
37 | compileSdkVersion androidCompileSdkVersion.toInteger()
38 |
39 | buildToolsVersion androidBuildToolsVersion
40 |
41 | sourceSets {
42 | main {
43 | manifest.srcFile 'AndroidManifest.xml'
44 | java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
45 | aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
46 | res.srcDirs = [qt5AndroidDir + '/res', 'res']
47 | resources.srcDirs = ['src']
48 | renderscript.srcDirs = ['src']
49 | assets.srcDirs = ['assets']
50 | jniLibs.srcDirs = ['libs']
51 | }
52 | }
53 |
54 | lintOptions {
55 | abortOnError false
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/cuda/dllapi/nv_inc.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef NV_INC_H
23 | #define NV_INC_H
24 |
25 | #undef NV_CONFIG
26 | #define NV_CONFIG(FEATURE) (defined QTAV_HAVE_##FEATURE && QTAV_HAVE_##FEATURE)
27 |
28 | #if NV_CONFIG(DLLAPI_CUDA)
29 | namespace dllapi {
30 | namespace cuda {
31 | #endif /*NV_CONFIG(DLLAPI_CUDA)*/
32 | #if defined(__cplusplus)
33 | //extern "C" {
34 | #endif /* __cplusplus */
35 |
36 | #include "cuda.h"
37 | #include "nvcuvid.h"
38 |
39 | #if defined(__cplusplus)
40 | //}
41 | #endif /* __cplusplus */
42 | #if NV_CONFIG(DLLAPI_CUDA)
43 | } //namespace cuda
44 | } //namespace dllapi
45 | #endif /*NV_CONFIG(DLLAPI_CUDA)*/
46 |
47 | #endif /* NV_INC_H*/
48 |
--------------------------------------------------------------------------------
/src/shaders/packed.f.glsl:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifdef GL_ES
23 | // Set default precision to medium
24 | precision mediump int;
25 | precision mediump float;
26 | #else
27 | #define highp
28 | #define mediump
29 | #define lowp
30 | #endif
31 |
32 | uniform sampler2D u_Texture0;
33 | varying vec2 v_TexCoords0;
34 | uniform mat4 u_colorMatrix;
35 | uniform float u_opacity;
36 | #ifdef PACKED_YUV
37 | uniform mat4 u_c;
38 | #endif //PACKED_YUV
39 |
40 | void main() {
41 | vec4 c = texture2D(u_Texture0, v_TexCoords0);
42 | #ifdef PACKED_YUV
43 | c = u_c * c;
44 | c.a = 1.0;
45 | #endif //PACKED_YUV
46 | gl_FragColor = clamp(u_colorMatrix * c, 0.0, 1.0) * u_opacity;
47 | }
48 |
--------------------------------------------------------------------------------
/src/cuda/dllapi/nvcuvid.cpp:
--------------------------------------------------------------------------------
1 | #include "dllapi_p.h"
2 | #include "dllapi.h"
3 |
4 | // include nv_inc.h headers later to avoid build error. have not find out why it happens
5 | #define __CUVID_INTERNAL //avoid replaced bt 64 api
6 | #define __CUDA_API_VERSION_INTERNAL
7 | #include "nv_inc.h"
8 |
9 | using namespace dllapi;
10 | namespace dllapi {
11 | namespace cuda {
12 |
13 | namespace nvcuvid { //the macro define class dll. so a namespace wrapper is required
14 | //DEFINE_DLL_INSTANCE_N("nvcuvid", "nvcuvid", NULL) //now may crash for vc
15 | static char* cuvid_names[] = { "nvcuvid", NULL };
16 | DEFINE_DLL_INSTANCE_V("nvcuvid", cuvid_names)
17 | }
18 | using namespace nvcuvid;
19 |
20 | DEFINE_DLLAPI_M_ARG(3, CUresult, CUDAAPI, cuvidCreateVideoSource, CUvideosource *, const char *, CUVIDSOURCEPARAMS *)
21 | DEFINE_DLLAPI_M_ARG(3, CUresult, CUDAAPI, cuvidCreateVideoSourceW, CUvideosource *, const int *, CUVIDSOURCEPARAMS *)
22 | DEFINE_DLLAPI_M_ARG(1, CUresult, CUDAAPI, cuvidDestroyVideoSource, CUvideosource)
23 | DEFINE_DLLAPI_M_ARG(2, CUresult, CUDAAPI, cuvidSetVideoSourceState, CUvideosource, cudaVideoState)
24 | DEFINE_DLLAPI_M_ARG(1, cudaVideoState, CUDAAPI, cuvidGetVideoSourceState, CUvideosource)
25 | DEFINE_DLLAPI_M_ARG(3, CUresult, CUDAAPI, cuvidGetSourceVideoFormat, CUvideosource, CUVIDEOFORMAT *, unsigned int)
26 | DEFINE_DLLAPI_M_ARG(3, CUresult, CUDAAPI, cuvidGetSourceAudioFormat, CUvideosource, CUAUDIOFORMAT *, unsigned int)
27 | DEFINE_DLLAPI_M_ARG(2, CUresult, CUDAAPI, cuvidCreateVideoParser, CUvideoparser *, CUVIDPARSERPARAMS *)
28 | DEFINE_DLLAPI_M_ARG(2, CUresult, CUDAAPI, cuvidParseVideoData, CUvideoparser, CUVIDSOURCEDATAPACKET *)
29 | DEFINE_DLLAPI_M_ARG(1, CUresult, CUDAAPI, cuvidDestroyVideoParser, CUvideoparser)
30 |
31 | } //namespace cuvid
32 | } //namespace dllapi
33 |
--------------------------------------------------------------------------------
/src/utils/CopyFrame_SSE4.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | // for mingw gcc
23 | #include //stream load
24 | #include //intptr_t
25 | #include
26 | #define STREAM_LOAD_SI128(x) _mm_stream_load_si128(x)
27 | namespace sse4 { //avoid name conflict
28 | #define INC_FROM_NAMESPACE
29 | #include "CopyFrame_SSE2.cpp"
30 | } //namespace sse4
31 |
32 | //QT_FUNCTION_TARGET("sse4.1")
33 | void CopyFrame_SSE4(void *pSrc, void *pDest, void *pCacheBlock, UINT width, UINT height, UINT pitch)
34 | {
35 | sse4::CopyFrame_SSE2(pSrc, pDest, pCacheBlock, width, height, pitch);
36 | }
37 |
38 | void *memcpy_sse4(void* dst, const void* src, size_t size)
39 | {
40 | return sse4::memcpy_sse2(dst, src, size);
41 | }
42 |
--------------------------------------------------------------------------------
/src/QtAV/private/Frame_p.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_FRAME_P_H
23 | #define QTAV_FRAME_P_H
24 |
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | namespace QtAV {
31 |
32 | class Frame;
33 | class FramePrivate : public QSharedData
34 | {
35 | Q_DISABLE_COPY(FramePrivate)
36 | public:
37 | FramePrivate()
38 | : timestamp(0)
39 | {}
40 | virtual ~FramePrivate() {}
41 |
42 | QVector planes; //slice
43 | QVector line_sizes; //stride
44 | QVariantMap metadata;
45 | QByteArray data;
46 | qreal timestamp;
47 | };
48 |
49 | } //namespace QtAV
50 |
51 | #endif // QTAV_Frame_P_H
52 |
--------------------------------------------------------------------------------
/src/shaders/video.vert:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | attribute vec4 a_Position;
23 | attribute vec2 a_TexCoords0;
24 | uniform mat4 u_MVP_matrix;
25 | varying vec2 v_TexCoords0;
26 | #ifdef MULTI_COORD
27 | attribute vec2 a_TexCoords1;
28 | attribute vec2 a_TexCoords2;
29 | varying vec2 v_TexCoords1;
30 | varying vec2 v_TexCoords2;
31 | #ifdef PLANE_4
32 | attribute vec2 a_TexCoords3;
33 | varying vec2 v_TexCoords3;
34 | #endif
35 | #endif //MULTI_COORD
36 | void main() {
37 | gl_Position = u_MVP_matrix * a_Position;
38 | v_TexCoords0 = a_TexCoords0;
39 | #ifdef MULTI_COORD
40 | v_TexCoords1 = a_TexCoords1;
41 | v_TexCoords2 = a_TexCoords2;
42 | #ifdef PLANE_4
43 | v_TexCoords3 = a_TexCoords3;
44 | #endif
45 | #endif //MULTI_COORD
46 | }
47 |
--------------------------------------------------------------------------------
/examples/player/config/MiscPage.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV Player Demo: this file is part of QtAV examples
3 | Copyright (C) 2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #ifndef MISCPAGE_H
22 | #define MISCPAGE_H
23 |
24 | #include "ConfigPageBase.h"
25 | #include
26 | #include
27 | #include
28 |
29 | class MiscPage : public ConfigPageBase
30 | {
31 | Q_OBJECT
32 | public:
33 | MiscPage();
34 | virtual QString name() const;
35 | protected:
36 | virtual void applyToUi();
37 | virtual void applyFromUi();
38 | private:
39 | QCheckBox *m_preview_on;
40 | QSpinBox *m_preview_w;
41 | QSpinBox *m_preview_h;
42 | QSpinBox *m_notify_interval;
43 | QDoubleSpinBox *m_fps;
44 | QSpinBox *m_buffer_value;
45 | QDoubleSpinBox *m_timeout;
46 | QCheckBox *m_timeout_abort;
47 | QComboBox *m_opengl;
48 | QComboBox *m_angle_platform;
49 | };
50 |
51 | #endif // MISCPAGE_H
52 |
--------------------------------------------------------------------------------
/src/utils/DirectXHelper.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_DIRECTXHELPER_H
23 | #define QTAV_DIRECTXHELPER_H
24 |
25 | namespace QtAV {
26 |
27 | #ifndef DX_LOG_COMPONENT
28 | #define DX_LOG_COMPONENT "DirectX"
29 | #endif //DX_LOG_COMPONENT
30 | #define DX_ENSURE_OK(f, ...) \
31 | do { \
32 | HRESULT hr = f; \
33 | if (FAILED(hr)) { \
34 | qWarning() << DX_LOG_COMPONENT " error@" << __LINE__ << ". " #f ": " << QString("(0x%1) ").arg(hr, 0, 16) << qt_error_string(hr); \
35 | return __VA_ARGS__; \
36 | } \
37 | } while (0)
38 |
39 |
40 | template void SafeRelease(T **ppT) {
41 | if (*ppT) {
42 | (*ppT)->Release();
43 | *ppT = NULL;
44 | }
45 | }
46 |
47 | } //namespace QtAV
48 | #endif //QTAV_DIRECTXHELPER_H
49 |
--------------------------------------------------------------------------------
/doc/UseQtAVinYourProjects-zh_CN.md:
--------------------------------------------------------------------------------
1 | QtAV 1.3.4 之后可以很方便地使之作为一个Qt模块,就像其他Qt模块那样。首先要编译QtAV,编译好后在编译目录会生成安装为Qt模块的脚本 `sdk_install.sh` 和 `sdk_uninstall.sh`,windows为`sdk_install.bat` 和 `sdk_uninstall.bat`,运行`sdk_install.sh` 或`sdk_install.bat`进行安装。安装后要使用QtAV只要在你的qmake工程里加上
2 |
3 | CONFIG += av
4 |
5 | 就行。对于Qt5,也可以使用
6 |
7 | QT += av
8 |
9 | 在 C++ 文件中,加入
10 |
11 | #include
12 |
13 | 自 QtAV 1.5 基于 QWidget 的渲染器被移到了新模块 QtAVWidgets, 若需要使用这些渲染器比如 OpenGLWidgetRenderer,在工程文件加入
14 |
15 | QT += avwidgets
16 |
17 | C++ 代码中加入
18 |
19 | #include
20 | #include
21 |
22 | 请确保在使用渲染器前调用`QtAV::Widgets::registerRenderers()`
23 |
24 | ## QtAV < 1.3.4
25 |
26 | 在你的项目中包含 QtAV 非常容易. 因为 QtAV 的qmake工程是精心设计的. (可以参考: https://github.com/wang-bin/LibProjWizard4QtCreator)
27 |
28 | 你可以参考 QtAV 里的例子来了解如何使用 QtAV, 或者也可以使用以下步骤
29 |
30 |
31 | ###1. 新建一个 subdirs 类型的工程myproject及一个直接调用QtAV的player子工程
32 |
33 | myproject/myproject.pro
34 |
35 | TEMPLATE = subdirs
36 | SUBDIRS += libQtAV myplayer
37 | myplayer.depends += libQtAV
38 | libQtAV.file = QtAV/QtAV.pro
39 | include(QtAV/root.pri)
40 |
41 | ###2. 把 QtAV 放到myproject
42 |
43 | 可以在 myproject/ 目录下使用 `git clone git@github.com:wang-bin/QtAV.git`, 或者复制 QtAV 代码到 myproject/. 建议使用git,这样方便获取最新代码.
44 |
45 | 现在的目录变为
46 |
47 | > myproject/myproject.pro
48 | > myproject/myplayer/myplayer.pro
49 | > myproject/QtAV/QtAV.pro
50 | > myproject/QtAV/src/libQtAV.pro
51 | > myproject/QtAV/src/libQtAV.pri
52 |
53 | ###3. 在player工程中包含 libQtAV.pri
54 |
55 | 在 myproject/myplayer/myplayer.pro, add
56 |
57 | include(../QtAV/src/libQtAV.pri)
58 |
59 | ###4. 生成 Makefile
60 |
61 | qmake
62 |
63 | or
64 |
65 | qmake -r
66 |
67 | ###5. make
68 | player 会生成在编译目录下的bin目录. 在windows下, QtAV 的 dll文件也会在那里生成
69 |
70 | 注意:windows 下如果用`qmake`命令(命令行下。QtCreator 默认使用`qmake -r`),则可能需要运行`qmake`两次,否则 make 可能失败
--------------------------------------------------------------------------------
/examples/videocapture/playerwindow.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | Simple Player: this file is part of QtAV examples
3 | Copyright (C) 2014-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #ifndef PLAYERWINDOW_H
22 | #define PLAYERWINDOW_H
23 |
24 | #include
25 | #include
26 |
27 | class QSlider;
28 | class QPushButton;
29 | class QLabel;
30 | class QCheckBox;
31 | class PlayerWindow : public QWidget
32 | {
33 | Q_OBJECT
34 | public:
35 | explicit PlayerWindow(QWidget *parent = 0);
36 | public Q_SLOTS:
37 | void openMedia();
38 | void seek(int);
39 | void capture();
40 | private Q_SLOTS:
41 | void updateSlider();
42 | void updatePreview(const QImage& image);
43 | void onCaptureSaved(const QString& path);
44 | void onCaptureError();
45 | private:
46 | QtAV::VideoOutput *m_vo;
47 | QtAV::AVPlayer *m_player;
48 | QSlider *m_slider;
49 | QPushButton *m_openBtn;
50 | QPushButton *m_captureBtn;
51 | QLabel *m_preview;
52 | };
53 |
54 | #endif // PLAYERWINDOW_H
55 |
--------------------------------------------------------------------------------
/examples/videographicsitem/videoplayer.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | this file is part of QtAV examples
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #ifndef QTAV_VIDEOPLAYER_H
22 | #define QTAV_VIDEOPLAYER_H
23 |
24 | #include
25 | #include
26 | #include
27 |
28 | class QGraphicsView;
29 | class VideoPlayer : public QWidget
30 | {
31 | Q_OBJECT
32 |
33 | public:
34 | VideoPlayer(QWidget *parent = 0);
35 | ~VideoPlayer();
36 |
37 | QSize sizeHint() const { return QSize(720, 640); }
38 | void play(const QString& file);
39 |
40 | public slots:
41 | void setOpenGL(bool o = true);
42 |
43 | private slots:
44 | void setOrientation(int value);
45 | void rotateVideo(int angle);
46 | void scaleVideo(int value);
47 | void open();
48 |
49 | private:
50 | QtAV::AVPlayer mediaPlayer;
51 | QtAV::GraphicsItemRenderer *videoItem;
52 | QGraphicsView *view;
53 | };
54 |
55 | #endif //QTAV_VIDEOPLAYER_H
56 |
--------------------------------------------------------------------------------
/src/output/video/VideoOutputEventFilter.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_VIDEOOUTPUTEVENTFILTER_H
23 | #define QTAV_VIDEOOUTPUTEVENTFILTER_H
24 |
25 | #include
26 | #include
27 | #include "QtAV/QtAV_Global.h"
28 |
29 | namespace QtAV {
30 |
31 | class VideoRenderer;
32 | class VideoOutputEventFilter : public QObject
33 | {
34 | Q_OBJECT
35 | public:
36 | VideoOutputEventFilter(VideoRenderer *renderer = 0);
37 | virtual bool eventFilter(QObject *watched, QEvent *event);
38 |
39 | private slots:
40 | void stopFiltering();
41 | private:
42 | void switchFullScreen();
43 | bool mRendererIsQObj;
44 | VideoRenderer *mpRenderer;
45 | QPoint gMousePos, iMousePos;
46 | };
47 |
48 | } //namespace QtAV
49 |
50 | #endif // QTAV_VIDEOOUTPUTEVENTFILTER_H
51 |
--------------------------------------------------------------------------------
/examples/player/config/AVFilterConfigPage.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV Player Demo: this file is part of QtAV examples
3 | Copyright (C) 2012-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 | #ifndef AVFILTERCONFIGPAGE_H
21 | #define AVFILTERCONFIGPAGE_H
22 |
23 | #include "ConfigPageBase.h"
24 |
25 | class QCheckBox;
26 | class QComboBox;
27 | class QLabel;
28 | class QTextEdit;
29 | class AVFilterConfigPage : public ConfigPageBase
30 | {
31 | Q_OBJECT
32 | public:
33 | AVFilterConfigPage(QWidget* parent = 0);
34 | virtual QString name() const;
35 | protected:
36 | virtual void applyToUi();
37 | virtual void applyFromUi();
38 | private Q_SLOTS:
39 | void audioFilterChanged(const QString& name);
40 | void videoFilterChanged(const QString& name);
41 | private:
42 | struct {
43 | QString type;
44 | QCheckBox *enable;
45 | QComboBox *name;
46 | QLabel *description;
47 | QTextEdit *options;
48 | } m_ui[2]; //0: video, 1: audio
49 | };
50 |
51 | #endif // AVFILTERCONFIGPAGE_H
52 |
--------------------------------------------------------------------------------
/tests/playerthread/main.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | VideoGroup: this file is part of QtAV examples
3 | Copyright (C) 2013-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 | ******************************************************************************/
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | using namespace QtAV;
28 | class Thread : public QThread
29 | {
30 | public:
31 | Thread(AVPlayer *player):
32 | QThread(0)
33 | , mpPlayer(player)
34 | {}
35 | protected:
36 | virtual void run() {
37 | //mpPlayer->play();
38 | exec();
39 | }
40 | AVPlayer *mpPlayer;
41 | };
42 |
43 | int main(int argc, char *argv[])
44 | {
45 | QApplication a(argc, argv);
46 |
47 | AVPlayer player;
48 | WidgetRenderer renderer;
49 | renderer.show();
50 | player.addVideoRenderer(&renderer);
51 | player.setFile(a.arguments().last());
52 | Thread thread(&player);
53 | player.moveToThread(&thread);
54 | thread.start();
55 | player.play();
56 |
57 | return a.exec();
58 | }
59 |
--------------------------------------------------------------------------------
/templates/mkclass.sh:
--------------------------------------------------------------------------------
1 | . ../scripts/functions.sh
2 |
3 | #TODO: auto add virtual functions
4 |
5 | help(){
6 | cecho green "Usage: $0 [-class Class] [-base Base] [-template Template]"
7 | cecho green "Or $0 [--class=Class] [--base=Base] [--template=Template]"
8 | exit 0
9 | }
10 |
11 | while [ $# -gt 0 ]; do
12 | VAR=
13 | case "$1" in
14 | --*=*)
15 | PAIR=${1##--}
16 | VAR=${PAIRE%=*}
17 | VAL=${PAIR##*=}
18 | ;;
19 | -*)
20 | VAR=${1##-}
21 | shift
22 | VAL=$1
23 | ;;
24 | *)
25 | break
26 | ;;
27 | esac
28 | if [ -n "VAR" ]; then
29 | VAR_U=`echo $VAR | tr "[:lower:]" "[:upper:]"`
30 | echo "$VAR_U"
31 | eval $VAR_U=$VAL
32 | fi
33 | shift
34 | done
35 |
36 | echo "class: $CLASS, template: $TEMPLATE"
37 | COPY=COPYRIGHT.h
38 | [ -n "$CLASS" -a -n "$TEMPLATE" ] || help
39 | [ -f $COPY ] || die 'NO copyright template found!'
40 |
41 | CLASS_U=`echo $CLASS | tr "[:lower:]" "[:upper:]"`
42 | YEAR=`date +%Y`
43 |
44 | #TODO: author info
45 | echo "generating ${CLASS}.h..."
46 | cat $COPY | sed "s/%YEAR%/$YEAR/g" > ${CLASS}.h
47 | cat ${TEMPLATE}.h |sed "s/%CLASS%/$CLASS/g" | sed "s/%CLASS:u%/$CLASS_U/g" >>${CLASS}.h
48 | [ -n "$BASE" ] && cat ${CLASS}.h |sed "s/%BASE%/$BASE/g" >${CLASS}_.h && mv ${CLASS}_.h ${CLASS}.h
49 |
50 | echo "generating ${CLASS}.cpp..."
51 | cat $COPY | sed "s/%YEAR%/$YEAR/g" > ${CLASS}.cpp
52 | cat ${TEMPLATE}.cpp | sed "s/%CLASS%/$CLASS/g" | sed "s/%CLASS:u%/$CLASS_U/g" >>${CLASS}.cpp
53 | [ -n "$BASE" ] && cat ${CLASS}.cpp |sed "s/%BASE%/$BASE/g" >${CLASS}_.cpp && mv ${CLASS}_.cpp ${CLASS}.cpp
54 |
55 | if [ -f ${TEMPLATE}_p.h ]; then
56 | echo "generating ${CLASS}_p.h..."
57 | cat $COPY | sed "s/%YEAR%/$YEAR/g" > ${CLASS}_p.h
58 | cat ${TEMPLATE}_p.h |sed "s/%CLASS%/$CLASS/g" | sed "s/%CLASS:u%/$CLASS_U/g" >>${CLASS}_p.h
59 | [ -n "$BASE" ] && cat ${CLASS}_p.h |sed "s/%BASE%/$BASE/g" >${CLASS}_p_.h && mv ${CLASS}_p_.h ${CLASS}_p.h
60 | fi
61 |
--------------------------------------------------------------------------------
/examples/player/filters/OSD.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2013 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_OSD_H
23 | #define QTAV_OSD_H
24 |
25 | #include
26 | #include
27 | #include
28 |
29 | namespace QtAV {
30 |
31 | class Statistics;
32 | class OSD
33 | {
34 | public:
35 | enum ShowType {
36 | ShowCurrentTime = 1,
37 | ShowCurrentAndTotalTime = 1<<1,
38 | ShowRemainTime = 1<<2,
39 | ShowPercent = 1<<3,
40 | ShowNone
41 | };
42 |
43 | OSD();
44 | virtual ~OSD();
45 | void setShowType(ShowType type);
46 | ShowType showType() const;
47 | void useNextShowType();
48 | bool hasShowType(ShowType t) const;
49 | QString text(Statistics* statistics);
50 | protected:
51 | ShowType mShowType;
52 | int mSecsTotal;
53 | };
54 |
55 | }//namespace QtAV
56 | #endif // QTAV_OSD_H
57 |
--------------------------------------------------------------------------------
/qml/QmlAV/SGVideoNode.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2014-2015 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef QTAV_SGVIDEONODE_H
23 | #define QTAV_SGVIDEONODE_H
24 |
25 | #include
26 | #include
27 |
28 | namespace QtAV {
29 |
30 | class SGVideoMaterial;
31 | class SGVideoNode : public QSGGeometryNode
32 | {
33 | public:
34 | SGVideoNode();
35 | ~SGVideoNode();
36 | virtual void setCurrentFrame(const VideoFrame &frame);
37 | /* Update the vertices and texture coordinates. Orientation must be in {0,90,180,270} */
38 | void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation);
39 | private:
40 | SGVideoMaterial *m_material;
41 | QRectF m_rect;
42 | QRectF m_textureRect;
43 | int m_orientation;
44 | qreal m_validWidth;
45 | };
46 |
47 | } //namespace QtAV
48 | #endif // QTAV_SGVIDEONODE_H
49 |
--------------------------------------------------------------------------------
/src/utils/GPUMemCopy.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | QtAV: Media play library based on Qt and FFmpeg
3 | Copyright (C) 2012-2014 Wang Bin
4 |
5 | * This file is part of QtAV
6 |
7 | This library is free software; you can redistribute it and/or
8 | modify it under the terms of the GNU Lesser General Public
9 | License as published by the Free Software Foundation; either
10 | version 2.1 of the License, or (at your option) any later version.
11 |
12 | This library is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | Lesser General Public License for more details.
16 |
17 | You should have received a copy of the GNU Lesser General Public
18 | License along with this library; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | ******************************************************************************/
21 |
22 | #ifndef GPUMemCopy_H
23 | #define GPUMemCopy_H
24 |
25 | #include
26 |
27 | namespace QtAV {
28 |
29 | class GPUMemCopy
30 | {
31 | public:
32 | static bool isAvailable();
33 | GPUMemCopy();
34 | ~GPUMemCopy();
35 | // available and initialized
36 | bool isReady() const;
37 | bool initCache(unsigned int width);
38 | void cleanCache();
39 | void copyFrame(void *pSrc, void *pDest, unsigned int width, unsigned int height, unsigned int pitch);
40 | //memcpy
41 | private:
42 | bool mInitialized;
43 | typedef struct {
44 | unsigned char* buffer;
45 | size_t size;
46 | } cache_t;
47 | cache_t mCache;
48 | };
49 |
50 | void* gpu_memcpy(void* dst, const void* src, size_t size);
51 |
52 | } //namespace QtAV
53 |
54 | #endif // GPUMemCopy_H
55 |
--------------------------------------------------------------------------------