/
githubmirror
/
FFmpeg
ОбзорДокументацияВойти
/
githubmirror
/
FFmpeg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
ДокументацияПоддержка
Политика конфиденциальностиПользовательское соглашениеПолитика использования «cookies»Согласие субъекта персональных данных
2026 ©
FFmpeg/
libavutil/
..
aarch64

avutil/crc: add aarch64 hybrid crc32 NEON PMULL+EOR SIMD implementation

месяц назад
arm

arm: Avoid warnings about redefining HWCAP constants

25 дней назад
loongarch

avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()

2 года назад
mips

avutil/mips: Add msa optimizations for pixelutils

5 месяцев назад
ppc

libavutil/ppc: Remove mfspr-based AltiVec detection code for Linux

4 месяца назад
riscv

avutil/riscv: Include unistd.h for musl Linux

2 месяца назад
tests

avutil/hwcontext_cuda: remove format allowlist, accept any pixel format

19 дней назад
wasm

all: fix whitespace/new-line issues

год назад
x86

avutil/x86/asm: Remove HAVE_[67]REGS, use HAVE_X86_[67]REGS directly

19 дней назад
.gitignore

Merge commit '257f00ec1ab06a2a161f535036c6512f3fc8e801'

10 лет назад
Makefile

avutil/hwcontext_cuda: remove format allowlist, accept any pixel format

19 дней назад
adler32.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
adler32.h

avutil: Switch crypto APIs to size_t

5 лет назад
aes.c

avutil/x86/aes: Only assemble iff HAVE_AESNI_EXTERNAL

4 месяца назад
aes.h

avutil/aes: document some missing arguments

4 года назад
aes_ctr.c

avutil/aes_ctr: reintroduce the block offset state

год назад
aes_ctr.h

avutil/aes_ctr: document some missing arguments

4 года назад
aes_internal.h

lavu/aes: add x86 AESNI optimizations

год назад
ambient_viewing_environment.c

avutil: zero size output parameter on allocation failure

2 месяца назад
ambient_viewing_environment.h

avutil: introduce AVAmbientViewingEnvironment side data

4 года назад
attributes.h

avutil: add av_fallthrough

3 месяца назад
attributes_internal.h

avutil/attributes_internal: Add attribute_nonstring

6 месяцев назад
audio_fifo.c

avutil/audio_fifo: Constify some pointees

3 года назад
audio_fifo.h

avutil/audio_fifo: Constify some pointees

3 года назад
avassert.h

avutil/avassert: Deprecate av_assert0_fpu()

6 месяцев назад
avsscanf.c

avutil/avsscanf: add break

3 месяца назад
avstring.c

all: Don't discard const through {mem,str,strr}chr

месяц назад
avstring.h

lavu: add av_scanf_format() and use it on av_sscanf()

год назад
avutil.h

avutil: Remove FF_API_OPT_INT_LIST

2 месяца назад
avutilres.rc

Add Windows resource file support for shared libraries

13 лет назад
base64.c

libavutil/base64: Try not to write over the array end

2 года назад
base64.h

lavu/base64: add AV_BASE64_DECODE_SIZE() macro

10 лет назад
blowfish.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
blowfish.h

avutil: undo FF_API_CRYPTO_CONTEXT deprecation

11 лет назад
bprint.c

avutil/bprint: fix pointer signedness in return value for av_bprint_get_buffer()

месяц назад
bprint.h

fix "param"s that should be "@param"

2 года назад
bswap.h

avutil/bswap: fix implicit conversion warning in av_bswap64

5 месяцев назад
buffer.c

avutil/buffer: Check ff_mutex_init() for failure

2 года назад
buffer.h

avutil/buffer: constify some function parameters

5 лет назад
buffer_internal.h

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
camellia.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
camellia.h

avutil/camellia: Fix doxy @param typo

4 года назад
cast5.c

avutil/cast5: Avoid undefined shift of uint32_t by 32 places

4 года назад
cast5.h

avutil/cast5: update Doxygen for av_cast5_init with return information

