├── .gitattributes ├── .gitignore ├── .gitmodules ├── .ycm_extra_conf.py ├── 3rd ├── include │ ├── SDL2 │ │ ├── SDL.h │ │ ├── SDL_assert.h │ │ ├── SDL_atomic.h │ │ ├── SDL_audio.h │ │ ├── SDL_bits.h │ │ ├── SDL_blendmode.h │ │ ├── SDL_clipboard.h │ │ ├── SDL_config.h │ │ ├── SDL_config.h.cmake │ │ ├── SDL_config.h.in │ │ ├── SDL_config_android.h │ │ ├── SDL_config_iphoneos.h │ │ ├── SDL_config_macosx.h │ │ ├── SDL_config_macosx.h.orig │ │ ├── SDL_config_minimal.h │ │ ├── SDL_config_pandora.h │ │ ├── SDL_config_psp.h │ │ ├── SDL_config_windows.h │ │ ├── SDL_config_winrt.h │ │ ├── SDL_config_wiz.h │ │ ├── SDL_copying.h │ │ ├── SDL_cpuinfo.h │ │ ├── SDL_egl.h │ │ ├── SDL_endian.h │ │ ├── SDL_error.h │ │ ├── SDL_events.h │ │ ├── SDL_filesystem.h │ │ ├── SDL_gamecontroller.h │ │ ├── SDL_gesture.h │ │ ├── SDL_haptic.h │ │ ├── SDL_hints.h │ │ ├── SDL_joystick.h │ │ ├── SDL_keyboard.h │ │ ├── SDL_keycode.h │ │ ├── SDL_loadso.h │ │ ├── SDL_log.h │ │ ├── SDL_main.h │ │ ├── SDL_messagebox.h │ │ ├── SDL_metal.h │ │ ├── SDL_mouse.h │ │ ├── SDL_mutex.h │ │ ├── SDL_name.h │ │ ├── SDL_opengl.h │ │ ├── SDL_opengl_glext.h │ │ ├── SDL_opengles.h │ │ ├── SDL_opengles2.h │ │ ├── SDL_opengles2_gl2.h │ │ ├── SDL_opengles2_gl2ext.h │ │ ├── SDL_opengles2_gl2platform.h │ │ ├── SDL_opengles2_khrplatform.h │ │ ├── SDL_pixels.h │ │ ├── SDL_platform.h │ │ ├── SDL_power.h │ │ ├── SDL_quit.h │ │ ├── SDL_rect.h │ │ ├── SDL_render.h │ │ ├── SDL_revision.h │ │ ├── SDL_rwops.h │ │ ├── SDL_scancode.h │ │ ├── SDL_sensor.h │ │ ├── SDL_shape.h │ │ ├── SDL_stdinc.h │ │ ├── SDL_surface.h │ │ ├── SDL_system.h │ │ ├── SDL_syswm.h │ │ ├── SDL_test.h │ │ ├── SDL_test_assert.h │ │ ├── SDL_test_common.h │ │ ├── SDL_test_compare.h │ │ ├── SDL_test_crc32.h │ │ ├── SDL_test_font.h │ │ ├── SDL_test_fuzzer.h │ │ ├── SDL_test_harness.h │ │ ├── SDL_test_images.h │ │ ├── SDL_test_log.h │ │ ├── SDL_test_md5.h │ │ ├── SDL_test_memory.h │ │ ├── SDL_test_random.h │ │ ├── SDL_thread.h │ │ ├── SDL_timer.h │ │ ├── SDL_touch.h │ │ ├── SDL_types.h │ │ ├── SDL_version.h │ │ ├── SDL_video.h │ │ ├── SDL_vulkan.h │ │ ├── begin_code.h │ │ └── close_code.h │ ├── libavcodec │ │ ├── ac3_parser.h │ │ ├── adts_parser.h │ │ ├── avcodec.h │ │ ├── avdct.h │ │ ├── avfft.h │ │ ├── d3d11va.h │ │ ├── dirac.h │ │ ├── dv_profile.h │ │ ├── dxva2.h │ │ ├── jni.h │ │ ├── mediacodec.h │ │ ├── qsv.h │ │ ├── vaapi.h │ │ ├── vdpau.h │ │ ├── version.h │ │ ├── videotoolbox.h │ │ ├── vorbis_parser.h │ │ └── xvmc.h │ ├── libavdevice │ │ ├── avdevice.h │ │ └── version.h │ ├── libavfilter │ │ ├── avfilter.h │ │ ├── buffersink.h │ │ ├── buffersrc.h │ │ └── version.h │ ├── libavformat │ │ ├── avformat.h │ │ ├── avio.h │ │ └── version.h │ ├── libavutil │ │ ├── adler32.h │ │ ├── aes.h │ │ ├── aes_ctr.h │ │ ├── attributes.h │ │ ├── audio_fifo.h │ │ ├── avassert.h │ │ ├── avconfig.h │ │ ├── avstring.h │ │ ├── avutil.h │ │ ├── base64.h │ │ ├── blowfish.h │ │ ├── bprint.h │ │ ├── bswap.h │ │ ├── buffer.h │ │ ├── camellia.h │ │ ├── cast5.h │ │ ├── channel_layout.h │ │ ├── common.h │ │ ├── cpu.h │ │ ├── crc.h │ │ ├── des.h │ │ ├── dict.h │ │ ├── display.h │ │ ├── downmix_info.h │ │ ├── encryption_info.h │ │ ├── error.h │ │ ├── eval.h │ │ ├── ffversion.h │ │ ├── fifo.h │ │ ├── file.h │ │ ├── frame.h │ │ ├── hash.h │ │ ├── hdr_dynamic_metadata.h │ │ ├── hmac.h │ │ ├── hwcontext.h │ │ ├── hwcontext_cuda.h │ │ ├── hwcontext_d3d11va.h │ │ ├── hwcontext_drm.h │ │ ├── hwcontext_dxva2.h │ │ ├── hwcontext_mediacodec.h │ │ ├── hwcontext_qsv.h │ │ ├── hwcontext_vaapi.h │ │ ├── hwcontext_vdpau.h │ │ ├── hwcontext_videotoolbox.h │ │ ├── imgutils.h │ │ ├── intfloat.h │ │ ├── intreadwrite.h │ │ ├── lfg.h │ │ ├── log.h │ │ ├── lzo.h │ │ ├── macros.h │ │ ├── mastering_display_metadata.h │ │ ├── mathematics.h │ │ ├── md5.h │ │ ├── mem.h │ │ ├── motion_vector.h │ │ ├── murmur3.h │ │ ├── opt.h │ │ ├── parseutils.h │ │ ├── pixdesc.h │ │ ├── pixelutils.h │ │ ├── pixfmt.h │ │ ├── random_seed.h │ │ ├── rational.h │ │ ├── rc4.h │ │ ├── replaygain.h │ │ ├── ripemd.h │ │ ├── samplefmt.h │ │ ├── sha.h │ │ ├── sha512.h │ │ ├── spherical.h │ │ ├── stereo3d.h │ │ ├── tea.h │ │ ├── threadmessage.h │ │ ├── time.h │ │ ├── timecode.h │ │ ├── timestamp.h │ │ ├── tree.h │ │ ├── twofish.h │ │ ├── tx.h │ │ ├── version.h │ │ └── xtea.h │ ├── libpostproc │ │ ├── postprocess.h │ │ └── version.h │ ├── libswresample │ │ ├── swresample.h │ │ └── version.h │ └── libswscale │ │ ├── swscale.h │ │ └── version.h └── lib │ └── msvc2015_x64 │ ├── SDL2.lib │ ├── avcodec.lib │ ├── avdevice.lib │ ├── avfilter.lib │ ├── avformat.lib │ ├── avutil.lib │ ├── postproc.lib │ ├── swresample.lib │ └── swscale.lib ├── BUILD.md ├── LICENSE ├── README.md ├── bin └── msvc2015_x64 │ ├── Qt5Core.dll │ ├── Qt5Gui.dll │ ├── Qt5Widgets.dll │ ├── SDL2.dll │ ├── avcodec-58.dll │ ├── avdevice-58.dll │ ├── avfilter-7.dll │ ├── avformat-58.dll │ ├── avutil-56.dll │ ├── conf │ └── hplayer.conf.default │ ├── ffplay.exe │ ├── hplayer.exe │ ├── platforms │ └── qwindows.dll │ ├── postproc-55.dll │ ├── swresample-3.dll │ └── swscale-5.dll ├── favicon.ico ├── hplayer.png ├── hplayer.pro ├── hplayer.rc ├── hplayer.sln ├── hplayer.vcxproj ├── hplayer25.png ├── hplayer4.png ├── rc ├── image.qrc ├── image │ ├── add.png │ ├── capture.png │ ├── clear.png │ ├── close.png │ ├── disk.png │ ├── file.png │ ├── fullscreen.png │ ├── icon.png │ ├── media.png │ ├── media_bk.png │ ├── mute.png │ ├── network.png │ ├── next.png │ ├── pause.png │ ├── prev.png │ ├── start.png │ ├── stop.png │ ├── style1.png │ ├── style16.png │ ├── style2.png │ ├── style25.png │ ├── style36.png │ ├── style4.png │ ├── style49.png │ ├── style64.png │ ├── style9.png │ ├── sub.png │ ├── timeshow.png │ └── voice.png ├── lang │ ├── app_zh_CN.qm │ ├── app_zh_CN.ts │ ├── qt_zh_CN.qm │ └── qt_zh_CN.ts ├── skin.qrc └── skin │ ├── dark.qss │ └── dark │ ├── add_bottom.png │ ├── add_left.png │ ├── add_right.png │ ├── add_top.png │ ├── branch_close.png │ ├── branch_open.png │ ├── calendar_nextmonth.png │ ├── calendar_prevmonth.png │ ├── checkbox_checked.png │ ├── checkbox_checked_disable.png │ ├── checkbox_parcial.png │ ├── checkbox_parcial_disable.png │ ├── checkbox_unchecked.png │ ├── checkbox_unchecked_disable.png │ ├── radiobutton_checked.png │ ├── radiobutton_checked_disable.png │ ├── radiobutton_unchecked.png │ └── radiobutton_unchecked_disable.png └── src ├── GL ├── eglew.h ├── glew.c ├── glew.h ├── glxew.h └── wglew.h ├── appdef.h ├── avdef.h ├── confile.h ├── main.cpp ├── qt ├── HGLWidget.cpp ├── HGLWidget.h ├── qtfunctions.h ├── qtheaders.h ├── qtrcloader.cpp └── qtrcloader.h ├── ui ├── CentralWidget.cpp ├── CentralWidget.h ├── CustomEventType.h ├── GLWnd.cpp ├── GLWnd.h ├── HMediaInfoDlg.cpp ├── HMediaInfoDlg.h ├── HMultiView.cpp ├── HMultiView.h ├── HOpenMediaDlg.cpp ├── HOpenMediaDlg.h ├── HVideoTitlebar.cpp ├── HVideoTitlebar.h ├── HVideoToolbar.cpp ├── HVideoToolbar.h ├── HVideoWidget.cpp ├── HVideoWidget.h ├── HVideoWnd.cpp ├── HVideoWnd.h ├── HVideoWndFactory.h ├── LsideWidget.cpp ├── LsideWidget.h ├── MainWindow.cpp ├── MainWindow.h ├── RsideWidget.cpp ├── RsideWidget.h ├── SDL2Wnd.cpp ├── SDL2Wnd.h ├── htable.cpp ├── htable.h └── qtstyles.h ├── util ├── ffmpeg_util.h ├── hframe.cpp ├── hframe.h ├── hgl.h ├── hgui.h ├── opencv_util.h └── sdl_util.h ├── video ├── HVideoCapture.cpp ├── HVideoCapture.h ├── HVideoPlayer.h ├── HVideoPlayerFactory.h ├── hffplayer.cpp ├── hffplayer.h └── hmedia.h └── win32 ├── hdevice.cpp └── hdevice.h /.gitattributes: -------------------------------------------------------------------------------- 1 | *.h linguist-language=cpp 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # cache 2 | *~ 3 | *.bk 4 | *.bak 5 | *.old 6 | *.new 7 | 8 | # IDE 9 | .vs 10 | .vscode 11 | *.user 12 | 13 | tags 14 | cscope* 15 | 16 | # output 17 | *.o 18 | *.obj 19 | 20 | *.conf 21 | *.pid 22 | *.log 23 | *.db 24 | 25 | .qmake.stash 26 | tmp 27 | *debug 28 | *release 29 | *.pdb 30 | Makefile* 31 | 32 | # msvc 33 | *.VC.db 34 | *.VC.VC.opendb 35 | *.vcxproj.filters 36 | Debug 37 | Release 38 | 39 | # toolchains 40 | msvc2015_x86 41 | mingw32 42 | mingw64 43 | 44 | # mine 45 | 3rd/include/opencv2 46 | 3rd/include/qt5 47 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/hv"] 2 | path = src/hv 3 | url = https://github.com/ithewei/libhv.git 4 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef SDL_clipboard_h_ 29 | #define SDL_clipboard_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * \brief Put UTF-8 text into the clipboard 43 | * 44 | * \sa SDL_GetClipboardText() 45 | */ 46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 47 | 48 | /** 49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() 50 | * 51 | * \sa SDL_SetClipboardText() 52 | */ 53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 54 | 55 | /** 56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty 57 | * 58 | * \sa SDL_GetClipboardText() 59 | */ 60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 61 | 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* SDL_clipboard_h_ */ 70 | 71 | /* vi: set ts=4 sw=4 expandtab: */ 72 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_config_minimal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_minimal_h_ 23 | #define SDL_config_minimal_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | /** 29 | * \file SDL_config_minimal.h 30 | * 31 | * This is the minimal configuration that can be used to build SDL. 32 | */ 33 | 34 | #define HAVE_STDARG_H 1 35 | #define HAVE_STDDEF_H 1 36 | 37 | /* Most everything except Visual Studio 2008 and earlier has stdint.h now */ 38 | #if defined(_MSC_VER) && (_MSC_VER < 1600) 39 | /* Here are some reasonable defaults */ 40 | typedef unsigned int size_t; 41 | typedef signed char int8_t; 42 | typedef unsigned char uint8_t; 43 | typedef signed short int16_t; 44 | typedef unsigned short uint16_t; 45 | typedef signed int int32_t; 46 | typedef unsigned int uint32_t; 47 | typedef signed long long int64_t; 48 | typedef unsigned long long uint64_t; 49 | typedef unsigned long uintptr_t; 50 | #else 51 | #define HAVE_STDINT_H 1 52 | #endif /* Visual Studio 2008 */ 53 | 54 | #ifdef __GNUC__ 55 | #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 56 | #endif 57 | 58 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ 59 | #define SDL_AUDIO_DRIVER_DUMMY 1 60 | 61 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ 62 | #define SDL_JOYSTICK_DISABLED 1 63 | 64 | /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ 65 | #define SDL_HAPTIC_DISABLED 1 66 | 67 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ 68 | #define SDL_LOADSO_DISABLED 1 69 | 70 | /* Enable the stub thread support (src/thread/generic/\*.c) */ 71 | #define SDL_THREADS_DISABLED 1 72 | 73 | /* Enable the stub timer support (src/timer/dummy/\*.c) */ 74 | #define SDL_TIMERS_DISABLED 1 75 | 76 | /* Enable the dummy video driver (src/video/dummy/\*.c) */ 77 | #define SDL_VIDEO_DRIVER_DUMMY 1 78 | 79 | /* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ 80 | #define SDL_FILESYSTEM_DUMMY 1 81 | 82 | #endif /* SDL_config_minimal_h_ */ 83 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_error.h 24 | * 25 | * Simple error message routines for SDL. 26 | */ 27 | 28 | #ifndef SDL_error_h_ 29 | #define SDL_error_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Public functions */ 40 | /* SDL_SetError() unconditionally returns -1. */ 41 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 42 | extern DECLSPEC const char *SDLCALL SDL_GetError(void); 43 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 44 | 45 | /** 46 | * \name Internal error functions 47 | * 48 | * \internal 49 | * Private error reporting function - used internally. 50 | */ 51 | /* @{ */ 52 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 53 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 54 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) 55 | typedef enum 56 | { 57 | SDL_ENOMEM, 58 | SDL_EFREAD, 59 | SDL_EFWRITE, 60 | SDL_EFSEEK, 61 | SDL_UNSUPPORTED, 62 | SDL_LASTERROR 63 | } SDL_errorcode; 64 | /* SDL_Error() unconditionally returns -1. */ 65 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); 66 | /* @} *//* Internal error functions */ 67 | 68 | /* Ends C function definitions when using C++ */ 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | #include "close_code.h" 73 | 74 | #endif /* SDL_error_h_ */ 75 | 76 | /* vi: set ts=4 sw=4 expandtab: */ 77 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_gesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_gesture.h 24 | * 25 | * Include file for SDL gesture event handling. 26 | */ 27 | 28 | #ifndef SDL_gesture_h_ 29 | #define SDL_gesture_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "SDL_touch.h" 36 | 37 | 38 | #include "begin_code.h" 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef Sint64 SDL_GestureID; 45 | 46 | /* Function prototypes */ 47 | 48 | /** 49 | * \brief Begin Recording a gesture on the specified touch, or all touches (-1) 50 | * 51 | * 52 | */ 53 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); 54 | 55 | 56 | /** 57 | * \brief Save all currently loaded Dollar Gesture templates 58 | * 59 | * 60 | */ 61 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); 62 | 63 | /** 64 | * \brief Save a currently loaded Dollar Gesture template 65 | * 66 | * 67 | */ 68 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); 69 | 70 | 71 | /** 72 | * \brief Load Dollar Gesture templates from a file 73 | * 74 | * 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); 77 | 78 | 79 | /* Ends C function definitions when using C++ */ 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #include "close_code.h" 84 | 85 | #endif /* SDL_gesture_h_ */ 86 | 87 | /* vi: set ts=4 sw=4 expandtab: */ 88 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifndef _MSC_VER 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_power_h_ 23 | #define SDL_power_h_ 24 | 25 | /** 26 | * \file SDL_power.h 27 | * 28 | * Header for the SDL power management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief The basic state for the system's power supply. 41 | */ 42 | typedef enum 43 | { 44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ 45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ 46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ 47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ 48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ 49 | } SDL_PowerState; 50 | 51 | 52 | /** 53 | * \brief Get the current power supply details. 54 | * 55 | * \param secs Seconds of battery life left. You can pass a NULL here if 56 | * you don't care. Will return -1 if we can't determine a 57 | * value, or we're not running on a battery. 58 | * 59 | * \param pct Percentage of battery life left, between 0 and 100. You can 60 | * pass a NULL here if you don't care. Will return -1 if we 61 | * can't determine a value, or we're not running on a battery. 62 | * 63 | * \return The state of the battery (if any). 64 | */ 65 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); 66 | 67 | /* Ends C function definitions when using C++ */ 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #include "close_code.h" 72 | 73 | #endif /* SDL_power_h_ */ 74 | 75 | /* vi: set ts=4 sw=4 expandtab: */ 76 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef SDL_quit_h_ 29 | #define SDL_quit_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* SDL_quit_h_ */ 59 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-13609:34cc7d3b69d3" 2 | #define SDL_REVISION_NUMBER 13609 3 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_h_ 31 | #define SDL_test_h_ 32 | 33 | #include "SDL.h" 34 | #include "SDL_test_assert.h" 35 | #include "SDL_test_common.h" 36 | #include "SDL_test_compare.h" 37 | #include "SDL_test_crc32.h" 38 | #include "SDL_test_font.h" 39 | #include "SDL_test_fuzzer.h" 40 | #include "SDL_test_harness.h" 41 | #include "SDL_test_images.h" 42 | #include "SDL_test_log.h" 43 | #include "SDL_test_md5.h" 44 | #include "SDL_test_memory.h" 45 | #include "SDL_test_random.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /* Global definitions */ 54 | 55 | /* 56 | * Note: Maximum size of SDLTest log message is less than SDL's limit 57 | * to ensure we can fit additional information such as the timestamp. 58 | */ 59 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_test_compare.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_compare.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines comparison functions (i.e. for surfaces). 33 | 34 | */ 35 | 36 | #ifndef SDL_test_compare_h_ 37 | #define SDL_test_compare_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "SDL_test_images.h" 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Compares a surface and with reference image data for equality 51 | * 52 | * \param surface Surface used in comparison 53 | * \param referenceSurface Test Surface used in comparison 54 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. 55 | * 56 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. 57 | */ 58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); 59 | 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_compare_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_test_font.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_font.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_font_h_ 31 | #define SDL_test_font_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | #define FONT_CHARACTER_SIZE 8 42 | 43 | /** 44 | * \brief Draw a string in the currently set font. 45 | * 46 | * \param renderer The renderer to draw on. 47 | * \param x The X coordinate of the upper left corner of the character. 48 | * \param y The Y coordinate of the upper left corner of the character. 49 | * \param c The character to draw. 50 | * 51 | * \returns Returns 0 on success, -1 on failure. 52 | */ 53 | int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c); 54 | 55 | /** 56 | * \brief Draw a string in the currently set font. 57 | * 58 | * \param renderer The renderer to draw on. 59 | * \param x The X coordinate of the upper left corner of the string. 60 | * \param y The Y coordinate of the upper left corner of the string. 61 | * \param s The string to draw. 62 | * 63 | * \returns Returns 0 on success, -1 on failure. 64 | */ 65 | int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); 66 | 67 | 68 | /** 69 | * \brief Cleanup textures used by font drawing functions. 70 | */ 71 | void SDLTest_CleanupTextDrawing(void); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_test_font_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_test_images.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_images.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines some images for tests. 33 | 34 | */ 35 | 36 | #ifndef SDL_test_images_h_ 37 | #define SDL_test_images_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "begin_code.h" 42 | /* Set up for C function definitions, even when using C++ */ 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /** 48 | *Type for test images. 49 | */ 50 | typedef struct SDLTest_SurfaceImage_s { 51 | int width; 52 | int height; 53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ 54 | const char *pixel_data; 55 | } SDLTest_SurfaceImage_t; 56 | 57 | /* Test images */ 58 | SDL_Surface *SDLTest_ImageBlit(void); 59 | SDL_Surface *SDLTest_ImageBlitColor(void); 60 | SDL_Surface *SDLTest_ImageBlitAlpha(void); 61 | SDL_Surface *SDLTest_ImageBlitBlendAdd(void); 62 | SDL_Surface *SDLTest_ImageBlitBlend(void); 63 | SDL_Surface *SDLTest_ImageBlitBlendMod(void); 64 | SDL_Surface *SDLTest_ImageBlitBlendNone(void); 65 | SDL_Surface *SDLTest_ImageBlitBlendAll(void); 66 | SDL_Surface *SDLTest_ImageFace(void); 67 | SDL_Surface *SDLTest_ImagePrimitives(void); 68 | SDL_Surface *SDLTest_ImagePrimitivesBlend(void); 69 | 70 | /* Ends C function definitions when using C++ */ 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | #include "close_code.h" 75 | 76 | #endif /* SDL_test_images_h_ */ 77 | 78 | /* vi: set ts=4 sw=4 expandtab: */ 79 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_log_h_ 37 | #define SDL_test_log_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* SDL_test_log_h_ */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_memory.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_memory_h_ 31 | #define SDL_test_memory_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** 41 | * \brief Start tracking SDL memory allocations 42 | * 43 | * \note This should be called before any other SDL functions for complete tracking coverage 44 | */ 45 | int SDLTest_TrackAllocations(void); 46 | 47 | /** 48 | * \brief Print a log of any outstanding allocations 49 | * 50 | * \note This can be called after SDL_Quit() 51 | */ 52 | void SDLTest_LogAllocations(void); 53 | 54 | 55 | /* Ends C function definitions when using C++ */ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | #include "close_code.h" 60 | 61 | #endif /* SDL_test_memory_h_ */ 62 | 63 | /* vi: set ts=4 sw=4 expandtab: */ 64 | -------------------------------------------------------------------------------- /3rd/include/SDL2/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /3rd/include/SDL2/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /3rd/include/libavcodec/ac3_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * AC-3 parser prototypes 3 | * Copyright (c) 2003 Fabrice Bellard 4 | * Copyright (c) 2003 Michael Niedermayer 5 | * 6 | * This file is part of FFmpeg. 7 | * 8 | * FFmpeg is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * FFmpeg is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with FFmpeg; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef AVCODEC_AC3_PARSER_H 24 | #define AVCODEC_AC3_PARSER_H 25 | 26 | #include 27 | #include 28 | 29 | /** 30 | * Extract the bitstream ID and the frame size from AC-3 data. 31 | */ 32 | int av_ac3_parse_header(const uint8_t *buf, size_t size, 33 | uint8_t *bitstream_id, uint16_t *frame_size); 34 | 35 | 36 | #endif /* AVCODEC_AC3_PARSER_H */ 37 | -------------------------------------------------------------------------------- /3rd/include/libavcodec/adts_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVCODEC_ADTS_PARSER_H 20 | #define AVCODEC_ADTS_PARSER_H 21 | 22 | #include 23 | #include 24 | 25 | #define AV_AAC_ADTS_HEADER_SIZE 7 26 | 27 | /** 28 | * Extract the number of samples and frames from AAC data. 29 | * @param[in] buf pointer to AAC data buffer 30 | * @param[out] samples Pointer to where number of samples is written 31 | * @param[out] frames Pointer to where number of frames is written 32 | * @return Returns 0 on success, error code on failure. 33 | */ 34 | int av_adts_header_parse(const uint8_t *buf, uint32_t *samples, 35 | uint8_t *frames); 36 | 37 | #endif /* AVCODEC_ADTS_PARSER_H */ 38 | -------------------------------------------------------------------------------- /3rd/include/libavcodec/avdct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVCODEC_AVDCT_H 20 | #define AVCODEC_AVDCT_H 21 | 22 | #include "libavutil/opt.h" 23 | 24 | /** 25 | * AVDCT context. 26 | * @note function pointers can be NULL if the specific features have been 27 | * disabled at build time. 28 | */ 29 | typedef struct AVDCT { 30 | const AVClass *av_class; 31 | 32 | void (*idct)(int16_t *block /* align 16 */); 33 | 34 | /** 35 | * IDCT input permutation. 36 | * Several optimized IDCTs need a permutated input (relative to the 37 | * normal order of the reference IDCT). 38 | * This permutation must be performed before the idct_put/add. 39 | * Note, normally this can be merged with the zigzag/alternate scan
40 | * An example to avoid confusion: 41 | * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...) 42 | * - (x -> reference DCT -> reference IDCT -> x) 43 | * - (x -> reference DCT -> simple_mmx_perm = idct_permutation 44 | * -> simple_idct_mmx -> x) 45 | * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant 46 | * -> simple_idct_mmx -> ...) 47 | */ 48 | uint8_t idct_permutation[64]; 49 | 50 | void (*fdct)(int16_t *block /* align 16 */); 51 | 52 | 53 | /** 54 | * DCT algorithm. 55 | * must use AVOptions to set this field. 56 | */ 57 | int dct_algo; 58 | 59 | /** 60 | * IDCT algorithm. 61 | * must use AVOptions to set this field. 62 | */ 63 | int idct_algo; 64 | 65 | void (*get_pixels)(int16_t *block /* align 16 */, 66 | const uint8_t *pixels /* align 8 */, 67 | ptrdiff_t line_size); 68 | 69 | int bits_per_sample; 70 | } AVDCT; 71 | 72 | /** 73 | * Allocates a AVDCT context. 74 | * This needs to be initialized with avcodec_dct_init() after optionally 75 | * configuring it with AVOptions. 76 | * 77 | * To free it use av_free() 78 | */ 79 | AVDCT *avcodec_dct_alloc(void); 80 | int avcodec_dct_init(AVDCT *); 81 | 82 | const AVClass *avcodec_dct_get_class(void); 83 | 84 | #endif /* AVCODEC_AVDCT_H */ 85 | -------------------------------------------------------------------------------- /3rd/include/libavcodec/dxva2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DXVA2 HW acceleration 3 | * 4 | * copyright (c) 2009 Laurent Aimar 5 | * 6 | * This file is part of FFmpeg. 7 | * 8 | * FFmpeg is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * FFmpeg is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with FFmpeg; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef AVCODEC_DXVA2_H 24 | #define AVCODEC_DXVA2_H 25 | 26 | /** 27 | * @file 28 | * @ingroup lavc_codec_hwaccel_dxva2 29 | * Public libavcodec DXVA2 header. 30 | */ 31 | 32 | #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602 33 | #undef _WIN32_WINNT 34 | #define _WIN32_WINNT 0x0602 35 | #endif 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | /** 42 | * @defgroup lavc_codec_hwaccel_dxva2 DXVA2 43 | * @ingroup lavc_codec_hwaccel 44 | * 45 | * @{ 46 | */ 47 | 48 | #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards 49 | #define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface 50 | 51 | /** 52 | * This structure is used to provides the necessary configurations and data 53 | * to the DXVA2 FFmpeg HWAccel implementation. 54 | * 55 | * The application must make it available as AVCodecContext.hwaccel_context. 56 | */ 57 | struct dxva_context { 58 | /** 59 | * DXVA2 decoder object 60 | */ 61 | IDirectXVideoDecoder *decoder; 62 | 63 | /** 64 | * DXVA2 configuration used to create the decoder 65 | */ 66 | const DXVA2_ConfigPictureDecode *cfg; 67 | 68 | /** 69 | * The number of surface in the surface array 70 | */ 71 | unsigned surface_count; 72 | 73 | /** 74 | * The array of Direct3D surfaces used to create the decoder 75 | */ 76 | LPDIRECT3DSURFACE9 *surface; 77 | 78 | /** 79 | * A bit field configuring the workarounds needed for using the decoder 80 | */ 81 | uint64_t workaround; 82 | 83 | /** 84 | * Private to the FFmpeg AVHWAccel implementation 85 | */ 86 | unsigned report_id; 87 | }; 88 | 89 | /** 90 | * @} 91 | */ 92 | 93 | #endif /* AVCODEC_DXVA2_H */ 94 | -------------------------------------------------------------------------------- /3rd/include/libavcodec/jni.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JNI public API functions 3 | * 4 | * Copyright (c) 2015-2016 Matthieu Bouron 5 | * 6 | * This file is part of FFmpeg. 7 | * 8 | * FFmpeg is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * FFmpeg is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with FFmpeg; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef AVCODEC_JNI_H 24 | #define AVCODEC_JNI_H 25 | 26 | /* 27 | * Manually set a Java virtual machine which will be used to retrieve the JNI 28 | * environment. Once a Java VM is set it cannot be changed afterwards, meaning 29 | * you can call multiple times av_jni_set_java_vm with the same Java VM pointer 30 | * however it will error out if you try to set a different Java VM. 31 | * 32 | * @param vm Java virtual machine 33 | * @param log_ctx context used for logging, can be NULL 34 | * @return 0 on success, < 0 otherwise 35 | */ 36 | int av_jni_set_java_vm(void *vm, void *log_ctx); 37 | 38 | /* 39 | * Get the Java virtual machine which has been set with av_jni_set_java_vm. 40 | * 41 | * @param vm Java virtual machine 42 | * @return a pointer to the Java virtual machine 43 | */ 44 | void *av_jni_get_java_vm(void *log_ctx); 45 | 46 | #endif /* AVCODEC_JNI_H */ 47 | -------------------------------------------------------------------------------- /3rd/include/libavcodec/vaapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Video Acceleration API (shared data between FFmpeg and the video player) 3 | * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1 4 | * 5 | * Copyright (C) 2008-2009 Splitted-Desktop Systems 6 | * 7 | * This file is part of FFmpeg. 8 | * 9 | * FFmpeg is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 2.1 of the License, or (at your option) any later version. 13 | * 14 | * FFmpeg is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with FFmpeg; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef AVCODEC_VAAPI_H 25 | #define AVCODEC_VAAPI_H 26 | 27 | /** 28 | * @file 29 | * @ingroup lavc_codec_hwaccel_vaapi 30 | * Public libavcodec VA API header. 31 | */ 32 | 33 | #include 34 | #include "libavutil/attributes.h" 35 | #include "version.h" 36 | 37 | #if FF_API_STRUCT_VAAPI_CONTEXT 38 | 39 | /** 40 | * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding 41 | * @ingroup lavc_codec_hwaccel 42 | * @{ 43 | */ 44 | 45 | /** 46 | * This structure is used to share data between the FFmpeg library and 47 | * the client video application. 48 | * This shall be zero-allocated and available as 49 | * AVCodecContext.hwaccel_context. All user members can be set once 50 | * during initialization or through each AVCodecContext.get_buffer() 51 | * function call. In any case, they must be valid prior to calling 52 | * decoding functions. 53 | * 54 | * Deprecated: use AVCodecContext.hw_frames_ctx instead. 55 | */ 56 | struct attribute_deprecated vaapi_context { 57 | /** 58 | * Window system dependent data 59 | * 60 | * - encoding: unused 61 | * - decoding: Set by user 62 | */ 63 | void *display; 64 | 65 | /** 66 | * Configuration ID 67 | * 68 | * - encoding: unused 69 | * - decoding: Set by user 70 | */ 71 | uint32_t config_id; 72 | 73 | /** 74 | * Context ID (video decode pipeline) 75 | * 76 | * - encoding: unused 77 | * - decoding: Set by user 78 | */ 79 | uint32_t context_id; 80 | }; 81 | 82 | /* @} */ 83 | 84 | #endif /* FF_API_STRUCT_VAAPI_CONTEXT */ 85 | 86 | #endif /* AVCODEC_VAAPI_H */ 87 | -------------------------------------------------------------------------------- /3rd/include/libavcodec/vorbis_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * A public API for Vorbis parsing 22 | * 23 | * Determines the duration for each packet. 24 | */ 25 | 26 | #ifndef AVCODEC_VORBIS_PARSER_H 27 | #define AVCODEC_VORBIS_PARSER_H 28 | 29 | #include 30 | 31 | typedef struct AVVorbisParseContext AVVorbisParseContext; 32 | 33 | /** 34 | * Allocate and initialize the Vorbis parser using headers in the extradata. 35 | */ 36 | AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata, 37 | int extradata_size); 38 | 39 | /** 40 | * Free the parser and everything associated with it. 41 | */ 42 | void av_vorbis_parse_free(AVVorbisParseContext **s); 43 | 44 | #define VORBIS_FLAG_HEADER 0x00000001 45 | #define VORBIS_FLAG_COMMENT 0x00000002 46 | #define VORBIS_FLAG_SETUP 0x00000004 47 | 48 | /** 49 | * Get the duration for a Vorbis packet. 50 | * 51 | * If @p flags is @c NULL, 52 | * special frames are considered invalid. 53 | * 54 | * @param s Vorbis parser context 55 | * @param buf buffer containing a Vorbis frame 56 | * @param buf_size size of the buffer 57 | * @param flags flags for special frames 58 | */ 59 | int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf, 60 | int buf_size, int *flags); 61 | 62 | /** 63 | * Get the duration for a Vorbis packet. 64 | * 65 | * @param s Vorbis parser context 66 | * @param buf buffer containing a Vorbis frame 67 | * @param buf_size size of the buffer 68 | */ 69 | int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf, 70 | int buf_size); 71 | 72 | void av_vorbis_parse_reset(AVVorbisParseContext *s); 73 | 74 | #endif /* AVCODEC_VORBIS_PARSER_H */ 75 | -------------------------------------------------------------------------------- /3rd/include/libavdevice/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVDEVICE_VERSION_H 20 | #define AVDEVICE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavd 25 | * Libavdevice version macros 26 | */ 27 | 28 | #include "libavutil/version.h" 29 | 30 | #define LIBAVDEVICE_VERSION_MAJOR 58 31 | #define LIBAVDEVICE_VERSION_MINOR 8 32 | #define LIBAVDEVICE_VERSION_MICRO 100 33 | 34 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ 35 | LIBAVDEVICE_VERSION_MINOR, \ 36 | LIBAVDEVICE_VERSION_MICRO) 37 | #define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \ 38 | LIBAVDEVICE_VERSION_MINOR, \ 39 | LIBAVDEVICE_VERSION_MICRO) 40 | #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT 41 | 42 | #define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) 43 | 44 | /** 45 | * FF_API_* defines may be placed below to indicate public API that will be 46 | * dropped at a future version bump. The defines themselves are not part of 47 | * the public API and may change, break or disappear at any time. 48 | */ 49 | 50 | #endif /* AVDEVICE_VERSION_H */ 51 | -------------------------------------------------------------------------------- /3rd/include/libavfilter/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVFILTER_VERSION_H 22 | #define AVFILTER_VERSION_H 23 | 24 | /** 25 | * @file 26 | * @ingroup lavfi 27 | * Libavfilter version macros 28 | */ 29 | 30 | #include "libavutil/version.h" 31 | 32 | #define LIBAVFILTER_VERSION_MAJOR 7 33 | #define LIBAVFILTER_VERSION_MINOR 57 34 | #define LIBAVFILTER_VERSION_MICRO 100 35 | 36 | 37 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ 38 | LIBAVFILTER_VERSION_MINOR, \ 39 | LIBAVFILTER_VERSION_MICRO) 40 | #define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \ 41 | LIBAVFILTER_VERSION_MINOR, \ 42 | LIBAVFILTER_VERSION_MICRO) 43 | #define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT 44 | 45 | #define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION) 46 | 47 | /** 48 | * FF_API_* defines may be placed below to indicate public API that will be 49 | * dropped at a future version bump. The defines themselves are not part of 50 | * the public API and may change, break or disappear at any time. 51 | */ 52 | 53 | #ifndef FF_API_OLD_FILTER_OPTS_ERROR 54 | #define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 8) 55 | #endif 56 | #ifndef FF_API_LAVR_OPTS 57 | #define FF_API_LAVR_OPTS (LIBAVFILTER_VERSION_MAJOR < 8) 58 | #endif 59 | #ifndef FF_API_FILTER_GET_SET 60 | #define FF_API_FILTER_GET_SET (LIBAVFILTER_VERSION_MAJOR < 8) 61 | #endif 62 | #ifndef FF_API_NEXT 63 | #define FF_API_NEXT (LIBAVFILTER_VERSION_MAJOR < 8) 64 | #endif 65 | 66 | #endif /* AVFILTER_VERSION_H */ 67 | -------------------------------------------------------------------------------- /3rd/include/libavutil/adler32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * @ingroup lavu_adler32 24 | * Public header for Adler-32 hash function implementation. 25 | */ 26 | 27 | #ifndef AVUTIL_ADLER32_H 28 | #define AVUTIL_ADLER32_H 29 | 30 | #include 31 | #include "attributes.h" 32 | 33 | /** 34 | * @defgroup lavu_adler32 Adler-32 35 | * @ingroup lavu_hash 36 | * Adler-32 hash function implementation. 37 | * 38 | * @{ 39 | */ 40 | 41 | /** 42 | * Calculate the Adler32 checksum of a buffer. 43 | * 44 | * Passing the return value to a subsequent av_adler32_update() call 45 | * allows the checksum of multiple buffers to be calculated as though 46 | * they were concatenated. 47 | * 48 | * @param adler initial checksum value 49 | * @param buf pointer to input buffer 50 | * @param len size of input buffer 51 | * @return updated checksum 52 | */ 53 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, 54 | unsigned int len) av_pure; 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | #endif /* AVUTIL_ADLER32_H */ 61 | -------------------------------------------------------------------------------- /3rd/include/libavutil/aes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2007 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_AES_H 22 | #define AVUTIL_AES_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_aes AES 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_aes_size; 36 | 37 | struct AVAES; 38 | 39 | /** 40 | * Allocate an AVAES context. 41 | */ 42 | struct AVAES *av_aes_alloc(void); 43 | 44 | /** 45 | * Initialize an AVAES context. 46 | * @param key_bits 128, 192 or 256 47 | * @param decrypt 0 for encryption, 1 for decryption 48 | */ 49 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); 50 | 51 | /** 52 | * Encrypt or decrypt a buffer using a previously initialized context. 53 | * @param count number of 16 byte blocks 54 | * @param dst destination array, can be equal to src 55 | * @param src source array, can be equal to dst 56 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 57 | * @param decrypt 0 for encryption, 1 for decryption 58 | */ 59 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | #endif /* AVUTIL_AES_H */ 66 | -------------------------------------------------------------------------------- /3rd/include/libavutil/aes_ctr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * AES-CTR cipher 3 | * Copyright (c) 2015 Eran Kornblau 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_AES_CTR_H 23 | #define AVUTIL_AES_CTR_H 24 | 25 | #include 26 | 27 | #include "attributes.h" 28 | #include "version.h" 29 | 30 | #define AES_CTR_KEY_SIZE (16) 31 | #define AES_CTR_IV_SIZE (8) 32 | 33 | struct AVAESCTR; 34 | 35 | /** 36 | * Allocate an AVAESCTR context. 37 | */ 38 | struct AVAESCTR *av_aes_ctr_alloc(void); 39 | 40 | /** 41 | * Initialize an AVAESCTR context. 42 | * @param key encryption key, must have a length of AES_CTR_KEY_SIZE 43 | */ 44 | int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key); 45 | 46 | /** 47 | * Release an AVAESCTR context. 48 | */ 49 | void av_aes_ctr_free(struct AVAESCTR *a); 50 | 51 | /** 52 | * Process a buffer using a previously initialized context. 53 | * @param dst destination array, can be equal to src 54 | * @param src source array, can be equal to dst 55 | * @param size the size of src and dst 56 | */ 57 | void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size); 58 | 59 | /** 60 | * Get the current iv 61 | */ 62 | const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a); 63 | 64 | /** 65 | * Generate a random iv 66 | */ 67 | void av_aes_ctr_set_random_iv(struct AVAESCTR *a); 68 | 69 | /** 70 | * Forcefully change the 8-byte iv 71 | */ 72 | void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv); 73 | 74 | /** 75 | * Forcefully change the "full" 16-byte iv, including the counter 76 | */ 77 | void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t* iv); 78 | 79 | /** 80 | * Increment the top 64 bit of the iv (performed after each frame) 81 | */ 82 | void av_aes_ctr_increment_iv(struct AVAESCTR *a); 83 | 84 | /** 85 | * @} 86 | */ 87 | 88 | #endif /* AVUTIL_AES_CTR_H */ 89 | -------------------------------------------------------------------------------- /3rd/include/libavutil/avassert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2010 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * simple assert() macros that are a bit more flexible than ISO C assert(). 24 | * @author Michael Niedermayer 25 | */ 26 | 27 | #ifndef AVUTIL_AVASSERT_H 28 | #define AVUTIL_AVASSERT_H 29 | 30 | #include 31 | #include "avutil.h" 32 | #include "log.h" 33 | 34 | /** 35 | * assert() equivalent, that is always enabled. 36 | */ 37 | #define av_assert0(cond) do { \ 38 | if (!(cond)) { \ 39 | av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \ 40 | AV_STRINGIFY(cond), __FILE__, __LINE__); \ 41 | abort(); \ 42 | } \ 43 | } while (0) 44 | 45 | 46 | /** 47 | * assert() equivalent, that does not lie in speed critical code. 48 | * These asserts() thus can be enabled without fearing speed loss. 49 | */ 50 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0 51 | #define av_assert1(cond) av_assert0(cond) 52 | #else 53 | #define av_assert1(cond) ((void)0) 54 | #endif 55 | 56 | 57 | /** 58 | * assert() equivalent, that does lie in speed critical code. 59 | */ 60 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 61 | #define av_assert2(cond) av_assert0(cond) 62 | #define av_assert2_fpu() av_assert0_fpu() 63 | #else 64 | #define av_assert2(cond) ((void)0) 65 | #define av_assert2_fpu() ((void)0) 66 | #endif 67 | 68 | /** 69 | * Assert that floating point operations can be executed. 70 | * 71 | * This will av_assert0() that the cpu is not in MMX state on X86 72 | */ 73 | void av_assert0_fpu(void); 74 | 75 | #endif /* AVUTIL_AVASSERT_H */ 76 | -------------------------------------------------------------------------------- /3rd/include/libavutil/avconfig.h: -------------------------------------------------------------------------------- 1 | /* Generated by ffmpeg configure */ 2 | #ifndef AVUTIL_AVCONFIG_H 3 | #define AVUTIL_AVCONFIG_H 4 | #define AV_HAVE_BIGENDIAN 0 5 | #define AV_HAVE_FAST_UNALIGNED 1 6 | #endif /* AVUTIL_AVCONFIG_H */ 7 | -------------------------------------------------------------------------------- /3rd/include/libavutil/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com) 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_BASE64_H 22 | #define AVUTIL_BASE64_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_base64 Base64 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | /** 33 | * Decode a base64-encoded string. 34 | * 35 | * @param out buffer for decoded data 36 | * @param in null-terminated input string 37 | * @param out_size size in bytes of the out buffer, must be at 38 | * least 3/4 of the length of in, that is AV_BASE64_DECODE_SIZE(strlen(in)) 39 | * @return number of bytes written, or a negative value in case of 40 | * invalid input 41 | */ 42 | int av_base64_decode(uint8_t *out, const char *in, int out_size); 43 | 44 | /** 45 | * Calculate the output size in bytes needed to decode a base64 string 46 | * with length x to a data buffer. 47 | */ 48 | #define AV_BASE64_DECODE_SIZE(x) ((x) * 3LL / 4) 49 | 50 | /** 51 | * Encode data to base64 and null-terminate. 52 | * 53 | * @param out buffer for encoded data 54 | * @param out_size size in bytes of the out buffer (including the 55 | * null terminator), must be at least AV_BASE64_SIZE(in_size) 56 | * @param in input buffer containing the data to encode 57 | * @param in_size size in bytes of the in buffer 58 | * @return out or NULL in case of error 59 | */ 60 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); 61 | 62 | /** 63 | * Calculate the output size needed to base64-encode x bytes to a 64 | * null-terminated string. 65 | */ 66 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) 67 | 68 | /** 69 | * @} 70 | */ 71 | 72 | #endif /* AVUTIL_BASE64_H */ 73 | -------------------------------------------------------------------------------- /3rd/include/libavutil/blowfish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Blowfish algorithm 3 | * Copyright (c) 2012 Samuel Pitoiset 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_BLOWFISH_H 23 | #define AVUTIL_BLOWFISH_H 24 | 25 | #include 26 | 27 | /** 28 | * @defgroup lavu_blowfish Blowfish 29 | * @ingroup lavu_crypto 30 | * @{ 31 | */ 32 | 33 | #define AV_BF_ROUNDS 16 34 | 35 | typedef struct AVBlowfish { 36 | uint32_t p[AV_BF_ROUNDS + 2]; 37 | uint32_t s[4][256]; 38 | } AVBlowfish; 39 | 40 | /** 41 | * Allocate an AVBlowfish context. 42 | */ 43 | AVBlowfish *av_blowfish_alloc(void); 44 | 45 | /** 46 | * Initialize an AVBlowfish context. 47 | * 48 | * @param ctx an AVBlowfish context 49 | * @param key a key 50 | * @param key_len length of the key 51 | */ 52 | void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len); 53 | 54 | /** 55 | * Encrypt or decrypt a buffer using a previously initialized context. 56 | * 57 | * @param ctx an AVBlowfish context 58 | * @param xl left four bytes halves of input to be encrypted 59 | * @param xr right four bytes halves of input to be encrypted 60 | * @param decrypt 0 for encryption, 1 for decryption 61 | */ 62 | void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr, 63 | int decrypt); 64 | 65 | /** 66 | * Encrypt or decrypt a buffer using a previously initialized context. 67 | * 68 | * @param ctx an AVBlowfish context 69 | * @param dst destination array, can be equal to src 70 | * @param src source array, can be equal to dst 71 | * @param count number of 8 byte blocks 72 | * @param iv initialization vector for CBC mode, if NULL ECB will be used 73 | * @param decrypt 0 for encryption, 1 for decryption 74 | */ 75 | void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src, 76 | int count, uint8_t *iv, int decrypt); 77 | 78 | /** 79 | * @} 80 | */ 81 | 82 | #endif /* AVUTIL_BLOWFISH_H */ 83 | -------------------------------------------------------------------------------- /3rd/include/libavutil/camellia.h: -------------------------------------------------------------------------------- 1 | /* 2 | * An implementation of the CAMELLIA algorithm as mentioned in RFC3713 3 | * Copyright (c) 2014 Supraja Meedinti 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_CAMELLIA_H 23 | #define AVUTIL_CAMELLIA_H 24 | 25 | #include 26 | 27 | 28 | /** 29 | * @file 30 | * @brief Public header for libavutil CAMELLIA algorithm 31 | * @defgroup lavu_camellia CAMELLIA 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_camellia_size; 37 | 38 | struct AVCAMELLIA; 39 | 40 | /** 41 | * Allocate an AVCAMELLIA context 42 | * To free the struct: av_free(ptr) 43 | */ 44 | struct AVCAMELLIA *av_camellia_alloc(void); 45 | 46 | /** 47 | * Initialize an AVCAMELLIA context. 48 | * 49 | * @param ctx an AVCAMELLIA context 50 | * @param key a key of 16, 24, 32 bytes used for encryption/decryption 51 | * @param key_bits number of keybits: possible are 128, 192, 256 52 | */ 53 | int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits); 54 | 55 | /** 56 | * Encrypt or decrypt a buffer using a previously initialized context 57 | * 58 | * @param ctx an AVCAMELLIA context 59 | * @param dst destination array, can be equal to src 60 | * @param src source array, can be equal to dst 61 | * @param count number of 16 byte blocks 62 | * @paran iv initialization vector for CBC mode, NULL for ECB mode 63 | * @param decrypt 0 for encryption, 1 for decryption 64 | */ 65 | void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); 66 | 67 | /** 68 | * @} 69 | */ 70 | #endif /* AVUTIL_CAMELLIA_H */ 71 | -------------------------------------------------------------------------------- /3rd/include/libavutil/cast5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * An implementation of the CAST128 algorithm as mentioned in RFC2144 3 | * Copyright (c) 2014 Supraja Meedinti 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_CAST5_H 23 | #define AVUTIL_CAST5_H 24 | 25 | #include 26 | 27 | 28 | /** 29 | * @file 30 | * @brief Public header for libavutil CAST5 algorithm 31 | * @defgroup lavu_cast5 CAST5 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_cast5_size; 37 | 38 | struct AVCAST5; 39 | 40 | /** 41 | * Allocate an AVCAST5 context 42 | * To free the struct: av_free(ptr) 43 | */ 44 | struct AVCAST5 *av_cast5_alloc(void); 45 | /** 46 | * Initialize an AVCAST5 context. 47 | * 48 | * @param ctx an AVCAST5 context 49 | * @param key a key of 5,6,...16 bytes used for encryption/decryption 50 | * @param key_bits number of keybits: possible are 40,48,...,128 51 | * @return 0 on success, less than 0 on failure 52 | */ 53 | int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits); 54 | 55 | /** 56 | * Encrypt or decrypt a buffer using a previously initialized context, ECB mode only 57 | * 58 | * @param ctx an AVCAST5 context 59 | * @param dst destination array, can be equal to src 60 | * @param src source array, can be equal to dst 61 | * @param count number of 8 byte blocks 62 | * @param decrypt 0 for encryption, 1 for decryption 63 | */ 64 | void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt); 65 | 66 | /** 67 | * Encrypt or decrypt a buffer using a previously initialized context 68 | * 69 | * @param ctx an AVCAST5 context 70 | * @param dst destination array, can be equal to src 71 | * @param src source array, can be equal to dst 72 | * @param count number of 8 byte blocks 73 | * @param iv initialization vector for CBC mode, NULL for ECB mode 74 | * @param decrypt 0 for encryption, 1 for decryption 75 | */ 76 | void av_cast5_crypt2(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 77 | /** 78 | * @} 79 | */ 80 | #endif /* AVUTIL_CAST5_H */ 81 | -------------------------------------------------------------------------------- /3rd/include/libavutil/des.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DES encryption/decryption 3 | * Copyright (c) 2007 Reimar Doeffinger 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_DES_H 23 | #define AVUTIL_DES_H 24 | 25 | #include 26 | 27 | /** 28 | * @defgroup lavu_des DES 29 | * @ingroup lavu_crypto 30 | * @{ 31 | */ 32 | 33 | typedef struct AVDES { 34 | uint64_t round_keys[3][16]; 35 | int triple_des; 36 | } AVDES; 37 | 38 | /** 39 | * Allocate an AVDES context. 40 | */ 41 | AVDES *av_des_alloc(void); 42 | 43 | /** 44 | * @brief Initializes an AVDES context. 45 | * 46 | * @param key_bits must be 64 or 192 47 | * @param decrypt 0 for encryption/CBC-MAC, 1 for decryption 48 | * @return zero on success, negative value otherwise 49 | */ 50 | int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt); 51 | 52 | /** 53 | * @brief Encrypts / decrypts using the DES algorithm. 54 | * 55 | * @param count number of 8 byte blocks 56 | * @param dst destination array, can be equal to src, must be 8-byte aligned 57 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL 58 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used, 59 | * must be 8-byte aligned 60 | * @param decrypt 0 for encryption, 1 for decryption 61 | */ 62 | void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 63 | 64 | /** 65 | * @brief Calculates CBC-MAC using the DES algorithm. 66 | * 67 | * @param count number of 8 byte blocks 68 | * @param dst destination array, can be equal to src, must be 8-byte aligned 69 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL 70 | */ 71 | void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count); 72 | 73 | /** 74 | * @} 75 | */ 76 | 77 | #endif /* AVUTIL_DES_H */ 78 | -------------------------------------------------------------------------------- /3rd/include/libavutil/ffversion.h: -------------------------------------------------------------------------------- 1 | /* Automatically generated by version.sh, do not manually edit! */ 2 | #ifndef AVUTIL_FFVERSION_H 3 | #define AVUTIL_FFVERSION_H 4 | #define FFMPEG_VERSION "4.2.2" 5 | #endif /* AVUTIL_FFVERSION_H */ 6 | -------------------------------------------------------------------------------- /3rd/include/libavutil/file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_FILE_H 20 | #define AVUTIL_FILE_H 21 | 22 | #include 23 | 24 | #include "avutil.h" 25 | 26 | /** 27 | * @file 28 | * Misc file utilities. 29 | */ 30 | 31 | /** 32 | * Read the file with name filename, and put its content in a newly 33 | * allocated buffer or map it with mmap() when available. 34 | * In case of success set *bufptr to the read or mmapped buffer, and 35 | * *size to the size in bytes of the buffer in *bufptr. 36 | * Unlike mmap this function succeeds with zero sized files, in this 37 | * case *bufptr will be set to NULL and *size will be set to 0. 38 | * The returned buffer must be released with av_file_unmap(). 39 | * 40 | * @param log_offset loglevel offset used for logging 41 | * @param log_ctx context used for logging 42 | * @return a non negative number in case of success, a negative value 43 | * corresponding to an AVERROR error code in case of failure 44 | */ 45 | av_warn_unused_result 46 | int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, 47 | int log_offset, void *log_ctx); 48 | 49 | /** 50 | * Unmap or free the buffer bufptr created by av_file_map(). 51 | * 52 | * @param size size in bytes of bufptr, must be the same as returned 53 | * by av_file_map() 54 | */ 55 | void av_file_unmap(uint8_t *bufptr, size_t size); 56 | 57 | /** 58 | * Wrapper to work around the lack of mkstemp() on mingw. 59 | * Also, tries to create file in /tmp first, if possible. 60 | * *prefix can be a character constant; *filename will be allocated internally. 61 | * @return file descriptor of opened file (or negative value corresponding to an 62 | * AVERROR code on error) 63 | * and opened file name in **filename. 64 | * @note On very old libcs it is necessary to set a secure umask before 65 | * calling this, av_tempfile() can't call umask itself as it is used in 66 | * libraries and could interfere with the calling application. 67 | * @deprecated as fd numbers cannot be passed saftely between libs on some platforms 68 | */ 69 | int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); 70 | 71 | #endif /* AVUTIL_FILE_H */ 72 | -------------------------------------------------------------------------------- /3rd/include/libavutil/hwcontext_cuda.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | 20 | #ifndef AVUTIL_HWCONTEXT_CUDA_H 21 | #define AVUTIL_HWCONTEXT_CUDA_H 22 | 23 | #ifndef CUDA_VERSION 24 | #include 25 | #endif 26 | 27 | #include "pixfmt.h" 28 | 29 | /** 30 | * @file 31 | * An API-specific header for AV_HWDEVICE_TYPE_CUDA. 32 | * 33 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return 34 | * AVBufferRefs whose data pointer is a CUdeviceptr. 35 | */ 36 | 37 | typedef struct AVCUDADeviceContextInternal AVCUDADeviceContextInternal; 38 | 39 | /** 40 | * This struct is allocated as AVHWDeviceContext.hwctx 41 | */ 42 | typedef struct AVCUDADeviceContext { 43 | CUcontext cuda_ctx; 44 | CUstream stream; 45 | AVCUDADeviceContextInternal *internal; 46 | } AVCUDADeviceContext; 47 | 48 | /** 49 | * AVHWFramesContext.hwctx is currently not used 50 | */ 51 | 52 | #endif /* AVUTIL_HWCONTEXT_CUDA_H */ 53 | -------------------------------------------------------------------------------- /3rd/include/libavutil/hwcontext_dxva2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | 20 | #ifndef AVUTIL_HWCONTEXT_DXVA2_H 21 | #define AVUTIL_HWCONTEXT_DXVA2_H 22 | 23 | /** 24 | * @file 25 | * An API-specific header for AV_HWDEVICE_TYPE_DXVA2. 26 | * 27 | * Only fixed-size pools are supported. 28 | * 29 | * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs 30 | * with the data pointer set to a pointer to IDirect3DSurface9. 31 | */ 32 | 33 | #include 34 | #include 35 | 36 | /** 37 | * This struct is allocated as AVHWDeviceContext.hwctx 38 | */ 39 | typedef struct AVDXVA2DeviceContext { 40 | IDirect3DDeviceManager9 *devmgr; 41 | } AVDXVA2DeviceContext; 42 | 43 | /** 44 | * This struct is allocated as AVHWFramesContext.hwctx 45 | */ 46 | typedef struct AVDXVA2FramesContext { 47 | /** 48 | * The surface type (e.g. DXVA2_VideoProcessorRenderTarget or 49 | * DXVA2_VideoDecoderRenderTarget). Must be set by the caller. 50 | */ 51 | DWORD surface_type; 52 | 53 | /** 54 | * The surface pool. When an external pool is not provided by the caller, 55 | * this will be managed (allocated and filled on init, freed on uninit) by 56 | * libavutil. 57 | */ 58 | IDirect3DSurface9 **surfaces; 59 | int nb_surfaces; 60 | 61 | /** 62 | * Certain drivers require the decoder to be destroyed before the surfaces. 63 | * To allow internally managed pools to work properly in such cases, this 64 | * field is provided. 65 | * 66 | * If it is non-NULL, libavutil will call IDirectXVideoDecoder_Release() on 67 | * it just before the internal surface pool is freed. 68 | * 69 | * This is for convenience only. Some code uses other methods to manage the 70 | * decoder reference. 71 | */ 72 | IDirectXVideoDecoder *decoder_to_release; 73 | } AVDXVA2FramesContext; 74 | 75 | #endif /* AVUTIL_HWCONTEXT_DXVA2_H */ 76 | -------------------------------------------------------------------------------- /3rd/include/libavutil/hwcontext_mediacodec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_HWCONTEXT_MEDIACODEC_H 20 | #define AVUTIL_HWCONTEXT_MEDIACODEC_H 21 | 22 | /** 23 | * MediaCodec details. 24 | * 25 | * Allocated as AVHWDeviceContext.hwctx 26 | */ 27 | typedef struct AVMediaCodecDeviceContext { 28 | /** 29 | * android/view/Surface handle, to be filled by the user. 30 | * 31 | * This is the default surface used by decoders on this device. 32 | */ 33 | void *surface; 34 | } AVMediaCodecDeviceContext; 35 | 36 | #endif /* AVUTIL_HWCONTEXT_MEDIACODEC_H */ 37 | -------------------------------------------------------------------------------- /3rd/include/libavutil/hwcontext_qsv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_HWCONTEXT_QSV_H 20 | #define AVUTIL_HWCONTEXT_QSV_H 21 | 22 | #include 23 | 24 | /** 25 | * @file 26 | * An API-specific header for AV_HWDEVICE_TYPE_QSV. 27 | * 28 | * This API does not support dynamic frame pools. AVHWFramesContext.pool must 29 | * contain AVBufferRefs whose data pointer points to an mfxFrameSurface1 struct. 30 | */ 31 | 32 | /** 33 | * This struct is allocated as AVHWDeviceContext.hwctx 34 | */ 35 | typedef struct AVQSVDeviceContext { 36 | mfxSession session; 37 | } AVQSVDeviceContext; 38 | 39 | /** 40 | * This struct is allocated as AVHWFramesContext.hwctx 41 | */ 42 | typedef struct AVQSVFramesContext { 43 | mfxFrameSurface1 *surfaces; 44 | int nb_surfaces; 45 | 46 | /** 47 | * A combination of MFX_MEMTYPE_* describing the frame pool. 48 | */ 49 | int frame_type; 50 | } AVQSVFramesContext; 51 | 52 | #endif /* AVUTIL_HWCONTEXT_QSV_H */ 53 | 54 | -------------------------------------------------------------------------------- /3rd/include/libavutil/hwcontext_vdpau.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_HWCONTEXT_VDPAU_H 20 | #define AVUTIL_HWCONTEXT_VDPAU_H 21 | 22 | #include 23 | 24 | /** 25 | * @file 26 | * An API-specific header for AV_HWDEVICE_TYPE_VDPAU. 27 | * 28 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return 29 | * AVBufferRefs whose data pointer is a VdpVideoSurface. 30 | */ 31 | 32 | /** 33 | * This struct is allocated as AVHWDeviceContext.hwctx 34 | */ 35 | typedef struct AVVDPAUDeviceContext { 36 | VdpDevice device; 37 | VdpGetProcAddress *get_proc_address; 38 | } AVVDPAUDeviceContext; 39 | 40 | /** 41 | * AVHWFramesContext.hwctx is currently not used 42 | */ 43 | 44 | #endif /* AVUTIL_HWCONTEXT_VDPAU_H */ 45 | -------------------------------------------------------------------------------- /3rd/include/libavutil/hwcontext_videotoolbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H 20 | #define AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H 21 | 22 | #include 23 | 24 | #include 25 | 26 | #include "pixfmt.h" 27 | 28 | /** 29 | * @file 30 | * An API-specific header for AV_HWDEVICE_TYPE_VIDEOTOOLBOX. 31 | * 32 | * This API currently does not support frame allocation, as the raw VideoToolbox 33 | * API does allocation, and FFmpeg itself never has the need to allocate frames. 34 | * 35 | * If the API user sets a custom pool, AVHWFramesContext.pool must return 36 | * AVBufferRefs whose data pointer is a CVImageBufferRef or CVPixelBufferRef. 37 | * 38 | * Currently AVHWDeviceContext.hwctx and AVHWFramesContext.hwctx are always 39 | * NULL. 40 | */ 41 | 42 | /** 43 | * Convert a VideoToolbox (actually CoreVideo) format to AVPixelFormat. 44 | * Returns AV_PIX_FMT_NONE if no known equivalent was found. 45 | */ 46 | enum AVPixelFormat av_map_videotoolbox_format_to_pixfmt(uint32_t cv_fmt); 47 | 48 | /** 49 | * Convert an AVPixelFormat to a VideoToolbox (actually CoreVideo) format. 50 | * Returns 0 if no known equivalent was found. 51 | */ 52 | uint32_t av_map_videotoolbox_format_from_pixfmt(enum AVPixelFormat pix_fmt); 53 | 54 | #endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */ 55 | -------------------------------------------------------------------------------- /3rd/include/libavutil/intfloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_INTFLOAT_H 22 | #define AVUTIL_INTFLOAT_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | union av_intfloat32 { 28 | uint32_t i; 29 | float f; 30 | }; 31 | 32 | union av_intfloat64 { 33 | uint64_t i; 34 | double f; 35 | }; 36 | 37 | /** 38 | * Reinterpret a 32-bit integer as a float. 39 | */ 40 | static av_always_inline float av_int2float(uint32_t i) 41 | { 42 | union av_intfloat32 v; 43 | v.i = i; 44 | return v.f; 45 | } 46 | 47 | /** 48 | * Reinterpret a float as a 32-bit integer. 49 | */ 50 | static av_always_inline uint32_t av_float2int(float f) 51 | { 52 | union av_intfloat32 v; 53 | v.f = f; 54 | return v.i; 55 | } 56 | 57 | /** 58 | * Reinterpret a 64-bit integer as a double. 59 | */ 60 | static av_always_inline double av_int2double(uint64_t i) 61 | { 62 | union av_intfloat64 v; 63 | v.i = i; 64 | return v.f; 65 | } 66 | 67 | /** 68 | * Reinterpret a double as a 64-bit integer. 69 | */ 70 | static av_always_inline uint64_t av_double2int(double f) 71 | { 72 | union av_intfloat64 v; 73 | v.f = f; 74 | return v.i; 75 | } 76 | 77 | #endif /* AVUTIL_INTFLOAT_H */ 78 | -------------------------------------------------------------------------------- /3rd/include/libavutil/lfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lagged Fibonacci PRNG 3 | * Copyright (c) 2008 Michael Niedermayer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_LFG_H 23 | #define AVUTIL_LFG_H 24 | 25 | #include 26 | 27 | /** 28 | * Context structure for the Lagged Fibonacci PRNG. 29 | * The exact layout, types and content of this struct may change and should 30 | * not be accessed directly. Only its sizeof() is guranteed to stay the same 31 | * to allow easy instanciation. 32 | */ 33 | typedef struct AVLFG { 34 | unsigned int state[64]; 35 | int index; 36 | } AVLFG; 37 | 38 | void av_lfg_init(AVLFG *c, unsigned int seed); 39 | 40 | /** 41 | * Seed the state of the ALFG using binary data. 42 | * 43 | * Return value: 0 on success, negative value (AVERROR) on failure. 44 | */ 45 | int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length); 46 | 47 | /** 48 | * Get the next random unsigned 32-bit number using an ALFG. 49 | * 50 | * Please also consider a simple LCG like state= state*1664525+1013904223, 51 | * it may be good enough and faster for your specific use case. 52 | */ 53 | static inline unsigned int av_lfg_get(AVLFG *c){ 54 | unsigned a = c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; 55 | c->index += 1U; 56 | return a; 57 | } 58 | 59 | /** 60 | * Get the next random unsigned 32-bit number using a MLFG. 61 | * 62 | * Please also consider av_lfg_get() above, it is faster. 63 | */ 64 | static inline unsigned int av_mlfg_get(AVLFG *c){ 65 | unsigned int a= c->state[(c->index-55) & 63]; 66 | unsigned int b= c->state[(c->index-24) & 63]; 67 | a = c->state[c->index & 63] = 2*a*b+a+b; 68 | c->index += 1U; 69 | return a; 70 | } 71 | 72 | /** 73 | * Get the next two numbers generated by a Box-Muller Gaussian 74 | * generator using the random numbers issued by lfg. 75 | * 76 | * @param out array where the two generated numbers are placed 77 | */ 78 | void av_bmg_get(AVLFG *lfg, double out[2]); 79 | 80 | #endif /* AVUTIL_LFG_H */ 81 | -------------------------------------------------------------------------------- /3rd/include/libavutil/lzo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LZO 1x decompression 3 | * copyright (c) 2006 Reimar Doeffinger 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_LZO_H 23 | #define AVUTIL_LZO_H 24 | 25 | /** 26 | * @defgroup lavu_lzo LZO 27 | * @ingroup lavu_crypto 28 | * 29 | * @{ 30 | */ 31 | 32 | #include 33 | 34 | /** @name Error flags returned by av_lzo1x_decode 35 | * @{ */ 36 | /// end of the input buffer reached before decoding finished 37 | #define AV_LZO_INPUT_DEPLETED 1 38 | /// decoded data did not fit into output buffer 39 | #define AV_LZO_OUTPUT_FULL 2 40 | /// a reference to previously decoded data was wrong 41 | #define AV_LZO_INVALID_BACKPTR 4 42 | /// a non-specific error in the compressed bitstream 43 | #define AV_LZO_ERROR 8 44 | /** @} */ 45 | 46 | #define AV_LZO_INPUT_PADDING 8 47 | #define AV_LZO_OUTPUT_PADDING 12 48 | 49 | /** 50 | * @brief Decodes LZO 1x compressed data. 51 | * @param out output buffer 52 | * @param outlen size of output buffer, number of bytes left are returned here 53 | * @param in input buffer 54 | * @param inlen size of input buffer, number of bytes left are returned here 55 | * @return 0 on success, otherwise a combination of the error flags above 56 | * 57 | * Make sure all buffers are appropriately padded, in must provide 58 | * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes. 59 | */ 60 | int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen); 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | #endif /* AVUTIL_LZO_H */ 67 | -------------------------------------------------------------------------------- /3rd/include/libavutil/macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * @ingroup lavu 22 | * Utility Preprocessor macros 23 | */ 24 | 25 | #ifndef AVUTIL_MACROS_H 26 | #define AVUTIL_MACROS_H 27 | 28 | /** 29 | * @addtogroup preproc_misc Preprocessor String Macros 30 | * 31 | * String manipulation macros 32 | * 33 | * @{ 34 | */ 35 | 36 | #define AV_STRINGIFY(s) AV_TOSTRING(s) 37 | #define AV_TOSTRING(s) #s 38 | 39 | #define AV_GLUE(a, b) a ## b 40 | #define AV_JOIN(a, b) AV_GLUE(a, b) 41 | 42 | /** 43 | * @} 44 | */ 45 | 46 | #define AV_PRAGMA(s) _Pragma(#s) 47 | 48 | #define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1)) 49 | 50 | #endif /* AVUTIL_MACROS_H */ 51 | -------------------------------------------------------------------------------- /3rd/include/libavutil/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * @ingroup lavu_md5 24 | * Public header for MD5 hash function implementation. 25 | */ 26 | 27 | #ifndef AVUTIL_MD5_H 28 | #define AVUTIL_MD5_H 29 | 30 | #include 31 | #include 32 | 33 | #include "attributes.h" 34 | #include "version.h" 35 | 36 | /** 37 | * @defgroup lavu_md5 MD5 38 | * @ingroup lavu_hash 39 | * MD5 hash function implementation. 40 | * 41 | * @{ 42 | */ 43 | 44 | extern const int av_md5_size; 45 | 46 | struct AVMD5; 47 | 48 | /** 49 | * Allocate an AVMD5 context. 50 | */ 51 | struct AVMD5 *av_md5_alloc(void); 52 | 53 | /** 54 | * Initialize MD5 hashing. 55 | * 56 | * @param ctx pointer to the function context (of size av_md5_size) 57 | */ 58 | void av_md5_init(struct AVMD5 *ctx); 59 | 60 | /** 61 | * Update hash value. 62 | * 63 | * @param ctx hash function context 64 | * @param src input data to update hash with 65 | * @param len input data length 66 | */ 67 | #if FF_API_CRYPTO_SIZE_T 68 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); 69 | #else 70 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, size_t len); 71 | #endif 72 | 73 | /** 74 | * Finish hashing and output digest value. 75 | * 76 | * @param ctx hash function context 77 | * @param dst buffer where output digest value is stored 78 | */ 79 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); 80 | 81 | /** 82 | * Hash an array of data. 83 | * 84 | * @param dst The output buffer to write the digest into 85 | * @param src The data to hash 86 | * @param len The length of the data, in bytes 87 | */ 88 | #if FF_API_CRYPTO_SIZE_T 89 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); 90 | #else 91 | void av_md5_sum(uint8_t *dst, const uint8_t *src, size_t len); 92 | #endif 93 | 94 | /** 95 | * @} 96 | */ 97 | 98 | #endif /* AVUTIL_MD5_H */ 99 | -------------------------------------------------------------------------------- /3rd/include/libavutil/motion_vector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_MOTION_VECTOR_H 20 | #define AVUTIL_MOTION_VECTOR_H 21 | 22 | #include 23 | 24 | typedef struct AVMotionVector { 25 | /** 26 | * Where the current macroblock comes from; negative value when it comes 27 | * from the past, positive value when it comes from the future. 28 | * XXX: set exact relative ref frame reference instead of a +/- 1 "direction". 29 | */ 30 | int32_t source; 31 | /** 32 | * Width and height of the block. 33 | */ 34 | uint8_t w, h; 35 | /** 36 | * Absolute source position. Can be outside the frame area. 37 | */ 38 | int16_t src_x, src_y; 39 | /** 40 | * Absolute destination position. Can be outside the frame area. 41 | */ 42 | int16_t dst_x, dst_y; 43 | /** 44 | * Extra flag information. 45 | * Currently unused. 46 | */ 47 | uint64_t flags; 48 | /** 49 | * Motion vector 50 | * src_x = dst_x + motion_x / motion_scale 51 | * src_y = dst_y + motion_y / motion_scale 52 | */ 53 | int32_t motion_x, motion_y; 54 | uint16_t motion_scale; 55 | } AVMotionVector; 56 | 57 | #endif /* AVUTIL_MOTION_VECTOR_H */ 58 | -------------------------------------------------------------------------------- /3rd/include/libavutil/pixelutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_PIXELUTILS_H 20 | #define AVUTIL_PIXELUTILS_H 21 | 22 | #include 23 | #include 24 | #include "common.h" 25 | 26 | /** 27 | * Sum of abs(src1[x] - src2[x]) 28 | */ 29 | typedef int (*av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1, 30 | const uint8_t *src2, ptrdiff_t stride2); 31 | 32 | /** 33 | * Get a potentially optimized pointer to a Sum-of-absolute-differences 34 | * function (see the av_pixelutils_sad_fn prototype). 35 | * 36 | * @param w_bits 1< 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_RANDOM_SEED_H 22 | #define AVUTIL_RANDOM_SEED_H 23 | 24 | #include 25 | /** 26 | * @addtogroup lavu_crypto 27 | * @{ 28 | */ 29 | 30 | /** 31 | * Get a seed to use in conjunction with random functions. 32 | * This function tries to provide a good seed at a best effort bases. 33 | * Its possible to call this function multiple times if more bits are needed. 34 | * It can be quite slow, which is why it should only be used as seed for a faster 35 | * PRNG. The quality of the seed depends on the platform. 36 | */ 37 | uint32_t av_get_random_seed(void); 38 | 39 | /** 40 | * @} 41 | */ 42 | 43 | #endif /* AVUTIL_RANDOM_SEED_H */ 44 | -------------------------------------------------------------------------------- /3rd/include/libavutil/rc4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RC4 encryption/decryption/pseudo-random number generator 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_RC4_H 22 | #define AVUTIL_RC4_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_rc4 RC4 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | typedef struct AVRC4 { 33 | uint8_t state[256]; 34 | int x, y; 35 | } AVRC4; 36 | 37 | /** 38 | * Allocate an AVRC4 context. 39 | */ 40 | AVRC4 *av_rc4_alloc(void); 41 | 42 | /** 43 | * @brief Initializes an AVRC4 context. 44 | * 45 | * @param key_bits must be a multiple of 8 46 | * @param decrypt 0 for encryption, 1 for decryption, currently has no effect 47 | * @return zero on success, negative value otherwise 48 | */ 49 | int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt); 50 | 51 | /** 52 | * @brief Encrypts / decrypts using the RC4 algorithm. 53 | * 54 | * @param count number of bytes 55 | * @param dst destination array, can be equal to src 56 | * @param src source array, can be equal to dst, may be NULL 57 | * @param iv not (yet) used for RC4, should be NULL 58 | * @param decrypt 0 for encryption, 1 for decryption, not (yet) used 59 | */ 60 | void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | #endif /* AVUTIL_RC4_H */ 67 | -------------------------------------------------------------------------------- /3rd/include/libavutil/replaygain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_REPLAYGAIN_H 20 | #define AVUTIL_REPLAYGAIN_H 21 | 22 | #include 23 | 24 | /** 25 | * ReplayGain information (see 26 | * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification). 27 | * The size of this struct is a part of the public ABI. 28 | */ 29 | typedef struct AVReplayGain { 30 | /** 31 | * Track replay gain in microbels (divide by 100000 to get the value in dB). 32 | * Should be set to INT32_MIN when unknown. 33 | */ 34 | int32_t track_gain; 35 | /** 36 | * Peak track amplitude, with 100000 representing full scale (but values 37 | * may overflow). 0 when unknown. 38 | */ 39 | uint32_t track_peak; 40 | /** 41 | * Same as track_gain, but for the whole album. 42 | */ 43 | int32_t album_gain; 44 | /** 45 | * Same as track_peak, but for the whole album, 46 | */ 47 | uint32_t album_peak; 48 | } AVReplayGain; 49 | 50 | #endif /* AVUTIL_REPLAYGAIN_H */ 51 | -------------------------------------------------------------------------------- /3rd/include/libavutil/ripemd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * Copyright (C) 2013 James Almer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | /** 23 | * @file 24 | * @ingroup lavu_ripemd 25 | * Public header for RIPEMD hash function implementation. 26 | */ 27 | 28 | #ifndef AVUTIL_RIPEMD_H 29 | #define AVUTIL_RIPEMD_H 30 | 31 | #include 32 | 33 | #include "attributes.h" 34 | #include "version.h" 35 | 36 | /** 37 | * @defgroup lavu_ripemd RIPEMD 38 | * @ingroup lavu_hash 39 | * RIPEMD hash function implementation. 40 | * 41 | * @{ 42 | */ 43 | 44 | extern const int av_ripemd_size; 45 | 46 | struct AVRIPEMD; 47 | 48 | /** 49 | * Allocate an AVRIPEMD context. 50 | */ 51 | struct AVRIPEMD *av_ripemd_alloc(void); 52 | 53 | /** 54 | * Initialize RIPEMD hashing. 55 | * 56 | * @param context pointer to the function context (of size av_ripemd_size) 57 | * @param bits number of bits in digest (128, 160, 256 or 320 bits) 58 | * @return zero if initialization succeeded, -1 otherwise 59 | */ 60 | int av_ripemd_init(struct AVRIPEMD* context, int bits); 61 | 62 | /** 63 | * Update hash value. 64 | * 65 | * @param context hash function context 66 | * @param data input data to update hash with 67 | * @param len input data length 68 | */ 69 | #if FF_API_CRYPTO_SIZE_T 70 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); 71 | #else 72 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len); 73 | #endif 74 | 75 | /** 76 | * Finish hashing and output digest value. 77 | * 78 | * @param context hash function context 79 | * @param digest buffer where output digest value is stored 80 | */ 81 | void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest); 82 | 83 | /** 84 | * @} 85 | */ 86 | 87 | #endif /* AVUTIL_RIPEMD_H */ 88 | -------------------------------------------------------------------------------- /3rd/include/libavutil/sha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * @ingroup lavu_sha 24 | * Public header for SHA-1 & SHA-256 hash function implementations. 25 | */ 26 | 27 | #ifndef AVUTIL_SHA_H 28 | #define AVUTIL_SHA_H 29 | 30 | #include 31 | #include 32 | 33 | #include "attributes.h" 34 | #include "version.h" 35 | 36 | /** 37 | * @defgroup lavu_sha SHA 38 | * @ingroup lavu_hash 39 | * SHA-1 and SHA-256 (Secure Hash Algorithm) hash function implementations. 40 | * 41 | * This module supports the following SHA hash functions: 42 | * 43 | * - SHA-1: 160 bits 44 | * - SHA-224: 224 bits, as a variant of SHA-2 45 | * - SHA-256: 256 bits, as a variant of SHA-2 46 | * 47 | * @see For SHA-384, SHA-512, and variants thereof, see @ref lavu_sha512. 48 | * 49 | * @{ 50 | */ 51 | 52 | extern const int av_sha_size; 53 | 54 | struct AVSHA; 55 | 56 | /** 57 | * Allocate an AVSHA context. 58 | */ 59 | struct AVSHA *av_sha_alloc(void); 60 | 61 | /** 62 | * Initialize SHA-1 or SHA-2 hashing. 63 | * 64 | * @param context pointer to the function context (of size av_sha_size) 65 | * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits) 66 | * @return zero if initialization succeeded, -1 otherwise 67 | */ 68 | int av_sha_init(struct AVSHA* context, int bits); 69 | 70 | /** 71 | * Update hash value. 72 | * 73 | * @param ctx hash function context 74 | * @param data input data to update hash with 75 | * @param len input data length 76 | */ 77 | #if FF_API_CRYPTO_SIZE_T 78 | void av_sha_update(struct AVSHA *ctx, const uint8_t *data, unsigned int len); 79 | #else 80 | void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len); 81 | #endif 82 | 83 | /** 84 | * Finish hashing and output digest value. 85 | * 86 | * @param context hash function context 87 | * @param digest buffer where output digest value is stored 88 | */ 89 | void av_sha_final(struct AVSHA* context, uint8_t *digest); 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | #endif /* AVUTIL_SHA_H */ 96 | -------------------------------------------------------------------------------- /3rd/include/libavutil/sha512.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * Copyright (C) 2013 James Almer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | /** 23 | * @file 24 | * @ingroup lavu_sha512 25 | * Public header for SHA-512 implementation. 26 | */ 27 | 28 | #ifndef AVUTIL_SHA512_H 29 | #define AVUTIL_SHA512_H 30 | 31 | #include 32 | #include 33 | 34 | #include "attributes.h" 35 | #include "version.h" 36 | 37 | /** 38 | * @defgroup lavu_sha512 SHA-512 39 | * @ingroup lavu_hash 40 | * SHA-512 (Secure Hash Algorithm) hash function implementations. 41 | * 42 | * This module supports the following SHA-2 hash functions: 43 | * 44 | * - SHA-512/224: 224 bits 45 | * - SHA-512/256: 256 bits 46 | * - SHA-384: 384 bits 47 | * - SHA-512: 512 bits 48 | * 49 | * @see For SHA-1, SHA-256, and variants thereof, see @ref lavu_sha. 50 | * 51 | * @{ 52 | */ 53 | 54 | extern const int av_sha512_size; 55 | 56 | struct AVSHA512; 57 | 58 | /** 59 | * Allocate an AVSHA512 context. 60 | */ 61 | struct AVSHA512 *av_sha512_alloc(void); 62 | 63 | /** 64 | * Initialize SHA-2 512 hashing. 65 | * 66 | * @param context pointer to the function context (of size av_sha512_size) 67 | * @param bits number of bits in digest (224, 256, 384 or 512 bits) 68 | * @return zero if initialization succeeded, -1 otherwise 69 | */ 70 | int av_sha512_init(struct AVSHA512* context, int bits); 71 | 72 | /** 73 | * Update hash value. 74 | * 75 | * @param context hash function context 76 | * @param data input data to update hash with 77 | * @param len input data length 78 | */ 79 | #if FF_API_CRYPTO_SIZE_T 80 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len); 81 | #else 82 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, size_t len); 83 | #endif 84 | 85 | /** 86 | * Finish hashing and output digest value. 87 | * 88 | * @param context hash function context 89 | * @param digest buffer where output digest value is stored 90 | */ 91 | void av_sha512_final(struct AVSHA512* context, uint8_t *digest); 92 | 93 | /** 94 | * @} 95 | */ 96 | 97 | #endif /* AVUTIL_SHA512_H */ 98 | -------------------------------------------------------------------------------- /3rd/include/libavutil/tea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A 32-bit implementation of the TEA algorithm 3 | * Copyright (c) 2015 Vesselin Bontchev 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_TEA_H 23 | #define AVUTIL_TEA_H 24 | 25 | #include 26 | 27 | /** 28 | * @file 29 | * @brief Public header for libavutil TEA algorithm 30 | * @defgroup lavu_tea TEA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_tea_size; 36 | 37 | struct AVTEA; 38 | 39 | /** 40 | * Allocate an AVTEA context 41 | * To free the struct: av_free(ptr) 42 | */ 43 | struct AVTEA *av_tea_alloc(void); 44 | 45 | /** 46 | * Initialize an AVTEA context. 47 | * 48 | * @param ctx an AVTEA context 49 | * @param key a key of 16 bytes used for encryption/decryption 50 | * @param rounds the number of rounds in TEA (64 is the "standard") 51 | */ 52 | void av_tea_init(struct AVTEA *ctx, const uint8_t key[16], int rounds); 53 | 54 | /** 55 | * Encrypt or decrypt a buffer using a previously initialized context. 56 | * 57 | * @param ctx an AVTEA context 58 | * @param dst destination array, can be equal to src 59 | * @param src source array, can be equal to dst 60 | * @param count number of 8 byte blocks 61 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 62 | * @param decrypt 0 for encryption, 1 for decryption 63 | */ 64 | void av_tea_crypt(struct AVTEA *ctx, uint8_t *dst, const uint8_t *src, 65 | int count, uint8_t *iv, int decrypt); 66 | 67 | /** 68 | * @} 69 | */ 70 | 71 | #endif /* AVUTIL_TEA_H */ 72 | -------------------------------------------------------------------------------- /3rd/include/libavutil/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000-2003 Fabrice Bellard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_TIME_H 22 | #define AVUTIL_TIME_H 23 | 24 | #include 25 | 26 | /** 27 | * Get the current time in microseconds. 28 | */ 29 | int64_t av_gettime(void); 30 | 31 | /** 32 | * Get the current time in microseconds since some unspecified starting point. 33 | * On platforms that support it, the time comes from a monotonic clock 34 | * This property makes this time source ideal for measuring relative time. 35 | * The returned values may not be monotonic on platforms where a monotonic 36 | * clock is not available. 37 | */ 38 | int64_t av_gettime_relative(void); 39 | 40 | /** 41 | * Indicates with a boolean result if the av_gettime_relative() time source 42 | * is monotonic. 43 | */ 44 | int av_gettime_relative_is_monotonic(void); 45 | 46 | /** 47 | * Sleep for a period of time. Although the duration is expressed in 48 | * microseconds, the actual delay may be rounded to the precision of the 49 | * system timer. 50 | * 51 | * @param usec Number of microseconds to sleep. 52 | * @return zero on success or (negative) error code. 53 | */ 54 | int av_usleep(unsigned usec); 55 | 56 | #endif /* AVUTIL_TIME_H */ 57 | -------------------------------------------------------------------------------- /3rd/include/libavutil/timestamp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * timestamp utils, mostly useful for debugging/logging purposes 22 | */ 23 | 24 | #ifndef AVUTIL_TIMESTAMP_H 25 | #define AVUTIL_TIMESTAMP_H 26 | 27 | #include "common.h" 28 | 29 | #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64) 30 | #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS 31 | #endif 32 | 33 | #define AV_TS_MAX_STRING_SIZE 32 34 | 35 | /** 36 | * Fill the provided buffer with a string containing a timestamp 37 | * representation. 38 | * 39 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE 40 | * @param ts the timestamp to represent 41 | * @return the buffer in input 42 | */ 43 | static inline char *av_ts_make_string(char *buf, int64_t ts) 44 | { 45 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); 46 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%" PRId64, ts); 47 | return buf; 48 | } 49 | 50 | /** 51 | * Convenience macro, the return value should be used only directly in 52 | * function arguments but never stand-alone. 53 | */ 54 | #define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts) 55 | 56 | /** 57 | * Fill the provided buffer with a string containing a timestamp time 58 | * representation. 59 | * 60 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE 61 | * @param ts the timestamp to represent 62 | * @param tb the timebase of the timestamp 63 | * @return the buffer in input 64 | */ 65 | static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb) 66 | { 67 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); 68 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts); 69 | return buf; 70 | } 71 | 72 | /** 73 | * Convenience macro, the return value should be used only directly in 74 | * function arguments but never stand-alone. 75 | */ 76 | #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb) 77 | 78 | #endif /* AVUTIL_TIMESTAMP_H */ 79 | -------------------------------------------------------------------------------- /3rd/include/libavutil/twofish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * An implementation of the TwoFish algorithm 3 | * Copyright (c) 2015 Supraja Meedinti 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_TWOFISH_H 23 | #define AVUTIL_TWOFISH_H 24 | 25 | #include 26 | 27 | 28 | /** 29 | * @file 30 | * @brief Public header for libavutil TWOFISH algorithm 31 | * @defgroup lavu_twofish TWOFISH 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_twofish_size; 37 | 38 | struct AVTWOFISH; 39 | 40 | /** 41 | * Allocate an AVTWOFISH context 42 | * To free the struct: av_free(ptr) 43 | */ 44 | struct AVTWOFISH *av_twofish_alloc(void); 45 | 46 | /** 47 | * Initialize an AVTWOFISH context. 48 | * 49 | * @param ctx an AVTWOFISH context 50 | * @param key a key of size ranging from 1 to 32 bytes used for encryption/decryption 51 | * @param key_bits number of keybits: 128, 192, 256 If less than the required, padded with zeroes to nearest valid value; return value is 0 if key_bits is 128/192/256, -1 if less than 0, 1 otherwise 52 | */ 53 | int av_twofish_init(struct AVTWOFISH *ctx, const uint8_t *key, int key_bits); 54 | 55 | /** 56 | * Encrypt or decrypt a buffer using a previously initialized context 57 | * 58 | * @param ctx an AVTWOFISH context 59 | * @param dst destination array, can be equal to src 60 | * @param src source array, can be equal to dst 61 | * @param count number of 16 byte blocks 62 | * @paran iv initialization vector for CBC mode, NULL for ECB mode 63 | * @param decrypt 0 for encryption, 1 for decryption 64 | */ 65 | void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); 66 | 67 | /** 68 | * @} 69 | */ 70 | #endif /* AVUTIL_TWOFISH_H */ 71 | -------------------------------------------------------------------------------- /3rd/include/libpostproc/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef POSTPROC_VERSION_H 22 | #define POSTPROC_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libpostproc version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBPOSTPROC_VERSION_MAJOR 55 32 | #define LIBPOSTPROC_VERSION_MINOR 5 33 | #define LIBPOSTPROC_VERSION_MICRO 100 34 | 35 | #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ 36 | LIBPOSTPROC_VERSION_MINOR, \ 37 | LIBPOSTPROC_VERSION_MICRO) 38 | #define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ 39 | LIBPOSTPROC_VERSION_MINOR, \ 40 | LIBPOSTPROC_VERSION_MICRO) 41 | #define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT 42 | 43 | #define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) 44 | 45 | #endif /* POSTPROC_VERSION_H */ 46 | -------------------------------------------------------------------------------- /3rd/include/libswresample/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of libswresample 5 | * 6 | * libswresample is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * libswresample is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with libswresample; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef SWRESAMPLE_VERSION_H 22 | #define SWRESAMPLE_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libswresample version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBSWRESAMPLE_VERSION_MAJOR 3 32 | #define LIBSWRESAMPLE_VERSION_MINOR 5 33 | #define LIBSWRESAMPLE_VERSION_MICRO 100 34 | 35 | #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ 36 | LIBSWRESAMPLE_VERSION_MINOR, \ 37 | LIBSWRESAMPLE_VERSION_MICRO) 38 | #define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \ 39 | LIBSWRESAMPLE_VERSION_MINOR, \ 40 | LIBSWRESAMPLE_VERSION_MICRO) 41 | #define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT 42 | 43 | #define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION) 44 | 45 | #endif /* SWRESAMPLE_VERSION_H */ 46 | -------------------------------------------------------------------------------- /3rd/include/libswscale/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef SWSCALE_VERSION_H 20 | #define SWSCALE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * swscale version macros 25 | */ 26 | 27 | #include "libavutil/version.h" 28 | 29 | #define LIBSWSCALE_VERSION_MAJOR 5 30 | #define LIBSWSCALE_VERSION_MINOR 5 31 | #define LIBSWSCALE_VERSION_MICRO 100 32 | 33 | #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ 34 | LIBSWSCALE_VERSION_MINOR, \ 35 | LIBSWSCALE_VERSION_MICRO) 36 | #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ 37 | LIBSWSCALE_VERSION_MINOR, \ 38 | LIBSWSCALE_VERSION_MICRO) 39 | #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT 40 | 41 | #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) 42 | 43 | /** 44 | * FF_API_* defines may be placed below to indicate public API that will be 45 | * dropped at a future version bump. The defines themselves are not part of 46 | * the public API and may change, break or disappear at any time. 47 | */ 48 | 49 | #ifndef FF_API_SWS_VECTOR 50 | #define FF_API_SWS_VECTOR (LIBSWSCALE_VERSION_MAJOR < 6) 51 | #endif 52 | 53 | #endif /* SWSCALE_VERSION_H */ 54 | -------------------------------------------------------------------------------- /3rd/lib/msvc2015_x64/SDL2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/3rd/lib/msvc2015_x64/SDL2.lib -------------------------------------------------------------------------------- /3rd/lib/msvc2015_x64/avcodec.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/3rd/lib/msvc2015_x64/avcodec.lib -------------------------------------------------------------------------------- /3rd/lib/msvc2015_x64/avdevice.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/3rd/lib/msvc2015_x64/avdevice.lib -------------------------------------------------------------------------------- /3rd/lib/msvc2015_x64/avfilter.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/3rd/lib/msvc2015_x64/avfilter.lib -------------------------------------------------------------------------------- /3rd/lib/msvc2015_x64/avformat.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/3rd/lib/msvc2015_x64/avformat.lib -------------------------------------------------------------------------------- /3rd/lib/msvc2015_x64/avutil.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/3rd/lib/msvc2015_x64/avutil.lib -------------------------------------------------------------------------------- /3rd/lib/msvc2015_x64/postproc.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/3rd/lib/msvc2015_x64/postproc.lib -------------------------------------------------------------------------------- /3rd/lib/msvc2015_x64/swresample.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/3rd/lib/msvc2015_x64/swresample.lib -------------------------------------------------------------------------------- /3rd/lib/msvc2015_x64/swscale.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/3rd/lib/msvc2015_x64/swscale.lib -------------------------------------------------------------------------------- /BUILD.md: -------------------------------------------------------------------------------- 1 | # submodule 2 | 3 | ``` 4 | git clone https://github.com/ithewei/hplayer.git 5 | cd hplayer 6 | git submodule update --init 7 | ``` 8 | 9 | # Dependents 10 | - msvc2015: 11 | - Qt5.9.0: 12 | - FFmpeg4.2.2: 13 | - SDL2.0.12: 14 | 15 | # CLI 16 | 17 | - qmake 18 | - make / nmake / mingw32-make 19 | 20 | # IDE 21 | 22 | ## Qt Creator 23 | 24 | - hplayer.pro 25 | 26 | ## Qt VS Tools 27 | 28 | - hplayer.sln 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 多画面播放器 2 | 3 | ## 需求分析 4 | 5 | - 做一个类似VLC的播放器,能播放文件源、网络源、设备捕获源; 6 | - 界面要求多画面监控网格,可自由切换多画面风格,支持拖拽与合并; 7 | 8 | ## 概要设计 9 | 10 | - 使用Qt实现界面; 11 | - 使用FFmpeg拉流,编解码,转码; 12 | - 使用OpenCV处理图片; 13 | - 使用OpenGL渲染视频帧; 14 | 15 | ## 详细设计 16 | 17 | **界面设计** 18 | 19 | ![](hplayer.png) 20 | 21 | **多画面效果图** 22 | 23 | ![](hplayer4.png) 24 | 25 | ![](hplayer25.png) 26 | 27 | ## 后期计划 28 | 29 | - 添加显示器捕获源; 30 | - 添加图片、文字、时间叠加功能; 31 | - 添加多画面合成功能; 32 | - 添加推流、录制功能; 33 | - 添加人脸检测与识别功能; 34 | - 添加美颜功能; 35 | 36 | ## Submodule 37 | ``` 38 | git clone --recurse-submodules https://github.com/ithewei/hplayer.git 39 | ``` 40 | or 41 | ``` 42 | git clone https://github.com/ithewei/hplayer.git 43 | git submodule update --init 44 | ``` 45 | 46 | ## Mirror 47 | ``` 48 | https://gitee.com/ithewei/hplayer.git 49 | ``` 50 | 51 | ## Build 52 | 53 | see BUILD.md 54 | 55 | ## 项目博客 56 | 57 | https://hewei.blog.csdn.net/article/category/9275796 58 | -------------------------------------------------------------------------------- /bin/msvc2015_x64/Qt5Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/Qt5Core.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/Qt5Gui.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/Qt5Gui.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/Qt5Widgets.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/Qt5Widgets.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/SDL2.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/avcodec-58.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/avcodec-58.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/avdevice-58.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/avdevice-58.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/avfilter-7.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/avfilter-7.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/avformat-58.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/avformat-58.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/avutil-56.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/avutil-56.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/conf/hplayer.conf.default: -------------------------------------------------------------------------------- 1 | # [root] 2 | 3 | logfile = logs/hplayer.log 4 | # loglevel = [VERBOSE,DEBUG,INFO,WARN,ERROR,FATAL,SILENT] 5 | loglevel = INFO 6 | log_remain_days = 3 7 | log_filesize = 16M 8 | 9 | [ui] 10 | skin = dark 11 | # 0xAARRGGBB 12 | palette = 0xFF132D48 13 | # language = [en, zh_CN, ...] 14 | language = 15 | fontsize = 12 16 | 17 | main_window_width = 1280 18 | main_window_height = 800 19 | # [NORMAL=0, MINIMIZED=1, MAXMIZED=2, FULLSCREEN=3] 20 | main_window_state = 2 21 | # rect(x,y,w,h) 22 | main_window_rect = rect(0,0,0,0) 23 | 24 | menubar_visible = true 25 | toolbar_visible = true 26 | statusbar_visible = true 27 | lside_visible = false 28 | rside_visible = false 29 | 30 | mv_row = 3 31 | mv_col = 3 32 | mv_fullscreen = false 33 | 34 | draw_time = false 35 | draw_fps = false 36 | draw_resolution = false 37 | 38 | [video] 39 | frame_cache = 5 40 | # fps = 25 41 | 42 | # aspect_ratio = [x%, w:h, x:y, wxh] 43 | # aspect_ratio = 100% # FULL 44 | # aspect_ratio = 50% # PERCENT 45 | # aspect_ratio = w:h # ORIGINAL_RATIO 46 | # aspect_ratio = 4:3 # CUSTOM_RATIO 47 | # aspect_ratio = wxh # ORIGINAL_SIZE 48 | # aspect_ratio = 800x600 # CUSTOM_SIZE 49 | 50 | # renderer = [opengl, sdl, ...] 51 | renderer = opengl 52 | 53 | # SOFTWARE_DECODE = 1, 54 | # HARDWARE_DECODE_QSV = 2, 55 | # HARDWARE_DECODE_CUVID = 3, 56 | decode_mode = 3 57 | 58 | # pix_fmt = [YUV, RGB] 59 | dst_pix_fmt = YUV 60 | 61 | # rtsp_transport = [tcp, udp] 62 | rtsp_transport = tcp 63 | 64 | # for network source retry 65 | retry_interval = 10000 # ms 66 | retry_maxcnt = -1 # -1 means INFINITE 67 | 68 | # for file source loop playback 69 | loop_playback = false 70 | 71 | [media] 72 | # 0:file 1:network 2:capture 73 | last_tab = 0 74 | last_file_source = 75 | last_network_source = 76 | -------------------------------------------------------------------------------- /bin/msvc2015_x64/ffplay.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/ffplay.exe -------------------------------------------------------------------------------- /bin/msvc2015_x64/hplayer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/hplayer.exe -------------------------------------------------------------------------------- /bin/msvc2015_x64/platforms/qwindows.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/platforms/qwindows.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/postproc-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/postproc-55.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/swresample-3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/swresample-3.dll -------------------------------------------------------------------------------- /bin/msvc2015_x64/swscale-5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/bin/msvc2015_x64/swscale-5.dll -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/favicon.ico -------------------------------------------------------------------------------- /hplayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/hplayer.png -------------------------------------------------------------------------------- /hplayer.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | IDI_ICON1 ICON DISCARDABLE ".\\favicon.ico" 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION 0,0,0,0 7 | PRODUCTVERSION 0,0,0,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS VS_FF_DEBUG 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS VOS__WINDOWS32 15 | FILETYPE VFT_DLL 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "040904b0" 21 | BEGIN 22 | VALUE "CompanyName", "\0" 23 | VALUE "FileDescription", "\0" 24 | VALUE "FileVersion", "0.0.0.0\0" 25 | VALUE "LegalCopyright", "\0" 26 | VALUE "OriginalFilename", "hplayer.exe\0" 27 | VALUE "ProductName", "hplayer\0" 28 | VALUE "ProductVersion", "0.0.0.0\0" 29 | END 30 | END 31 | BLOCK "VarFileInfo" 32 | BEGIN 33 | VALUE "Translation", 0x0409, 1200 34 | END 35 | END 36 | /* End of Version info */ 37 | 38 | -------------------------------------------------------------------------------- /hplayer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hplayer", "hplayer.vcxproj", "{8CFCC16B-B228-35DD-B5D2-C4DDEFB765F5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {8CFCC16B-B228-35DD-B5D2-C4DDEFB765F5}.Debug|x64.ActiveCfg = Debug|x64 15 | {8CFCC16B-B228-35DD-B5D2-C4DDEFB765F5}.Debug|x64.Build.0 = Debug|x64 16 | {8CFCC16B-B228-35DD-B5D2-C4DDEFB765F5}.Release|x64.ActiveCfg = Release|x64 17 | {8CFCC16B-B228-35DD-B5D2-C4DDEFB765F5}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /hplayer25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/hplayer25.png -------------------------------------------------------------------------------- /hplayer4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/hplayer4.png -------------------------------------------------------------------------------- /rc/image.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/add.png 4 | image/pause.png 5 | image/start.png 6 | image/stop.png 7 | image/style1.png 8 | image/style2.png 9 | image/style4.png 10 | image/style9.png 11 | image/style16.png 12 | image/style25.png 13 | image/style36.png 14 | image/style49.png 15 | image/style64.png 16 | image/media_bk.png 17 | image/next.png 18 | image/prev.png 19 | image/capture.png 20 | image/clear.png 21 | image/disk.png 22 | image/file.png 23 | image/fullscreen.png 24 | image/icon.png 25 | image/media.png 26 | image/mute.png 27 | image/network.png 28 | image/sub.png 29 | image/timeshow.png 30 | image/voice.png 31 | image/close.png 32 | 33 | 34 | -------------------------------------------------------------------------------- /rc/image/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/add.png -------------------------------------------------------------------------------- /rc/image/capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/capture.png -------------------------------------------------------------------------------- /rc/image/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/clear.png -------------------------------------------------------------------------------- /rc/image/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/close.png -------------------------------------------------------------------------------- /rc/image/disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/disk.png -------------------------------------------------------------------------------- /rc/image/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/file.png -------------------------------------------------------------------------------- /rc/image/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/fullscreen.png -------------------------------------------------------------------------------- /rc/image/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/icon.png -------------------------------------------------------------------------------- /rc/image/media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/media.png -------------------------------------------------------------------------------- /rc/image/media_bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/media_bk.png -------------------------------------------------------------------------------- /rc/image/mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/mute.png -------------------------------------------------------------------------------- /rc/image/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/network.png -------------------------------------------------------------------------------- /rc/image/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/next.png -------------------------------------------------------------------------------- /rc/image/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/pause.png -------------------------------------------------------------------------------- /rc/image/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/prev.png -------------------------------------------------------------------------------- /rc/image/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/start.png -------------------------------------------------------------------------------- /rc/image/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/stop.png -------------------------------------------------------------------------------- /rc/image/style1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/style1.png -------------------------------------------------------------------------------- /rc/image/style16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/style16.png -------------------------------------------------------------------------------- /rc/image/style2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/style2.png -------------------------------------------------------------------------------- /rc/image/style25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/style25.png -------------------------------------------------------------------------------- /rc/image/style36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/style36.png -------------------------------------------------------------------------------- /rc/image/style4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/style4.png -------------------------------------------------------------------------------- /rc/image/style49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/style49.png -------------------------------------------------------------------------------- /rc/image/style64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/style64.png -------------------------------------------------------------------------------- /rc/image/style9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/style9.png -------------------------------------------------------------------------------- /rc/image/sub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/sub.png -------------------------------------------------------------------------------- /rc/image/timeshow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/timeshow.png -------------------------------------------------------------------------------- /rc/image/voice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/image/voice.png -------------------------------------------------------------------------------- /rc/lang/app_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/lang/app_zh_CN.qm -------------------------------------------------------------------------------- /rc/lang/qt_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/lang/qt_zh_CN.qm -------------------------------------------------------------------------------- /rc/skin.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | skin/dark.qss 5 | skin/dark/add_bottom.png 6 | skin/dark/add_left.png 7 | skin/dark/add_right.png 8 | skin/dark/add_top.png 9 | skin/dark/branch_close.png 10 | skin/dark/branch_open.png 11 | skin/dark/calendar_nextmonth.png 12 | skin/dark/calendar_prevmonth.png 13 | skin/dark/checkbox_checked.png 14 | skin/dark/checkbox_checked_disable.png 15 | skin/dark/checkbox_parcial.png 16 | skin/dark/checkbox_parcial_disable.png 17 | skin/dark/checkbox_unchecked.png 18 | skin/dark/checkbox_unchecked_disable.png 19 | skin/dark/radiobutton_checked.png 20 | skin/dark/radiobutton_checked_disable.png 21 | skin/dark/radiobutton_unchecked.png 22 | skin/dark/radiobutton_unchecked_disable.png 23 | lang/app_zh_CN.qm 24 | lang/qt_zh_CN.qm 25 | 26 | 27 | -------------------------------------------------------------------------------- /rc/skin/dark/add_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/add_bottom.png -------------------------------------------------------------------------------- /rc/skin/dark/add_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/add_left.png -------------------------------------------------------------------------------- /rc/skin/dark/add_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/add_right.png -------------------------------------------------------------------------------- /rc/skin/dark/add_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/add_top.png -------------------------------------------------------------------------------- /rc/skin/dark/branch_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/branch_close.png -------------------------------------------------------------------------------- /rc/skin/dark/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/branch_open.png -------------------------------------------------------------------------------- /rc/skin/dark/calendar_nextmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/calendar_nextmonth.png -------------------------------------------------------------------------------- /rc/skin/dark/calendar_prevmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/calendar_prevmonth.png -------------------------------------------------------------------------------- /rc/skin/dark/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/checkbox_checked.png -------------------------------------------------------------------------------- /rc/skin/dark/checkbox_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/checkbox_checked_disable.png -------------------------------------------------------------------------------- /rc/skin/dark/checkbox_parcial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/checkbox_parcial.png -------------------------------------------------------------------------------- /rc/skin/dark/checkbox_parcial_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/checkbox_parcial_disable.png -------------------------------------------------------------------------------- /rc/skin/dark/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/checkbox_unchecked.png -------------------------------------------------------------------------------- /rc/skin/dark/checkbox_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/checkbox_unchecked_disable.png -------------------------------------------------------------------------------- /rc/skin/dark/radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/radiobutton_checked.png -------------------------------------------------------------------------------- /rc/skin/dark/radiobutton_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/radiobutton_checked_disable.png -------------------------------------------------------------------------------- /rc/skin/dark/radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/radiobutton_unchecked.png -------------------------------------------------------------------------------- /rc/skin/dark/radiobutton_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ithewei/hplayer/52a5a36af6aab1e00e6f615e22b3f705086c4f8b/rc/skin/dark/radiobutton_unchecked_disable.png -------------------------------------------------------------------------------- /src/appdef.h: -------------------------------------------------------------------------------- 1 | #ifndef APPDEF_H 2 | #define APPDEF_H 3 | 4 | #define APP_NAME "hplayer" 5 | #define APP_VERSION "1.20.7" 6 | 7 | #define COMPANY_NAME "" 8 | #define COMPANY_WEBSITE "" 9 | 10 | #define AUTHOR "ithewei" 11 | #define PERSON_EMAIL "ithewei@163.com" 12 | #define PERSON_WEBSITE "https://github.com/ithewei" 13 | 14 | #endif // APPDEF_H 15 | -------------------------------------------------------------------------------- /src/avdef.h: -------------------------------------------------------------------------------- 1 | #ifndef AV_DEF_H 2 | #define AV_DEF_H 3 | 4 | typedef enum { 5 | PIX_FMT_NONE = 0, 6 | 7 | PIX_FMT_GRAY, // YYYYYYYY 8 | 9 | PIX_FMT_YUV_FIRST = 100, 10 | PIX_FMT_YUV_PLANAR_FIRST = 200, 11 | PIX_FMT_IYUV, // YYYYYYYYUUVV 12 | PIX_FMT_YV12, // YYYYVVYYVVUU 13 | PIX_FMT_NV12, // YYUVYYYYUVUV 14 | PIX_FMT_NV21, // YYVUYYYYVUVU 15 | PIX_FMT_YUV_PLANAR_LAST, 16 | PIX_FMT_YUV_PACKED_FIRST = 300, 17 | PIX_FMT_YUY2, // YUYVYUYV 18 | PIX_FMT_YVYU, // YVYUYVYU 19 | PIX_FMT_UYVY, // UYVYUYVY 20 | PIX_FMT_YUV_PACKED_LAST, 21 | PIX_FMT_YUV_LAST, 22 | 23 | PIX_FMT_RGB_FIRST = 400, 24 | PIX_FMT_RGB, // RGBRGB 25 | PIX_FMT_BGR, // BGRBGR 26 | PIX_FMT_RGBA, // RGBARGBA 27 | PIX_FMT_BGRA, // BGRABGRA 28 | PIX_FMT_ARGB, // ARGBARGB 29 | PIX_FMT_ABGR, // ABGRABGR 30 | PIX_FMT_RGB_LAST, 31 | } pix_fmt_e; 32 | 33 | static inline bool pix_fmt_is_yuv(int type) { 34 | return type > PIX_FMT_YUV_FIRST && type < PIX_FMT_YUV_LAST; 35 | } 36 | 37 | static inline bool pix_fmt_is_planar_yuv(int type) { 38 | return type > PIX_FMT_YUV_PLANAR_FIRST && type < PIX_FMT_YUV_PLANAR_LAST; 39 | } 40 | 41 | static inline bool pix_fmt_is_packet_yuv(int type) { 42 | return type > PIX_FMT_YUV_PACKED_FIRST && type < PIX_FMT_YUV_PACKED_LAST; 43 | } 44 | 45 | static inline bool pix_fmt_is_rgb(int type) { 46 | return type > PIX_FMT_RGB_FIRST && type < PIX_FMT_RGB_LAST; 47 | } 48 | 49 | static inline int pix_fmt_bpp(int type) { 50 | if (pix_fmt_is_yuv(type)) { 51 | return 12; 52 | } 53 | switch(type) { 54 | case PIX_FMT_RGB: 55 | case PIX_FMT_BGR: 56 | return 24; 57 | case PIX_FMT_RGBA: 58 | case PIX_FMT_BGRA: 59 | case PIX_FMT_ARGB: 60 | case PIX_FMT_ABGR: 61 | return 32; 62 | case PIX_FMT_GRAY: 63 | return 8; 64 | } 65 | return 0; 66 | } 67 | 68 | typedef enum { 69 | MEDIA_TYPE_FILE = 0, 70 | MEDIA_TYPE_NETWORK, 71 | MEDIA_TYPE_CAPTURE, 72 | MEDIA_TYPE_NB 73 | } media_type_e; 74 | #define DEFAULT_MEDIA_TYPE MEDIA_TYPE_CAPTURE 75 | #define MEDIA_TYPE_NONE MEDIA_TYPE_NB 76 | 77 | typedef enum { 78 | AVSTREAM_TYPE_VIDEO, 79 | AVSTREAM_TYPE_AUDIO, 80 | AVSTREAM_TYPE_SUBTITLE, 81 | AVSTREAM_TYPE_NB 82 | } avstream_type_e; 83 | 84 | typedef enum { 85 | ASPECT_FULL, // 100% 86 | ASPECT_PERCENT, // 50% 87 | ASPECT_ORIGINAL_RATIO, // w:h 88 | ASPECT_ORIGINAL_SIZE, // wxh 89 | ASPECT_CUSTOM_RATIO, // 4:3 16:9 ... 90 | ASPECT_CUSTOM_SIZE, // 1280x720 640*480 ... 91 | } aspect_ratio_e; 92 | #define DEFAULT_ASPECT_RATIO ASPECT_FULL 93 | 94 | typedef struct aspect_ratio_s { 95 | aspect_ratio_e type; 96 | int w, h; 97 | } aspect_ratio_t; 98 | 99 | #endif // AV_DEF_H 100 | -------------------------------------------------------------------------------- /src/confile.h: -------------------------------------------------------------------------------- 1 | #ifndef HPLAYER_CONFILE_H_ 2 | #define HPLAYER_CONFILE_H_ 3 | 4 | #include "iniparser.h" 5 | 6 | extern IniParser* g_confile; 7 | extern char g_exec_path[256]; 8 | extern char g_exec_dir[256]; 9 | extern char g_run_dir[256]; 10 | 11 | extern char g_conf_file[256]; 12 | extern char g_log_file[256]; 13 | 14 | #endif // HPLAYER_CONFILE_H_ 15 | -------------------------------------------------------------------------------- /src/qt/HGLWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef H_GL_WIDGET_H 2 | #define H_GL_WIDGET_H 3 | 4 | #include "hgl.h" 5 | #include "hframe.h" 6 | #include "hgui.h" 7 | #include 8 | #include 9 | 10 | void bindTexture(GLTexture* tex, QImage* img); 11 | 12 | class HGLWidget : public QOpenGLWidget 13 | { 14 | public: 15 | HGLWidget(QWidget* parent = NULL); 16 | 17 | // ratio = 0 means spread 18 | void setAspectRatio(double ratio); 19 | 20 | void drawFrame(HFrame *pFrame); 21 | void drawTexture(HRect rc, GLTexture *tex); 22 | void drawRect(HRect rc, HColor clr, int line_width = 1, bool bFill = false); 23 | void drawText(QPoint lb, const char* text, int fontsize, QColor clr); 24 | 25 | protected: 26 | virtual void initializeGL(); 27 | virtual void resizeGL(int w, int h); 28 | virtual void paintGL(); 29 | 30 | void setVertices(double ratio); 31 | void setVertices(QRect rc); 32 | 33 | static void loadYUVShader(); 34 | void initVAO(); 35 | void initYUV(); 36 | 37 | void drawYUV(HFrame* pFrame); 38 | 39 | protected: 40 | static std::atomic_flag s_glew_init; 41 | static GLuint prog_yuv; 42 | static GLuint texUniformY; 43 | static GLuint texUniformU; 44 | static GLuint texUniformV; 45 | GLuint tex_yuv[3]; 46 | 47 | double aspect_ratio; 48 | GLfloat vertices[8]; 49 | GLfloat textures[8]; 50 | 51 | // NOTE: QPainter used 3 VertexAttribArray 52 | enum VER_ATTR { 53 | VER_ATTR_VER = 3, 54 | VER_ATTR_TEX, 55 | }; 56 | }; 57 | 58 | #endif // H_GL_WIDGET_H 59 | -------------------------------------------------------------------------------- /src/qt/qtheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef QT_HEADERS_H 2 | #define QT_HEADERS_H 3 | 4 | // using glew.h not gl.h 5 | #include "hgl.h" 6 | 7 | #include "hv.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #if _MSC_VER >= 1600 14 | #pragma execution_character_set("utf-8") 15 | #endif 16 | 17 | #define DATE qPrintable(QDate::currentDate().toString("yyyy-MM-dd")) 18 | #define TIME qPrintable(QTime::currentTime().toString("hh:mm:ss")) 19 | #define DATETIME qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")) 20 | 21 | #define TIMEMS qPrintable(QTime::currentTime().toString("hh:mm:ss zzz")) 22 | #define DATETIMENBSP qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss")) 23 | #define DATETIMEMSNBSP qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss-zzz")) 24 | 25 | #define DESKTOP_WIDTH qApp->desktop()->availableGeometry().width() 26 | #define DESKTOP_HEIGHT qApp->desktop()->availableGeometry().height() 27 | 28 | #include "qtfunctions.h" 29 | #include "qtrcloader.h" 30 | //============================================================================ 31 | #endif // QT_HEADERS_H 32 | -------------------------------------------------------------------------------- /src/qt/qtrcloader.cpp: -------------------------------------------------------------------------------- 1 | #include "qtrcloader.h" 2 | 3 | #define IMAGE_PATH "./images/" 4 | 5 | SINGLETON_IMPL(HRcLoader) 6 | 7 | void HRcLoader::loadIcon() { 8 | #define LOAD_ICON(rcid, filename) \ 9 | m_mapIcon[rcid] = QPixmap(QString(IMAGE_PATH) + filename); \ 10 | 11 | FOREACH_ICON(LOAD_ICON) 12 | FOREACH_ICON_MV(LOAD_ICON) 13 | 14 | #undef LOAD_ICON 15 | } 16 | -------------------------------------------------------------------------------- /src/qt/qtrcloader.h: -------------------------------------------------------------------------------- 1 | #ifndef QT_RCLOADER_H 2 | #define QT_RCLOADER_H 3 | 4 | #define FOREACH_ICON(F) \ 5 | F(RC_SUBMIT, "submit.png") \ 6 | F(RC_CLOSE, "close.png") \ 7 | \ 8 | F(RC_START, "start.png") \ 9 | F(RC_PAUSE, "pause.png") \ 10 | F(RC_STOP, "stop.png") \ 11 | \ 12 | F(RC_ADD, "add.png") \ 13 | F(RC_DEL, "del.png") \ 14 | F(RC_TRASH, "trash.png") \ 15 | 16 | #define FOREACH_ICON_MV(F) \ 17 | F(RC_STYLE1, "style1.png") \ 18 | F(RC_STYLE2, "style2.png") \ 19 | F(RC_STYLE4, "style4.png") \ 20 | F(RC_STYLE9, "style9.png") \ 21 | F(RC_STYLE16, "style16.png") \ 22 | F(RC_STYLE25, "style25.png") \ 23 | F(RC_STYLE36, "style36.png") \ 24 | F(RC_STYLE49, "style49.png") \ 25 | F(RC_STYLE64, "style64.png") \ 26 | 27 | #define FOREACH_RC(F) \ 28 | FOREACH_ICON(F) \ 29 | FOREACH_ICON_MV(F) \ 30 | 31 | #define ENUM_RCID(rcid, _) rcid, 32 | 33 | enum RCID { 34 | RC_FIRST = 1, 35 | FOREACH_RC(ENUM_RCID) 36 | RC_LAST 37 | }; 38 | 39 | #include "singleton.h" 40 | #include 41 | #include 42 | class HRcLoader 43 | { 44 | SINGLETON_DECL(HRcLoader) 45 | private: 46 | HRcLoader() {} 47 | 48 | public: 49 | void loadIcon(); 50 | 51 | QPixmap get(RCID rcid) { 52 | return m_mapIcon[rcid]; 53 | } 54 | private: 55 | QMap m_mapIcon; 56 | }; 57 | 58 | #define rcloader HRcLoader::instance() 59 | 60 | #endif // QT_RCLOADER_H 61 | -------------------------------------------------------------------------------- /src/ui/CentralWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "CentralWidget.h" 2 | #include "qtstyles.h" 3 | 4 | CentralWidget::CentralWidget(QWidget *parent) : QWidget(parent) 5 | { 6 | initUI(); 7 | initConnect(); 8 | } 9 | 10 | CentralWidget::~CentralWidget() { 11 | hlogd("~CentralWidget"); 12 | } 13 | 14 | void CentralWidget::initUI() { 15 | lside = new LsideWidget; 16 | mv = new HMultiView; 17 | rside = new RsideWidget; 18 | 19 | QSplitter *split = new QSplitter(Qt::Horizontal); 20 | split->addWidget(lside); 21 | split->addWidget(mv); 22 | split->addWidget(rside); 23 | 24 | lside->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); 25 | lside->setMinimumWidth(LSIDE_MIN_WIDTH); 26 | lside->setMaximumWidth(LSIDE_MAX_WIDTH); 27 | 28 | mv->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); 29 | mv->setMinimumWidth(MV_MIN_WIDTH); 30 | mv->setMinimumHeight(MV_MIN_HEIGHT); 31 | 32 | rside->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); 33 | rside->setMinimumWidth(RSIDE_MIN_WIDTH); 34 | rside->setMaximumWidth(RSIDE_MAX_WIDTH); 35 | 36 | split->setStretchFactor(0, 1); 37 | split->setStretchFactor(1, 1); 38 | split->setStretchFactor(2, 1); 39 | 40 | QHBoxLayout *hbox = genHBoxLayout(); 41 | hbox->addWidget(split); 42 | setLayout(hbox); 43 | } 44 | 45 | void CentralWidget::initConnect() { 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/ui/CentralWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CENTRAL_WIDGET_H 2 | #define CENTRAL_WIDGET_H 3 | 4 | #include "qtheaders.h" 5 | 6 | #include "HMultiView.h" 7 | 8 | #include "LsideWidget.h" 9 | #include "RsideWidget.h" 10 | 11 | class CentralWidget : public QWidget { 12 | Q_OBJECT 13 | public: 14 | explicit CentralWidget(QWidget *parent = nullptr); 15 | ~CentralWidget(); 16 | 17 | signals: 18 | 19 | public slots: 20 | 21 | protected: 22 | void initUI(); 23 | void initConnect(); 24 | 25 | public: 26 | LsideWidget* lside; 27 | HMultiView* mv; 28 | RsideWidget* rside; 29 | }; 30 | 31 | #endif // CENTRAL_WIDGET_H 32 | -------------------------------------------------------------------------------- /src/ui/CustomEventType.h: -------------------------------------------------------------------------------- 1 | #ifndef CUSTOM_EVENT_TYPE_H_ 2 | #define CUSTOM_EVENT_TYPE_H_ 3 | 4 | // QEvent::User = 1000 5 | // QEvent::MaxUser = 65535 6 | 7 | class QCustomEvent { 8 | public: 9 | enum Type{ 10 | User = 10000, 11 | OpenMediaSucceed, 12 | OpenMediaFailed, 13 | PlayerEOF, 14 | PlayerError, 15 | }; 16 | }; 17 | 18 | #endif // CUSTOM_EVENT_TYPE_H_ 19 | -------------------------------------------------------------------------------- /src/ui/GLWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "GLWnd.h" 2 | 3 | GLWnd::GLWnd(QWidget* parent) : HVideoWnd(parent), HGLWidget(parent) 4 | { 5 | 6 | } 7 | 8 | void GLWnd::drawTime() { 9 | char szTime[12]; 10 | duration_fmt(last_frame.ts / 1000, szTime); 11 | // Left Top 12 | QPoint pt(10, 40); 13 | drawText(pt, szTime, 14, Qt::white); 14 | } 15 | 16 | void GLWnd::drawFPS() { 17 | char szFPS[16]; 18 | sprintf(szFPS, "FPS:%d", fps); 19 | // Right Top 20 | QPoint pt(width()-100, 40); 21 | drawText(pt, szFPS, 14, Qt::blue); 22 | } 23 | 24 | void GLWnd::drawResolution() { 25 | char szResolution[16]; 26 | sprintf(szResolution, "%d X %d", last_frame.w, last_frame.h); 27 | // Left Bottom 28 | QPoint pt(10, height() - 10); 29 | drawText(pt, szResolution, 14, Qt::blue); 30 | } 31 | 32 | void GLWnd::paintGL() { 33 | calcFPS(); 34 | HGLWidget::paintGL(); 35 | 36 | if (last_frame.isNull()) { 37 | /* 38 | QPoint pt = rect().center() - QPoint(80, -10); 39 | drawText(pt, "NO VIDEO", 16, Qt::white); 40 | 41 | QPainter painter(this); 42 | QPixmap pixmap(":/image/media_bk.png"); 43 | int w = pixmap.width(); 44 | int h = pixmap.height(); 45 | QRect rc((width()-w)/2, (height()-h)/2, w, h); 46 | painter.drawPixmap(rc, pixmap); 47 | */ 48 | } 49 | else { 50 | drawFrame(&last_frame); 51 | if (draw_time) { 52 | drawTime(); 53 | } 54 | if (draw_fps) { 55 | drawFPS(); 56 | } 57 | if (draw_resolution) { 58 | drawResolution(); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/ui/GLWnd.h: -------------------------------------------------------------------------------- 1 | #ifndef GL_WND_H 2 | #define GL_WND_H 3 | 4 | #include "HVideoWnd.h" 5 | #include "HGLWidget.h" 6 | 7 | class GLWnd : public HVideoWnd, HGLWidget { 8 | public: 9 | GLWnd(QWidget* parent = nullptr); 10 | 11 | virtual void setGeometry(const QRect& rc) { 12 | HGLWidget::setGeometry(rc); 13 | } 14 | 15 | virtual void update() { 16 | HGLWidget::update(); 17 | } 18 | 19 | protected: 20 | virtual void paintGL(); 21 | void drawTime(); 22 | void drawFPS(); 23 | void drawResolution(); 24 | }; 25 | 26 | #endif // GL_WND_H 27 | -------------------------------------------------------------------------------- /src/ui/HMediaInfoDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "HMediaInfoDlg.h" 2 | 3 | HMediaInfoDlg::HMediaInfoDlg(QWidget* parent) 4 | : QDialog(parent) 5 | { 6 | initUI(); 7 | initConnect(); 8 | } 9 | 10 | void HMediaInfoDlg::initUI() { 11 | 12 | } 13 | 14 | void HMediaInfoDlg::initConnect() { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/ui/HMediaInfoDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef H_MEIDA_INFO_DLG_H 2 | #define H_MEIDA_INFO_DLG_H 3 | 4 | #include "qtheaders.h" 5 | 6 | class HMediaInfoDlg : public QDialog 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit HMediaInfoDlg(QWidget *parent = nullptr); 11 | 12 | signals: 13 | 14 | public slots: 15 | 16 | protected: 17 | void initUI(); 18 | void initConnect(); 19 | }; 20 | 21 | #endif // H_MEIDA_INFO_DLG_H 22 | -------------------------------------------------------------------------------- /src/ui/HMultiView.h: -------------------------------------------------------------------------------- 1 | #ifndef H_MULTI_VIEW_H 2 | #define H_MULTI_VIEW_H 3 | 4 | #include "qtheaders.h" 5 | #include "htable.h" 6 | #include "HVideoWidget.h" 7 | 8 | #define MV_STYLE_MAXNUM 64 9 | 10 | // F(id, row, col, label, image) 11 | #define FOREACH_MV_STYLE(F) \ 12 | F(MV_STYLE_1, 1, 1, " MV1", ":/image/style1.png") \ 13 | F(MV_STYLE_2, 1, 2, " MV2", ":/image/style2.png") \ 14 | F(MV_STYLE_4, 2, 2, " MV4", ":/image/style4.png") \ 15 | F(MV_STYLE_9, 3, 3, " MV9", ":/image/style9.png") \ 16 | F(MV_STYLE_16, 4, 4, " MV16", ":/image/style16.png") \ 17 | F(MV_STYLE_25, 5, 5, " MV25", ":/image/style25.png") \ 18 | F(MV_STYLE_36, 6, 6, " MV36", ":/image/style36.png") \ 19 | F(MV_STYLE_49, 7, 7, " MV49", ":/image/style49.png") \ 20 | F(MV_STYLE_64, 8, 8, " MV64", ":/image/style64.png") \ 21 | 22 | enum MV_STYLE { 23 | #define ENUM_MV_STYLE(id, row, col, label, image) id, 24 | FOREACH_MV_STYLE(ENUM_MV_STYLE) 25 | }; 26 | 27 | class HMultiView : public QWidget 28 | { 29 | Q_OBJECT 30 | public: 31 | enum Action { 32 | STRETCH, 33 | EXCHANGE, 34 | MERGE, 35 | }; 36 | explicit HMultiView(QWidget *parent = nullptr); 37 | ~HMultiView(); 38 | 39 | HVideoWidget* getPlayerByID(int playerid); 40 | HVideoWidget* getPlayerByPos(QPoint pt); 41 | HVideoWidget* getIdlePlayer(); 42 | 43 | signals: 44 | 45 | public slots: 46 | void setLayout(int row, int col); 47 | void saveLayout(); 48 | void restoreLayout(); 49 | 50 | void mergeCells(int lt, int rb); 51 | void exchangeCells(HVideoWidget* player1, HVideoWidget* player2); 52 | void stretch(QWidget* wdg); 53 | 54 | void play(HMedia& media); 55 | 56 | protected: 57 | void initUI(); 58 | void initConnect(); 59 | void updateUI(); 60 | 61 | virtual void resizeEvent(QResizeEvent* e); 62 | virtual void mousePressEvent(QMouseEvent *e); 63 | virtual void mouseReleaseEvent(QMouseEvent *e); 64 | virtual void mouseMoveEvent(QMouseEvent *e); 65 | virtual void mouseDoubleClickEvent(QMouseEvent *e); 66 | 67 | public: 68 | HTable table; 69 | HTable prev_table; 70 | QVector views; 71 | QLabel *labRect; 72 | QLabel *labDrag; 73 | 74 | QPoint ptMousePress; 75 | uint64_t tsMousePress; 76 | Action action; 77 | bool bStretch; 78 | }; 79 | 80 | #endif // H_MULTI_VIEW_H 81 | -------------------------------------------------------------------------------- /src/ui/HOpenMediaDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef H_OPEN_MEDIA_DLG_H 2 | #define H_OPEN_MEDIA_DLG_H 3 | 4 | #include "qtheaders.h" 5 | 6 | class FileTab : public QWidget 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit FileTab(QWidget *parent = nullptr); 11 | 12 | public: 13 | QLineEdit* edit; 14 | QPushButton* btnBrowse; 15 | }; 16 | 17 | class NetworkTab : public QWidget 18 | { 19 | Q_OBJECT 20 | public: 21 | explicit NetworkTab(QWidget *parent = nullptr); 22 | 23 | public: 24 | QLineEdit* edit; 25 | }; 26 | 27 | class CaptureTab : public QWidget 28 | { 29 | Q_OBJECT 30 | public: 31 | explicit CaptureTab(QWidget *parent = nullptr); 32 | 33 | public: 34 | QComboBox* cmb; 35 | }; 36 | 37 | #include "hmedia.h" 38 | class HOpenMediaDlg : public QDialog 39 | { 40 | Q_OBJECT 41 | public: 42 | explicit HOpenMediaDlg(QWidget *parent = nullptr); 43 | 44 | signals: 45 | 46 | public slots: 47 | virtual void accept(); 48 | 49 | protected: 50 | void initUI(); 51 | void initConnect(); 52 | 53 | public: 54 | QTabWidget* tab; 55 | HMedia media; 56 | }; 57 | 58 | #endif // H_OPEN_MEDIA_DLG_H 59 | -------------------------------------------------------------------------------- /src/ui/HVideoTitlebar.cpp: -------------------------------------------------------------------------------- 1 | #include "HVideoTitlebar.h" 2 | #include "qtstyles.h" 3 | 4 | HVideoTitlebar::HVideoTitlebar(QWidget *parent) : QFrame(parent) 5 | { 6 | initUI(); 7 | initConnect(); 8 | } 9 | 10 | void HVideoTitlebar::initUI() { 11 | setFixedHeight(VIDEO_TITLEBAR_HEIGHT); 12 | 13 | labTitle = new QLabel; 14 | btnClose = genPushButton(QPixmap(":/image/close.png"), tr("close")); 15 | 16 | QHBoxLayout *hbox = genHBoxLayout(); 17 | hbox->addWidget(labTitle); 18 | hbox->addStretch(); 19 | hbox->addWidget(btnClose); 20 | 21 | setLayout(hbox); 22 | } 23 | 24 | void HVideoTitlebar::initConnect() { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/ui/HVideoTitlebar.h: -------------------------------------------------------------------------------- 1 | #ifndef H_VIDEO_TITLEBAR_H 2 | #define H_VIDEO_TITLEBAR_H 3 | 4 | #include "qtheaders.h" 5 | 6 | class HVideoTitlebar : public QFrame 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit HVideoTitlebar(QWidget *parent = nullptr); 11 | 12 | protected: 13 | void initUI(); 14 | void initConnect(); 15 | 16 | public: 17 | QLabel *labTitle; 18 | QPushButton *btnClose; 19 | }; 20 | 21 | #endif // H_VIDEO_TITLEBAR_H 22 | -------------------------------------------------------------------------------- /src/ui/HVideoToolbar.cpp: -------------------------------------------------------------------------------- 1 | #include "HVideoToolbar.h" 2 | #include "qtstyles.h" 3 | 4 | HVideoToolbar::HVideoToolbar(QWidget *parent) : QFrame(parent) 5 | { 6 | initUI(); 7 | initConnect(); 8 | } 9 | 10 | void HVideoToolbar::initUI() { 11 | setFixedHeight(VIDEO_TOOLBAR_HEIGHT); 12 | 13 | QSize sz(VIDEO_TOOLBAR_ICON_WIDTH, VIDEO_TOOLBAR_ICON_HEIGHT); 14 | btnStart = genPushButton(QPixmap(":/image/start.png"), tr("start")); 15 | btnPause = genPushButton(QPixmap(":/image/pause.png"), tr("pause")); 16 | #if !WITH_MV_STYLE 17 | btnStart->setShortcut(Qt::Key_Space); 18 | btnPause->setShortcut(Qt::Key_Space); 19 | #endif 20 | 21 | btnPrev = genPushButton(QPixmap(":/image/prev.png"), tr("prev")); 22 | btnStop = genPushButton(QPixmap(":/image/stop.png"), tr("stop")); 23 | btnStop->setAutoDefault(true); 24 | btnNext = genPushButton(QPixmap(":/image/next.png"), tr("next")); 25 | 26 | sldProgress = new QSlider; 27 | sldProgress->setOrientation(Qt::Horizontal); 28 | lblDuration = new QLabel("00:00:00"); 29 | 30 | QHBoxLayout *hbox = genHBoxLayout(); 31 | hbox->setSpacing(5); 32 | hbox->addWidget(btnStart, 0, Qt::AlignLeft); 33 | hbox->addWidget(btnPause, 0, Qt::AlignLeft); 34 | btnPause->hide(); 35 | 36 | hbox->addSpacing(5); 37 | hbox->addWidget(btnPrev, 0, Qt::AlignLeft); 38 | btnPrev->hide(); 39 | hbox->addWidget(btnStop, 0, Qt::AlignLeft); 40 | btnStop->hide(); 41 | hbox->addWidget(btnNext, 0, Qt::AlignLeft); 42 | btnNext->hide(); 43 | 44 | hbox->addSpacing(5); 45 | hbox->addWidget(sldProgress); 46 | sldProgress->hide(); 47 | hbox->addWidget(lblDuration); 48 | lblDuration->hide(); 49 | 50 | setLayout(hbox); 51 | } 52 | 53 | void HVideoToolbar::initConnect() { 54 | connectButtons(btnStart, btnPause); 55 | 56 | connect(btnStart, SIGNAL(clicked(bool)), this, SIGNAL(sigStart())); 57 | connect(btnPause, SIGNAL(clicked(bool)), this, SIGNAL(sigPause())); 58 | connect(btnStop, SIGNAL(clicked(bool)), this, SIGNAL(sigStop())); 59 | 60 | connect(btnStop, SIGNAL(clicked(bool)), btnStart, SLOT(show())); 61 | connect(btnStop, SIGNAL(clicked(bool)), btnPause, SLOT(hide())); 62 | } 63 | -------------------------------------------------------------------------------- /src/ui/HVideoToolbar.h: -------------------------------------------------------------------------------- 1 | #ifndef H_VIDEO_TOOLBAR_H 2 | #define H_VIDEO_TOOLBAR_H 3 | 4 | #include "qtheaders.h" 5 | 6 | class HVideoToolbar : public QFrame 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit HVideoToolbar(QWidget *parent = nullptr); 11 | 12 | signals: 13 | void sigStart(); 14 | void sigPause(); 15 | void sigStop(); 16 | 17 | public slots: 18 | 19 | protected: 20 | void initUI(); 21 | void initConnect(); 22 | 23 | public: 24 | QPushButton *btnStart; 25 | QPushButton *btnPause; 26 | 27 | QPushButton *btnPrev; 28 | QPushButton *btnStop; 29 | QPushButton *btnNext; 30 | 31 | QSlider *sldProgress; 32 | QLabel *lblDuration; 33 | }; 34 | 35 | #endif // H_VIDEO_TOOLBAR_H 36 | -------------------------------------------------------------------------------- /src/ui/HVideoWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef H_VIDEO_WIDGET_H 2 | #define H_VIDEO_WIDGET_H 3 | 4 | #include "qtheaders.h" 5 | #include "avdef.h" 6 | 7 | #include "HVideoWndFactory.h" 8 | #include "HVideoTitlebar.h" 9 | #include "HVideoToolbar.h" 10 | #include "HVideoPlayerFactory.h" 11 | 12 | class HVideoWidget : public QFrame 13 | { 14 | Q_OBJECT 15 | public: 16 | enum Status { 17 | STOP, 18 | PAUSE, 19 | PLAY, 20 | }; 21 | 22 | explicit HVideoWidget(QWidget *parent = nullptr); 23 | ~HVideoWidget(); 24 | 25 | signals: 26 | 27 | public slots: 28 | void open(HMedia& media); 29 | void close(); 30 | 31 | void start(); 32 | void stop(); 33 | void pause(); 34 | void resume(); 35 | void restart(); 36 | void retry(); 37 | 38 | void onTimerUpdate(); 39 | void onOpenSucceed(); 40 | void onOpenFailed(); 41 | void onPlayerEOF(); 42 | void onPlayerError(); 43 | 44 | void setAspectRatio(aspect_ratio_t aspect_ratio); 45 | 46 | protected: 47 | void initUI(); 48 | void initConnect(); 49 | void updateUI(); 50 | 51 | virtual void resizeEvent(QResizeEvent *e); 52 | virtual void enterEvent(QEvent *e); 53 | virtual void leaveEvent(QEvent *e); 54 | virtual void mousePressEvent(QMouseEvent *e); 55 | virtual void mouseReleaseEvent(QMouseEvent *e); 56 | virtual void mouseMoveEvent(QMouseEvent *e); 57 | virtual void customEvent(QEvent* e); 58 | 59 | public: 60 | int playerid; 61 | int status; 62 | QString title; 63 | int fps; 64 | aspect_ratio_t aspect_ratio; 65 | renderer_type_e renderer_type; 66 | 67 | HVideoWnd *videownd; 68 | HVideoTitlebar *titlebar; 69 | HVideoToolbar *toolbar; 70 | QPushButton *btnMedia; 71 | private: 72 | QPoint ptMousePress; 73 | QTimer* timer; 74 | 75 | HMedia media; 76 | HVideoPlayer* pImpl_player; 77 | // for retry when SIGNAL_END_OF_FILE 78 | int retry_interval; 79 | int retry_maxcnt; 80 | int64_t last_retry_time; 81 | int retry_cnt; 82 | }; 83 | 84 | #endif // H_VIDEO_WIDGET_H 85 | -------------------------------------------------------------------------------- /src/ui/HVideoWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "HVideoWnd.h" 2 | #include "confile.h" 3 | 4 | HVideoWnd::HVideoWnd(QWidget *parent) 5 | { 6 | fps = 0; 7 | framecnt = 0; 8 | tick = 0; 9 | draw_time = g_confile->Get("draw_time", "ui", false); 10 | draw_fps = g_confile->Get("draw_fps", "ui", false); 11 | draw_resolution = g_confile->Get("draw_resolution", "ui", false); 12 | } 13 | 14 | void HVideoWnd::calcFPS() { 15 | if (gettick() - tick > 1000) { 16 | fps = framecnt; 17 | framecnt = 0; 18 | tick = gettick(); 19 | } 20 | else { 21 | ++framecnt; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/ui/HVideoWnd.h: -------------------------------------------------------------------------------- 1 | #ifndef H_VIDEO_WND_H 2 | #define H_VIDEO_WND_H 3 | 4 | #include 5 | 6 | class HVideoWnd { 7 | public: 8 | HVideoWnd(QWidget* parent = nullptr); 9 | virtual ~HVideoWnd() {} 10 | 11 | virtual void setGeometry(const QRect& rc) = 0; 12 | virtual void update() = 0; 13 | 14 | protected: 15 | void calcFPS(); 16 | 17 | public: 18 | HFrame last_frame; 19 | int fps; 20 | bool draw_time; 21 | bool draw_fps; 22 | bool draw_resolution; 23 | protected: 24 | // for calFPS 25 | uint64_t tick; 26 | int framecnt; 27 | }; 28 | 29 | #endif // H_VIDEO_WND_H 30 | -------------------------------------------------------------------------------- /src/ui/HVideoWndFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef H_VIDEO_WND_FACTORY_H 2 | #define H_VIDEO_WND_FACTORY_H 3 | 4 | #include "HVideoWnd.h" 5 | #include "GLWnd.h" 6 | #include "SDL2Wnd.h" 7 | 8 | enum renderer_type_e { 9 | RENDERER_TYPE_OPENGL, 10 | RENDERER_TYPE_SDL2, 11 | // Windows only 12 | // RENDERER_TYPE_D3D, 13 | // RENDERER_TYPE_DDRAW, 14 | // RENDERER_TYPE_GDI, 15 | }; 16 | #define DEFAULT_RENDERER_TYPE RENDERER_TYPE_OPENGL 17 | 18 | class HVideoWndFactory { 19 | public: 20 | static HVideoWnd* create(renderer_type_e type = DEFAULT_RENDERER_TYPE, QWidget* parent = NULL) { 21 | switch(type) { 22 | case RENDERER_TYPE_OPENGL: 23 | return new GLWnd(parent); 24 | case RENDERER_TYPE_SDL2: 25 | return new SDL2Wnd(parent); 26 | default: 27 | return NULL; 28 | } 29 | } 30 | }; 31 | 32 | #endif // H_VIDEO_WND_FACTORY_H 33 | -------------------------------------------------------------------------------- /src/ui/LsideWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "LsideWidget.h" 2 | -------------------------------------------------------------------------------- /src/ui/LsideWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef LSIDE_WIDGET_H 2 | #define LSIDE_WIDGET_H 3 | 4 | #include "qtheaders.h" 5 | 6 | // define LsideWidget for future expansion 7 | typedef QWidget LsideWidget; 8 | 9 | #endif // LSIDE_WIDGET_H 10 | -------------------------------------------------------------------------------- /src/ui/MainWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_WINDOW_H 2 | #define MAIN_WINDOW_H 3 | 4 | #include "qtheaders.h" 5 | #include "qtstyles.h" 6 | #include "singleton.h" 7 | 8 | #include "CentralWidget.h" 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | SINGLETON_DECL(MainWindow) 14 | 15 | public: 16 | MainWindow(QWidget *parent = 0); 17 | ~MainWindow(); 18 | 19 | enum window_state_e { 20 | NORMAL = 0, 21 | MINIMIZED, 22 | MAXIMIZED, 23 | FULLSCREEN, 24 | } window_state; 25 | 26 | protected: 27 | void initUI(); 28 | void initConnect(); 29 | 30 | void initMenu(); 31 | 32 | virtual void keyPressEvent(QKeyEvent* e); 33 | virtual void changeEvent(QEvent* e); 34 | 35 | signals: 36 | 37 | public slots: 38 | void about(); 39 | void fullscreen(); 40 | 41 | void onMVStyleSelected(int id); 42 | void mv_fullscreen(); 43 | 44 | void OpenMediaDlg(int index); 45 | 46 | public: 47 | QAction *actMenubar; 48 | QAction *actFullscreen; 49 | QAction *actMvFullscreen; 50 | 51 | QVector toolbars; 52 | 53 | CentralWidget* center; 54 | }; 55 | 56 | #define g_mainwnd MainWindow::instance() 57 | 58 | #endif // MAIN_WINDOW_H 59 | -------------------------------------------------------------------------------- /src/ui/RsideWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "RsideWidget.h" 2 | -------------------------------------------------------------------------------- /src/ui/RsideWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef RSIDE_WIDGET_H 2 | #define RSIDE_WIDGET_H 3 | 4 | #include "qtheaders.h" 5 | 6 | // define RsideWidget for future expansion 7 | typedef QWidget RsideWidget; 8 | 9 | #endif // LSIDE_WIDGET_H 10 | -------------------------------------------------------------------------------- /src/ui/SDL2Wnd.h: -------------------------------------------------------------------------------- 1 | #ifndef SDL2_WND_H 2 | #define SDL2_WND_H 3 | 4 | #include "HVideoWnd.h" 5 | #include "sdl_util.h" 6 | 7 | class SDL2Wnd : public HVideoWnd, QWidget { 8 | public: 9 | SDL2Wnd(QWidget* parent = nullptr); 10 | ~SDL2Wnd(); 11 | 12 | virtual void setGeometry(const QRect& rc) { 13 | QWidget::setGeometry(rc); 14 | } 15 | 16 | virtual void update(); 17 | 18 | protected: 19 | virtual void paintEvent(QPaintEvent* e); 20 | virtual void resizeEvent(QResizeEvent* e); 21 | 22 | static std::atomic_flag s_sdl_init; 23 | SDL_Window* sdlWindow; 24 | SDL_Renderer* sdlRenderer; 25 | SDL_Texture* sdlTexture; 26 | SDL_RendererInfo renderer_info; 27 | int tex_w; 28 | int tex_h; 29 | int tex_pix_fmt; 30 | int tex_bpp; 31 | int tex_pitch; 32 | SDL_PixelFormatEnum sdl_pix_fmt; 33 | }; 34 | 35 | #endif // SDL2_WND_H 36 | -------------------------------------------------------------------------------- /src/ui/htable.cpp: -------------------------------------------------------------------------------- 1 | #include "htable.h" 2 | 3 | #include "hdef.h" 4 | 5 | void combine(HTableCell& a, HTableCell& b, HTableCell& comb) { 6 | comb.r1 = MIN(a.r1, b.r1); 7 | comb.r2 = MAX(a.r2, b.r2); 8 | comb.c1 = MIN(a.c1, b.c1); 9 | comb.c2 = MAX(a.c2, b.c2); 10 | } 11 | 12 | bool overlap(HTableCell& a, HTableCell& b, HTableCell& inter, HTableCell& comb) { 13 | inter.r1 = MAX(a.r1, b.r1); 14 | inter.r2 = MIN(a.r2, b.r2); 15 | inter.c1 = MAX(a.c1, b.c1); 16 | inter.c2 = MIN(a.c2, b.c2); 17 | 18 | if (inter.r1 < inter.r2 && inter.c1 < inter.c2) { 19 | combine(a, b, comb); 20 | return true; 21 | } 22 | 23 | return false; 24 | } 25 | 26 | HTable::HTable() { 27 | row = col = 0; 28 | } 29 | 30 | void HTable::init(int row, int col) { 31 | this->row = row; 32 | this->col = col; 33 | m_mapCells.clear(); 34 | for (int r = 1; r <= row; ++r) { 35 | for (int c = 1; c <= col; ++c) { 36 | int id = (r-1) * col + c; 37 | m_mapCells[id] = HTableCell(r, r+1, c, c+1); 38 | } 39 | } 40 | } 41 | 42 | bool HTable::getTableCell(int id, HTableCell& rst) { 43 | if (m_mapCells.find(id) != m_mapCells.end()) { 44 | rst = m_mapCells[id]; 45 | return true; 46 | } 47 | return false; 48 | } 49 | 50 | HTableCell HTable::merge(int lt, int rb) { 51 | HTableCell cell_lt, cell_rb, inter, comb; 52 | if (getTableCell(lt, cell_lt) && getTableCell(rb, cell_rb)) { 53 | combine(cell_lt, cell_rb, comb); 54 | 55 | std::map::iterator iter = m_mapCells.begin(); 56 | while (iter != m_mapCells.end()) { 57 | if (overlap(comb, iter->second, inter, comb)) { 58 | iter = m_mapCells.erase(iter); 59 | } 60 | else { 61 | ++iter; 62 | } 63 | } 64 | 65 | int id = (comb.r1-1) * col + comb.c1; 66 | m_mapCells[id] = comb; 67 | 68 | return comb; 69 | } 70 | 71 | return HTableCell(); 72 | } 73 | -------------------------------------------------------------------------------- /src/ui/htable.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_TABLE_H_ 2 | #define HW_TABLE_H_ 3 | 4 | #include 5 | 6 | class HTableCell { 7 | public: 8 | HTableCell() {r1 = r2 = c1 = c2 = 0;} 9 | HTableCell(int r1, int r2, int c1, int c2) { 10 | this->r1 = r1; 11 | this->r2 = r2; 12 | this->c1 = c1; 13 | this->c2 = c2; 14 | } 15 | 16 | int rowspan() {return r2 - r1;} 17 | int colspan() {return c2 - c1;} 18 | int span() {return rowspan() * colspan();} 19 | 20 | bool contain(HTableCell cell) { 21 | if (cell.r1 >= r1 && cell.r2 <= r2 && 22 | cell.c1 >= c1 && cell.c2 <= c2) 23 | return true; 24 | return false; 25 | } 26 | 27 | int r1, r2, c1, c2; 28 | }; 29 | 30 | class HTable { 31 | public: 32 | HTable(); 33 | 34 | void init(int row, int col); 35 | bool getTableCell(int id, HTableCell& rst); 36 | HTableCell merge(int lt, int rb); 37 | 38 | public: 39 | int row; 40 | int col; 41 | std::map m_mapCells; // id => HTabelCell 42 | }; 43 | 44 | #endif // HW_TABLE_H_ 45 | -------------------------------------------------------------------------------- /src/ui/qtstyles.h: -------------------------------------------------------------------------------- 1 | #ifndef QT_STYLES_H 2 | #define QT_STYLES_H 3 | 4 | //----------------mutable----------------------- 5 | #define LSIDE_VISIBLE false 6 | #define RSIDE_VISIBLE false 7 | 8 | #define LSIDE_MIN_WIDTH 200 9 | #define LSIDE_MAX_WIDTH 400 10 | 11 | #define MV_MIN_WIDTH 640 12 | #define MV_MIN_HEIGHT 480 13 | 14 | #define RSIDE_MIN_WIDTH 200 15 | #define RSIDE_MAX_WIDTH 400 16 | 17 | #define WITH_MV_STYLE 1 18 | #define MV_STYLE_ROW 3 19 | #define MV_STYLE_COL 3 20 | //============================================== 21 | 22 | #define DEFAULT_SKIN "dark" 23 | #define DEFAULT_PALETTE_COLOR 0xFF132D48 24 | #define DEFAULT_LANGUAGE "" 25 | #define DEFAULT_FONT_SIZE 12 26 | 27 | #define MAIN_WINDOW_WIDTH 1280 28 | #define MAIN_WINDOW_HEIGHT 800 29 | 30 | #define VIDEO_TITLEBAR_HEIGHT 50 31 | #define VIDEO_TITLEBAR_ICON_WIDTH 48 32 | #define VIDEO_TITLEBAR_ICON_HEIGHT 48 33 | 34 | #define VIDEO_TOOLBAR_HEIGHT 50 35 | #define VIDEO_TOOLBAR_ICON_WIDTH 48 36 | #define VIDEO_TOOLBAR_ICON_HEIGHT 48 37 | 38 | #define DRAG_WIDTH 160 39 | #define DRAG_HEIGHT 120 40 | 41 | #define DRAG_QSS "border:3px groove #FF8C00" 42 | #define RECT_QSS "border:2px solid red" 43 | 44 | #endif // QT_STYLES_H 45 | -------------------------------------------------------------------------------- /src/util/ffmpeg_util.h: -------------------------------------------------------------------------------- 1 | #ifndef FFMPEG_UTIL_H 2 | #define FFMPEG_UTIL_H 3 | 4 | extern "C" { 5 | #include "libavutil/avutil.h" 6 | #include "libavutil/pixdesc.h" 7 | #include "libavcodec/avcodec.h" 8 | #include "libavformat/avformat.h" 9 | #include "libavdevice/avdevice.h" 10 | #include "libswscale/swscale.h" 11 | } 12 | 13 | #endif // FFMPEG_UTIL_H 14 | -------------------------------------------------------------------------------- /src/util/hframe.cpp: -------------------------------------------------------------------------------- 1 | #include "hframe.h" 2 | 3 | #include "hlog.h" 4 | 5 | int HFrameBuf::push(HFrame* pFrame) { 6 | if (pFrame->isNull()) 7 | return -10; 8 | 9 | frame_stats.push_cnt++; 10 | 11 | std::lock_guard locker(mutex); 12 | 13 | if (frames.size() >= (size_t)cache_num) { 14 | hlogd("frame cache full!"); 15 | if (policy == HFrameBuf::DISCARD) { 16 | return -20; // note: cache full, discard frame 17 | } 18 | 19 | HFrame& frame = frames.front(); 20 | frames.pop_front(); 21 | free(frame.buf.len); 22 | if (frame.userdata) { 23 | hlogd("free userdata"); 24 | ::free(frame.userdata); 25 | frame.userdata = NULL; 26 | } 27 | } 28 | 29 | int ret = 0; 30 | if (isNull()) { 31 | resize(pFrame->buf.len * cache_num); 32 | ret = 1; // note: first push 33 | 34 | frame_info.w = pFrame->w; 35 | frame_info.h = pFrame->h; 36 | frame_info.type = pFrame->type; 37 | frame_info.bpp = pFrame->bpp; 38 | } 39 | 40 | HFrame frame; 41 | frame.buf.base = alloc(pFrame->buf.len); 42 | frame.buf.len = pFrame->buf.len; 43 | frame.copy(*pFrame); 44 | frames.push_back(frame); 45 | frame_stats.push_ok_cnt++; 46 | 47 | return ret; 48 | } 49 | 50 | int HFrameBuf::pop(HFrame* pFrame) { 51 | frame_stats.pop_cnt++; 52 | 53 | std::lock_guard locker(mutex); 54 | 55 | if (isNull()) 56 | return -10; 57 | 58 | if (frames.size() == 0) { 59 | hlogd("frame cache empty!"); 60 | return -20; 61 | } 62 | 63 | HFrame& frame = frames.front(); 64 | frames.pop_front(); 65 | free(frame.buf.len); 66 | 67 | if (frame.isNull()) 68 | return -30; 69 | 70 | pFrame->copy(frame); 71 | frame_stats.pop_ok_cnt++; 72 | 73 | return 0; 74 | } 75 | 76 | void HFrameBuf::clear() { 77 | std::lock_guard locker(mutex); 78 | frames.clear(); 79 | HRingBuf::clear(); 80 | } 81 | -------------------------------------------------------------------------------- /src/util/hframe.h: -------------------------------------------------------------------------------- 1 | #ifndef HV_FRAME_H_ 2 | #define HV_FRAME_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "hbuf.h" 8 | 9 | class HFrame { 10 | public: 11 | HBuf buf; 12 | int w; 13 | int h; 14 | int bpp; 15 | int type; 16 | uint64_t ts; 17 | int64_t useridx; 18 | void* userdata; 19 | 20 | HFrame() { 21 | w = h = bpp = type = 0; 22 | ts = 0; 23 | useridx = -1; 24 | userdata = NULL; 25 | } 26 | 27 | bool isNull() { 28 | return w == 0 || h == 0 || buf.isNull(); 29 | } 30 | 31 | void copy(const HFrame& rhs) { 32 | w = rhs.w; 33 | h = rhs.h; 34 | bpp = rhs.bpp; 35 | type = rhs.type; 36 | ts = rhs.ts; 37 | useridx = rhs.useridx; 38 | userdata = rhs.userdata; 39 | buf.copy(rhs.buf.base, rhs.buf.len); 40 | } 41 | }; 42 | 43 | typedef struct frame_info_s { 44 | int w; 45 | int h; 46 | int type; 47 | int bpp; 48 | } FrameInfo; 49 | 50 | typedef struct frame_stats_s { 51 | int push_cnt; 52 | int pop_cnt; 53 | 54 | int push_ok_cnt; 55 | int pop_ok_cnt; 56 | 57 | frame_stats_s() { 58 | push_cnt = pop_cnt = push_ok_cnt = pop_ok_cnt = 0; 59 | } 60 | } FrameStats; 61 | 62 | #define DEFAULT_FRAME_CACHENUM 10 63 | 64 | class HFrameBuf : public HRingBuf { 65 | public: 66 | enum CacheFullPolicy { 67 | SQUEEZE, 68 | DISCARD, 69 | } policy; 70 | 71 | HFrameBuf() : HRingBuf() { 72 | cache_num = DEFAULT_FRAME_CACHENUM; 73 | policy = SQUEEZE; 74 | } 75 | 76 | void setCache(int num) {cache_num = num;} 77 | void setPolicy(CacheFullPolicy policy) {this->policy = policy;} 78 | 79 | int push(HFrame* pFrame); 80 | int pop(HFrame* pFrame); 81 | void clear(); 82 | 83 | int cache_num; 84 | FrameStats frame_stats; 85 | FrameInfo frame_info; 86 | std::deque frames; 87 | std::mutex mutex; 88 | }; 89 | 90 | #endif // HV_FRAME_H_ 91 | -------------------------------------------------------------------------------- /src/util/hgl.h: -------------------------------------------------------------------------------- 1 | #ifndef HV_GL_H_ 2 | #define HV_GL_H_ 3 | 4 | #include "glew.h" 5 | #include "hframe.h" 6 | 7 | // GL PixelFormat extend 8 | #define GL_I420 0x1910 // YYYYYYYYUUVV 9 | #define GL_YV12 0x1911 // YYYYYYYYVVUU 10 | #define GL_NV12 0x1912 // YYYYYYYYUVUV 11 | #define GL_NV21 0x1913 // YYYYYYYYVUVU 12 | 13 | /* 14 | #define GL_RGB 0x1907 // RGBRGB 15 | #define GL_RGBA 0x1908 // RGBARGBA 16 | 17 | #define GL_BGR 0x80E0 // BGRBGR .bmp 18 | #define GL_BGRA 0x80E1 // BGRABGRA 19 | */ 20 | 21 | typedef struct GLTexture_s { 22 | unsigned int id; // for glGenTextures 23 | HFrame frame; 24 | } GLTexture; 25 | 26 | #endif // HV_GL_H_ 27 | -------------------------------------------------------------------------------- /src/util/hgui.h: -------------------------------------------------------------------------------- 1 | #ifndef HV_GUI_H_ 2 | #define HV_GUI_H_ 3 | 4 | typedef unsigned int HColor; // 0xAARRGGBB 5 | 6 | #define CLR_B(c) (c & 0xff) 7 | #define CLR_G(c) ((c >> 8) & 0xff) 8 | #define CLR_R(c) ((c >> 16) & 0xff) 9 | #define CLR_A(c) ((c >> 24) & 0xff) 10 | #define ARGB(a, r, g, b) MAKE_FOURCC(a, r, g, b) 11 | 12 | typedef struct hpoint_s { 13 | int x; 14 | int y; 15 | 16 | #ifdef __cplusplus 17 | hpoint_s() { 18 | x = y = 0; 19 | } 20 | 21 | hpoint_s(int x, int y) { 22 | this->x = x; 23 | this->y = y; 24 | } 25 | #endif 26 | } HPoint; 27 | 28 | typedef struct hsize_s { 29 | int w; 30 | int h; 31 | 32 | #ifdef __cplusplus 33 | hsize_s() { 34 | w = h = 0; 35 | } 36 | 37 | hsize_s(int w, int h) { 38 | this->w = w; 39 | this->h = h; 40 | } 41 | #endif 42 | } HSize; 43 | 44 | typedef struct hrect_s { 45 | int x; 46 | int y; 47 | int w; 48 | int h; 49 | 50 | #ifdef __cplusplus 51 | hrect_s() { 52 | x = y = w = h = 0; 53 | } 54 | 55 | hrect_s(int x, int y, int w, int h) { 56 | this->x = x; 57 | this->y = y; 58 | this->w = w; 59 | this->h = h; 60 | } 61 | 62 | int left() {return x;} 63 | int right() {return x+w;} 64 | int top() {return y;} 65 | int bottom() {return y+h;} 66 | #endif 67 | } HRect; 68 | 69 | #endif // HV_GUI_H_ 70 | -------------------------------------------------------------------------------- /src/util/opencv_util.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENCV_UTIL_H 2 | #define OPENCV_UTIL_H 3 | 4 | #include "opencv2/opencv.hpp" 5 | #include "hframe.h" 6 | #include "hgl.h" 7 | 8 | inline void Mat2HFrame(cv::Mat& mat, HFrame& frame) { 9 | frame.buf.base = (char*)mat.data; 10 | frame.buf.len = mat.cols * mat.rows * mat.channels(); 11 | frame.w = mat.cols; 12 | frame.h = mat.rows; 13 | frame.bpp = mat.channels()*8; 14 | switch(mat.type()) { 15 | default: 16 | frame.type = GL_BGR; 17 | } 18 | } 19 | 20 | #include 21 | inline QImage Mat2QImage(cv::Mat& matBGR) { 22 | cv::Mat matRGB; 23 | cv::cvtColor(matBGR, matRGB,CV_BGR2RGB); // cvtColor Makes a copt, that what i need 24 | QImage dst((const uchar *) matRGB.data, matRGB.cols, matRGB.rows, matRGB.step, QImage::Format_RGB888); 25 | dst.bits(); // enforce deep copy, see documentation 26 | return dst; 27 | } 28 | 29 | inline cv::Mat QImage2Mat(QImage const& img) { 30 | cv::Mat matBGR; 31 | if (img.format() == QImage::Format_RGB32) { 32 | cv::Mat matRGBA(img.height(),img.width(),CV_8UC4,(uchar*)img.bits(),img.bytesPerLine()); 33 | cv::cvtColor(matRGBA, matBGR,CV_BGRA2BGR); 34 | } 35 | else if (img.format() == QImage::Format_RGB888) { 36 | cv::Mat matRGB(img.height(),img.width(),CV_8UC3,(uchar*)img.bits(),img.bytesPerLine()); 37 | cv::cvtColor(matRGB, matBGR,CV_RGB2BGR); 38 | } 39 | return matBGR; 40 | } 41 | 42 | #endif // OPENCV_UTIL_H 43 | -------------------------------------------------------------------------------- /src/util/sdl_util.h: -------------------------------------------------------------------------------- 1 | #ifndef SDL_UTIL_H 2 | #define SDL_UTIL_H 3 | 4 | #include "SDL2/SDL.h" 5 | // define main SDL_main 6 | #undef main 7 | 8 | #endif // SDL_UTIL_H 9 | -------------------------------------------------------------------------------- /src/video/HVideoCapture.cpp: -------------------------------------------------------------------------------- 1 | #include "HVideoCapture.h" 2 | #include "opencv_util.h" 3 | 4 | #include "qtheaders.h" 5 | 6 | int HVideoCapture::start() { 7 | switch (media.type) { 8 | case MEDIA_TYPE_CAPTURE: 9 | vc.open(media.index, cv::CAP_DSHOW); 10 | break; 11 | case MEDIA_TYPE_FILE: 12 | case MEDIA_TYPE_NETWORK: 13 | vc.open(media.src.c_str(), cv::CAP_FFMPEG); 14 | break; 15 | default: 16 | return -10; 17 | } 18 | 19 | if (!vc.isOpened()) { 20 | return -20; 21 | } 22 | 23 | vc.set(cv::CAP_PROP_FPS, fps); 24 | HThread::setSleepPolicy(HThread::SLEEP_UNTIL, 1000/fps); 25 | 26 | return HThread::start(); 27 | } 28 | 29 | int HVideoCapture::stop() { 30 | HThread::stop(); 31 | vc.release(); 32 | return 0; 33 | } 34 | 35 | void HVideoCapture::doTask() { 36 | cv::Mat mat; 37 | if (!vc.read(mat)) { 38 | return; 39 | } 40 | 41 | HFrame hframe; 42 | Mat2HFrame(mat, hframe); 43 | push_frame(&hframe); 44 | } 45 | -------------------------------------------------------------------------------- /src/video/HVideoCapture.h: -------------------------------------------------------------------------------- 1 | #ifndef H_VIDEO_CAPTURE_H 2 | #define H_VIDEO_CAPTURE_H 3 | 4 | #include "HVideoPlayer.h" 5 | #include "hthread.h" 6 | #include "opencv2/opencv.hpp" 7 | 8 | class HVideoCapture : public HVideoPlayer, public HThread 9 | { 10 | public: 11 | HVideoCapture() : HVideoPlayer(), HThread() {} 12 | 13 | virtual int start(); 14 | virtual int stop(); 15 | virtual int pause() {return HThread::pause();} 16 | virtual int resume() {return HThread::resume();} 17 | 18 | virtual void doTask(); 19 | 20 | protected: 21 | cv::VideoCapture vc; 22 | }; 23 | 24 | #endif // HVIDEOCAPTURE_H 25 | -------------------------------------------------------------------------------- /src/video/HVideoPlayerFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef H_VIDEO_PLAYER_FACTORY_H 2 | #define H_VIDEO_PLAYER_FACTORY_H 3 | 4 | #include "hmedia.h" 5 | #include "HVideoPlayer.h" 6 | // #include "HVideoCapture.h" 7 | #include "hffplayer.h" 8 | 9 | class HVideoPlayerFactory 10 | { 11 | public: 12 | static HVideoPlayer* create(media_type_e type) { 13 | switch (type) { 14 | case MEDIA_TYPE_FILE: 15 | case MEDIA_TYPE_NETWORK: 16 | return new HFFPlayer; 17 | case MEDIA_TYPE_CAPTURE: 18 | // return new HVideoCapture; 19 | return new HFFPlayer; 20 | default: 21 | return NULL; 22 | } 23 | } 24 | }; 25 | 26 | #endif // H_VIDEO_PLAYER_FACTORY_H 27 | -------------------------------------------------------------------------------- /src/video/hffplayer.h: -------------------------------------------------------------------------------- 1 | #ifndef H_FFPLAYER_H 2 | #define H_FFPLAYER_H 3 | 4 | #include "HVideoPlayer.h" 5 | #include "ffmpeg_util.h" 6 | 7 | #include "hthread.h" 8 | 9 | #include 10 | 11 | class HFFPlayer : public HVideoPlayer, public HThread { 12 | public: 13 | HFFPlayer(); 14 | ~HFFPlayer(); 15 | 16 | virtual int start() { 17 | quit = 0; 18 | return HThread::start(); 19 | } 20 | virtual int stop() { 21 | quit = 1; 22 | return HThread::stop(); 23 | } 24 | virtual int pause() {return HThread::pause();} 25 | virtual int resume() {return HThread::resume();} 26 | 27 | virtual int seek(int64_t ms); 28 | 29 | private: 30 | virtual bool doPrepare(); 31 | virtual void doTask(); 32 | virtual bool doFinish(); 33 | 34 | int open(); 35 | int close(); 36 | 37 | public: 38 | int64_t block_starttime; 39 | int64_t block_timeout; 40 | int quit; 41 | 42 | private: 43 | static std::atomic_flag s_ffmpeg_init; 44 | 45 | AVDictionary* fmt_opts; 46 | AVDictionary* codec_opts; 47 | 48 | AVFormatContext* fmt_ctx; 49 | AVCodecContext* codec_ctx; 50 | 51 | AVPacket* packet; 52 | AVFrame* frame; 53 | 54 | int video_stream_index; 55 | int audio_stream_index; 56 | int subtitle_stream_index; 57 | 58 | int video_time_base_num; 59 | int video_time_base_den; 60 | 61 | // for scale 62 | AVPixelFormat src_pix_fmt; 63 | AVPixelFormat dst_pix_fmt; 64 | SwsContext* sws_ctx; 65 | uint8_t* data[4]; 66 | int linesize[4]; 67 | HFrame hframe; 68 | }; 69 | 70 | #endif // H_FFPLAYER_H 71 | -------------------------------------------------------------------------------- /src/video/hmedia.h: -------------------------------------------------------------------------------- 1 | #ifndef H_MEDIA_H 2 | #define H_MEDIA_H 3 | 4 | #include 5 | #include "avdef.h" 6 | 7 | typedef struct media_s { 8 | media_type_e type; 9 | std::string src; 10 | std::string descr; 11 | int index; // for camera index 12 | 13 | media_s() { 14 | type = MEDIA_TYPE_NONE; 15 | index = -1; 16 | } 17 | } HMedia; 18 | 19 | #endif // H_MEDIA_H 20 | -------------------------------------------------------------------------------- /src/win32/hdevice.h: -------------------------------------------------------------------------------- 1 | #ifndef H_DEVICE_H 2 | #define H_DEVICE_H 3 | 4 | #include 5 | 6 | struct HDevice { 7 | char name[256]; 8 | //... 9 | }; 10 | 11 | std::vector getVideoDevices(); 12 | std::vector getAudioDevices(); 13 | 14 | #endif // H_DEVICE_H 15 | --------------------------------------------------------------------------------