├── README.md ├── src ├── .qmake.stash ├── Makefile ├── Makefile.Debug ├── Makefile.Release ├── Security_Monitoring.pro ├── Security_Monitoring.pro.user ├── bin │ ├── Security_Monitoring.exe │ ├── avcodec-58.dll │ ├── avdevice-58.dll │ ├── avfilter-7.dll │ ├── avformat-58.dll │ ├── avutil-56.dll │ ├── haha.yuv │ ├── postproc-55.dll │ ├── saveH264.h264 │ ├── saveYUV.yuv │ ├── sqlite3.dll │ ├── swresample-3.dll │ ├── swscale-5.dll │ └── trance.mp4 ├── controller │ ├── imagecontrol.cpp │ ├── imagecontrol.h │ ├── setcontrol.cpp │ ├── setcontrol.h │ ├── usercontrol.cpp │ ├── usercontrol.h │ ├── videocontrol.cpp │ └── videocontrol.h ├── data │ └── video ├── debug │ ├── decode2.o │ ├── ftrancetodest.o │ ├── moc_decode2.cpp │ └── moc_decode2.o ├── ffmpeg │ ├── decode.cpp │ ├── decode.h │ ├── decode_replay.cpp │ ├── decode_replay.h │ ├── encodetoh264.cpp │ ├── encodetoh264.h │ ├── ftrancetodest.h.autosave │ ├── ftrancetomp4.cpp │ └── ftrancetomp4.h ├── ffmpeglib │ ├── include │ │ ├── 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 │ │ │ ├── hwcontext_vulkan.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 │ │ ├── avcodec-58.def │ │ ├── avcodec.lib │ │ ├── avdevice-58.def │ │ ├── avdevice.lib │ │ ├── avfilter-7.def │ │ ├── avfilter.lib │ │ ├── avformat-58.def │ │ ├── avformat.lib │ │ ├── avutil-56.def │ │ ├── avutil.lib │ │ ├── libavcodec.dll.a │ │ ├── libavdevice.dll.a │ │ ├── libavfilter.dll.a │ │ ├── libavformat.dll.a │ │ ├── libavutil.dll.a │ │ ├── libpostproc.dll.a │ │ ├── libswresample.dll.a │ │ ├── libswscale.dll.a │ │ ├── postproc-55.def │ │ ├── postproc.lib │ │ ├── swresample-3.def │ │ ├── swresample.lib │ │ ├── swscale-5.def │ │ └── swscale.lib ├── image.qrc ├── lib │ └── sqlite3.lib ├── main.cpp ├── model │ ├── imagemodel.cpp │ ├── imagemodel.h │ ├── setmodel.cpp │ ├── setmodel.h │ ├── singeldb.cpp │ ├── singeldb.h │ ├── usermodel.cpp │ ├── usermodel.h │ ├── videomodel.cpp │ └── videomodel.h ├── object_script.Security_Monitoring.Debug ├── object_script.Security_Monitoring.Release ├── png │ ├── 1.png │ ├── 2.png │ ├── background.jpeg │ ├── 声音关.png │ ├── 声音开.png │ ├── 展开.png │ ├── 开始.png │ ├── 搜索.png │ ├── 放大展示.png │ ├── 新建文件夹 │ │ ├── 1.png │ │ └── 2.png │ ├── 暂停.png │ ├── 最后一个视频.png │ ├── 第一个视频.png │ ├── 缩小.png │ └── 静音.png ├── sqlite3.h ├── video1234.h264 └── view │ ├── beginwidget.cpp │ ├── beginwidget.h │ ├── image_widegt.cpp │ ├── image_widegt.h │ ├── loginwidget.cpp │ ├── loginwidget.h │ ├── main_monitorwidget.cpp │ ├── main_monitorwidget.h │ ├── main_replaywidget.cpp │ ├── main_replaywidget.h │ ├── main_widget.cpp │ ├── main_widget.h │ ├── mainwidget.h.autosave │ ├── myitem.cpp │ ├── myitem.h │ ├── play_widget.cpp │ ├── play_widget.h │ ├── registerwidget.cpp │ ├── registerwidget.h │ ├── setwidget.cpp │ └── setwidget.h └── 用户手册.docx /README.md: -------------------------------------------------------------------------------- 1 | # Security_Monitoring 2 | 本系统是一个单机版的FFmpeg安防监控系统应用程序,用 C/C++语言编写,在 windows 环境下运行。模拟摄像头监控,实现实时画面解码显示、H264视频编码存储、视频实时播放和截图、H264视频转码导出MP4格式视频、图片的查看等功能。 3 | -------------------------------------------------------------------------------- /src/.qmake.stash: -------------------------------------------------------------------------------- 1 | QMAKE_CXX.INCDIRS = \ 2 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include \ 3 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include-fixed \ 4 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/i686-w64-mingw32/include \ 5 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/i686-w64-mingw32/include/c++ \ 6 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/i686-w64-mingw32/include/c++/i686-w64-mingw32 \ 7 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/i686-w64-mingw32/include/c++/backward 8 | QMAKE_CXX.LIBDIRS = \ 9 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0 \ 10 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/lib/gcc \ 11 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/i686-w64-mingw32/lib \ 12 | D:/Software/QT/QT5.9.8/Tools/mingw530_32/lib 13 | QMAKE_CXX.QT_COMPILER_STDCXX = 199711L 14 | QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 5 15 | QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 3 16 | QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0 17 | QMAKE_CXX.COMPILER_MACROS = \ 18 | QT_COMPILER_STDCXX \ 19 | QMAKE_GCC_MAJOR_VERSION \ 20 | QMAKE_GCC_MINOR_VERSION \ 21 | QMAKE_GCC_PATCH_VERSION 22 | -------------------------------------------------------------------------------- /src/Security_Monitoring.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2021-06-06T17:05:29 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | QT += multimedia 9 | QT += widgets 10 | 11 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 12 | 13 | TARGET = Security_Monitoring 14 | TEMPLATE = app 15 | 16 | # The following define makes your compiler emit warnings if you use 17 | # any feature of Qt which has been marked as deprecated (the exact warnings 18 | # depend on your compiler). Please consult the documentation of the 19 | # deprecated API in order to know how to port your code away from it. 20 | DEFINES += QT_DEPRECATED_WARNINGS 21 | 22 | # You can also make your code fail to compile if you use deprecated APIs. 23 | # In order to do so, uncomment the following line. 24 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 25 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 26 | 27 | CONFIG += c++11 28 | 29 | SOURCES += \ 30 | main.cpp \ 31 | view/loginwidget.cpp \ 32 | model/usermodel.cpp \ 33 | model/singeldb.cpp \ 34 | controller/usercontrol.cpp \ 35 | view/registerwidget.cpp \ 36 | ffmpeg/encodetoh264.cpp \ 37 | view/beginwidget.cpp \ 38 | view/myitem.cpp \ 39 | view/setwidget.cpp \ 40 | view/main_monitorwidget.cpp \ 41 | model/setmodel.cpp \ 42 | controller/setcontrol.cpp \ 43 | view/main_widget.cpp \ 44 | view/main_replaywidget.cpp \ 45 | ffmpeg/decode.cpp \ 46 | model/videomodel.cpp \ 47 | controller/videocontrol.cpp \ 48 | controller/imagecontrol.cpp \ 49 | model/imagemodel.cpp \ 50 | view/play_widget.cpp \ 51 | ffmpeg/decode_replay.cpp \ 52 | ffmpeg/ftrancetomp4.cpp \ 53 | view/image_widegt.cpp 54 | 55 | 56 | HEADERS += \ 57 | view/loginwidget.h \ 58 | model/usermodel.h \ 59 | model/singeldb.h \ 60 | controller/usercontrol.h \ 61 | view/registerwidget.h \ 62 | ffmpeg/encodetoh264.h \ 63 | view/beginwidget.h \ 64 | view/myitem.h \ 65 | view/setwidget.h \ 66 | view/main_monitorwidget.h \ 67 | view/main_widget.h \ 68 | model/setmodel.h \ 69 | controller/setcontrol.h \ 70 | view/main_replaywidget.h \ 71 | ffmpeg/decode.h \ 72 | model/videomodel.h \ 73 | controller/videocontrol.h \ 74 | controller/imagecontrol.h \ 75 | model/imagemodel.h \ 76 | view/play_widget.h \ 77 | ffmpeg/decode_replay.h \ 78 | ffmpeg/ftrancetomp4.h \ 79 | view/image_widegt.h 80 | 81 | 82 | # Default rules for deployment. 83 | qnx: target.path = /tmp/$${TARGET}/bin 84 | else: unix:!android: target.path = /opt/$${TARGET}/bin 85 | !isEmpty(target.path): INSTALLS += target 86 | 87 | LIBS=$$PWD/lib/sqlite3.lib 88 | DESTDIR+=bin 89 | 90 | INCLUDEPATH += $$PWD/ffmpeglib/include 91 | LIBS += $$PWD/ffmpeglib/lib/avcodec.lib \ 92 | $$PWD/ffmpeglib/lib/avdevice.lib \ 93 | $$PWD/ffmpeglib/lib/avfilter.lib \ 94 | $$PWD/ffmpeglib/lib/avformat.lib \ 95 | $$PWD/ffmpeglib/lib/avutil.lib \ 96 | $$PWD/ffmpeglib/lib/swresample.lib \ 97 | $$PWD/ffmpeglib/lib/swscale.lib 98 | 99 | RESOURCES += \ 100 | image.qrc 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/bin/Security_Monitoring.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/Security_Monitoring.exe -------------------------------------------------------------------------------- /src/bin/avcodec-58.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/avcodec-58.dll -------------------------------------------------------------------------------- /src/bin/avdevice-58.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/avdevice-58.dll -------------------------------------------------------------------------------- /src/bin/avfilter-7.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/avfilter-7.dll -------------------------------------------------------------------------------- /src/bin/avformat-58.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/avformat-58.dll -------------------------------------------------------------------------------- /src/bin/avutil-56.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/avutil-56.dll -------------------------------------------------------------------------------- /src/bin/haha.yuv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/haha.yuv -------------------------------------------------------------------------------- /src/bin/postproc-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/postproc-55.dll -------------------------------------------------------------------------------- /src/bin/saveH264.h264: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/saveH264.h264 -------------------------------------------------------------------------------- /src/bin/saveYUV.yuv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/saveYUV.yuv -------------------------------------------------------------------------------- /src/bin/sqlite3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/sqlite3.dll -------------------------------------------------------------------------------- /src/bin/swresample-3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/swresample-3.dll -------------------------------------------------------------------------------- /src/bin/swscale-5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/swscale-5.dll -------------------------------------------------------------------------------- /src/bin/trance.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/bin/trance.mp4 -------------------------------------------------------------------------------- /src/controller/imagecontrol.cpp: -------------------------------------------------------------------------------- 1 | #include "imagecontrol.h" 2 | ImageControl *ImageControl::contorl=nullptr; 3 | ImageControl::ImageControl() 4 | { 5 | 6 | 7 | } 8 | 9 | //外部公共接口 获取control对象 10 | ImageControl *ImageControl::getInstance() 11 | { 12 | if(ImageControl::contorl=nullptr) 13 | { 14 | ImageControl::contorl=new ImageControl(); 15 | } 16 | return ImageControl::contorl; 17 | } 18 | 19 | //从control层添加图片路径到数据库----截图 20 | int ImageControl::addImagePath(QString video_name, QString cover_path) 21 | { 22 | return ImageModel::getInstance()->addImagePath(video_name,cover_path); 23 | } 24 | 25 | //从control层获取数据库中的图片路径----照片列表 26 | char **ImageControl::getImagePath(int num) 27 | { 28 | return ImageModel::getInstance()->getImagePath(num); 29 | } 30 | 31 | //从control层获取数据库中的图片路径-----照片放大 32 | char **ImageControl::getimage(QString name) 33 | { 34 | return ImageModel::getInstance()->getimage(name); 35 | } 36 | -------------------------------------------------------------------------------- /src/controller/imagecontrol.h: -------------------------------------------------------------------------------- 1 | #ifndef IMAGECONTROL_H 2 | #define IMAGECONTROL_H 3 | #include 4 | #include "model/imagemodel.h" 5 | class ImageControl 6 | { 7 | public: 8 | //外部公共接口 获取control对象 9 | static ImageControl *getInstance(); 10 | //从control层添加图片路径到数据库----截图 11 | int addImagePath(QString video_name, QString cover_path); 12 | //从control层获取数据库中的图片路径----照片列表 13 | char **getImagePath(int num); 14 | //从control层获取数据库中的图片路径----照片放大 15 | char **getimage(QString name); 16 | private: 17 | ImageControl();//构造私有化 18 | static ImageControl *contorl;//静态私成员变量 19 | }; 20 | 21 | #endif // IMAGECONTROL_H 22 | -------------------------------------------------------------------------------- /src/controller/setcontrol.cpp: -------------------------------------------------------------------------------- 1 | #include "setcontrol.h" 2 | SetControl *SetControl::contorl=nullptr; 3 | SetControl::SetControl() 4 | { 5 | } 6 | 7 | //外部公共接口 获取control对象 8 | SetControl *SetControl::getInstance() 9 | { 10 | if(SetControl::contorl=nullptr) 11 | { 12 | SetControl::contorl=new SetControl(); 13 | } 14 | return SetControl::contorl; 15 | } 16 | 17 | //第一次设置参数存储到数据库 18 | int SetControl::doSet(QString Video_path,QString Image_path,int framecount,QString cameraName) 19 | { 20 | return SetModel::getInstance()->addSetting(Video_path,Image_path,framecount,cameraName); 21 | } 22 | 23 | //获取视频路径 24 | QString SetControl::getSetting_videopath() 25 | { 26 | QString videopath; 27 | SetModel::getInstance()->getSetting_videopath(videopath); 28 | return videopath; 29 | } 30 | 31 | //获取设置信息图片路径 32 | QString SetControl::getSetting_imagepath() 33 | { 34 | QString imagepath; 35 | SetModel::getInstance()->getSetting_imagepath(imagepath); 36 | return imagepath; 37 | } 38 | 39 | //获取视频录制时长 40 | int SetControl::getSetting_interval() 41 | { 42 | 43 | return SetModel::getInstance()->getSetting_interval(); 44 | } 45 | 46 | //获取设置信息,用于判断是否有设置过 47 | int SetControl::getSetting() 48 | { 49 | return SetModel::getInstance()->getSetting(); 50 | } 51 | 52 | //更新设置信息 53 | int SetControl::updateSetting(QString Video_path, QString Image_path, int framecount, QString cameraName) 54 | { 55 | return SetModel::getInstance()->updateSetting(Video_path,Image_path,framecount,cameraName); 56 | } 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/controller/setcontrol.h: -------------------------------------------------------------------------------- 1 | #ifndef SETCONTROL_H 2 | #define SETCONTROL_H 3 | #include 4 | #include "model/setmodel.h" 5 | class SetControl 6 | { 7 | public: 8 | //外部公共接口 获取control对象 9 | static SetControl *getInstance(); 10 | //第一次设置参数存储到数据库 11 | int doSet(QString Video_path,QString Image_path,int framecount,QString cameraName); 12 | //获取设置信息视频保存路径 13 | QString getSetting_videopath(); 14 | //获取设置信息图片保存路径 15 | QString getSetting_imagepath(); 16 | //获取设置信息视频间隔 17 | int getSetting_interval(); 18 | //获取设置信息,用于判断是否有设置过 19 | int getSetting(); 20 | //更新设置信息 21 | int updateSetting(QString Video_path, QString Image_path, int framecount, QString cameraName); 22 | private: 23 | SetControl();//构造私有化 24 | static SetControl *contorl;//静态私成员变量 25 | }; 26 | 27 | #endif // SETCONTROL_H 28 | -------------------------------------------------------------------------------- /src/controller/usercontrol.cpp: -------------------------------------------------------------------------------- 1 | #include "usercontrol.h" 2 | UserControl *UserControl::contorl=nullptr; 3 | //外部公共接口 获取control对象 4 | UserControl *UserControl::getInstance() 5 | { 6 | if(UserControl::contorl=nullptr) 7 | { 8 | UserControl::contorl=new UserControl(); 9 | } 10 | return UserControl::contorl; 11 | } 12 | //登录验证,0表示验证成功,1表示验证失败 13 | int UserControl::doLogin(QString account, QString pwd) 14 | { 15 | return UserModel::getInstance()->getUserByNamePwd(account,pwd); 16 | } 17 | 18 | //注册 19 | int UserControl::doReister(QString account,QString user_name, QString pwd) 20 | { 21 | int res=UserModel::getInstance()->checkUserByNamePwd(account); 22 | //res为0说明用户存在 23 | if(res==1) 24 | { 25 | return UserModel::getInstance()->addUser(account,user_name,pwd); 26 | } 27 | //res为1说明用户不存在 28 | else 29 | { 30 | return -1; 31 | } 32 | } 33 | 34 | UserControl::UserControl() 35 | { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/controller/usercontrol.h: -------------------------------------------------------------------------------- 1 | #ifndef USERCONTROL_H 2 | #define USERCONTROL_H 3 | #include 4 | #include "model/usermodel.h" 5 | class UserControl 6 | { 7 | public: 8 | //外部公共接口 获取control对象 9 | static UserControl *getInstance(); 10 | //登录验证 11 | int doLogin(QString account,QString pwd); 12 | //注册 13 | int doReister(QString account,QString user_name, QString pwd); 14 | private: 15 | UserControl();//构造私有化 16 | static UserControl *contorl;//静态私成员变量 17 | }; 18 | 19 | #endif // USERCONTROL_H 20 | -------------------------------------------------------------------------------- /src/controller/videocontrol.cpp: -------------------------------------------------------------------------------- 1 | #include "videocontrol.h" 2 | VideoControl *VideoControl::contorl=nullptr; 3 | VideoControl::VideoControl() 4 | { 5 | 6 | } 7 | 8 | //外部公共接口 获取control对象 9 | VideoControl *VideoControl::getInstance() 10 | { 11 | if(VideoControl::contorl=nullptr) 12 | { 13 | VideoControl::contorl=new VideoControl(); 14 | } 15 | return VideoControl::contorl; 16 | 17 | } 18 | //从model层添加视频信息 19 | int VideoControl::addVideoPath(QString video_name, QString cover_path, QString video_path) 20 | { 21 | return VideoModel::getInstance()->addVideoPath(video_name,cover_path,video_path); 22 | } 23 | //从model层获取多个视频路径和视频名称---视频列表显示 24 | char **VideoControl::getVideoPath() 25 | { 26 | return VideoModel::getInstance()->getVideoPath(); 27 | } 28 | //从model层获取指定视频路径---视频播放 29 | char **VideoControl::getVideo(QString name) 30 | { 31 | return VideoModel::getInstance()->getVideo(name); 32 | } 33 | //从model层日历查询视频信息 34 | char **VideoControl::calendar_query(QString date) 35 | { 36 | return VideoModel::getInstance()->calendar_query(date); 37 | } 38 | 39 | //从model层获取最后一个视频路径 40 | char **VideoControl::getLastvideo() 41 | { 42 | return VideoModel::getInstance()->getLastvideo(); 43 | } 44 | -------------------------------------------------------------------------------- /src/controller/videocontrol.h: -------------------------------------------------------------------------------- 1 | #ifndef VIDEOCONTROL_H 2 | #define VIDEOCONTROL_H 3 | 4 | #include 5 | #include "model/videomodel.h" 6 | class VideoControl 7 | { 8 | public: 9 | //外部公共接口 获取control对象 10 | static VideoControl *getInstance(); 11 | //从model层添加图片信息 12 | int addVideoPath(QString video_name, QString cover_path, QString video_path); 13 | //从model层获取多个视频路径和视频名称---视频列表显示 14 | char **getVideoPath(); 15 | //从model层获取指定视频路径---视频播放 16 | char **getVideo(QString name); 17 | //从model层日历查询视频信息 18 | char **calendar_query(QString date); 19 | //从model层获取最后一个视频路径 20 | char **getLastvideo(); 21 | private: 22 | VideoControl();//构造私有化 23 | static VideoControl *contorl;//静态私成员变量 24 | 25 | }; 26 | 27 | #endif // VIDEOCONTROL_H 28 | -------------------------------------------------------------------------------- /src/data/video: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/data/video -------------------------------------------------------------------------------- /src/debug/decode2.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/debug/decode2.o -------------------------------------------------------------------------------- /src/debug/ftrancetodest.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/debug/ftrancetodest.o -------------------------------------------------------------------------------- /src/debug/moc_decode2.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/debug/moc_decode2.o -------------------------------------------------------------------------------- /src/ffmpeg/decode.h: -------------------------------------------------------------------------------- 1 | #ifndef DECODE_H 2 | #define DECODE_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "encodetoh264.h" 10 | 11 | extern "C" 12 | { 13 | #include "libavcodec/avcodec.h" //编解码 14 | #include "libavdevice/avdevice.h" //转码 15 | #include "libavfilter/avfilter.h" 16 | #include "libavformat/avformat.h" //格式 17 | #include "libavutil/avutil.h" //工具 18 | #include "libswresample/swresample.h" 19 | #include "libswscale/swscale.h" //转置 20 | } 21 | 22 | class Decode:public QThread 23 | { 24 | Q_OBJECT 25 | public: 26 | Decode(); 27 | //注册组件 28 | void registerFFmpeg(); 29 | //打开视频 30 | int open_camera(); 31 | 32 | int open_video(); 33 | //流媒体数据 34 | int find_stream(); 35 | //编解码器上下文结构体 36 | //找解码器 37 | int find_decoder(); 38 | void prepare_image(); 39 | //读取码流数据 40 | void decode_frame(); 41 | 42 | static QList getcamera(); 43 | 44 | private: 45 | AVFormatContext *pformatContext; //封装格式上下文结构体 46 | AVCodecContext *codec; 47 | AVCodec *decoder; 48 | 49 | AVPacket *pkt; 50 | AVFrame *yuvpicture, *picture,*rgbpicture; //picture有损像素数据 yuvpicture去除有损数据的像素数据 51 | SwsContext *swscontentRGB,*swscontentYUV; 52 | uint8_t *bufferRGB,*bufferYUV; 53 | QImage img; 54 | int videoIndex; 55 | int count; 56 | int interval; 57 | EncodeToH264 *encodeObj; 58 | QString image_name; 59 | protected: 60 | void run(); 61 | signals: 62 | void sendImg(QImage img); 63 | }; 64 | 65 | #endif // DECODETOH264_H 66 | -------------------------------------------------------------------------------- /src/ffmpeg/decode_replay.h: -------------------------------------------------------------------------------- 1 | #ifndef DECODE_REPLAY_H 2 | #define DECODE_REPLAY_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "controller/setcontrol.h" 10 | #include "controller/imagecontrol.h" 11 | extern "C" 12 | { 13 | #include "libavcodec/avcodec.h" //编解码 14 | #include "libavdevice/avdevice.h" //转码 15 | #include "libavfilter/avfilter.h" 16 | #include "libavformat/avformat.h" //格式 17 | #include "libavutil/avutil.h" //工具 18 | #include "libswresample/swresample.h" 19 | #include "libswscale/swscale.h" //转置 20 | } 21 | class Decode_Replay:public QThread 22 | { 23 | Q_OBJECT 24 | public: 25 | Decode_Replay(QString path); 26 | ~Decode_Replay(); 27 | 28 | //注册组件 29 | void registerFFmpeg(); 30 | //打开视频 31 | int open_video(); 32 | //流媒体数据 33 | int find_stream(); 34 | //编解码器上下文结构体 35 | //找解码器 36 | int find_decoder(); 37 | //准备图片帧 38 | void prepare_image(); 39 | //读取码流数据 40 | void decode_frame(); 41 | 42 | static QString replay_path; 43 | 44 | int status; 45 | int screenshots_mark; 46 | 47 | private: 48 | AVFormatContext *pformatContext; //封装格式上下文结构体 49 | AVCodecContext *codec; 50 | AVCodec *decoder; 51 | 52 | AVPacket *pkt; 53 | AVFrame *picture,*rgbpicture; //picture有损像素数据 yuvpicture去除有损数据的像素数据 54 | SwsContext *swscontentRGB; 55 | uint8_t *bufferRGB; 56 | QImage img; 57 | int play_speed; 58 | int videoIndex; 59 | QString getTime(); 60 | 61 | protected: 62 | void run(); 63 | signals: 64 | void sendImg2(QImage img); 65 | public slots: 66 | void setSpeed(QString speed); 67 | }; 68 | 69 | #endif // DECODE_REPLAY_H 70 | -------------------------------------------------------------------------------- /src/ffmpeg/encodetoh264.h: -------------------------------------------------------------------------------- 1 | #ifndef ENCODETOH264_H 2 | #define ENCODETOH264_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "controller/setcontrol.h" 9 | #include "controller/videocontrol.h" 10 | extern "C" 11 | { 12 | #include "libavcodec/avcodec.h" //编解码 13 | #include "libavdevice/avdevice.h" //转码 14 | #include "libavfilter/avfilter.h" 15 | #include "libavformat/avformat.h" //格式 16 | #include "libavutil/avutil.h" //工具 17 | #include "libswresample/swresample.h" 18 | #include "libswscale/swscale.h" //转置 19 | } 20 | 21 | class EncodeToH264:public QThread 22 | { 23 | 24 | public: 25 | EncodeToH264(); 26 | //注册组件 27 | void registerEncode(); 28 | void guess_format(int width,int height); 29 | void encode_frame(AVFrame *yuvpicture); 30 | void writeTailer(); 31 | 32 | void getHeightWidth(int width,int height); 33 | void getName(QString name); 34 | static int frame_count; 35 | //队列 36 | static QQueue Queue_AVFrame; 37 | QString getTime(); 38 | QString path; 39 | QString video_path; 40 | static QString name; 41 | static int width; 42 | static int height; 43 | 44 | 45 | AVCodec *encoder; 46 | AVOutputFormat *outformat; 47 | AVStream *newStream; 48 | private: 49 | AVCodecContext *codecContext; 50 | AVFormatContext *pformatContext; 51 | AVPacket *pkt; 52 | int pkt_index; 53 | int interval; 54 | void run(); 55 | }; 56 | 57 | #endif // ENCODETOH264_H 58 | -------------------------------------------------------------------------------- /src/ffmpeg/ftrancetodest.h.autosave: -------------------------------------------------------------------------------- 1 | #ifndef FTRANCETODEST_H 2 | #define FTRANCETODEST_H 3 | #include 4 | #include 5 | #include 6 | #include "controller/setcontrol.h" 7 | extern "C" 8 | { 9 | #include "libavcodec/avcodec.h" //编解码 10 | #include "libavdevice/avdevice.h" //转码 11 | #include "libavfilter/avfilter.h" 12 | #include "libavformat/avformat.h" //格式 13 | #include "libavutil/avutil.h" //工具 14 | #include "libswresample/swresample.h" 15 | #include "libswscale/swscale.h" //转置 16 | } 17 | 18 | class FTranceToDest 19 | { 20 | public: 21 | FTranceToDest(QString path); 22 | void openH264File(QString file); 23 | void coverTomp4(); 24 | QString getTime(); 25 | 26 | private: 27 | AVFormatContext *pFormatContext,*outFormatContext;//输出的封装格式上下文结构体 28 | AVCodecContext *codecContenct; 29 | AVPacket *pkt; 30 | AVOutputFormat *outformat; 31 | int videoIndex,frameCount; 32 | AVStream *newStream; 33 | }; 34 | 35 | #endif // FTRANCETODEST_H 36 | -------------------------------------------------------------------------------- /src/ffmpeg/ftrancetomp4.h: -------------------------------------------------------------------------------- 1 | #ifndef FTRANCETOMP4_H 2 | #define FTRANCETOMP4_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "controller/setcontrol.h" 10 | extern "C" 11 | { 12 | #include "libavcodec/avcodec.h" //编解码 13 | #include "libavdevice/avdevice.h" //转码 14 | #include "libavfilter/avfilter.h" 15 | #include "libavformat/avformat.h" //格式 16 | #include "libavutil/avutil.h" //工具 17 | #include "libswresample/swresample.h" 18 | #include "libswscale/swscale.h" //转置 19 | } 20 | 21 | class FTranceTomp4 : public QThread 22 | { 23 | 24 | public: 25 | FTranceTomp4(); 26 | void openH264File(QString file); 27 | void coverTomp4(); 28 | QString getTime(); 29 | 30 | private: 31 | AVFormatContext *pFormatContext,*outFormatContext;//输出的封装格式上下文结构体 32 | AVPacket *pkt; 33 | AVOutputFormat *outformat; 34 | int videoIndex,frameCount; 35 | AVStream *newStream; 36 | 37 | }; 38 | 39 | #endif // FTRANCETODEST_H 40 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavcodec/avfft.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_AVFFT_H 20 | #define AVCODEC_AVFFT_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavc_fft 25 | * FFT functions 26 | */ 27 | 28 | /** 29 | * @defgroup lavc_fft FFT functions 30 | * @ingroup lavc_misc 31 | * 32 | * @{ 33 | */ 34 | 35 | typedef float FFTSample; 36 | 37 | typedef struct FFTComplex { 38 | FFTSample re, im; 39 | } FFTComplex; 40 | 41 | typedef struct FFTContext FFTContext; 42 | 43 | /** 44 | * Set up a complex FFT. 45 | * @param nbits log2 of the length of the input array 46 | * @param inverse if 0 perform the forward transform, if 1 perform the inverse 47 | */ 48 | FFTContext *av_fft_init(int nbits, int inverse); 49 | 50 | /** 51 | * Do the permutation needed BEFORE calling ff_fft_calc(). 52 | */ 53 | void av_fft_permute(FFTContext *s, FFTComplex *z); 54 | 55 | /** 56 | * Do a complex FFT with the parameters defined in av_fft_init(). The 57 | * input data must be permuted before. No 1.0/sqrt(n) normalization is done. 58 | */ 59 | void av_fft_calc(FFTContext *s, FFTComplex *z); 60 | 61 | void av_fft_end(FFTContext *s); 62 | 63 | FFTContext *av_mdct_init(int nbits, int inverse, double scale); 64 | void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); 65 | void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); 66 | void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); 67 | void av_mdct_end(FFTContext *s); 68 | 69 | /* Real Discrete Fourier Transform */ 70 | 71 | enum RDFTransformType { 72 | DFT_R2C, 73 | IDFT_C2R, 74 | IDFT_R2C, 75 | DFT_C2R, 76 | }; 77 | 78 | typedef struct RDFTContext RDFTContext; 79 | 80 | /** 81 | * Set up a real FFT. 82 | * @param nbits log2 of the length of the input array 83 | * @param trans the type of transform 84 | */ 85 | RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); 86 | void av_rdft_calc(RDFTContext *s, FFTSample *data); 87 | void av_rdft_end(RDFTContext *s); 88 | 89 | /* Discrete Cosine Transform */ 90 | 91 | typedef struct DCTContext DCTContext; 92 | 93 | enum DCTTransformType { 94 | DCT_II = 0, 95 | DCT_III, 96 | DCT_I, 97 | DST_I, 98 | }; 99 | 100 | /** 101 | * Set up DCT. 102 | * 103 | * @param nbits size of the input array: 104 | * (1 << nbits) for DCT-II, DCT-III and DST-I 105 | * (1 << nbits) + 1 for DCT-I 106 | * @param type the type of transform 107 | * 108 | * @note the first element of the input of DST-I is ignored 109 | */ 110 | DCTContext *av_dct_init(int nbits, enum DCTTransformType type); 111 | void av_dct_calc(DCTContext *s, FFTSample *data); 112 | void av_dct_end (DCTContext *s); 113 | 114 | /** 115 | * @} 116 | */ 117 | 118 | #endif /* AVCODEC_AVFFT_H */ 119 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavcodec/d3d11va.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Direct3D11 HW acceleration 3 | * 4 | * copyright (c) 2009 Laurent Aimar 5 | * copyright (c) 2015 Steve Lhomme 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_D3D11VA_H 25 | #define AVCODEC_D3D11VA_H 26 | 27 | /** 28 | * @file 29 | * @ingroup lavc_codec_hwaccel_d3d11va 30 | * Public libavcodec D3D11VA header. 31 | */ 32 | 33 | #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602 34 | #undef _WIN32_WINNT 35 | #define _WIN32_WINNT 0x0602 36 | #endif 37 | 38 | #include 39 | #include 40 | 41 | /** 42 | * @defgroup lavc_codec_hwaccel_d3d11va Direct3D11 43 | * @ingroup lavc_codec_hwaccel 44 | * 45 | * @{ 46 | */ 47 | 48 | #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for Direct3D11 and old UVD/UVD+ ATI video cards 49 | #define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for Direct3D11 and old Intel GPUs with ClearVideo interface 50 | 51 | /** 52 | * This structure is used to provides the necessary configurations and data 53 | * to the Direct3D11 FFmpeg HWAccel implementation. 54 | * 55 | * The application must make it available as AVCodecContext.hwaccel_context. 56 | * 57 | * Use av_d3d11va_alloc_context() exclusively to allocate an AVD3D11VAContext. 58 | */ 59 | typedef struct AVD3D11VAContext { 60 | /** 61 | * D3D11 decoder object 62 | */ 63 | ID3D11VideoDecoder *decoder; 64 | 65 | /** 66 | * D3D11 VideoContext 67 | */ 68 | ID3D11VideoContext *video_context; 69 | 70 | /** 71 | * D3D11 configuration used to create the decoder 72 | */ 73 | D3D11_VIDEO_DECODER_CONFIG *cfg; 74 | 75 | /** 76 | * The number of surface in the surface array 77 | */ 78 | unsigned surface_count; 79 | 80 | /** 81 | * The array of Direct3D surfaces used to create the decoder 82 | */ 83 | ID3D11VideoDecoderOutputView **surface; 84 | 85 | /** 86 | * A bit field configuring the workarounds needed for using the decoder 87 | */ 88 | uint64_t workaround; 89 | 90 | /** 91 | * Private to the FFmpeg AVHWAccel implementation 92 | */ 93 | unsigned report_id; 94 | 95 | /** 96 | * Mutex to access video_context 97 | */ 98 | HANDLE context_mutex; 99 | } AVD3D11VAContext; 100 | 101 | /** 102 | * Allocate an AVD3D11VAContext. 103 | * 104 | * @return Newly-allocated AVD3D11VAContext or NULL on failure. 105 | */ 106 | AVD3D11VAContext *av_d3d11va_alloc_context(void); 107 | 108 | /** 109 | * @} 110 | */ 111 | 112 | #endif /* AVCODEC_D3D11VA_H */ 113 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavcodec/dv_profile.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_DV_PROFILE_H 20 | #define AVCODEC_DV_PROFILE_H 21 | 22 | #include 23 | 24 | #include "libavutil/pixfmt.h" 25 | #include "libavutil/rational.h" 26 | #include "avcodec.h" 27 | 28 | /* minimum number of bytes to read from a DV stream in order to 29 | * determine the profile */ 30 | #define DV_PROFILE_BYTES (6 * 80) /* 6 DIF blocks */ 31 | 32 | 33 | /* 34 | * AVDVProfile is used to express the differences between various 35 | * DV flavors. For now it's primarily used for differentiating 36 | * 525/60 and 625/50, but the plans are to use it for various 37 | * DV specs as well (e.g. SMPTE314M vs. IEC 61834). 38 | */ 39 | typedef struct AVDVProfile { 40 | int dsf; /* value of the dsf in the DV header */ 41 | int video_stype; /* stype for VAUX source pack */ 42 | int frame_size; /* total size of one frame in bytes */ 43 | int difseg_size; /* number of DIF segments per DIF channel */ 44 | int n_difchan; /* number of DIF channels per frame */ 45 | AVRational time_base; /* 1/framerate */ 46 | int ltc_divisor; /* FPS from the LTS standpoint */ 47 | int height; /* picture height in pixels */ 48 | int width; /* picture width in pixels */ 49 | AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */ 50 | enum AVPixelFormat pix_fmt; /* picture pixel format */ 51 | int bpm; /* blocks per macroblock */ 52 | const uint8_t *block_sizes; /* AC block sizes, in bits */ 53 | int audio_stride; /* size of audio_shuffle table */ 54 | int audio_min_samples[3]; /* min amount of audio samples */ 55 | /* for 48kHz, 44.1kHz and 32kHz */ 56 | int audio_samples_dist[5]; /* how many samples are supposed to be */ 57 | /* in each frame in a 5 frames window */ 58 | const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */ 59 | } AVDVProfile; 60 | 61 | /** 62 | * Get a DV profile for the provided compressed frame. 63 | * 64 | * @param sys the profile used for the previous frame, may be NULL 65 | * @param frame the compressed data buffer 66 | * @param buf_size size of the buffer in bytes 67 | * @return the DV profile for the supplied data or NULL on failure 68 | */ 69 | const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys, 70 | const uint8_t *frame, unsigned buf_size); 71 | 72 | /** 73 | * Get a DV profile for the provided stream parameters. 74 | */ 75 | const AVDVProfile *av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt); 76 | 77 | /** 78 | * Get a DV profile for the provided stream parameters. 79 | * The frame rate is used as a best-effort parameter. 80 | */ 81 | const AVDVProfile *av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate); 82 | 83 | #endif /* AVCODEC_DV_PROFILE_H */ 84 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavcodec/mediacodec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Android MediaCodec public API 3 | * 4 | * Copyright (c) 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_MEDIACODEC_H 24 | #define AVCODEC_MEDIACODEC_H 25 | 26 | #include "libavcodec/avcodec.h" 27 | 28 | /** 29 | * This structure holds a reference to a android/view/Surface object that will 30 | * be used as output by the decoder. 31 | * 32 | */ 33 | typedef struct AVMediaCodecContext { 34 | 35 | /** 36 | * android/view/Surface object reference. 37 | */ 38 | void *surface; 39 | 40 | } AVMediaCodecContext; 41 | 42 | /** 43 | * Allocate and initialize a MediaCodec context. 44 | * 45 | * When decoding with MediaCodec is finished, the caller must free the 46 | * MediaCodec context with av_mediacodec_default_free. 47 | * 48 | * @return a pointer to a newly allocated AVMediaCodecContext on success, NULL otherwise 49 | */ 50 | AVMediaCodecContext *av_mediacodec_alloc_context(void); 51 | 52 | /** 53 | * Convenience function that sets up the MediaCodec context. 54 | * 55 | * @param avctx codec context 56 | * @param ctx MediaCodec context to initialize 57 | * @param surface reference to an android/view/Surface 58 | * @return 0 on success, < 0 otherwise 59 | */ 60 | int av_mediacodec_default_init(AVCodecContext *avctx, AVMediaCodecContext *ctx, void *surface); 61 | 62 | /** 63 | * This function must be called to free the MediaCodec context initialized with 64 | * av_mediacodec_default_init(). 65 | * 66 | * @param avctx codec context 67 | */ 68 | void av_mediacodec_default_free(AVCodecContext *avctx); 69 | 70 | /** 71 | * Opaque structure representing a MediaCodec buffer to render. 72 | */ 73 | typedef struct MediaCodecBuffer AVMediaCodecBuffer; 74 | 75 | /** 76 | * Release a MediaCodec buffer and render it to the surface that is associated 77 | * with the decoder. This function should only be called once on a given 78 | * buffer, once released the underlying buffer returns to the codec, thus 79 | * subsequent calls to this function will have no effect. 80 | * 81 | * @param buffer the buffer to render 82 | * @param render 1 to release and render the buffer to the surface or 0 to 83 | * discard the buffer 84 | * @return 0 on success, < 0 otherwise 85 | */ 86 | int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render); 87 | 88 | /** 89 | * Release a MediaCodec buffer and render it at the given time to the surface 90 | * that is associated with the decoder. The timestamp must be within one second 91 | * of the current java/lang/System#nanoTime() (which is implemented using 92 | * CLOCK_MONOTONIC on Android). See the Android MediaCodec documentation 93 | * of android/media/MediaCodec#releaseOutputBuffer(int,long) for more details. 94 | * 95 | * @param buffer the buffer to render 96 | * @param time timestamp in nanoseconds of when to render the buffer 97 | * @return 0 on success, < 0 otherwise 98 | */ 99 | int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time); 100 | 101 | #endif /* AVCODEC_MEDIACODEC_H */ 102 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 9 32 | #define LIBAVDEVICE_VERSION_MICRO 103 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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 77 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_SWS_PARAM_OPTION 63 | #define FF_API_SWS_PARAM_OPTION (LIBAVFILTER_VERSION_MAJOR < 8) 64 | #endif 65 | #ifndef FF_API_NEXT 66 | #define FF_API_NEXT (LIBAVFILTER_VERSION_MAJOR < 8) 67 | #endif 68 | 69 | #endif /* AVFILTER_VERSION_H */ 70 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavutil/bswap.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 | * byte swapping routines 24 | */ 25 | 26 | #ifndef AVUTIL_BSWAP_H 27 | #define AVUTIL_BSWAP_H 28 | 29 | #include 30 | #include "libavutil/avconfig.h" 31 | #include "attributes.h" 32 | 33 | #ifdef HAVE_AV_CONFIG_H 34 | 35 | #include "config.h" 36 | 37 | #if ARCH_AARCH64 38 | # include "aarch64/bswap.h" 39 | #elif ARCH_ARM 40 | # include "arm/bswap.h" 41 | #elif ARCH_AVR32 42 | # include "avr32/bswap.h" 43 | #elif ARCH_SH4 44 | # include "sh4/bswap.h" 45 | #elif ARCH_X86 46 | # include "x86/bswap.h" 47 | #endif 48 | 49 | #endif /* HAVE_AV_CONFIG_H */ 50 | 51 | #define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff)) 52 | #define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16)) 53 | #define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32)) 54 | 55 | #define AV_BSWAPC(s, x) AV_BSWAP##s##C(x) 56 | 57 | #ifndef av_bswap16 58 | static av_always_inline av_const uint16_t av_bswap16(uint16_t x) 59 | { 60 | x= (x>>8) | (x<<8); 61 | return x; 62 | } 63 | #endif 64 | 65 | #ifndef av_bswap32 66 | static av_always_inline av_const uint32_t av_bswap32(uint32_t x) 67 | { 68 | return AV_BSWAP32C(x); 69 | } 70 | #endif 71 | 72 | #ifndef av_bswap64 73 | static inline uint64_t av_const av_bswap64(uint64_t x) 74 | { 75 | return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32); 76 | } 77 | #endif 78 | 79 | // be2ne ... big-endian to native-endian 80 | // le2ne ... little-endian to native-endian 81 | 82 | #if AV_HAVE_BIGENDIAN 83 | #define av_be2ne16(x) (x) 84 | #define av_be2ne32(x) (x) 85 | #define av_be2ne64(x) (x) 86 | #define av_le2ne16(x) av_bswap16(x) 87 | #define av_le2ne32(x) av_bswap32(x) 88 | #define av_le2ne64(x) av_bswap64(x) 89 | #define AV_BE2NEC(s, x) (x) 90 | #define AV_LE2NEC(s, x) AV_BSWAPC(s, x) 91 | #else 92 | #define av_be2ne16(x) av_bswap16(x) 93 | #define av_be2ne32(x) av_bswap32(x) 94 | #define av_be2ne64(x) av_bswap64(x) 95 | #define av_le2ne16(x) (x) 96 | #define av_le2ne32(x) (x) 97 | #define av_le2ne64(x) (x) 98 | #define AV_BE2NEC(s, x) AV_BSWAPC(s, x) 99 | #define AV_LE2NEC(s, x) (x) 100 | #endif 101 | 102 | #define AV_BE2NE16C(x) AV_BE2NEC(16, x) 103 | #define AV_BE2NE32C(x) AV_BE2NEC(32, x) 104 | #define AV_BE2NE64C(x) AV_BE2NEC(64, x) 105 | #define AV_LE2NE16C(x) AV_LE2NEC(16, x) 106 | #define AV_LE2NE32C(x) AV_LE2NEC(32, x) 107 | #define AV_LE2NE64C(x) AV_LE2NEC(64, x) 108 | 109 | #endif /* AVUTIL_BSWAP_H */ 110 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavutil/crc.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_crc32 24 | * Public header for CRC hash function implementation. 25 | */ 26 | 27 | #ifndef AVUTIL_CRC_H 28 | #define AVUTIL_CRC_H 29 | 30 | #include 31 | #include 32 | #include "attributes.h" 33 | #include "version.h" 34 | 35 | /** 36 | * @defgroup lavu_crc32 CRC 37 | * @ingroup lavu_hash 38 | * CRC (Cyclic Redundancy Check) hash function implementation. 39 | * 40 | * This module supports numerous CRC polynomials, in addition to the most 41 | * widely used CRC-32-IEEE. See @ref AVCRCId for a list of available 42 | * polynomials. 43 | * 44 | * @{ 45 | */ 46 | 47 | typedef uint32_t AVCRC; 48 | 49 | typedef enum { 50 | AV_CRC_8_ATM, 51 | AV_CRC_16_ANSI, 52 | AV_CRC_16_CCITT, 53 | AV_CRC_32_IEEE, 54 | AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */ 55 | AV_CRC_16_ANSI_LE, /*< reversed bitorder version of AV_CRC_16_ANSI */ 56 | AV_CRC_24_IEEE, 57 | AV_CRC_8_EBU, 58 | AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */ 59 | }AVCRCId; 60 | 61 | /** 62 | * Initialize a CRC table. 63 | * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024 64 | * @param le If 1, the lowest bit represents the coefficient for the highest 65 | * exponent of the corresponding polynomial (both for poly and 66 | * actual CRC). 67 | * If 0, you must swap the CRC parameter and the result of av_crc 68 | * if you need the standard representation (can be simplified in 69 | * most cases to e.g. bswap16): 70 | * av_bswap32(crc << (32-bits)) 71 | * @param bits number of bits for the CRC 72 | * @param poly generator polynomial without the x**bits coefficient, in the 73 | * representation as specified by le 74 | * @param ctx_size size of ctx in bytes 75 | * @return <0 on failure 76 | */ 77 | int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size); 78 | 79 | /** 80 | * Get an initialized standard CRC table. 81 | * @param crc_id ID of a standard CRC 82 | * @return a pointer to the CRC table or NULL on failure 83 | */ 84 | const AVCRC *av_crc_get_table(AVCRCId crc_id); 85 | 86 | /** 87 | * Calculate the CRC of a block. 88 | * @param crc CRC of previous blocks if any or initial value for CRC 89 | * @return CRC updated with the data from the given block 90 | * 91 | * @see av_crc_init() "le" parameter 92 | */ 93 | uint32_t av_crc(const AVCRC *ctx, uint32_t crc, 94 | const uint8_t *buffer, size_t length) av_pure; 95 | 96 | /** 97 | * @} 98 | */ 99 | 100 | #endif /* AVUTIL_CRC_H */ 101 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavutil/downmix_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Tim Walker 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_DOWNMIX_INFO_H 22 | #define AVUTIL_DOWNMIX_INFO_H 23 | 24 | #include "frame.h" 25 | 26 | /** 27 | * @file 28 | * audio downmix medatata 29 | */ 30 | 31 | /** 32 | * @addtogroup lavu_audio 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @defgroup downmix_info Audio downmix metadata 38 | * @{ 39 | */ 40 | 41 | /** 42 | * Possible downmix types. 43 | */ 44 | enum AVDownmixType { 45 | AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */ 46 | AV_DOWNMIX_TYPE_LORO, /**< Lo/Ro 2-channel downmix (Stereo). */ 47 | AV_DOWNMIX_TYPE_LTRT, /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */ 48 | AV_DOWNMIX_TYPE_DPLII, /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */ 49 | AV_DOWNMIX_TYPE_NB /**< Number of downmix types. Not part of ABI. */ 50 | }; 51 | 52 | /** 53 | * This structure describes optional metadata relevant to a downmix procedure. 54 | * 55 | * All fields are set by the decoder to the value indicated in the audio 56 | * bitstream (if present), or to a "sane" default otherwise. 57 | */ 58 | typedef struct AVDownmixInfo { 59 | /** 60 | * Type of downmix preferred by the mastering engineer. 61 | */ 62 | enum AVDownmixType preferred_downmix_type; 63 | 64 | /** 65 | * Absolute scale factor representing the nominal level of the center 66 | * channel during a regular downmix. 67 | */ 68 | double center_mix_level; 69 | 70 | /** 71 | * Absolute scale factor representing the nominal level of the center 72 | * channel during an Lt/Rt compatible downmix. 73 | */ 74 | double center_mix_level_ltrt; 75 | 76 | /** 77 | * Absolute scale factor representing the nominal level of the surround 78 | * channels during a regular downmix. 79 | */ 80 | double surround_mix_level; 81 | 82 | /** 83 | * Absolute scale factor representing the nominal level of the surround 84 | * channels during an Lt/Rt compatible downmix. 85 | */ 86 | double surround_mix_level_ltrt; 87 | 88 | /** 89 | * Absolute scale factor representing the level at which the LFE data is 90 | * mixed into L/R channels during downmixing. 91 | */ 92 | double lfe_mix_level; 93 | } AVDownmixInfo; 94 | 95 | /** 96 | * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing. 97 | * 98 | * If the side data is absent, it is created and added to the frame. 99 | * 100 | * @param frame the frame for which the side data is to be obtained or created 101 | * 102 | * @return the AVDownmixInfo structure to be edited by the caller, or NULL if 103 | * the structure cannot be allocated. 104 | */ 105 | AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame); 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /** 112 | * @} 113 | */ 114 | 115 | #endif /* AVUTIL_DOWNMIX_INFO_H */ 116 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 "git-2020-03-06-cfd9a65" 5 | #endif /* AVUTIL_FFVERSION_H */ 6 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavutil/hmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Martin Storsjo 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_HMAC_H 22 | #define AVUTIL_HMAC_H 23 | 24 | #include 25 | 26 | #include "version.h" 27 | /** 28 | * @defgroup lavu_hmac HMAC 29 | * @ingroup lavu_crypto 30 | * @{ 31 | */ 32 | 33 | enum AVHMACType { 34 | AV_HMAC_MD5, 35 | AV_HMAC_SHA1, 36 | AV_HMAC_SHA224, 37 | AV_HMAC_SHA256, 38 | AV_HMAC_SHA384, 39 | AV_HMAC_SHA512, 40 | }; 41 | 42 | typedef struct AVHMAC AVHMAC; 43 | 44 | /** 45 | * Allocate an AVHMAC context. 46 | * @param type The hash function used for the HMAC. 47 | */ 48 | AVHMAC *av_hmac_alloc(enum AVHMACType type); 49 | 50 | /** 51 | * Free an AVHMAC context. 52 | * @param ctx The context to free, may be NULL 53 | */ 54 | void av_hmac_free(AVHMAC *ctx); 55 | 56 | /** 57 | * Initialize an AVHMAC context with an authentication key. 58 | * @param ctx The HMAC context 59 | * @param key The authentication key 60 | * @param keylen The length of the key, in bytes 61 | */ 62 | void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen); 63 | 64 | /** 65 | * Hash data with the HMAC. 66 | * @param ctx The HMAC context 67 | * @param data The data to hash 68 | * @param len The length of the data, in bytes 69 | */ 70 | void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len); 71 | 72 | /** 73 | * Finish hashing and output the HMAC digest. 74 | * @param ctx The HMAC context 75 | * @param out The output buffer to write the digest into 76 | * @param outlen The length of the out buffer, in bytes 77 | * @return The number of bytes written to out, or a negative error code. 78 | */ 79 | int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen); 80 | 81 | /** 82 | * Hash an array of data with a key. 83 | * @param ctx The HMAC context 84 | * @param data The data to hash 85 | * @param len The length of the data, in bytes 86 | * @param key The authentication key 87 | * @param keylen The length of the key, in bytes 88 | * @param out The output buffer to write the digest into 89 | * @param outlen The length of the out buffer, in bytes 90 | * @return The number of bytes written to out, or a negative error code. 91 | */ 92 | int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len, 93 | const uint8_t *key, unsigned int keylen, 94 | uint8_t *out, unsigned int outlen); 95 | 96 | /** 97 | * @} 98 | */ 99 | 100 | #endif /* AVUTIL_HMAC_H */ 101 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | /** 53 | * @defgroup hwcontext_cuda Device context creation flags 54 | * 55 | * Flags for av_hwdevice_ctx_create. 56 | * 57 | * @{ 58 | */ 59 | 60 | /** 61 | * Use primary device context instead of creating a new one. 62 | */ 63 | #define AV_CUDA_USE_PRIMARY_CONTEXT (1 << 0) 64 | 65 | /** 66 | * @} 67 | */ 68 | 69 | #endif /* AVUTIL_HWCONTEXT_CUDA_H */ 70 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | /** 55 | * Same as av_map_videotoolbox_format_from_pixfmt function, but can map and 56 | * return full range pixel formats via a flag. 57 | */ 58 | uint32_t av_map_videotoolbox_format_from_pixfmt2(enum AVPixelFormat pix_fmt, bool full_range); 59 | 60 | #endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */ 61 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavutil/tx.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_TX_H 20 | #define AVUTIL_TX_H 21 | 22 | #include 23 | #include 24 | 25 | typedef struct AVTXContext AVTXContext; 26 | 27 | typedef struct AVComplexFloat { 28 | float re, im; 29 | } AVComplexFloat; 30 | 31 | typedef struct AVComplexDouble { 32 | double re, im; 33 | } AVComplexDouble; 34 | 35 | typedef struct AVComplexInt32 { 36 | int32_t re, im; 37 | } AVComplexInt32; 38 | 39 | enum AVTXType { 40 | /** 41 | * Standard complex to complex FFT with sample data type AVComplexFloat. 42 | * Output is not 1/len normalized. Scaling currently unsupported. 43 | */ 44 | AV_TX_FLOAT_FFT = 0, 45 | /** 46 | * Standard MDCT with sample data type of float and a scale type of 47 | * float. Length is the frame size, not the window size (which is 2x frame) 48 | */ 49 | AV_TX_FLOAT_MDCT = 1, 50 | /** 51 | * Same as AV_TX_FLOAT_FFT with a data type of AVComplexDouble. 52 | */ 53 | AV_TX_DOUBLE_FFT = 2, 54 | /** 55 | * Same as AV_TX_FLOAT_MDCT with data and scale type of double. 56 | */ 57 | AV_TX_DOUBLE_MDCT = 3, 58 | /** 59 | * Same as AV_TX_FLOAT_FFT with a data type of AVComplexInt32. 60 | */ 61 | AV_TX_INT32_FFT = 4, 62 | /** 63 | * Same as AV_TX_FLOAT_MDCT with data type of int32_t and scale type of float. 64 | * Only scale values less than or equal to 1.0 are supported. 65 | */ 66 | AV_TX_INT32_MDCT = 5, 67 | }; 68 | 69 | /** 70 | * Function pointer to a function to perform the transform. 71 | * 72 | * @note Using a different context than the one allocated during av_tx_init() 73 | * is not allowed. 74 | * 75 | * @param s the transform context 76 | * @param out the output array 77 | * @param in the input array 78 | * @param stride the input or output stride (depending on transform direction) 79 | * in bytes, currently implemented for all MDCT transforms 80 | */ 81 | typedef void (*av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride); 82 | 83 | /** 84 | * Initialize a transform context with the given configuration 85 | * Currently power of two lengths from 4 to 131072 are supported, along with 86 | * any length decomposable to a power of two and either 3, 5 or 15. 87 | * 88 | * @param ctx the context to allocate, will be NULL on error 89 | * @param tx pointer to the transform function pointer to set 90 | * @param type type the type of transform 91 | * @param inv whether to do an inverse or a forward transform 92 | * @param len the size of the transform in samples 93 | * @param scale pointer to the value to scale the output if supported by type 94 | * @param flags currently unused 95 | * 96 | * @return 0 on success, negative error code on failure 97 | */ 98 | int av_tx_init(AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type, 99 | int inv, int len, const void *scale, uint64_t flags); 100 | 101 | /** 102 | * Frees a context and sets ctx to NULL, does nothing when ctx == NULL 103 | */ 104 | void av_tx_uninit(AVTXContext **ctx); 105 | 106 | #endif /* AVUTIL_TX_H */ 107 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libavutil/xtea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A 32-bit implementation of the XTEA 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_XTEA_H 23 | #define AVUTIL_XTEA_H 24 | 25 | #include 26 | 27 | /** 28 | * @file 29 | * @brief Public header for libavutil XTEA algorithm 30 | * @defgroup lavu_xtea XTEA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | typedef struct AVXTEA { 36 | uint32_t key[16]; 37 | } AVXTEA; 38 | 39 | /** 40 | * Allocate an AVXTEA context. 41 | */ 42 | AVXTEA *av_xtea_alloc(void); 43 | 44 | /** 45 | * Initialize an AVXTEA context. 46 | * 47 | * @param ctx an AVXTEA context 48 | * @param key a key of 16 bytes used for encryption/decryption, 49 | * interpreted as big endian 32 bit numbers 50 | */ 51 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); 52 | 53 | /** 54 | * Initialize an AVXTEA context. 55 | * 56 | * @param ctx an AVXTEA context 57 | * @param key a key of 16 bytes used for encryption/decryption, 58 | * interpreted as little endian 32 bit numbers 59 | */ 60 | void av_xtea_le_init(struct AVXTEA *ctx, const uint8_t key[16]); 61 | 62 | /** 63 | * Encrypt or decrypt a buffer using a previously initialized context, 64 | * in big endian format. 65 | * 66 | * @param ctx an AVXTEA context 67 | * @param dst destination array, can be equal to src 68 | * @param src source array, can be equal to dst 69 | * @param count number of 8 byte blocks 70 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 71 | * @param decrypt 0 for encryption, 1 for decryption 72 | */ 73 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 74 | int count, uint8_t *iv, int decrypt); 75 | 76 | /** 77 | * Encrypt or decrypt a buffer using a previously initialized context, 78 | * in little endian format. 79 | * 80 | * @param ctx an AVXTEA context 81 | * @param dst destination array, can be equal to src 82 | * @param src source array, can be equal to dst 83 | * @param count number of 8 byte blocks 84 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 85 | * @param decrypt 0 for encryption, 1 for decryption 86 | */ 87 | void av_xtea_le_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 88 | int count, uint8_t *iv, int decrypt); 89 | 90 | /** 91 | * @} 92 | */ 93 | 94 | #endif /* AVUTIL_XTEA_H */ 95 | -------------------------------------------------------------------------------- /src/ffmpeglib/include/libpostproc/postprocess.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at) 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (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 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * 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_POSTPROCESS_H 22 | #define POSTPROC_POSTPROCESS_H 23 | 24 | /** 25 | * @file 26 | * @ingroup lpp 27 | * external API header 28 | */ 29 | 30 | /** 31 | * @defgroup lpp libpostproc 32 | * Video postprocessing library. 33 | * 34 | * @{ 35 | */ 36 | 37 | #include "libpostproc/version.h" 38 | 39 | /** 40 | * Return the LIBPOSTPROC_VERSION_INT constant. 41 | */ 42 | unsigned postproc_version(void); 43 | 44 | /** 45 | * Return the libpostproc build-time configuration. 46 | */ 47 | const char *postproc_configuration(void); 48 | 49 | /** 50 | * Return the libpostproc license. 51 | */ 52 | const char *postproc_license(void); 53 | 54 | #define PP_QUALITY_MAX 6 55 | 56 | #include 57 | 58 | typedef void pp_context; 59 | typedef void pp_mode; 60 | 61 | #if LIBPOSTPROC_VERSION_INT < (52<<16) 62 | typedef pp_context pp_context_t; 63 | typedef pp_mode pp_mode_t; 64 | extern const char *const pp_help; ///< a simple help text 65 | #else 66 | extern const char pp_help[]; ///< a simple help text 67 | #endif 68 | 69 | void pp_postprocess(const uint8_t * src[3], const int srcStride[3], 70 | uint8_t * dst[3], const int dstStride[3], 71 | int horizontalSize, int verticalSize, 72 | const int8_t *QP_store, int QP_stride, 73 | pp_mode *mode, pp_context *ppContext, int pict_type); 74 | 75 | 76 | /** 77 | * Return a pp_mode or NULL if an error occurred. 78 | * 79 | * @param name the string after "-pp" on the command line 80 | * @param quality a number from 0 to PP_QUALITY_MAX 81 | */ 82 | pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality); 83 | void pp_free_mode(pp_mode *mode); 84 | 85 | pp_context *pp_get_context(int width, int height, int flags); 86 | void pp_free_context(pp_context *ppContext); 87 | 88 | #define PP_CPU_CAPS_MMX 0x80000000 89 | #define PP_CPU_CAPS_MMX2 0x20000000 90 | #define PP_CPU_CAPS_3DNOW 0x40000000 91 | #define PP_CPU_CAPS_ALTIVEC 0x10000000 92 | #define PP_CPU_CAPS_AUTO 0x00080000 93 | 94 | #define PP_FORMAT 0x00000008 95 | #define PP_FORMAT_420 (0x00000011|PP_FORMAT) 96 | #define PP_FORMAT_422 (0x00000001|PP_FORMAT) 97 | #define PP_FORMAT_411 (0x00000002|PP_FORMAT) 98 | #define PP_FORMAT_444 (0x00000000|PP_FORMAT) 99 | #define PP_FORMAT_440 (0x00000010|PP_FORMAT) 100 | 101 | #define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | #endif /* POSTPROC_POSTPROCESS_H */ 108 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 6 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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 6 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 | -------------------------------------------------------------------------------- /src/ffmpeglib/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 6 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 | -------------------------------------------------------------------------------- /src/ffmpeglib/lib/avcodec.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/avcodec.lib -------------------------------------------------------------------------------- /src/ffmpeglib/lib/avdevice-58.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | av_device_capabilities 3 | av_device_ffversion 4 | av_input_audio_device_next 5 | av_input_video_device_next 6 | av_output_audio_device_next 7 | av_output_video_device_next 8 | avdevice_app_to_dev_control_message 9 | avdevice_capabilities_create 10 | avdevice_capabilities_free 11 | avdevice_configuration 12 | avdevice_dev_to_app_control_message 13 | avdevice_free_list_devices 14 | avdevice_license 15 | avdevice_list_devices 16 | avdevice_list_input_sources 17 | avdevice_list_output_sinks 18 | avdevice_register_all 19 | avdevice_version 20 | -------------------------------------------------------------------------------- /src/ffmpeglib/lib/avdevice.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/avdevice.lib -------------------------------------------------------------------------------- /src/ffmpeglib/lib/avfilter-7.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | av_abuffersink_params_alloc 3 | av_buffersink_get_channel_layout 4 | av_buffersink_get_channels 5 | av_buffersink_get_format 6 | av_buffersink_get_frame 7 | av_buffersink_get_frame_flags 8 | av_buffersink_get_frame_rate 9 | av_buffersink_get_h 10 | av_buffersink_get_hw_frames_ctx 11 | av_buffersink_get_sample_aspect_ratio 12 | av_buffersink_get_sample_rate 13 | av_buffersink_get_samples 14 | av_buffersink_get_time_base 15 | av_buffersink_get_type 16 | av_buffersink_get_w 17 | av_buffersink_params_alloc 18 | av_buffersink_set_frame_size 19 | av_buffersrc_add_frame 20 | av_buffersrc_add_frame_flags 21 | av_buffersrc_close 22 | av_buffersrc_get_nb_failed_requests 23 | av_buffersrc_parameters_alloc 24 | av_buffersrc_parameters_set 25 | av_buffersrc_write_frame 26 | av_filter_ffversion 27 | av_filter_iterate 28 | avfilter_add_matrix 29 | avfilter_all_channel_layouts 30 | avfilter_config_links 31 | avfilter_configuration 32 | avfilter_free 33 | avfilter_get_by_name 34 | avfilter_get_class 35 | avfilter_graph_alloc 36 | avfilter_graph_alloc_filter 37 | avfilter_graph_config 38 | avfilter_graph_create_filter 39 | avfilter_graph_dump 40 | avfilter_graph_free 41 | avfilter_graph_get_filter 42 | avfilter_graph_parse 43 | avfilter_graph_parse2 44 | avfilter_graph_parse_ptr 45 | avfilter_graph_queue_command 46 | avfilter_graph_request_oldest 47 | avfilter_graph_send_command 48 | avfilter_graph_set_auto_convert 49 | avfilter_init_dict 50 | avfilter_init_str 51 | avfilter_inout_alloc 52 | avfilter_inout_free 53 | avfilter_insert_filter 54 | avfilter_license 55 | avfilter_link 56 | avfilter_link_free 57 | avfilter_link_get_channels 58 | avfilter_link_set_closed 59 | avfilter_make_format64_list 60 | avfilter_mul_matrix 61 | avfilter_next 62 | avfilter_pad_count 63 | avfilter_pad_get_name 64 | avfilter_pad_get_type 65 | avfilter_process_command 66 | avfilter_register 67 | avfilter_register_all 68 | avfilter_sub_matrix 69 | avfilter_transform 70 | avfilter_version 71 | -------------------------------------------------------------------------------- /src/ffmpeglib/lib/avfilter.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/avfilter.lib -------------------------------------------------------------------------------- /src/ffmpeglib/lib/avformat.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/avformat.lib -------------------------------------------------------------------------------- /src/ffmpeglib/lib/avutil.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/avutil.lib -------------------------------------------------------------------------------- /src/ffmpeglib/lib/libavcodec.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/libavcodec.dll.a -------------------------------------------------------------------------------- /src/ffmpeglib/lib/libavdevice.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/libavdevice.dll.a -------------------------------------------------------------------------------- /src/ffmpeglib/lib/libavfilter.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/libavfilter.dll.a -------------------------------------------------------------------------------- /src/ffmpeglib/lib/libavformat.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/libavformat.dll.a -------------------------------------------------------------------------------- /src/ffmpeglib/lib/libavutil.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/libavutil.dll.a -------------------------------------------------------------------------------- /src/ffmpeglib/lib/libpostproc.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/libpostproc.dll.a -------------------------------------------------------------------------------- /src/ffmpeglib/lib/libswresample.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/libswresample.dll.a -------------------------------------------------------------------------------- /src/ffmpeglib/lib/libswscale.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/libswscale.dll.a -------------------------------------------------------------------------------- /src/ffmpeglib/lib/postproc-55.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | postproc_configuration 3 | postproc_ffversion 4 | postproc_license 5 | postproc_version 6 | pp_free_context 7 | pp_free_mode 8 | pp_get_context 9 | pp_get_mode_by_name_and_quality 10 | pp_help 11 | pp_postprocess 12 | -------------------------------------------------------------------------------- /src/ffmpeglib/lib/postproc.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/postproc.lib -------------------------------------------------------------------------------- /src/ffmpeglib/lib/swresample-3.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | swr_alloc 3 | swr_alloc_set_opts 4 | swr_build_matrix 5 | swr_close 6 | swr_config_frame 7 | swr_convert 8 | swr_convert_frame 9 | swr_drop_output 10 | swr_ffversion 11 | swr_free 12 | swr_get_class 13 | swr_get_delay 14 | swr_get_out_samples 15 | swr_init 16 | swr_inject_silence 17 | swr_is_initialized 18 | swr_next_pts 19 | swr_set_channel_mapping 20 | swr_set_compensation 21 | swr_set_matrix 22 | swresample_configuration 23 | swresample_license 24 | swresample_version 25 | -------------------------------------------------------------------------------- /src/ffmpeglib/lib/swresample.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/swresample.lib -------------------------------------------------------------------------------- /src/ffmpeglib/lib/swscale-5.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | sws_addVec 3 | sws_allocVec 4 | sws_alloc_context 5 | sws_alloc_set_opts 6 | sws_cloneVec 7 | sws_convVec 8 | sws_convertPalette8ToPacked24 9 | sws_convertPalette8ToPacked32 10 | sws_freeContext 11 | sws_freeFilter 12 | sws_freeVec 13 | sws_getCachedContext 14 | sws_getCoefficients 15 | sws_getColorspaceDetails 16 | sws_getConstVec 17 | sws_getContext 18 | sws_getDefaultFilter 19 | sws_getGaussianVec 20 | sws_getIdentityVec 21 | sws_get_class 22 | sws_init_context 23 | sws_isSupportedEndiannessConversion 24 | sws_isSupportedInput 25 | sws_isSupportedOutput 26 | sws_normalizeVec 27 | sws_printVec2 28 | sws_scale 29 | sws_scaleVec 30 | sws_setColorspaceDetails 31 | sws_shiftVec 32 | sws_subVec 33 | swscale_configuration 34 | swscale_license 35 | swscale_version 36 | -------------------------------------------------------------------------------- /src/ffmpeglib/lib/swscale.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/ffmpeglib/lib/swscale.lib -------------------------------------------------------------------------------- /src/image.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | png/1.png 4 | png/2.png 5 | png/background.jpeg 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/lib/sqlite3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/lib/sqlite3.lib -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "view/beginwidget.h" 3 | 4 | #include "view/main_widget.h" 5 | 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | 10 | QApplication a(argc, argv); 11 | BeginWidget test; 12 | //Main_Widget test; 13 | test.show(); 14 | 15 | 16 | return a.exec(); 17 | } 18 | -------------------------------------------------------------------------------- /src/model/imagemodel.cpp: -------------------------------------------------------------------------------- 1 | #include "imagemodel.h" 2 | ImageModel *ImageModel::moder =nullptr; 3 | int ImageModel::row=0; 4 | int ImageModel::col=0; 5 | ImageModel::ImageModel() 6 | { 7 | 8 | } 9 | //外部公共接口 获取model对象 10 | ImageModel *ImageModel::getInstance() 11 | { 12 | if(ImageModel::moder==nullptr) 13 | { 14 | ImageModel::moder=new ImageModel; 15 | } 16 | return ImageModel::moder; 17 | } 18 | //添加设置信息 19 | int ImageModel::addImagePath(QString video_name, QString cover_path) 20 | { 21 | char sql[256]; 22 | sprintf(sql,"insert into image(image_name,image_path)values('%s','%s');", 23 | video_name.toStdString().c_str(),cover_path.toStdString().c_str()); 24 | char **qres; 25 | int row,col; 26 | return SingelDB::getInstance()->dosql(sql,qres,row,col); 27 | } 28 | //获取多个图片路径 9个为一组 29 | char **ImageModel::getImagePath(int num) 30 | { 31 | char sql[256]; 32 | sprintf(sql,"select image_path,image_name from image limit 9 offset (%d-1)*9;",num); 33 | char **qres; 34 | //int row,col; 35 | SingelDB::getInstance()->dosql(sql,qres,row,col); 36 | return qres; 37 | } 38 | 39 | //获取图片路径 40 | char **ImageModel::getimage(QString name) 41 | { 42 | char sql[256]; 43 | sprintf(sql,"select image_path from image where image_name = '%s';",name.toStdString().c_str()); 44 | char **qres; 45 | int row,col; 46 | SingelDB::getInstance()->dosql(sql,qres,row,col); 47 | return qres; 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/model/imagemodel.h: -------------------------------------------------------------------------------- 1 | #ifndef IMAGEMODEL_H 2 | #define IMAGEMODEL_H 3 | #include "singeldb.h" 4 | #include 5 | #include 6 | 7 | class ImageModel 8 | { 9 | public: 10 | //外部公共接口 获取model对象 11 | static ImageModel *getInstance(); 12 | //添加设置信息 13 | int addImagePath(QString video_name, QString cover_path); 14 | //获取多个图片路径 9个为一组 15 | char **getImagePath(int num); 16 | //获取图片路径 17 | char **getimage(QString name); 18 | 19 | static int row , col; 20 | private: 21 | ImageModel();//构造私有化 22 | static ImageModel *moder; //静态私成员变量 23 | sqlite3 *sqldb; 24 | char *errmsg; //用来存储错误信息字符串 25 | }; 26 | 27 | #endif // IMAGEMODEL_H 28 | -------------------------------------------------------------------------------- /src/model/setmodel.cpp: -------------------------------------------------------------------------------- 1 | #include "setmodel.h" 2 | 3 | SetModel *SetModel::moder =nullptr; 4 | 5 | SetModel::SetModel(){} 6 | 7 | //外部公共接口 获取model对象 8 | SetModel *SetModel::getInstance() 9 | { 10 | if(SetModel::moder==nullptr) 11 | { 12 | SetModel::moder=new SetModel; 13 | } 14 | 15 | return SetModel::moder; 16 | } 17 | 18 | //添加设置信息 19 | int SetModel::addSetting(QString Video_path, QString Image_path, int framecount, QString cameraName) 20 | { 21 | char sql[256]; 22 | sprintf(sql,"insert into setting(video_path,image_path,interval,camera_name)values('%s','%s','%d','%s');", 23 | Video_path.toStdString().c_str(),Image_path.toStdString().c_str(), 24 | framecount,cameraName.toStdString().c_str()); 25 | char **qres; 26 | int row,col; 27 | return SingelDB::getInstance()->dosql(sql,qres,row,col); 28 | } 29 | 30 | //更新设置信息 31 | //返回值0代表更新成功,1代表失败 32 | int SetModel::updateSetting(QString Video_path, QString Image_path, int framecount, QString cameraName) 33 | { 34 | char sql[256]; 35 | char **qres; 36 | int row,col; 37 | sprintf(sql,"update setting set video_path='%s',image_path='%s',interval='%d',camera_name='%s' where set_id=1;", 38 | Video_path.toStdString().c_str(),Image_path.toStdString().c_str(),framecount,cameraName.toStdString().c_str()); 39 | return SingelDB::getInstance()->dosql(sql,qres,row,col); 40 | 41 | } 42 | 43 | //获取设置信息 44 | //0表示dosql没有数据,大于0 表示有数据,-1执行失败 45 | int SetModel::getSetting() 46 | { 47 | char sql[256] = "select * from setting"; 48 | char **qres; 49 | int col,row; 50 | int res = SingelDB::getInstance()->dosql(sql,qres,row,col); 51 | if(res == 0) 52 | { 53 | return row; 54 | } 55 | return -1; 56 | } 57 | 58 | //获取设置信息视频保存路径 59 | void SetModel::getSetting_videopath(QString &videopath) 60 | { 61 | char sql[256] = "select video_path from setting where set_id=1;"; 62 | char **qres; 63 | int col,row; 64 | //将sql语句换成sqlite3可以识别的语句,返回指针到stmt 65 | int res = SingelDB::getInstance()->dosql(sql,qres,row,col); 66 | if(res == SQLITE_OK) 67 | { 68 | if(row==0) 69 | { 70 | return;//没有数据 71 | } 72 | //videopath= qres[1]; 73 | videopath = QString(QLatin1String(qres[1])); 74 | } 75 | } 76 | 77 | //获取设置信息图片保存路径 78 | void SetModel::getSetting_imagepath(QString &imagepath) 79 | { 80 | char sql[256] = "select image_path from setting where set_id=1;"; 81 | char **qres; 82 | int col,row; 83 | int res = SingelDB::getInstance()->dosql(sql,qres,row,col); 84 | if(res == SQLITE_OK) 85 | { 86 | if(row==0) 87 | { 88 | return;//没有数据 89 | } 90 | 91 | imagepath = QString(QLatin1String(qres[1])); 92 | } 93 | } 94 | 95 | int SetModel::getSetting_interval() 96 | { 97 | char sql[256] = "select interval from setting where set_id=1;"; 98 | char **qres; 99 | int col,row; 100 | int res = SingelDB::getInstance()->dosql(sql,qres,row,col); 101 | if(res == SQLITE_OK) 102 | { 103 | if(row==0) 104 | { 105 | return 1;//没有数据 106 | } 107 | return atoi(qres[1]); 108 | } 109 | return -1; 110 | } 111 | -------------------------------------------------------------------------------- /src/model/setmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef SETMODEL_H 2 | #define SETMODEL_H 3 | #include "singeldb.h" 4 | #include 5 | #include 6 | #include 7 | class SetModel 8 | { 9 | public: 10 | //外部公共接口 获取model对象 11 | static SetModel *getInstance(); 12 | //添加设置信息 13 | int addSetting(QString Video_path,QString Image_path,int framecount,QString cameraName); 14 | //更新设置信息 15 | int updateSetting(QString Video_path,QString Image_path,int framecount,QString cameraName); 16 | //获取设置信息 17 | int getSetting(); 18 | //获取设置信息视频保存路径 19 | void getSetting_videopath(QString &videopath); 20 | //获取设置信息图片保存路径 21 | void getSetting_imagepath(QString &imagpath); 22 | //获取设置信息视频间隔 23 | int getSetting_interval(); 24 | private: 25 | SetModel();//构造私有化 26 | static SetModel *moder; //静态私成员变量 27 | sqlite3 *sqldb; 28 | char *errmsg; //用来存储错误信息字符串 29 | }; 30 | 31 | #endif // SETMODEL_H 32 | -------------------------------------------------------------------------------- /src/model/singeldb.cpp: -------------------------------------------------------------------------------- 1 | #include "singeldb.h" 2 | 3 | SingelDB *SingelDB::myDB=nullptr; 4 | //单例打开数据库路径 5 | SingelDB::SingelDB() 6 | { 7 | this->openDataBase("../data/video"); 8 | } 9 | //外部公共接口 获取单例对象 10 | SingelDB *SingelDB::getInstance() 11 | { 12 | if(SingelDB::myDB==nullptr) 13 | { 14 | SingelDB::myDB=new SingelDB(); 15 | } 16 | 17 | return SingelDB::myDB; 18 | 19 | } 20 | //数据库执行 21 | int SingelDB::dosql(char *sql, char **&result, int &row, int &col) 22 | { 23 | int res =sqlite3_get_table(sqldb, sql, &result, &row, &col, &errmsg); 24 | if(res!=SQLITE_OK) 25 | { 26 | cout< 5 | using namespace std; 6 | 7 | class SingelDB 8 | { 9 | public: 10 | ~SingelDB(); 11 | //外部公共接口 获取model对象 12 | static SingelDB *getInstance(); 13 | //static void releaseInstence(); 14 | //数据库执行 15 | int dosql(char *sql,char **&result,int &row, int &col); 16 | //打开数据库 17 | void openDataBase(const char *dbPath); 18 | //关闭数据库 19 | void closeDataBase(); 20 | 21 | 22 | private: 23 | SingelDB();//构造私有化 24 | static SingelDB *myDB;//静态私成员变量 25 | sqlite3 *sqldb; 26 | char *errmsg; //用来存储错误信息字符串 27 | 28 | 29 | }; 30 | 31 | #endif // SINGELDB_H 32 | -------------------------------------------------------------------------------- /src/model/usermodel.cpp: -------------------------------------------------------------------------------- 1 | #include "usermodel.h" 2 | 3 | UserModel *UserModel::moder =nullptr; 4 | 5 | UserModel::UserModel() 6 | { 7 | 8 | } 9 | //外部公共接口 获取model对象 10 | UserModel *UserModel::getInstance() 11 | { 12 | if(UserModel::moder==nullptr) 13 | { 14 | UserModel::moder=new UserModel; 15 | } 16 | return UserModel::moder; 17 | } 18 | //验证用户和密码 19 | int UserModel::getUserByNamePwd(QString account, QString pwd) 20 | { 21 | char sql[256]; 22 | 23 | char **qres; 24 | int row,col; 25 | sprintf(sql,"select * from user where account='%s' AND password='%s';", 26 | account.toStdString().c_str(),pwd.toStdString().c_str()); 27 | int res = SingelDB::getInstance()->dosql(sql,qres,row,col); 28 | //res为查询成功 29 | if(res==0) 30 | { 31 | //如果row大于0说明验证成功 32 | if(row>0) 33 | { 34 | return 0; 35 | } 36 | //反之说明验证失败 37 | else 38 | { 39 | return 1; 40 | } 41 | } 42 | //查询失败 43 | else 44 | { 45 | return -1; 46 | } 47 | } 48 | 49 | 50 | //核对用户是否存在 51 | int UserModel::checkUserByNamePwd(QString account) 52 | { 53 | char sql[256]; 54 | sprintf(sql,"select * from user where account='%s';", 55 | account.toStdString().c_str()); 56 | char **qres; 57 | int row,col; 58 | int res = SingelDB::getInstance()->dosql(sql,qres,row,col); 59 | if(res==0) 60 | { 61 | //如果row大于0用户存在 62 | if(row>0) 63 | { 64 | return 0; 65 | } 66 | //反之说明用户不存在 67 | else 68 | { 69 | return 1; 70 | } 71 | } 72 | //查询失败 73 | else 74 | { 75 | return -1; 76 | } 77 | } 78 | 79 | //添加用户 80 | int UserModel::addUser(QString account,QString user_name, QString pwd) 81 | { 82 | char sql[256]; 83 | sprintf(sql,"insert into user(account,user_name,password)values('%s','%s','%s');", 84 | account.toStdString().c_str(),user_name.toStdString().c_str(),pwd.toStdString().c_str()); 85 | char **qres; 86 | int row,col; 87 | return SingelDB::getInstance()->dosql(sql,qres,row,col); 88 | } 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /src/model/usermodel.h: -------------------------------------------------------------------------------- 1 | #ifndef USERMODEL_H 2 | #define USERMODEL_H 3 | #include 4 | #include 5 | #include "singeldb.h" 6 | #include 7 | using namespace std; 8 | 9 | class UserModel 10 | { 11 | public: 12 | //外部公共接口 获取model对象 13 | static UserModel *getInstance(); 14 | //验证用户和密码 15 | int getUserByNamePwd(QString account,QString pwd); 16 | //添加用户 17 | int addUser(QString account,QString user_name,QString pwd); 18 | //核对用户是否存在 19 | int checkUserByNamePwd(QString account); 20 | 21 | private: 22 | UserModel(); //构造私有化 23 | static UserModel *moder; //静态私成员变量 24 | sqlite3 *sqldb; 25 | char *errmsg; //用来存储错误信息字符串 26 | }; 27 | 28 | #endif // USERMODEL_H 29 | -------------------------------------------------------------------------------- /src/model/videomodel.cpp: -------------------------------------------------------------------------------- 1 | #include "videomodel.h" 2 | VideoModel *VideoModel::moder =nullptr; 3 | int VideoModel::row=0; 4 | int VideoModel::col=0; 5 | VideoModel::VideoModel() 6 | { 7 | 8 | } 9 | 10 | //外部公共接口 获取model对象 11 | VideoModel *VideoModel::getInstance() 12 | { 13 | if(VideoModel::moder==nullptr) 14 | { 15 | VideoModel::moder=new VideoModel; 16 | } 17 | 18 | return VideoModel::moder; 19 | } 20 | //添加视频信息 21 | int VideoModel::addVideoPath(QString video_name, QString cover_path, QString video_path) 22 | { 23 | char sql[256]; 24 | sprintf(sql,"insert into video(video_name,cover_path,video_path)values('%s','%s','%s');", 25 | video_name.toStdString().c_str(),cover_path.toStdString().c_str(),video_path.toStdString().c_str()); 26 | char **qres; 27 | int row,col; 28 | return SingelDB::getInstance()->dosql(sql,qres,row,col); 29 | } 30 | //获取多个视频路径和视频名称---视频列表显示 31 | char **VideoModel::getVideoPath() 32 | { 33 | char sql[256]; 34 | sprintf(sql,"select video_name,cover_path from video;"); 35 | char **qres; 36 | //int row,col; 37 | SingelDB::getInstance()->dosql(sql,qres,row,col); 38 | return qres; 39 | } 40 | 41 | //获取指定视频路径---视频播放 42 | char **VideoModel::getVideo(QString name) 43 | { 44 | char sql[256]; 45 | sprintf(sql,"select video_path from video where video_name = '%s' ;",name.toStdString().c_str()); 46 | char **qres; 47 | int row,col; 48 | SingelDB::getInstance()->dosql(sql,qres,row,col); 49 | return qres; 50 | } 51 | 52 | //日历查询视频信息 53 | char **VideoModel::calendar_query(QString date) 54 | { 55 | char sql[256]; 56 | sprintf(sql,"select video_name,cover_path from video where video_name like '%s%';",date.toStdString().c_str()); 57 | char **qres; 58 | //int row,col; 59 | SingelDB::getInstance()->dosql(sql,qres,row,col); 60 | return qres; 61 | } 62 | 63 | //获取最后一个视频路径 64 | char **VideoModel::getLastvideo() 65 | { 66 | char sql[256]; 67 | sprintf(sql,"select video_path from video order by video_id desc limit 1;"); 68 | char **qres; 69 | int row,col; 70 | SingelDB::getInstance()->dosql(sql,qres,row,col); 71 | return qres; 72 | 73 | } 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/model/videomodel.h: -------------------------------------------------------------------------------- 1 | #ifndef VIDEOMODEL_H 2 | #define VIDEOMODEL_H 3 | #include "singeldb.h" 4 | #include 5 | #include 6 | 7 | class VideoModel 8 | { 9 | public: 10 | //外部公共接口 获取model对象 11 | static VideoModel *getInstance(); 12 | //添加图片信息 13 | int addVideoPath(QString video_name, QString cover_path, QString video_path); 14 | //获取多个视频路径和视频名称---视频列表显示 15 | char **getVideoPath(); 16 | //获取指定视频路径---视频播放 17 | char **getVideo(QString name); 18 | //日历查询视频信息 19 | char **calendar_query(QString date); 20 | //获取最后一个视频路径 21 | char **getLastvideo(); 22 | static int row,col; 23 | private: 24 | VideoModel();//构造私有化 25 | static VideoModel *moder; //静态私成员变量 26 | sqlite3 *sqldb; 27 | char *errmsg; //用来存储错误信息字符串 28 | }; 29 | 30 | #endif // VIDEOMODEL_H 31 | -------------------------------------------------------------------------------- /src/object_script.Security_Monitoring.Debug: -------------------------------------------------------------------------------- 1 | INPUT( 2 | ./debug\main.o 3 | ./debug\loginwidget.o 4 | ./debug\usermodel.o 5 | ./debug\singeldb.o 6 | ./debug\usercontrol.o 7 | ./debug\registerwidget.o 8 | ./debug\encodetoh264.o 9 | ./debug\beginwidget.o 10 | ./debug\myitem.o 11 | ./debug\setwidget.o 12 | ./debug\main_monitorwidget.o 13 | ./debug\setmodel.o 14 | ./debug\setcontrol.o 15 | ./debug\main_widget.o 16 | ./debug\main_replaywidget.o 17 | ./debug\decode.o 18 | ./debug\videomodel.o 19 | ./debug\videocontrol.o 20 | ./debug\imagecontrol.o 21 | ./debug\imagemodel.o 22 | ./debug\play_widget.o 23 | ./debug\decode_replay.o 24 | ./debug\ftrancetomp4.o 25 | ./debug\image_widegt.o 26 | ./debug\qrc_image.o 27 | ./debug\moc_loginwidget.o 28 | ./debug\moc_registerwidget.o 29 | ./debug\moc_beginwidget.o 30 | ./debug\moc_myitem.o 31 | ./debug\moc_setwidget.o 32 | ./debug\moc_main_monitorwidget.o 33 | ./debug\moc_main_widget.o 34 | ./debug\moc_main_replaywidget.o 35 | ./debug\moc_decode.o 36 | ./debug\moc_play_widget.o 37 | ./debug\moc_decode_replay.o 38 | ./debug\moc_image_widegt.o 39 | ); 40 | -------------------------------------------------------------------------------- /src/object_script.Security_Monitoring.Release: -------------------------------------------------------------------------------- 1 | INPUT( 2 | ./release\main.o 3 | ./release\loginwidget.o 4 | ./release\usermodel.o 5 | ./release\singeldb.o 6 | ./release\usercontrol.o 7 | ./release\registerwidget.o 8 | ./release\encodetoh264.o 9 | ./release\beginwidget.o 10 | ./release\myitem.o 11 | ./release\setwidget.o 12 | ./release\main_monitorwidget.o 13 | ./release\setmodel.o 14 | ./release\setcontrol.o 15 | ./release\main_widget.o 16 | ./release\main_replaywidget.o 17 | ./release\decode.o 18 | ./release\videomodel.o 19 | ./release\videocontrol.o 20 | ./release\imagecontrol.o 21 | ./release\imagemodel.o 22 | ./release\play_widget.o 23 | ./release\decode_replay.o 24 | ./release\ftrancetomp4.o 25 | ./release\image_widegt.o 26 | ./release\qrc_image.o 27 | ./release\moc_loginwidget.o 28 | ./release\moc_registerwidget.o 29 | ./release\moc_beginwidget.o 30 | ./release\moc_myitem.o 31 | ./release\moc_setwidget.o 32 | ./release\moc_main_monitorwidget.o 33 | ./release\moc_main_widget.o 34 | ./release\moc_main_replaywidget.o 35 | ./release\moc_decode.o 36 | ./release\moc_play_widget.o 37 | ./release\moc_decode_replay.o 38 | ./release\moc_image_widegt.o 39 | ); 40 | -------------------------------------------------------------------------------- /src/png/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/1.png -------------------------------------------------------------------------------- /src/png/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/2.png -------------------------------------------------------------------------------- /src/png/background.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/background.jpeg -------------------------------------------------------------------------------- /src/png/声音关.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/声音关.png -------------------------------------------------------------------------------- /src/png/声音开.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/声音开.png -------------------------------------------------------------------------------- /src/png/展开.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/展开.png -------------------------------------------------------------------------------- /src/png/开始.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/开始.png -------------------------------------------------------------------------------- /src/png/搜索.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/搜索.png -------------------------------------------------------------------------------- /src/png/放大展示.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/放大展示.png -------------------------------------------------------------------------------- /src/png/新建文件夹/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/新建文件夹/1.png -------------------------------------------------------------------------------- /src/png/新建文件夹/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/新建文件夹/2.png -------------------------------------------------------------------------------- /src/png/暂停.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/暂停.png -------------------------------------------------------------------------------- /src/png/最后一个视频.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/最后一个视频.png -------------------------------------------------------------------------------- /src/png/第一个视频.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/第一个视频.png -------------------------------------------------------------------------------- /src/png/缩小.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/缩小.png -------------------------------------------------------------------------------- /src/png/静音.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/png/静音.png -------------------------------------------------------------------------------- /src/video1234.h264: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/src/video1234.h264 -------------------------------------------------------------------------------- /src/view/beginwidget.cpp: -------------------------------------------------------------------------------- 1 | #include "beginwidget.h" 2 | //构造函数 3 | BeginWidget::BeginWidget() 4 | { 5 | this->setting=new SetWidget(); 6 | init_UI(); 7 | init_control(); 8 | init_connect(); 9 | } 10 | 11 | void BeginWidget::init_UI() 12 | { 13 | //设置窗口标题 14 | this->setWindowTitle("安防监控系统"); 15 | //设置窗口大小 16 | this->setFixedSize(780,500); 17 | //设置背景图 18 | this->setBackgroundBrush(QBrush(QPixmap(":png/background.jpeg"))); 19 | 20 | } 21 | 22 | void BeginWidget::init_control() 23 | { 24 | //创建场景 25 | this->scene = new QGraphicsScene(); 26 | this->setScene(scene); 27 | //设置场景坐标和视图一致 28 | this->setSceneRect(0,0,this->width()-2,this->height()-2); 29 | 30 | //创建图元 31 | item1 = new MyItem(":png/1.png",1); 32 | item2 = new MyItem(":png/2.png",2); 33 | 34 | //设置图元开始位置 35 | item1->setPos(125,this->height()/2); 36 | item2->setPos(638,this->height()/2); 37 | 38 | //场景添加图元 39 | scene->addItem(item1); 40 | scene->addItem(item2); 41 | 42 | //定时器 43 | timer = new QTimer(); 44 | timer->start(25); 45 | 46 | } 47 | 48 | void BeginWidget::init_connect() 49 | { 50 | //场景的槽函数: advance 作用:触发每一-个图元的advance(int)-->图元移动 51 | connect(timer, SIGNAL(timeout()), scene, SLOT(advance())); 52 | //场景的槽函数: watchStatus 作用:观察图元状态--状态改变就停止 53 | connect(timer, SIGNAL(timeout()), this, SLOT(watchStatus())); 54 | //场景的槽函数: tologin 作用:跳转窗口 55 | connect(this->item2,SIGNAL(end()),this,SLOT(toSettingorMainWidget())); 56 | 57 | } 58 | //图元状态监控函数 59 | void BeginWidget::watchStatus() 60 | { 61 | //判断状态图元状态,变成1就停止 62 | if(this->item1->status == 1) 63 | { 64 | this->timer->stop(); 65 | } 66 | } 67 | //设置界面跳转 68 | void BeginWidget::toSettingorMainWidget() 69 | { 70 | //开机动画隐藏 71 | this->hide(); 72 | //从数据库查询是否有设置参数 73 | int mark = SetControl::getInstance()->getSetting(); 74 | //如果没有就跳到设置页面 75 | if(mark != 0) 76 | { 77 | this->Main=new Main_Widget(); 78 | this->Main->show(); 79 | } 80 | //否则跳转主界面 81 | else 82 | { 83 | this->setting->show(); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/view/beginwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef BEGINWIDGET_H 2 | #define BEGINWIDGET_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "view/myitem.h" //自己定义的图元类 8 | #include 9 | #include 10 | #include "view/main_widget.h" 11 | #include "view/setwidget.h" 12 | #include "controller/setcontrol.h" 13 | 14 | class BeginWidget:public QGraphicsView 15 | { 16 | Q_OBJECT 17 | public: 18 | BeginWidget(); 19 | 20 | 21 | Main_Widget *Main; 22 | SetWidget *setting; 23 | QGraphicsScene *scene; 24 | MyItem *item1,*item2; 25 | QTimer *timer; 26 | void init_UI(); 27 | void init_control(); 28 | void init_connect(); 29 | public slots: 30 | void watchStatus(); 31 | void toSettingorMainWidget(); 32 | 33 | 34 | }; 35 | 36 | #endif // BEGINWIDGET_H 37 | -------------------------------------------------------------------------------- /src/view/image_widegt.cpp: -------------------------------------------------------------------------------- 1 | #include "image_widegt.h" 2 | 3 | //图片放大构造函数 4 | Image_Widegt::Image_Widegt(QString image_path,QWidget *parent) : QWidget(parent) 5 | { 6 | this->setWindowTitle("播放界面"); 7 | this->setFixedSize(640,481); 8 | this->totalLayout = new QHBoxLayout(); 9 | 10 | this->image_label = new QLabel(); 11 | QImage *image = new QImage(image_path); 12 | this->image_label->setPixmap(QPixmap::fromImage(*image)); 13 | this->image_label->setScaledContents(true); 14 | this->totalLayout->addWidget(image_label); 15 | this->setLayout(totalLayout); 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/view/image_widegt.h: -------------------------------------------------------------------------------- 1 | #ifndef IMAGE_WIDEGT_H 2 | #define IMAGE_WIDEGT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class Image_Widegt : public QWidget 11 | { 12 | Q_OBJECT 13 | public: 14 | //图片放大函数 15 | explicit Image_Widegt(QString image_path,QWidget *parent = nullptr); 16 | private: 17 | QLabel *image_label; 18 | QHBoxLayout *totalLayout; 19 | 20 | signals: 21 | 22 | public slots: 23 | }; 24 | 25 | #endif // IMAGE_WIDEGT_H 26 | -------------------------------------------------------------------------------- /src/view/loginwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGINWIDGET_H 2 | #define LOGINWIDGET_H 3 | #include "controller/setcontrol.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "controller/usercontrol.h" 18 | #include "view/registerwidget.h" 19 | class loginWidget : public QWidget 20 | { 21 | Q_OBJECT 22 | public: 23 | loginWidget(QWidget *parent = 0); 24 | void paintEvent(QPaintEvent *event); 25 | void init_UI(); 26 | void init_control(); 27 | void init_connect(); 28 | QString getcode(); 29 | void mousePressEvent(QMouseEvent *event); 30 | ~loginWidget(); 31 | int mark; 32 | 33 | public slots: 34 | void login();//点击登录按钮是执行的槽函数 35 | void toreg(); 36 | void backlog(); 37 | void PlainAndCipher(); 38 | QString GetMd5(const QString &value); 39 | 40 | 41 | private: 42 | QLabel *user_label,*password_label,*code_label; 43 | QPushButton *login_btn,*qsc_btn,*register_btn,*eye_btn; 44 | QLineEdit *user_edit,*password_edit,*Vericode_edit; 45 | QString code; 46 | RegisterWidget *regWin; 47 | }; 48 | 49 | #endif // LOGINWIDGET_H 50 | -------------------------------------------------------------------------------- /src/view/main_monitorwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_MONITORWIDGET_H 2 | #define MAIN_MONITORWIDGET_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "ffmpeg/decode.h" 14 | 15 | #include 16 | class Main_MonitorWidget : public QWidget 17 | { 18 | Q_OBJECT 19 | public: 20 | explicit Main_MonitorWidget(QWidget *parent = nullptr); 21 | 22 | void init_control(); 23 | void init_control2(); 24 | void init_connect(); 25 | void startdecode(); 26 | Decode *decodeThread;//声明解码线程 27 | 28 | private: 29 | QWidget *rightWidget,*leftWidget,*rightBottomWidget,*righttopWidget; 30 | QVBoxLayout *leftLayout,*rightLayout; 31 | QHBoxLayout *rightBottomLayout,*totalLayout; 32 | QGridLayout *righttopLayout; 33 | QPushButton *single_screen_btn,*multi_screen_btn; 34 | QLabel *video1_label,*video2_label,*video3_label,*video4_label; 35 | QList camera; 36 | QImage image; 37 | 38 | signals: 39 | 40 | public slots: 41 | void receiveImg(QImage img); 42 | void ToSingle(); 43 | void ToFour(); 44 | protected: 45 | void paintEvent(QPaintEvent *); 46 | }; 47 | 48 | #endif // MAIN_MONITORWIDGET_H 49 | -------------------------------------------------------------------------------- /src/view/main_replaywidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_REPLAYWIDGET_H 2 | #define MAIN_REPLAYWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | 22 | #include "controller/videocontrol.h" 23 | #include "controller/imagecontrol.h" 24 | #include "model/videomodel.h" 25 | #include "model/imagemodel.h" 26 | #include "play_widget.h" 27 | #include "image_widegt.h" 28 | 29 | 30 | class Main_ReplayWidget : public QWidget 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit Main_ReplayWidget(QWidget *parent = nullptr); 35 | void init_UI(); 36 | void init_connect(); 37 | void videolist(); 38 | void imagelist(); 39 | void lastvideo_play(); 40 | 41 | 42 | private: 43 | QWidget *leftWidget,*rightWidget,*rightWidget2, 44 | *midWidget,*rightBottomWidget,*righttopWidget; 45 | QVBoxLayout *leftLayout,*rightLayout, 46 | *righttopLayout,*midLayout; 47 | QStackedWidget *StackedWidget; 48 | QHBoxLayout *rightBottomLayout,*totalLayout,*rightLayout2; 49 | 50 | QPushButton *Inquire_btn,*Next_btn,*Previous_btn, 51 | *video_btn,*image_btn; 52 | QLabel *video_label,*video_label2; 53 | 54 | QImage image; 55 | QListWidget *playList,*image_List; 56 | Play_Widget *replayWidget; 57 | Image_Widegt *ImageWidget; 58 | 59 | QWidget *leftWidget1,*bottomWidget,*rightWidget3, 60 | *rightWidget4,*topWidget; 61 | QVBoxLayout *leftLayout1,*rightLayout3; 62 | QHBoxLayout *rightLayout4,*bottomLayout; 63 | QGridLayout *topLayout; 64 | 65 | QLabel *name_label,*size_label,*resolution_label; 66 | Decode_Replay *decodeThread; 67 | int page; 68 | QDateEdit *date; 69 | QString *date_time; 70 | 71 | QImage Image; 72 | 73 | QImage image_size; 74 | 75 | signals: 76 | 77 | public slots: 78 | void click_video(QListWidgetItem *item); 79 | void tovideo(); 80 | void toimage(); 81 | void next(); 82 | void previous(); 83 | void calendar_query(); 84 | void receiveimg(QImage img); 85 | void click_image(QListWidgetItem *item); 86 | //void update(); 87 | 88 | protected: 89 | void paintEvent(QPaintEvent *); 90 | 91 | }; 92 | 93 | #endif // MAIN_REPLAYWIDGET_H 94 | -------------------------------------------------------------------------------- /src/view/main_widget.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWIDGET_H 2 | #define MAINWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "main_monitorwidget.h" 23 | #include "main_replaywidget.h" 24 | #include "loginwidget.h" 25 | #include "setwidget.h" 26 | class Main_Widget : public QWidget 27 | { 28 | Q_OBJECT 29 | public: 30 | explicit Main_Widget(QWidget *parent = nullptr); 31 | 32 | void init_UI(); 33 | void init_control(); 34 | void init_connect(); 35 | static int status; 36 | 37 | private: 38 | QWidget *topWidget; 39 | QStackedWidget *bottomWidget; 40 | QLabel *time_label,*logo_label; 41 | QVBoxLayout *totalLayout; 42 | QHBoxLayout *topLayout; 43 | QPushButton *play_btn,*replay_btn,*log_btn,*setting_btn; 44 | QTimer *timer; 45 | Main_MonitorWidget *monitor; 46 | Main_ReplayWidget *replay; 47 | SetWidget *setting; 48 | loginWidget *loginwidget; 49 | signals: 50 | 51 | public slots: 52 | void qtimeSlot(); 53 | void Tosetting(); 54 | void Toreplay(); 55 | void Tomonitor(); 56 | void Tomain(); 57 | }; 58 | 59 | #endif // MAINWIDGET_H 60 | -------------------------------------------------------------------------------- /src/view/mainwidget.h.autosave: -------------------------------------------------------------------------------- 1 | #ifndef MAINWIDGET_H 2 | #define MAINWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | class MainWidget : public QWidget 23 | { 24 | Q_OBJECT 25 | public: 26 | explicit MainWidget(QWidget *parent = nullptr); 27 | MainWidget(); 28 | void init_UI(); 29 | void init_control(); 30 | 31 | private: 32 | QWidget *topWidget; 33 | QStackedWidget *bottomWidget; 34 | QLabel *time,*logo; 35 | QHBoxLayout *totalLayout,*topLayout; 36 | QPushButton *play_btn,*replay_btn,*log_btn,*setting_btn; 37 | QTimer *timer; 38 | 39 | signals: 40 | 41 | public slots: 42 | void qtimeSlot(); 43 | }; 44 | 45 | #endif // MAINWIDGET_H 46 | -------------------------------------------------------------------------------- /src/view/myitem.cpp: -------------------------------------------------------------------------------- 1 | #include "myitem.h" 2 | 3 | //图元重写构造函数 4 | MyItem::MyItem(QString path,int move) 5 | { 6 | this->itempath =path; 7 | //加载图元 8 | this->img.load(this->itempath); 9 | this->move = move; 10 | this->status = 0; 11 | } 12 | 13 | //图元边界设定函数 14 | QRectF MyItem::boundingRect() const 15 | { 16 | return QRectF(-this->img.width()/2, 17 | -this->img.height()/2, 18 | this->img.width(), 19 | this->img.height()); 20 | } 21 | 22 | //图元绘制事件 23 | void MyItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) 24 | { 25 | painter->drawPixmap(-this->img.width()/2,-this->img.height()/2,this->img); 26 | } 27 | 28 | //图元移动判断函数 29 | void MyItem::advance(int) 30 | { 31 | if(this->move==1) 32 | { 33 | //碰撞检测 34 | if(this->collidingItems().count()>0) 35 | { 36 | //图元状态改变 37 | this->status = 1; 38 | } 39 | //没有碰撞就继续走 40 | this->setPos(mapToScene(1,0)); 41 | } 42 | if(this->move==2) 43 | { 44 | //碰撞检测 45 | if(this->collidingItems().count()>0) 46 | { 47 | //图元状态改变 48 | this->status = 1; 49 | //发送信号碰撞信号,准备跳转页面 50 | Sleep(1000); 51 | emit end(); 52 | } 53 | //没有碰撞就继续走 54 | this->setPos(mapToScene(-1,0)); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/view/myitem.h: -------------------------------------------------------------------------------- 1 | #ifndef MYITEM_H 2 | #define MYITEM_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | class MyItem:public QObject,public QGraphicsItem 16 | { 17 | Q_OBJECT 18 | public: 19 | MyItem(QString path,int move); 20 | //返回图元绘制的矩阵区域 21 | QRectF boundingRect() const; 22 | //绘制图元内容 23 | void paint(QPainter *painter, 24 | const QStyleOptionGraphicsItem *option, 25 | QWidget *widget); 26 | void advance(int); 27 | 28 | int status; 29 | private: 30 | QString itempath; 31 | QPixmap img; 32 | int move; 33 | signals: 34 | void end(); 35 | 36 | }; 37 | 38 | #endif // MYITEM_H 39 | -------------------------------------------------------------------------------- /src/view/play_widget.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAY_WIDGET_H 2 | #define PLAY_WIDGET_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "ffmpeg/decode_replay.h" 13 | #include "ffmpeg/ftrancetomp4.h" 14 | #include 15 | class Play_Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit Play_Widget(QString PATH,QWidget *parent = nullptr); 20 | void init_UI(); 21 | void init_control(); 22 | void init_connect(); 23 | Decode_Replay *decodeThread; 24 | static QString path; 25 | 26 | private: 27 | QVBoxLayout *totalLayout; 28 | QWidget *bottomWidget,*topWidget; 29 | QHBoxLayout *bottomLayout,*topLayout; 30 | QLabel *video_label; 31 | QPushButton *play_btn,*screenshots_btn,*export_btn; 32 | QComboBox *Timesthespeed_box; 33 | QImage Image; 34 | FTranceTomp4 *trance; 35 | int mark; 36 | 37 | signals: 38 | 39 | public slots: 40 | void receiveimg(QImage img); 41 | void continue_stop(); 42 | void screenshots(); 43 | void trancetomp4(); 44 | protected: 45 | void paintEvent(QPaintEvent *); 46 | }; 47 | 48 | #endif // PLAY_WIDGET_H 49 | -------------------------------------------------------------------------------- /src/view/registerwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef REGISTERWIDGET_H 2 | #define REGISTERWIDGET_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "controller/usercontrol.h" 15 | class RegisterWidget : public QWidget 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit RegisterWidget(QWidget *parent = nullptr); 20 | void keyPressEvent(QKeyEvent *event); 21 | void init_UI(); 22 | void init_control(); 23 | void init_connect(); 24 | int mark; 25 | 26 | public slots: 27 | //点击注册按钮是执行的槽函数 28 | void regist(); 29 | void PlainAndCipher(); 30 | QString GetMd5(const QString &value); 31 | 32 | private: 33 | QLabel *account_label,*user_label,*password_label, 34 | *password_label2; 35 | 36 | QPushButton *register_btn,*qsc_btn,*eye_btn; 37 | QLineEdit *account_edit,*user_edit,*password_edit, 38 | *password_edit2; 39 | 40 | 41 | signals: 42 | void back(); 43 | 44 | }; 45 | 46 | #endif // REGISTERWIDGET_H 47 | -------------------------------------------------------------------------------- /src/view/setwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef SETWIDGET_H 2 | #define SETWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "ffmpeg/decode.h" 19 | #include "controller/setcontrol.h" 20 | 21 | class SetWidget:public QWidget 22 | { 23 | Q_OBJECT 24 | public: 25 | SetWidget(); 26 | void init_UI(); 27 | void init_control(); 28 | void init_connect(); 29 | int mark; 30 | 31 | private: 32 | QLabel *Set_label,*VideoPath_label,*ImagePath_label, 33 | *Interval_label,*Camera_label; 34 | QPushButton *VideoPath_btn,*ImagePath_btn, 35 | *OK_btn,*Esc_btn; 36 | QLineEdit *VideoPath_edit,*ImagePath_edit; 37 | QComboBox *Interval_box,*Camera_box; 38 | 39 | 40 | public slots: 41 | void Select_VideoPath(); 42 | void Select_ImagePath(); 43 | void init_data(); 44 | void getmain(); 45 | 46 | signals: 47 | void tomain(); 48 | 49 | 50 | }; 51 | 52 | #endif // SETWIDGET_H 53 | -------------------------------------------------------------------------------- /用户手册.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/779295285/Security_Monitoring/5fefe74aba69c8c842a9b9be1a93b39a9f2b43ca/用户手册.docx --------------------------------------------------------------------------------