11 лет назад
channel_layout.c

all: Don't discard const through {mem,str,strr}chr

месяц назад
channel_layout.h

all: fix typos found by codespell

год назад
colorspace.h

avutil/colorspace: add macros for RGB->YUV BT.709

7 лет назад
common.h

avutil/common: Remove FF_API_MOD_UINTP2

2 месяца назад
container_fifo.c

lavc/container_fifo: move to lavu and make public

2 года назад
container_fifo.h

lavc/container_fifo: move to lavu and make public

2 года назад
cpu.c

avutil/cpu: add aarch64 CPU feature flag for PMULL and EOR3

5 месяцев назад
cpu.h

avutil/cpu: Remove FF_API_RISCV_FD_ZBA

2 месяца назад
cpu_internal.h

configure: Add wasm as a fake arch

2 года назад
crc.c

avutil/crc: add aarch64 NEON PMULL+EOR3 SIMD implementation for av_crc

5 месяцев назад
crc.h

avutil/crc: Add doxy for missing arguments

4 года назад
crc_internal.h

avutil/crc_internal: mark xnmodp as av_unused

6 часов назад
csp.c

avutil/csp: don't dereference NULL pointer in av_csp_primaries_desc_from_id()

9 месяцев назад
csp.h

avutil/csp: add av_csp_approximate_eotf_gamma()

10 месяцев назад
cuda_check.h

avutil/log: Don't include avutil.h

4 года назад
des.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
des.h

avutil/des: Add doxy for missing arguments

4 года назад
detection_bbox.c

avutil/common: Don't auto-include mem.h

2 года назад
detection_bbox.h

avutil/detection_bbox: Add doxy for missing argument

4 года назад
dict.c

avutil/dict: fix memleak in av_dict_set()

год назад
dict.h

all: fix typos found by codespell

год назад
display.c

avutil/display: Don't include avutil.h

4 года назад
display.h

avutil/display: Add file to doxy group

4 года назад
dovi_meta.c

avutil: zero size output parameter on allocation failure

2 месяца назад
dovi_meta.h

avutil/dovi_meta: Document valid range for index of av_dovi_get_ext()

6 месяцев назад
downmix_info.c

avutil/downmix_info: add a new API to propagate pre-made downmix matrixes

месяц назад
downmix_info.h

avutil/downmix_info: add a new API to propagate pre-made downmix matrixes

месяц назад
dynarray.h

avutil/dynarry.h: fix comment grammar mistakes of FF_DYNARRAY_ADD

7 лет назад
emms.h

avutil/x86/emms: Unavpriv avpriv_emms_asm()

2 месяца назад
encryption_info.c

avutil/mem: Don't include avutil.h

3 года назад
encryption_info.h

avutil/encryption_info: Fix documentation problem.

8 лет назад
error.c

avutil/error: Fix overflow when negating

5 месяцев назад
error.h

avutil/error: Add HTTP 429 Too Many Requests AVERROR code

2 года назад
eval.c

avutil/eval: apply unary sign to print, squish, gauss and lerp

2 месяца назад
eval.h

apply spelling fixes

3 года назад
executor.c

avutil/executor: Fix stack overflow due to recursive call

2 года назад
executor.h

avutil/executor: Allowing thread_count be zero

2 года назад
ffmath.h

all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.h

10 лет назад
fifo.c

avutil: remove deprecated FF_API_FIFO_OLD_API

2 года назад
fifo.h

avutil/fifo, file: Remove unused headers

2 года назад
file.c

avutil/file: fix av_file_map file mapping on Windows

2 года назад
file.h

avutil/fifo, file: Remove unused headers

2 года назад
file_open.c

av{codec,util}/tests: Remove pointless undefs

9 месяцев назад
file_open.h

avutil/internal: Move avpriv-file API to a header of its own

4 года назад
film_grain_params.c

avutil: zero size output parameter on allocation failure

2 месяца назад
film_grain_params.h

all: fix typos found by codespell

год назад
fixed_dsp.c

