├── README.md
├── stdafx.h
├── RtmpH264.cpp
├── RtmpH264.h
├── dllmain.cpp
├── stdafx.cpp
├── targetver.h
├── Lib
├── avutil.lib
├── MyLibrtmp.lib
├── libeay32.lib
├── libfaac.dll
├── libfaac.lib
├── libmp4v2.dll
├── libmp4v2.lib
├── librtmp.dll
├── librtmp.lib
├── libx264.lib
├── postproc.lib
├── rtmpmod.lib
├── ssleay32.lib
├── swscale-4.dll
├── swscale.lib
├── zlibwapi.lib
├── libx264-146.dll
├── swresample.lib
├── Caixin.Audio.dll
├── libpostproc.dll.a
├── libswscale.dll.a
├── libswresample.dll.a
├── postproc-53.def
└── swresample-1.def
├── RecordVideoH264.h
├── librtmp_send264.h
├── RecordVideoH264.cpp
├── librtmp_send264.cpp
├── RtmpH264.vcxproj.user
├── include
├── libavutil
│ ├── ffversion.h
│ ├── avconfig.h
│ ├── murmur3.h
│ ├── macros.h
│ ├── random_seed.h
│ ├── adler32.h
│ ├── replaygain.h
│ ├── motion_vector.h
│ ├── time.h
│ ├── intfloat.h
│ ├── aes.h
│ ├── rc4.h
│ ├── lfg.h
│ ├── sha.h
│ ├── pixelutils.h
│ ├── md5.h
│ ├── lzo.h
│ ├── tea.h
│ ├── ripemd.h
│ ├── sha512.h
│ ├── base64.h
│ ├── avassert.h
│ ├── camellia.h
│ ├── aes_ctr.h
│ ├── twofish.h
│ ├── des.h
│ ├── blowfish.h
│ ├── file.h
│ ├── cast5.h
│ ├── timestamp.h
│ ├── xtea.h
│ ├── crc.h
│ ├── hmac.h
│ ├── bswap.h
│ ├── display.h
│ ├── downmix_info.h
│ ├── hash.h
│ ├── threadmessage.h
│ ├── stereo3d.h
│ ├── version.h
│ ├── rational.h
│ ├── attributes.h
│ ├── cpu.h
│ ├── eval.h
│ ├── timecode.h
│ ├── audio_fifo.h
│ ├── error.h
│ ├── mathematics.h
│ ├── tree.h
│ └── fifo.h
├── mp4v2
│ ├── project.h
│ ├── project.h.in
│ ├── mp4v2.h
│ ├── platform.h
│ ├── isma.h
│ ├── file_prop.h
│ └── streaming.h
├── librtmp
│ ├── http.h
│ ├── log.h
│ ├── bytes.h
│ ├── rtmp_sys.h
│ └── amf.h
└── libswscale
│ └── version.h
├── x264_config.h
├── RtmpH264.sln
├── ReadMe.txt
├── RtmpH264.vcxproj.filters
├── faac.h
└── faaccfg.h
/README.md:
--------------------------------------------------------------------------------
1 | # LibRtmpH264
2 | 自己用的一个windows下的动态链接库 集成了RTMP推流 H264编码
3 |
--------------------------------------------------------------------------------
/stdafx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/stdafx.h
--------------------------------------------------------------------------------
/RtmpH264.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/RtmpH264.cpp
--------------------------------------------------------------------------------
/RtmpH264.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/RtmpH264.h
--------------------------------------------------------------------------------
/dllmain.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/dllmain.cpp
--------------------------------------------------------------------------------
/stdafx.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/stdafx.cpp
--------------------------------------------------------------------------------
/targetver.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/targetver.h
--------------------------------------------------------------------------------
/Lib/avutil.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/avutil.lib
--------------------------------------------------------------------------------
/Lib/MyLibrtmp.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/MyLibrtmp.lib
--------------------------------------------------------------------------------
/Lib/libeay32.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libeay32.lib
--------------------------------------------------------------------------------
/Lib/libfaac.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libfaac.dll
--------------------------------------------------------------------------------
/Lib/libfaac.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libfaac.lib
--------------------------------------------------------------------------------
/Lib/libmp4v2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libmp4v2.dll
--------------------------------------------------------------------------------
/Lib/libmp4v2.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libmp4v2.lib
--------------------------------------------------------------------------------
/Lib/librtmp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/librtmp.dll
--------------------------------------------------------------------------------
/Lib/librtmp.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/librtmp.lib
--------------------------------------------------------------------------------
/Lib/libx264.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libx264.lib
--------------------------------------------------------------------------------
/Lib/postproc.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/postproc.lib
--------------------------------------------------------------------------------
/Lib/rtmpmod.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/rtmpmod.lib
--------------------------------------------------------------------------------
/Lib/ssleay32.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/ssleay32.lib
--------------------------------------------------------------------------------
/Lib/swscale-4.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/swscale-4.dll
--------------------------------------------------------------------------------
/Lib/swscale.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/swscale.lib
--------------------------------------------------------------------------------
/Lib/zlibwapi.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/zlibwapi.lib
--------------------------------------------------------------------------------
/RecordVideoH264.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/RecordVideoH264.h
--------------------------------------------------------------------------------
/librtmp_send264.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/librtmp_send264.h
--------------------------------------------------------------------------------
/Lib/libx264-146.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libx264-146.dll
--------------------------------------------------------------------------------
/Lib/swresample.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/swresample.lib
--------------------------------------------------------------------------------
/RecordVideoH264.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/RecordVideoH264.cpp
--------------------------------------------------------------------------------
/librtmp_send264.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/librtmp_send264.cpp
--------------------------------------------------------------------------------
/Lib/Caixin.Audio.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/Caixin.Audio.dll
--------------------------------------------------------------------------------
/Lib/libpostproc.dll.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libpostproc.dll.a
--------------------------------------------------------------------------------
/Lib/libswscale.dll.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libswscale.dll.a
--------------------------------------------------------------------------------
/Lib/libswresample.dll.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/njk888/LibRtmpH264/HEAD/Lib/libswresample.dll.a
--------------------------------------------------------------------------------
/RtmpH264.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/include/libavutil/ffversion.h:
--------------------------------------------------------------------------------
1 | /* Automatically generated by version.sh, do not manually edit! */
2 | #ifndef AVUTIL_FFVERSION_H
3 | #define AVUTIL_FFVERSION_H
4 | #define FFMPEG_VERSION "N-77432-gc0f67e1"
5 | #endif /* AVUTIL_FFVERSION_H */
6 |
--------------------------------------------------------------------------------
/include/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 |
--------------------------------------------------------------------------------
/x264_config.h:
--------------------------------------------------------------------------------
1 | #define X264_BIT_DEPTH 8
2 | #define X264_GPL 1
3 | #define X264_INTERLACED 0
4 | #define X264_CHROMA_FORMAT 0
5 | #define X264_REV 2538
6 | #define X264_REV_DIFF 0
7 | #define X264_VERSION " r2538 121396c"
8 | #define X264_POINTVER "0.146.2538 121396c"
9 |
--------------------------------------------------------------------------------
/Lib/postproc-53.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 |
--------------------------------------------------------------------------------
/Lib/swresample-1.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_init
14 | swr_inject_silence
15 | swr_is_initialized
16 | swr_next_pts
17 | swr_set_channel_mapping
18 | swr_set_compensation
19 | swr_set_matrix
20 | swresample_configuration
21 | swresample_license
22 | swresample_version
23 |
--------------------------------------------------------------------------------
/RtmpH264.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RtmpH264", "RtmpH264.vcxproj", "{C4612ECF-DEBE-4A83-9916-3DF14DA5E228}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {C4612ECF-DEBE-4A83-9916-3DF14DA5E228}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {C4612ECF-DEBE-4A83-9916-3DF14DA5E228}.Debug|Win32.Build.0 = Debug|Win32
14 | {C4612ECF-DEBE-4A83-9916-3DF14DA5E228}.Release|Win32.ActiveCfg = Release|Win32
15 | {C4612ECF-DEBE-4A83-9916-3DF14DA5E228}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/ReadMe.txt:
--------------------------------------------------------------------------------
1 | ========================================================================
2 | 动态链接库:RtmpH264 项目概述
3 | ========================================================================
4 |
5 | 应用程序向导已为您创建了此 RtmpH264 DLL。
6 |
7 | 本文件概要介绍组成 RtmpH264 应用程序的每个文件的内容。
8 |
9 |
10 | RtmpH264.vcxproj
11 | 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
12 |
13 | RtmpH264.vcxproj.filters
14 | 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。
15 |
16 | RtmpH264.cpp
17 | 这是主 DLL 源文件。
18 |
19 | 此 DLL 在创建时不导出任何符号。因此,生成时不会产生 .lib 文件。如果希望此项目成为其他某个项目的项目依赖项,则需要添加代码以从 DLL 导出某些符号,以便产生一个导出库,或者,也可以在项目“属性页”对话框中的“链接器”文件夹中,将“常规”属性页上的“忽略输入库”属性设置为“是”。
20 |
21 | /////////////////////////////////////////////////////////////////////////////
22 | 其他标准文件:
23 |
24 | StdAfx.h, StdAfx.cpp
25 | 这些文件用于生成名为 RtmpH264.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。
26 |
27 | /////////////////////////////////////////////////////////////////////////////
28 | 其他注释:
29 |
30 | 应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。
31 |
32 | /////////////////////////////////////////////////////////////////////////////
33 |
--------------------------------------------------------------------------------
/include/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 |
--------------------------------------------------------------------------------
/include/libavutil/macros.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | /**
20 | * @file
21 | * @ingroup lavu
22 | * Utility Preprocessor macros
23 | */
24 |
25 | #ifndef AVUTIL_MACROS_H
26 | #define AVUTIL_MACROS_H
27 |
28 | /**
29 | * @addtogroup preproc_misc Preprocessor String Macros
30 | *
31 | * String manipulation macros
32 | *
33 | * @{
34 | */
35 |
36 | #define AV_STRINGIFY(s) AV_TOSTRING(s)
37 | #define AV_TOSTRING(s) #s
38 |
39 | #define AV_GLUE(a, b) a ## b
40 | #define AV_JOIN(a, b) AV_GLUE(a, b)
41 |
42 | /**
43 | * @}
44 | */
45 |
46 | #define AV_PRAGMA(s) _Pragma(#s)
47 |
48 | #endif /* AVUTIL_MACROS_H */
49 |
--------------------------------------------------------------------------------
/include/libavutil/random_seed.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 Baptiste Coudurier
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 |
--------------------------------------------------------------------------------
/include/mp4v2/project.h:
--------------------------------------------------------------------------------
1 | #ifndef MP4V2_PROJECT_H
2 | #define MP4V2_PROJECT_H
3 |
4 | /*****************************************************************************/
5 |
6 | #define MP4V2_PROJECT_name "MP4v2"
7 | #define MP4V2_PROJECT_name_lower "mp4v2"
8 | #define MP4V2_PROJECT_name_upper "MP4V2"
9 | #define MP4V2_PROJECT_name_formal "MP4v2 2.0.0"
10 | #define MP4V2_PROJECT_url_website "http://code.google.com/p/mp4v2"
11 | #define MP4V2_PROJECT_url_downloads "http://code.google.com/p/mp4v2/downloads/list"
12 | #define MP4V2_PROJECT_url_discussion "http://groups.google.com/group/mp4v2"
13 | #define MP4V2_PROJECT_irc "irc://irc.freenode.net/handbrake"
14 | #define MP4V2_PROJECT_bugreport ""
15 | #define MP4V2_PROJECT_version "2.0.0"
16 | #define MP4V2_PROJECT_version_hex 0x00020000
17 | #define MP4V2_PROJECT_version_major 2
18 | #define MP4V2_PROJECT_version_minor 0
19 | #define MP4V2_PROJECT_version_point 0
20 | #define MP4V2_PROJECT_repo_url "https://mp4v2.googlecode.com/svn/releases/2.0.0"
21 | #define MP4V2_PROJECT_repo_branch "2.0.0"
22 | #define MP4V2_PROJECT_repo_root "https://mp4v2.googlecode.com/svn"
23 | #define MP4V2_PROJECT_repo_uuid "6e6572fa-98a6-11dd-ad9f-f77439c74b79"
24 | #define MP4V2_PROJECT_repo_rev 493
25 | #define MP4V2_PROJECT_repo_date "2012-05-20 15:16:54 -0700 (Sun, 20 May 2012)"
26 | #define MP4V2_PROJECT_repo_type "stable"
27 | #define MP4V2_PROJECT_build "Mon Jan 21 10:15:40 EST 2013"
28 |
29 | /*****************************************************************************/
30 |
31 | #endif /* MP4V2_PROJECT_H */
32 |
--------------------------------------------------------------------------------
/include/mp4v2/project.h.in:
--------------------------------------------------------------------------------
1 | #ifndef MP4V2_PROJECT_H
2 | #define MP4V2_PROJECT_H
3 |
4 | /*****************************************************************************/
5 |
6 | #define MP4V2_PROJECT_name "@PROJECT_name@"
7 | #define MP4V2_PROJECT_name_lower "@PROJECT_name_lower@"
8 | #define MP4V2_PROJECT_name_upper "@PROJECT_name_upper@"
9 | #define MP4V2_PROJECT_name_formal "@PROJECT_name_formal@"
10 | #define MP4V2_PROJECT_url_website "@PROJECT_url_website@"
11 | #define MP4V2_PROJECT_url_downloads "@PROJECT_url_downloads@"
12 | #define MP4V2_PROJECT_url_discussion "@PROJECT_url_discussion@"
13 | #define MP4V2_PROJECT_irc "@PROJECT_irc@"
14 | #define MP4V2_PROJECT_bugreport "@PROJECT_bugreport@"
15 | #define MP4V2_PROJECT_version "@PROJECT_version@"
16 | #define MP4V2_PROJECT_version_hex @PROJECT_version_hex@
17 | #define MP4V2_PROJECT_version_major @PROJECT_version_major@
18 | #define MP4V2_PROJECT_version_minor @PROJECT_version_minor@
19 | #define MP4V2_PROJECT_version_point @PROJECT_version_point@
20 | #define MP4V2_PROJECT_repo_url "@PROJECT_repo_url@"
21 | #define MP4V2_PROJECT_repo_branch "@PROJECT_repo_branch@"
22 | #define MP4V2_PROJECT_repo_root "@PROJECT_repo_root@"
23 | #define MP4V2_PROJECT_repo_uuid "@PROJECT_repo_uuid@"
24 | #define MP4V2_PROJECT_repo_rev @PROJECT_repo_rev@
25 | #define MP4V2_PROJECT_repo_date "@PROJECT_repo_date@"
26 | #define MP4V2_PROJECT_repo_type "@PROJECT_repo_type@"
27 | #define MP4V2_PROJECT_build "@PROJECT_build@"
28 |
29 | /*****************************************************************************/
30 |
31 | #endif /* MP4V2_PROJECT_H */
32 |
--------------------------------------------------------------------------------
/include/libavutil/adler32.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Mans Rullgard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #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 |
--------------------------------------------------------------------------------
/include/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 |
--------------------------------------------------------------------------------
/include/librtmp/http.h:
--------------------------------------------------------------------------------
1 | #ifndef __RTMP_HTTP_H__
2 | #define __RTMP_HTTP_H__
3 | /*
4 | * Copyright (C) 2010 Howard Chu
5 | * Copyright (C) 2010 Antti Ajanki
6 | *
7 | * This file is part of librtmp.
8 | *
9 | * librtmp is free software; you can redistribute it and/or modify
10 | * it under the terms of the GNU Lesser General Public License as
11 | * published by the Free Software Foundation; either version 2.1,
12 | * or (at your option) any later version.
13 | *
14 | * librtmp 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
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU Lesser General Public License
20 | * along with librtmp see the file COPYING. If not, write to
21 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 | * Boston, MA 02110-1301, USA.
23 | * http://www.gnu.org/copyleft/lgpl.html
24 | */
25 |
26 | typedef enum {
27 | HTTPRES_OK, /* result OK */
28 | HTTPRES_OK_NOT_MODIFIED, /* not modified since last request */
29 | HTTPRES_NOT_FOUND, /* not found */
30 | HTTPRES_BAD_REQUEST, /* client error */
31 | HTTPRES_SERVER_ERROR, /* server reported an error */
32 | HTTPRES_REDIRECTED, /* resource has been moved */
33 | HTTPRES_LOST_CONNECTION /* connection lost while waiting for data */
34 | } HTTPResult;
35 |
36 | struct HTTP_ctx {
37 | char *date;
38 | int size;
39 | int status;
40 | void *data;
41 | };
42 |
43 | typedef size_t (HTTP_read_callback)(void *ptr, size_t size, size_t nmemb, void *stream);
44 |
45 | HTTPResult HTTP_get(struct HTTP_ctx *http, const char *url, HTTP_read_callback *cb);
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/include/libavutil/motion_vector.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_MOTION_VECTOR_H
20 | #define AVUTIL_MOTION_VECTOR_H
21 |
22 | #include
23 |
24 | typedef struct AVMotionVector {
25 | /**
26 | * Where the current macroblock comes from; negative value when it comes
27 | * from the past, positive value when it comes from the future.
28 | * XXX: set exact relative ref frame reference instead of a +/- 1 "direction".
29 | */
30 | int32_t source;
31 | /**
32 | * Width and height of the block.
33 | */
34 | uint8_t w, h;
35 | /**
36 | * Absolute source position. Can be outside the frame area.
37 | */
38 | int16_t src_x, src_y;
39 | /**
40 | * Absolute destination position. Can be outside the frame area.
41 | */
42 | int16_t dst_x, dst_y;
43 | /**
44 | * Extra flag information.
45 | * Currently unused.
46 | */
47 | uint64_t flags;
48 | /**
49 | * Motion vector
50 | * src_x = dst_x + motion_x / motion_scale
51 | * src_y = dst_y + motion_y / motion_scale
52 | */
53 | int32_t motion_x, motion_y;
54 | uint16_t motion_scale;
55 | } AVMotionVector;
56 |
57 | #endif /* AVUTIL_MOTION_VECTOR_H */
58 |
--------------------------------------------------------------------------------
/include/libswscale/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef SWSCALE_VERSION_H
20 | #define SWSCALE_VERSION_H
21 |
22 | /**
23 | * @file
24 | * swscale version macros
25 | */
26 |
27 | #include "libavutil/version.h"
28 |
29 | #define LIBSWSCALE_VERSION_MAJOR 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 |
--------------------------------------------------------------------------------
/include/libavutil/time.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2000-2003 Fabrice Bellard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_TIME_H
22 | #define AVUTIL_TIME_H
23 |
24 | #include
25 |
26 | /**
27 | * Get the current time in microseconds.
28 | */
29 | int64_t av_gettime(void);
30 |
31 | /**
32 | * Get the current time in microseconds since some unspecified starting point.
33 | * On platforms that support it, the time comes from a monotonic clock
34 | * This property makes this time source ideal for measuring relative time.
35 | * The returned values may not be monotonic on platforms where a monotonic
36 | * clock is not available.
37 | */
38 | int64_t av_gettime_relative(void);
39 |
40 | /**
41 | * Indicates with a boolean result if the av_gettime_relative() time source
42 | * is monotonic.
43 | */
44 | int av_gettime_relative_is_monotonic(void);
45 |
46 | /**
47 | * Sleep for a period of time. Although the duration is expressed in
48 | * microseconds, the actual delay may be rounded to the precision of the
49 | * system timer.
50 | *
51 | * @param usec Number of microseconds to sleep.
52 | * @return zero on success or (negative) error code.
53 | */
54 | int av_usleep(unsigned usec);
55 |
56 | #endif /* AVUTIL_TIME_H */
57 |
--------------------------------------------------------------------------------
/RtmpH264.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 头文件
23 |
24 |
25 | 头文件
26 |
27 |
28 | 头文件
29 |
30 |
31 | 头文件
32 |
33 |
34 | 头文件
35 |
36 |
37 | 头文件
38 |
39 |
40 | 头文件
41 |
42 |
43 | 头文件
44 |
45 |
46 |
47 |
48 | 源文件
49 |
50 |
51 | 源文件
52 |
53 |
54 | 源文件
55 |
56 |
57 |
--------------------------------------------------------------------------------
/include/libavutil/intfloat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Mans Rullgard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_INTFLOAT_H
22 | #define AVUTIL_INTFLOAT_H
23 |
24 | #include
25 | #include "attributes.h"
26 |
27 | union av_intfloat32 {
28 | uint32_t i;
29 | float f;
30 | };
31 |
32 | union av_intfloat64 {
33 | uint64_t i;
34 | double f;
35 | };
36 |
37 | /**
38 | * Reinterpret a 32-bit integer as a float.
39 | */
40 | static av_always_inline float av_int2float(uint32_t i)
41 | {
42 | union av_intfloat32 v;
43 | v.i = i;
44 | return v.f;
45 | }
46 |
47 | /**
48 | * Reinterpret a float as a 32-bit integer.
49 | */
50 | static av_always_inline uint32_t av_float2int(float f)
51 | {
52 | union av_intfloat32 v;
53 | v.f = f;
54 | return v.i;
55 | }
56 |
57 | /**
58 | * Reinterpret a 64-bit integer as a double.
59 | */
60 | static av_always_inline double av_int2double(uint64_t i)
61 | {
62 | union av_intfloat64 v;
63 | v.i = i;
64 | return v.f;
65 | }
66 |
67 | /**
68 | * Reinterpret a double as a 64-bit integer.
69 | */
70 | static av_always_inline uint64_t av_double2int(double f)
71 | {
72 | union av_intfloat64 v;
73 | v.f = f;
74 | return v.i;
75 | }
76 |
77 | #endif /* AVUTIL_INTFLOAT_H */
78 |
--------------------------------------------------------------------------------
/include/libavutil/aes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2007 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_AES_H
22 | #define AVUTIL_AES_H
23 |
24 | #include
25 |
26 | #include "attributes.h"
27 | #include "version.h"
28 |
29 | /**
30 | * @defgroup lavu_aes AES
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | extern const int av_aes_size;
36 |
37 | struct AVAES;
38 |
39 | /**
40 | * Allocate an AVAES context.
41 | */
42 | struct AVAES *av_aes_alloc(void);
43 |
44 | /**
45 | * Initialize an AVAES context.
46 | * @param key_bits 128, 192 or 256
47 | * @param decrypt 0 for encryption, 1 for decryption
48 | */
49 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
50 |
51 | /**
52 | * Encrypt or decrypt a buffer using a previously initialized context.
53 | * @param count number of 16 byte blocks
54 | * @param dst destination array, can be equal to src
55 | * @param src source array, can be equal to dst
56 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
57 | * @param decrypt 0 for encryption, 1 for decryption
58 | */
59 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
60 |
61 | /**
62 | * @}
63 | */
64 |
65 | #endif /* AVUTIL_AES_H */
66 |
--------------------------------------------------------------------------------
/include/libavutil/rc4.h:
--------------------------------------------------------------------------------
1 | /*
2 | * RC4 encryption/decryption/pseudo-random number generator
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_RC4_H
22 | #define AVUTIL_RC4_H
23 |
24 | #include
25 |
26 | /**
27 | * @defgroup lavu_rc4 RC4
28 | * @ingroup lavu_crypto
29 | * @{
30 | */
31 |
32 | typedef struct AVRC4 {
33 | uint8_t state[256];
34 | int x, y;
35 | } AVRC4;
36 |
37 | /**
38 | * Allocate an AVRC4 context.
39 | */
40 | AVRC4 *av_rc4_alloc(void);
41 |
42 | /**
43 | * @brief Initializes an AVRC4 context.
44 | *
45 | * @param key_bits must be a multiple of 8
46 | * @param decrypt 0 for encryption, 1 for decryption, currently has no effect
47 | * @return zero on success, negative value otherwise
48 | */
49 | int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt);
50 |
51 | /**
52 | * @brief Encrypts / decrypts using the RC4 algorithm.
53 | *
54 | * @param count number of bytes
55 | * @param dst destination array, can be equal to src
56 | * @param src source array, can be equal to dst, may be NULL
57 | * @param iv not (yet) used for RC4, should be NULL
58 | * @param decrypt 0 for encryption, 1 for decryption, not (yet) used
59 | */
60 | void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | #endif /* AVUTIL_RC4_H */
67 |
--------------------------------------------------------------------------------
/include/libavutil/lfg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Lagged Fibonacci PRNG
3 | * Copyright (c) 2008 Michael Niedermayer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_LFG_H
23 | #define AVUTIL_LFG_H
24 |
25 | 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 |
--------------------------------------------------------------------------------
/include/libavutil/sha.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #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 |
--------------------------------------------------------------------------------
/include/libavutil/pixelutils.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_PIXELUTILS_H
20 | #define AVUTIL_PIXELUTILS_H
21 |
22 | #include
23 | #include
24 | #include "common.h"
25 |
26 | /**
27 | * Sum of abs(src1[x] - src2[x])
28 | */
29 | typedef int (*av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1,
30 | const uint8_t *src2, ptrdiff_t stride2);
31 |
32 | /**
33 | * Get a potentially optimized pointer to a Sum-of-absolute-differences
34 | * function (see the av_pixelutils_sad_fn prototype).
35 | *
36 | * @param w_bits 1<
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_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 |
--------------------------------------------------------------------------------
/include/libavutil/lzo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LZO 1x decompression
3 | * copyright (c) 2006 Reimar Doeffinger
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_LZO_H
23 | #define AVUTIL_LZO_H
24 |
25 | /**
26 | * @defgroup lavu_lzo LZO
27 | * @ingroup lavu_crypto
28 | *
29 | * @{
30 | */
31 |
32 | #include
33 |
34 | /** @name Error flags returned by av_lzo1x_decode
35 | * @{ */
36 | /// end of the input buffer reached before decoding finished
37 | #define AV_LZO_INPUT_DEPLETED 1
38 | /// decoded data did not fit into output buffer
39 | #define AV_LZO_OUTPUT_FULL 2
40 | /// a reference to previously decoded data was wrong
41 | #define AV_LZO_INVALID_BACKPTR 4
42 | /// a non-specific error in the compressed bitstream
43 | #define AV_LZO_ERROR 8
44 | /** @} */
45 |
46 | #define AV_LZO_INPUT_PADDING 8
47 | #define AV_LZO_OUTPUT_PADDING 12
48 |
49 | /**
50 | * @brief Decodes LZO 1x compressed data.
51 | * @param out output buffer
52 | * @param outlen size of output buffer, number of bytes left are returned here
53 | * @param in input buffer
54 | * @param inlen size of input buffer, number of bytes left are returned here
55 | * @return 0 on success, otherwise a combination of the error flags above
56 | *
57 | * Make sure all buffers are appropriately padded, in must provide
58 | * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
59 | */
60 | int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | #endif /* AVUTIL_LZO_H */
67 |
--------------------------------------------------------------------------------
/include/libavutil/tea.h:
--------------------------------------------------------------------------------
1 | /*
2 | * A 32-bit implementation of the TEA algorithm
3 | * Copyright (c) 2015 Vesselin Bontchev
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_TEA_H
23 | #define AVUTIL_TEA_H
24 |
25 | #include
26 |
27 | /**
28 | * @file
29 | * @brief Public header for libavutil TEA algorithm
30 | * @defgroup lavu_tea TEA
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | extern const int av_tea_size;
36 |
37 | struct AVTEA;
38 |
39 | /**
40 | * Allocate an AVTEA context
41 | * To free the struct: av_free(ptr)
42 | */
43 | struct AVTEA *av_tea_alloc(void);
44 |
45 | /**
46 | * Initialize an AVTEA context.
47 | *
48 | * @param ctx an AVTEA context
49 | * @param key a key of 16 bytes used for encryption/decryption
50 | * @param rounds the number of rounds in TEA (64 is the "standard")
51 | */
52 | void av_tea_init(struct AVTEA *ctx, const uint8_t key[16], int rounds);
53 |
54 | /**
55 | * Encrypt or decrypt a buffer using a previously initialized context.
56 | *
57 | * @param ctx an AVTEA context
58 | * @param dst destination array, can be equal to src
59 | * @param src source array, can be equal to dst
60 | * @param count number of 8 byte blocks
61 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
62 | * @param decrypt 0 for encryption, 1 for decryption
63 | */
64 | void av_tea_crypt(struct AVTEA *ctx, uint8_t *dst, const uint8_t *src,
65 | int count, uint8_t *iv, int decrypt);
66 |
67 | /**
68 | * @}
69 | */
70 |
71 | #endif /* AVUTIL_TEA_H */
72 |
--------------------------------------------------------------------------------
/include/libavutil/ripemd.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | * Copyright (C) 2013 James Almer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #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 |
--------------------------------------------------------------------------------
/include/libavutil/sha512.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | * Copyright (C) 2013 James Almer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #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 |
--------------------------------------------------------------------------------
/include/libavutil/base64.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_BASE64_H
22 | #define AVUTIL_BASE64_H
23 |
24 | #include
25 |
26 | /**
27 | * @defgroup lavu_base64 Base64
28 | * @ingroup lavu_crypto
29 | * @{
30 | */
31 |
32 |
33 | /**
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 |
--------------------------------------------------------------------------------
/include/libavutil/avassert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2010 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * simple assert() macros that are a bit more flexible than ISO C assert().
24 | * @author Michael Niedermayer
25 | */
26 |
27 | #ifndef AVUTIL_AVASSERT_H
28 | #define AVUTIL_AVASSERT_H
29 |
30 | #include
31 | #include "avutil.h"
32 | #include "log.h"
33 |
34 | /**
35 | * assert() equivalent, that is always enabled.
36 | */
37 | #define av_assert0(cond) do { \
38 | if (!(cond)) { \
39 | av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
40 | AV_STRINGIFY(cond), __FILE__, __LINE__); \
41 | abort(); \
42 | } \
43 | } while (0)
44 |
45 |
46 | /**
47 | * assert() equivalent, that does not lie in speed critical code.
48 | * These asserts() thus can be enabled without fearing 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 |
--------------------------------------------------------------------------------
/include/libavutil/camellia.h:
--------------------------------------------------------------------------------
1 | /*
2 | * An implementation of the CAMELLIA algorithm as mentioned in RFC3713
3 | * Copyright (c) 2014 Supraja Meedinti
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_CAMELLIA_H
23 | #define AVUTIL_CAMELLIA_H
24 |
25 | #include
26 |
27 |
28 | /**
29 | * @file
30 | * @brief Public header for libavutil CAMELLIA algorithm
31 | * @defgroup lavu_camellia CAMELLIA
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_camellia_size;
37 |
38 | struct AVCAMELLIA;
39 |
40 | /**
41 | * Allocate an AVCAMELLIA context
42 | * To free the struct: av_free(ptr)
43 | */
44 | struct AVCAMELLIA *av_camellia_alloc(void);
45 |
46 | /**
47 | * Initialize an AVCAMELLIA context.
48 | *
49 | * @param ctx an AVCAMELLIA context
50 | * @param key a key of 16, 24, 32 bytes used for encryption/decryption
51 | * @param key_bits number of keybits: possible are 128, 192, 256
52 | */
53 | int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits);
54 |
55 | /**
56 | * Encrypt or decrypt a buffer using a previously initialized context
57 | *
58 | * @param ctx an AVCAMELLIA context
59 | * @param dst destination array, can be equal to src
60 | * @param src source array, can be equal to dst
61 | * @param count number of 16 byte blocks
62 | * @paran iv initialization vector for CBC mode, NULL for ECB mode
63 | * @param decrypt 0 for encryption, 1 for decryption
64 | */
65 | void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);
66 |
67 | /**
68 | * @}
69 | */
70 | #endif /* AVUTIL_CAMELLIA_H */
71 |
--------------------------------------------------------------------------------
/include/libavutil/aes_ctr.h:
--------------------------------------------------------------------------------
1 | /*
2 | * AES-CTR cipher
3 | * Copyright (c) 2015 Eran Kornblau
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_AES_CTR_H
23 | #define AVUTIL_AES_CTR_H
24 |
25 | #include
26 |
27 | #include "attributes.h"
28 | #include "version.h"
29 |
30 | #define AES_CTR_KEY_SIZE (16)
31 | #define AES_CTR_IV_SIZE (8)
32 |
33 | struct AVAESCTR;
34 |
35 | /**
36 | * Allocate an AVAESCTR context.
37 | */
38 | struct AVAESCTR *av_aes_ctr_alloc(void);
39 |
40 | /**
41 | * Initialize an AVAESCTR context.
42 | * @param key encryption key, must have a length of AES_CTR_KEY_SIZE
43 | */
44 | int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key);
45 |
46 | /**
47 | * Release an AVAESCTR context.
48 | */
49 | void av_aes_ctr_free(struct AVAESCTR *a);
50 |
51 | /**
52 | * Process a buffer using a previously initialized context.
53 | * @param dst destination array, can be equal to src
54 | * @param src source array, can be equal to dst
55 | * @param size the size of src and dst
56 | */
57 | void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size);
58 |
59 | /**
60 | * Get the current iv
61 | */
62 | const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a);
63 |
64 | /**
65 | * Generate a random iv
66 | */
67 | void av_aes_ctr_set_random_iv(struct AVAESCTR *a);
68 |
69 | /**
70 | * Forcefully change the 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 |
--------------------------------------------------------------------------------
/include/librtmp/log.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008-2009 Andrej Stepanchuk
3 | * Copyright (C) 2009-2010 Howard Chu
4 | *
5 | * This file is part of librtmp.
6 | *
7 | * librtmp is free software; you can redistribute it and/or modify
8 | * it under the terms of the GNU Lesser General Public License as
9 | * published by the Free Software Foundation; either version 2.1,
10 | * or (at your option) any later version.
11 | *
12 | * librtmp is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public License
18 | * along with librtmp see the file COPYING. If not, write to
19 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 | * Boston, MA 02110-1301, USA.
21 | * http://www.gnu.org/copyleft/lgpl.html
22 | */
23 |
24 | #ifndef __RTMP_LOG_H__
25 | #define __RTMP_LOG_H__
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | #ifdef __cplusplus
32 | extern "C" {
33 | #endif
34 | /* Enable this to get full debugging output */
35 | /* #define _DEBUG */
36 |
37 | #ifdef _DEBUG
38 | #undef NODEBUG
39 | #endif
40 |
41 | typedef enum
42 | { RTMP_LOGCRIT=0, RTMP_LOGERROR, RTMP_LOGWARNING, RTMP_LOGINFO,
43 | RTMP_LOGDEBUG, RTMP_LOGDEBUG2, RTMP_LOGALL
44 | } RTMP_LogLevel;
45 |
46 | extern RTMP_LogLevel RTMP_debuglevel;
47 |
48 | typedef void (RTMP_LogCallback)(int level, const char *fmt, va_list);
49 | void RTMP_LogSetCallback(RTMP_LogCallback *cb);
50 | void RTMP_LogSetOutput(FILE *file);
51 | #ifdef __GNUC__
52 | void RTMP_LogPrintf(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
53 | void RTMP_LogStatus(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
54 | void RTMP_Log(int level, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
55 | #else
56 | void RTMP_LogPrintf(const char *format, ...);
57 | void RTMP_LogStatus(const char *format, ...);
58 | void RTMP_Log(int level, const char *format, ...);
59 | #endif
60 | void RTMP_LogHex(int level, const uint8_t *data, unsigned long len);
61 | void RTMP_LogHexString(int level, const uint8_t *data, unsigned long len);
62 | void RTMP_LogSetLevel(RTMP_LogLevel lvl);
63 | RTMP_LogLevel RTMP_LogGetLevel(void);
64 |
65 | #ifdef __cplusplus
66 | }
67 | #endif
68 |
69 | #endif
70 |
--------------------------------------------------------------------------------
/include/libavutil/twofish.h:
--------------------------------------------------------------------------------
1 | /*
2 | * An implementation of the TwoFish algorithm
3 | * Copyright (c) 2015 Supraja Meedinti
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_TWOFISH_H
23 | #define AVUTIL_TWOFISH_H
24 |
25 | #include
26 |
27 |
28 | /**
29 | * @file
30 | * @brief Public header for libavutil TWOFISH algorithm
31 | * @defgroup lavu_twofish TWOFISH
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_twofish_size;
37 |
38 | struct AVTWOFISH;
39 |
40 | /**
41 | * Allocate an AVTWOFISH context
42 | * To free the struct: av_free(ptr)
43 | */
44 | struct AVTWOFISH *av_twofish_alloc(void);
45 |
46 | /**
47 | * Initialize an AVTWOFISH context.
48 | *
49 | * @param ctx an AVTWOFISH context
50 | * @param key a key of size ranging from 1 to 32 bytes used for encryption/decryption
51 | * @param key_bits number of keybits: 128, 192, 256 If less than the required, padded with zeroes to nearest valid value; return value is 0 if key_bits is 128/192/256, -1 if less than 0, 1 otherwise
52 | */
53 | int av_twofish_init(struct AVTWOFISH *ctx, const uint8_t *key, int key_bits);
54 |
55 | /**
56 | * Encrypt or decrypt a buffer using a previously initialized context
57 | *
58 | * @param ctx an AVTWOFISH context
59 | * @param dst destination array, can be equal to src
60 | * @param src source array, can be equal to dst
61 | * @param count number of 16 byte blocks
62 | * @paran iv initialization vector for CBC mode, NULL for ECB mode
63 | * @param decrypt 0 for encryption, 1 for decryption
64 | */
65 | void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);
66 |
67 | /**
68 | * @}
69 | */
70 | #endif /* AVUTIL_TWOFISH_H */
71 |
--------------------------------------------------------------------------------
/include/libavutil/des.h:
--------------------------------------------------------------------------------
1 | /*
2 | * DES encryption/decryption
3 | * Copyright (c) 2007 Reimar Doeffinger
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_DES_H
23 | #define AVUTIL_DES_H
24 |
25 | #include
26 |
27 | /**
28 | * @defgroup lavu_des DES
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | typedef struct AVDES {
34 | uint64_t round_keys[3][16];
35 | int triple_des;
36 | } AVDES;
37 |
38 | /**
39 | * Allocate an AVDES context.
40 | */
41 | AVDES *av_des_alloc(void);
42 |
43 | /**
44 | * @brief Initializes an AVDES context.
45 | *
46 | * @param key_bits must be 64 or 192
47 | * @param decrypt 0 for encryption/CBC-MAC, 1 for decryption
48 | * @return zero on success, negative value otherwise
49 | */
50 | int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt);
51 |
52 | /**
53 | * @brief Encrypts / decrypts using the DES algorithm.
54 | *
55 | * @param count number of 8 byte blocks
56 | * @param dst destination array, can be equal to src, must be 8-byte aligned
57 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
58 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used,
59 | * must be 8-byte aligned
60 | * @param decrypt 0 for encryption, 1 for decryption
61 | */
62 | void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
63 |
64 | /**
65 | * @brief Calculates CBC-MAC using the DES algorithm.
66 | *
67 | * @param count number of 8 byte blocks
68 | * @param dst destination array, can be equal to src, must be 8-byte aligned
69 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
70 | */
71 | void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);
72 |
73 | /**
74 | * @}
75 | */
76 |
77 | #endif /* AVUTIL_DES_H */
78 |
--------------------------------------------------------------------------------
/include/libavutil/blowfish.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Blowfish algorithm
3 | * Copyright (c) 2012 Samuel Pitoiset
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_BLOWFISH_H
23 | #define AVUTIL_BLOWFISH_H
24 |
25 | #include
26 |
27 | /**
28 | * @defgroup lavu_blowfish Blowfish
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | #define AV_BF_ROUNDS 16
34 |
35 | typedef struct AVBlowfish {
36 | uint32_t p[AV_BF_ROUNDS + 2];
37 | uint32_t s[4][256];
38 | } AVBlowfish;
39 |
40 | /**
41 | * Allocate an AVBlowfish context.
42 | */
43 | AVBlowfish *av_blowfish_alloc(void);
44 |
45 | /**
46 | * Initialize an AVBlowfish context.
47 | *
48 | * @param ctx an AVBlowfish context
49 | * @param key a key
50 | * @param key_len length of the key
51 | */
52 | void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len);
53 |
54 | /**
55 | * Encrypt or decrypt a buffer using a previously initialized context.
56 | *
57 | * @param ctx an AVBlowfish context
58 | * @param xl left four bytes halves of input to be encrypted
59 | * @param xr right four bytes halves of input to be encrypted
60 | * @param decrypt 0 for encryption, 1 for decryption
61 | */
62 | void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
63 | int decrypt);
64 |
65 | /**
66 | * Encrypt or decrypt a buffer using a previously initialized context.
67 | *
68 | * @param ctx an AVBlowfish context
69 | * @param dst destination array, can be equal to src
70 | * @param src source array, can be equal to dst
71 | * @param count number of 8 byte blocks
72 | * @param iv initialization vector for CBC mode, if NULL ECB will be used
73 | * @param decrypt 0 for encryption, 1 for decryption
74 | */
75 | void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
76 | int count, uint8_t *iv, int decrypt);
77 |
78 | /**
79 | * @}
80 | */
81 |
82 | #endif /* AVUTIL_BLOWFISH_H */
83 |
--------------------------------------------------------------------------------
/include/libavutil/file.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_FILE_H
20 | #define AVUTIL_FILE_H
21 |
22 | #include
23 |
24 | #include "avutil.h"
25 |
26 | /**
27 | * @file
28 | * Misc file utilities.
29 | */
30 |
31 | /**
32 | * Read the file with name filename, and put its content in a newly
33 | * allocated buffer or map it with mmap() when available.
34 | * In case of success set *bufptr to the read or mmapped buffer, and
35 | * *size to the size in bytes of the buffer in *bufptr.
36 | * 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 |
--------------------------------------------------------------------------------
/include/mp4v2/mp4v2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * The contents of this file are subject to the Mozilla Public
3 | * License Version 1.1 (the "License"); you may not use this file
4 | * except in compliance with the License. You may obtain a copy of
5 | * the License at http://www.mozilla.org/MPL/
6 | *
7 | * Software distributed under the License is distributed on an "AS
8 | * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 | * implied. See the License for the specific language governing
10 | * rights and limitations under the License.
11 | *
12 | * The Original Code is MPEG4IP.
13 | *
14 | * The Initial Developer of the Original Code is Cisco Systems Inc.
15 | * Portions created by Cisco Systems Inc. are
16 | * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved.
17 | *
18 | * 3GPP features implementation is based on 3GPP's TS26.234-v5.60,
19 | * and was contributed by Ximpo Group Ltd.
20 | *
21 | * Portions created by Ximpo Group Ltd. are
22 | * Copyright (C) Ximpo Group Ltd. 2003, 2004. All Rights Reserved.
23 | *
24 | * Contributor(s):
25 | * Dave Mackie dmackie@cisco.com
26 | * Alix Marchandise-Franquet alix@cisco.com
27 | * Ximpo Group Ltd. mp4v2@ximpo.com
28 | * Bill May wmay@cisco.com
29 | */
30 | #ifndef MP4V2_MP4V2_H
31 | #define MP4V2_MP4V2_H
32 |
33 | /*****************************************************************************/
34 |
35 | #include
36 | #include
37 |
38 | /*****************************************************************************/
39 |
40 | /* exploit C++ ability of default values for function parameters */
41 | #if defined( DEFAULT )
42 | # define __MP4V2_SAVE_DEFAULT DEFAULT
43 | #endif
44 | #undef DEFAULT
45 | #if defined( __cplusplus )
46 | # define DEFAULT(x) =x
47 | #else
48 | # define DEFAULT(x)
49 | #endif
50 |
51 | #ifdef __cplusplus
52 | extern "C" {
53 | #endif
54 |
55 | /*****************************************************************************/
56 |
57 | #include
58 | #include
59 | #include
60 | #include
61 | #include
62 | #include
63 | #include
64 | #include
65 | #include
66 | #include
67 | #include
68 |
69 | /*****************************************************************************/
70 |
71 | /* restore macro DEFAULT to state prior to mp4v2 headers */
72 | #undef DEFAULT
73 | #if defined( __MP4V2_SAVE_DEFAULT )
74 | # define DEFAULT __MP4V2_SAVE_DEFAULT
75 | #endif
76 |
77 | #ifdef __cplusplus
78 | } // extern "C"
79 | #endif
80 |
81 | /*****************************************************************************/
82 |
83 | #endif /* MP4V2_MP4V2_H */
84 |
--------------------------------------------------------------------------------
/include/mp4v2/platform.h:
--------------------------------------------------------------------------------
1 | #ifndef MP4V2_PLATFORM_H
2 | #define MP4V2_PLATFORM_H
3 |
4 | /*****************************************************************************/
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // Thanks, MSFT, for making C99 a total PITA. Declare this not to define any stdint stuff; this is useful
11 | // if you're going to be using mp4v2 on windows with some other library that defines its own stdint.
12 | // TODO msft has finally re-included stdint in vs2010, so maybe at some point in the future this won't be needed.
13 | #ifndef MP4V2_NO_STDINT_DEFS
14 | //#if defined( _WIN32 ) && !defined( __MINGW32__ )
15 | // typedef char int8_t;
16 | // typedef short int16_t;
17 | // typedef int int32_t;
18 | // typedef long long int64_t;
19 |
20 | // typedef unsigned char uint8_t;
21 | // typedef unsigned short uint16_t;
22 | // typedef unsigned int uint32_t;
23 | // typedef unsigned long long uint64_t;
24 | //#else
25 | #include
26 | //#endif
27 | #endif
28 |
29 | #if defined( _WIN32 ) || defined( __MINGW32__ )
30 | # if defined( MP4V2_EXPORTS )
31 | # define MP4V2_EXPORT __declspec(dllexport)
32 | # elif defined( MP4V2_USE_DLL_IMPORT ) || !defined( MP4V2_USE_STATIC_LIB )
33 | # define MP4V2_EXPORT __declspec(dllimport)
34 | # else
35 | # define MP4V2_EXPORT
36 | # endif
37 | #else
38 | # define MP4V2_EXPORT __attribute__((visibility("default")))
39 | #endif
40 |
41 | #if defined( __GNUC__ )
42 | # define MP4V2_DEPRECATED __attribute__((deprecated))
43 | #else
44 | # define MP4V2_DEPRECATED
45 | #endif
46 |
47 | /******************************************************************************
48 | *
49 | * TODO-KB: cleanup -- absolutely no need for a C-API to fuss with reserved
50 | * C++ keywords. This will involve changing the public interface and current
51 | * plan of action:
52 | *
53 | * typdef enum {
54 | * mp4_false,
55 | * mp4_true,
56 | * } mp4_bool_t;
57 | *
58 | * followed by updating all public signatures and implementation.
59 | */
60 |
61 | #ifndef FALSE
62 | #define FALSE 0
63 | #endif
64 |
65 | #ifndef TRUE
66 | #define TRUE 1
67 | #endif
68 |
69 | #if !defined( __cplusplus )
70 | #ifndef bool
71 | #if SIZEOF_BOOL == 8
72 | typedef uint64_t bool;
73 | #else
74 | #if SIZEOF_BOOL == 4
75 | typedef uint32_t bool;
76 | #else
77 | #if SIZEOF_BOOL == 2
78 | typedef uint16_t bool;
79 | #else
80 | typedef unsigned char bool;
81 | #endif
82 | #endif
83 | #endif
84 | #ifndef false
85 | #define false FALSE
86 | #endif
87 | #ifndef true
88 | #define true TRUE
89 | #endif
90 | #endif
91 | #endif
92 |
93 | /*****************************************************************************/
94 |
95 | #endif /* MP4V2_PLATFORM_H */
96 |
--------------------------------------------------------------------------------
/faac.h:
--------------------------------------------------------------------------------
1 | /*
2 | * FAAC - Freeware Advanced Audio Coder
3 | * Copyright (C) 2001 Menno Bakker
4 | *
5 | * This library 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 | * This library 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 this library; if not, write to the Free Software
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 | *
19 | * $Id: faac.h,v 1.36 2009/01/25 18:50:32 menno Exp $
20 | */
21 |
22 | #ifndef _FAAC_H_
23 | #define _FAAC_H_
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif /* __cplusplus */
28 |
29 | #if defined(_WIN32) && !defined(__MINGW32__)
30 | # ifndef FAACAPI
31 | # define FAACAPI __stdcall
32 | # endif
33 | #else
34 | # ifndef FAACAPI
35 | # define FAACAPI
36 | # endif
37 | #endif
38 |
39 | #pragma pack(push, 1)
40 |
41 | typedef struct {
42 | void *ptr;
43 | char *name;
44 | }
45 | psymodellist_t;
46 |
47 | #include "faaccfg.h"
48 |
49 |
50 | typedef void *faacEncHandle;
51 |
52 | #ifndef HAVE_INT32_T
53 | typedef signed int int32_t;
54 | #endif
55 |
56 | /*
57 | Allows an application to get FAAC version info. This is intended
58 | purely for informative purposes.
59 |
60 | Returns FAAC_CFG_VERSION.
61 | */
62 | int FAACAPI faacEncGetVersion(char **faac_id_string,
63 | char **faac_copyright_string);
64 |
65 |
66 | faacEncConfigurationPtr FAACAPI
67 | faacEncGetCurrentConfiguration(faacEncHandle hEncoder);
68 |
69 |
70 | int FAACAPI faacEncSetConfiguration(faacEncHandle hEncoder,
71 | faacEncConfigurationPtr config);
72 |
73 |
74 | faacEncHandle FAACAPI faacEncOpen(unsigned long sampleRate,
75 | unsigned int numChannels,
76 | unsigned long *inputSamples,
77 | unsigned long *maxOutputBytes);
78 |
79 |
80 | int FAACAPI faacEncGetDecoderSpecificInfo(faacEncHandle hEncoder, unsigned char **ppBuffer,
81 | unsigned long *pSizeOfDecoderSpecificInfo);
82 |
83 |
84 | int FAACAPI faacEncEncode(faacEncHandle hEncoder, int32_t * inputBuffer, unsigned int samplesInput,
85 | unsigned char *outputBuffer,
86 | unsigned int bufferSize);
87 |
88 |
89 | int FAACAPI faacEncClose(faacEncHandle hEncoder);
90 |
91 |
92 |
93 | #pragma pack(pop)
94 |
95 | #ifdef __cplusplus
96 | }
97 | #endif /* __cplusplus */
98 |
99 | #endif /* _FAAC_H_ */
100 |
--------------------------------------------------------------------------------
/include/libavutil/cast5.h:
--------------------------------------------------------------------------------
1 | /*
2 | * An implementation of the CAST128 algorithm as mentioned in RFC2144
3 | * Copyright (c) 2014 Supraja Meedinti
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_CAST5_H
23 | #define AVUTIL_CAST5_H
24 |
25 | #include
26 |
27 |
28 | /**
29 | * @file
30 | * @brief Public header for libavutil CAST5 algorithm
31 | * @defgroup lavu_cast5 CAST5
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_cast5_size;
37 |
38 | struct AVCAST5;
39 |
40 | /**
41 | * Allocate an AVCAST5 context
42 | * To free the struct: av_free(ptr)
43 | */
44 | struct AVCAST5 *av_cast5_alloc(void);
45 | /**
46 | * Initialize an AVCAST5 context.
47 | *
48 | * @param ctx an AVCAST5 context
49 | * @param key a key of 5,6,...16 bytes used for encryption/decryption
50 | * @param key_bits number of keybits: possible are 40,48,...,128
51 | * @return 0 on success, less than 0 on failure
52 | */
53 | int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits);
54 |
55 | /**
56 | * Encrypt or decrypt a buffer using a previously initialized context, ECB mode only
57 | *
58 | * @param ctx an AVCAST5 context
59 | * @param dst destination array, can be equal to src
60 | * @param src source array, can be equal to dst
61 | * @param count number of 8 byte blocks
62 | * @param decrypt 0 for encryption, 1 for decryption
63 | */
64 | void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt);
65 |
66 | /**
67 | * Encrypt or decrypt a buffer using a previously initialized context
68 | *
69 | * @param ctx an AVCAST5 context
70 | * @param dst destination array, can be equal to src
71 | * @param src source array, can be equal to dst
72 | * @param count number of 8 byte blocks
73 | * @param iv initialization vector for CBC mode, NULL for ECB mode
74 | * @param decrypt 0 for encryption, 1 for decryption
75 | */
76 | void av_cast5_crypt2(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
77 | /**
78 | * @}
79 | */
80 | #endif /* AVUTIL_CAST5_H */
81 |
--------------------------------------------------------------------------------
/include/librtmp/bytes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2008 Team XBMC
3 | * http://www.xbmc.org
4 | * Copyright (C) 2008-2009 Andrej Stepanchuk
5 | * Copyright (C) 2009-2010 Howard Chu
6 | *
7 | * This file is part of librtmp.
8 | *
9 | * librtmp is free software; you can redistribute it and/or modify
10 | * it under the terms of the GNU Lesser General Public License as
11 | * published by the Free Software Foundation; either version 2.1,
12 | * or (at your option) any later version.
13 | *
14 | * librtmp 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
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU Lesser General Public License
20 | * along with librtmp see the file COPYING. If not, write to
21 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 | * Boston, MA 02110-1301, USA.
23 | * http://www.gnu.org/copyleft/lgpl.html
24 | */
25 |
26 | #ifndef __BYTES_H__
27 | #define __BYTES_H__
28 |
29 | #include
30 |
31 | #ifdef _WIN32
32 | /* Windows is little endian only */
33 | #define __LITTLE_ENDIAN 1234
34 | #define __BIG_ENDIAN 4321
35 | #define __BYTE_ORDER __LITTLE_ENDIAN
36 | #define __FLOAT_WORD_ORDER __BYTE_ORDER
37 |
38 | typedef unsigned char uint8_t;
39 |
40 | #else /* !_WIN32 */
41 |
42 | #include
43 |
44 | #if defined(BYTE_ORDER) && !defined(__BYTE_ORDER)
45 | #define __BYTE_ORDER BYTE_ORDER
46 | #endif
47 |
48 | #if defined(BIG_ENDIAN) && !defined(__BIG_ENDIAN)
49 | #define __BIG_ENDIAN BIG_ENDIAN
50 | #endif
51 |
52 | #if defined(LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN)
53 | #define __LITTLE_ENDIAN LITTLE_ENDIAN
54 | #endif
55 |
56 | #endif /* !_WIN32 */
57 |
58 | /* define default endianness */
59 | #ifndef __LITTLE_ENDIAN
60 | #define __LITTLE_ENDIAN 1234
61 | #endif
62 |
63 | #ifndef __BIG_ENDIAN
64 | #define __BIG_ENDIAN 4321
65 | #endif
66 |
67 | #ifndef __BYTE_ORDER
68 | #warning "Byte order not defined on your system, assuming little endian!"
69 | #define __BYTE_ORDER __LITTLE_ENDIAN
70 | #endif
71 |
72 | /* ok, we assume to have the same float word order and byte order if float word order is not defined */
73 | #ifndef __FLOAT_WORD_ORDER
74 | #warning "Float word order not defined, assuming the same as byte order!"
75 | #define __FLOAT_WORD_ORDER __BYTE_ORDER
76 | #endif
77 |
78 | #if !defined(__BYTE_ORDER) || !defined(__FLOAT_WORD_ORDER)
79 | #error "Undefined byte or float word order!"
80 | #endif
81 |
82 | #if __FLOAT_WORD_ORDER != __BIG_ENDIAN && __FLOAT_WORD_ORDER != __LITTLE_ENDIAN
83 | #error "Unknown/unsupported float word order!"
84 | #endif
85 |
86 | #if __BYTE_ORDER != __BIG_ENDIAN && __BYTE_ORDER != __LITTLE_ENDIAN
87 | #error "Unknown/unsupported byte order!"
88 | #endif
89 |
90 | #endif
91 |
92 |
--------------------------------------------------------------------------------
/include/libavutil/timestamp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | /**
20 | * @file
21 | * timestamp utils, mostly useful for debugging/logging purposes
22 | */
23 |
24 | #ifndef AVUTIL_TIMESTAMP_H
25 | #define AVUTIL_TIMESTAMP_H
26 |
27 | #include "common.h"
28 |
29 | #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64)
30 | #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS
31 | #endif
32 |
33 | #define AV_TS_MAX_STRING_SIZE 32
34 |
35 | /**
36 | * Fill the provided buffer with a string containing a timestamp
37 | * representation.
38 | *
39 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
40 | * @param ts the timestamp to represent
41 | * @return the buffer in input
42 | */
43 | static inline char *av_ts_make_string(char *buf, int64_t ts)
44 | {
45 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
46 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64, ts);
47 | return buf;
48 | }
49 |
50 | /**
51 | * Convenience macro, the return value should be used only directly in
52 | * function arguments but never stand-alone.
53 | */
54 | #define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts)
55 |
56 | /**
57 | * Fill the provided buffer with a string containing a timestamp time
58 | * representation.
59 | *
60 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
61 | * @param ts the timestamp to represent
62 | * @param tb the timebase of the timestamp
63 | * @return the buffer in input
64 | */
65 | static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb)
66 | {
67 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
68 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
69 | return buf;
70 | }
71 |
72 | /**
73 | * Convenience macro, the return value should be used only directly in
74 | * function arguments but never stand-alone.
75 | */
76 | #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb)
77 |
78 | #endif /* AVUTIL_TIMESTAMP_H */
79 |
--------------------------------------------------------------------------------
/include/libavutil/xtea.h:
--------------------------------------------------------------------------------
1 | /*
2 | * A 32-bit implementation of the XTEA algorithm
3 | * Copyright (c) 2012 Samuel Pitoiset
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_XTEA_H
23 | #define AVUTIL_XTEA_H
24 |
25 | #include
26 |
27 | /**
28 | * @file
29 | * @brief Public header for libavutil XTEA algorithm
30 | * @defgroup lavu_xtea XTEA
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | typedef struct AVXTEA {
36 | uint32_t key[16];
37 | } AVXTEA;
38 |
39 | /**
40 | * Allocate an AVXTEA context.
41 | */
42 | AVXTEA *av_xtea_alloc(void);
43 |
44 | /**
45 | * Initialize an AVXTEA context.
46 | *
47 | * @param ctx an AVXTEA context
48 | * @param key a key of 16 bytes used for encryption/decryption,
49 | * interpreted as big endian 32 bit numbers
50 | */
51 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
52 |
53 | /**
54 | * Initialize an AVXTEA context.
55 | *
56 | * @param ctx an AVXTEA context
57 | * @param key a key of 16 bytes used for encryption/decryption,
58 | * interpreted as little endian 32 bit numbers
59 | */
60 | void av_xtea_le_init(struct AVXTEA *ctx, const uint8_t key[16]);
61 |
62 | /**
63 | * Encrypt or decrypt a buffer using a previously initialized context,
64 | * in big endian format.
65 | *
66 | * @param ctx an AVXTEA context
67 | * @param dst destination array, can be equal to src
68 | * @param src source array, can be equal to dst
69 | * @param count number of 8 byte blocks
70 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
71 | * @param decrypt 0 for encryption, 1 for decryption
72 | */
73 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
74 | int count, uint8_t *iv, int decrypt);
75 |
76 | /**
77 | * Encrypt or decrypt a buffer using a previously initialized context,
78 | * in little endian format.
79 | *
80 | * @param ctx an AVXTEA context
81 | * @param dst destination array, can be equal to src
82 | * @param src source array, can be equal to dst
83 | * @param count number of 8 byte blocks
84 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
85 | * @param decrypt 0 for encryption, 1 for decryption
86 | */
87 | void av_xtea_le_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
88 | int count, uint8_t *iv, int decrypt);
89 |
90 | /**
91 | * @}
92 | */
93 |
94 | #endif /* AVUTIL_XTEA_H */
95 |
--------------------------------------------------------------------------------
/include/libavutil/crc.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #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 |
--------------------------------------------------------------------------------
/include/mp4v2/isma.h:
--------------------------------------------------------------------------------
1 | #ifndef MP4V2_ISMA_H
2 | #define MP4V2_ISMA_H
3 |
4 | /**************************************************************************//**
5 | *
6 | * @defgroup mp4_isma MP4v2 ISMA (Internet Streaming Media Alliance)
7 | * @{
8 | *
9 | *****************************************************************************/
10 |
11 | /** something */
12 | typedef struct mp4v2_ismacryp_session_params {
13 | uint32_t scheme_type;
14 | uint16_t scheme_version;
15 | uint8_t key_ind_len;
16 | uint8_t iv_len;
17 | uint8_t selective_enc;
18 | const char* kms_uri;
19 | } mp4v2_ismacrypParams;
20 |
21 | /*
22 | * API to initialize ismacryp properties to sensible defaults
23 | * if input param is null then mallocs a params struct
24 | */
25 |
26 | MP4V2_EXPORT
27 | mp4v2_ismacrypParams* MP4DefaultISMACrypParams( mp4v2_ismacrypParams* ptr );
28 |
29 | MP4V2_EXPORT
30 | MP4TrackId MP4AddEncAudioTrack(
31 | MP4FileHandle hFile,
32 | uint32_t timeScale,
33 | MP4Duration sampleDuration,
34 | mp4v2_ismacrypParams* icPp,
35 | uint8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE) );
36 |
37 | MP4V2_EXPORT
38 | MP4TrackId MP4AddEncVideoTrack(
39 | MP4FileHandle hFile,
40 | uint32_t timeScale,
41 | MP4Duration sampleDuration,
42 | uint16_t width,
43 | uint16_t height,
44 | mp4v2_ismacrypParams* icPp,
45 | uint8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE),
46 | const char* oFormat DEFAULT(NULL) );
47 |
48 | MP4V2_EXPORT
49 | MP4TrackId MP4AddEncH264VideoTrack(
50 | MP4FileHandle dstFile,
51 | uint32_t timeScale,
52 | MP4Duration sampleDuration,
53 | uint16_t width,
54 | uint16_t height,
55 | MP4FileHandle srcFile,
56 | MP4TrackId srcTrackId,
57 | mp4v2_ismacrypParams* icPp );
58 |
59 | MP4V2_EXPORT
60 | MP4TrackId MP4EncAndCloneTrack(
61 | MP4FileHandle srcFile,
62 | MP4TrackId srcTrackId,
63 | mp4v2_ismacrypParams* icPp,
64 | MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
65 | MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID) );
66 |
67 | MP4V2_EXPORT
68 | MP4TrackId MP4EncAndCopyTrack(
69 | MP4FileHandle srcFile,
70 | MP4TrackId srcTrackId,
71 | mp4v2_ismacrypParams* icPp,
72 | encryptFunc_t encfcnp,
73 | uint32_t encfcnparam1,
74 | MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
75 | bool applyEdits DEFAULT(false),
76 | MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID) );
77 |
78 | MP4V2_EXPORT
79 | bool MP4MakeIsmaCompliant(
80 | const char* fileName,
81 | bool addIsmaComplianceSdp DEFAULT(true) );
82 |
83 | MP4V2_EXPORT
84 | char* MP4MakeIsmaSdpIod(
85 | uint8_t videoProfile,
86 | uint32_t videoBitrate,
87 | uint8_t* videoConfig,
88 | uint32_t videoConfigLength,
89 | uint8_t audioProfile,
90 | uint32_t audioBitrate,
91 | uint8_t* audioConfig,
92 | uint32_t audioConfigLength );
93 |
94 | /** @} ***********************************************************************/
95 |
96 | #endif /* MP4V2_ISMA_H */
97 |
--------------------------------------------------------------------------------
/include/libavutil/hmac.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Martin Storsjo
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_HMAC_H
22 | #define AVUTIL_HMAC_H
23 |
24 | #include
25 |
26 | #include "version.h"
27 | /**
28 | * @defgroup lavu_hmac HMAC
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | enum AVHMACType {
34 | AV_HMAC_MD5,
35 | AV_HMAC_SHA1,
36 | AV_HMAC_SHA224,
37 | AV_HMAC_SHA256,
38 | AV_HMAC_SHA384 = 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 |
--------------------------------------------------------------------------------
/include/libavutil/bswap.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * byte swapping routines
24 | */
25 |
26 | #ifndef AVUTIL_BSWAP_H
27 | #define AVUTIL_BSWAP_H
28 |
29 | #include
30 | #include "libavutil/avconfig.h"
31 | #include "attributes.h"
32 |
33 | #ifdef HAVE_AV_CONFIG_H
34 |
35 | #include "config.h"
36 |
37 | #if ARCH_AARCH64
38 | # include "aarch64/bswap.h"
39 | #elif ARCH_ARM
40 | # include "arm/bswap.h"
41 | #elif ARCH_AVR32
42 | # include "avr32/bswap.h"
43 | #elif ARCH_SH4
44 | # include "sh4/bswap.h"
45 | #elif ARCH_X86
46 | # include "x86/bswap.h"
47 | #endif
48 |
49 | #endif /* HAVE_AV_CONFIG_H */
50 |
51 | #define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff))
52 | #define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
53 | #define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
54 |
55 | #define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
56 |
57 | #ifndef av_bswap16
58 | static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
59 | {
60 | x= (x>>8) | (x<<8);
61 | return x;
62 | }
63 | #endif
64 |
65 | #ifndef av_bswap32
66 | static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
67 | {
68 | return AV_BSWAP32C(x);
69 | }
70 | #endif
71 |
72 | #ifndef av_bswap64
73 | static inline uint64_t av_const av_bswap64(uint64_t x)
74 | {
75 | return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
76 | }
77 | #endif
78 |
79 | // be2ne ... big-endian to native-endian
80 | // le2ne ... little-endian to native-endian
81 |
82 | #if AV_HAVE_BIGENDIAN
83 | #define av_be2ne16(x) (x)
84 | #define av_be2ne32(x) (x)
85 | #define av_be2ne64(x) (x)
86 | #define av_le2ne16(x) av_bswap16(x)
87 | #define av_le2ne32(x) av_bswap32(x)
88 | #define av_le2ne64(x) av_bswap64(x)
89 | #define AV_BE2NEC(s, x) (x)
90 | #define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
91 | #else
92 | #define av_be2ne16(x) av_bswap16(x)
93 | #define av_be2ne32(x) av_bswap32(x)
94 | #define av_be2ne64(x) av_bswap64(x)
95 | #define av_le2ne16(x) (x)
96 | #define av_le2ne32(x) (x)
97 | #define av_le2ne64(x) (x)
98 | #define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
99 | #define AV_LE2NEC(s, x) (x)
100 | #endif
101 |
102 | #define AV_BE2NE16C(x) AV_BE2NEC(16, x)
103 | #define AV_BE2NE32C(x) AV_BE2NEC(32, x)
104 | #define AV_BE2NE64C(x) AV_BE2NEC(64, x)
105 | #define AV_LE2NE16C(x) AV_LE2NEC(16, x)
106 | #define AV_LE2NE32C(x) AV_LE2NEC(32, x)
107 | #define AV_LE2NE64C(x) AV_LE2NEC(64, x)
108 |
109 | #endif /* AVUTIL_BSWAP_H */
110 |
--------------------------------------------------------------------------------
/include/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 |
--------------------------------------------------------------------------------
/faaccfg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * FAAC - Freeware Advanced Audio Coder
3 | * Copyright (C) 2001 Menno Bakker
4 | *
5 | * This library 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 | * This library 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 this library; if not, write to the Free Software
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 | *
19 | * $Id: faaccfg.h,v 1.3 2004/07/04 12:12:05 corrados Exp $
20 | */
21 |
22 | #ifndef _FAACCFG_H_
23 | #define _FAACCFG_H_
24 |
25 | #define FAAC_CFG_VERSION 104
26 |
27 | /* MPEG ID's */
28 | #define MPEG2 1
29 | #define MPEG4 0
30 |
31 | /* AAC object types */
32 | #define MAIN 1
33 | #define LOW 2
34 | #define SSR 3
35 | #define LTP 4
36 |
37 | /* Input Formats */
38 | #define FAAC_INPUT_NULL 0
39 | #define FAAC_INPUT_16BIT 1
40 | #define FAAC_INPUT_24BIT 2
41 | #define FAAC_INPUT_32BIT 3
42 | #define FAAC_INPUT_FLOAT 4
43 |
44 | #define SHORTCTL_NORMAL 0
45 | #define SHORTCTL_NOSHORT 1
46 | #define SHORTCTL_NOLONG 2
47 |
48 | #pragma pack(push, 1)
49 | typedef struct faacEncConfiguration
50 | {
51 | /* config version */
52 | int version;
53 |
54 | /* library version */
55 | char *name;
56 |
57 | /* copyright string */
58 | char *copyright;
59 |
60 | /* MPEG version, 2 or 4 */
61 | unsigned int mpegVersion;
62 |
63 | /* AAC object type */
64 | unsigned int aacObjectType;
65 |
66 | /* Allow mid/side coding */
67 | unsigned int allowMidside;
68 |
69 | /* Use one of the channels as LFE channel */
70 | unsigned int useLfe;
71 |
72 | /* Use Temporal Noise Shaping */
73 | unsigned int useTns;
74 |
75 | /* bitrate / channel of AAC file */
76 | unsigned long bitRate;
77 |
78 | /* AAC file frequency bandwidth */
79 | unsigned int bandWidth;
80 |
81 | /* Quantizer quality */
82 | unsigned long quantqual;
83 |
84 | /* Bitstream output format (0 = Raw; 1 = ADTS) */
85 | unsigned int outputFormat;
86 |
87 | /* psychoacoustic model list */
88 | psymodellist_t *psymodellist;
89 |
90 | /* selected index in psymodellist */
91 | unsigned int psymodelidx;
92 |
93 | /*
94 | PCM Sample Input Format
95 | 0 FAAC_INPUT_NULL invalid, signifies a misconfigured config
96 | 1 FAAC_INPUT_16BIT native endian 16bit
97 | 2 FAAC_INPUT_24BIT native endian 24bit in 24 bits (not implemented)
98 | 3 FAAC_INPUT_32BIT native endian 24bit in 32 bits (DEFAULT)
99 | 4 FAAC_INPUT_FLOAT 32bit floating point
100 | */
101 | unsigned int inputFormat;
102 |
103 | /* block type enforcing (SHORTCTL_NORMAL/SHORTCTL_NOSHORT/SHORTCTL_NOLONG) */
104 | int shortctl;
105 |
106 | /*
107 | Channel Remapping
108 |
109 | Default 0, 1, 2, 3 ... 63 (64 is MAX_CHANNELS in coder.h)
110 |
111 | WAVE 4.0 2, 0, 1, 3
112 | WAVE 5.0 2, 0, 1, 3, 4
113 | WAVE 5.1 2, 0, 1, 4, 5, 3
114 | AIFF 5.1 2, 0, 3, 1, 4, 5
115 | */
116 | int channel_map[64];
117 |
118 | } faacEncConfiguration, *faacEncConfigurationPtr;
119 |
120 | #pragma pack(pop)
121 |
122 | #endif /* _FAACCFG_H_ */
123 |
--------------------------------------------------------------------------------
/include/libavutil/downmix_info.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Tim Walker
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_DOWNMIX_INFO_H
22 | #define AVUTIL_DOWNMIX_INFO_H
23 |
24 | #include "frame.h"
25 |
26 | /**
27 | * @file
28 | * audio downmix medatata
29 | */
30 |
31 | /**
32 | * @addtogroup lavu_audio
33 | * @{
34 | */
35 |
36 | /**
37 | * @defgroup downmix_info Audio downmix metadata
38 | * @{
39 | */
40 |
41 | /**
42 | * Possible downmix types.
43 | */
44 | enum AVDownmixType {
45 | AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */
46 | AV_DOWNMIX_TYPE_LORO, /**< Lo/Ro 2-channel downmix (Stereo). */
47 | AV_DOWNMIX_TYPE_LTRT, /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */
48 | AV_DOWNMIX_TYPE_DPLII, /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */
49 | AV_DOWNMIX_TYPE_NB /**< Number of downmix types. Not part of ABI. */
50 | };
51 |
52 | /**
53 | * This structure describes optional metadata relevant to a downmix procedure.
54 | *
55 | * All fields are set by the decoder to the value indicated in the audio
56 | * bitstream (if present), or to a "sane" default otherwise.
57 | */
58 | typedef struct AVDownmixInfo {
59 | /**
60 | * Type of downmix preferred by the mastering engineer.
61 | */
62 | enum AVDownmixType preferred_downmix_type;
63 |
64 | /**
65 | * Absolute scale factor representing the nominal level of the center
66 | * channel during a regular downmix.
67 | */
68 | double center_mix_level;
69 |
70 | /**
71 | * Absolute scale factor representing the nominal level of the center
72 | * channel during an Lt/Rt compatible downmix.
73 | */
74 | double center_mix_level_ltrt;
75 |
76 | /**
77 | * Absolute scale factor representing the nominal level of the surround
78 | * channels during a regular downmix.
79 | */
80 | double surround_mix_level;
81 |
82 | /**
83 | * Absolute scale factor representing the nominal level of the surround
84 | * channels during an Lt/Rt compatible downmix.
85 | */
86 | double surround_mix_level_ltrt;
87 |
88 | /**
89 | * Absolute scale factor representing the level at which the LFE data is
90 | * mixed into L/R channels during downmixing.
91 | */
92 | double lfe_mix_level;
93 | } AVDownmixInfo;
94 |
95 | /**
96 | * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing.
97 | *
98 | * If the side data is absent, it is created and added to the frame.
99 | *
100 | * @param frame the frame for which the side data is to be obtained or created
101 | *
102 | * @return the AVDownmixInfo structure to be edited by the caller, or NULL if
103 | * the structure cannot be allocated.
104 | */
105 | AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame);
106 |
107 | /**
108 | * @}
109 | */
110 |
111 | /**
112 | * @}
113 | */
114 |
115 | #endif /* AVUTIL_DOWNMIX_INFO_H */
116 |
--------------------------------------------------------------------------------
/include/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 |
--------------------------------------------------------------------------------
/include/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 |
--------------------------------------------------------------------------------
/include/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 |
--------------------------------------------------------------------------------
/include/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 11
68 | #define LIBAVUTIL_VERSION_MICRO 100
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 |
130 |
--------------------------------------------------------------------------------
/include/mp4v2/file_prop.h:
--------------------------------------------------------------------------------
1 | #ifndef MP4V2_FILE_PROP_H
2 | #define MP4V2_FILE_PROP_H
3 |
4 | /**************************************************************************//**
5 | *
6 | * @defgroup mp4_file_prop MP4v2 File Property
7 | * @{
8 | *
9 | *****************************************************************************/
10 |
11 | /* generic props */
12 |
13 | MP4V2_EXPORT
14 | bool MP4HaveAtom(
15 | MP4FileHandle hFile,
16 | const char* atomName );
17 |
18 | MP4V2_EXPORT
19 | bool MP4GetIntegerProperty(
20 | MP4FileHandle hFile,
21 | const char* propName,
22 | uint64_t* retval );
23 |
24 | MP4V2_EXPORT
25 | bool MP4GetFloatProperty(
26 | MP4FileHandle hFile,
27 | const char* propName,
28 | float* retvalue );
29 |
30 | MP4V2_EXPORT
31 | bool MP4GetStringProperty(
32 | MP4FileHandle hFile,
33 | const char* propName,
34 | const char** retvalue );
35 |
36 | MP4V2_EXPORT
37 | bool MP4GetBytesProperty(
38 | MP4FileHandle hFile,
39 | const char* propName,
40 | uint8_t** ppValue,
41 | uint32_t* pValueSize );
42 |
43 | MP4V2_EXPORT
44 | bool MP4SetIntegerProperty(
45 | MP4FileHandle hFile,
46 | const char* propName,
47 | int64_t value );
48 |
49 | MP4V2_EXPORT
50 | bool MP4SetFloatProperty(
51 | MP4FileHandle hFile,
52 | const char* propName,
53 | float value );
54 |
55 | MP4V2_EXPORT
56 | bool MP4SetStringProperty(
57 | MP4FileHandle hFile,
58 | const char* propName,
59 | const char* value );
60 |
61 | MP4V2_EXPORT
62 | bool MP4SetBytesProperty(
63 | MP4FileHandle hFile,
64 | const char* propName,
65 | const uint8_t* pValue,
66 | uint32_t valueSize );
67 |
68 | /* specific props */
69 |
70 | MP4V2_EXPORT
71 | MP4Duration MP4GetDuration( MP4FileHandle hFile );
72 |
73 | /** Get the time scale of the movie (file).
74 | *
75 | * MP4GetTimeScale returns the time scale in units of ticks per second for
76 | * the mp4 file. Caveat: tracks may use the same time scale as the movie
77 | * or may use their own time scale.
78 | *
79 | * @param hFile handle of file for operation.
80 | *
81 | * @return timescale (ticks per second) of the mp4 file.
82 | */
83 | MP4V2_EXPORT
84 | uint32_t MP4GetTimeScale( MP4FileHandle hFile );
85 |
86 | /** Set the time scale of the movie (file).
87 | *
88 | * MP4SetTimeScale sets the time scale of the mp4 file. The time scale is
89 | * in the number of clock ticks per second. Caveat: tracks may use the
90 | * same time scale as the movie or may use their own time scale.
91 | *
92 | * @param hFile handle of file for operation.
93 | * @param value desired timescale for the movie.
94 | *
95 | * @return On success, true. On failure, false.
96 | */
97 | MP4V2_EXPORT
98 | bool MP4SetTimeScale( MP4FileHandle hFile, uint32_t value );
99 |
100 | /** Change the general timescale of file hFile.
101 | *
102 | * This function changes the general timescale of the file hFile
103 | * to the new timescale value by recalculating all values that depend
104 | * on the timescale in "moov.mvhd".
105 | *
106 | * If the timescale is already equal to value nothing is done.
107 | *
108 | * @param hFile handle of file to change.
109 | * @param value the new timescale.
110 | */
111 | MP4V2_EXPORT
112 | void MP4ChangeMovieTimeScale( MP4FileHandle hFile, uint32_t value );
113 |
114 | MP4V2_EXPORT
115 | uint8_t MP4GetODProfileLevel( MP4FileHandle hFile );
116 |
117 | MP4V2_EXPORT
118 | bool MP4SetODProfileLevel( MP4FileHandle hFile, uint8_t value );
119 |
120 | MP4V2_EXPORT
121 | uint8_t MP4GetSceneProfileLevel( MP4FileHandle hFile );
122 |
123 | MP4V2_EXPORT
124 | bool MP4SetSceneProfileLevel( MP4FileHandle hFile, uint8_t value );
125 |
126 | MP4V2_EXPORT
127 | uint8_t MP4GetVideoProfileLevel(
128 | MP4FileHandle hFile,
129 | MP4TrackId trackId DEFAULT(MP4_INVALID_TRACK_ID) );
130 |
131 | MP4V2_EXPORT
132 | void MP4SetVideoProfileLevel( MP4FileHandle hFile, uint8_t value );
133 |
134 | MP4V2_EXPORT
135 | uint8_t MP4GetAudioProfileLevel( MP4FileHandle hFile );
136 |
137 | MP4V2_EXPORT
138 | void MP4SetAudioProfileLevel( MP4FileHandle hFile, uint8_t value );
139 |
140 | MP4V2_EXPORT
141 | uint8_t MP4GetGraphicsProfileLevel( MP4FileHandle hFile );
142 |
143 | MP4V2_EXPORT
144 | bool MP4SetGraphicsProfileLevel( MP4FileHandle hFile, uint8_t value );
145 |
146 | /** @} ***********************************************************************/
147 |
148 | #endif /* MP4V2_FILE_PROP_H */
149 |
--------------------------------------------------------------------------------
/include/mp4v2/streaming.h:
--------------------------------------------------------------------------------
1 | #ifndef MP4V2_STREAMING_H
2 | #define MP4V2_STREAMING_H
3 |
4 | /**************************************************************************//**
5 | *
6 | * @defgroup mp4_hint MP4v2 Streaming
7 | * @{
8 | *
9 | *****************************************************************************/
10 |
11 | MP4V2_EXPORT
12 | bool MP4GetHintTrackRtpPayload(
13 | MP4FileHandle hFile,
14 | MP4TrackId hintTrackId,
15 | char** ppPayloadName DEFAULT(NULL),
16 | uint8_t* pPayloadNumber DEFAULT(NULL),
17 | uint16_t* pMaxPayloadSize DEFAULT(NULL),
18 | char** ppEncodingParams DEFAULT(NULL) );
19 |
20 | #define MP4_SET_DYNAMIC_PAYLOAD 0xff
21 |
22 | MP4V2_EXPORT
23 | bool MP4SetHintTrackRtpPayload(
24 | MP4FileHandle hFile,
25 | MP4TrackId hintTrackId,
26 | const char* pPayloadName,
27 | uint8_t* pPayloadNumber,
28 | uint16_t maxPayloadSize DEFAULT(0),
29 | const char * encode_params DEFAULT(NULL),
30 | bool include_rtp_map DEFAULT(true),
31 | bool include_mpeg4_esid DEFAULT(true) );
32 |
33 | MP4V2_EXPORT
34 | const char* MP4GetSessionSdp(
35 | MP4FileHandle hFile );
36 |
37 | MP4V2_EXPORT
38 | bool MP4SetSessionSdp(
39 | MP4FileHandle hFile,
40 | const char* sdpString );
41 |
42 | MP4V2_EXPORT
43 | bool MP4AppendSessionSdp(
44 | MP4FileHandle hFile,
45 | const char* sdpString );
46 |
47 | MP4V2_EXPORT
48 | const char* MP4GetHintTrackSdp(
49 | MP4FileHandle hFile,
50 | MP4TrackId hintTrackId );
51 |
52 | MP4V2_EXPORT
53 | bool MP4SetHintTrackSdp(
54 | MP4FileHandle hFile,
55 | MP4TrackId hintTrackId,
56 | const char* sdpString );
57 |
58 | MP4V2_EXPORT
59 | bool MP4AppendHintTrackSdp(
60 | MP4FileHandle hFile,
61 | MP4TrackId hintTrackId,
62 | const char* sdpString );
63 |
64 | MP4V2_EXPORT
65 | MP4TrackId MP4GetHintTrackReferenceTrackId(
66 | MP4FileHandle hFile,
67 | MP4TrackId hintTrackId );
68 |
69 | MP4V2_EXPORT
70 | bool MP4ReadRtpHint(
71 | MP4FileHandle hFile,
72 | MP4TrackId hintTrackId,
73 | MP4SampleId hintSampleId,
74 | uint16_t* pNumPackets DEFAULT(NULL) );
75 |
76 | MP4V2_EXPORT
77 | uint16_t MP4GetRtpHintNumberOfPackets(
78 | MP4FileHandle hFile,
79 | MP4TrackId hintTrackId );
80 |
81 | MP4V2_EXPORT
82 | int8_t MP4GetRtpPacketBFrame(
83 | MP4FileHandle hFile,
84 | MP4TrackId hintTrackId,
85 | uint16_t packetIndex );
86 |
87 | MP4V2_EXPORT
88 | int32_t MP4GetRtpPacketTransmitOffset(
89 | MP4FileHandle hFile,
90 | MP4TrackId hintTrackId,
91 | uint16_t packetIndex );
92 |
93 | MP4V2_EXPORT
94 | bool MP4ReadRtpPacket(
95 | MP4FileHandle hFile,
96 | MP4TrackId hintTrackId,
97 | uint16_t packetIndex,
98 | uint8_t** ppBytes,
99 | uint32_t* pNumBytes,
100 | uint32_t ssrc DEFAULT(0),
101 | bool includeHeader DEFAULT(true),
102 | bool includePayload DEFAULT(true) );
103 |
104 | MP4V2_EXPORT
105 | MP4Timestamp MP4GetRtpTimestampStart(
106 | MP4FileHandle hFile,
107 | MP4TrackId hintTrackId );
108 |
109 | MP4V2_EXPORT
110 | bool MP4SetRtpTimestampStart(
111 | MP4FileHandle hFile,
112 | MP4TrackId hintTrackId,
113 | MP4Timestamp rtpStart );
114 |
115 | MP4V2_EXPORT
116 | bool MP4AddRtpHint(
117 | MP4FileHandle hFile,
118 | MP4TrackId hintTrackId );
119 |
120 | MP4V2_EXPORT
121 | bool MP4AddRtpVideoHint(
122 | MP4FileHandle hFile,
123 | MP4TrackId hintTrackId,
124 | bool isBframe DEFAULT(false),
125 | uint32_t timestampOffset DEFAULT(0) );
126 |
127 | MP4V2_EXPORT
128 | bool MP4AddRtpPacket(
129 | MP4FileHandle hFile,
130 | MP4TrackId hintTrackId,
131 | bool setMbit DEFAULT(false),
132 | int32_t transmitOffset DEFAULT(0) );
133 |
134 | MP4V2_EXPORT
135 | bool MP4AddRtpImmediateData(
136 | MP4FileHandle hFile,
137 | MP4TrackId hintTrackId,
138 | const uint8_t* pBytes,
139 | uint32_t numBytes );
140 |
141 | MP4V2_EXPORT
142 | bool MP4AddRtpSampleData(
143 | MP4FileHandle hFile,
144 | MP4TrackId hintTrackId,
145 | MP4SampleId sampleId,
146 | uint32_t dataOffset,
147 | uint32_t dataLength );
148 |
149 | MP4V2_EXPORT
150 | bool MP4AddRtpESConfigurationPacket(
151 | MP4FileHandle hFile,
152 | MP4TrackId hintTrackId );
153 |
154 | MP4V2_EXPORT
155 | bool MP4WriteRtpHint(
156 | MP4FileHandle hFile,
157 | MP4TrackId hintTrackId,
158 | MP4Duration duration,
159 | bool isSyncSample DEFAULT(true) );
160 |
161 | /** @} ***********************************************************************/
162 |
163 | #endif /* MP4V2_STREAMING_H */
164 |
--------------------------------------------------------------------------------
/include/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 |
--------------------------------------------------------------------------------
/include/libavutil/attributes.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 | * Macro definitions for various function/variable attributes
24 | */
25 |
26 | #ifndef AVUTIL_ATTRIBUTES_H
27 | #define AVUTIL_ATTRIBUTES_H
28 |
29 | #ifdef __GNUC__
30 | # define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
31 | # define AV_GCC_VERSION_AT_MOST(x,y) (__GNUC__ < (x) || __GNUC__ == (x) && __GNUC_MINOR__ <= (y))
32 | #else
33 | # define AV_GCC_VERSION_AT_LEAST(x,y) 0
34 | # define AV_GCC_VERSION_AT_MOST(x,y) 0
35 | #endif
36 |
37 | #ifndef av_always_inline
38 | #if AV_GCC_VERSION_AT_LEAST(3,1)
39 | # define av_always_inline __attribute__((always_inline)) inline
40 | #elif defined(_MSC_VER)
41 | # define av_always_inline __forceinline
42 | #else
43 | # define av_always_inline inline
44 | #endif
45 | #endif
46 |
47 | #ifndef av_extern_inline
48 | #if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__)
49 | # define av_extern_inline extern inline
50 | #else
51 | # define av_extern_inline inline
52 | #endif
53 | #endif
54 |
55 | #if AV_GCC_VERSION_AT_LEAST(3,4)
56 | # define av_warn_unused_result __attribute__((warn_unused_result))
57 | #else
58 | # define av_warn_unused_result
59 | #endif
60 |
61 | #if AV_GCC_VERSION_AT_LEAST(3,1)
62 | # define av_noinline __attribute__((noinline))
63 | #elif defined(_MSC_VER)
64 | # define av_noinline __declspec(noinline)
65 | #else
66 | # define av_noinline
67 | #endif
68 |
69 | #if AV_GCC_VERSION_AT_LEAST(3,1)
70 | # define av_pure __attribute__((pure))
71 | #else
72 | # define av_pure
73 | #endif
74 |
75 | #if AV_GCC_VERSION_AT_LEAST(2,6)
76 | # define av_const __attribute__((const))
77 | #else
78 | # define av_const
79 | #endif
80 |
81 | #if AV_GCC_VERSION_AT_LEAST(4,3)
82 | # define av_cold __attribute__((cold))
83 | #else
84 | # define av_cold
85 | #endif
86 |
87 | #if AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__llvm__)
88 | # define av_flatten __attribute__((flatten))
89 | #else
90 | # define av_flatten
91 | #endif
92 |
93 | #if AV_GCC_VERSION_AT_LEAST(3,1)
94 | # define attribute_deprecated __attribute__((deprecated))
95 | #elif defined(_MSC_VER)
96 | # define attribute_deprecated __declspec(deprecated)
97 | #else
98 | # define attribute_deprecated
99 | #endif
100 |
101 | /**
102 | * Disable warnings about deprecated features
103 | * This is useful for sections of code kept for backward compatibility and
104 | * scheduled for removal.
105 | */
106 | #ifndef AV_NOWARN_DEPRECATED
107 | #if AV_GCC_VERSION_AT_LEAST(4,6)
108 | # define AV_NOWARN_DEPRECATED(code) \
109 | _Pragma("GCC diagnostic push") \
110 | _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
111 | code \
112 | _Pragma("GCC diagnostic pop")
113 | #elif defined(_MSC_VER)
114 | # define AV_NOWARN_DEPRECATED(code) \
115 | __pragma(warning(push)) \
116 | __pragma(warning(disable : 4996)) \
117 | code; \
118 | __pragma(warning(pop))
119 | #else
120 | # define AV_NOWARN_DEPRECATED(code) code
121 | #endif
122 | #endif
123 |
124 |
125 | #if defined(__GNUC__)
126 | # define av_unused __attribute__((unused))
127 | #else
128 | # define av_unused
129 | #endif
130 |
131 | /**
132 | * Mark a variable as used and prevent the compiler from optimizing it
133 | * away. This is useful for variables accessed only from inline
134 | * assembler without the compiler being aware.
135 | */
136 | #if AV_GCC_VERSION_AT_LEAST(3,1)
137 | # define av_used __attribute__((used))
138 | #else
139 | # define av_used
140 | #endif
141 |
142 | #if AV_GCC_VERSION_AT_LEAST(3,3)
143 | # define av_alias __attribute__((may_alias))
144 | #else
145 | # define av_alias
146 | #endif
147 |
148 | #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
149 | # define av_uninit(x) x=x
150 | #else
151 | # define av_uninit(x) x
152 | #endif
153 |
154 | #ifdef __GNUC__
155 | # define av_builtin_constant_p __builtin_constant_p
156 | # define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
157 | #else
158 | # define av_builtin_constant_p(x) 0
159 | # define av_printf_format(fmtpos, attrpos)
160 | #endif
161 |
162 | #if AV_GCC_VERSION_AT_LEAST(2,5)
163 | # define av_noreturn __attribute__((noreturn))
164 | #else
165 | # define av_noreturn
166 | #endif
167 |
168 | #endif /* AVUTIL_ATTRIBUTES_H */
169 |
--------------------------------------------------------------------------------
/include/libavutil/cpu.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2000, 2001, 2002 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_CPU_H
22 | #define AVUTIL_CPU_H
23 |
24 | #include "attributes.h"
25 |
26 | #define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
27 |
28 | /* lower 16 bits - CPU features */
29 | #define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX
30 | #define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
31 | #define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext
32 | #define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW
33 | #define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions
34 | #define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions
35 | #define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
36 | ///< than regular MMX/SSE (e.g. Core1)
37 | #define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt
38 | #define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions
39 | #define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
40 | ///< than regular MMX/SSE (e.g. Core1)
41 | #define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions
42 | #define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower
43 | #define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions
44 | #define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions
45 | #define AV_CPU_FLAG_AESNI 0x80000 ///< Advanced Encryption Standard functions
46 | #define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
47 | #define AV_CPU_FLAG_AVXSLOW 0x8000000 ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer)
48 | #define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions
49 | #define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions
50 | #define AV_CPU_FLAG_CMOV 0x1000 ///< supports cmov instruction
51 | #define AV_CPU_FLAG_AVX2 0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't used
52 | #define AV_CPU_FLAG_FMA3 0x10000 ///< Haswell FMA3 functions
53 | #define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1
54 | #define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2
55 |
56 | #define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
57 | #define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06
58 | #define AV_CPU_FLAG_POWER8 0x0004 ///< ISA 2.07
59 |
60 | #define AV_CPU_FLAG_ARMV5TE (1 << 0)
61 | #define AV_CPU_FLAG_ARMV6 (1 << 1)
62 | #define AV_CPU_FLAG_ARMV6T2 (1 << 2)
63 | #define AV_CPU_FLAG_VFP (1 << 3)
64 | #define AV_CPU_FLAG_VFPV3 (1 << 4)
65 | #define AV_CPU_FLAG_NEON (1 << 5)
66 | #define AV_CPU_FLAG_ARMV8 (1 << 6)
67 | #define AV_CPU_FLAG_SETEND (1 <<16)
68 |
69 | /**
70 | * Return the flags which specify extensions supported by the CPU.
71 | * The returned value is affected by av_force_cpu_flags() if that was used
72 | * before. So av_get_cpu_flags() can easily be used in a application to
73 | * detect the enabled cpu flags.
74 | */
75 | int av_get_cpu_flags(void);
76 |
77 | /**
78 | * Disables cpu detection and forces the specified flags.
79 | * -1 is a special case that disables forcing of specific flags.
80 | */
81 | void av_force_cpu_flags(int flags);
82 |
83 | /**
84 | * Set a mask on flags returned by av_get_cpu_flags().
85 | * This function is mainly useful for testing.
86 | * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible
87 | *
88 | * @warning this function is not thread safe.
89 | */
90 | attribute_deprecated void av_set_cpu_flags_mask(int mask);
91 |
92 | /**
93 | * Parse CPU flags from a string.
94 | *
95 | * The returned flags contain the specified flags as well as related unspecified flags.
96 | *
97 | * This function exists only for compatibility with libav.
98 | * Please use av_parse_cpu_caps() when possible.
99 | * @return a combination of AV_CPU_* flags, negative on error.
100 | */
101 | attribute_deprecated
102 | int av_parse_cpu_flags(const char *s);
103 |
104 | /**
105 | * Parse CPU caps from a string and update the given AV_CPU_* flags based on that.
106 | *
107 | * @return negative on error.
108 | */
109 | int av_parse_cpu_caps(unsigned *flags, const char *s);
110 |
111 | /**
112 | * @return the number of logical CPU cores present.
113 | */
114 | int av_cpu_count(void);
115 |
116 | #endif /* AVUTIL_CPU_H */
117 |
--------------------------------------------------------------------------------
/include/librtmp/rtmp_sys.h:
--------------------------------------------------------------------------------
1 | #ifndef __RTMP_SYS_H__
2 | #define __RTMP_SYS_H__
3 | /*
4 | * Copyright (C) 2010 Howard Chu
5 | *
6 | * This file is part of librtmp.
7 | *
8 | * librtmp is free software; you can redistribute it and/or modify
9 | * it under the terms of the GNU Lesser General Public License as
10 | * published by the Free Software Foundation; either version 2.1,
11 | * or (at your option) any later version.
12 | *
13 | * librtmp 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
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public License
19 | * along with librtmp see the file COPYING. If not, write to
20 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 | * Boston, MA 02110-1301, USA.
22 | * http://www.gnu.org/copyleft/lgpl.html
23 | */
24 |
25 | #ifdef _WIN32
26 |
27 | #include
28 | #include
29 |
30 | #ifdef _MSC_VER /* MSVC */
31 | #define snprintf _snprintf
32 | #define strcasecmp stricmp
33 | #define strncasecmp strnicmp
34 | #define vsnprintf _vsnprintf
35 | #endif
36 |
37 | #define GetSockError() WSAGetLastError()
38 | #define SetSockError(e) WSASetLastError(e)
39 | #define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
40 | #define EWOULDBLOCK WSAETIMEDOUT /* we don't use nonblocking, but we do use timeouts */
41 | #define sleep(n) Sleep(n*1000)
42 | #define msleep(n) Sleep(n)
43 | #define SET_RCVTIMEO(tv,s) int tv = s*1000
44 | #else /* !_WIN32 */
45 | #include
46 | #include
47 | #include
48 | #include
49 | #include
50 | #include
51 | #include
52 | #include
53 | #define GetSockError() errno
54 | #define SetSockError(e) errno = e
55 | #undef closesocket
56 | #define closesocket(s) close(s)
57 | #define msleep(n) usleep(n*1000)
58 | #define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0}
59 | #endif
60 |
61 | #include "rtmp.h"
62 |
63 | #ifdef USE_POLARSSL
64 | #include
65 | #include
66 | #include
67 | #include
68 | #if POLARSSL_VERSION_NUMBER < 0x01010000
69 | #define havege_random havege_rand
70 | #endif
71 | #if POLARSSL_VERSION_NUMBER >= 0x01020000
72 | #define SSL_SET_SESSION(S,resume,timeout,ctx) ssl_set_session(S,ctx)
73 | #else
74 | #define SSL_SET_SESSION(S,resume,timeout,ctx) ssl_set_session(S,resume,timeout,ctx)
75 | #endif
76 | typedef struct tls_ctx {
77 | havege_state hs;
78 | ssl_session ssn;
79 | } tls_ctx;
80 | typedef struct tls_server_ctx {
81 | havege_state *hs;
82 | x509_cert cert;
83 | rsa_context key;
84 | ssl_session ssn;
85 | const char *dhm_P, *dhm_G;
86 | } tls_server_ctx;
87 |
88 | #define TLS_CTX tls_ctx *
89 | #define TLS_client(ctx,s) s = malloc(sizeof(ssl_context)); ssl_init(s);\
90 | ssl_set_endpoint(s, SSL_IS_CLIENT); ssl_set_authmode(s, SSL_VERIFY_NONE);\
91 | ssl_set_rng(s, havege_random, &ctx->hs);\
92 | ssl_set_ciphersuites(s, ssl_default_ciphersuites);\
93 | SSL_SET_SESSION(s, 1, 600, &ctx->ssn)
94 | #define TLS_server(ctx,s) s = malloc(sizeof(ssl_context)); ssl_init(s);\
95 | ssl_set_endpoint(s, SSL_IS_SERVER); ssl_set_authmode(s, SSL_VERIFY_NONE);\
96 | ssl_set_rng(s, havege_random, ((tls_server_ctx*)ctx)->hs);\
97 | ssl_set_ciphersuites(s, ssl_default_ciphersuites);\
98 | SSL_SET_SESSION(s, 1, 600, &((tls_server_ctx*)ctx)->ssn);\
99 | ssl_set_own_cert(s, &((tls_server_ctx*)ctx)->cert, &((tls_server_ctx*)ctx)->key);\
100 | ssl_set_dh_param(s, ((tls_server_ctx*)ctx)->dhm_P, ((tls_server_ctx*)ctx)->dhm_G)
101 | #define TLS_setfd(s,fd) ssl_set_bio(s, net_recv, &fd, net_send, &fd)
102 | #define TLS_connect(s) ssl_handshake(s)
103 | #define TLS_accept(s) ssl_handshake(s)
104 | #define TLS_read(s,b,l) ssl_read(s,(unsigned char *)b,l)
105 | #define TLS_write(s,b,l) ssl_write(s,(unsigned char *)b,l)
106 | #define TLS_shutdown(s) ssl_close_notify(s)
107 | #define TLS_close(s) ssl_free(s); free(s)
108 |
109 | #elif defined(USE_GNUTLS)
110 | #include
111 | typedef struct tls_ctx {
112 | gnutls_certificate_credentials_t cred;
113 | gnutls_priority_t prios;
114 | } tls_ctx;
115 | #define TLS_CTX tls_ctx *
116 | #define TLS_client(ctx,s) gnutls_init((gnutls_session_t *)(&s), GNUTLS_CLIENT); gnutls_priority_set(s, ctx->prios); gnutls_credentials_set(s, GNUTLS_CRD_CERTIFICATE, ctx->cred)
117 | #define TLS_server(ctx,s) gnutls_init((gnutls_session_t *)(&s), GNUTLS_SERVER); gnutls_priority_set_direct(s, "NORMAL", NULL); gnutls_credentials_set(s, GNUTLS_CRD_CERTIFICATE, ctx)
118 | #define TLS_setfd(s,fd) gnutls_transport_set_ptr(s, (gnutls_transport_ptr_t)(long)fd)
119 | #define TLS_connect(s) gnutls_handshake(s)
120 | #define TLS_accept(s) gnutls_handshake(s)
121 | #define TLS_read(s,b,l) gnutls_record_recv(s,b,l)
122 | #define TLS_write(s,b,l) gnutls_record_send(s,b,l)
123 | #define TLS_shutdown(s) gnutls_bye(s, GNUTLS_SHUT_RDWR)
124 | #define TLS_close(s) gnutls_deinit(s)
125 |
126 | #else /* USE_OPENSSL */
127 | #define TLS_CTX SSL_CTX *
128 | #define TLS_client(ctx,s) s = SSL_new(ctx)
129 | #define TLS_server(ctx,s) s = SSL_new(ctx)
130 | #define TLS_setfd(s,fd) SSL_set_fd(s,fd)
131 | #define TLS_connect(s) SSL_connect(s)
132 | #define TLS_accept(s) SSL_accept(s)
133 | #define TLS_read(s,b,l) SSL_read(s,b,l)
134 | #define TLS_write(s,b,l) SSL_write(s,b,l)
135 | #define TLS_shutdown(s) SSL_shutdown(s)
136 | #define TLS_close(s) SSL_free(s)
137 |
138 | #endif
139 | #endif
140 |
--------------------------------------------------------------------------------
/include/libavutil/eval.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2002 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 arithmetic expression evaluator
24 | */
25 |
26 | #ifndef AVUTIL_EVAL_H
27 | #define AVUTIL_EVAL_H
28 |
29 | #include "avutil.h"
30 |
31 | typedef struct AVExpr AVExpr;
32 |
33 | /**
34 | * Parse and evaluate an expression.
35 | * Note, this is significantly slower than av_expr_eval().
36 | *
37 | * @param res a pointer to a double where is put the result value of
38 | * the expression, or NAN in case of error
39 | * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
40 | * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
41 | * @param const_values a zero terminated array of values for the identifiers from const_names
42 | * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
43 | * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
44 | * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
45 | * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
46 | * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
47 | * @param log_ctx parent logging context
48 | * @return >= 0 in case of success, a negative value corresponding to an
49 | * AVERROR code otherwise
50 | */
51 | int av_expr_parse_and_eval(double *res, const char *s,
52 | const char * const *const_names, const double *const_values,
53 | const char * const *func1_names, double (* const *funcs1)(void *, double),
54 | const char * const *func2_names, double (* const *funcs2)(void *, double, double),
55 | void *opaque, int log_offset, void *log_ctx);
56 |
57 | /**
58 | * Parse an expression.
59 | *
60 | * @param expr a pointer where is put an AVExpr containing the parsed
61 | * value in case of successful parsing, or NULL otherwise.
62 | * The pointed to AVExpr must be freed with av_expr_free() by the user
63 | * when it is not needed anymore.
64 | * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
65 | * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
66 | * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
67 | * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
68 | * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
69 | * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
70 | * @param log_ctx parent logging context
71 | * @return >= 0 in case of success, a negative value corresponding to an
72 | * AVERROR code otherwise
73 | */
74 | int av_expr_parse(AVExpr **expr, const char *s,
75 | const char * const *const_names,
76 | const char * const *func1_names, double (* const *funcs1)(void *, double),
77 | const char * const *func2_names, double (* const *funcs2)(void *, double, double),
78 | int log_offset, void *log_ctx);
79 |
80 | /**
81 | * Evaluate a previously parsed expression.
82 | *
83 | * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
84 | * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
85 | * @return the value of the expression
86 | */
87 | double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
88 |
89 | /**
90 | * Free a parsed expression previously created with av_expr_parse().
91 | */
92 | void av_expr_free(AVExpr *e);
93 |
94 | /**
95 | * Parse the string in numstr and return its value as a double. If
96 | * the string is empty, contains only whitespaces, or does not contain
97 | * an initial substring that has the expected syntax for a
98 | * floating-point number, no conversion is performed. In this case,
99 | * returns a value of zero and the value returned in tail is the value
100 | * of numstr.
101 | *
102 | * @param numstr a string representing a number, may contain one of
103 | * the International System number postfixes, for example 'K', 'M',
104 | * 'G'. If 'i' is appended after the postfix, powers of 2 are used
105 | * instead of powers of 10. The 'B' postfix multiplies the value by
106 | * 8, and can be appended after another postfix or used alone. This
107 | * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
108 | * @param tail if non-NULL puts here the pointer to the char next
109 | * after the last parsed character
110 | */
111 | double av_strtod(const char *numstr, char **tail);
112 |
113 | #endif /* AVUTIL_EVAL_H */
114 |
--------------------------------------------------------------------------------
/include/libavutil/timecode.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006 Smartjog S.A.S, Baptiste Coudurier
3 | * Copyright (c) 2011-2012 Smartjog S.A.S, Clément Bœsch
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 | * Timecode helpers header
25 | */
26 |
27 | #ifndef AVUTIL_TIMECODE_H
28 | #define AVUTIL_TIMECODE_H
29 |
30 | #include
31 | #include "rational.h"
32 |
33 | #define AV_TIMECODE_STR_SIZE 16
34 |
35 | enum AVTimecodeFlag {
36 | AV_TIMECODE_FLAG_DROPFRAME = 1<<0, ///< timecode is drop frame
37 | AV_TIMECODE_FLAG_24HOURSMAX = 1<<1, ///< timecode wraps after 24 hours
38 | AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1<<2, ///< negative time values are allowed
39 | };
40 |
41 | typedef struct {
42 | int start; ///< timecode frame start (first base frame number)
43 | uint32_t flags; ///< flags such as drop frame, +24 hours support, ...
44 | AVRational rate; ///< frame rate in rational form
45 | unsigned fps; ///< frame per second; must be consistent with the rate field
46 | } AVTimecode;
47 |
48 | /**
49 | * Adjust frame number for NTSC drop frame time code.
50 | *
51 | * @param framenum frame number to adjust
52 | * @param fps frame per second, 30 or 60
53 | * @return adjusted frame number
54 | * @warning adjustment is only valid in NTSC 29.97 and 59.94
55 | */
56 | int av_timecode_adjust_ntsc_framenum2(int framenum, int fps);
57 |
58 | /**
59 | * Convert frame number to SMPTE 12M binary representation.
60 | *
61 | * @param tc timecode data correctly initialized
62 | * @param framenum frame number
63 | * @return the SMPTE binary representation
64 | *
65 | * @note Frame number adjustment is automatically done in case of drop timecode,
66 | * you do NOT have to call av_timecode_adjust_ntsc_framenum2().
67 | * @note The frame number is relative to tc->start.
68 | * @note Color frame (CF), binary group flags (BGF) and biphase mark polarity
69 | * correction (PC) bits are set to zero.
70 | */
71 | uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum);
72 |
73 | /**
74 | * Load timecode string in buf.
75 | *
76 | * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long
77 | * @param tc timecode data correctly initialized
78 | * @param framenum frame number
79 | * @return the buf parameter
80 | *
81 | * @note Timecode representation can be a negative timecode and have more than
82 | * 24 hours, but will only be honored if the flags are correctly set.
83 | * @note The frame number is relative to tc->start.
84 | */
85 | char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum);
86 |
87 | /**
88 | * Get the timecode string from the SMPTE timecode format.
89 | *
90 | * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long
91 | * @param tcsmpte the 32-bit SMPTE timecode
92 | * @param prevent_df prevent the use of a drop flag when it is known the DF bit
93 | * is arbitrary
94 | * @return the buf parameter
95 | */
96 | char *av_timecode_make_smpte_tc_string(char *buf, uint32_t tcsmpte, int prevent_df);
97 |
98 | /**
99 | * Get the timecode string from the 25-bit timecode format (MPEG GOP format).
100 | *
101 | * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long
102 | * @param tc25bit the 25-bits timecode
103 | * @return the buf parameter
104 | */
105 | char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit);
106 |
107 | /**
108 | * Init a timecode struct with the passed parameters.
109 | *
110 | * @param log_ctx a pointer to an arbitrary struct of which the first field
111 | * is a pointer to an AVClass struct (used for av_log)
112 | * @param tc pointer to an allocated AVTimecode
113 | * @param rate frame rate in rational form
114 | * @param flags miscellaneous flags such as drop frame, +24 hours, ...
115 | * (see AVTimecodeFlag)
116 | * @param frame_start the first frame number
117 | * @return 0 on success, AVERROR otherwise
118 | */
119 | int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx);
120 |
121 | /**
122 | * Parse timecode representation (hh:mm:ss[:;.]ff).
123 | *
124 | * @param log_ctx a pointer to an arbitrary struct of which the first field is a
125 | * pointer to an AVClass struct (used for av_log).
126 | * @param tc pointer to an allocated AVTimecode
127 | * @param rate frame rate in rational form
128 | * @param str timecode string which will determine the frame start
129 | * @return 0 on success, AVERROR otherwise
130 | */
131 | int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx);
132 |
133 | /**
134 | * Check if the timecode feature is available for the given frame rate
135 | *
136 | * @return 0 if supported, <0 otherwise
137 | */
138 | int av_timecode_check_frame_rate(AVRational rate);
139 |
140 | #endif /* AVUTIL_TIMECODE_H */
141 |
--------------------------------------------------------------------------------
/include/libavutil/audio_fifo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Audio FIFO
3 | * Copyright (c) 2012 Justin Ruggles
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 | * Audio FIFO Buffer
25 | */
26 |
27 | #ifndef AVUTIL_AUDIO_FIFO_H
28 | #define AVUTIL_AUDIO_FIFO_H
29 |
30 | #include "avutil.h"
31 | #include "fifo.h"
32 | #include "samplefmt.h"
33 |
34 | /**
35 | * @addtogroup lavu_audio
36 | * @{
37 | *
38 | * @defgroup lavu_audiofifo Audio FIFO Buffer
39 | * @{
40 | */
41 |
42 | /**
43 | * Context for an Audio FIFO Buffer.
44 | *
45 | * - Operates at the sample level rather than the byte level.
46 | * - Supports multiple channels with either planar or packed sample format.
47 | * - Automatic reallocation when writing to a full buffer.
48 | */
49 | typedef struct AVAudioFifo AVAudioFifo;
50 |
51 | /**
52 | * Free an AVAudioFifo.
53 | *
54 | * @param af AVAudioFifo to free
55 | */
56 | void av_audio_fifo_free(AVAudioFifo *af);
57 |
58 | /**
59 | * Allocate an AVAudioFifo.
60 | *
61 | * @param sample_fmt sample format
62 | * @param channels number of channels
63 | * @param nb_samples initial allocation size, in samples
64 | * @return newly allocated AVAudioFifo, or NULL on error
65 | */
66 | AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
67 | int nb_samples);
68 |
69 | /**
70 | * Reallocate an AVAudioFifo.
71 | *
72 | * @param af AVAudioFifo to reallocate
73 | * @param nb_samples new allocation size, in samples
74 | * @return 0 if OK, or negative AVERROR code on failure
75 | */
76 | av_warn_unused_result
77 | int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
78 |
79 | /**
80 | * Write data to an AVAudioFifo.
81 | *
82 | * The AVAudioFifo will be reallocated automatically if the available space
83 | * is less than nb_samples.
84 | *
85 | * @see enum AVSampleFormat
86 | * The documentation for AVSampleFormat describes the data layout.
87 | *
88 | * @param af AVAudioFifo to write to
89 | * @param data audio data plane pointers
90 | * @param nb_samples number of samples to write
91 | * @return number of samples actually written, or negative AVERROR
92 | * code on failure. If successful, the number of samples
93 | * actually written will always be nb_samples.
94 | */
95 | int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
96 |
97 | /**
98 | * Peek data from an AVAudioFifo.
99 | *
100 | * @see enum AVSampleFormat
101 | * The documentation for AVSampleFormat describes the data layout.
102 | *
103 | * @param af AVAudioFifo to read from
104 | * @param data audio data plane pointers
105 | * @param nb_samples number of samples to peek
106 | * @return number of samples actually peek, or negative AVERROR code
107 | * on failure. The number of samples actually peek will not
108 | * be greater than nb_samples, and will only be less than
109 | * nb_samples if av_audio_fifo_size is less than nb_samples.
110 | */
111 | int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples);
112 |
113 | /**
114 | * Read data from an AVAudioFifo.
115 | *
116 | * @see enum AVSampleFormat
117 | * The documentation for AVSampleFormat describes the data layout.
118 | *
119 | * @param af AVAudioFifo to read from
120 | * @param data audio data plane pointers
121 | * @param nb_samples number of samples to read
122 | * @return number of samples actually read, or negative AVERROR code
123 | * on failure. The number of samples actually read will not
124 | * be greater than nb_samples, and will only be less than
125 | * nb_samples if av_audio_fifo_size is less than nb_samples.
126 | */
127 | int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples);
128 |
129 | /**
130 | * Drain data from an AVAudioFifo.
131 | *
132 | * Removes the data without reading it.
133 | *
134 | * @param af AVAudioFifo to drain
135 | * @param nb_samples number of samples to drain
136 | * @return 0 if OK, or negative AVERROR code on failure
137 | */
138 | int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples);
139 |
140 | /**
141 | * Reset the AVAudioFifo buffer.
142 | *
143 | * This empties all data in the buffer.
144 | *
145 | * @param af AVAudioFifo to reset
146 | */
147 | void av_audio_fifo_reset(AVAudioFifo *af);
148 |
149 | /**
150 | * Get the current number of samples in the AVAudioFifo available for reading.
151 | *
152 | * @param af the AVAudioFifo to query
153 | * @return number of samples available for reading
154 | */
155 | int av_audio_fifo_size(AVAudioFifo *af);
156 |
157 | /**
158 | * Get the current number of samples in the AVAudioFifo available for writing.
159 | *
160 | * @param af the AVAudioFifo to query
161 | * @return number of samples available for writing
162 | */
163 | int av_audio_fifo_space(AVAudioFifo *af);
164 |
165 | /**
166 | * @}
167 | * @}
168 | */
169 |
170 | #endif /* AVUTIL_AUDIO_FIFO_H */
171 |
--------------------------------------------------------------------------------
/include/libavutil/error.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 | * error code definitions
22 | */
23 |
24 | #ifndef AVUTIL_ERROR_H
25 | #define AVUTIL_ERROR_H
26 |
27 | #include
28 | #include
29 |
30 | /**
31 | * @addtogroup lavu_error
32 | *
33 | * @{
34 | */
35 |
36 |
37 | /* error handling */
38 | #if EDOM > 0
39 | #define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions.
40 | #define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
41 | #else
42 | /* Some platforms have E* and errno already negated. */
43 | #define AVERROR(e) (e)
44 | #define AVUNERROR(e) (e)
45 | #endif
46 |
47 | #define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d))
48 |
49 | #define AVERROR_BSF_NOT_FOUND FFERRTAG(0xF8,'B','S','F') ///< Bitstream filter not found
50 | #define AVERROR_BUG FFERRTAG( 'B','U','G','!') ///< Internal bug, also see AVERROR_BUG2
51 | #define AVERROR_BUFFER_TOO_SMALL FFERRTAG( 'B','U','F','S') ///< Buffer too small
52 | #define AVERROR_DECODER_NOT_FOUND FFERRTAG(0xF8,'D','E','C') ///< Decoder not found
53 | #define AVERROR_DEMUXER_NOT_FOUND FFERRTAG(0xF8,'D','E','M') ///< Demuxer not found
54 | #define AVERROR_ENCODER_NOT_FOUND FFERRTAG(0xF8,'E','N','C') ///< Encoder not found
55 | #define AVERROR_EOF FFERRTAG( 'E','O','F',' ') ///< End of file
56 | #define AVERROR_EXIT FFERRTAG( 'E','X','I','T') ///< Immediate exit was requested; the called function should not be restarted
57 | #define AVERROR_EXTERNAL FFERRTAG( 'E','X','T',' ') ///< Generic error in an external library
58 | #define AVERROR_FILTER_NOT_FOUND FFERRTAG(0xF8,'F','I','L') ///< Filter not found
59 | #define AVERROR_INVALIDDATA FFERRTAG( 'I','N','D','A') ///< Invalid data found when processing input
60 | #define AVERROR_MUXER_NOT_FOUND FFERRTAG(0xF8,'M','U','X') ///< Muxer not found
61 | #define AVERROR_OPTION_NOT_FOUND FFERRTAG(0xF8,'O','P','T') ///< Option not found
62 | #define AVERROR_PATCHWELCOME FFERRTAG( 'P','A','W','E') ///< Not yet implemented in FFmpeg, patches welcome
63 | #define AVERROR_PROTOCOL_NOT_FOUND FFERRTAG(0xF8,'P','R','O') ///< Protocol not found
64 |
65 | #define AVERROR_STREAM_NOT_FOUND FFERRTAG(0xF8,'S','T','R') ///< Stream not found
66 | /**
67 | * This is semantically identical to AVERROR_BUG
68 | * it has been introduced in Libav after our AVERROR_BUG and with a modified value.
69 | */
70 | #define AVERROR_BUG2 FFERRTAG( 'B','U','G',' ')
71 | #define AVERROR_UNKNOWN FFERRTAG( 'U','N','K','N') ///< Unknown error, typically from an external library
72 | #define AVERROR_EXPERIMENTAL (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
73 | #define AVERROR_INPUT_CHANGED (-0x636e6701) ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED)
74 | #define AVERROR_OUTPUT_CHANGED (-0x636e6702) ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED)
75 | /* HTTP & RTSP errors */
76 | #define AVERROR_HTTP_BAD_REQUEST FFERRTAG(0xF8,'4','0','0')
77 | #define AVERROR_HTTP_UNAUTHORIZED FFERRTAG(0xF8,'4','0','1')
78 | #define AVERROR_HTTP_FORBIDDEN FFERRTAG(0xF8,'4','0','3')
79 | #define AVERROR_HTTP_NOT_FOUND FFERRTAG(0xF8,'4','0','4')
80 | #define AVERROR_HTTP_OTHER_4XX FFERRTAG(0xF8,'4','X','X')
81 | #define AVERROR_HTTP_SERVER_ERROR FFERRTAG(0xF8,'5','X','X')
82 |
83 | #define AV_ERROR_MAX_STRING_SIZE 64
84 |
85 | /**
86 | * Put a description of the AVERROR code errnum in errbuf.
87 | * In case of failure the global variable errno is set to indicate the
88 | * error. Even in case of failure av_strerror() will print a generic
89 | * error message indicating the errnum provided to errbuf.
90 | *
91 | * @param errnum error code to describe
92 | * @param errbuf buffer to which description is written
93 | * @param errbuf_size the size in bytes of errbuf
94 | * @return 0 on success, a negative value if a description for errnum
95 | * cannot be found
96 | */
97 | int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
98 |
99 | /**
100 | * Fill the provided buffer with a string containing an error string
101 | * corresponding to the AVERROR code errnum.
102 | *
103 | * @param errbuf a buffer
104 | * @param errbuf_size size in bytes of errbuf
105 | * @param errnum error code to describe
106 | * @return the buffer in input, filled with the error description
107 | * @see av_strerror()
108 | */
109 | static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int errnum)
110 | {
111 | av_strerror(errnum, errbuf, errbuf_size);
112 | return errbuf;
113 | }
114 |
115 | /**
116 | * Convenience macro, the return value should be used only directly in
117 | * function arguments but never stand-alone.
118 | */
119 | #define av_err2str(errnum) \
120 | av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
121 |
122 | /**
123 | * @}
124 | */
125 |
126 | #endif /* AVUTIL_ERROR_H */
127 |
--------------------------------------------------------------------------------
/include/libavutil/mathematics.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2005-2012 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_MATHEMATICS_H
22 | #define AVUTIL_MATHEMATICS_H
23 |
24 | #include
25 | #include
26 | #include "attributes.h"
27 | #include "rational.h"
28 | #include "intfloat.h"
29 |
30 | #ifndef M_E
31 | #define M_E 2.7182818284590452354 /* e */
32 | #endif
33 | #ifndef M_LN2
34 | #define M_LN2 0.69314718055994530942 /* log_e 2 */
35 | #endif
36 | #ifndef M_LN10
37 | #define M_LN10 2.30258509299404568402 /* log_e 10 */
38 | #endif
39 | #ifndef M_LOG2_10
40 | #define M_LOG2_10 3.32192809488736234787 /* log_2 10 */
41 | #endif
42 | #ifndef M_PHI
43 | #define M_PHI 1.61803398874989484820 /* phi / golden ratio */
44 | #endif
45 | #ifndef M_PI
46 | #define M_PI 3.14159265358979323846 /* pi */
47 | #endif
48 | #ifndef M_PI_2
49 | #define M_PI_2 1.57079632679489661923 /* pi/2 */
50 | #endif
51 | #ifndef M_SQRT1_2
52 | #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
53 | #endif
54 | #ifndef M_SQRT2
55 | #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
56 | #endif
57 | #ifndef NAN
58 | #define NAN av_int2float(0x7fc00000)
59 | #endif
60 | #ifndef INFINITY
61 | #define INFINITY av_int2float(0x7f800000)
62 | #endif
63 |
64 | /**
65 | * @addtogroup lavu_math
66 | * @{
67 | */
68 |
69 |
70 | enum AVRounding {
71 | AV_ROUND_ZERO = 0, ///< Round toward zero.
72 | AV_ROUND_INF = 1, ///< Round away from zero.
73 | AV_ROUND_DOWN = 2, ///< Round toward -infinity.
74 | AV_ROUND_UP = 3, ///< Round toward +infinity.
75 | AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
76 | AV_ROUND_PASS_MINMAX = 8192, ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE
77 | };
78 |
79 | /**
80 | * Compute the greatest common divisor of a and b.
81 | *
82 | * @return gcd of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0;
83 | * if a == 0 and b == 0, returns 0.
84 | */
85 | int64_t av_const av_gcd(int64_t a, int64_t b);
86 |
87 | /**
88 | * Rescale a 64-bit integer with rounding to nearest.
89 | * A simple a*b/c isn't possible as it can overflow.
90 | */
91 | int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
92 |
93 | /**
94 | * Rescale a 64-bit integer with specified rounding.
95 | * A simple a*b/c isn't possible as it can overflow.
96 | *
97 | * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is
98 | * INT64_MIN or INT64_MAX then a is passed through unchanged.
99 | */
100 | int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
101 |
102 | /**
103 | * Rescale a 64-bit integer by 2 rational numbers.
104 | */
105 | int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
106 |
107 | /**
108 | * Rescale a 64-bit integer by 2 rational numbers with specified rounding.
109 | *
110 | * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is
111 | * INT64_MIN or INT64_MAX then a is passed through unchanged.
112 | */
113 | int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
114 | enum AVRounding) av_const;
115 |
116 | /**
117 | * Compare 2 timestamps each in its own timebases.
118 | * The result of the function is undefined if one of the timestamps
119 | * is outside the int64_t range when represented in the others timebase.
120 | * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
121 | */
122 | int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
123 |
124 | /**
125 | * Compare 2 integers modulo mod.
126 | * That is we compare integers a and b for which only the least
127 | * significant log2(mod) bits are known.
128 | *
129 | * @param mod must be a power of 2
130 | * @return a negative value if a is smaller than b
131 | * a positive value if a is greater than b
132 | * 0 if a equals b
133 | */
134 | int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
135 |
136 | /**
137 | * Rescale a timestamp while preserving known durations.
138 | *
139 | * @param in_ts Input timestamp
140 | * @param in_tb Input timebase
141 | * @param fs_tb Duration and *last timebase
142 | * @param duration duration till the next call
143 | * @param out_tb Output timebase
144 | */
145 | int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb);
146 |
147 | /**
148 | * Add a value to a timestamp.
149 | *
150 | * This function guarantees that when the same value is repeatly added that
151 | * no accumulation of rounding errors occurs.
152 | *
153 | * @param ts Input timestamp
154 | * @param ts_tb Input timestamp timebase
155 | * @param inc value to add to ts
156 | * @param inc_tb inc timebase
157 | */
158 | int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc);
159 |
160 |
161 | /**
162 | * @}
163 | */
164 |
165 | #endif /* AVUTIL_MATHEMATICS_H */
166 |
--------------------------------------------------------------------------------
/include/libavutil/tree.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 | * A tree container.
24 | * @author Michael Niedermayer
25 | */
26 |
27 | #ifndef AVUTIL_TREE_H
28 | #define AVUTIL_TREE_H
29 |
30 | #include "attributes.h"
31 | #include "version.h"
32 |
33 | /**
34 | * @addtogroup lavu_tree AVTree
35 | * @ingroup lavu_data
36 | *
37 | * Low-complexity tree container
38 | *
39 | * Insertion, removal, finding equal, largest which is smaller than and
40 | * smallest which is larger than, all have O(log n) worst-case complexity.
41 | * @{
42 | */
43 |
44 |
45 | struct AVTreeNode;
46 | extern const int av_tree_node_size;
47 |
48 | /**
49 | * Allocate an AVTreeNode.
50 | */
51 | struct AVTreeNode *av_tree_node_alloc(void);
52 |
53 | /**
54 | * Find an element.
55 | * @param root a pointer to the root node of the tree
56 | * @param next If next is not NULL, then next[0] will contain the previous
57 | * element and next[1] the next element. If either does not exist,
58 | * then the corresponding entry in next is unchanged.
59 | * @param cmp compare function used to compare elements in the tree,
60 | * API identical to that of Standard C's qsort
61 | * It is guranteed that the first and only the first argument to cmp()
62 | * will be the key parameter to av_tree_find(), thus it could if the
63 | * user wants, be a different type (like an opaque context).
64 | * @return An element with cmp(key, elem) == 0 or NULL if no such element
65 | * exists in the tree.
66 | */
67 | void *av_tree_find(const struct AVTreeNode *root, void *key,
68 | int (*cmp)(const void *key, const void *b), void *next[2]);
69 |
70 | /**
71 | * Insert or remove an element.
72 | *
73 | * If *next is NULL, then the supplied element will be removed if it exists.
74 | * If *next is non-NULL, then the supplied element will be inserted, unless
75 | * it already exists in the tree.
76 | *
77 | * @param rootp A pointer to a pointer to the root node of the tree; note that
78 | * the root node can change during insertions, this is required
79 | * to keep the tree balanced.
80 | * @param key pointer to the element key to insert in the tree
81 | * @param next Used to allocate and free AVTreeNodes. For insertion the user
82 | * must set it to an allocated and zeroed object of at least
83 | * av_tree_node_size bytes size. av_tree_insert() will set it to
84 | * NULL if it has been consumed.
85 | * For deleting elements *next is set to NULL by the user and
86 | * av_tree_insert() will set it to the AVTreeNode which was
87 | * used for the removed element.
88 | * This allows the use of flat arrays, which have
89 | * lower overhead compared to many malloced elements.
90 | * You might want to define a function like:
91 | * @code
92 | * void *tree_insert(struct AVTreeNode **rootp, void *key,
93 | * int (*cmp)(void *key, const void *b),
94 | * AVTreeNode **next)
95 | * {
96 | * if (!*next)
97 | * *next = av_mallocz(av_tree_node_size);
98 | * return av_tree_insert(rootp, key, cmp, next);
99 | * }
100 | * void *tree_remove(struct AVTreeNode **rootp, void *key,
101 | * int (*cmp)(void *key, const void *b, AVTreeNode **next))
102 | * {
103 | * av_freep(next);
104 | * return av_tree_insert(rootp, key, cmp, next);
105 | * }
106 | * @endcode
107 | * @param cmp compare function used to compare elements in the tree, API identical
108 | * to that of Standard C's qsort
109 | * @return If no insertion happened, the found element; if an insertion or
110 | * removal happened, then either key or NULL will be returned.
111 | * Which one it is depends on the tree state and the implementation. You
112 | * should make no assumptions that it's one or the other in the code.
113 | */
114 | void *av_tree_insert(struct AVTreeNode **rootp, void *key,
115 | int (*cmp)(const void *key, const void *b),
116 | struct AVTreeNode **next);
117 |
118 | void av_tree_destroy(struct AVTreeNode *t);
119 |
120 | /**
121 | * Apply enu(opaque, &elem) to all the elements in the tree in a given range.
122 | *
123 | * @param cmp a comparison function that returns < 0 for a element below the
124 | * range, > 0 for a element above the range and == 0 for a
125 | * element inside the range
126 | *
127 | * @note The cmp function should use the same ordering used to construct the
128 | * tree.
129 | */
130 | void av_tree_enumerate(struct AVTreeNode *t, void *opaque,
131 | int (*cmp)(void *opaque, void *elem),
132 | int (*enu)(void *opaque, void *elem));
133 |
134 | /**
135 | * @}
136 | */
137 |
138 | #endif /* AVUTIL_TREE_H */
139 |
--------------------------------------------------------------------------------
/include/librtmp/amf.h:
--------------------------------------------------------------------------------
1 | #ifndef __AMF_H__
2 | #define __AMF_H__
3 | /*
4 | * Copyright (C) 2005-2008 Team XBMC
5 | * http://www.xbmc.org
6 | * Copyright (C) 2008-2009 Andrej Stepanchuk
7 | * Copyright (C) 2009-2010 Howard Chu
8 | *
9 | * This file is part of librtmp.
10 | *
11 | * librtmp is free software; you can redistribute it and/or modify
12 | * it under the terms of the GNU Lesser General Public License as
13 | * published by the Free Software Foundation; either version 2.1,
14 | * or (at your option) any later version.
15 | *
16 | * librtmp is distributed in the hope that it will be useful,
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 | * GNU General Public License for more details.
20 | *
21 | * You should have received a copy of the GNU Lesser General Public License
22 | * along with librtmp see the file COPYING. If not, write to
23 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 | * Boston, MA 02110-1301, USA.
25 | * http://www.gnu.org/copyleft/lgpl.html
26 | */
27 |
28 | #include
29 |
30 | #ifndef TRUE
31 | #define TRUE 1
32 | #define FALSE 0
33 | #endif
34 |
35 | #ifdef __cplusplus
36 | extern "C"
37 | {
38 | #endif
39 |
40 | typedef enum
41 | { AMF_NUMBER = 0, AMF_BOOLEAN, AMF_STRING, AMF_OBJECT,
42 | AMF_MOVIECLIP, /* reserved, not used */
43 | AMF_NULL, AMF_UNDEFINED, AMF_REFERENCE, AMF_ECMA_ARRAY, AMF_OBJECT_END,
44 | AMF_STRICT_ARRAY, AMF_DATE, AMF_LONG_STRING, AMF_UNSUPPORTED,
45 | AMF_RECORDSET, /* reserved, not used */
46 | AMF_XML_DOC, AMF_TYPED_OBJECT,
47 | AMF_AVMPLUS, /* switch to AMF3 */
48 | AMF_INVALID = 0xff
49 | } AMFDataType;
50 |
51 | typedef enum
52 | { AMF3_UNDEFINED = 0, AMF3_NULL, AMF3_FALSE, AMF3_TRUE,
53 | AMF3_INTEGER, AMF3_DOUBLE, AMF3_STRING, AMF3_XML_DOC, AMF3_DATE,
54 | AMF3_ARRAY, AMF3_OBJECT, AMF3_XML, AMF3_BYTE_ARRAY
55 | } AMF3DataType;
56 |
57 | typedef struct AVal
58 | {
59 | char *av_val;
60 | int av_len;
61 | } AVal;
62 | #define AVC(str) {str,sizeof(str)-1}
63 | #define AVMATCH(a1,a2) ((a1)->av_len == (a2)->av_len && !memcmp((a1)->av_val,(a2)->av_val,(a1)->av_len))
64 |
65 | struct AMFObjectProperty;
66 |
67 | typedef struct AMFObject
68 | {
69 | int o_num;
70 | struct AMFObjectProperty *o_props;
71 | } AMFObject;
72 |
73 | typedef struct AMFObjectProperty
74 | {
75 | AVal p_name;
76 | AMFDataType p_type;
77 | union
78 | {
79 | double p_number;
80 | AVal p_aval;
81 | AMFObject p_object;
82 | } p_vu;
83 | int16_t p_UTCoffset;
84 | } AMFObjectProperty;
85 |
86 | char *AMF_EncodeString(char *output, char *outend, const AVal * str);
87 | char *AMF_EncodeNumber(char *output, char *outend, double dVal);
88 | char *AMF_EncodeInt16(char *output, char *outend, short nVal);
89 | char *AMF_EncodeInt24(char *output, char *outend, int nVal);
90 | char *AMF_EncodeInt32(char *output, char *outend, int nVal);
91 | char *AMF_EncodeBoolean(char *output, char *outend, int bVal);
92 |
93 | /* Shortcuts for AMFProp_Encode */
94 | char *AMF_EncodeNamedString(char *output, char *outend, const AVal * name, const AVal * value);
95 | char *AMF_EncodeNamedNumber(char *output, char *outend, const AVal * name, double dVal);
96 | char *AMF_EncodeNamedBoolean(char *output, char *outend, const AVal * name, int bVal);
97 |
98 | unsigned short AMF_DecodeInt16(const char *data);
99 | unsigned int AMF_DecodeInt24(const char *data);
100 | unsigned int AMF_DecodeInt32(const char *data);
101 | void AMF_DecodeString(const char *data, AVal * str);
102 | void AMF_DecodeLongString(const char *data, AVal * str);
103 | int AMF_DecodeBoolean(const char *data);
104 | double AMF_DecodeNumber(const char *data);
105 |
106 | char *AMF_Encode(AMFObject * obj, char *pBuffer, char *pBufEnd);
107 | char *AMF_EncodeEcmaArray(AMFObject *obj, char *pBuffer, char *pBufEnd);
108 | char *AMF_EncodeArray(AMFObject *obj, char *pBuffer, char *pBufEnd);
109 |
110 | int AMF_Decode(AMFObject * obj, const char *pBuffer, int nSize,
111 | int bDecodeName);
112 | int AMF_DecodeArray(AMFObject * obj, const char *pBuffer, int nSize,
113 | int nArrayLen, int bDecodeName);
114 | int AMF3_Decode(AMFObject * obj, const char *pBuffer, int nSize,
115 | int bDecodeName);
116 | void AMF_Dump(AMFObject * obj);
117 | void AMF_Reset(AMFObject * obj);
118 |
119 | void AMF_AddProp(AMFObject * obj, const AMFObjectProperty * prop);
120 | int AMF_CountProp(AMFObject * obj);
121 | AMFObjectProperty *AMF_GetProp(AMFObject * obj, const AVal * name,
122 | int nIndex);
123 |
124 | AMFDataType AMFProp_GetType(AMFObjectProperty * prop);
125 | void AMFProp_SetNumber(AMFObjectProperty * prop, double dval);
126 | void AMFProp_SetBoolean(AMFObjectProperty * prop, int bflag);
127 | void AMFProp_SetString(AMFObjectProperty * prop, AVal * str);
128 | void AMFProp_SetObject(AMFObjectProperty * prop, AMFObject * obj);
129 |
130 | void AMFProp_GetName(AMFObjectProperty * prop, AVal * name);
131 | void AMFProp_SetName(AMFObjectProperty * prop, AVal * name);
132 | double AMFProp_GetNumber(AMFObjectProperty * prop);
133 | int AMFProp_GetBoolean(AMFObjectProperty * prop);
134 | void AMFProp_GetString(AMFObjectProperty * prop, AVal * str);
135 | void AMFProp_GetObject(AMFObjectProperty * prop, AMFObject * obj);
136 |
137 | int AMFProp_IsValid(AMFObjectProperty * prop);
138 |
139 | char *AMFProp_Encode(AMFObjectProperty * prop, char *pBuffer, char *pBufEnd);
140 | int AMF3Prop_Decode(AMFObjectProperty * prop, const char *pBuffer,
141 | int nSize, int bDecodeName);
142 | int AMFProp_Decode(AMFObjectProperty * prop, const char *pBuffer,
143 | int nSize, int bDecodeName);
144 |
145 | void AMFProp_Dump(AMFObjectProperty * prop);
146 | void AMFProp_Reset(AMFObjectProperty * prop);
147 |
148 | typedef struct AMF3ClassDef
149 | {
150 | AVal cd_name;
151 | char cd_externalizable;
152 | char cd_dynamic;
153 | int cd_num;
154 | AVal *cd_props;
155 | } AMF3ClassDef;
156 |
157 | void AMF3CD_AddProp(AMF3ClassDef * cd, AVal * prop);
158 | AVal *AMF3CD_GetProp(AMF3ClassDef * cd, int idx);
159 |
160 | #ifdef __cplusplus
161 | }
162 | #endif
163 |
164 | #endif /* __AMF_H__ */
165 |
--------------------------------------------------------------------------------
/include/libavutil/fifo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | /**
20 | * @file
21 | * a very simple circular buffer FIFO implementation
22 | */
23 |
24 | #ifndef AVUTIL_FIFO_H
25 | #define AVUTIL_FIFO_H
26 |
27 | #include
28 | #include "avutil.h"
29 | #include "attributes.h"
30 |
31 | typedef struct AVFifoBuffer {
32 | uint8_t *buffer;
33 | uint8_t *rptr, *wptr, *end;
34 | uint32_t rndx, wndx;
35 | } AVFifoBuffer;
36 |
37 | /**
38 | * Initialize an AVFifoBuffer.
39 | * @param size of FIFO
40 | * @return AVFifoBuffer or NULL in case of memory allocation failure
41 | */
42 | AVFifoBuffer *av_fifo_alloc(unsigned int size);
43 |
44 | /**
45 | * Initialize an AVFifoBuffer.
46 | * @param nmemb number of elements
47 | * @param size size of the single element
48 | * @return AVFifoBuffer or NULL in case of memory allocation failure
49 | */
50 | AVFifoBuffer *av_fifo_alloc_array(size_t nmemb, size_t size);
51 |
52 | /**
53 | * Free an AVFifoBuffer.
54 | * @param f AVFifoBuffer to free
55 | */
56 | void av_fifo_free(AVFifoBuffer *f);
57 |
58 | /**
59 | * Free an AVFifoBuffer and reset pointer to NULL.
60 | * @param f AVFifoBuffer to free
61 | */
62 | void av_fifo_freep(AVFifoBuffer **f);
63 |
64 | /**
65 | * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
66 | * @param f AVFifoBuffer to reset
67 | */
68 | void av_fifo_reset(AVFifoBuffer *f);
69 |
70 | /**
71 | * Return the amount of data in bytes in the AVFifoBuffer, that is the
72 | * amount of data you can read from it.
73 | * @param f AVFifoBuffer to read from
74 | * @return size
75 | */
76 | int av_fifo_size(const AVFifoBuffer *f);
77 |
78 | /**
79 | * Return the amount of space in bytes in the AVFifoBuffer, that is the
80 | * amount of data you can write into it.
81 | * @param f AVFifoBuffer to write into
82 | * @return size
83 | */
84 | int av_fifo_space(const AVFifoBuffer *f);
85 |
86 | /**
87 | * Feed data at specific position from an AVFifoBuffer to a user-supplied callback.
88 | * Similar as av_fifo_gereric_read but without discarding data.
89 | * @param f AVFifoBuffer to read from
90 | * @param offset offset from current read position
91 | * @param buf_size number of bytes to read
92 | * @param func generic read function
93 | * @param dest data destination
94 | */
95 | int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int buf_size, void (*func)(void*, void*, int));
96 |
97 | /**
98 | * Feed data from an AVFifoBuffer to a user-supplied callback.
99 | * Similar as av_fifo_gereric_read but without discarding data.
100 | * @param f AVFifoBuffer to read from
101 | * @param buf_size number of bytes to read
102 | * @param func generic read function
103 | * @param dest data destination
104 | */
105 | int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
106 |
107 | /**
108 | * Feed data from an AVFifoBuffer to a user-supplied callback.
109 | * @param f AVFifoBuffer to read from
110 | * @param buf_size number of bytes to read
111 | * @param func generic read function
112 | * @param dest data destination
113 | */
114 | int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
115 |
116 | /**
117 | * Feed data from a user-supplied callback to an AVFifoBuffer.
118 | * @param f AVFifoBuffer to write to
119 | * @param src data source; non-const since it may be used as a
120 | * modifiable context by the function defined in func
121 | * @param size number of bytes to write
122 | * @param func generic write function; the first parameter is src,
123 | * the second is dest_buf, the third is dest_buf_size.
124 | * func must return the number of bytes written to dest_buf, or <= 0 to
125 | * indicate no more data available to write.
126 | * If func is NULL, src is interpreted as a simple byte array for source data.
127 | * @return the number of bytes written to the FIFO
128 | */
129 | int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
130 |
131 | /**
132 | * Resize an AVFifoBuffer.
133 | * In case of reallocation failure, the old FIFO is kept unchanged.
134 | *
135 | * @param f AVFifoBuffer to resize
136 | * @param size new AVFifoBuffer size in bytes
137 | * @return <0 for failure, >=0 otherwise
138 | */
139 | int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
140 |
141 | /**
142 | * Enlarge an AVFifoBuffer.
143 | * In case of reallocation failure, the old FIFO is kept unchanged.
144 | * The new fifo size may be larger than the requested size.
145 | *
146 | * @param f AVFifoBuffer to resize
147 | * @param additional_space the amount of space in bytes to allocate in addition to av_fifo_size()
148 | * @return <0 for failure, >=0 otherwise
149 | */
150 | int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space);
151 |
152 | /**
153 | * Read and discard the specified amount of data from an AVFifoBuffer.
154 | * @param f AVFifoBuffer to read from
155 | * @param size amount of data to read in bytes
156 | */
157 | void av_fifo_drain(AVFifoBuffer *f, int size);
158 |
159 | /**
160 | * Return a pointer to the data stored in a FIFO buffer at a certain offset.
161 | * The FIFO buffer is not modified.
162 | *
163 | * @param f AVFifoBuffer to peek at, f must be non-NULL
164 | * @param offs an offset in bytes, its absolute value must be less
165 | * than the used buffer size or the returned pointer will
166 | * point outside to the buffer data.
167 | * The used buffer size can be checked with av_fifo_size().
168 | */
169 | static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
170 | {
171 | uint8_t *ptr = f->rptr + offs;
172 | if (ptr >= f->end)
173 | ptr = f->buffer + (ptr - f->end);
174 | else if (ptr < f->buffer)
175 | ptr = f->end - (f->buffer - ptr);
176 | return ptr;
177 | }
178 |
179 | #endif /* AVUTIL_FIFO_H */
180 |
--------------------------------------------------------------------------------