├── .gitignore
├── CMakeLists.txt
├── LICENSE
├── QTFFPlayer_zh_CN.ts
├── README.md
├── build-scripts
├── .DS_Store
├── init_library_for_macos.sh
├── init_library_for_ubuntu.sh
└── init_qtffplayer_pc.sh
└── src
├── base
├── IObserver.cpp
├── IObserver.h
├── IThread.cpp
└── IThread.h
├── main.cpp
├── mainwindow.cpp
├── mainwindow.h
├── mainwindow.ui
└── utils
├── log4z.cpp
└── log4z.h
/.gitignore:
--------------------------------------------------------------------------------
1 | # C++ objects and libs
2 | *.slo
3 | *.lo
4 | *.o
5 | *.a
6 | *.la
7 | *.lai
8 | *.so
9 | *.so.*
10 | *.dll
11 | *.dylib
12 |
13 | # Qt-es
14 | object_script.*.Release
15 | object_script.*.Debug
16 | *_plugin_import.cpp
17 | /.qmake.cache
18 | /.qmake.stash
19 | *.pro.user
20 | *.pro.user.*
21 | *.qbs.user
22 | *.qbs.user.*
23 | *.moc
24 | moc_*.cpp
25 | moc_*.h
26 | qrc_*.cpp
27 | ui_*.h
28 | *.qmlc
29 | *.jsc
30 | Makefile*
31 | #*build-*
32 | *cmake-build-*
33 | *.qm
34 | *.prl
35 |
36 | # Qt unit tests
37 | target_wrapper.*
38 |
39 | # QtCreator
40 | *.autosave
41 |
42 | # QtCreator Qml
43 | *.qmlproject.user
44 | *.qmlproject.user.*
45 |
46 | # QtCreator CMake
47 | CMakeLists.txt.user*
48 |
49 | # QtCreator 4.8< compilation database
50 | compile_commands.json
51 |
52 | # QtCreator local machine specific files for imported projects
53 | *creator.user*
54 |
55 | /output
56 | /temp
57 | /bin
58 | /lib
59 | /libs
60 | /source
61 | .idea
62 | *build-*
63 | /CMakeFiles
64 | .DS_Store
65 | *.mp4
66 | *.mp3
67 | *.zip
68 | *.yuv
69 | *.h264
70 | *.dylib
71 | *.a
72 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 |
3 | project(QTFFPlayer VERSION 0.0.1 LANGUAGES CXX)
4 |
5 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
6 |
7 | set(CMAKE_AUTOUIC ON)
8 | set(CMAKE_AUTOMOC ON)
9 | set(CMAKE_AUTORCC ON)
10 |
11 | set(CMAKE_CXX_STANDARD 11)
12 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
13 |
14 | set(CMAKE_PREFIX_PATH "/Users/devyk/Data/qt/install/5/5.14.2/5.14.2/clang_64/lib/cmake")
15 | set(QT_VERSION_MAJOR 5)
16 | set(REQUIRED_LIBS Core Gui Widgets Multimedia OpenGL)
17 | set(REQUIRED_LIBS_QUALIFIED Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Multimedia Qt5::OpenGL)
18 | find_package(Qt${QT_VERSION_MAJOR} COMPONENTS ${REQUIRED_LIBS} REQUIRED)
19 | #平台判断
20 | if (WIN32)
21 | message("Now is windows")
22 | elseif (APPLE)
23 | message("Now is Apple systens.")
24 | elseif (ANDROID)
25 | message("Now is ANDROID systens.")
26 | elseif (UNIX)
27 | message("Now is UNIX systens.")
28 | endif ()
29 |
30 | set(TS_FILES QTFFPlayer_zh_CN.ts)
31 | set(FFMPEG_PREFIX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs")
32 | message("CMAKE_HOST_SYSTEM_NAME--->${CMAKE_HOST_SYSTEM_NAME}")
33 | message("CMAKE_SYSTEM_NAME--->${CMAKE_SYSTEM_NAME}")
34 |
35 | message("FFMPEG_PREFIX_DIR=${FFMPEG_PREFIX_DIR}")
36 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/output/)
37 | set(FFMPEG_INCLUDE_DIRS "${FFMPEG_PREFIX_DIR}/include/")
38 | set(FFMPEG_LIB_DIRS "${FFMPEG_PREFIX_DIR}/lib/")
39 |
40 | set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
41 | set(BASE_DIR ${SRC_DIR}/base)
42 | set(DECODE_DIR ${SRC_DIR}/decode)
43 | set(DEMUX_DIR ${SRC_DIR}/demux)
44 | set(RESAMPLE_DIR ${SRC_DIR}/resample)
45 | set(PROXY_DIR ${SRC_DIR}/proxy)
46 | set(WIDGET_DIR ${SRC_DIR}/widget)
47 | set(UTILS_DIR ${SRC_DIR}/utils)
48 |
49 | include_directories(${BASE_DIR})
50 | include_directories(${DECODE_DIR})
51 | include_directories(${DEMUX_DIR})
52 | include_directories(${RESAMPLE_DIR})
53 | include_directories(${PROXY_DIR})
54 | include_directories(${WIDGET_DIR})
55 | include_directories(${UTILS_DIR})
56 | include_directories(${FFMPEG_INCLUDE_DIRS})
57 |
58 | link_directories(${FFMPEG_LIB_DIRS})
59 |
60 |
61 | set(PROJECT_SOURCES
62 | src/main.cpp
63 | src/mainwindow.cpp
64 | src/mainwindow.h
65 | src/mainwindow.ui
66 | ${TS_FILES}
67 | src/base/IThread.cpp
68 | src/base/IObserver.cpp
69 | src/utils/log4z.cpp
70 | )
71 | add_library(QTFFPlayer SHARED
72 | ${PROJECT_SOURCES}
73 | )
74 | add_executable(QTFFPlayer_GUI
75 | ${PROJECT_SOURCES}
76 | )
77 |
78 |
79 | target_link_libraries(QTFFPlayer PRIVATE
80 | Qt${QT_VERSION_MAJOR}::Widgets
81 | #FFmpeg 支持
82 | avcodec avdevice avfilter avformat avutil swscale swresample
83 | )
84 |
85 | target_link_libraries(QTFFPlayer_GUI PRIVATE
86 | Qt${QT_VERSION_MAJOR}::Widgets
87 | #FFmpeg 支持
88 | avcodec avdevice avfilter avformat avutil swscale swresample
89 | )
90 |
91 |
92 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/QTFFPlayer_zh_CN.ts:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MainWindow
6 |
7 |
8 |
9 | MainWindow
10 |
11 |
12 |
13 |
14 |
15 | 我是 MAC OS 系统
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # QTFFPlayer
2 | MAC、Win、Linux、Android、IOS 跨平台播放器开发
3 |
4 | ##如何使用
5 |
6 | 1、cd build-scripts
7 |
8 | 2、执行编译
9 |
10 | **Mac**
11 |
12 | 第一个参数是编译平台,第二个是编译的目录,直接给当前项目的最对路径即可
13 |
14 | ./init_qtffplayer_pc.sh mac /Users/devyk/Data/qt/project/QTFFPlayer/libs
15 |
16 | **ubuntu**
17 |
18 | ./init_qtffplayer_pc.sh ubuntu /Users/devyk/Data/qt/project/QTFFPlayer/libs
19 |
20 |
--------------------------------------------------------------------------------
/build-scripts/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangkun19921001/QTFFPlayer/686f417449df4ad268d6d9378f43bfb5ebefedb8/build-scripts/.DS_Store
--------------------------------------------------------------------------------
/build-scripts/init_library_for_macos.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | brew install pkg-config fdk-aac x264 yasm lame x265 zimg zmq libsoxr speex openjpeg libass xvid webp libvpx libvidstab theora snappy rubberband opus dav1d libbluray aom
5 |
6 |
--------------------------------------------------------------------------------
/build-scripts/init_library_for_ubuntu.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #参考 http://www.manks.top/ffmpeg-install-linux-centos.html#_label5
4 |
5 | sudo apt-get update && sudo apt-get install autoconf automake libfreetype6-dev libtool make pkg-config zlib1g zlib1g.dev clang yasm yasm libgnutls28-dev \
6 | nasm libx264-dev libnuma-dev \
7 | libx265-dev libnuma-dev libvpx-dev \
8 | libfdk-aac-dev libmp3lame-dev libopus-dev \
9 | libspeex-dev frei0r-plugins-dev libsdl2-2.0 libsdl2-dev libxss1 \
10 |
11 |
12 | sudo apt-get install python3-pip && \
13 | pip3 install --user meson \
14 |
15 |
16 |
17 | if [ ! -d "../src" ]; then
18 | mkdir ../src
19 | fi
20 |
21 |
22 | # cd ../src/
23 | # PREFIX=$(pwd)/../libs/
24 |
25 | # #编译 nasm
26 | # echo ">>>>>>> start build nasm <<<<<<<<<"
27 | # curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2
28 | # tar xjvf nasm-2.15.05.tar.bz2
29 | # cd nasm-2.15.05
30 | # ./autogen.sh
31 | # ./configure --prefix="$PREFIX" --bindir="$PREFIX/nasm-2.15.05/bin"
32 | # make
33 | # make install
34 | # ln -s $PREFIX/nasm-2.15.05/bin/nasm /usr/bin/nasm
35 | # cd ..
36 |
37 | # #编译 yasm
38 | # echo ">>>>>>> start build yasm <<<<<<<<<"
39 | # curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
40 | # tar xzvf yasm-1.3.0.tar.gz
41 | # cd yasm-1.3.0
42 | # ./configure --prefix="$PREFIX" --bindir="$PREFIX/yasm-1.3.0/bin"
43 | # make
44 | # make install
45 | # ln -s $PREFIX/yasm-1.3.0/bin/yasm /usr/bin/yasm
46 | # cd ..
47 |
48 |
49 | # #编译 libx264
50 | # echo ">>>>>>> start build libx264 <<<<<<<<<"
51 | # git clone --branch stable --depth 1 https://code.videolan.org/videolan/x264.git
52 | # cd x264
53 | # PKG_CONFIG_PATH="$PREFIX/pkgconfig" ./configure --prefix="$PREFIX" --bindir="$PREFIX/x264/bin" --enable-static
54 | # make
55 | # make install
56 | # cd ..
57 |
58 | # #编译 libx265
59 | # echo ">>>>>>> start build libx265 <<<<<<<<<"
60 | # git clone --branch stable --depth 2 https://bitbucket.org/multicoreware/x265_git
61 | # cd x265_git/build/linux
62 | # cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$PREFIX" -DENABLE_SHARED:bool=off
63 | # make
64 | # make install
65 | # cd ..
66 |
67 |
68 | # #编译 libfdk_aac
69 | # echo ">>>>>>> start build libfdk_aac <<<<<<<<<"
70 | # git clone --depth 1 https://github.com/mstorsjo/fdk-aac
71 | # cd fdk-aac
72 | # autoreconf -fiv
73 | # ./configure --prefix="$PREFIX" --disable-shared
74 | # make
75 | # make install
76 | # cd ..
77 |
78 | # #编译 libmp3lame
79 | # echo ">>>>>>> start build libmp3lame <<<<<<<<<"
80 | # curl -O -L https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
81 | # tar xzvf lame-3.100.tar.gz
82 | # cd lame-3.100
83 | # ./configure --prefix="$PREFIX" --bindir="$PREFIX/lame-3.100/bin" --disable-shared --enable-nasm
84 | # make
85 | # make install
86 | # cd ..
87 |
88 |
89 | # #编译 libopus
90 | # echo ">>>>>>> start build libopus <<<<<<<<<"
91 | # curl -O -L https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
92 | # tar xzvf opus-1.3.1.tar.gz
93 | # cd opus-1.3.1
94 | # ./configure --prefix="$PREFIX" --disable-shared
95 | # make
96 | # make install
97 | # cd ..
98 |
99 |
100 | # #编译 libvpx
101 | # echo ">>>>>>> start build libvpx <<<<<<<<<"
102 | # git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
103 | # cd libvpx
104 | # ./configure --prefix="$PREFIX" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
105 | # make
106 | # make install
107 | # cd ..
108 |
109 |
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/build-scripts/init_qtffplayer_pc.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #参考 https://lvv.me/blog/posts/2020/04/14_build_ffmpeg/
3 | #https://blog.avdancedu.com/f3f66133/
4 |
5 | set -e
6 |
7 | FFMPEG_VERSION=4.4
8 |
9 | FFMPEG_PREFIX=$2
10 |
11 |
12 | if [ ! -d "../source" ]; then
13 | mkdir ../source
14 | if [ ! -d "../source/ffmpeg" ]; then
15 | mkdir ../source/ffmpeg
16 | fi
17 | fi
18 |
19 | TARGET=$1
20 |
21 |
22 | if [ $TARGET == "mac" ]
23 | then
24 | echo "mac"
25 | chmod +x init_library_for_macos.sh
26 | ./init_library_for_macos.sh
27 | elif [ $TARGET == "ubuntu" ]
28 | then
29 | echo "ubuntu"
30 | chmod +x init_library_for_ubuntu.sh
31 | ./init_library_for_ubuntu.sh
32 | else
33 | echo "not found $1"
34 | fi
35 |
36 |
37 | cd ../source/ffmpeg
38 |
39 | echo $PWD
40 |
41 |
42 | if [ ! -d "ffmpeg-4.4" ]; then
43 | wget https://ffmpeg.org/releases/ffmpeg-4.4.tar.bz2
44 | tar -zxvf ffmpeg-4.4.tar.bz2
45 | fi
46 |
47 | cd ffmpeg-$FFMPEG_VERSION
48 | echo "--->$(pwd)"
49 |
50 | sudo rm -rf $FFMPEG_PREFIX
51 |
52 |
53 | ./configure \
54 | --prefix=$FFMPEG_PREFIX \
55 | --enable-shared \
56 | --disable-static \
57 | --enable-pthreads \
58 | --enable-gpl \
59 | --enable-nonfree \
60 | --enable-libmp3lame \
61 | --enable-libsnappy \
62 | --enable-libtheora \
63 | --enable-libx264 \
64 | --enable-libx265 \
65 | --enable-libfdk-aac \
66 | --enable-libfontconfig \
67 | --enable-libfreetype \
68 | --enable-libspeex \
69 |
70 | make -j8
71 | make install
72 |
73 | cd ../../../libs/
74 | ls -lht
75 |
76 |
77 |
--------------------------------------------------------------------------------
/src/base/IObserver.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangkun19921001/QTFFPlayer/686f417449df4ad268d6d9378f43bfb5ebefedb8/src/base/IObserver.cpp
--------------------------------------------------------------------------------
/src/base/IObserver.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangkun19921001/QTFFPlayer/686f417449df4ad268d6d9378f43bfb5ebefedb8/src/base/IObserver.h
--------------------------------------------------------------------------------
/src/base/IThread.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangkun19921001/QTFFPlayer/686f417449df4ad268d6d9378f43bfb5ebefedb8/src/base/IThread.cpp
--------------------------------------------------------------------------------
/src/base/IThread.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangkun19921001/QTFFPlayer/686f417449df4ad268d6d9378f43bfb5ebefedb8/src/base/IThread.h
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | #include "mainwindow.h"
2 |
3 | #include
4 | #include "log4z.h"
5 | using namespace zsummer::log4z;
6 | int main(int argc, char *argv[])
7 | {
8 | ILog4zManager::getRef().start();
9 | QApplication a(argc, argv);
10 | MainWindow w;
11 | w.show();
12 |
13 | //begin test stream log input....
14 | LOGT("stream input *** " << "LOGT LOGT LOGT LOGT" << " *** ");
15 | LOGD("stream input *** " << "LOGD LOGD LOGD LOGD" << " *** ");
16 | LOGI("stream input *** " << "LOGI LOGI LOGI LOGI" << " *** ");
17 | LOGW("stream input *** " << "LOGW LOGW LOGW LOGW" << " *** ");
18 | LOGE("stream input *** " << "LOGE LOGE LOGE LOGE" << " *** ");
19 | LOGA("stream input *** " << "LOGA LOGA LOGA LOGA" << " *** ");
20 | LOGF("stream input *** " << "LOGF LOGF LOGF LOGF" << " *** ");
21 |
22 | // cannot support VC6 or VS2003
23 | //begin test format log input....
24 | LOGFMTT("format input *** %s *** %d ***", "LOGFMTT", 123456);
25 | LOGFMTD("format input *** %s *** %d ***", "LOGFMTD", 123456);
26 | LOGFMTI("format input *** %s *** %d ***", "LOGFMTI", 123456);
27 | LOGFMTW("format input *** %s *** %d ***", "LOGFMTW", 123456);
28 | LOGFMTE("format input *** %s *** %d ***", "LOGFMTE", 123456);
29 | LOGFMTA("format input *** %s *** %d ***", "LOGFMTA", 123456);
30 | LOGFMTF("format input *** %s *** %d ***", "LOGFMTF", 123456);
31 |
32 | LOGA("main quit ...");
33 | return a.exec();
34 | }
35 |
--------------------------------------------------------------------------------
/src/mainwindow.cpp:
--------------------------------------------------------------------------------
1 | #include "mainwindow.h"
2 | #include "./ui_mainwindow.h"
3 | #include
4 |
5 | extern "C"{
6 | #include "libavcodec/avcodec.h"
7 | #include "libavutil/avutil.h"
8 | }
9 |
10 | MainWindow::MainWindow(QWidget *parent)
11 | : QMainWindow(parent)
12 | , ui(new Ui::MainWindow)
13 | {
14 |
15 | ui->setupUi(this);
16 | printf("Ffmpeg cmkae build = \n %s",avcodec_configuration());
17 | }
18 |
19 | MainWindow::~MainWindow()
20 | {
21 | delete ui;
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/src/mainwindow.h:
--------------------------------------------------------------------------------
1 | #ifndef MAINWINDOW_H
2 | #define MAINWINDOW_H
3 |
4 | #include
5 |
6 | QT_BEGIN_NAMESPACE
7 | namespace Ui { class MainWindow; }
8 | QT_END_NAMESPACE
9 |
10 | class MainWindow : public QMainWindow
11 | {
12 | Q_OBJECT
13 |
14 | public:
15 | MainWindow(QWidget *parent = nullptr);
16 | ~MainWindow();
17 |
18 | private:
19 | Ui::MainWindow *ui;
20 | };
21 | #endif // MAINWINDOW_H
22 |
--------------------------------------------------------------------------------
/src/mainwindow.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 502
10 | 434
11 |
12 |
13 |
14 | MainWindow
15 |
16 |
17 |
18 |
19 |
20 | 190
21 | 170
22 | 113
23 | 21
24 |
25 |
26 |
27 | 我是 MAC OS 系统
28 |
29 |
30 |
31 |
32 |
33 |
34 | 0
35 | 0
36 | 502
37 | 24
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/utils/log4z.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Log4z License
3 | * -----------
4 | *
5 | * Log4z is licensed under the terms of the MIT license reproduced below.
6 | * This means that Log4z is free software and can be used for both academic
7 | * and commercial purposes at absolutely no cost.
8 | *
9 | *
10 | * ===============================================================================
11 | *
12 | * Copyright (C) 2010-2017 YaweiZhang .
13 | *
14 | * Permission is hereby granted, free of charge, to any person obtaining a copy
15 | * of this software and associated documentation files (the "Software"), to deal
16 | * in the Software without restriction, including without limitation the rights
17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 | * copies of the Software, and to permit persons to whom the Software is
19 | * furnished to do so, subject to the following conditions:
20 | *
21 | * The above copyright notice and this permission notice shall be included in
22 | * all copies or substantial portions of the Software.
23 | *
24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30 | * THE SOFTWARE.
31 | *
32 | * ===============================================================================
33 | *
34 | * (end of COPYRIGHT)
35 | */
36 |
37 | #include "log4z.h"
38 | #include
39 | #include
40 | #include
41 | #include
42 | #include
43 | #include
44 | #include
45 | #include
46 | #include