avutil/x86/Makefile: Only compile ASM init files when X86ASM is enabled

8 месяцев назад
fixed_dsp.h

configure: Remove av_restrict

2 года назад
float2half.c

avutil/half2float: use native _Float16 if available

4 года назад
float2half.h

avutil/half2float: use native _Float16 if available

4 года назад
float_dsp.c

avutil/x86/Makefile: Only compile ASM init files when X86ASM is enabled

8 месяцев назад
float_dsp.h

avutil/float_dsp: Unavpriv avpriv_scalarproduct_float_c()

год назад
float_scalarproduct.c

avutil/float_dsp: Unavpriv avpriv_scalarproduct_float_c()

год назад
frame.c

avutil/frame: add AVFrame.alpha_mode

год назад
frame.h

avutil/frame: add a new side data type for downmix matrix

месяц назад
getenv_utf8.h

libavutil: Add wchartoutf8(), wchartoansi(), utf8toansi(), getenv_utf8(), freeenv_utf8() and getenv_dup()

4 года назад
half2float.c

avutil/half2float: use native _Float16 if available

4 года назад
half2float.h

avutil/half2float: use native _Float16 if available

4 года назад
hash.c

avutil/hash: Avoid relocations for hash names

2 года назад
hash.h

Remove obsolete version.h inclusions

5 лет назад
hdr_dynamic_metadata.c

avutil: zero size output parameter on allocation failure

2 месяца назад
hdr_dynamic_metadata.h

libavutil: Add functions for SMPTE-2094-50 HDR metadata

4 месяца назад
hdr_dynamic_vivid_metadata.c

avutil: zero size output parameter on allocation failure

2 месяца назад
hdr_dynamic_vivid_metadata.h

all: fix typos found by codespell

год назад
hmac.c

avutil/hmac: avoid calling functions through pointer of invalid type

год назад
hmac.h

Remove obsolete version.h inclusions

5 лет назад
hwcontext.c

avutil/hwcontext: Add ohcodec device and pixel format

год назад
hwcontext.h

all: fix typos found by codespell

год назад
hwcontext_amf.c

avutil/hwcontext_amf: Implement AMF hardware memory mapping support.

2 месяца назад
hwcontext_amf.h

avfilter/vf_vpp_amf: Extend AMF Color Converter HDR capabilities

5 месяцев назад
hwcontext_amf_internal.h

avutil/hwcontext_amf: Add AMF_IFACE_CALL macro

4 месяца назад
hwcontext_cuda.c

avutil/hwcontext_cuda: fix unused variable 'i' warning

19 дней назад
hwcontext_cuda.h

avutil/hwcontext_cuda: add CUarray surface pool support

месяц назад
hwcontext_cuda_internal.h

avutil/hwcontext_cuda: add CUarray surface pool support

месяц назад
hwcontext_d3d11va.c

avutil/hwcontext_d3d11va: support native P016 format

2 месяца назад
hwcontext_d3d11va.h

avutil/hwcontext_d3d11va: added resource and heap flags to DeviceContext

7 месяцев назад
hwcontext_d3d12va.c

avcodec/d3d12va: add AV1 Profile 2 support

14 дней назад
hwcontext_d3d12va.h

avutil/hwcontext_d3d12va: added resource and heap flags to DeviceContext

год назад
hwcontext_d3d12va_internal.h

libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12

3 года назад
hwcontext_drm.c

avutil/hwcontext_drm: fix mapping when dst format is unset

год назад
hwcontext_drm.h

hwcontext_drm: Clarify value for unknown format modifiers

8 лет назад
hwcontext_dxva2.c

libavutil/hwcontext_{d3d11va, dxva2}: Support Y212/XV36 pixel format

2 года назад
hwcontext_dxva2.h

dxva: add support for new dxva2 and d3d11 hwaccel APIs

9 лет назад
hwcontext_internal.h

avutil/hwcontext: Add ohcodec device and pixel format

год назад
hwcontext_mediacodec.c

avutil/hwcontext_mediacodec: fix backward compatibility

