├── README.md ├── ScreenRecorder-VS ├── ScreenRecorder-VS.sln └── ScreenRecorder-VS │ ├── CoreInterface.cpp │ ├── CoreInterface.h │ ├── RenderAPI_D3D11.cpp │ ├── RenderAPI_D3D9.cpp │ ├── bin │ └── x86_64 │ │ ├── avcodec-57.def │ │ ├── avcodec-57.dll │ │ ├── avfilter-6.def │ │ ├── avfilter-6.dll │ │ ├── avformat-57.def │ │ ├── avformat-57.dll │ │ ├── avutil-55.def │ │ ├── avutil-55.dll │ │ ├── libavcodec.dll.a │ │ ├── libavfilter.dll.a │ │ ├── libavformat.dll.a │ │ ├── libavutil.dll.a │ │ ├── libpostproc.dll.a │ │ ├── libswresample.dll.a │ │ ├── libswscale.dll.a │ │ ├── libx264-148.def │ │ ├── libx264-148.dll │ │ ├── libx264.dll.a │ │ ├── postproc-54.def │ │ ├── postproc-54.dll │ │ ├── swresample-2.def │ │ ├── swresample-2.dll │ │ ├── swscale-4.def │ │ └── swscale-4.dll │ ├── dllmain.cpp │ ├── stdafx.h │ └── targetver.h └── SharedSource ├── AACEncoder.cpp ├── AACEncoder.h ├── AudioConverter.cpp ├── AudioConverter.h ├── DebugTools.h ├── Encoder.cpp ├── Encoder.h ├── EngineDevice ├── IUnityGraphics.h ├── IUnityGraphicsD3D11.h ├── IUnityGraphicsD3D12.h ├── IUnityGraphicsD3D9.h ├── IUnityGraphicsMetal.h └── IUnityInterface.h ├── FramePool.cpp ├── FramePool.h ├── Muxer.cpp ├── Muxer.h ├── PlatformBase.h ├── RGB2YUV420.h ├── RenderAPI.cpp ├── RenderAPI.h ├── SystemCallbacks.h ├── TimeTools.cpp ├── TimeTools.h ├── libavcodec ├── avcodec.h ├── avdct.h ├── avfft.h ├── d3d11va.h ├── dirac.h ├── dv_profile.h ├── dxva2.h ├── qsv.h ├── vaapi.h ├── vda.h ├── vdpau.h ├── version.h ├── videotoolbox.h ├── vorbis_parser.h └── xvmc.h ├── libavfilter ├── avfilter.h ├── avfiltergraph.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 ├── error.h ├── eval.h ├── ffversion.h ├── fifo.h ├── file.h ├── frame.h ├── hash.h ├── hmac.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 ├── stereo3d.h ├── tea.h ├── threadmessage.h ├── time.h ├── timecode.h ├── timestamp.h ├── tree.h ├── twofish.h ├── version.h └── xtea.h ├── libpostproc ├── postprocess.h └── version.h ├── libswresample ├── swresample.h └── version.h ├── libswscale ├── swscale.h └── version.h ├── x264.h └── x264_config.h /README.md: -------------------------------------------------------------------------------- 1 | # ScreenRecorder 2 | Multiplatform screen recorder for OpenGL and DirectX 3 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScreenRecorder-VS", "ScreenRecorder-VS\ScreenRecorder-VS.vcxproj", "{44A64AA2-8B12-4BC9-9605-46EF924D1610}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {44A64AA2-8B12-4BC9-9605-46EF924D1610}.Debug|x64.ActiveCfg = Debug|x64 17 | {44A64AA2-8B12-4BC9-9605-46EF924D1610}.Debug|x64.Build.0 = Debug|x64 18 | {44A64AA2-8B12-4BC9-9605-46EF924D1610}.Debug|x86.ActiveCfg = Debug|Win32 19 | {44A64AA2-8B12-4BC9-9605-46EF924D1610}.Debug|x86.Build.0 = Debug|Win32 20 | {44A64AA2-8B12-4BC9-9605-46EF924D1610}.Release|x64.ActiveCfg = Release|x64 21 | {44A64AA2-8B12-4BC9-9605-46EF924D1610}.Release|x64.Build.0 = Release|x64 22 | {44A64AA2-8B12-4BC9-9605-46EF924D1610}.Release|x86.ActiveCfg = Release|Win32 23 | {44A64AA2-8B12-4BC9-9605-46EF924D1610}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/CoreInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // CoreInterface.cpp : Defines the exported functions for the DLL. 4 | // 5 | 6 | #include 7 | #include 8 | #include "SystemCallbacks.h" 9 | 10 | extern "C" { 11 | #include "libavutil/mathematics.h" 12 | #include "libavformat/avformat.h" 13 | #include "libavcodec/avcodec.h" 14 | #include "libswscale/swscale.h" 15 | #include "libavutil/imgutils.h" 16 | #include "libavutil/cpu.h" 17 | #include "libavutil/mem.h" 18 | #include "libavutil/samplefmt.h" 19 | #include "libavcodec/avcodec.h" 20 | #include "libavutil/frame.h" 21 | } 22 | 23 | #ifdef CAPTUREINTERFACE 24 | #define SCREENRECORDER_INTERFACE __declspec(dllexport) 25 | #else 26 | #define SCREENRECORDER_INTERFACE __declspec(dllimport) 27 | #endif 28 | 29 | extern "C" { 30 | SCREENRECORDER_INTERFACE void __stdcall SetLogCallback(LogCallback callback); 31 | 32 | SCREENRECORDER_INTERFACE void __stdcall SetDebugPath(const char* path); 33 | 34 | SCREENRECORDER_INTERFACE int __stdcall CreateEncoder(const char* videoPath, int codec, int width, int height, int framerate, int bitrate, int iframeInterval); 35 | 36 | SCREENRECORDER_INTERFACE int __stdcall DestroyEncoder(); 37 | 38 | SCREENRECORDER_INTERFACE int __stdcall StartEncoding(int inputWidth, int inputHeight, int outputWidth, int outputHeight, int inputFramerate); 39 | 40 | SCREENRECORDER_INTERFACE int __stdcall StopEncoding(); 41 | 42 | SCREENRECORDER_INTERFACE int __stdcall EncodeFrames(int maxFrames); 43 | 44 | SCREENRECORDER_INTERFACE int __stdcall CreateMuxer(const char* videoFile, const char* audioFile); 45 | 46 | SCREENRECORDER_INTERFACE int __stdcall StartMuxing(const char* outputFile); 47 | 48 | SCREENRECORDER_INTERFACE int __stdcall DestroyMuxer(); 49 | 50 | SCREENRECORDER_INTERFACE void __stdcall StartCapturing(int _width, int _height); 51 | 52 | SCREENRECORDER_INTERFACE void __stdcall StopCapturing(); 53 | 54 | SCREENRECORDER_INTERFACE int64_t __stdcall GetHighresTime(); 55 | } 56 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/RenderAPI_D3D11.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PLATFORMBASE_H 2 | #include "PlatformBase.h" 3 | #endif 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "EngineDevice/IUnityGraphicsD3D11.h" 10 | #include "RenderAPI.h" 11 | 12 | class RenderAPI_D3D11 : public RenderAPI 13 | { 14 | public: 15 | RenderAPI_D3D11(); 16 | virtual ~RenderAPI_D3D11(); 17 | 18 | virtual void SetDebugCallback(LogCallback debugLog); 19 | 20 | virtual void SetDebugPath(std::string debugPath); 21 | 22 | virtual void SetExternalEncoder(Encoder *encoder); 23 | 24 | virtual void StartCapturing(int width, int height); 25 | 26 | virtual void StopCapturing(); 27 | 28 | virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces); 29 | 30 | virtual void ReadFrameBuffer(); 31 | 32 | private: 33 | ID3D11Device* _device; 34 | ID3D11DeviceContext* _context; 35 | Encoder *m_encoder; 36 | LogCallback debugLog; 37 | std::string debugPath; 38 | }; 39 | 40 | RenderAPI* CreateRenderAPI_D3D11() { 41 | 42 | return new RenderAPI_D3D11(); 43 | } 44 | 45 | RenderAPI_D3D11::RenderAPI_D3D11(): _device(NULL),_context(NULL) 46 | { 47 | } 48 | 49 | RenderAPI_D3D11::~RenderAPI_D3D11() 50 | { 51 | } 52 | 53 | void RenderAPI_D3D11::ProcessDeviceEvent(UnityGfxDeviceEventType eventType, IUnityInterfaces * interfaces) 54 | { 55 | switch (eventType) 56 | { 57 | case kUnityGfxDeviceEventInitialize: 58 | { 59 | IUnityGraphicsD3D11* d3d = interfaces->Get(); 60 | _device = d3d->GetDevice(); 61 | _device->GetImmediateContext(&_context); 62 | break; 63 | } 64 | case kUnityGfxDeviceEventShutdown: 65 | { 66 | //Release Resources ... 67 | SAFE_RELEASE(_context); 68 | break; 69 | } 70 | } 71 | } 72 | 73 | void RenderAPI_D3D11::SetExternalEncoder(Encoder *encoder) 74 | { 75 | m_encoder = encoder; 76 | } 77 | 78 | void RenderAPI_D3D11::ReadFrameBuffer() 79 | { 80 | ID3D11RenderTargetView* pRenderTargetView; 81 | _context->OMGetRenderTargets(1, &pRenderTargetView, NULL); 82 | 83 | D3D11_RENDER_TARGET_VIEW_DESC renderTargetDesc; 84 | pRenderTargetView->GetDesc(&renderTargetDesc); 85 | 86 | ID3D11Resource* resource; 87 | pRenderTargetView->GetResource(&resource); 88 | 89 | D3D11_RENDER_TARGET_VIEW_DESC desc; 90 | pRenderTargetView->GetDesc(&desc); 91 | 92 | CComPtr stagingResource; 93 | 94 | _context->CopyResource(stagingResource, resource); 95 | 96 | //Create a resource with the STAGING USAGE 97 | //Copy data from RenderResource to StagingResource 98 | //Mapp the StagingResource to get the data. 99 | } 100 | 101 | 102 | void RenderAPI_D3D11::StopCapturing() 103 | { 104 | 105 | 106 | } 107 | void RenderAPI_D3D11::StartCapturing(int _width, int _height) 108 | { 109 | 110 | } 111 | 112 | void RenderAPI_D3D11::SetDebugCallback(LogCallback callback) 113 | { 114 | debugLog = callback; 115 | } 116 | 117 | void RenderAPI_D3D11::SetDebugPath(std::string path) 118 | { 119 | debugPath = path; 120 | } 121 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avcodec-57.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avcodec-57.dll -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avfilter-6.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | av_abuffersink_params_alloc 3 | av_buffersink_get_frame 4 | av_buffersink_get_frame_flags 5 | av_buffersink_get_frame_rate 6 | av_buffersink_get_samples 7 | av_buffersink_params_alloc 8 | av_buffersink_set_frame_size 9 | av_buffersrc_add_frame 10 | av_buffersrc_add_frame_flags 11 | av_buffersrc_get_nb_failed_requests 12 | av_buffersrc_write_frame 13 | av_filter_ffversion DATA 14 | av_filter_next 15 | avfilter_add_matrix 16 | avfilter_all_channel_layouts DATA 17 | avfilter_config_links 18 | avfilter_configuration 19 | avfilter_free 20 | avfilter_get_by_name 21 | avfilter_get_class 22 | avfilter_get_matrix 23 | avfilter_graph_add_filter 24 | avfilter_graph_alloc 25 | avfilter_graph_alloc_filter 26 | avfilter_graph_config 27 | avfilter_graph_create_filter 28 | avfilter_graph_dump 29 | avfilter_graph_free 30 | avfilter_graph_get_filter 31 | avfilter_graph_parse 32 | avfilter_graph_parse2 33 | avfilter_graph_parse_ptr 34 | avfilter_graph_queue_command 35 | avfilter_graph_request_oldest 36 | avfilter_graph_send_command 37 | avfilter_graph_set_auto_convert 38 | avfilter_init_dict 39 | avfilter_init_filter 40 | avfilter_init_str 41 | avfilter_inout_alloc 42 | avfilter_inout_free 43 | avfilter_insert_filter 44 | avfilter_license 45 | avfilter_link 46 | avfilter_link_free 47 | avfilter_link_get_channels 48 | avfilter_link_set_closed 49 | avfilter_make_format64_list 50 | avfilter_mul_matrix 51 | avfilter_next 52 | avfilter_open 53 | avfilter_pad_count 54 | avfilter_pad_get_name 55 | avfilter_pad_get_type 56 | avfilter_process_command 57 | avfilter_register 58 | avfilter_register_all 59 | avfilter_sub_matrix 60 | avfilter_transform 61 | avfilter_uninit 62 | avfilter_version 63 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avfilter-6.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avfilter-6.dll -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avformat-57.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | av_add_index_entry 3 | av_append_packet 4 | av_apply_bitstream_filters 5 | av_codec_get_id 6 | av_codec_get_tag 7 | av_codec_get_tag2 8 | av_convert_lang_to 9 | av_demuxer_open 10 | av_dump_format 11 | av_filename_number_test 12 | av_find_best_stream 13 | av_find_default_stream_index 14 | av_find_input_format 15 | av_find_program_from_stream 16 | av_fmt_ctx_get_duration_estimation_method 17 | av_format_ffversion DATA 18 | av_format_get_audio_codec 19 | av_format_get_control_message_cb 20 | av_format_get_data_codec 21 | av_format_get_metadata_header_padding 22 | av_format_get_opaque 23 | av_format_get_open_cb 24 | av_format_get_probe_score 25 | av_format_get_subtitle_codec 26 | av_format_get_video_codec 27 | av_format_inject_global_side_data 28 | av_format_set_audio_codec 29 | av_format_set_control_message_cb 30 | av_format_set_data_codec 31 | av_format_set_metadata_header_padding 32 | av_format_set_opaque 33 | av_format_set_open_cb 34 | av_format_set_subtitle_codec 35 | av_format_set_video_codec 36 | av_get_frame_filename 37 | av_get_output_timestamp 38 | av_get_packet 39 | av_guess_codec 40 | av_guess_format 41 | av_guess_frame_rate 42 | av_guess_sample_aspect_ratio 43 | av_hex_dump 44 | av_hex_dump_log 45 | av_iformat_next 46 | av_index_search_timestamp 47 | av_interleaved_write_frame 48 | av_interleaved_write_uncoded_frame 49 | av_match_ext 50 | av_new_program 51 | av_oformat_next 52 | av_pkt_dump2 53 | av_pkt_dump_log2 54 | av_probe_input_buffer 55 | av_probe_input_buffer2 56 | av_probe_input_format 57 | av_probe_input_format2 58 | av_probe_input_format3 59 | av_program_add_stream_index 60 | av_read_frame 61 | av_read_pause 62 | av_read_play 63 | av_register_all 64 | av_register_input_format 65 | av_register_output_format 66 | av_sdp_create 67 | av_seek_frame 68 | av_stream_get_end_pts 69 | av_stream_get_parser 70 | av_stream_get_r_frame_rate 71 | av_stream_get_recommended_encoder_configuration 72 | av_stream_get_side_data 73 | av_stream_new_side_data 74 | av_stream_set_r_frame_rate 75 | av_stream_set_recommended_encoder_configuration 76 | av_url_split 77 | av_write_frame 78 | av_write_trailer 79 | av_write_uncoded_frame 80 | av_write_uncoded_frame_query 81 | avformat_alloc_context 82 | avformat_alloc_output_context2 83 | avformat_close_input 84 | avformat_configuration 85 | avformat_find_stream_info 86 | avformat_flush 87 | avformat_free_context 88 | avformat_get_class 89 | avformat_get_mov_audio_tags 90 | avformat_get_mov_video_tags 91 | avformat_get_riff_audio_tags 92 | avformat_get_riff_video_tags 93 | avformat_license 94 | avformat_match_stream_specifier 95 | avformat_network_deinit 96 | avformat_network_init 97 | avformat_new_stream 98 | avformat_open_input 99 | avformat_query_codec 100 | avformat_queue_attached_pictures 101 | avformat_seek_file 102 | avformat_version 103 | avformat_write_header 104 | avio_accept 105 | avio_alloc_context 106 | avio_check 107 | avio_close 108 | avio_close_dir 109 | avio_close_dyn_buf 110 | avio_closep 111 | avio_enum_protocols 112 | avio_feof 113 | avio_find_protocol_name 114 | avio_flush 115 | avio_free_directory_entry 116 | avio_get_str 117 | avio_get_str16be 118 | avio_get_str16le 119 | avio_handshake 120 | avio_open 121 | avio_open2 122 | avio_open_dir 123 | avio_open_dyn_buf 124 | avio_pause 125 | avio_printf 126 | avio_put_str 127 | avio_put_str16be 128 | avio_put_str16le 129 | avio_r8 130 | avio_rb16 131 | avio_rb24 132 | avio_rb32 133 | avio_rb64 134 | avio_read 135 | avio_read_dir 136 | avio_read_to_bprint 137 | avio_rl16 138 | avio_rl24 139 | avio_rl32 140 | avio_rl64 141 | avio_seek 142 | avio_seek_time 143 | avio_size 144 | avio_skip 145 | avio_w8 146 | avio_wb16 147 | avio_wb24 148 | avio_wb32 149 | avio_wb64 150 | avio_wl16 151 | avio_wl24 152 | avio_wl32 153 | avio_wl64 154 | avio_write 155 | avpriv_dv_get_packet 156 | avpriv_dv_init_demux 157 | avpriv_dv_produce_packet 158 | avpriv_io_delete 159 | avpriv_io_move 160 | avpriv_mpegts_parse_close 161 | avpriv_mpegts_parse_open 162 | avpriv_mpegts_parse_packet 163 | avpriv_new_chapter 164 | avpriv_set_pts_info 165 | ff_inet_aton 166 | ff_rtp_get_local_rtcp_port 167 | ff_rtp_get_local_rtp_port 168 | ff_rtsp_parse_line 169 | ff_socket_nonblock 170 | ffio_open_dyn_packet_buf 171 | ffio_set_buf_size 172 | ffurl_close 173 | ffurl_open 174 | ffurl_write 175 | url_feof 176 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avformat-57.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avformat-57.dll -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avutil-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/avutil-55.dll -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libavcodec.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libavcodec.dll.a -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libavfilter.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libavfilter.dll.a -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libavformat.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libavformat.dll.a -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libavutil.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libavutil.dll.a -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libpostproc.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libpostproc.dll.a -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libswresample.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libswresample.dll.a -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libswscale.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libswscale.dll.a -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libx264-148.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libx264-148.dll -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libx264.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/libx264.dll.a -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/postproc-54.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | postproc_configuration 3 | postproc_ffversion DATA 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 DATA 11 | pp_postprocess 12 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/postproc-54.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/postproc-54.dll -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/swresample-2.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | swr_alloc 3 | swr_alloc_set_opts 4 | swr_close 5 | swr_config_frame 6 | swr_convert 7 | swr_convert_frame 8 | swr_drop_output 9 | swr_ffversion DATA 10 | swr_free 11 | swr_get_class 12 | swr_get_delay 13 | swr_get_out_samples 14 | swr_init 15 | swr_inject_silence 16 | swr_is_initialized 17 | swr_next_pts 18 | swr_set_channel_mapping 19 | swr_set_compensation 20 | swr_set_matrix 21 | swresample_configuration 22 | swresample_license 23 | swresample_version 24 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/swresample-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/swresample-2.dll -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/swscale-4.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 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/swscale-4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LinusLangels/ScreenRecorder/3b4033a9389ebcf7ad870b87ef5081cd17559472/ScreenRecorder-VS/ScreenRecorder-VS/bin/x86_64/swscale-4.dll -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /ScreenRecorder-VS/ScreenRecorder-VS/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /SharedSource/AACEncoder.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Linus on 2017-03-14. 3 | // 4 | 5 | #ifndef ANDROIDNATIVECAPTURING_TRANSCODE_AAC_H 6 | #define ANDROIDNATIVECAPTURING_TRANSCODE_AAC_H 7 | 8 | #include 9 | #include 10 | #include "SystemCallbacks.h" 11 | 12 | extern "C" { 13 | #include "libavformat/avformat.h" 14 | #include "libavformat/avio.h" 15 | #include "libavcodec/avcodec.h" 16 | #include "libavutil/audio_fifo.h" 17 | #include "libavutil/avassert.h" 18 | #include "libavutil/avstring.h" 19 | #include "libavutil/frame.h" 20 | #include "libavutil/opt.h" 21 | #include "libswresample/swresample.h" 22 | } 23 | 24 | class AACEncoder { 25 | std::string inputFile; 26 | AVFormatContext *targetCcontext; 27 | int64_t audioPTS = 0; 28 | LogCallback debugLog; 29 | 30 | AVFormatContext *inputContext = NULL; 31 | AVCodecContext *inputCodecContext = NULL; 32 | AVCodecContext *outputCodecContext = NULL; 33 | AVStream *audioStream = NULL; 34 | SwrContext *resample_context = NULL; 35 | AVAudioFifo *fifo = NULL; 36 | int ret = AVERROR_EXIT; 37 | 38 | int open_input(const char *filename, 39 | AVFormatContext **input_format_context, 40 | AVCodecContext **input_codec_context); 41 | 42 | int configure_output(AVFormatContext *output_context, 43 | AVCodecContext *input_codec_context, 44 | AVCodecContext **output_codec_context, 45 | AVStream **audio_stream); 46 | 47 | const char *get_error_text(const int error) 48 | { 49 | static char error_buffer[255]; 50 | av_strerror(error, error_buffer, sizeof(error_buffer)); 51 | return error_buffer; 52 | } 53 | 54 | void init_packet(AVPacket *packet); 55 | int init_input_frame(AVFrame **frame); 56 | int init_resampler(AVCodecContext *input_codec_context, AVCodecContext *output_codec_context, SwrContext **resample_context); 57 | int init_fifo(AVAudioFifo **fifo, AVCodecContext *output_codec_context); 58 | int decode_audio_frame(AVFrame *frame, 59 | AVFormatContext *input_format_context, 60 | AVCodecContext *input_codec_context, 61 | int *data_present, int *finished); 62 | int init_converted_samples(uint8_t ***converted_input_samples, 63 | AVCodecContext *output_codec_context, 64 | int frame_size); 65 | int convert_samples(const uint8_t **input_data, 66 | uint8_t **converted_data, const int frame_size, 67 | SwrContext *resample_context); 68 | int add_samples_to_fifo(AVAudioFifo *fifo, 69 | uint8_t **converted_input_samples, 70 | const int frame_size); 71 | int read_decode_convert_and_store(AVAudioFifo *fifo, 72 | AVFormatContext *input_format_context, 73 | AVCodecContext *input_codec_context, 74 | AVCodecContext *output_codec_context, 75 | SwrContext *resampler_context, 76 | int *finished); 77 | int init_output_frame(AVFrame **frame, 78 | AVCodecContext *output_codec_context, 79 | int frame_size); 80 | int encode_audio_frame(AVFrame *frame, 81 | AVFormatContext *output_format_context, 82 | AVCodecContext *output_codec_context, 83 | int *data_present); 84 | int load_encode_and_write(AVAudioFifo *fifo, 85 | AVFormatContext *output_format_context, 86 | AVCodecContext *output_codec_context); 87 | 88 | 89 | public: 90 | AACEncoder(std::string path, AVFormatContext *context, LogCallback callback); 91 | ~AACEncoder(); 92 | 93 | int EncodeAudio(); 94 | int ShouldEncodeAudio(AVStream* videoStream, int64_t videoPTS); 95 | int GetAudioPTS(); 96 | }; 97 | 98 | #endif //ANDROIDNATIVECAPTURING_TRANSCODE_AAC_H 99 | -------------------------------------------------------------------------------- /SharedSource/AudioConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" { 4 | #include "libavutil/mathematics.h" 5 | #include "libavformat/avformat.h" 6 | #include "libavcodec/avcodec.h" 7 | #include "libswscale/swscale.h" 8 | #include "libavutil/imgutils.h" 9 | #include "libavutil/cpu.h" 10 | #include "libavutil/mem.h" 11 | #include "libavutil/samplefmt.h" 12 | #include "libavcodec/avcodec.h" 13 | #include "libavutil/frame.h" 14 | #include "libswresample/swresample.h" 15 | #include "libavutil/opt.h" 16 | } 17 | 18 | #include 19 | #include 20 | #include 21 | #include "SystemCallbacks.h" 22 | 23 | class AudioConverter 24 | { 25 | std::string file; 26 | std::string outputFile; 27 | LogCallback debugLog; 28 | 29 | public: 30 | AudioConverter(std::string filePath, std::string outFile); 31 | ~AudioConverter(); 32 | 33 | void SetDebugLog(LogCallback callback); 34 | int Convert(); 35 | }; 36 | -------------------------------------------------------------------------------- /SharedSource/DebugTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Linus on 2017-02-23. 3 | // 4 | 5 | #ifndef ANDROIDNATIVECAPTURING_DEBUGTOOLS_H 6 | #define ANDROIDNATIVECAPTURING_DEBUGTOOLS_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | static void create_binary_rgb(const char* debugPath, char *prefix, int frame_id, int width, int height, int pixelSize, unsigned char *pixel) 13 | { 14 | enum Constants { max_filename = 256 }; 15 | char filename[max_filename]; 16 | snprintf(filename, max_filename, "%s/%s%d.raw", debugPath, prefix, frame_id); 17 | FILE *f = fopen(filename, "w"); 18 | 19 | fwrite(pixel, width*height*pixelSize, 1, f); 20 | fclose(f); 21 | } 22 | 23 | #endif //ANDROIDNATIVECAPTURING_DEBUGTOOLS_H 24 | -------------------------------------------------------------------------------- /SharedSource/Encoder.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Linus Langels on 19/04/17. 3 | // 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "FramePool.h" 14 | #include "SystemCallbacks.h" 15 | 16 | extern "C" { 17 | #include "libavutil/mathematics.h" 18 | #include "libavformat/avformat.h" 19 | #include "libavcodec/avcodec.h" 20 | #include "libswscale/swscale.h" 21 | #include "libavutil/imgutils.h" 22 | #include "libavutil/cpu.h" 23 | #include "libavutil/mem.h" 24 | #include "libavutil/samplefmt.h" 25 | #include "libavcodec/avcodec.h" 26 | #include 27 | #include "libavutil/frame.h" 28 | } 29 | 30 | enum CapturingCodec { H264 = 0, MPEG4 = 1, GIF = 2 }; 31 | 32 | typedef struct EncodeStream { 33 | AVFormatContext *formatContext; 34 | AVStream *stream; 35 | AVCodec *codec; 36 | uint8_t *picture_buffer; 37 | AVFrame *outputFrame; 38 | } EncodeStream; 39 | 40 | class Encoder{ 41 | std::string debugPath; 42 | LogCallback debugLog; 43 | 44 | std::string videoFile; 45 | int width; 46 | int height; 47 | int framerate; 48 | int bitrate; 49 | int iframeinterval; 50 | int frameCount; 51 | bool flipV; 52 | CapturingCodec captureCodec; 53 | 54 | EncodeStream* encodeStream; 55 | AVFrame *encode_frame; 56 | uint8_t *frame_data; 57 | int64_t codecTime; 58 | FramePool *framePool; 59 | std::queue processingFrames; 60 | uint8_t *flippedPixelBuffer; 61 | 62 | //State needed for gif generation. 63 | struct SwsContext *frameScaleConverter; 64 | AVFrame *rescaleFrame; 65 | bool isRescaled; 66 | 67 | EncodeStream* OpenOutputFile(const char* file); 68 | int ConfigureOutputVideo(EncodeStream *output, int contextWidth, int contextHeight); 69 | int OpenOutputVideoCodec(EncodeStream *output); 70 | int flush_encoder(AVFormatContext *fmt_ctx, int stream_index, int64_t pts); 71 | int EncodeFrame(AVFrame *frame); 72 | 73 | public: 74 | Encoder(std::string videoFile, CapturingCodec codec, int encodeBitrate, int iframeinterval, bool flipVertical); 75 | ~Encoder(); 76 | 77 | int EncodeFrames(int maxFrames); 78 | int StartEncoding(int inputWidth, int inputHeight, int outputWidth, int outputHeight, int inputFramerate); 79 | int StopEncoding(); 80 | int InsertFrame(uint8_t *frame, int bytesPerPixel, int64_t timeStamp); 81 | void SetDebugPath(std::string path); 82 | void SetDebugLog(LogCallback callback); 83 | }; 84 | -------------------------------------------------------------------------------- /SharedSource/EngineDevice/IUnityGraphics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | typedef enum UnityGfxRenderer 5 | { 6 | kUnityGfxRendererOpenGL = 0, // Legacy OpenGL 7 | kUnityGfxRendererD3D9 = 1, // Direct3D 9 8 | kUnityGfxRendererD3D11 = 2, // Direct3D 11 9 | kUnityGfxRendererGCM = 3, // PlayStation 3 10 | kUnityGfxRendererNull = 4, // "null" device (used in batch mode) 11 | kUnityGfxRendererXenon = 6, // Xbox 360 12 | kUnityGfxRendererOpenGLES20 = 8, // OpenGL ES 2.0 13 | kUnityGfxRendererOpenGLES30 = 11, // OpenGL ES 3.x 14 | kUnityGfxRendererGXM = 12, // PlayStation Vita 15 | kUnityGfxRendererPS4 = 13, // PlayStation 4 16 | kUnityGfxRendererXboxOne = 14, // Xbox One 17 | kUnityGfxRendererMetal = 16, // iOS Metal 18 | kUnityGfxRendererOpenGLCore = 17, // OpenGL core 19 | kUnityGfxRendererD3D12 = 18, // Direct3D 12 20 | } UnityGfxRenderer; 21 | 22 | typedef enum UnityGfxDeviceEventType 23 | { 24 | kUnityGfxDeviceEventInitialize = 0, 25 | kUnityGfxDeviceEventShutdown = 1, 26 | kUnityGfxDeviceEventBeforeReset = 2, 27 | kUnityGfxDeviceEventAfterReset = 3, 28 | } UnityGfxDeviceEventType; 29 | 30 | typedef void (UNITY_INTERFACE_API * IUnityGraphicsDeviceEventCallback)(UnityGfxDeviceEventType eventType); 31 | 32 | // Should only be used on the rendering thread unless noted otherwise. 33 | UNITY_DECLARE_INTERFACE(IUnityGraphics) 34 | { 35 | UnityGfxRenderer (UNITY_INTERFACE_API * GetRenderer)(); // Thread safe 36 | 37 | // This callback will be called when graphics device is created, destroyed, reset, etc. 38 | // It is possible to miss the kUnityGfxDeviceEventInitialize event in case plugin is loaded at a later time, 39 | // when the graphics device is already created. 40 | void (UNITY_INTERFACE_API * RegisterDeviceEventCallback)(IUnityGraphicsDeviceEventCallback callback); 41 | void (UNITY_INTERFACE_API * UnregisterDeviceEventCallback)(IUnityGraphicsDeviceEventCallback callback); 42 | }; 43 | UNITY_REGISTER_INTERFACE_GUID(0x7CBA0A9CA4DDB544ULL,0x8C5AD4926EB17B11ULL,IUnityGraphics) 44 | 45 | 46 | 47 | // Certain Unity APIs (GL.IssuePluginEvent, CommandBuffer.IssuePluginEvent) can callback into native plugins. 48 | // Provide them with an address to a function of this signature. 49 | typedef void (UNITY_INTERFACE_API * UnityRenderingEvent)(int eventId); 50 | -------------------------------------------------------------------------------- /SharedSource/EngineDevice/IUnityGraphicsD3D11.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | // Should only be used on the rendering thread unless noted otherwise. 5 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D11) 6 | { 7 | ID3D11Device* (UNITY_INTERFACE_API * GetDevice)(); 8 | }; 9 | UNITY_REGISTER_INTERFACE_GUID(0xAAB37EF87A87D748ULL,0xBF76967F07EFB177ULL,IUnityGraphicsD3D11) 10 | -------------------------------------------------------------------------------- /SharedSource/EngineDevice/IUnityGraphicsD3D12.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | #ifndef __cplusplus 4 | #include 5 | #endif 6 | 7 | typedef struct UnityGraphicsD3D12ResourceState UnityGraphicsD3D12ResourceState; 8 | struct UnityGraphicsD3D12ResourceState 9 | { 10 | ID3D12Resource* resource; // Resource to barrier. 11 | D3D12_RESOURCE_STATES expected; // Expected resource state before this command list is executed. 12 | D3D12_RESOURCE_STATES current; // State this resource will be in after this command list is executed. 13 | }; 14 | 15 | // Should only be used on the main thread. 16 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12v2) 17 | { 18 | ID3D12Device* (UNITY_INTERFACE_API * GetDevice)(); 19 | 20 | ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)(); 21 | // Returns the value set on the frame fence once the current frame completes or the GPU is flushed 22 | UINT64 (UNITY_INTERFACE_API * GetNextFrameFenceValue)(); 23 | 24 | // Executes a given command list on a worker thread. 25 | // [Optional] Declares expected and post-execution resource states. 26 | // Returns the fence value. 27 | UINT64 (UNITY_INTERFACE_API * ExecuteCommandList)(ID3D12GraphicsCommandList* commandList, int stateCount, UnityGraphicsD3D12ResourceState* states); 28 | }; 29 | UNITY_REGISTER_INTERFACE_GUID(0xEC39D2F18446C745ULL,0xB1A2626641D6B11FULL,IUnityGraphicsD3D12v2) 30 | 31 | 32 | 33 | // Obsolete 34 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12) 35 | { 36 | ID3D12Device* (UNITY_INTERFACE_API * GetDevice)(); 37 | ID3D12CommandQueue* (UNITY_INTERFACE_API * GetCommandQueue)(); 38 | 39 | ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)(); 40 | // Returns the value set on the frame fence once the current frame completes or the GPU is flushed 41 | UINT64 (UNITY_INTERFACE_API * GetNextFrameFenceValue)(); 42 | 43 | // Returns the state a resource will be in after the last command list is executed 44 | bool (UNITY_INTERFACE_API * GetResourceState)(ID3D12Resource* resource, D3D12_RESOURCE_STATES* outState); 45 | // Specifies the state a resource will be in after a plugin command list with resource barriers is executed 46 | void (UNITY_INTERFACE_API * SetResourceState)(ID3D12Resource* resource, D3D12_RESOURCE_STATES state); 47 | }; 48 | UNITY_REGISTER_INTERFACE_GUID(0xEF4CEC88A45F4C4CULL,0xBD295B6F2A38D9DEULL,IUnityGraphicsD3D12) 49 | -------------------------------------------------------------------------------- /SharedSource/EngineDevice/IUnityGraphicsD3D9.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | // Should only be used on the rendering thread unless noted otherwise. 5 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D9) 6 | { 7 | IDirect3D9* (UNITY_INTERFACE_API * GetD3D)(); 8 | IDirect3DDevice9* (UNITY_INTERFACE_API * GetDevice)(); 9 | }; 10 | UNITY_REGISTER_INTERFACE_GUID(0xE90746A523D53C4CULL,0xAC825B19B6F82AC3ULL,IUnityGraphicsD3D9) 11 | -------------------------------------------------------------------------------- /SharedSource/EngineDevice/IUnityGraphicsMetal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | #ifndef __OBJC__ 5 | #error metal plugin is objc code. 6 | #endif 7 | #ifndef __clang__ 8 | #error only clang compiler is supported. 9 | #endif 10 | #if !__has_feature(objc_arc) 11 | #error metal demands ARC enabled. 12 | #endif 13 | 14 | @class NSBundle; 15 | @protocol MTLDevice; 16 | @protocol MTLCommandBuffer; 17 | @protocol MTLCommandEncoder; 18 | @protocol MTLTexture; 19 | 20 | struct RenderSurfaceBase; 21 | typedef struct RenderSurfaceBase* UnityRenderBuffer; 22 | 23 | // Should only be used on the rendering thread unless noted otherwise. 24 | UNITY_DECLARE_INTERFACE(IUnityGraphicsMetal) 25 | { 26 | NSBundle* (UNITY_INTERFACE_API * MetalBundle)(); 27 | id (UNITY_INTERFACE_API * MetalDevice)(); 28 | 29 | id (UNITY_INTERFACE_API * CurrentCommandBuffer)(); 30 | 31 | // for custom rendering support there are two scenarios: 32 | // you want to use current in-flight MTLCommandEncoder (NB: it might be nil) 33 | id (UNITY_INTERFACE_API * CurrentCommandEncoder)(); 34 | // or you might want to create your own encoder. 35 | // In that case you should end unity's encoder before creating your own and end yours before returning control to unity 36 | void (UNITY_INTERFACE_API * EndCurrentCommandEncoder)(); 37 | 38 | // access to RenderBuffer's texure 39 | // NB: you pass here *native* RenderBuffer, acquired by calling (C#) RenderBuffer.GetNativeRenderBufferPtr 40 | // AAResolvedTextureFromRenderBuffer will return nil in case of non-AA RenderBuffer or if called for depth RenderBuffer 41 | // StencilTextureFromRenderBuffer will return nil in case of no-stencil RenderBuffer or if called for color RenderBuffer 42 | id (UNITY_INTERFACE_API * TextureFromRenderBuffer)(UnityRenderBuffer buffer); 43 | id (UNITY_INTERFACE_API * AAResolvedTextureFromRenderBuffer)(UnityRenderBuffer buffer); 44 | id (UNITY_INTERFACE_API * StencilTextureFromRenderBuffer)(UnityRenderBuffer buffer); 45 | 46 | }; 47 | UNITY_REGISTER_INTERFACE_GUID(0x992C8EAEA95811E5ULL,0x9A62C4B5B9876117ULL,IUnityGraphicsMetal) 48 | -------------------------------------------------------------------------------- /SharedSource/FramePool.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Linus on 2017-03-03. 3 | // 4 | 5 | #include 6 | #include "FramePool.h" 7 | 8 | FramePool::FramePool(int size, int frameSize) 9 | { 10 | numberOfFrames = size; 11 | 12 | //Pre-allocate frames for pool 13 | for (int i = 0; i < numberOfFrames; i++){ 14 | 15 | FrameObject_t *frame = (FrameObject_t*)malloc((sizeof(FrameObject_t))); 16 | frame->frame = (uint8_t*)(malloc(frameSize)); 17 | frame->pts = 0; 18 | 19 | freeFrames.push(frame); 20 | } 21 | } 22 | 23 | FramePool::~FramePool() 24 | { 25 | while (freeFrames.size() > 0) 26 | { 27 | FrameObject_t *frame = freeFrames.front(); 28 | freeFrames.pop(); 29 | 30 | free(frame->frame); 31 | free(frame); 32 | } 33 | } 34 | 35 | FrameObject_t* FramePool::popFrame() 36 | { 37 | FrameObject_t *frame = freeFrames.front(); 38 | freeFrames.pop(); 39 | 40 | return frame; 41 | } 42 | 43 | void FramePool::pushFrame(FrameObject_t *frame) 44 | { 45 | freeFrames.push(frame); 46 | } 47 | 48 | int FramePool::framesAvailable() 49 | { 50 | EnterRead(); 51 | int size = freeFrames.size(); 52 | ExitRead(); 53 | 54 | return size; 55 | } 56 | 57 | void FramePool::EnterRead() { 58 | #if defined(__APPLE__) || defined(__linux__) || defined(__unix__) 59 | EncodeThreadSyncObject *syncObject = GetSyncObject(); 60 | pthread_mutex_lock(&syncObject->Mutex); 61 | #endif 62 | } 63 | 64 | void FramePool::ExitRead() { 65 | #if defined(__APPLE__) || defined(__linux__) || defined(__unix__) 66 | EncodeThreadSyncObject *syncObject = GetSyncObject(); 67 | pthread_mutex_unlock(&syncObject->Mutex); 68 | #endif 69 | } 70 | 71 | #if defined(__APPLE__) || defined(__linux__) || defined(__unix__) 72 | EncodeThreadSyncObject* FramePool::GetSyncObject() 73 | { 74 | return &syncObject; 75 | } 76 | #endif 77 | -------------------------------------------------------------------------------- /SharedSource/FramePool.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Linus on 2017-03-03. 3 | // 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | #if defined(__APPLE__) || defined(__linux__) || defined(__unix__) 11 | #include 12 | 13 | struct EncodeThreadSyncObject 14 | { 15 | pthread_cond_t ConditionVariable; 16 | pthread_mutex_t Mutex; 17 | 18 | EncodeThreadSyncObject() 19 | { 20 | ConditionVariable = PTHREAD_COND_INITIALIZER; 21 | Mutex = PTHREAD_MUTEX_INITIALIZER; 22 | } 23 | }; 24 | #endif 25 | 26 | typedef struct FrameObject 27 | { 28 | uint8_t *frame; 29 | int64_t pts; 30 | } FrameObject_t; 31 | 32 | class FramePool { 33 | int numberOfFrames; 34 | std::queue freeFrames; 35 | 36 | #if defined(__APPLE__) || defined(__linux__) || defined(__unix__) 37 | struct EncodeThreadSyncObject syncObject; 38 | #endif 39 | 40 | void EnterRead(); 41 | void ExitRead(); 42 | 43 | public: 44 | 45 | FramePool(int size, int frameSize); 46 | ~FramePool(); 47 | 48 | FrameObject_t *popFrame(); 49 | void pushFrame(FrameObject_t *frame); 50 | int framesAvailable(); 51 | 52 | #if defined(__APPLE__) || defined(__linux__) || defined(__unix__) 53 | EncodeThreadSyncObject* GetSyncObject(); 54 | #endif 55 | }; 56 | -------------------------------------------------------------------------------- /SharedSource/Muxer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Linus on 2017-03-10. 3 | // 4 | 5 | #ifndef ANDROIDNATIVECAPTURING_SIMPLEMUXER_H 6 | #define ANDROIDNATIVECAPTURING_SIMPLEMUXER_H 7 | 8 | #include "SystemCallbacks.h" 9 | #include 10 | 11 | extern "C" { 12 | #include "libavutil/mathematics.h" 13 | #include "libavformat/avformat.h" 14 | #include "libavcodec/avcodec.h" 15 | #include "libswscale/swscale.h" 16 | #include "libavutil/imgutils.h" 17 | #include "libavutil/cpu.h" 18 | #include "libavutil/mem.h" 19 | #include "libavutil/samplefmt.h" 20 | #include "libavcodec/avcodec.h" 21 | #include "libswresample/swresample.h" 22 | } 23 | 24 | typedef struct StreamSource { 25 | AVFormatContext *formatContext; 26 | AVStream *inputStream; 27 | } MuxSource; 28 | 29 | typedef struct StreamOutput { 30 | AVFormatContext *formatContext; 31 | AVStream *videoStream; 32 | AVStream *audioStream; 33 | uint8_t *picture_buffer; 34 | AVFrame *outputFrame; 35 | } MuxDestination; 36 | 37 | class Muxer{ 38 | std::string videoFile; 39 | std::string audioFile; 40 | std::string debugPath; 41 | LogCallback debugLog; 42 | 43 | MuxSource* OpenInputSource(const char* file); 44 | MuxDestination* OpenOutputFile(const char* outFile, MuxSource *videoSource); 45 | 46 | public: 47 | Muxer(std::string inputVideoFile, std::string inputAudioFile); 48 | ~Muxer(); 49 | 50 | int startMuxing(std::string outputFile); 51 | void SetDebugPath(std::string path); 52 | void SetDebugLog(LogCallback callback); 53 | }; 54 | #endif //ANDROIDNATIVECAPTURING_SIMPLEMUXER_H 55 | -------------------------------------------------------------------------------- /SharedSource/PlatformBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | 6 | // Which platform we are on? 7 | // UNITY_WIN - Windows (regular win32) 8 | // UNITY_OSX - Mac OS X 9 | // UNITY_LINUX - Linux 10 | // UNITY_IPHONE - iOS 11 | // UNITY_ANDROID - Android 12 | // UNITY_METRO - WSA or UWP 13 | // UNITY_WEBGL - WebGL 14 | #if _MSC_VER 15 | #define UNITY_WIN 1 16 | #elif defined(__APPLE__) 17 | #if defined(__arm__) || defined(__arm64__) 18 | #define UNITY_IPHONE 1 19 | #else 20 | #define UNITY_OSX 1 21 | #endif 22 | #elif defined(UNITY_METRO) || defined(UNITY_ANDROID) || defined(UNITY_LINUX) || defined(UNITY_WEBGL) 23 | // these are defined externally 24 | #elif defined(__EMSCRIPTEN__) 25 | // this is already defined in Unity 5.6 26 | #define UNITY_WEBGL 1 27 | #else 28 | #error "Unknown platform!" 29 | #endif 30 | 31 | 32 | 33 | // Which graphics device APIs we possibly support? 34 | #if UNITY_METRO 35 | #define SUPPORT_D3D11 1 36 | #if WINDOWS_UWP 37 | #define SUPPORT_D3D12 1 38 | #endif 39 | #elif UNITY_WIN 40 | #define SUPPORT_D3D9 1 41 | /*#define SUPPORT_D3D11 1 // comment this out if you don't have D3D11 header/library files 42 | #define SUPPORT_D3D12 0 //@TODO: enable by default? comment this out if you don't have D3D12 header/library files*/ 43 | #define SUPPORT_OPENGL_LEGACY 1 44 | #define SUPPORT_OPENGL_UNIFIED 1 45 | #define SUPPORT_OPENGL_CORE 1 46 | #elif UNITY_IPHONE || UNITY_ANDROID || UNITY_WEBGL 47 | #define SUPPORT_OPENGL_UNIFIED 1 48 | #define SUPPORT_OPENGL_ES 1 49 | #elif UNITY_OSX || UNITY_LINUX 50 | #define SUPPORT_OPENGL_LEGACY 1 51 | #define SUPPORT_OPENGL_UNIFIED 1 52 | #define SUPPORT_OPENGL_CORE 1 53 | #endif 54 | 55 | #if UNITY_IPHONE || UNITY_OSX 56 | #define SUPPORT_METAL 1 57 | #endif 58 | 59 | 60 | 61 | // COM-like Release macro 62 | #ifndef SAFE_RELEASE 63 | #define SAFE_RELEASE(a) if (a) { a->Release(); a = NULL; } 64 | #endif 65 | 66 | #ifndef SAFE_DELETE 67 | #define SAFE_DELETE(a) if (a) { delete a; a = NULL; } 68 | #endif 69 | -------------------------------------------------------------------------------- /SharedSource/RGB2YUV420.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Linus on 2017-03-02. 3 | // 4 | 5 | #ifndef ANDROIDNATIVECAPTURING_RGB2YUV420_H 6 | #define ANDROIDNATIVECAPTURING_RGB2YUV420_H 7 | 8 | #include 9 | #include 10 | 11 | void rgb2yuv420(uint8_t *destination, uint8_t *rgb, int bytesPerPixel, size_t width, size_t height) 12 | { 13 | size_t image_size = width * height; 14 | size_t upos = image_size; 15 | size_t vpos = upos + upos / 4; 16 | size_t i = 0; 17 | 18 | for( size_t line = 0; line < height; ++line ) 19 | { 20 | if( !(line % 2) ) 21 | { 22 | for( size_t x = 0; x < width; x += 2 ) 23 | { 24 | uint8_t r = rgb[bytesPerPixel * i + 0]; 25 | uint8_t g = rgb[bytesPerPixel * i + 1]; 26 | uint8_t b = rgb[bytesPerPixel * i + 2]; 27 | 28 | destination[i++] = ((66*r + 129*g + 25*b) >> 8) + 16; 29 | 30 | destination[upos++] = ((-38*r + -74*g + 112*b) >> 8) + 128; 31 | destination[vpos++] = ((112*r + -94*g + -18*b) >> 8) + 128; 32 | 33 | r = rgb[bytesPerPixel * i + 0]; 34 | g = rgb[bytesPerPixel * i + 1]; 35 | b = rgb[bytesPerPixel * i + 2]; 36 | 37 | destination[i++] = ((66*r + 129*g + 25*b) >> 8) + 16; 38 | } 39 | } 40 | else 41 | { 42 | for( size_t x = 0; x < width; x += 1 ) 43 | { 44 | uint8_t r = rgb[bytesPerPixel * i + 0]; 45 | uint8_t g = rgb[bytesPerPixel * i + 1]; 46 | uint8_t b = rgb[bytesPerPixel * i + 2]; 47 | 48 | destination[i++] = ((66*r + 129*g + 25*b) >> 8) + 16; 49 | } 50 | } 51 | } 52 | } 53 | 54 | #endif //ANDROIDNATIVECAPTURING_RGB2YUV420_H 55 | -------------------------------------------------------------------------------- /SharedSource/RenderAPI.cpp: -------------------------------------------------------------------------------- 1 | #include "RenderAPI.h" 2 | #include "EngineDevice/IUnityGraphics.h" 3 | #include "PlatformBase.h" 4 | 5 | RenderAPI * CreateRenderAPI(UnityGfxRenderer apiType) 6 | { 7 | #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WINAPI_FAMILY) 8 | 9 | if (apiType == kUnityGfxRendererD3D9) 10 | { 11 | extern RenderAPI* CreateRenderAPI_D3D9(); 12 | return CreateRenderAPI_D3D9(); 13 | } 14 | if (apiType == kUnityGfxRendererD3D11) 15 | { 16 | extern RenderAPI* CreateRenderAPI_D3D11(); 17 | return CreateRenderAPI_D3D11(); 18 | } 19 | 20 | #elif defined(__MACH__) || defined(__ANDROID__) || defined(__linux__) || defined(__QNX__) || defined(__APPLE__) || defined(__APPLE) 21 | 22 | #if SUPPORT_OPENGL_UNIFIED 23 | if (apiType == kUnityGfxRendererOpenGLCore || apiType == kUnityGfxRendererOpenGLES20 || apiType == kUnityGfxRendererOpenGLES30) 24 | { 25 | extern RenderAPI* Create_OpenGLCoreCapturer(UnityGfxRenderer apiType); 26 | return Create_OpenGLCoreCapturer(apiType); 27 | } 28 | #endif // if SUPPORT_OPENGL_UNIFIED 29 | 30 | #if SUPPORT_OPENGL_LEGACY 31 | if (apiType == kUnityGfxRendererOpenGL) 32 | { 33 | extern RenderAPI* Create_OpenGL2Capturer(); 34 | return Create_OpenGL2Capturer(); 35 | } 36 | #endif // if SUPPORT_OPENGL_LEGACY 37 | #endif 38 | return NULL; 39 | } 40 | -------------------------------------------------------------------------------- /SharedSource/RenderAPI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SystemCallbacks.h" 4 | #include "EngineDevice/IUnityGraphics.h" 5 | #include "Encoder.h" 6 | #include 7 | #include 8 | 9 | struct IUnityInterfaces; 10 | 11 | class RenderAPI 12 | { 13 | public: 14 | virtual ~RenderAPI() { } 15 | 16 | virtual void SetDebugPath(std::string debugPath) = 0; 17 | 18 | virtual void SetDebugCallback(LogCallback debugLog) = 0; 19 | 20 | virtual void SetExternalEncoder(Encoder *encoder) = 0; 21 | 22 | virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces) = 0; 23 | 24 | virtual void StartCapturing(int width, int height) = 0; 25 | 26 | virtual void StopCapturing() = 0; 27 | 28 | virtual void ReadFrameBuffer() = 0; 29 | }; 30 | 31 | // Create a graphics API implementation instance for the given API type. 32 | RenderAPI* CreateRenderAPI(UnityGfxRenderer apiType); 33 | 34 | -------------------------------------------------------------------------------- /SharedSource/SystemCallbacks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _WIN32 4 | typedef void(__stdcall *LogCallback)(const char* message); 5 | #else 6 | typedef void(__cdecl *LogCallback)(const char* message); 7 | #endif 8 | -------------------------------------------------------------------------------- /SharedSource/TimeTools.cpp: -------------------------------------------------------------------------------- 1 | #include "TimeTools.h" 2 | #include 3 | #include 4 | 5 | int64_t timenow_ms() 6 | { 7 | LARGE_INTEGER cTime; 8 | FILETIME fTime; 9 | SYSTEMTIME currentTime; 10 | GetSystemTime(¤tTime); 11 | 12 | SystemTimeToFileTime(¤tTime, &fTime); 13 | cTime.HighPart = fTime.dwHighDateTime; 14 | cTime.LowPart = fTime.dwLowDateTime; 15 | 16 | return cTime.QuadPart / 10000; 17 | } 18 | -------------------------------------------------------------------------------- /SharedSource/TimeTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Linus on 2017-02-23. 3 | // 4 | #ifndef TIME_TOOLS_H 5 | #define TIME_TOOLS_H 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | int64_t timenow_ms(); 12 | 13 | #endif //TIME_TOOLS_H 14 | 15 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/libavcodec/dirac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Marco Gerards 3 | * Copyright (C) 2009 David Conrad 4 | * Copyright (C) 2011 Jordi Ortiz 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_DIRAC_H 24 | #define AVCODEC_DIRAC_H 25 | 26 | /** 27 | * @file 28 | * Interface to Dirac Decoder/Encoder 29 | * @author Marco Gerards 30 | * @author David Conrad 31 | * @author Jordi Ortiz 32 | */ 33 | 34 | #include "avcodec.h" 35 | 36 | /** 37 | * The spec limits the number of wavelet decompositions to 4 for both 38 | * level 1 (VC-2) and 128 (long-gop default). 39 | * 5 decompositions is the maximum before >16-bit buffers are needed. 40 | * Schroedinger allows this for DD 9,7 and 13,7 wavelets only, limiting 41 | * the others to 4 decompositions (or 3 for the fidelity filter). 42 | * 43 | * We use this instead of MAX_DECOMPOSITIONS to save some memory. 44 | */ 45 | #define MAX_DWT_LEVELS 5 46 | 47 | /** 48 | * Parse code values: 49 | * 50 | * Dirac Specification -> 51 | * 9.6.1 Table 9.1 52 | * 53 | * VC-2 Specification -> 54 | * 10.4.1 Table 10.1 55 | */ 56 | 57 | enum DiracParseCodes { 58 | DIRAC_PCODE_SEQ_HEADER = 0x00, 59 | DIRAC_PCODE_END_SEQ = 0x10, 60 | DIRAC_PCODE_AUX = 0x20, 61 | DIRAC_PCODE_PAD = 0x30, 62 | DIRAC_PCODE_PICTURE_CODED = 0x08, 63 | DIRAC_PCODE_PICTURE_RAW = 0x48, 64 | DIRAC_PCODE_PICTURE_LOW_DEL = 0xC8, 65 | DIRAC_PCODE_PICTURE_HQ = 0xE8, 66 | DIRAC_PCODE_INTER_NOREF_CO1 = 0x0A, 67 | DIRAC_PCODE_INTER_NOREF_CO2 = 0x09, 68 | DIRAC_PCODE_INTER_REF_CO1 = 0x0D, 69 | DIRAC_PCODE_INTER_REF_CO2 = 0x0E, 70 | DIRAC_PCODE_INTRA_REF_CO = 0x0C, 71 | DIRAC_PCODE_INTRA_REF_RAW = 0x4C, 72 | DIRAC_PCODE_INTRA_REF_PICT = 0xCC, 73 | DIRAC_PCODE_MAGIC = 0x42424344, 74 | }; 75 | 76 | typedef struct DiracVersionInfo { 77 | int major; 78 | int minor; 79 | } DiracVersionInfo; 80 | 81 | typedef struct AVDiracSeqHeader { 82 | unsigned width; 83 | unsigned height; 84 | uint8_t chroma_format; ///< 0: 444 1: 422 2: 420 85 | 86 | uint8_t interlaced; 87 | uint8_t top_field_first; 88 | 89 | uint8_t frame_rate_index; ///< index into dirac_frame_rate[] 90 | uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[] 91 | 92 | uint16_t clean_width; 93 | uint16_t clean_height; 94 | uint16_t clean_left_offset; 95 | uint16_t clean_right_offset; 96 | 97 | uint8_t pixel_range_index; ///< index into dirac_pixel_range_presets[] 98 | uint8_t color_spec_index; ///< index into dirac_color_spec_presets[] 99 | 100 | int profile; 101 | int level; 102 | 103 | AVRational framerate; 104 | AVRational sample_aspect_ratio; 105 | 106 | enum AVPixelFormat pix_fmt; 107 | enum AVColorRange color_range; 108 | enum AVColorPrimaries color_primaries; 109 | enum AVColorTransferCharacteristic color_trc; 110 | enum AVColorSpace colorspace; 111 | 112 | DiracVersionInfo version; 113 | int bit_depth; 114 | } AVDiracSeqHeader; 115 | 116 | /** 117 | * Parse a Dirac sequence header. 118 | * 119 | * @param dsh this function will allocate and fill an AVDiracSeqHeader struct 120 | * and write it into this pointer. The caller must free it with 121 | * av_free(). 122 | * @param buf the data buffer 123 | * @param buf_size the size of the data buffer in bytes 124 | * @param log_ctx if non-NULL, this function will log errors here 125 | * @return 0 on success, a negative AVERROR code on failure 126 | */ 127 | int av_dirac_parse_sequence_header(AVDiracSeqHeader **dsh, 128 | const uint8_t *buf, size_t buf_size, 129 | void *log_ctx); 130 | 131 | #endif /* AVCODEC_DIRAC_H */ 132 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/libavcodec/qsv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Intel MediaSDK QSV public API 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 AVCODEC_QSV_H 22 | #define AVCODEC_QSV_H 23 | 24 | #include 25 | 26 | #include "libavutil/buffer.h" 27 | 28 | /** 29 | * This struct is used for communicating QSV parameters between libavcodec and 30 | * the caller. It is managed by the caller and must be assigned to 31 | * AVCodecContext.hwaccel_context. 32 | * - decoding: hwaccel_context must be set on return from the get_format() 33 | * callback 34 | * - encoding: hwaccel_context must be set before avcodec_open2() 35 | */ 36 | typedef struct AVQSVContext { 37 | /** 38 | * If non-NULL, the session to use for encoding or decoding. 39 | * Otherwise, libavcodec will try to create an internal session. 40 | */ 41 | mfxSession session; 42 | 43 | /** 44 | * The IO pattern to use. 45 | */ 46 | int iopattern; 47 | 48 | /** 49 | * Extra buffers to pass to encoder or decoder initialization. 50 | */ 51 | mfxExtBuffer **ext_buffers; 52 | int nb_ext_buffers; 53 | 54 | /** 55 | * Encoding only. If this field is set to non-zero by the caller, libavcodec 56 | * will create an mfxExtOpaqueSurfaceAlloc extended buffer and pass it to 57 | * the encoder initialization. This only makes sense if iopattern is also 58 | * set to MFX_IOPATTERN_IN_OPAQUE_MEMORY. 59 | * 60 | * The number of allocated opaque surfaces will be the sum of the number 61 | * required by the encoder and the user-provided value nb_opaque_surfaces. 62 | * The array of the opaque surfaces will be exported to the caller through 63 | * the opaque_surfaces field. 64 | */ 65 | int opaque_alloc; 66 | 67 | /** 68 | * Encoding only, and only if opaque_alloc is set to non-zero. Before 69 | * calling avcodec_open2(), the caller should set this field to the number 70 | * of extra opaque surfaces to allocate beyond what is required by the 71 | * encoder. 72 | * 73 | * On return from avcodec_open2(), this field will be set by libavcodec to 74 | * the total number of allocated opaque surfaces. 75 | */ 76 | int nb_opaque_surfaces; 77 | 78 | /** 79 | * Encoding only, and only if opaque_alloc is set to non-zero. On return 80 | * from avcodec_open2(), this field will be used by libavcodec to export the 81 | * array of the allocated opaque surfaces to the caller, so they can be 82 | * passed to other parts of the pipeline. 83 | * 84 | * The buffer reference exported here is owned and managed by libavcodec, 85 | * the callers should make their own reference with av_buffer_ref() and free 86 | * it with av_buffer_unref() when it is no longer needed. 87 | * 88 | * The buffer data is an nb_opaque_surfaces-sized array of mfxFrameSurface1. 89 | */ 90 | AVBufferRef *opaque_surfaces; 91 | 92 | /** 93 | * Encoding only, and only if opaque_alloc is set to non-zero. On return 94 | * from avcodec_open2(), this field will be set to the surface type used in 95 | * the opaque allocation request. 96 | */ 97 | int opaque_alloc_type; 98 | } AVQSVContext; 99 | 100 | /** 101 | * Allocate a new context. 102 | * 103 | * It must be freed by the caller with av_free(). 104 | */ 105 | AVQSVContext *av_qsv_alloc_context(void); 106 | 107 | #endif /* AVCODEC_QSV_H */ 108 | -------------------------------------------------------------------------------- /SharedSource/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 | /** 38 | * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding 39 | * @ingroup lavc_codec_hwaccel 40 | * @{ 41 | */ 42 | 43 | /** 44 | * This structure is used to share data between the FFmpeg library and 45 | * the client video application. 46 | * This shall be zero-allocated and available as 47 | * AVCodecContext.hwaccel_context. All user members can be set once 48 | * during initialization or through each AVCodecContext.get_buffer() 49 | * function call. In any case, they must be valid prior to calling 50 | * decoding functions. 51 | */ 52 | struct vaapi_context { 53 | /** 54 | * Window system dependent data 55 | * 56 | * - encoding: unused 57 | * - decoding: Set by user 58 | */ 59 | void *display; 60 | 61 | /** 62 | * Configuration ID 63 | * 64 | * - encoding: unused 65 | * - decoding: Set by user 66 | */ 67 | uint32_t config_id; 68 | 69 | /** 70 | * Context ID (video decode pipeline) 71 | * 72 | * - encoding: unused 73 | * - decoding: Set by user 74 | */ 75 | uint32_t context_id; 76 | 77 | #if FF_API_VAAPI_CONTEXT 78 | /** 79 | * VAPictureParameterBuffer ID 80 | * 81 | * - encoding: unused 82 | * - decoding: Set by libavcodec 83 | */ 84 | attribute_deprecated 85 | uint32_t pic_param_buf_id; 86 | 87 | /** 88 | * VAIQMatrixBuffer ID 89 | * 90 | * - encoding: unused 91 | * - decoding: Set by libavcodec 92 | */ 93 | attribute_deprecated 94 | uint32_t iq_matrix_buf_id; 95 | 96 | /** 97 | * VABitPlaneBuffer ID (for VC-1 decoding) 98 | * 99 | * - encoding: unused 100 | * - decoding: Set by libavcodec 101 | */ 102 | attribute_deprecated 103 | uint32_t bitplane_buf_id; 104 | 105 | /** 106 | * Slice parameter/data buffer IDs 107 | * 108 | * - encoding: unused 109 | * - decoding: Set by libavcodec 110 | */ 111 | attribute_deprecated 112 | uint32_t *slice_buf_ids; 113 | 114 | /** 115 | * Number of effective slice buffer IDs to send to the HW 116 | * 117 | * - encoding: unused 118 | * - decoding: Set by libavcodec 119 | */ 120 | attribute_deprecated 121 | unsigned int n_slice_buf_ids; 122 | 123 | /** 124 | * Size of pre-allocated slice_buf_ids 125 | * 126 | * - encoding: unused 127 | * - decoding: Set by libavcodec 128 | */ 129 | attribute_deprecated 130 | unsigned int slice_buf_ids_alloc; 131 | 132 | /** 133 | * Pointer to VASliceParameterBuffers 134 | * 135 | * - encoding: unused 136 | * - decoding: Set by libavcodec 137 | */ 138 | attribute_deprecated 139 | void *slice_params; 140 | 141 | /** 142 | * Size of a VASliceParameterBuffer element 143 | * 144 | * - encoding: unused 145 | * - decoding: Set by libavcodec 146 | */ 147 | attribute_deprecated 148 | unsigned int slice_param_size; 149 | 150 | /** 151 | * Size of pre-allocated slice_params 152 | * 153 | * - encoding: unused 154 | * - decoding: Set by libavcodec 155 | */ 156 | attribute_deprecated 157 | unsigned int slice_params_alloc; 158 | 159 | /** 160 | * Number of slices currently filled in 161 | * 162 | * - encoding: unused 163 | * - decoding: Set by libavcodec 164 | */ 165 | attribute_deprecated 166 | unsigned int slice_count; 167 | 168 | /** 169 | * Pointer to slice data buffer base 170 | * - encoding: unused 171 | * - decoding: Set by libavcodec 172 | */ 173 | attribute_deprecated 174 | const uint8_t *slice_data; 175 | 176 | /** 177 | * Current size of slice data 178 | * 179 | * - encoding: unused 180 | * - decoding: Set by libavcodec 181 | */ 182 | attribute_deprecated 183 | uint32_t slice_data_size; 184 | #endif 185 | }; 186 | 187 | /* @} */ 188 | 189 | #endif /* AVCODEC_VAAPI_H */ 190 | -------------------------------------------------------------------------------- /SharedSource/libavcodec/videotoolbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Videotoolbox hardware acceleration 3 | * 4 | * copyright (c) 2012 Sebastien Zwickert 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_VIDEOTOOLBOX_H 24 | #define AVCODEC_VIDEOTOOLBOX_H 25 | 26 | /** 27 | * @file 28 | * @ingroup lavc_codec_hwaccel_videotoolbox 29 | * Public libavcodec Videotoolbox header. 30 | */ 31 | 32 | #include 33 | 34 | #define Picture QuickdrawPicture 35 | #include 36 | #undef Picture 37 | 38 | #include "libavcodec/avcodec.h" 39 | 40 | /** 41 | * This struct holds all the information that needs to be passed 42 | * between the caller and libavcodec for initializing Videotoolbox decoding. 43 | * Its size is not a part of the public ABI, it must be allocated with 44 | * av_videotoolbox_alloc_context() and freed with av_free(). 45 | */ 46 | typedef struct AVVideotoolboxContext { 47 | /** 48 | * Videotoolbox decompression session object. 49 | * Created and freed the caller. 50 | */ 51 | VTDecompressionSessionRef session; 52 | 53 | /** 54 | * The output callback that must be passed to the session. 55 | * Set by av_videottoolbox_default_init() 56 | */ 57 | VTDecompressionOutputCallback output_callback; 58 | 59 | /** 60 | * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames. 61 | * set by the caller. 62 | */ 63 | OSType cv_pix_fmt_type; 64 | 65 | /** 66 | * CoreMedia Format Description that Videotoolbox will use to create the decompression session. 67 | * Set by the caller. 68 | */ 69 | CMVideoFormatDescriptionRef cm_fmt_desc; 70 | 71 | /** 72 | * CoreMedia codec type that Videotoolbox will use to create the decompression session. 73 | * Set by the caller. 74 | */ 75 | int cm_codec_type; 76 | } AVVideotoolboxContext; 77 | 78 | /** 79 | * Allocate and initialize a Videotoolbox context. 80 | * 81 | * This function should be called from the get_format() callback when the caller 82 | * selects the AV_PIX_FMT_VIDETOOLBOX format. The caller must then create 83 | * the decoder object (using the output callback provided by libavcodec) that 84 | * will be used for Videotoolbox-accelerated decoding. 85 | * 86 | * When decoding with Videotoolbox is finished, the caller must destroy the decoder 87 | * object and free the Videotoolbox context using av_free(). 88 | * 89 | * @return the newly allocated context or NULL on failure 90 | */ 91 | AVVideotoolboxContext *av_videotoolbox_alloc_context(void); 92 | 93 | /** 94 | * This is a convenience function that creates and sets up the Videotoolbox context using 95 | * an internal implementation. 96 | * 97 | * @param avctx the corresponding codec context 98 | * 99 | * @return >= 0 on success, a negative AVERROR code on failure 100 | */ 101 | int av_videotoolbox_default_init(AVCodecContext *avctx); 102 | 103 | /** 104 | * This is a convenience function that creates and sets up the Videotoolbox context using 105 | * an internal implementation. 106 | * 107 | * @param avctx the corresponding codec context 108 | * @param vtctx the Videotoolbox context to use 109 | * 110 | * @return >= 0 on success, a negative AVERROR code on failure 111 | */ 112 | int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx); 113 | 114 | /** 115 | * This function must be called to free the Videotoolbox context initialized with 116 | * av_videotoolbox_default_init(). 117 | * 118 | * @param avctx the corresponding codec context 119 | */ 120 | void av_videotoolbox_default_free(AVCodecContext *avctx); 121 | 122 | /** 123 | * @} 124 | */ 125 | 126 | #endif /* AVCODEC_VIDEOTOOLBOX_H */ 127 | -------------------------------------------------------------------------------- /SharedSource/libavcodec/vorbis_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of FFmpeg. 4 | * 5 | * FFmpeg is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * FFmpeg is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with FFmpeg; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | /** 21 | * @file 22 | * A public API for Vorbis parsing 23 | * 24 | * Determines the duration for each packet. 25 | */ 26 | 27 | #ifndef AVCODEC_VORBIS_PARSER_H 28 | #define AVCODEC_VORBIS_PARSER_H 29 | 30 | #include 31 | 32 | typedef struct AVVorbisParseContext AVVorbisParseContext; 33 | 34 | /** 35 | * Allocate and initialize the Vorbis parser using headers in the extradata. 36 | * 37 | * @param avctx codec context 38 | * @param s Vorbis parser context 39 | */ 40 | AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata, 41 | int extradata_size); 42 | 43 | /** 44 | * Free the parser and everything associated with it. 45 | */ 46 | void av_vorbis_parse_free(AVVorbisParseContext **s); 47 | 48 | #define VORBIS_FLAG_HEADER 0x00000001 49 | #define VORBIS_FLAG_COMMENT 0x00000002 50 | #define VORBIS_FLAG_SETUP 0x00000004 51 | 52 | /** 53 | * Get the duration for a Vorbis packet. 54 | * 55 | * If @p flags is @c NULL, 56 | * special frames are considered invalid. 57 | * 58 | * @param s Vorbis parser context 59 | * @param buf buffer containing a Vorbis frame 60 | * @param buf_size size of the buffer 61 | * @param flags flags for special frames 62 | */ 63 | int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf, 64 | int buf_size, int *flags); 65 | 66 | /** 67 | * Get the duration for a Vorbis packet. 68 | * 69 | * @param s Vorbis parser context 70 | * @param buf buffer containing a Vorbis frame 71 | * @param buf_size size of the buffer 72 | */ 73 | int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf, 74 | int buf_size); 75 | 76 | void av_vorbis_parse_reset(AVVorbisParseContext *s); 77 | 78 | #endif /* AVCODEC_VORBIS_PARSER_H */ 79 | -------------------------------------------------------------------------------- /SharedSource/libavfilter/avfiltergraph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Filter graphs 3 | * copyright (c) 2007 Bobby Bingham 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 AVFILTER_AVFILTERGRAPH_H 23 | #define AVFILTER_AVFILTERGRAPH_H 24 | 25 | #include "avfilter.h" 26 | #include "libavutil/log.h" 27 | 28 | #endif /* AVFILTER_AVFILTERGRAPH_H */ 29 | -------------------------------------------------------------------------------- /SharedSource/libavfilter/buffersrc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of FFmpeg. 4 | * 5 | * FFmpeg is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * FFmpeg is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with FFmpeg; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef AVFILTER_BUFFERSRC_H 21 | #define AVFILTER_BUFFERSRC_H 22 | 23 | /** 24 | * @file 25 | * @ingroup lavfi_buffersrc 26 | * Memory buffer source API. 27 | */ 28 | 29 | #include "libavcodec/avcodec.h" 30 | #include "avfilter.h" 31 | 32 | /** 33 | * @defgroup lavfi_buffersrc Buffer source API 34 | * @ingroup lavfi 35 | * @{ 36 | */ 37 | 38 | enum { 39 | 40 | /** 41 | * Do not check for format changes. 42 | */ 43 | AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT = 1, 44 | 45 | /** 46 | * Immediately push the frame to the output. 47 | */ 48 | AV_BUFFERSRC_FLAG_PUSH = 4, 49 | 50 | /** 51 | * Keep a reference to the frame. 52 | * If the frame if reference-counted, create a new reference; otherwise 53 | * copy the frame data. 54 | */ 55 | AV_BUFFERSRC_FLAG_KEEP_REF = 8, 56 | 57 | }; 58 | 59 | /** 60 | * Get the number of failed requests. 61 | * 62 | * A failed request is when the request_frame method is called while no 63 | * frame is present in the buffer. 64 | * The number is reset when a frame is added. 65 | */ 66 | unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src); 67 | 68 | /** 69 | * Add a frame to the buffer source. 70 | * 71 | * @param ctx an instance of the buffersrc filter 72 | * @param frame frame to be added. If the frame is reference counted, this 73 | * function will make a new reference to it. Otherwise the frame data will be 74 | * copied. 75 | * 76 | * @return 0 on success, a negative AVERROR on error 77 | * 78 | * This function is equivalent to av_buffersrc_add_frame_flags() with the 79 | * AV_BUFFERSRC_FLAG_KEEP_REF flag. 80 | */ 81 | av_warn_unused_result 82 | int av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame); 83 | 84 | /** 85 | * Add a frame to the buffer source. 86 | * 87 | * @param ctx an instance of the buffersrc filter 88 | * @param frame frame to be added. If the frame is reference counted, this 89 | * function will take ownership of the reference(s) and reset the frame. 90 | * Otherwise the frame data will be copied. If this function returns an error, 91 | * the input frame is not touched. 92 | * 93 | * @return 0 on success, a negative AVERROR on error. 94 | * 95 | * @note the difference between this function and av_buffersrc_write_frame() is 96 | * that av_buffersrc_write_frame() creates a new reference to the input frame, 97 | * while this function takes ownership of the reference passed to it. 98 | * 99 | * This function is equivalent to av_buffersrc_add_frame_flags() without the 100 | * AV_BUFFERSRC_FLAG_KEEP_REF flag. 101 | */ 102 | av_warn_unused_result 103 | int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame); 104 | 105 | /** 106 | * Add a frame to the buffer source. 107 | * 108 | * By default, if the frame is reference-counted, this function will take 109 | * ownership of the reference(s) and reset the frame. This can be controlled 110 | * using the flags. 111 | * 112 | * If this function returns an error, the input frame is not touched. 113 | * 114 | * @param buffer_src pointer to a buffer source context 115 | * @param frame a frame, or NULL to mark EOF 116 | * @param flags a combination of AV_BUFFERSRC_FLAG_* 117 | * @return >= 0 in case of success, a negative AVERROR code 118 | * in case of failure 119 | */ 120 | av_warn_unused_result 121 | int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src, 122 | AVFrame *frame, int flags); 123 | 124 | 125 | /** 126 | * @} 127 | */ 128 | 129 | #endif /* AVFILTER_BUFFERSRC_H */ 130 | -------------------------------------------------------------------------------- /SharedSource/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 6 33 | #define LIBAVFILTER_VERSION_MINOR 31 34 | #define LIBAVFILTER_VERSION_MICRO 100 35 | 36 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ 37 | LIBAVFILTER_VERSION_MINOR, \ 38 | LIBAVFILTER_VERSION_MICRO) 39 | #define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \ 40 | LIBAVFILTER_VERSION_MINOR, \ 41 | LIBAVFILTER_VERSION_MICRO) 42 | #define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT 43 | 44 | #define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION) 45 | 46 | /** 47 | * FF_API_* defines may be placed below to indicate public API that will be 48 | * dropped at a future version bump. The defines themselves are not part of 49 | * the public API and may change, break or disappear at any time. 50 | */ 51 | 52 | #ifndef FF_API_OLD_FILTER_OPTS 53 | #define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 7) 54 | #endif 55 | #ifndef FF_API_OLD_FILTER_OPTS_ERROR 56 | #define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 7) 57 | #endif 58 | #ifndef FF_API_AVFILTER_OPEN 59 | #define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 7) 60 | #endif 61 | #ifndef FF_API_AVFILTER_INIT_FILTER 62 | #define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 7) 63 | #endif 64 | #ifndef FF_API_OLD_FILTER_REGISTER 65 | #define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 7) 66 | #endif 67 | #ifndef FF_API_NOCONST_GET_NAME 68 | #define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 7) 69 | #endif 70 | 71 | #endif /* AVFILTER_VERSION_H */ 72 | -------------------------------------------------------------------------------- /SharedSource/libavformat/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 AVFORMAT_VERSION_H 22 | #define AVFORMAT_VERSION_H 23 | 24 | /** 25 | * @file 26 | * @ingroup libavf 27 | * Libavformat version macros 28 | */ 29 | 30 | #include "libavutil/version.h" 31 | 32 | #define LIBAVFORMAT_VERSION_MAJOR 57 33 | #define LIBAVFORMAT_VERSION_MINOR 25 34 | #define LIBAVFORMAT_VERSION_MICRO 100 35 | 36 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ 37 | LIBAVFORMAT_VERSION_MINOR, \ 38 | LIBAVFORMAT_VERSION_MICRO) 39 | #define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \ 40 | LIBAVFORMAT_VERSION_MINOR, \ 41 | LIBAVFORMAT_VERSION_MICRO) 42 | #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT 43 | 44 | #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) 45 | 46 | /** 47 | * FF_API_* defines may be placed below to indicate public API that will be 48 | * dropped at a future version bump. The defines themselves are not part of 49 | * the public API and may change, break or disappear at any time. 50 | * 51 | * @note, when bumping the major version it is recommended to manually 52 | * disable each FF_API_* in its own commit instead of disabling them all 53 | * at once through the bump. This improves the git bisect-ability of the change. 54 | * 55 | */ 56 | #ifndef FF_API_LAVF_BITEXACT 57 | #define FF_API_LAVF_BITEXACT (LIBAVFORMAT_VERSION_MAJOR < 58) 58 | #endif 59 | #ifndef FF_API_LAVF_FRAC 60 | #define FF_API_LAVF_FRAC (LIBAVFORMAT_VERSION_MAJOR < 58) 61 | #endif 62 | #ifndef FF_API_LAVF_CODEC_TB 63 | #define FF_API_LAVF_CODEC_TB (LIBAVFORMAT_VERSION_MAJOR < 58) 64 | #endif 65 | #ifndef FF_API_URL_FEOF 66 | #define FF_API_URL_FEOF (LIBAVFORMAT_VERSION_MAJOR < 58) 67 | #endif 68 | #ifndef FF_API_LAVF_FMT_RAWPICTURE 69 | #define FF_API_LAVF_FMT_RAWPICTURE (LIBAVFORMAT_VERSION_MAJOR < 58) 70 | #endif 71 | #ifndef FF_API_COMPUTE_PKT_FIELDS2 72 | #define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 58) 73 | #endif 74 | #ifndef FF_API_OLD_OPEN_CALLBACKS 75 | #define FF_API_OLD_OPEN_CALLBACKS (LIBAVFORMAT_VERSION_MAJOR < 58) 76 | #endif 77 | 78 | #ifndef FF_API_R_FRAME_RATE 79 | #define FF_API_R_FRAME_RATE 1 80 | #endif 81 | #endif /* AVFORMAT_VERSION_H */ 82 | -------------------------------------------------------------------------------- /SharedSource/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 | #ifndef AVUTIL_ADLER32_H 22 | #define AVUTIL_ADLER32_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | /** 28 | * @file 29 | * Public header for libavutil Adler32 hasher 30 | * 31 | * @defgroup lavu_adler32 Adler32 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | /** 37 | * Calculate the Adler32 checksum of a buffer. 38 | * 39 | * Passing the return value to a subsequent av_adler32_update() call 40 | * allows the checksum of multiple buffers to be calculated as though 41 | * they were concatenated. 42 | * 43 | * @param adler initial checksum value 44 | * @param buf pointer to input buffer 45 | * @param len size of input buffer 46 | * @return updated checksum 47 | */ 48 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, 49 | unsigned int len) av_pure; 50 | 51 | /** 52 | * @} 53 | */ 54 | 55 | #endif /* AVUTIL_ADLER32_H */ 56 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 iv 71 | */ 72 | void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv); 73 | 74 | /** 75 | * Increment the top 64 bit of the iv (performed after each frame) 76 | */ 77 | void av_aes_ctr_increment_iv(struct AVAESCTR *a); 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | #endif /* AVUTIL_AES_CTR_H */ 84 | -------------------------------------------------------------------------------- /SharedSource/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 speedloss. 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 | #else 63 | #define av_assert2(cond) ((void)0) 64 | #endif 65 | 66 | #endif /* AVUTIL_AVASSERT_H */ 67 | -------------------------------------------------------------------------------- /SharedSource/libavutil/avconfig.h: -------------------------------------------------------------------------------- 1 | /* Generated by ffconf */ 2 | #ifndef AVUTIL_AVCONFIG_H 3 | #define AVUTIL_AVCONFIG_H 4 | #define AV_HAVE_BIGENDIAN 0 5 | #define AV_HAVE_FAST_UNALIGNED 1 6 | #define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0 7 | #endif /* AVUTIL_AVCONFIG_H */ 8 | -------------------------------------------------------------------------------- /SharedSource/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 | /** 34 | * Decode a base64-encoded string. 35 | * 36 | * @param out buffer for decoded data 37 | * @param in null-terminated input string 38 | * @param out_size size in bytes of the out buffer, must be at 39 | * least 3/4 of the length of in 40 | * @return number of bytes written, or a negative value in case of 41 | * invalid input 42 | */ 43 | int av_base64_decode(uint8_t *out, const char *in, int out_size); 44 | 45 | /** 46 | * Encode data to base64 and null-terminate. 47 | * 48 | * @param out buffer for encoded data 49 | * @param out_size size in bytes of the out buffer (including the 50 | * null terminator), must be at least AV_BASE64_SIZE(in_size) 51 | * @param in input buffer containing the data to encode 52 | * @param in_size size in bytes of the in buffer 53 | * @return out or NULL in case of error 54 | */ 55 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); 56 | 57 | /** 58 | * Calculate the output size needed to base64-encode x bytes to a 59 | * null-terminated string. 60 | */ 61 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | #endif /* AVUTIL_BASE64_H */ 68 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | #ifndef AVUTIL_CRC_H 22 | #define AVUTIL_CRC_H 23 | 24 | #include 25 | #include 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_crc32 CRC32 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | typedef uint32_t AVCRC; 36 | 37 | typedef enum { 38 | AV_CRC_8_ATM, 39 | AV_CRC_16_ANSI, 40 | AV_CRC_16_CCITT, 41 | AV_CRC_32_IEEE, 42 | AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */ 43 | AV_CRC_16_ANSI_LE, /*< reversed bitorder version of AV_CRC_16_ANSI */ 44 | #if FF_API_CRC_BIG_TABLE 45 | AV_CRC_24_IEEE = 12, 46 | #else 47 | AV_CRC_24_IEEE, 48 | #endif /* FF_API_CRC_BIG_TABLE */ 49 | AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */ 50 | }AVCRCId; 51 | 52 | /** 53 | * Initialize a CRC table. 54 | * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024 55 | * @param le If 1, the lowest bit represents the coefficient for the highest 56 | * exponent of the corresponding polynomial (both for poly and 57 | * actual CRC). 58 | * If 0, you must swap the CRC parameter and the result of av_crc 59 | * if you need the standard representation (can be simplified in 60 | * most cases to e.g. bswap16): 61 | * av_bswap32(crc << (32-bits)) 62 | * @param bits number of bits for the CRC 63 | * @param poly generator polynomial without the x**bits coefficient, in the 64 | * representation as specified by le 65 | * @param ctx_size size of ctx in bytes 66 | * @return <0 on failure 67 | */ 68 | int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size); 69 | 70 | /** 71 | * Get an initialized standard CRC table. 72 | * @param crc_id ID of a standard CRC 73 | * @return a pointer to the CRC table or NULL on failure 74 | */ 75 | const AVCRC *av_crc_get_table(AVCRCId crc_id); 76 | 77 | /** 78 | * Calculate the CRC of a block. 79 | * @param crc CRC of previous blocks if any or initial value for CRC 80 | * @return CRC updated with the data from the given block 81 | * 82 | * @see av_crc_init() "le" parameter 83 | */ 84 | uint32_t av_crc(const AVCRC *ctx, uint32_t crc, 85 | const uint8_t *buffer, size_t length) av_pure; 86 | 87 | /** 88 | * @} 89 | */ 90 | 91 | #endif /* AVUTIL_CRC_H */ 92 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/libavutil/display.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Vittorio Giovara 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_DISPLAY_H 22 | #define AVUTIL_DISPLAY_H 23 | 24 | #include 25 | 26 | /** 27 | * The display transformation matrix specifies an affine transformation that 28 | * should be applied to video frames for correct presentation. It is compatible 29 | * with the matrices stored in the ISO/IEC 14496-12 container format. 30 | * 31 | * The data is a 3x3 matrix represented as a 9-element array: 32 | * 33 | * | a b u | 34 | * (a, b, u, c, d, v, x, y, w) -> | c d v | 35 | * | x y w | 36 | * 37 | * All numbers are stored in native endianness, as 16.16 fixed-point values, 38 | * except for u, v and w, which are stored as 2.30 fixed-point values. 39 | * 40 | * The transformation maps a point (p, q) in the source (pre-transformation) 41 | * frame to the point (p', q') in the destination (post-transformation) frame as 42 | * follows: 43 | * | a b u | 44 | * (p, q, 1) . | c d v | = z * (p', q', 1) 45 | * | x y w | 46 | * 47 | * The transformation can also be more explicitly written in components as 48 | * follows: 49 | * p' = (a * p + c * q + x) / z; 50 | * q' = (b * p + d * q + y) / z; 51 | * z = u * p + v * q + w 52 | */ 53 | 54 | /** 55 | * Extract the rotation component of the transformation matrix. 56 | * 57 | * @param matrix the transformation matrix 58 | * @return the angle (in degrees) by which the transformation rotates the frame 59 | * counterclockwise. The angle will be in range [-180.0, 180.0], 60 | * or NaN if the matrix is singular. 61 | * 62 | * @note floating point numbers are inherently inexact, so callers are 63 | * recommended to round the return value to nearest integer before use. 64 | */ 65 | double av_display_rotation_get(const int32_t matrix[9]); 66 | 67 | /** 68 | * Initialize a transformation matrix describing a pure counterclockwise 69 | * rotation by the specified angle (in degrees). 70 | * 71 | * @param matrix an allocated transformation matrix (will be fully overwritten 72 | * by this function) 73 | * @param angle rotation angle in degrees. 74 | */ 75 | void av_display_rotation_set(int32_t matrix[9], double angle); 76 | 77 | /** 78 | * Flip the input matrix horizontally and/or vertically. 79 | * 80 | * @param matrix an allocated transformation matrix 81 | * @param hflip whether the matrix should be flipped horizontally 82 | * @param vflip whether the matrix should be flipped vertically 83 | */ 84 | void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip); 85 | 86 | #endif /* AVUTIL_DISPLAY_H */ 87 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 "3a8a560" 5 | #endif /* AVUTIL_FFVERSION_H */ 6 | -------------------------------------------------------------------------------- /SharedSource/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 | * The returned buffer must be released with av_file_unmap(). 37 | * 38 | * @param log_offset loglevel offset used for logging 39 | * @param log_ctx context used for logging 40 | * @return a non negative number in case of success, a negative value 41 | * corresponding to an AVERROR error code in case of failure 42 | */ 43 | av_warn_unused_result 44 | int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, 45 | int log_offset, void *log_ctx); 46 | 47 | /** 48 | * Unmap or free the buffer bufptr created by av_file_map(). 49 | * 50 | * @param size size in bytes of bufptr, must be the same as returned 51 | * by av_file_map() 52 | */ 53 | void av_file_unmap(uint8_t *bufptr, size_t size); 54 | 55 | /** 56 | * Wrapper to work around the lack of mkstemp() on mingw. 57 | * Also, tries to create file in /tmp first, if possible. 58 | * *prefix can be a character constant; *filename will be allocated internally. 59 | * @return file descriptor of opened file (or negative value corresponding to an 60 | * AVERROR code on error) 61 | * and opened file name in **filename. 62 | * @note On very old libcs it is necessary to set a secure umask before 63 | * calling this, av_tempfile() can't call umask itself as it is used in 64 | * libraries and could interfere with the calling application. 65 | */ 66 | int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); 67 | 68 | #endif /* AVUTIL_FILE_H */ 69 | -------------------------------------------------------------------------------- /SharedSource/libavutil/hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Reimar Döffinger 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_HASH_H 22 | #define AVUTIL_HASH_H 23 | 24 | #include 25 | 26 | struct AVHashContext; 27 | 28 | /** 29 | * Allocate a hash context for the algorithm specified by name. 30 | * 31 | * @return >= 0 for success, a negative error code for failure 32 | * @note The context is not initialized, you must call av_hash_init(). 33 | */ 34 | int av_hash_alloc(struct AVHashContext **ctx, const char *name); 35 | 36 | /** 37 | * Get the names of available hash algorithms. 38 | * 39 | * This function can be used to enumerate the algorithms. 40 | * 41 | * @param i index of the hash algorithm, starting from 0 42 | * @return a pointer to a static string or NULL if i is out of range 43 | */ 44 | const char *av_hash_names(int i); 45 | 46 | /** 47 | * Get the name of the algorithm corresponding to the given hash context. 48 | */ 49 | const char *av_hash_get_name(const struct AVHashContext *ctx); 50 | 51 | /** 52 | * Maximum value that av_hash_get_size will currently return. 53 | * 54 | * You can use this if you absolutely want or need to use static allocation 55 | * and are fine with not supporting hashes newly added to libavutil without 56 | * recompilation. 57 | * Note that you still need to check against av_hash_get_size, adding new hashes 58 | * with larger sizes will not be considered an ABI change and should not cause 59 | * your code to overflow a buffer. 60 | */ 61 | #define AV_HASH_MAX_SIZE 64 62 | 63 | /** 64 | * Get the size of the resulting hash value in bytes. 65 | * 66 | * The pointer passed to av_hash_final have space for at least this many bytes. 67 | */ 68 | int av_hash_get_size(const struct AVHashContext *ctx); 69 | 70 | /** 71 | * Initialize or reset a hash context. 72 | */ 73 | void av_hash_init(struct AVHashContext *ctx); 74 | 75 | /** 76 | * Update a hash context with additional data. 77 | */ 78 | void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len); 79 | 80 | /** 81 | * Finalize a hash context and compute the actual hash value. 82 | */ 83 | void av_hash_final(struct AVHashContext *ctx, uint8_t *dst); 84 | 85 | /** 86 | * Finalize a hash context and compute the actual hash value. 87 | * If size is smaller than the hash size, the hash is truncated; 88 | * if size is larger, the buffer is padded with 0. 89 | */ 90 | void av_hash_final_bin(struct AVHashContext *ctx, uint8_t *dst, int size); 91 | 92 | /** 93 | * Finalize a hash context and compute the actual hash value as a hex string. 94 | * The string is always 0-terminated. 95 | * If size is smaller than 2 * hash_size + 1, the hex string is truncated. 96 | */ 97 | void av_hash_final_hex(struct AVHashContext *ctx, uint8_t *dst, int size); 98 | 99 | /** 100 | * Finalize a hash context and compute the actual hash value as a base64 string. 101 | * The string is always 0-terminated. 102 | * If size is smaller than AV_BASE64_SIZE(hash_size), the base64 string is 103 | * truncated. 104 | */ 105 | void av_hash_final_b64(struct AVHashContext *ctx, uint8_t *dst, int size); 106 | 107 | /** 108 | * Free hash context. 109 | */ 110 | void av_hash_freep(struct AVHashContext **ctx); 111 | 112 | #endif /* AVUTIL_HASH_H */ 113 | -------------------------------------------------------------------------------- /SharedSource/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 = 12, 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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | typedef struct AVLFG { 26 | unsigned int state[64]; 27 | int index; 28 | } AVLFG; 29 | 30 | void av_lfg_init(AVLFG *c, unsigned int seed); 31 | 32 | /** 33 | * Get the next random unsigned 32-bit number using an ALFG. 34 | * 35 | * Please also consider a simple LCG like state= state*1664525+1013904223, 36 | * it may be good enough and faster for your specific use case. 37 | */ 38 | static inline unsigned int av_lfg_get(AVLFG *c){ 39 | c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; 40 | return c->state[c->index++ & 63]; 41 | } 42 | 43 | /** 44 | * Get the next random unsigned 32-bit number using a MLFG. 45 | * 46 | * Please also consider av_lfg_get() above, it is faster. 47 | */ 48 | static inline unsigned int av_mlfg_get(AVLFG *c){ 49 | unsigned int a= c->state[(c->index-55) & 63]; 50 | unsigned int b= c->state[(c->index-24) & 63]; 51 | return c->state[c->index++ & 63] = 2*a*b+a+b; 52 | } 53 | 54 | /** 55 | * Get the next two numbers generated by a Box-Muller Gaussian 56 | * generator using the random numbers issued by lfg. 57 | * 58 | * @param out array where the two generated numbers are placed 59 | */ 60 | void av_bmg_get(AVLFG *lfg, double out[2]); 61 | 62 | #endif /* AVUTIL_LFG_H */ 63 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/libavutil/mastering_display_metadata.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 Neil Birkbeck 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_MASTERING_DISPLAY_METADATA_H 22 | #define AVUTIL_MASTERING_DISPLAY_METADATA_H 23 | 24 | #include "frame.h" 25 | #include "rational.h" 26 | 27 | 28 | /** 29 | * Mastering display metadata capable of representing the color volume of 30 | * the display used to master the content (SMPTE 2086:2014). 31 | * 32 | * To be used as payload of a AVFrameSideData or AVPacketSideData with the 33 | * appropriate type. 34 | * 35 | * @note The struct should be allocated with av_mastering_display_metadata_alloc() 36 | * and its size is not a part of the public ABI. 37 | */ 38 | typedef struct AVMasteringDisplayMetadata { 39 | /** 40 | * CIE 1931 xy chromaticity coords of color primaries (r, g, b order). 41 | */ 42 | AVRational display_primaries[3][2]; 43 | 44 | /** 45 | * CIE 1931 xy chromaticity coords of white point. 46 | */ 47 | AVRational white_point[2]; 48 | 49 | /** 50 | * Min luminance of mastering display (cd/m^2). 51 | */ 52 | AVRational min_luminance; 53 | 54 | /** 55 | * Max luminance of mastering display (cd/m^2). 56 | */ 57 | AVRational max_luminance; 58 | 59 | /** 60 | * Flag indicating whether the display primaries (and white point) are set. 61 | */ 62 | int has_primaries; 63 | 64 | /** 65 | * Flag indicating whether the luminance (min_ and max_) have been set. 66 | */ 67 | int has_luminance; 68 | 69 | } AVMasteringDisplayMetadata; 70 | 71 | /** 72 | * Allocate an AVMasteringDisplayMetadata structure and set its fields to 73 | * default values. The resulting struct can be freed using av_freep(). 74 | * 75 | * @return An AVMasteringDisplayMetadata filled with default values or NULL 76 | * on failure. 77 | */ 78 | AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void); 79 | 80 | /** 81 | * Allocate a complete AVMasteringDisplayMetadata and add it to the frame. 82 | * 83 | * @param frame The frame which side data is added to. 84 | * 85 | * @return The AVMasteringDisplayMetadata structure to be filled by caller. 86 | */ 87 | AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFrame *frame); 88 | 89 | #endif /* AVUTIL_MASTERING_DISPLAY_METADATA_H */ 90 | -------------------------------------------------------------------------------- /SharedSource/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 | #ifndef AVUTIL_MD5_H 22 | #define AVUTIL_MD5_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_md5 MD5 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_md5_size; 36 | 37 | struct AVMD5; 38 | 39 | /** 40 | * Allocate an AVMD5 context. 41 | */ 42 | struct AVMD5 *av_md5_alloc(void); 43 | 44 | /** 45 | * Initialize MD5 hashing. 46 | * 47 | * @param ctx pointer to the function context (of size av_md5_size) 48 | */ 49 | void av_md5_init(struct AVMD5 *ctx); 50 | 51 | /** 52 | * Update hash value. 53 | * 54 | * @param ctx hash function context 55 | * @param src input data to update hash with 56 | * @param len input data length 57 | */ 58 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); 59 | 60 | /** 61 | * Finish hashing and output digest value. 62 | * 63 | * @param ctx hash function context 64 | * @param dst buffer where output digest value is stored 65 | */ 66 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); 67 | 68 | /** 69 | * Hash an array of data. 70 | * 71 | * @param dst The output buffer to write the digest into 72 | * @param src The data to hash 73 | * @param len The length of the data, in bytes 74 | */ 75 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); 76 | 77 | /** 78 | * @} 79 | */ 80 | 81 | #endif /* AVUTIL_MD5_H */ 82 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/libavutil/murmur3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Reimar Döffinger 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_MURMUR3_H 22 | #define AVUTIL_MURMUR3_H 23 | 24 | #include 25 | 26 | struct AVMurMur3 *av_murmur3_alloc(void); 27 | void av_murmur3_init_seeded(struct AVMurMur3 *c, uint64_t seed); 28 | void av_murmur3_init(struct AVMurMur3 *c); 29 | void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len); 30 | void av_murmur3_final(struct AVMurMur3 *c, uint8_t dst[16]); 31 | 32 | #endif /* AVUTIL_MURMUR3_H */ 33 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/libavutil/rational.h: -------------------------------------------------------------------------------- 1 | /* 2 | * rational numbers 3 | * Copyright (c) 2003 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 | /** 23 | * @file 24 | * rational numbers 25 | * @author Michael Niedermayer 26 | */ 27 | 28 | #ifndef AVUTIL_RATIONAL_H 29 | #define AVUTIL_RATIONAL_H 30 | 31 | #include 32 | #include 33 | #include "attributes.h" 34 | 35 | /** 36 | * @addtogroup lavu_math 37 | * @{ 38 | */ 39 | 40 | /** 41 | * rational number numerator/denominator 42 | */ 43 | typedef struct AVRational{ 44 | int num; ///< numerator 45 | int den; ///< denominator 46 | } AVRational; 47 | 48 | /** 49 | * Create a rational. 50 | * Useful for compilers that do not support compound literals. 51 | * @note The return value is not reduced. 52 | */ 53 | static inline AVRational av_make_q(int num, int den) 54 | { 55 | AVRational r = { num, den }; 56 | return r; 57 | } 58 | 59 | /** 60 | * Compare two rationals. 61 | * @param a first rational 62 | * @param b second rational 63 | * @return 0 if a==b, 1 if a>b, -1 if a>63)|1; 70 | else if(b.den && a.den) return 0; 71 | else if(a.num && b.num) return (a.num>>31) - (b.num>>31); 72 | else return INT_MIN; 73 | } 74 | 75 | /** 76 | * Convert rational to double. 77 | * @param a rational to convert 78 | * @return (double) a 79 | */ 80 | static inline double av_q2d(AVRational a){ 81 | return a.num / (double) a.den; 82 | } 83 | 84 | /** 85 | * Reduce a fraction. 86 | * This is useful for framerate calculations. 87 | * @param dst_num destination numerator 88 | * @param dst_den destination denominator 89 | * @param num source numerator 90 | * @param den source denominator 91 | * @param max the maximum allowed for dst_num & dst_den 92 | * @return 1 if exact, 0 otherwise 93 | */ 94 | int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max); 95 | 96 | /** 97 | * Multiply two rationals. 98 | * @param b first rational 99 | * @param c second rational 100 | * @return b*c 101 | */ 102 | AVRational av_mul_q(AVRational b, AVRational c) av_const; 103 | 104 | /** 105 | * Divide one rational by another. 106 | * @param b first rational 107 | * @param c second rational 108 | * @return b/c 109 | */ 110 | AVRational av_div_q(AVRational b, AVRational c) av_const; 111 | 112 | /** 113 | * Add two rationals. 114 | * @param b first rational 115 | * @param c second rational 116 | * @return b+c 117 | */ 118 | AVRational av_add_q(AVRational b, AVRational c) av_const; 119 | 120 | /** 121 | * Subtract one rational from another. 122 | * @param b first rational 123 | * @param c second rational 124 | * @return b-c 125 | */ 126 | AVRational av_sub_q(AVRational b, AVRational c) av_const; 127 | 128 | /** 129 | * Invert a rational. 130 | * @param q value 131 | * @return 1 / q 132 | */ 133 | static av_always_inline AVRational av_inv_q(AVRational q) 134 | { 135 | AVRational r = { q.den, q.num }; 136 | return r; 137 | } 138 | 139 | /** 140 | * Convert a double precision floating point number to a rational. 141 | * inf is expressed as {1,0} or {-1,0} depending on the sign. 142 | * 143 | * @param d double to convert 144 | * @param max the maximum allowed numerator and denominator 145 | * @return (AVRational) d 146 | */ 147 | AVRational av_d2q(double d, int max) av_const; 148 | 149 | /** 150 | * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer 151 | * than q1, 0 if they have the same distance. 152 | */ 153 | int av_nearer_q(AVRational q, AVRational q1, AVRational q2); 154 | 155 | /** 156 | * Find the nearest value in q_list to q. 157 | * @param q_list an array of rationals terminated by {0, 0} 158 | * @return the index of the nearest value found in the array 159 | */ 160 | int av_find_nearest_q_idx(AVRational q, const AVRational* q_list); 161 | 162 | /** 163 | * Converts a AVRational to a IEEE 32bit float. 164 | * 165 | * The float is returned in a uint32_t and its value is platform indepenant. 166 | */ 167 | uint32_t av_q2intfloat(AVRational q); 168 | 169 | /** 170 | * @} 171 | */ 172 | 173 | #endif /* AVUTIL_RATIONAL_H */ 174 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/libavutil/replaygain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of FFmpeg. 4 | * 5 | * FFmpeg is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * FFmpeg is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with FFmpeg; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef AVUTIL_REPLAYGAIN_H 21 | #define AVUTIL_REPLAYGAIN_H 22 | 23 | #include 24 | 25 | /** 26 | * ReplayGain information (see 27 | * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification). 28 | * The size of this struct is a part of the public ABI. 29 | */ 30 | typedef struct AVReplayGain { 31 | /** 32 | * Track replay gain in microbels (divide by 100000 to get the value in dB). 33 | * Should be set to INT32_MIN when unknown. 34 | */ 35 | int32_t track_gain; 36 | /** 37 | * Peak track amplitude, with 100000 representing full scale (but values 38 | * may overflow). 0 when unknown. 39 | */ 40 | uint32_t track_peak; 41 | /** 42 | * Same as track_gain, but for the whole album. 43 | */ 44 | int32_t album_gain; 45 | /** 46 | * Same as track_peak, but for the whole album, 47 | */ 48 | uint32_t album_peak; 49 | } AVReplayGain; 50 | 51 | #endif /* AVUTIL_REPLAYGAIN_H */ 52 | -------------------------------------------------------------------------------- /SharedSource/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 | #ifndef AVUTIL_RIPEMD_H 23 | #define AVUTIL_RIPEMD_H 24 | 25 | #include 26 | 27 | #include "attributes.h" 28 | #include "version.h" 29 | 30 | /** 31 | * @defgroup lavu_ripemd RIPEMD 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_ripemd_size; 37 | 38 | struct AVRIPEMD; 39 | 40 | /** 41 | * Allocate an AVRIPEMD context. 42 | */ 43 | struct AVRIPEMD *av_ripemd_alloc(void); 44 | 45 | /** 46 | * Initialize RIPEMD hashing. 47 | * 48 | * @param context pointer to the function context (of size av_ripemd_size) 49 | * @param bits number of bits in digest (128, 160, 256 or 320 bits) 50 | * @return zero if initialization succeeded, -1 otherwise 51 | */ 52 | int av_ripemd_init(struct AVRIPEMD* context, int bits); 53 | 54 | /** 55 | * Update hash value. 56 | * 57 | * @param context hash function context 58 | * @param data input data to update hash with 59 | * @param len input data length 60 | */ 61 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); 62 | 63 | /** 64 | * Finish hashing and output digest value. 65 | * 66 | * @param context hash function context 67 | * @param digest buffer where output digest value is stored 68 | */ 69 | void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest); 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | #endif /* AVUTIL_RIPEMD_H */ 76 | -------------------------------------------------------------------------------- /SharedSource/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 | #ifndef AVUTIL_SHA_H 22 | #define AVUTIL_SHA_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_sha SHA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_sha_size; 36 | 37 | struct AVSHA; 38 | 39 | /** 40 | * Allocate an AVSHA context. 41 | */ 42 | struct AVSHA *av_sha_alloc(void); 43 | 44 | /** 45 | * Initialize SHA-1 or SHA-2 hashing. 46 | * 47 | * @param context pointer to the function context (of size av_sha_size) 48 | * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits) 49 | * @return zero if initialization succeeded, -1 otherwise 50 | */ 51 | int av_sha_init(struct AVSHA* context, int bits); 52 | 53 | /** 54 | * Update hash value. 55 | * 56 | * @param context hash function context 57 | * @param data input data to update hash with 58 | * @param len input data length 59 | */ 60 | void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); 61 | 62 | /** 63 | * Finish hashing and output digest value. 64 | * 65 | * @param context hash function context 66 | * @param digest buffer where output digest value is stored 67 | */ 68 | void av_sha_final(struct AVSHA* context, uint8_t *digest); 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | #endif /* AVUTIL_SHA_H */ 75 | -------------------------------------------------------------------------------- /SharedSource/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 | #ifndef AVUTIL_SHA512_H 23 | #define AVUTIL_SHA512_H 24 | 25 | #include 26 | 27 | #include "attributes.h" 28 | #include "version.h" 29 | 30 | /** 31 | * @defgroup lavu_sha512 SHA512 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_sha512_size; 37 | 38 | struct AVSHA512; 39 | 40 | /** 41 | * Allocate an AVSHA512 context. 42 | */ 43 | struct AVSHA512 *av_sha512_alloc(void); 44 | 45 | /** 46 | * Initialize SHA-2 512 hashing. 47 | * 48 | * @param context pointer to the function context (of size av_sha512_size) 49 | * @param bits number of bits in digest (224, 256, 384 or 512 bits) 50 | * @return zero if initialization succeeded, -1 otherwise 51 | */ 52 | int av_sha512_init(struct AVSHA512* context, int bits); 53 | 54 | /** 55 | * Update hash value. 56 | * 57 | * @param context hash function context 58 | * @param data input data to update hash with 59 | * @param len input data length 60 | */ 61 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len); 62 | 63 | /** 64 | * Finish hashing and output digest value. 65 | * 66 | * @param context hash function context 67 | * @param digest buffer where output digest value is stored 68 | */ 69 | void av_sha512_final(struct AVSHA512* context, uint8_t *digest); 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | #endif /* AVUTIL_SHA512_H */ 76 | -------------------------------------------------------------------------------- /SharedSource/libavutil/stereo3d.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Vittorio Giovara 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_STEREO3D_H 22 | #define AVUTIL_STEREO3D_H 23 | 24 | #include 25 | 26 | #include "frame.h" 27 | 28 | /** 29 | * List of possible 3D Types 30 | */ 31 | enum AVStereo3DType { 32 | /** 33 | * Video is not stereoscopic (and metadata has to be there). 34 | */ 35 | AV_STEREO3D_2D, 36 | 37 | /** 38 | * Views are next to each other. 39 | * 40 | * LLLLRRRR 41 | * LLLLRRRR 42 | * LLLLRRRR 43 | * ... 44 | */ 45 | AV_STEREO3D_SIDEBYSIDE, 46 | 47 | /** 48 | * Views are on top of each other. 49 | * 50 | * LLLLLLLL 51 | * LLLLLLLL 52 | * RRRRRRRR 53 | * RRRRRRRR 54 | */ 55 | AV_STEREO3D_TOPBOTTOM, 56 | 57 | /** 58 | * Views are alternated temporally. 59 | * 60 | * frame0 frame1 frame2 ... 61 | * LLLLLLLL RRRRRRRR LLLLLLLL 62 | * LLLLLLLL RRRRRRRR LLLLLLLL 63 | * LLLLLLLL RRRRRRRR LLLLLLLL 64 | * ... ... ... 65 | */ 66 | AV_STEREO3D_FRAMESEQUENCE, 67 | 68 | /** 69 | * Views are packed in a checkerboard-like structure per pixel. 70 | * 71 | * LRLRLRLR 72 | * RLRLRLRL 73 | * LRLRLRLR 74 | * ... 75 | */ 76 | AV_STEREO3D_CHECKERBOARD, 77 | 78 | /** 79 | * Views are next to each other, but when upscaling 80 | * apply a checkerboard pattern. 81 | * 82 | * LLLLRRRR L L L L R R R R 83 | * LLLLRRRR => L L L L R R R R 84 | * LLLLRRRR L L L L R R R R 85 | * LLLLRRRR L L L L R R R R 86 | */ 87 | AV_STEREO3D_SIDEBYSIDE_QUINCUNX, 88 | 89 | /** 90 | * Views are packed per line, as if interlaced. 91 | * 92 | * LLLLLLLL 93 | * RRRRRRRR 94 | * LLLLLLLL 95 | * ... 96 | */ 97 | AV_STEREO3D_LINES, 98 | 99 | /** 100 | * Views are packed per column. 101 | * 102 | * LRLRLRLR 103 | * LRLRLRLR 104 | * LRLRLRLR 105 | * ... 106 | */ 107 | AV_STEREO3D_COLUMNS, 108 | }; 109 | 110 | 111 | /** 112 | * Inverted views, Right/Bottom represents the left view. 113 | */ 114 | #define AV_STEREO3D_FLAG_INVERT (1 << 0) 115 | 116 | /** 117 | * Stereo 3D type: this structure describes how two videos are packed 118 | * within a single video surface, with additional information as needed. 119 | * 120 | * @note The struct must be allocated with av_stereo3d_alloc() and 121 | * its size is not a part of the public ABI. 122 | */ 123 | typedef struct AVStereo3D { 124 | /** 125 | * How views are packed within the video. 126 | */ 127 | enum AVStereo3DType type; 128 | 129 | /** 130 | * Additional information about the frame packing. 131 | */ 132 | int flags; 133 | } AVStereo3D; 134 | 135 | /** 136 | * Allocate an AVStereo3D structure and set its fields to default values. 137 | * The resulting struct can be freed using av_freep(). 138 | * 139 | * @return An AVStereo3D filled with default values or NULL on failure. 140 | */ 141 | AVStereo3D *av_stereo3d_alloc(void); 142 | 143 | /** 144 | * Allocate a complete AVFrameSideData and add it to the frame. 145 | * 146 | * @param frame The frame which side data is added to. 147 | * 148 | * @return The AVStereo3D structure to be filled by caller. 149 | */ 150 | AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame); 151 | 152 | #endif /* AVUTIL_STEREO3D_H */ 153 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/libavutil/threadmessage.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 License 6 | * 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 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with FFmpeg; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_THREADMESSAGE_H 20 | #define AVUTIL_THREADMESSAGE_H 21 | 22 | typedef struct AVThreadMessageQueue AVThreadMessageQueue; 23 | 24 | typedef enum AVThreadMessageFlags { 25 | 26 | /** 27 | * Perform non-blocking operation. 28 | * If this flag is set, send and recv operations are non-blocking and 29 | * return AVERROR(EAGAIN) immediately if they can not proceed. 30 | */ 31 | AV_THREAD_MESSAGE_NONBLOCK = 1, 32 | 33 | } AVThreadMessageFlags; 34 | 35 | /** 36 | * Allocate a new message queue. 37 | * 38 | * @param mq pointer to the message queue 39 | * @param nelem maximum number of elements in the queue 40 | * @param elsize size of each element in the queue 41 | * @return >=0 for success; <0 for error, in particular AVERROR(ENOSYS) if 42 | * lavu was built without thread support 43 | */ 44 | int av_thread_message_queue_alloc(AVThreadMessageQueue **mq, 45 | unsigned nelem, 46 | unsigned elsize); 47 | 48 | /** 49 | * Free a message queue. 50 | * 51 | * The message queue must no longer be in use by another thread. 52 | */ 53 | void av_thread_message_queue_free(AVThreadMessageQueue **mq); 54 | 55 | /** 56 | * Send a message on the queue. 57 | */ 58 | int av_thread_message_queue_send(AVThreadMessageQueue *mq, 59 | void *msg, 60 | unsigned flags); 61 | 62 | /** 63 | * Receive a message from the queue. 64 | */ 65 | int av_thread_message_queue_recv(AVThreadMessageQueue *mq, 66 | void *msg, 67 | unsigned flags); 68 | 69 | /** 70 | * Set the sending error code. 71 | * 72 | * If the error code is set to non-zero, av_thread_message_queue_recv() will 73 | * return it immediately when there are no longer available messages. 74 | * Conventional values, such as AVERROR_EOF or AVERROR(EAGAIN), can be used 75 | * to cause the receiving thread to stop or suspend its operation. 76 | */ 77 | void av_thread_message_queue_set_err_send(AVThreadMessageQueue *mq, 78 | int err); 79 | 80 | /** 81 | * Set the receiving error code. 82 | * 83 | * If the error code is set to non-zero, av_thread_message_queue_send() will 84 | * return it immediately. Conventional values, such as AVERROR_EOF or 85 | * AVERROR(EAGAIN), can be used to cause the sending thread to stop or 86 | * suspend its operation. 87 | */ 88 | void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq, 89 | int err); 90 | 91 | /** 92 | * Set the optional free message callback function which will be called if an 93 | * operation is removing messages from the queue. 94 | */ 95 | void av_thread_message_queue_set_free_func(AVThreadMessageQueue *mq, 96 | void (*free_func)(void *msg)); 97 | 98 | /** 99 | * Flush the message queue 100 | * 101 | * This function is mostly equivalent to reading and free-ing every message 102 | * except that it will be done in a single operation (no lock/unlock between 103 | * reads). 104 | */ 105 | void av_thread_message_flush(AVThreadMessageQueue *mq); 106 | 107 | #endif /* AVUTIL_THREADMESSAGE_H */ 108 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/libavutil/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 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_VERSION_H 22 | #define AVUTIL_VERSION_H 23 | 24 | #include "macros.h" 25 | 26 | /** 27 | * @addtogroup version_utils 28 | * 29 | * Useful to check and match library version in order to maintain 30 | * backward compatibility. 31 | * 32 | * @{ 33 | */ 34 | 35 | #define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c)) 36 | #define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c 37 | #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) 38 | 39 | /** 40 | * Extract version components from the full ::AV_VERSION_INT int as returned 41 | * by functions like ::avformat_version() and ::avcodec_version() 42 | */ 43 | #define AV_VERSION_MAJOR(a) ((a) >> 16) 44 | #define AV_VERSION_MINOR(a) (((a) & 0x00FF00) >> 8) 45 | #define AV_VERSION_MICRO(a) ((a) & 0xFF) 46 | 47 | /** 48 | * @} 49 | */ 50 | 51 | /** 52 | * @file 53 | * @ingroup lavu 54 | * Libavutil version macros 55 | */ 56 | 57 | /** 58 | * @defgroup lavu_ver Version and Build diagnostics 59 | * 60 | * Macros and function useful to check at compiletime and at runtime 61 | * which version of libavutil is in use. 62 | * 63 | * @{ 64 | */ 65 | 66 | #define LIBAVUTIL_VERSION_MAJOR 55 67 | #define LIBAVUTIL_VERSION_MINOR 17 68 | #define LIBAVUTIL_VERSION_MICRO 103 69 | 70 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ 71 | LIBAVUTIL_VERSION_MINOR, \ 72 | LIBAVUTIL_VERSION_MICRO) 73 | #define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \ 74 | LIBAVUTIL_VERSION_MINOR, \ 75 | LIBAVUTIL_VERSION_MICRO) 76 | #define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT 77 | 78 | #define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) 79 | 80 | /** 81 | * @} 82 | * 83 | * @defgroup depr_guards Deprecation guards 84 | * FF_API_* defines may be placed below to indicate public API that will be 85 | * dropped at a future version bump. The defines themselves are not part of 86 | * the public API and may change, break or disappear at any time. 87 | * 88 | * @note, when bumping the major version it is recommended to manually 89 | * disable each FF_API_* in its own commit instead of disabling them all 90 | * at once through the bump. This improves the git bisect-ability of the change. 91 | * 92 | * @{ 93 | */ 94 | 95 | #ifndef FF_API_VDPAU 96 | #define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 56) 97 | #endif 98 | #ifndef FF_API_XVMC 99 | #define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 56) 100 | #endif 101 | #ifndef FF_API_OPT_TYPE_METADATA 102 | #define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 56) 103 | #endif 104 | #ifndef FF_API_DLOG 105 | #define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 56) 106 | #endif 107 | #ifndef FF_API_VAAPI 108 | #define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 56) 109 | #endif 110 | #ifndef FF_API_FRAME_QP 111 | #define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 56) 112 | #endif 113 | #ifndef FF_API_PLUS1_MINUS1 114 | #define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 56) 115 | #endif 116 | #ifndef FF_API_ERROR_FRAME 117 | #define FF_API_ERROR_FRAME (LIBAVUTIL_VERSION_MAJOR < 56) 118 | #endif 119 | #ifndef FF_API_CRC_BIG_TABLE 120 | #define FF_API_CRC_BIG_TABLE (LIBAVUTIL_VERSION_MAJOR < 56) 121 | #endif 122 | 123 | 124 | /** 125 | * @} 126 | */ 127 | 128 | #endif /* AVUTIL_VERSION_H */ 129 | -------------------------------------------------------------------------------- /SharedSource/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 | -------------------------------------------------------------------------------- /SharedSource/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 | * @{ 33 | */ 34 | 35 | #include "libpostproc/version.h" 36 | 37 | /** 38 | * Return the LIBPOSTPROC_VERSION_INT constant. 39 | */ 40 | unsigned postproc_version(void); 41 | 42 | /** 43 | * Return the libpostproc build-time configuration. 44 | */ 45 | const char *postproc_configuration(void); 46 | 47 | /** 48 | * Return the libpostproc license. 49 | */ 50 | const char *postproc_license(void); 51 | 52 | #define PP_QUALITY_MAX 6 53 | 54 | #if FF_API_QP_TYPE 55 | #define QP_STORE_T int8_t //deprecated 56 | #endif 57 | 58 | #include 59 | 60 | typedef void pp_context; 61 | typedef void pp_mode; 62 | 63 | #if LIBPOSTPROC_VERSION_INT < (52<<16) 64 | typedef pp_context pp_context_t; 65 | typedef pp_mode pp_mode_t; 66 | extern const char *const pp_help; ///< a simple help text 67 | #else 68 | extern const char pp_help[]; ///< a simple help text 69 | #endif 70 | 71 | void pp_postprocess(const uint8_t * src[3], const int srcStride[3], 72 | uint8_t * dst[3], const int dstStride[3], 73 | int horizontalSize, int verticalSize, 74 | const int8_t *QP_store, int QP_stride, 75 | pp_mode *mode, pp_context *ppContext, int pict_type); 76 | 77 | 78 | /** 79 | * Return a pp_mode or NULL if an error occurred. 80 | * 81 | * @param name the string after "-pp" on the command line 82 | * @param quality a number from 0 to PP_QUALITY_MAX 83 | */ 84 | pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality); 85 | void pp_free_mode(pp_mode *mode); 86 | 87 | pp_context *pp_get_context(int width, int height, int flags); 88 | void pp_free_context(pp_context *ppContext); 89 | 90 | #define PP_CPU_CAPS_MMX 0x80000000 91 | #define PP_CPU_CAPS_MMX2 0x20000000 92 | #define PP_CPU_CAPS_3DNOW 0x40000000 93 | #define PP_CPU_CAPS_ALTIVEC 0x10000000 94 | #define PP_CPU_CAPS_AUTO 0x00080000 95 | 96 | #define PP_FORMAT 0x00000008 97 | #define PP_FORMAT_420 (0x00000011|PP_FORMAT) 98 | #define PP_FORMAT_422 (0x00000001|PP_FORMAT) 99 | #define PP_FORMAT_411 (0x00000002|PP_FORMAT) 100 | #define PP_FORMAT_444 (0x00000000|PP_FORMAT) 101 | #define PP_FORMAT_440 (0x00000010|PP_FORMAT) 102 | 103 | #define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale 104 | 105 | /** 106 | * @} 107 | */ 108 | 109 | #endif /* POSTPROC_POSTPROCESS_H */ 110 | -------------------------------------------------------------------------------- /SharedSource/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 54 32 | #define LIBPOSTPROC_VERSION_MINOR 0 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 | #ifndef FF_API_QP_TYPE 46 | #define FF_API_QP_TYPE (LIBPOSTPROC_VERSION_MAJOR < 55) 47 | #endif 48 | 49 | #endif /* POSTPROC_VERSION_H */ 50 | -------------------------------------------------------------------------------- /SharedSource/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 2 32 | #define LIBSWRESAMPLE_VERSION_MINOR 0 33 | #define LIBSWRESAMPLE_VERSION_MICRO 101 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 | -------------------------------------------------------------------------------- /SharedSource/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 4 30 | #define LIBSWSCALE_VERSION_MINOR 0 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 | #endif /* SWSCALE_VERSION_H */ 50 | -------------------------------------------------------------------------------- /SharedSource/x264_config.h: -------------------------------------------------------------------------------- 1 | #define X264_BIT_DEPTH 8 2 | #define X264_GPL 1 3 | #define X264_INTERLACED 1 4 | #define X264_CHROMA_FORMAT 0 5 | #define X264_VERSION "" 6 | #define X264_POINTVER "0.148.x" 7 | --------------------------------------------------------------------------------