4 года назад
hwcontext_mediacodec.h

avutil/hwcontext_mediacodec: fix backward compatibility

4 года назад
hwcontext_oh.c

avutil/hwcontext: Add ohcodec device and pixel format

год назад
hwcontext_oh.h

avutil/hwcontext: Add ohcodec device and pixel format

год назад
hwcontext_opencl.c

avutil/hwcontext_opencl: don't fall through between mapping types

6 часов назад
hwcontext_opencl.h

all: fix typos found by codespell

год назад
hwcontext_qsv.c

avutil/hwcontext_qsv: fix fall-through in qsv_fixed_pool_map_to()

6 часов назад
hwcontext_qsv.h

all: fix whitespace/new-line issues

год назад
hwcontext_stub.c

)hwcontext: add a stub implementation for Vulkan functions

4 года назад
hwcontext_vaapi.c

hwcontext_vaapi: fix undefined close() on windows

17 дней назад
hwcontext_vaapi.h

doc: fix typos

7 месяцев назад
hwcontext_vdpau.c

avutil/hwcontext: Allocate AVHWFramesCtx jointly with its internals

2 года назад
hwcontext_vdpau.h

Merge commit 'a001ce31bc2bcf875a39b5fb22dae49120293b42'

10 лет назад
hwcontext_videotoolbox.c

lavc: add ProRes RAW videotoolbox hwaccel

3 месяца назад
hwcontext_videotoolbox.h

avutil/hwcontext_videotoolbox: Update documentation

2 года назад
hwcontext_vulkan.c

avutil/hwcontext_vulkan: Query export support with the real image flags

3 дня назад
hwcontext_vulkan.h

avutil/hwcontext_vulkan: Move AVVkFrame.internal to the end

2 месяца назад
iamf.c

avutil/iamf: stop setting parameter definition block defaults

6 месяцев назад
iamf.h

avutil/iamf: add an AVOption for AVIAMFLayer.demixing_matrix

7 месяцев назад
imgutils.c

avutil/imgutils: use AV_CEIL_RSHIFT

8 месяцев назад
imgutils.h

avutil/imgutils: add new function av_image_fill_color()

3 года назад
imgutils_internal.h

avutil/internal: Move avpriv_set_systematic_pal2 decl to imgutils_internal.h

2 года назад
int128.h

avutil/int128: add header for 128-bit integers

2 месяца назад
integer.c

avutil/integer: Use '|' instead of '+' where it is more natural

4 года назад
integer.h

avutil/integer: Don't include common.h

4 года назад
internal.h

avutil/xga_font_data: Stop exporting font data directly

2 месяца назад
intfloat.h

Reinstate proper FFmpeg license for all files.

13 лет назад
intmath.c

intmath: remove av_ctz.

11 лет назад
intmath.h

avutil/intmath: use AV_HAS_BUILTIN to detect builtin availability

год назад
intreadwrite.h

avutil/aarch64: add AV_COPY128 and AV_ZERO128 macros

2 года назад
lfg.c

libavutil: add av_lfg_init_from_data() function

10 лет назад
lfg.h

all: fix typos found by codespell

год назад
libavutil.v

build: Change structure of the linker version script templates

10 лет назад
libm.h

avutil/libm: Only include intfloat.h when needed

год назад
lls.c

avutil/x86/Makefile: Only compile ASM init files when X86ASM is enabled

8 месяцев назад
lls.h

lavu/lls: R-V V update_lls

2 года назад
log.c

avutil/log: use atomics to load and store logging level, flags and callback pointer

8 месяцев назад
log.h

all: fix typos found by codespell

год назад
log2_tab.c

Merge commit '930c9d4373e0f3cb7c64fcfc129127a309f6d066'

14 лет назад
lzo.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
lzo.h

Merge remote-tracking branch 'qatar/master'

14 лет назад
macos_kperf.c

avutil/macos_kperf: Fix assert which makes kperf failed to run

2 года назад
macos_kperf.h

lavu/kperf: use ff_thread_once()

5 лет назад
macros.h

avutil/common, macros: Move several macros from common.h to macros.h

5 лет назад
mastering_display_metadata.c

avutil: zero size output parameter on allocation failure

2 месяца назад
mastering_display_metadata.h

avutil/mastering_display_metadata: add a new allocator function that returns a size

2 года назад
mathematics.c

Move bessel_i0() from swresample/resample to avutil/mathematics

3 года назад
mathematics.h

all: fix typos found by codespell

год назад
md5.c

avutil/mem: Don't include avutil.h

3 года назад
md5.h

Remove obsolete version.h inclusions

5 лет назад
mem.c

all: Don't discard const through {mem,str,strr}chr

месяц назад
mem.h

avutil/mem: Don't include avutil.h

3 года назад
mem_internal.h

avutil: Fix linking x86 asm constants with Clang in MSVC mode

год назад
motion_vector.h

avutil/motion_vector: export subpel motion information

11 лет назад
murmur3.c

avutil/mem: Don't include avutil.h

3 года назад
murmur3.h

Remove obsolete version.h inclusions

5 лет назад
objc.h

avutil: add obj-c helpers into header-only include

5 лет назад
opt.c

avutil/opt: Use correct enum size

3 дня назад
opt.h

avutil/opt: Remove FF_API_OPT_PTR

2 месяца назад
parseutils.c

avutil/parseutils: do no rely on av_d2q returning higher num/den than allowed in av_parse_video_rate

2 года назад
parseutils.h

avutil/parseutils: Use inline code and properly escape

4 года назад
pca.c

avutil/common: Don't auto-include mem.h

2 года назад
pca.h

avutil/pca: Make argument of ff_pca_add() const

12 лет назад
pixdesc.c

avutil/pixfmt: add AV_PIX_FMT_CUARRAY for opaque CUDA block-linear surfaces

месяц назад
pixdesc.h

avutil/frame: add AVFrame.alpha_mode

год назад
pixelutils.c

avutil/mips: Add msa optimizations for pixelutils

5 месяцев назад
pixelutils.h

avutil/pixelutils: Don't include common.h

4 года назад
pixfmt.h

avutil/pixfmt: add AV_PIX_FMT_CUARRAY for opaque CUDA block-linear surfaces

месяц назад
qsort.h

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
random_seed.c

random_seed: Improve behaviour with small timer increments with high precision timers

год назад
random_seed.h

avutil/random_seed: include stddef.h

3 года назад
rational.c

avutil/rational: avoid signed integer overflow

2 месяца назад
rational.h

all: fix typos found by codespell

год назад
raw_color_params.c

lavu/frame: add camera raw codec side data

2 месяца назад
raw_color_params.h

lavu/frame: add camera raw codec side data

2 месяца назад
rc4.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
rc4.h

all: fix typos found by codespell

год назад
refstruct.c

avutil/refstruct: Remove redundant check

год назад
refstruct.h

all: fix typos found by codespell

год назад
replaygain.h

Merge commit '29c2d06d67724e994980045afa055c6c34611b30'

10 лет назад
reverse.c

avutil: add ff_reverse as av_reverse replacement

11 лет назад
reverse.h

avutil/reverse: move the ff_reverse declaration to a separate header

10 лет назад
ripemd.c

ALL: move av_unused to conform with standard requirement

10 месяцев назад
ripemd.h

Remove obsolete version.h inclusions

5 лет назад
samplefmt.c

avutil/samplefmt: Constify some pointees

3 года назад
samplefmt.h

avutil/samplefmt: Dont claim that av_get_sample_fmt_string checks sample_fmt

4 месяца назад
sfc64.h

avutil/eval: Use even better PRNG

3 года назад
sha.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
sha.h

Remove obsolete version.h inclusions

5 лет назад
sha512.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
sha512.h

Remove obsolete version.h inclusions

5 лет назад
side_data.c

avutil/frame: add a new side data type for downmix matrix

месяц назад
side_data.h

avutil/frame: move side data helpers to a new file

год назад
slicethread.c

avutil/slicethread: Fix shadowing

5 месяцев назад
slicethread.h

avutil: merge slice threading implementation from avcodec and avfilter

9 лет назад
softfloat.h

ALL: move av_unused to conform with standard requirement

10 месяцев назад
softfloat_ieee754.h

avutil/softfloat_ieee754: Fix odd bit position for exponent and sign in av_bits2sf_ieee754()

7 лет назад
softfloat_tables.h

avutil/softfloat_tables: add missing stdint.h include

11 лет назад
spherical.c

avutil: zero size output parameter on allocation failure

2 месяца назад
spherical.h

lavu/spherical: Add support for Spherical Immersive type

год назад
stereo3d.c

avutil: zero size output parameter on allocation failure

2 месяца назад
stereo3d.h

avutil/stereo3d: add a Stereo3D view to signal that the view is unspecified

2 года назад
tablegen.h

libavutil/tablegen: add missing math.h include

11 лет назад
tdrdi.c

avutil: add an API to handle 3D Reference Displays Information

год назад
tdrdi.h

all: fix typos found by codespell

год назад
tea.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
tea.h

Add support for TEA (Tiny Encryption Algorithm)

11 лет назад
thread.h

w32pthreads: add support for setting thread name

год назад
threadmessage.c

avutil/mem: Don't include avutil.h

3 года назад
threadmessage.h

lavu/threadmessage: add av_thread_message_queue_nb_elems()

8 лет назад
time.c

lavu: monotonic av_gettime_relative for msvc

месяц назад
time.h

Merge commit '1bd0bdcdc236099d5c0d179696951f35f5310fa5'

12 лет назад
time_internal.h

Merge commit 'c4642788e83b0858bca449f9b6e71ddb015dfa5d'

7 лет назад
timecode.c

avutil/timecode: Check for integer overflow in av_timecode_init_from_components()

5 месяцев назад
timecode.h

libavutil/timecode: fix parameter order in documentation

3 года назад
timecode_internal.c

avutil/timecode: add ff_timecode_set_smpte

год назад
timecode_internal.h

avutil/timecode: add ff_timecode_set_smpte

год назад
timer.h

lavu: Set default FF_TIMER_UNITS to "ns"

2 года назад
timestamp.c

avutil/timestamp: avoid possible FPE when 0 is passed to av_ts_make_time_string2()

2 года назад
timestamp.h

avutil/timestamp: change precision of av_ts_make_time_string()

2 года назад
tree.c

Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'

10 лет назад
tree.h

Remove obsolete version.h inclusions

5 лет назад
twofish.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
twofish.h

avutil/twofish: Fix doxy @param typo

4 года назад
tx.c

avutil/tx: zero whole array, not only one element

год назад
tx.h

all: fix typos found by codespell

год назад
tx_double.c

lavu/tx: add support for double precision FFT and MDCT

7 лет назад
tx_float.c

lavu/tx: add support for double precision FFT and MDCT

7 лет назад
tx_int32.c

lavu/tx: implement 32 bit fixed point FFT and MDCT

6 лет назад
tx_priv.h

avutil/mem: Don't include avutil.h

3 года назад
tx_template.c

Revert "avutil/tx_template: extend to 2M"

8 месяцев назад
utils.c

avutil: Remove FF_API_OPT_INT_LIST

2 месяца назад
uuid.c

avutil/attributes_internal: Add attribute_nonstring

6 месяцев назад
uuid.h

avutil/uuid: Remove bogus doxy return doc

4 года назад
version.c

lib*/version: Use static_assert for static asserts

2 года назад
version.h

avutil/hwcontext_cuda: add CUarray surface pool support

месяц назад
version_major.h

Fix libversion.sh for split version headers, to unbreak shared library builds

4 года назад
video_enc_params.c

lavu/video_enc_params: Avoid relying on an undefined C construct

4 года назад
video_enc_params.h

avutil/video_enc_params: fix doxy for av_video_enc_params_block()

3 года назад
video_hint.c

lavu: add video_hint API

3 года назад
video_hint.h

all: fix typos found by codespell

год назад
vulkan.c

vulkan: fix typo when printing the SPIR-V/binary size

6 дней назад
vulkan.h

vulkan: remove ff_vk_exec_add_dep_buf

6 дней назад
vulkan_functions.h

vulkan: enable VK_KHR_shader_maximal_reconvergence when available

8 дней назад
vulkan_loader.h

vulkan: enable VK_KHR_shader_maximal_reconvergence when available

8 дней назад
wchar_filename.h

avutil/wchar_filename: re-introduce explicit cast of void* to char*

2 года назад
xga_font_data.c

avutil/xga_font_data: Stop exporting font data directly

2 месяца назад
xga_font_data.h

avutil/xga_font_data: Stop exporting font data directly

2 месяца назад
xtea.c

Remove unnecessary libavutil/(avutil|common|internal).h inclusions

4 года назад
xtea.h

Merge commit '588b6215b4c74945994eb9636b0699028c069ed2'

11 лет назад
zlib_utils.h

cuda/load_helper: move zlib decompression into a separate file

7 месяцев назад
threadmessage.c
/*
* Copyright (c) 2014 Nicolas George
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FFmpeg; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
 
#include <limits.h>
#include <stddef.h>
 
#include "error.h"
#include "fifo.h"
#include "mem.h"
#include "threadmessage.h"
#include "thread.h"
 
struct AVThreadMessageQueue {
#if HAVE_THREADS
AVFifo *fifo;
pthread_mutex_t lock;
pthread_cond_t cond_recv;
pthread_cond_t cond_send;
int err_send;
int err_recv;
unsigned elsize;
void (*free_func)(void *msg);
#else
int dummy;
#endif
};
 
int av_thread_message_queue_alloc(AVThreadMessageQueue **mq,
unsigned nelem,
unsigned elsize)
{
#if HAVE_THREADS
AVThreadMessageQueue *rmq;
int ret = 0;
 
if (nelem > INT_MAX / elsize)
return AVERROR(EINVAL);
if (!(rmq = av_mallocz(sizeof(*rmq))))
return AVERROR(ENOMEM);
if ((ret = pthread_mutex_init(&rmq->lock, NULL))) {
av_free(rmq);
return AVERROR(ret);
}
if ((ret = pthread_cond_init(&rmq->cond_recv, NULL))) {
pthread_mutex_destroy(&rmq->lock);
av_free(rmq);
return AVERROR(ret);
}
if ((ret = pthread_cond_init(&rmq->cond_send, NULL))) {
pthread_cond_destroy(&rmq->cond_recv);
pthread_mutex_destroy(&rmq->lock);
av_free(rmq);
return AVERROR(ret);
}
if (!(rmq->fifo = av_fifo_alloc2(nelem, elsize, 0))) {
pthread_cond_destroy(&rmq->cond_send);
pthread_cond_destroy(&rmq->cond_recv);
pthread_mutex_destroy(&rmq->lock);
av_free(rmq);
return AVERROR(ENOMEM);
}
rmq->elsize = elsize;
*mq = rmq;
return 0;
#else
*mq = NULL;
return AVERROR(ENOSYS);
#endif /* HAVE_THREADS */
}
 
void av_thread_message_queue_set_free_func(AVThreadMessageQueue *mq,
void (*free_func)(void *msg))
{
#if HAVE_THREADS
mq->free_func = free_func;
#endif
}
 
void av_thread_message_queue_free(AVThreadMessageQueue **mq)
{
#if HAVE_THREADS
if (*mq) {
av_thread_message_flush(*mq);
av_fifo_freep2(&(*mq)->fifo);
pthread_cond_destroy(&(*mq)->cond_send);
pthread_cond_destroy(&(*mq)->cond_recv);
pthread_mutex_destroy(&(*mq)->lock);
av_freep(mq);
}
#endif
}
 
int av_thread_message_queue_nb_elems(AVThreadMessageQueue *mq)
{
#if HAVE_THREADS
int ret;
pthread_mutex_lock(&mq->lock);
ret = av_fifo_can_read(mq->fifo);
pthread_mutex_unlock(&mq->lock);
return ret;
#else
return AVERROR(ENOSYS);
#endif
}
 
#if HAVE_THREADS
 
static int av_thread_message_queue_send_locked(AVThreadMessageQueue *mq,
void *msg,
unsigned flags)
{
while (!mq->err_send && !av_fifo_can_write(mq->fifo)) {
if ((flags & AV_THREAD_MESSAGE_NONBLOCK))
return AVERROR(EAGAIN);
pthread_cond_wait(&mq->cond_send, &mq->lock);
}
if (mq->err_send)
return mq->err_send;
av_fifo_write(mq->fifo, msg, 1);
/* one message is sent, signal one receiver */
pthread_cond_signal(&mq->cond_recv);
return 0;
}
 
static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq,
void *msg,
unsigned flags)
{
while (!mq->err_recv && !av_fifo_can_read(mq->fifo)) {
if ((flags & AV_THREAD_MESSAGE_NONBLOCK))
return AVERROR(EAGAIN);
pthread_cond_wait(&mq->cond_recv, &mq->lock);
}
if (!av_fifo_can_read(mq->fifo))
return mq->err_recv;
av_fifo_read(mq->fifo, msg, 1);
/* one message space appeared, signal one sender */
pthread_cond_signal(&mq->cond_send);
return 0;
}
 
#endif /* HAVE_THREADS */
 
int av_thread_message_queue_send(AVThreadMessageQueue *mq,
void *msg,
unsigned flags)
{
#if HAVE_THREADS
int ret;
 
pthread_mutex_lock(&mq->lock);
ret = av_thread_message_queue_send_locked(mq, msg, flags);
pthread_mutex_unlock(&mq->lock);
return ret;
#else
return AVERROR(ENOSYS);
#endif /* HAVE_THREADS */
}
 
int av_thread_message_queue_recv(AVThreadMessageQueue *mq,
void *msg,
unsigned flags)
{
#if HAVE_THREADS
int ret;
 
pthread_mutex_lock(&mq->lock);
ret = av_thread_message_queue_recv_locked(mq, msg, flags);
pthread_mutex_unlock(&mq->lock);
return ret;
#else
return AVERROR(ENOSYS);
#endif /* HAVE_THREADS */
}
 
void av_thread_message_queue_set_err_send(AVThreadMessageQueue *mq,
int err)
{
#if HAVE_THREADS
pthread_mutex_lock(&mq->lock);
mq->err_send = err;
pthread_cond_broadcast(&mq->cond_send);
pthread_mutex_unlock(&mq->lock);
#endif /* HAVE_THREADS */
}
 
void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq,
int err)
{
#if HAVE_THREADS
pthread_mutex_lock(&mq->lock);
mq->err_recv = err;
pthread_cond_broadcast(&mq->cond_recv);
pthread_mutex_unlock(&mq->lock);
#endif /* HAVE_THREADS */
}
 
#if HAVE_THREADS
static int free_func_wrap(void *arg, void *buf, size_t *nb_elems)
{
AVThreadMessageQueue *mq = arg;
uint8_t *msg = buf;
for (size_t i = 0; i < *nb_elems; i++)
mq->free_func(msg + i * mq->elsize);
return 0;
}
#endif
 
void av_thread_message_flush(AVThreadMessageQueue *mq)
{
#if HAVE_THREADS
size_t used;
 
pthread_mutex_lock(&mq->lock);
used = av_fifo_can_read(mq->fifo);
if (mq->free_func)
av_fifo_read_to_cb(mq->fifo, free_func_wrap, mq, &used);
/* only the senders need to be notified since the queue is empty and there
* is nothing to read */
pthread_cond_broadcast(&mq->cond_send);
pthread_mutex_unlock(&mq->lock);
#endif /* HAVE_THREADS */
}