├── .gitignore ├── libavutil ├── avconfig.h ├── ffversion.h ├── macros.nim ├── attributes.nim ├── avassert.nim ├── random_seed.nim ├── hwcontext_vdpau.nim ├── adler32.nim ├── lzo.nim ├── hwcontext_cuda.nim ├── replaygain.nim ├── hwcontext_qsv.nim ├── base64.nim ├── hwcontext_dxva2.nim ├── motion_vector.nim ├── pixelutils.nim ├── time.nim ├── display.nim ├── timestamp.nim ├── bswap.nim ├── file.nim ├── rc4.nim ├── tea.nim ├── aes.nim ├── hwcontext_vaapi.nim ├── sha.nim ├── twofish.nim ├── crc.nim ├── downmix_info.nim ├── camellia.nim ├── md5.nim ├── murmur3.nim ├── ripemd.nim ├── sha512.nim ├── mastering_display_metadata.nim ├── des.nim ├── intfloat.nim ├── cpu.nim ├── cast5.nim ├── blowfish.nim ├── xtea.nim ├── lfg.nim ├── stereo3d.nim ├── hmac.nim ├── aes_ctr.nim ├── macros.h ├── tree.nim ├── spherical.nim ├── hwcontext_vdpau.h ├── random_seed.h ├── eval.nim ├── parseutils.nim ├── hwcontext_cuda.h ├── dict.nim ├── hwcontext_qsv.h ├── hash.nim ├── replaygain.h ├── threadmessage.nim ├── adler32.h ├── audio_fifo.nim ├── motion_vector.h ├── time.h ├── intfloat.h ├── aes.h ├── timecode.nim ├── rc4.h ├── avutil.nim ├── pixelutils.h ├── lzo.h ├── tea.h ├── camellia.h ├── aes_ctr.h ├── md5.h ├── lfg.h ├── ripemd.h ├── twofish.h ├── base64.h └── hwcontext_dxva2.h ├── libavcodec ├── vaapi.nim ├── jni.nim ├── dxva2.nim ├── qsv.nim ├── d3d11va.nim ├── xvmc.nim ├── avdct.nim ├── mediacodec.nim ├── vorbis_parser.nim ├── videotoolbox.nim ├── dv_profile.nim ├── jni.h ├── vda.nim ├── vdpau.nim ├── dirac.nim └── avfft.nim ├── av.c2nim ├── README.md ├── test.nim ├── pp-libavcodec ├── jni.h ├── vaapi.h ├── dxva2.h ├── mediacodec.h ├── qsv.h ├── avdct.h ├── vorbis_parser.h ├── d3d11va.h ├── videotoolbox.h ├── avfft.h ├── dv_profile.h ├── vdpau.h └── xvmc.h ├── pp-libavutil ├── macros.h ├── random_seed.h ├── hwcontext_vdpau.h ├── time.h ├── replaygain.h ├── base64.h ├── adler32.h ├── display.h ├── avassert.h ├── hwcontext_qsv.h ├── hwcontext_cuda.h ├── pixelutils.h ├── motion_vector.h ├── lzo.h ├── file.h ├── tea.h ├── twofish.h ├── camellia.h ├── rc4.h ├── murmur3.h ├── aes.h ├── des.h ├── cast5.h ├── hwcontext_dxva2.h ├── sha.h ├── sha512.h ├── ripemd.h ├── blowfish.h ├── timestamp.h ├── md5.h ├── xtea.h ├── attributes.h ├── mastering_display_metadata.h ├── cpu.h ├── lfg.h ├── crc.h ├── aes_ctr.h ├── bswap.h ├── intfloat.h ├── tree.h ├── hmac.h ├── hwcontext_vaapi.h ├── parseutils.h ├── downmix_info.h ├── eval.h ├── dict.h ├── hash.h ├── stereo3d.h ├── timecode.h ├── audio_fifo.h ├── threadmessage.h ├── channel_layout.h └── spherical.h ├── libswscale └── version.h └── nim_ffmpeg_common.nim /.gitignore: -------------------------------------------------------------------------------- 1 | nimcache 2 | test 3 | *.ipynb 4 | *.sh 5 | 6 | -------------------------------------------------------------------------------- /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 | #endif /* AVUTIL_AVCONFIG_H */ 7 | -------------------------------------------------------------------------------- /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 "3.3.3" 5 | #endif /* AVUTIL_FFVERSION_H */ 6 | -------------------------------------------------------------------------------- /libavutil/macros.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | -------------------------------------------------------------------------------- /libavutil/attributes.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | -------------------------------------------------------------------------------- /libavcodec/vaapi.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, ../libavutil/attributes 13 | 14 | -------------------------------------------------------------------------------- /libavutil/avassert.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, avutil 13 | 14 | 15 | proc av_assert0_fpu*() {.cdecl, importc: "av_assert0_fpu", dynlib: avutildll.} -------------------------------------------------------------------------------- /av.c2nim: -------------------------------------------------------------------------------- 1 | #skipcomments 2 | #cdecl 3 | 4 | #def attribute_deprecated 5 | 6 | #def av_pure 7 | #def av_warn_unused_result 8 | #def av_const 9 | #def av_always_inline 10 | #def av_alias 11 | 12 | #def DECLARE_ALIGNED(n,t,v) __noop(n,t,v) __noop() 13 | #def av_printf_format(x,y) 14 | #def av_printf_format(x,y) __noop() 15 | 16 | #def intptr_t int* 17 | 18 | #discardableprefix av_strerror 19 | 20 | -------------------------------------------------------------------------------- /libavutil/random_seed.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | proc av_get_random_seed*(): uint32_t {.cdecl, importc: "av_get_random_seed", 16 | dynlib: avutildll.} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nim-ffmpeg 2 | Yet incomplete attempt to bring `ffmpeg` to [nim](https://nim-lang.org). 3 | Wrappers are generated automatically. See [auto_only branch](https://github.com/ahirner/nim-ffmpeg/tree/auto_only) for conversion scripts and unmangled results . 4 | 5 | **Run** 6 | ``` 7 | nim c test.nim 8 | ./test 9 | ``` 10 | 11 | **Output** 12 | ``` 13 | Imported basics of ffmpeg version 3.3.3 14 | ``` 15 | Dynamic linked on Mac OS-X via `brew`. 16 | -------------------------------------------------------------------------------- /libavutil/hwcontext_vdpau.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVVDPAUDeviceContext* {.bycopy.} = object 17 | device*: VdpDevice 18 | get_proc_address*: ptr VdpGetProcAddress 19 | 20 | -------------------------------------------------------------------------------- /libavutil/adler32.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | proc av_adler32_update*(adler: culong; buf: ptr uint8_t; len: cuint): culong {.cdecl, 16 | importc: "av_adler32_update", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/lzo.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | proc av_lzo1x_decode*(`out`: pointer; outlen: ptr cint; `in`: pointer; inlen: ptr cint): cint {. 16 | cdecl, importc: "av_lzo1x_decode", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/hwcontext_cuda.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, pixfmt 13 | 14 | 15 | type 16 | AVCUDADeviceContext* {.bycopy.} = object 17 | cuda_ctx*: CUcontext 18 | internal*: ptr AVCUDADeviceContextInternal 19 | 20 | -------------------------------------------------------------------------------- /test.nim: -------------------------------------------------------------------------------- 1 | ## Start by making the following imports work 2 | #[ 3 | #include 4 | #include 5 | #include 6 | #include 7 | ]# 8 | 9 | import libavcodec/avcodec 10 | import libavformat/avformat 11 | import libswscale/swscale 12 | import libavutil/motion_vector 13 | 14 | import libavutil/avutil 15 | 16 | echo "Imported basics of ffmpeg version " & $av_version_info() 17 | 18 | -------------------------------------------------------------------------------- /libavutil/replaygain.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVReplayGain* {.bycopy.} = object 17 | track_gain*: int32_t 18 | track_peak*: uint32_t 19 | album_gain*: int32_t 20 | album_peak*: uint32_t 21 | 22 | -------------------------------------------------------------------------------- /libavutil/hwcontext_qsv.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVQSVDeviceContext* {.bycopy.} = object 17 | session*: mfxSession 18 | 19 | AVQSVFramesContext* {.bycopy.} = object 20 | surfaces*: ptr mfxFrameSurface1 21 | nb_surfaces*: cint 22 | frame_type*: cint 23 | 24 | -------------------------------------------------------------------------------- /libavcodec/jni.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | proc av_jni_set_java_vm*(vm: pointer; log_ctx: pointer): cint {.cdecl, 15 | importc: "av_jni_set_java_vm", dynlib: avcodecdll.} 16 | proc av_jni_get_java_vm*(log_ctx: pointer): pointer {.cdecl, 17 | importc: "av_jni_get_java_vm", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /pp-libavcodec/jni.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | int av_jni_set_java_vm(void *vm, void *log_ctx); 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | void *av_jni_get_java_vm(void *log_ctx); 29 | 30 | 31 | -------------------------------------------------------------------------------- /pp-libavutil/macros.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 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 | -------------------------------------------------------------------------------- /libavcodec/dxva2.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | dxva_context* {.bycopy.} = object 17 | decoder*: ptr IDirectXVideoDecoder 18 | cfg*: ptr DXVA2_ConfigPictureDecode 19 | surface_count*: cuint 20 | surface*: ptr LPDIRECT3DSURFACE9 21 | workaround*: uint64_t 22 | report_id*: cuint 23 | 24 | -------------------------------------------------------------------------------- /pp-libavutil/random_seed.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #23 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | uint32_t av_get_random_seed(void); 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /libavutil/base64.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | proc av_base64_decode*(`out`: ptr uint8_t; `in`: cstring; out_size: cint): cint {.cdecl, 16 | importc: "av_base64_decode", dynlib: avutildll.} 17 | proc av_base64_encode*(`out`: cstring; out_size: cint; `in`: ptr uint8_t; in_size: cint): cstring {. 18 | cdecl, importc: "av_base64_encode", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavcodec/vaapi.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "../libavutil/attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #32 26 | //#include "libavutil/attributes.h" // #33 27 | //#include "version.h" // #34 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /libavutil/hwcontext_dxva2.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVDXVA2DeviceContext* {.bycopy.} = object 17 | devmgr*: ptr IDirect3DDeviceManager9 18 | 19 | AVDXVA2FramesContext* {.bycopy.} = object 20 | surface_type*: DWORD 21 | surfaces*: ptr ptr IDirect3DSurface9 22 | nb_surfaces*: cint 23 | decoder_to_release*: ptr IDirectXVideoDecoder 24 | 25 | -------------------------------------------------------------------------------- /libavutil/motion_vector.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVMotionVector* {.bycopy.} = object 17 | source*: int32_t 18 | w*: uint8_t 19 | h*: uint8_t 20 | src_x*: int16_t 21 | src_y*: int16_t 22 | dst_x*: int16_t 23 | dst_y*: int16_t 24 | flags*: uint64_t 25 | motion_x*: int32_t 26 | motion_y*: int32_t 27 | motion_scale*: uint16_t 28 | 29 | -------------------------------------------------------------------------------- /libavutil/pixelutils.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | av_pixelutils_sad_fn* = proc (src1: ptr uint8_t; stride1: ptrdiff_t; 17 | src2: ptr uint8_t; stride2: ptrdiff_t): cint {.cdecl.} 18 | 19 | proc av_pixelutils_get_sad_fn*(w_bits: cint; h_bits: cint; aligned: cint; 20 | log_ctx: pointer): av_pixelutils_sad_fn {.cdecl, 21 | importc: "av_pixelutils_get_sad_fn", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/hwcontext_vdpau.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #21 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | typedef struct AVVDPAUDeviceContext { 32 | VdpDevice device; 33 | VdpGetProcAddress *get_proc_address; 34 | } AVVDPAUDeviceContext; 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /libavutil/time.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | proc av_gettime*(): int64_t {.cdecl, importc: "av_gettime", dynlib: avutildll.} 16 | proc av_gettime_relative*(): int64_t {.cdecl, importc: "av_gettime_relative", 17 | dynlib: avutildll.} 18 | proc av_gettime_relative_is_monotonic*(): cint {.cdecl, 19 | importc: "av_gettime_relative_is_monotonic", dynlib: avutildll.} 20 | proc av_usleep*(usec: cuint): cint {.cdecl, importc: "av_usleep", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/display.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | proc av_display_rotation_get*(matrix: array[9, int32_t]): cdouble {.cdecl, 16 | importc: "av_display_rotation_get", dynlib: avutildll.} 17 | proc av_display_rotation_set*(matrix: array[9, int32_t]; angle: cdouble) {.cdecl, 18 | importc: "av_display_rotation_set", dynlib: avutildll.} 19 | proc av_display_matrix_flip*(matrix: array[9, int32_t]; hflip: cint; vflip: cint) {. 20 | cdecl, importc: "av_display_matrix_flip", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/time.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #23 19 | 20 | 21 | 22 | 23 | int64_t av_gettime(void); 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | int64_t av_gettime_relative(void); 33 | 34 | 35 | 36 | 37 | 38 | int av_gettime_relative_is_monotonic(void); 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | int av_usleep(unsigned usec); 49 | 50 | 51 | -------------------------------------------------------------------------------- /pp-libavutil/replaygain.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #21 19 | 20 | 21 | 22 | 23 | 24 | 25 | typedef struct AVReplayGain { 26 | 27 | 28 | 29 | 30 | int32_t track_gain; 31 | 32 | 33 | 34 | 35 | uint32_t track_peak; 36 | 37 | 38 | 39 | int32_t album_gain; 40 | 41 | 42 | 43 | uint32_t album_peak; 44 | } AVReplayGain; 45 | 46 | 47 | -------------------------------------------------------------------------------- /libavutil/timestamp.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | proc av_ts_make_string*(buf: cstring; ts: int64_t): cstring {.inline, cdecl.} = 16 | if ts == AV_NOPTS_VALUE: snprintf(buf, 32, "NOPTS") 17 | else: snprintf(buf, 32, "%", PRId64, ts) 18 | return buf 19 | 20 | proc av_ts_make_time_string*(buf: cstring; ts: int64_t; tb: ptr AVRational): cstring {. 21 | inline, cdecl.} = 22 | if ts == AV_NOPTS_VALUE: snprintf(buf, 32, "NOPTS") 23 | else: snprintf(buf, 32, "%.6g", av_q2d(tb[]) * ts) 24 | return buf 25 | -------------------------------------------------------------------------------- /pp-libavutil/base64.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #23 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | int av_base64_decode(uint8_t *out, const char *in, int out_size); 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /libavcodec/qsv.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, ../libavutil/buffer 13 | 14 | 15 | type 16 | AVQSVContext* {.bycopy.} = object 17 | session*: mfxSession 18 | iopattern*: cint 19 | ext_buffers*: ptr ptr mfxExtBuffer 20 | nb_ext_buffers*: cint 21 | opaque_alloc*: cint 22 | nb_opaque_surfaces*: cint 23 | opaque_surfaces*: ptr AVBufferRef 24 | opaque_alloc_type*: cint 25 | 26 | 27 | proc av_qsv_alloc_context*(): ptr AVQSVContext {.cdecl, 28 | importc: "av_qsv_alloc_context", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /pp-libavutil/adler32.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #29 26 | //#include "attributes.h" // #30 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, 39 | unsigned int len) av_pure; 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /libavutil/bswap.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes, config 13 | 14 | 15 | proc av_bswap16*(x: uint16_t): uint16_t {.cdecl.} = 16 | x = (x shr 8) or (x shl 8) 17 | return x 18 | 19 | proc av_bswap32*(x: uint32_t): uint32_t {.cdecl.} = 20 | return (((x) shl 8 and 0x0000FF00) or ((x) shr 8 and 0x000000FF)) shl 16 or 21 | ((((x) shr 16) shl 8 and 0x0000FF00) or (((x) shr 16) shr 8 and 0x000000FF)) 22 | 23 | proc av_bswap64*(x: uint64_t): uint64_t {.inline, cdecl.} = 24 | return cast[uint64_t](av_bswap32(x)) shl 32 or av_bswap32(x shr 32) 25 | 26 | -------------------------------------------------------------------------------- /libavcodec/d3d11va.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVD3D11VAContext* {.bycopy.} = object 17 | decoder*: ptr ID3D11VideoDecoder 18 | video_context*: ptr ID3D11VideoContext 19 | cfg*: ptr D3D11_VIDEO_DECODER_CONFIG 20 | surface_count*: cuint 21 | surface*: ptr ptr ID3D11VideoDecoderOutputView 22 | workaround*: uint64_t 23 | report_id*: cuint 24 | context_mutex*: HANDLE 25 | 26 | 27 | proc av_d3d11va_alloc_context*(): ptr AVD3D11VAContext {.cdecl, 28 | importc: "av_d3d11va_alloc_context", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /pp-libavutil/display.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #23 19 | //#include "common.h" // #24 20 | 21 | 22 | 23 | 24 | 25 | 26 | double av_display_rotation_get(const int32_t matrix[9]); 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | void av_display_rotation_set(int32_t matrix[9], double angle); 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip); 46 | 47 | 48 | -------------------------------------------------------------------------------- /pp-libavutil/avassert.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "avutil.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #29 26 | //#include "avutil.h" // #30 27 | //#include "log.h" // #31 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 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | void av_assert0_fpu(void); 69 | 70 | 71 | -------------------------------------------------------------------------------- /libavutil/file.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, avutil 13 | 14 | 15 | proc av_file_map*(filename: cstring; bufptr: ptr ptr uint8_t; size: ptr csize; 16 | log_offset: cint; log_ctx: pointer): cint {.cdecl, 17 | importc: "av_file_map", dynlib: avutildll.} 18 | proc av_file_unmap*(bufptr: ptr uint8_t; size: csize) {.cdecl, 19 | importc: "av_file_unmap", dynlib: avutildll.} 20 | proc av_tempfile*(prefix: cstring; filename: cstringArray; log_offset: cint; 21 | log_ctx: pointer): cint {.cdecl, importc: "av_tempfile", 22 | dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/hwcontext_qsv.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #21 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | typedef struct AVQSVDeviceContext { 32 | mfxSession session; 33 | } AVQSVDeviceContext; 34 | 35 | 36 | 37 | 38 | typedef struct AVQSVFramesContext { 39 | mfxFrameSurface1 *surfaces; 40 | int nb_surfaces; 41 | 42 | 43 | 44 | 45 | int frame_type; 46 | } AVQSVFramesContext; 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /pp-libavutil/hwcontext_cuda.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "pixfmt.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | //#include // #23 22 | 23 | 24 | //#include "pixfmt.h" // #26 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | typedef struct AVCUDADeviceContextInternal AVCUDADeviceContextInternal; 35 | 36 | 37 | 38 | 39 | typedef struct AVCUDADeviceContext { 40 | CUcontext cuda_ctx; 41 | AVCUDADeviceContextInternal *internal; 42 | } AVCUDADeviceContext; 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /libavutil/rc4.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVRC4* {.bycopy.} = object 17 | state*: array[256, uint8_t] 18 | x*: cint 19 | y*: cint 20 | 21 | 22 | proc av_rc4_alloc*(): ptr AVRC4 {.cdecl, importc: "av_rc4_alloc", dynlib: avutildll.} 23 | proc av_rc4_init*(d: ptr AVRC4; key: ptr uint8_t; key_bits: cint; decrypt: cint): cint {. 24 | cdecl, importc: "av_rc4_init", dynlib: avutildll.} 25 | proc av_rc4_crypt*(d: ptr AVRC4; dst: ptr uint8_t; src: ptr uint8_t; count: cint; 26 | iv: ptr uint8_t; decrypt: cint) {.cdecl, importc: "av_rc4_crypt", 27 | dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/tea.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | var av_tea_size* {.importc: "av_tea_size", dynlib: avutildll.}: cint 16 | 17 | type 18 | AVTEA* {.bycopy.} = object 19 | 20 | 21 | proc av_tea_alloc*(): ptr AVTEA {.cdecl, importc: "av_tea_alloc", dynlib: avutildll.} 22 | proc av_tea_init*(ctx: ptr AVTEA; key: array[16, uint8_t]; rounds: cint) {.cdecl, 23 | importc: "av_tea_init", dynlib: avutildll.} 24 | proc av_tea_crypt*(ctx: ptr AVTEA; dst: ptr uint8_t; src: ptr uint8_t; count: cint; 25 | iv: ptr uint8_t; decrypt: cint) {.cdecl, importc: "av_tea_crypt", 26 | dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/pixelutils.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #21 19 | //#include // #22 20 | //#include "common.h" // #23 21 | 22 | 23 | 24 | 25 | typedef int (*av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1, 26 | const uint8_t *src2, ptrdiff_t stride2); 27 | 28 | 29 | 30 | av_pixelutils_sad_fn av_pixelutils_get_sad_fn(int w_bits, int h_bits, 31 | int aligned, void *log_ctx); 32 | 33 | 34 | -------------------------------------------------------------------------------- /pp-libavutil/motion_vector.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #21 19 | 20 | typedef struct AVMotionVector { 21 | 22 | 23 | 24 | 25 | 26 | int32_t source; 27 | 28 | 29 | 30 | uint8_t w, h; 31 | 32 | 33 | 34 | int16_t src_x, src_y; 35 | 36 | 37 | 38 | int16_t dst_x, dst_y; 39 | 40 | 41 | 42 | 43 | uint64_t flags; 44 | 45 | 46 | 47 | 48 | 49 | int32_t motion_x, motion_y; 50 | uint16_t motion_scale; 51 | } AVMotionVector; 52 | 53 | 54 | -------------------------------------------------------------------------------- /libavutil/aes.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | var av_aes_size* {.importc: "av_aes_size", dynlib: avutildll.}: cint 16 | 17 | type 18 | AVAES* {.bycopy.} = object 19 | 20 | 21 | proc av_aes_alloc*(): ptr AVAES {.cdecl, importc: "av_aes_alloc", dynlib: avutildll.} 22 | proc av_aes_init*(a: ptr AVAES; key: ptr uint8_t; key_bits: cint; decrypt: cint): cint {. 23 | cdecl, importc: "av_aes_init", dynlib: avutildll.} 24 | proc av_aes_crypt*(a: ptr AVAES; dst: ptr uint8_t; src: ptr uint8_t; count: cint; 25 | iv: ptr uint8_t; decrypt: cint) {.cdecl, importc: "av_aes_crypt", 26 | dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/hwcontext_vaapi.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | const 16 | AV_VAAPI_DRIVER_QUIRK_USER_SET* = (1 shl 0) 17 | AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS* = (1 shl 1) 18 | AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE* = (1 shl 2) 19 | 20 | type 21 | AVVAAPIDeviceContext* {.bycopy.} = object 22 | display*: VADisplay 23 | driver_quirks*: cuint 24 | 25 | AVVAAPIFramesContext* {.bycopy.} = object 26 | attributes*: ptr VASurfaceAttrib 27 | nb_attributes*: cint 28 | surface_ids*: ptr VASurfaceID 29 | nb_surfaces*: cint 30 | 31 | AVVAAPIHWConfig* {.bycopy.} = object 32 | config_id*: VAConfigID 33 | 34 | -------------------------------------------------------------------------------- /pp-libavutil/lzo.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #31 26 | 27 | 28 | 29 | /// end of the input buffer reached before decoding finished 30 | 31 | /// decoded data did not fit into output buffer 32 | 33 | /// a reference to previously decoded data was wrong 34 | 35 | /// a non-specific error in the compressed bitstream 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen); 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /libavcodec/xvmc.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, ../libavutil/attributes, avcodec 13 | 14 | 15 | type 16 | xvmc_pix_fmt* {.bycopy.} = object 17 | xvmc_id*: cint 18 | data_blocks*: ptr cshort 19 | mv_blocks*: ptr XvMCMacroBlock 20 | allocated_mv_blocks*: cint 21 | allocated_data_blocks*: cint 22 | idct*: cint 23 | unsigned_intra*: cint 24 | p_surface*: ptr XvMCSurface 25 | p_past_surface*: ptr XvMCSurface 26 | p_future_surface*: ptr XvMCSurface 27 | picture_structure*: cuint 28 | flags*: cuint 29 | start_mv_blocks_num*: cint 30 | filled_mv_blocks_num*: cint 31 | next_free_data_block_num*: cint 32 | 33 | -------------------------------------------------------------------------------- /pp-libavutil/file.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "avutil.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include // #21 20 | 21 | //#include "avutil.h" // #23 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | av_warn_unused_result 31 | int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, 32 | int log_offset, void *log_ctx); 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | void av_file_unmap(uint8_t *bufptr, size_t size); 41 | 42 | 43 | 44 | int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); 45 | 46 | 47 | -------------------------------------------------------------------------------- /libavutil/sha.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | var av_sha_size* {.importc: "av_sha_size", dynlib: avutildll.}: cint 16 | 17 | type 18 | AVSHA* {.bycopy.} = object 19 | 20 | 21 | proc av_sha_alloc*(): ptr AVSHA {.cdecl, importc: "av_sha_alloc", dynlib: avutildll.} 22 | proc av_sha_init*(context: ptr AVSHA; bits: cint): cint {.cdecl, importc: "av_sha_init", 23 | dynlib: avutildll.} 24 | proc av_sha_update*(context: ptr AVSHA; data: ptr uint8_t; len: cuint) {.cdecl, 25 | importc: "av_sha_update", dynlib: avutildll.} 26 | proc av_sha_final*(context: ptr AVSHA; digest: ptr uint8_t) {.cdecl, 27 | importc: "av_sha_final", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/tea.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #24 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | extern const int av_tea_size; 29 | 30 | struct AVTEA; 31 | 32 | 33 | 34 | 35 | 36 | struct AVTEA *av_tea_alloc(void); 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | void av_tea_init(struct AVTEA *ctx, const uint8_t key[16], int rounds); 46 | 47 | 48 | 49 | void av_tea_crypt(struct AVTEA *ctx, uint8_t *dst, const uint8_t *src, 50 | int count, uint8_t *iv, int decrypt); 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /pp-libavutil/twofish.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #24 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | extern const int av_twofish_size; 30 | 31 | struct AVTWOFISH; 32 | 33 | 34 | 35 | 36 | 37 | struct AVTWOFISH *av_twofish_alloc(void); 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | int av_twofish_init(struct AVTWOFISH *ctx, const uint8_t *key, int key_bits); 47 | 48 | 49 | 50 | void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /pp-libavutil/camellia.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #24 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | extern const int av_camellia_size; 30 | 31 | struct AVCAMELLIA; 32 | 33 | 34 | 35 | 36 | 37 | struct AVCAMELLIA *av_camellia_alloc(void); 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits); 47 | 48 | 49 | 50 | void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /pp-libavutil/rc4.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #23 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | typedef struct AVRC4 { 27 | uint8_t state[256]; 28 | int x, y; 29 | } AVRC4; 30 | 31 | 32 | 33 | 34 | AVRC4 *av_rc4_alloc(void); 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt); 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /libavutil/twofish.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | var av_twofish_size* {.importc: "av_twofish_size", dynlib: avutildll.}: cint 16 | 17 | type 18 | AVTWOFISH* {.bycopy.} = object 19 | 20 | 21 | proc av_twofish_alloc*(): ptr AVTWOFISH {.cdecl, importc: "av_twofish_alloc", 22 | dynlib: avutildll.} 23 | proc av_twofish_init*(ctx: ptr AVTWOFISH; key: ptr uint8_t; key_bits: cint): cint {.cdecl, 24 | importc: "av_twofish_init", dynlib: avutildll.} 25 | proc av_twofish_crypt*(ctx: ptr AVTWOFISH; dst: ptr uint8_t; src: ptr uint8_t; 26 | count: cint; iv: ptr uint8_t; decrypt: cint) {.cdecl, 27 | importc: "av_twofish_crypt", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/crc.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | type 16 | AVCRC* = uint32_t 17 | AVCRCId* {.size: sizeof(cint).} = enum 18 | AV_CRC_8_ATM, AV_CRC_16_ANSI, AV_CRC_16_CCITT, AV_CRC_32_IEEE, 19 | AV_CRC_32_IEEE_LE, AV_CRC_16_ANSI_LE, AV_CRC_24_IEEE, AV_CRC_MAX 20 | 21 | 22 | proc av_crc_init*(ctx: ptr AVCRC; le: cint; bits: cint; poly: uint32_t; ctx_size: cint): cint {. 23 | cdecl, importc: "av_crc_init", dynlib: avutildll.} 24 | proc av_crc_get_table*(crc_id: AVCRCId): ptr AVCRC {.cdecl, 25 | importc: "av_crc_get_table", dynlib: avutildll.} 26 | proc av_crc*(ctx: ptr AVCRC; crc: uint32_t; buffer: ptr uint8_t; length: csize): uint32_t {. 27 | cdecl, importc: "av_crc", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/downmix_info.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, frame 13 | 14 | 15 | type 16 | AVDownmixType* {.size: sizeof(cint).} = enum 17 | AV_DOWNMIX_TYPE_UNKNOWN, AV_DOWNMIX_TYPE_LORO, AV_DOWNMIX_TYPE_LTRT, 18 | AV_DOWNMIX_TYPE_DPLII, AV_DOWNMIX_TYPE_NB 19 | 20 | 21 | type 22 | AVDownmixInfo* {.bycopy.} = object 23 | preferred_downmix_type*: AVDownmixType 24 | center_mix_level*: cdouble 25 | center_mix_level_ltrt*: cdouble 26 | surround_mix_level*: cdouble 27 | surround_mix_level_ltrt*: cdouble 28 | lfe_mix_level*: cdouble 29 | 30 | 31 | proc av_downmix_info_update_side_data*(frame: ptr AVFrame): ptr AVDownmixInfo {.cdecl, 32 | importc: "av_downmix_info_update_side_data", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/camellia.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | var av_camellia_size* {.importc: "av_camellia_size", dynlib: avutildll.}: cint 16 | 17 | type 18 | AVCAMELLIA* {.bycopy.} = object 19 | 20 | 21 | proc av_camellia_alloc*(): ptr AVCAMELLIA {.cdecl, importc: "av_camellia_alloc", 22 | dynlib: avutildll.} 23 | proc av_camellia_init*(ctx: ptr AVCAMELLIA; key: ptr uint8_t; key_bits: cint): cint {. 24 | cdecl, importc: "av_camellia_init", dynlib: avutildll.} 25 | proc av_camellia_crypt*(ctx: ptr AVCAMELLIA; dst: ptr uint8_t; src: ptr uint8_t; 26 | count: cint; iv: ptr uint8_t; decrypt: cint) {.cdecl, 27 | importc: "av_camellia_crypt", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/murmur3.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | //#include // #29 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | struct AVMurMur3 *av_murmur3_alloc(void); 35 | 36 | 37 | 38 | void av_murmur3_init_seeded(struct AVMurMur3 *c, uint64_t seed); 39 | 40 | 41 | 42 | void av_murmur3_init(struct AVMurMur3 *c); 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len); 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | void av_murmur3_final(struct AVMurMur3 *c, uint8_t dst[16]); 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /libavutil/md5.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | var av_md5_size* {.importc: "av_md5_size", dynlib: avutildll.}: cint 16 | 17 | type 18 | AVMD5* {.bycopy.} = object 19 | 20 | 21 | proc av_md5_alloc*(): ptr AVMD5 {.cdecl, importc: "av_md5_alloc", dynlib: avutildll.} 22 | proc av_md5_init*(ctx: ptr AVMD5) {.cdecl, importc: "av_md5_init", dynlib: avutildll.} 23 | proc av_md5_update*(ctx: ptr AVMD5; src: ptr uint8_t; len: cint) {.cdecl, 24 | importc: "av_md5_update", dynlib: avutildll.} 25 | proc av_md5_final*(ctx: ptr AVMD5; dst: ptr uint8_t) {.cdecl, importc: "av_md5_final", 26 | dynlib: avutildll.} 27 | proc av_md5_sum*(dst: ptr uint8_t; src: ptr uint8_t; len: cint) {.cdecl, 28 | importc: "av_md5_sum", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/murmur3.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | proc av_murmur3_alloc*(): ptr AVMurMur3 {.cdecl, importc: "av_murmur3_alloc", 16 | dynlib: avutildll.} 17 | proc av_murmur3_init_seeded*(c: ptr AVMurMur3; seed: uint64_t) {.cdecl, 18 | importc: "av_murmur3_init_seeded", dynlib: avutildll.} 19 | proc av_murmur3_init*(c: ptr AVMurMur3) {.cdecl, importc: "av_murmur3_init", 20 | dynlib: avutildll.} 21 | proc av_murmur3_update*(c: ptr AVMurMur3; src: ptr uint8_t; len: cint) {.cdecl, 22 | importc: "av_murmur3_update", dynlib: avutildll.} 23 | proc av_murmur3_final*(c: ptr AVMurMur3; dst: array[16, uint8_t]) {.cdecl, 24 | importc: "av_murmur3_final", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/ripemd.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | var av_ripemd_size* {.importc: "av_ripemd_size", dynlib: avutildll.}: cint 16 | 17 | type 18 | AVRIPEMD* {.bycopy.} = object 19 | 20 | 21 | proc av_ripemd_alloc*(): ptr AVRIPEMD {.cdecl, importc: "av_ripemd_alloc", 22 | dynlib: avutildll.} 23 | proc av_ripemd_init*(context: ptr AVRIPEMD; bits: cint): cint {.cdecl, 24 | importc: "av_ripemd_init", dynlib: avutildll.} 25 | proc av_ripemd_update*(context: ptr AVRIPEMD; data: ptr uint8_t; len: cuint) {.cdecl, 26 | importc: "av_ripemd_update", dynlib: avutildll.} 27 | proc av_ripemd_final*(context: ptr AVRIPEMD; digest: ptr uint8_t) {.cdecl, 28 | importc: "av_ripemd_final", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/sha512.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | var av_sha512_size* {.importc: "av_sha512_size", dynlib: avutildll.}: cint 16 | 17 | type 18 | AVSHA512* {.bycopy.} = object 19 | 20 | 21 | proc av_sha512_alloc*(): ptr AVSHA512 {.cdecl, importc: "av_sha512_alloc", 22 | dynlib: avutildll.} 23 | proc av_sha512_init*(context: ptr AVSHA512; bits: cint): cint {.cdecl, 24 | importc: "av_sha512_init", dynlib: avutildll.} 25 | proc av_sha512_update*(context: ptr AVSHA512; data: ptr uint8_t; len: cuint) {.cdecl, 26 | importc: "av_sha512_update", dynlib: avutildll.} 27 | proc av_sha512_final*(context: ptr AVSHA512; digest: ptr uint8_t) {.cdecl, 28 | importc: "av_sha512_final", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/mastering_display_metadata.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, frame 13 | 14 | 15 | type 16 | AVMasteringDisplayMetadata* {.bycopy.} = object 17 | display_primaries*: array[3, array[2, AVRational]] 18 | white_point*: array[2, AVRational] 19 | min_luminance*: AVRational 20 | max_luminance*: AVRational 21 | has_primaries*: cint 22 | has_luminance*: cint 23 | 24 | 25 | proc av_mastering_display_metadata_alloc*(): ptr AVMasteringDisplayMetadata {.cdecl, 26 | importc: "av_mastering_display_metadata_alloc", dynlib: avutildll.} 27 | proc av_mastering_display_metadata_create_side_data*(frame: ptr AVFrame): ptr AVMasteringDisplayMetadata {. 28 | cdecl, importc: "av_mastering_display_metadata_create_side_data", 29 | dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/des.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVDES* {.bycopy.} = object 17 | round_keys*: array[3, array[16, uint64_t]] 18 | triple_des*: cint 19 | 20 | 21 | proc av_des_alloc*(): ptr AVDES {.cdecl, importc: "av_des_alloc", dynlib: avutildll.} 22 | proc av_des_init*(d: ptr AVDES; key: ptr uint8_t; key_bits: cint; decrypt: cint): cint {. 23 | cdecl, importc: "av_des_init", dynlib: avutildll.} 24 | proc av_des_crypt*(d: ptr AVDES; dst: ptr uint8_t; src: ptr uint8_t; count: cint; 25 | iv: ptr uint8_t; decrypt: cint) {.cdecl, importc: "av_des_crypt", 26 | dynlib: avutildll.} 27 | proc av_des_mac*(d: ptr AVDES; dst: ptr uint8_t; src: ptr uint8_t; count: cint) {.cdecl, 28 | importc: "av_des_mac", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/intfloat.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | type 16 | av_intfloat32* {.bycopy.} = object {.union.} 17 | i*: uint32_t 18 | f*: cfloat 19 | 20 | av_intfloat64* {.bycopy.} = object {.union.} 21 | i*: uint64_t 22 | f*: cdouble 23 | 24 | 25 | proc av_int2float*(i: uint32_t): cfloat {.cdecl.} = 26 | var v: av_intfloat32 27 | v.i = i 28 | return v.f 29 | 30 | proc av_float2int*(f: cfloat): uint32_t {.cdecl.} = 31 | var v: av_intfloat32 32 | v.f = f 33 | return v.i 34 | 35 | proc av_int2double*(i: uint64_t): cdouble {.cdecl.} = 36 | var v: av_intfloat64 37 | v.i = i 38 | return v.f 39 | 40 | proc av_double2int*(f: cdouble): uint64_t {.cdecl.} = 41 | var v: av_intfloat64 42 | v.f = f 43 | return v.i 44 | -------------------------------------------------------------------------------- /libavutil/cpu.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | proc av_get_cpu_flags*(): cint {.cdecl, importc: "av_get_cpu_flags", dynlib: avutildll.} 16 | proc av_force_cpu_flags*(flags: cint) {.cdecl, importc: "av_force_cpu_flags", 17 | dynlib: avutildll.} 18 | proc av_set_cpu_flags_mask*(mask: cint) {.cdecl, importc: "av_set_cpu_flags_mask", 19 | dynlib: avutildll.} 20 | proc av_parse_cpu_flags*(s: cstring): cint {.cdecl, importc: "av_parse_cpu_flags", 21 | dynlib: avutildll.} 22 | proc av_parse_cpu_caps*(flags: ptr cuint; s: cstring): cint {.cdecl, 23 | importc: "av_parse_cpu_caps", dynlib: avutildll.} 24 | proc av_cpu_count*(): cint {.cdecl, importc: "av_cpu_count", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/aes.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include // #23 20 | 21 | //#include "attributes.h" // #25 22 | //#include "version.h" // #26 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | extern const int av_aes_size; 31 | 32 | struct AVAES; 33 | 34 | 35 | 36 | 37 | struct AVAES *av_aes_alloc(void); 38 | 39 | 40 | 41 | 42 | 43 | 44 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /pp-libavutil/des.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #24 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | typedef struct AVDES { 27 | uint64_t round_keys[3][16]; 28 | int triple_des; 29 | } AVDES; 30 | 31 | 32 | 33 | 34 | AVDES *av_des_alloc(void); 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt); 44 | 45 | 46 | 47 | void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count); 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /pp-libavutil/cast5.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #24 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | extern const int av_cast5_size; 30 | 31 | struct AVCAST5; 32 | 33 | 34 | 35 | 36 | 37 | struct AVCAST5 *av_cast5_alloc(void); 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits); 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt); 58 | 59 | 60 | 61 | void av_cast5_crypt2(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /pp-libavutil/hwcontext_dxva2.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | //#include // #32 30 | //#include // #33 31 | 32 | 33 | 34 | 35 | typedef struct AVDXVA2DeviceContext { 36 | IDirect3DDeviceManager9 *devmgr; 37 | } AVDXVA2DeviceContext; 38 | 39 | 40 | 41 | 42 | typedef struct AVDXVA2FramesContext { 43 | 44 | 45 | 46 | 47 | DWORD surface_type; 48 | 49 | 50 | 51 | 52 | 53 | 54 | IDirect3DSurface9 **surfaces; 55 | int nb_surfaces; 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | IDirectXVideoDecoder *decoder_to_release; 66 | } AVDXVA2FramesContext; 67 | 68 | 69 | -------------------------------------------------------------------------------- /pp-libavutil/sha.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #29 26 | 27 | //#include "attributes.h" // #31 28 | //#include "version.h" // #32 29 | 30 | 31 | 32 | 33 | extern const int av_sha_size; 34 | 35 | struct AVSHA; 36 | 37 | 38 | 39 | 40 | struct AVSHA *av_sha_alloc(void); 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | int av_sha_init(struct AVSHA* context, int bits); 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | void av_sha_final(struct AVSHA* context, uint8_t *digest); 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /pp-libavcodec/dxva2.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | //#include // #36 30 | //#include // #37 31 | //#include // #38 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | struct dxva_context { 50 | 51 | 52 | 53 | IDirectXVideoDecoder *decoder; 54 | 55 | 56 | 57 | 58 | const DXVA2_ConfigPictureDecode *cfg; 59 | 60 | 61 | 62 | 63 | unsigned surface_count; 64 | 65 | 66 | 67 | 68 | LPDIRECT3DSURFACE9 *surface; 69 | 70 | 71 | 72 | 73 | uint64_t workaround; 74 | 75 | 76 | 77 | 78 | unsigned report_id; 79 | }; 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /libavcodec/avdct.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, ../libavutil/opt 13 | 14 | 15 | type 16 | AVDCT* {.bycopy.} = object 17 | av_class*: ptr AVClass 18 | idct*: proc (`block`: ptr int16_t) {.cdecl.} 19 | idct_permutation*: array[64, uint8_t] 20 | fdct*: proc (`block`: ptr int16_t) {.cdecl.} 21 | dct_algo*: cint 22 | idct_algo*: cint 23 | get_pixels*: proc (`block`: ptr int16_t; pixels: ptr uint8_t; line_size: ptrdiff_t) {. 24 | cdecl.} 25 | bits_per_sample*: cint 26 | 27 | 28 | proc avcodec_dct_alloc*(): ptr AVDCT {.cdecl, importc: "avcodec_dct_alloc", 29 | dynlib: avcodecdll.} 30 | proc avcodec_dct_init*(a2: ptr AVDCT): cint {.cdecl, importc: "avcodec_dct_init", 31 | dynlib: avcodecdll.} 32 | proc avcodec_dct_get_class*(): ptr AVClass {.cdecl, importc: "avcodec_dct_get_class", 33 | dynlib: avcodecdll.} -------------------------------------------------------------------------------- /pp-libavutil/sha512.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #30 26 | 27 | //#include "attributes.h" // #32 28 | //#include "version.h" // #33 29 | 30 | 31 | 32 | 33 | extern const int av_sha512_size; 34 | 35 | struct AVSHA512; 36 | 37 | 38 | 39 | 40 | struct AVSHA512 *av_sha512_alloc(void); 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | int av_sha512_init(struct AVSHA512* context, int bits); 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len); 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | void av_sha512_final(struct AVSHA512* context, uint8_t *digest); 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /libavcodec/mediacodec.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, avcodec 13 | 14 | 15 | type 16 | AVMediaCodecContext* {.bycopy.} = object 17 | surface*: pointer 18 | 19 | 20 | proc av_mediacodec_alloc_context*(): ptr AVMediaCodecContext {.cdecl, 21 | importc: "av_mediacodec_alloc_context", dynlib: avcodecdll.} 22 | proc av_mediacodec_default_init*(avctx: ptr AVCodecContext; 23 | ctx: ptr AVMediaCodecContext; surface: pointer): cint {. 24 | cdecl, importc: "av_mediacodec_default_init", dynlib: avcodecdll.} 25 | proc av_mediacodec_default_free*(avctx: ptr AVCodecContext) {.cdecl, 26 | importc: "av_mediacodec_default_free", dynlib: avcodecdll.} 27 | type 28 | AVMediaCodecBuffer* = MediaCodecBuffer 29 | 30 | proc av_mediacodec_release_buffer*(buffer: ptr AVMediaCodecBuffer; render: cint): cint {. 31 | cdecl, importc: "av_mediacodec_release_buffer", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /libavutil/cast5.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | var av_cast5_size* {.importc: "av_cast5_size", dynlib: avutildll.}: cint 16 | 17 | type 18 | AVCAST5* {.bycopy.} = object 19 | 20 | 21 | proc av_cast5_alloc*(): ptr AVCAST5 {.cdecl, importc: "av_cast5_alloc", 22 | dynlib: avutildll.} 23 | proc av_cast5_init*(ctx: ptr AVCAST5; key: ptr uint8_t; key_bits: cint): cint {.cdecl, 24 | importc: "av_cast5_init", dynlib: avutildll.} 25 | proc av_cast5_crypt*(ctx: ptr AVCAST5; dst: ptr uint8_t; src: ptr uint8_t; count: cint; 26 | decrypt: cint) {.cdecl, importc: "av_cast5_crypt", 27 | dynlib: avutildll.} 28 | proc av_cast5_crypt2*(ctx: ptr AVCAST5; dst: ptr uint8_t; src: ptr uint8_t; count: cint; 29 | iv: ptr uint8_t; decrypt: cint) {.cdecl, 30 | importc: "av_cast5_crypt2", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/ripemd.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #30 26 | 27 | //#include "attributes.h" // #32 28 | //#include "version.h" // #33 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | extern const int av_ripemd_size; 39 | 40 | struct AVRIPEMD; 41 | 42 | 43 | 44 | 45 | struct AVRIPEMD *av_ripemd_alloc(void); 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | int av_ripemd_init(struct AVRIPEMD* context, int bits); 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest); 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /libavutil/blowfish.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVBlowfish* {.bycopy.} = object 17 | p*: array[16 + 2, uint32_t] 18 | s*: array[4, array[256, uint32_t]] 19 | 20 | 21 | proc av_blowfish_alloc*(): ptr AVBlowfish {.cdecl, importc: "av_blowfish_alloc", 22 | dynlib: avutildll.} 23 | proc av_blowfish_init*(ctx: ptr AVBlowfish; key: ptr uint8_t; key_len: cint) {.cdecl, 24 | importc: "av_blowfish_init", dynlib: avutildll.} 25 | proc av_blowfish_crypt_ecb*(ctx: ptr AVBlowfish; xl: ptr uint32_t; xr: ptr uint32_t; 26 | decrypt: cint) {.cdecl, 27 | importc: "av_blowfish_crypt_ecb", dynlib: avutildll.} 28 | proc av_blowfish_crypt*(ctx: ptr AVBlowfish; dst: ptr uint8_t; src: ptr uint8_t; 29 | count: cint; iv: ptr uint8_t; decrypt: cint) {.cdecl, 30 | importc: "av_blowfish_crypt", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/xtea.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVXTEA* {.bycopy.} = object 17 | key*: array[16, uint32_t] 18 | 19 | 20 | proc av_xtea_alloc*(): ptr AVXTEA {.cdecl, importc: "av_xtea_alloc", dynlib: avutildll.} 21 | proc av_xtea_init*(ctx: ptr AVXTEA; key: array[16, uint8_t]) {.cdecl, 22 | importc: "av_xtea_init", dynlib: avutildll.} 23 | proc av_xtea_le_init*(ctx: ptr AVXTEA; key: array[16, uint8_t]) {.cdecl, 24 | importc: "av_xtea_le_init", dynlib: avutildll.} 25 | proc av_xtea_crypt*(ctx: ptr AVXTEA; dst: ptr uint8_t; src: ptr uint8_t; count: cint; 26 | iv: ptr uint8_t; decrypt: cint) {.cdecl, importc: "av_xtea_crypt", 27 | dynlib: avutildll.} 28 | proc av_xtea_le_crypt*(ctx: ptr AVXTEA; dst: ptr uint8_t; src: ptr uint8_t; count: cint; 29 | iv: ptr uint8_t; decrypt: cint) {.cdecl, 30 | importc: "av_xtea_le_crypt", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/blowfish.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #24 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | typedef struct AVBlowfish { 29 | uint32_t p[16 + 2]; 30 | uint32_t s[4][256]; 31 | } AVBlowfish; 32 | 33 | 34 | 35 | 36 | AVBlowfish *av_blowfish_alloc(void); 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len); 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr, 56 | int decrypt); 57 | 58 | 59 | 60 | void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src, 61 | int count, uint8_t *iv, int decrypt); 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /libavutil/lfg.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVLFG* {.bycopy.} = object 17 | state*: array[64, cuint] 18 | index*: cint 19 | 20 | 21 | proc av_lfg_init*(c: ptr AVLFG; seed: cuint) {.cdecl, importc: "av_lfg_init", 22 | dynlib: avutildll.} 23 | proc av_lfg_init_from_data*(c: ptr AVLFG; data: ptr uint8_t; length: cuint): cint {.cdecl, 24 | importc: "av_lfg_init_from_data", dynlib: avutildll.} 25 | proc av_lfg_get*(c: ptr AVLFG): cuint {.inline, cdecl.} = 26 | c.state[c.index and 63] = c.state[(c.index - 24) and 63] + 27 | c.state[(c.index - 55) and 63] 28 | return c.state[inc(c.index) and 63] 29 | 30 | proc av_mlfg_get*(c: ptr AVLFG): cuint {.inline, cdecl.} = 31 | var a: cuint 32 | var b: cuint 33 | return c.state[inc(c.index) and 63] = 2 * a * b + a + b 34 | 35 | proc av_bmg_get*(lfg: ptr AVLFG; `out`: array[2, cdouble]) {.cdecl, 36 | importc: "av_bmg_get", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/timestamp.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | //#include "common.h" // #26 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | static inline char *av_ts_make_string(char *buf, int64_t ts) 40 | { 41 | if (ts == AV_NOPTS_VALUE) snprintf(buf, 32, "NOPTS"); 42 | else snprintf(buf, 32, "%" PRId64, ts); 43 | return buf; 44 | } 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb) 62 | { 63 | if (ts == AV_NOPTS_VALUE) snprintf(buf, 32, "NOPTS"); 64 | else snprintf(buf, 32, "%.6g", av_q2d(*tb) * ts); 65 | return buf; 66 | } 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /pp-libavutil/md5.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #29 26 | 27 | //#include "attributes.h" // #31 28 | //#include "version.h" // #32 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | extern const int av_md5_size; 39 | 40 | struct AVMD5; 41 | 42 | 43 | 44 | 45 | struct AVMD5 *av_md5_alloc(void); 46 | 47 | 48 | 49 | 50 | 51 | 52 | void av_md5_init(struct AVMD5 *ctx); 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /pp-libavutil/xtea.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #24 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | typedef struct AVXTEA { 29 | uint32_t key[16]; 30 | } AVXTEA; 31 | 32 | 33 | 34 | 35 | AVXTEA *av_xtea_alloc(void); 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | void av_xtea_le_init(struct AVXTEA *ctx, const uint8_t key[16]); 54 | 55 | 56 | 57 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 58 | int count, uint8_t *iv, int decrypt); 59 | 60 | 61 | 62 | void av_xtea_le_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 63 | int count, uint8_t *iv, int decrypt); 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /libavcodec/vorbis_parser.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | 16 | proc av_vorbis_parse_init*(extradata: ptr uint8_t; extradata_size: cint): ptr AVVorbisParseContext {. 17 | cdecl, importc: "av_vorbis_parse_init", dynlib: avcodecdll.} 18 | proc av_vorbis_parse_free*(s: ptr ptr AVVorbisParseContext) {.cdecl, 19 | importc: "av_vorbis_parse_free", dynlib: avcodecdll.} 20 | proc av_vorbis_parse_frame_flags*(s: ptr AVVorbisParseContext; buf: ptr uint8_t; 21 | buf_size: cint; flags: ptr cint): cint {.cdecl, 22 | importc: "av_vorbis_parse_frame_flags", dynlib: avcodecdll.} 23 | proc av_vorbis_parse_frame*(s: ptr AVVorbisParseContext; buf: ptr uint8_t; 24 | buf_size: cint): cint {.cdecl, 25 | importc: "av_vorbis_parse_frame", dynlib: avcodecdll.} 26 | proc av_vorbis_parse_reset*(s: ptr AVVorbisParseContext) {.cdecl, 27 | importc: "av_vorbis_parse_reset", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /pp-libavcodec/mediacodec.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "avcodec.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include "libavcodec/avcodec.h" // #25 20 | 21 | 22 | 23 | 24 | 25 | 26 | typedef struct AVMediaCodecContext { 27 | 28 | 29 | 30 | 31 | void *surface; 32 | 33 | } AVMediaCodecContext; 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | AVMediaCodecContext *av_mediacodec_alloc_context(void); 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | int av_mediacodec_default_init(AVCodecContext *avctx, AVMediaCodecContext *ctx, void *surface); 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | void av_mediacodec_default_free(AVCodecContext *avctx); 62 | 63 | 64 | 65 | 66 | typedef struct MediaCodecBuffer AVMediaCodecBuffer; 67 | 68 | 69 | 70 | int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render); 71 | 72 | 73 | -------------------------------------------------------------------------------- /pp-libavcodec/qsv.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "../libavutil/buffer.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include // #23 20 | 21 | //#include "libavutil/buffer.h" // #25 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | typedef struct AVQSVContext { 32 | 33 | 34 | 35 | 36 | mfxSession session; 37 | 38 | 39 | 40 | 41 | int iopattern; 42 | 43 | 44 | 45 | 46 | mfxExtBuffer **ext_buffers; 47 | int nb_ext_buffers; 48 | 49 | 50 | 51 | int opaque_alloc; 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | int nb_opaque_surfaces; 63 | 64 | 65 | 66 | AVBufferRef *opaque_surfaces; 67 | 68 | 69 | 70 | 71 | 72 | 73 | int opaque_alloc_type; 74 | } AVQSVContext; 75 | 76 | 77 | 78 | 79 | 80 | 81 | AVQSVContext *av_qsv_alloc_context(void); 82 | 83 | 84 | -------------------------------------------------------------------------------- /pp-libavcodec/avdct.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "../libavutil/opt.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include "libavutil/opt.h" // #21 20 | 21 | 22 | 23 | 24 | 25 | 26 | typedef struct AVDCT { 27 | const AVClass *av_class; 28 | 29 | void (*idct)(int16_t *block ); 30 | 31 | 32 | 33 | uint8_t idct_permutation[64]; 34 | 35 | void (*fdct)(int16_t *block ); 36 | 37 | 38 | 39 | 40 | 41 | 42 | int dct_algo; 43 | 44 | 45 | 46 | 47 | 48 | int idct_algo; 49 | 50 | void (*get_pixels)(int16_t *block , 51 | const uint8_t *pixels , 52 | ptrdiff_t line_size); 53 | 54 | int bits_per_sample; 55 | } AVDCT; 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | AVDCT *avcodec_dct_alloc(void); 65 | int avcodec_dct_init(AVDCT *); 66 | 67 | const AVClass *avcodec_dct_get_class(void); 68 | 69 | 70 | -------------------------------------------------------------------------------- /pp-libavcodec/vorbis_parser.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #28 26 | 27 | typedef struct AVVorbisParseContext AVVorbisParseContext; 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata, 36 | int extradata_size); 37 | 38 | 39 | 40 | 41 | void av_vorbis_parse_free(AVVorbisParseContext **s); 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf, 50 | int buf_size, int *flags); 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf, 60 | int buf_size); 61 | 62 | void av_vorbis_parse_reset(AVVorbisParseContext *s); 63 | 64 | 65 | -------------------------------------------------------------------------------- /pp-libavutil/attributes.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 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 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /libavutil/stereo3d.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, frame 13 | 14 | 15 | type 16 | AVStereo3DType* {.size: sizeof(cint).} = enum 17 | AV_STEREO3D_2D, AV_STEREO3D_SIDEBYSIDE, AV_STEREO3D_TOPBOTTOM, 18 | AV_STEREO3D_FRAMESEQUENCE, AV_STEREO3D_CHECKERBOARD, 19 | AV_STEREO3D_SIDEBYSIDE_QUINCUNX, AV_STEREO3D_LINES, AV_STEREO3D_COLUMNS 20 | 21 | 22 | type 23 | AVStereo3D* {.bycopy.} = object 24 | `type`*: AVStereo3DType 25 | flags*: cint 26 | 27 | 28 | proc av_stereo3d_alloc*(): ptr AVStereo3D {.cdecl, importc: "av_stereo3d_alloc", 29 | dynlib: avutildll.} 30 | proc av_stereo3d_create_side_data*(frame: ptr AVFrame): ptr AVStereo3D {.cdecl, 31 | importc: "av_stereo3d_create_side_data", dynlib: avutildll.} 32 | proc av_stereo3d_type_name*(`type`: cuint): cstring {.cdecl, 33 | importc: "av_stereo3d_type_name", dynlib: avutildll.} 34 | proc av_stereo3d_from_name*(name: cstring): cint {.cdecl, 35 | importc: "av_stereo3d_from_name", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/mastering_display_metadata.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "frame.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include "frame.h" // #23 20 | //#include "rational.h" // #24 21 | 22 | 23 | 24 | 25 | typedef struct AVMasteringDisplayMetadata { 26 | 27 | 28 | 29 | AVRational display_primaries[3][2]; 30 | 31 | 32 | 33 | 34 | AVRational white_point[2]; 35 | 36 | 37 | 38 | 39 | AVRational min_luminance; 40 | 41 | 42 | 43 | 44 | AVRational max_luminance; 45 | 46 | 47 | 48 | 49 | int has_primaries; 50 | 51 | 52 | 53 | 54 | int has_luminance; 55 | 56 | } AVMasteringDisplayMetadata; 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void); 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFrame *frame); 75 | 76 | 77 | -------------------------------------------------------------------------------- /libavcodec/videotoolbox.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, avcodec 13 | 14 | 15 | type 16 | AVVideotoolboxContext* {.bycopy.} = object 17 | session*: VTDecompressionSessionRef 18 | output_callback*: VTDecompressionOutputCallback 19 | cv_pix_fmt_type*: OSType 20 | cm_fmt_desc*: CMVideoFormatDescriptionRef 21 | cm_codec_type*: cint 22 | 23 | 24 | proc av_videotoolbox_alloc_context*(): ptr AVVideotoolboxContext {.cdecl, 25 | importc: "av_videotoolbox_alloc_context", dynlib: avcodecdll.} 26 | proc av_videotoolbox_default_init*(avctx: ptr AVCodecContext): cint {.cdecl, 27 | importc: "av_videotoolbox_default_init", dynlib: avcodecdll.} 28 | proc av_videotoolbox_default_init2*(avctx: ptr AVCodecContext; 29 | vtctx: ptr AVVideotoolboxContext): cint {.cdecl, 30 | importc: "av_videotoolbox_default_init2", dynlib: avcodecdll.} 31 | proc av_videotoolbox_default_free*(avctx: ptr AVCodecContext) {.cdecl, 32 | importc: "av_videotoolbox_default_free", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /pp-libavutil/cpu.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include "attributes.h" // #23 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ///< than regular MMX/SSE (e.g. Core1) 32 | 33 | 34 | 35 | ///< than regular MMX/SSE (e.g. Core1) 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | int av_get_cpu_flags(void); 51 | 52 | 53 | 54 | 55 | 56 | void av_force_cpu_flags(int flags); 57 | 58 | 59 | 60 | 61 | 62 | 63 | attribute_deprecated void av_set_cpu_flags_mask(int mask); 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | attribute_deprecated 75 | int av_parse_cpu_flags(const char *s); 76 | 77 | 78 | 79 | 80 | 81 | 82 | int av_parse_cpu_caps(unsigned *flags, const char *s); 83 | 84 | 85 | 86 | 87 | int av_cpu_count(void); 88 | 89 | 90 | -------------------------------------------------------------------------------- /pp-libavutil/lfg.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #24 19 | 20 | typedef struct AVLFG { 21 | unsigned int state[64]; 22 | int index; 23 | } AVLFG; 24 | 25 | void av_lfg_init(AVLFG *c, unsigned int seed); 26 | 27 | 28 | 29 | 30 | 31 | 32 | int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length); 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | static inline unsigned int av_lfg_get(AVLFG *c){ 41 | c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; 42 | return c->state[c->index++ & 63]; 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | static inline unsigned int av_mlfg_get(AVLFG *c){ 51 | unsigned int a= c->state[(c->index-55) & 63]; 52 | unsigned int b= c->state[(c->index-24) & 63]; 53 | return c->state[c->index++ & 63] = 2*a*b+a+b; 54 | } 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | void av_bmg_get(AVLFG *lfg, double out[2]); 63 | 64 | 65 | -------------------------------------------------------------------------------- /pp-libavutil/crc.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #29 26 | //#include // #30 27 | //#include "attributes.h" // #31 28 | //#include "version.h" // #32 29 | 30 | 31 | 32 | 33 | typedef uint32_t AVCRC; 34 | 35 | typedef enum { 36 | AV_CRC_8_ATM, 37 | AV_CRC_16_ANSI, 38 | AV_CRC_16_CCITT, 39 | AV_CRC_32_IEEE, 40 | AV_CRC_32_IEEE_LE, 41 | AV_CRC_16_ANSI_LE, 42 | 43 | 44 | 45 | AV_CRC_24_IEEE, 46 | 47 | AV_CRC_MAX, 48 | }AVCRCId; 49 | 50 | 51 | 52 | int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size); 53 | 54 | 55 | 56 | 57 | 58 | 59 | const AVCRC *av_crc_get_table(AVCRCId crc_id); 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | uint32_t av_crc(const AVCRC *ctx, uint32_t crc, 69 | const uint8_t *buffer, size_t length) av_pure; 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /pp-libavutil/aes_ctr.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include // #24 20 | 21 | //#include "attributes.h" // #26 22 | //#include "version.h" // #27 23 | 24 | 25 | 26 | 27 | struct AVAESCTR; 28 | 29 | 30 | 31 | 32 | struct AVAESCTR *av_aes_ctr_alloc(void); 33 | 34 | 35 | 36 | 37 | 38 | int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key); 39 | 40 | 41 | 42 | 43 | void av_aes_ctr_free(struct AVAESCTR *a); 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size); 52 | 53 | 54 | 55 | 56 | const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a); 57 | 58 | 59 | 60 | 61 | void av_aes_ctr_set_random_iv(struct AVAESCTR *a); 62 | 63 | 64 | 65 | 66 | void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv); 67 | 68 | 69 | 70 | 71 | void av_aes_ctr_increment_iv(struct AVAESCTR *a); 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /libavutil/hmac.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVHMACType* {.size: sizeof(cint).} = enum 17 | AV_HMAC_MD5, AV_HMAC_SHA1, AV_HMAC_SHA224, AV_HMAC_SHA256, AV_HMAC_SHA384 = 12, 18 | AV_HMAC_SHA512 19 | 20 | 21 | 22 | proc av_hmac_alloc*(`type`: AVHMACType): ptr AVHMAC {.cdecl, importc: "av_hmac_alloc", 23 | dynlib: avutildll.} 24 | proc av_hmac_free*(ctx: ptr AVHMAC) {.cdecl, importc: "av_hmac_free", dynlib: avutildll.} 25 | proc av_hmac_init*(ctx: ptr AVHMAC; key: ptr uint8_t; keylen: cuint) {.cdecl, 26 | importc: "av_hmac_init", dynlib: avutildll.} 27 | proc av_hmac_update*(ctx: ptr AVHMAC; data: ptr uint8_t; len: cuint) {.cdecl, 28 | importc: "av_hmac_update", dynlib: avutildll.} 29 | proc av_hmac_final*(ctx: ptr AVHMAC; `out`: ptr uint8_t; outlen: cuint): cint {.cdecl, 30 | importc: "av_hmac_final", dynlib: avutildll.} 31 | proc av_hmac_calc*(ctx: ptr AVHMAC; data: ptr uint8_t; len: cuint; key: ptr uint8_t; 32 | keylen: cuint; `out`: ptr uint8_t; outlen: cuint): cint {.cdecl, 33 | importc: "av_hmac_calc", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/bswap.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | #include "config.h" 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #28 26 | //#include "libavutil/avconfig.h" // #29 27 | //#include "attributes.h" // #30 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | static av_always_inline av_const uint16_t av_bswap16(uint16_t x) 39 | { 40 | x= (x>>8) | (x<<8); 41 | return x; 42 | } 43 | 44 | 45 | 46 | static av_always_inline av_const uint32_t av_bswap32(uint32_t x) 47 | { 48 | return ((((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff)) << 16 | ((((x) >> 16) << 8 & 0xff00) | (((x) >> 16) >> 8 & 0x00ff))); 49 | } 50 | 51 | 52 | 53 | static inline uint64_t av_const av_bswap64(uint64_t x) 54 | { 55 | return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32); 56 | } 57 | 58 | 59 | // be2ne ... big-endian to native-endian 60 | // le2ne ... little-endian to native-endian 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /pp-libavutil/intfloat.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include // #23 20 | //#include "attributes.h" // #24 21 | 22 | union av_intfloat32 { 23 | uint32_t i; 24 | float f; 25 | }; 26 | 27 | union av_intfloat64 { 28 | uint64_t i; 29 | double f; 30 | }; 31 | 32 | 33 | 34 | 35 | static av_always_inline float av_int2float(uint32_t i) 36 | { 37 | union av_intfloat32 v; 38 | v.i = i; 39 | return v.f; 40 | } 41 | 42 | 43 | 44 | 45 | static av_always_inline uint32_t av_float2int(float f) 46 | { 47 | union av_intfloat32 v; 48 | v.f = f; 49 | return v.i; 50 | } 51 | 52 | 53 | 54 | 55 | static av_always_inline double av_int2double(uint64_t i) 56 | { 57 | union av_intfloat64 v; 58 | v.i = i; 59 | return v.f; 60 | } 61 | 62 | 63 | 64 | 65 | static av_always_inline uint64_t av_double2int(double f) 66 | { 67 | union av_intfloat64 v; 68 | v.f = f; 69 | return v.i; 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /pp-libavutil/tree.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "attributes.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include "attributes.h" // #29 26 | //#include "version.h" // #30 27 | 28 | 29 | 30 | 31 | 32 | struct AVTreeNode; 33 | extern const int av_tree_node_size; 34 | 35 | 36 | 37 | 38 | struct AVTreeNode *av_tree_node_alloc(void); 39 | 40 | 41 | 42 | void *av_tree_find(const struct AVTreeNode *root, void *key, 43 | int (*cmp)(const void *key, const void *b), void *next[2]); 44 | 45 | 46 | 47 | void *av_tree_insert(struct AVTreeNode **rootp, void *key, 48 | int (*cmp)(const void *key, const void *b), 49 | struct AVTreeNode **next); 50 | 51 | void av_tree_destroy(struct AVTreeNode *t); 52 | 53 | 54 | 55 | void av_tree_enumerate(struct AVTreeNode *t, void *opaque, 56 | int (*cmp)(void *opaque, void *elem), 57 | int (*enu)(void *opaque, void *elem)); 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /libavutil/aes_ctr.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | type 16 | AVAESCTR* {.bycopy.} = object 17 | 18 | 19 | proc av_aes_ctr_alloc*(): ptr AVAESCTR {.cdecl, importc: "av_aes_ctr_alloc", 20 | dynlib: avutildll.} 21 | proc av_aes_ctr_init*(a: ptr AVAESCTR; key: ptr uint8_t): cint {.cdecl, 22 | importc: "av_aes_ctr_init", dynlib: avutildll.} 23 | proc av_aes_ctr_free*(a: ptr AVAESCTR) {.cdecl, importc: "av_aes_ctr_free", 24 | dynlib: avutildll.} 25 | proc av_aes_ctr_crypt*(a: ptr AVAESCTR; dst: ptr uint8_t; src: ptr uint8_t; size: cint) {. 26 | cdecl, importc: "av_aes_ctr_crypt", dynlib: avutildll.} 27 | proc av_aes_ctr_get_iv*(a: ptr AVAESCTR): ptr uint8_t {.cdecl, 28 | importc: "av_aes_ctr_get_iv", dynlib: avutildll.} 29 | proc av_aes_ctr_set_random_iv*(a: ptr AVAESCTR) {.cdecl, 30 | importc: "av_aes_ctr_set_random_iv", dynlib: avutildll.} 31 | proc av_aes_ctr_set_iv*(a: ptr AVAESCTR; iv: ptr uint8_t) {.cdecl, 32 | importc: "av_aes_ctr_set_iv", dynlib: avutildll.} 33 | proc av_aes_ctr_increment_iv*(a: ptr AVAESCTR) {.cdecl, 34 | importc: "av_aes_ctr_increment_iv", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavcodec/d3d11va.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | //#include // #37 30 | //#include // #38 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | typedef struct AVD3D11VAContext { 51 | 52 | 53 | 54 | ID3D11VideoDecoder *decoder; 55 | 56 | 57 | 58 | 59 | ID3D11VideoContext *video_context; 60 | 61 | 62 | 63 | 64 | D3D11_VIDEO_DECODER_CONFIG *cfg; 65 | 66 | 67 | 68 | 69 | unsigned surface_count; 70 | 71 | 72 | 73 | 74 | ID3D11VideoDecoderOutputView **surface; 75 | 76 | 77 | 78 | 79 | uint64_t workaround; 80 | 81 | 82 | 83 | 84 | unsigned report_id; 85 | 86 | 87 | 88 | 89 | HANDLE context_mutex; 90 | } AVD3D11VAContext; 91 | 92 | 93 | 94 | 95 | 96 | 97 | AVD3D11VAContext *av_d3d11va_alloc_context(void); 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /pp-libavutil/hmac.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #23 19 | 20 | //#include "version.h" // #25 21 | 22 | 23 | 24 | 25 | 26 | 27 | enum AVHMACType { 28 | AV_HMAC_MD5, 29 | AV_HMAC_SHA1, 30 | AV_HMAC_SHA224, 31 | AV_HMAC_SHA256, 32 | AV_HMAC_SHA384 = 12, 33 | AV_HMAC_SHA512, 34 | }; 35 | 36 | typedef struct AVHMAC AVHMAC; 37 | 38 | 39 | 40 | 41 | 42 | AVHMAC *av_hmac_alloc(enum AVHMACType type); 43 | 44 | 45 | 46 | 47 | 48 | void av_hmac_free(AVHMAC *ctx); 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen); 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len); 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen); 74 | 75 | 76 | 77 | int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len, 78 | const uint8_t *key, unsigned int keylen, 79 | uint8_t *out, unsigned int outlen); 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /pp-libavutil/hwcontext_vaapi.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #21 19 | 20 | 21 | 22 | 23 | enum { 24 | 25 | 26 | 27 | 28 | AV_VAAPI_DRIVER_QUIRK_USER_SET = (1 << 0), 29 | 30 | 31 | 32 | 33 | 34 | AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1), 35 | 36 | 37 | 38 | 39 | 40 | AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE = (1 << 2), 41 | }; 42 | 43 | 44 | 45 | 46 | 47 | 48 | typedef struct AVVAAPIDeviceContext { 49 | 50 | 51 | 52 | VADisplay display; 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | unsigned int driver_quirks; 61 | } AVVAAPIDeviceContext; 62 | 63 | 64 | 65 | 66 | 67 | 68 | typedef struct AVVAAPIFramesContext { 69 | 70 | 71 | 72 | 73 | VASurfaceAttrib *attributes; 74 | int nb_attributes; 75 | 76 | 77 | 78 | 79 | 80 | 81 | VASurfaceID *surface_ids; 82 | int nb_surfaces; 83 | } AVVAAPIFramesContext; 84 | 85 | 86 | 87 | 88 | 89 | 90 | typedef struct AVVAAPIHWConfig { 91 | 92 | 93 | 94 | VAConfigID config_id; 95 | } AVVAAPIHWConfig; 96 | 97 | 98 | -------------------------------------------------------------------------------- /libavcodec/dv_profile.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, ../libavutil/pixfmt, avcodec 13 | 14 | 15 | type 16 | AVDVProfile* {.bycopy.} = object 17 | dsf*: cint 18 | video_stype*: cint 19 | frame_size*: cint 20 | difseg_size*: cint 21 | n_difchan*: cint 22 | time_base*: AVRational 23 | ltc_divisor*: cint 24 | height*: cint 25 | width*: cint 26 | sar*: array[2, AVRational] 27 | pix_fmt*: AVPixelFormat 28 | bpm*: cint 29 | block_sizes*: ptr uint8_t 30 | audio_stride*: cint 31 | audio_min_samples*: array[3, cint] 32 | audio_samples_dist*: array[5, cint] 33 | audio_shuffle*: array[9, uint8_t] 34 | 35 | 36 | proc av_dv_frame_profile*(sys: ptr AVDVProfile; frame: ptr uint8_t; buf_size: cuint): ptr AVDVProfile {. 37 | cdecl, importc: "av_dv_frame_profile", dynlib: avcodecdll.} 38 | proc av_dv_codec_profile*(width: cint; height: cint; pix_fmt: AVPixelFormat): ptr AVDVProfile {. 39 | cdecl, importc: "av_dv_codec_profile", dynlib: avcodecdll.} 40 | proc av_dv_codec_profile2*(width: cint; height: cint; pix_fmt: AVPixelFormat; 41 | frame_rate: AVRational): ptr AVDVProfile {.cdecl, 42 | importc: "av_dv_codec_profile2", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /libavutil/macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * @ingroup lavu 22 | * Utility Preprocessor macros 23 | */ 24 | 25 | #ifndef AVUTIL_MACROS_H 26 | #define AVUTIL_MACROS_H 27 | 28 | /** 29 | * @addtogroup preproc_misc Preprocessor String Macros 30 | * 31 | * String manipulation macros 32 | * 33 | * @{ 34 | */ 35 | 36 | #define AV_STRINGIFY(s) AV_TOSTRING(s) 37 | #define AV_TOSTRING(s) #s 38 | 39 | #define AV_GLUE(a, b) a ## b 40 | #define AV_JOIN(a, b) AV_GLUE(a, b) 41 | 42 | /** 43 | * @} 44 | */ 45 | 46 | #define AV_PRAGMA(s) _Pragma(#s) 47 | 48 | #define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1)) 49 | 50 | #endif /* AVUTIL_MACROS_H */ 51 | -------------------------------------------------------------------------------- /libavutil/tree.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, attributes 13 | 14 | 15 | type 16 | AVTreeNode* {.bycopy.} = object 17 | 18 | 19 | var av_tree_node_size* {.importc: "av_tree_node_size", dynlib: avutildll.}: cint 20 | 21 | proc av_tree_node_alloc*(): ptr AVTreeNode {.cdecl, importc: "av_tree_node_alloc", 22 | dynlib: avutildll.} 23 | proc av_tree_find*(root: ptr AVTreeNode; key: pointer; 24 | cmp: proc (key: pointer; b: pointer): cint {.cdecl.}; 25 | next: array[2, pointer]): pointer {.cdecl, importc: "av_tree_find", 26 | dynlib: avutildll.} 27 | proc av_tree_insert*(rootp: ptr ptr AVTreeNode; key: pointer; 28 | cmp: proc (key: pointer; b: pointer): cint {.cdecl.}; 29 | next: ptr ptr AVTreeNode): pointer {.cdecl, 30 | importc: "av_tree_insert", dynlib: avutildll.} 31 | proc av_tree_destroy*(t: ptr AVTreeNode) {.cdecl, importc: "av_tree_destroy", 32 | dynlib: avutildll.} 33 | proc av_tree_enumerate*(t: ptr AVTreeNode; opaque: pointer; cmp: proc (opaque: pointer; 34 | elem: pointer): cint {.cdecl.}; enu: proc (opaque: pointer; elem: pointer): cint {. 35 | cdecl.}) {.cdecl, importc: "av_tree_enumerate", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/parseutils.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #21 19 | 20 | //#include "rational.h" // #23 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | int av_parse_ratio(AVRational *q, const char *str, int max, 30 | int log_offset, void *log_ctx); 31 | 32 | 33 | 34 | 35 | 36 | 37 | int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str); 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | int av_parse_video_rate(AVRational *rate, const char *str); 49 | 50 | 51 | 52 | int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, 53 | void *log_ctx); 54 | 55 | 56 | 57 | const char *av_get_known_color_name(int color_idx, const uint8_t **rgb); 58 | 59 | 60 | 61 | int av_parse_time(int64_t *timeval, const char *timestr, int duration); 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info); 70 | 71 | 72 | 73 | char *av_small_strptime(const char *p, const char *fmt, struct tm *dt); 74 | 75 | 76 | 77 | 78 | time_t av_timegm(struct tm *tm); 79 | 80 | 81 | -------------------------------------------------------------------------------- /libavutil/spherical.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVSphericalProjection* {.size: sizeof(cint).} = enum 17 | AV_SPHERICAL_EQUIRECTANGULAR, AV_SPHERICAL_CUBEMAP, 18 | AV_SPHERICAL_EQUIRECTANGULAR_TILE 19 | 20 | 21 | type 22 | AVSphericalMapping* {.bycopy.} = object 23 | projection*: AVSphericalProjection 24 | yaw*: int32_t 25 | pitch*: int32_t 26 | roll*: int32_t 27 | bound_left*: uint32_t 28 | bound_top*: uint32_t 29 | bound_right*: uint32_t 30 | bound_bottom*: uint32_t 31 | padding*: uint32_t 32 | 33 | 34 | proc av_spherical_alloc*(size: ptr csize): ptr AVSphericalMapping {.cdecl, 35 | importc: "av_spherical_alloc", dynlib: avutildll.} 36 | proc av_spherical_tile_bounds*(map: ptr AVSphericalMapping; width: csize; 37 | height: csize; left: ptr csize; top: ptr csize; 38 | right: ptr csize; bottom: ptr csize) {.cdecl, 39 | importc: "av_spherical_tile_bounds", dynlib: avutildll.} 40 | proc av_spherical_projection_name*(projection: AVSphericalProjection): cstring {. 41 | cdecl, importc: "av_spherical_projection_name", dynlib: avutildll.} 42 | proc av_spherical_from_name*(name: cstring): cint {.cdecl, 43 | importc: "av_spherical_from_name", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavutil/downmix_info.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "frame.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include "frame.h" // #23 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | enum AVDownmixType { 40 | AV_DOWNMIX_TYPE_UNKNOWN, 41 | AV_DOWNMIX_TYPE_LORO, 42 | AV_DOWNMIX_TYPE_LTRT, 43 | AV_DOWNMIX_TYPE_DPLII, 44 | AV_DOWNMIX_TYPE_NB 45 | }; 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | typedef struct AVDownmixInfo { 54 | 55 | 56 | 57 | enum AVDownmixType preferred_downmix_type; 58 | 59 | 60 | 61 | 62 | 63 | double center_mix_level; 64 | 65 | 66 | 67 | 68 | 69 | double center_mix_level_ltrt; 70 | 71 | 72 | 73 | 74 | 75 | double surround_mix_level; 76 | 77 | 78 | 79 | 80 | 81 | double surround_mix_level_ltrt; 82 | 83 | 84 | 85 | 86 | 87 | double lfe_mix_level; 88 | } AVDownmixInfo; 89 | 90 | 91 | 92 | AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame); 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /libavutil/hwcontext_vdpau.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_HWCONTEXT_VDPAU_H 20 | #define AVUTIL_HWCONTEXT_VDPAU_H 21 | 22 | #include 23 | 24 | /** 25 | * @file 26 | * An API-specific header for AV_HWDEVICE_TYPE_VDPAU. 27 | * 28 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return 29 | * AVBufferRefs whose data pointer is a VdpVideoSurface. 30 | */ 31 | 32 | /** 33 | * This struct is allocated as AVHWDeviceContext.hwctx 34 | */ 35 | typedef struct AVVDPAUDeviceContext { 36 | VdpDevice device; 37 | VdpGetProcAddress *get_proc_address; 38 | } AVVDPAUDeviceContext; 39 | 40 | /** 41 | * AVHWFramesContext.hwctx is currently not used 42 | */ 43 | 44 | #endif /* AVUTIL_HWCONTEXT_VDPAU_H */ 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pp-libavutil/eval.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "avutil.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | //#include "avutil.h" // #28 25 | 26 | typedef struct AVExpr AVExpr; 27 | 28 | 29 | 30 | int av_expr_parse_and_eval(double *res, const char *s, 31 | const char * const *const_names, const double *const_values, 32 | const char * const *func1_names, double (* const *funcs1)(void *, double), 33 | const char * const *func2_names, double (* const *funcs2)(void *, double, double), 34 | void *opaque, int log_offset, void *log_ctx); 35 | 36 | 37 | 38 | int av_expr_parse(AVExpr **expr, const char *s, 39 | const char * const *const_names, 40 | const char * const *func1_names, double (* const *funcs1)(void *, double), 41 | const char * const *func2_names, double (* const *funcs2)(void *, double, double), 42 | int log_offset, void *log_ctx); 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | double av_expr_eval(AVExpr *e, const double *const_values, void *opaque); 52 | 53 | 54 | 55 | 56 | void av_expr_free(AVExpr *e); 57 | 58 | 59 | 60 | double av_strtod(const char *numstr, char **tail); 61 | 62 | 63 | -------------------------------------------------------------------------------- /libavutil/eval.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, avutil 13 | 14 | 15 | 16 | proc av_expr_parse_and_eval*(res: ptr cdouble; s: cstring; const_names: cstringArray; 17 | const_values: ptr cdouble; func1_names: cstringArray; 18 | funcs1: proc (a2: pointer; a3: cdouble): cdouble {.cdecl.}; 19 | func2_names: cstringArray; funcs2: proc (a2: pointer; 20 | a3: cdouble; a4: cdouble): cdouble {.cdecl.}; opaque: pointer; log_offset: cint; 21 | log_ctx: pointer): cint {.cdecl, 22 | importc: "av_expr_parse_and_eval", dynlib: avutildll.} 23 | proc av_expr_parse*(expr: ptr ptr AVExpr; s: cstring; const_names: cstringArray; 24 | func1_names: cstringArray; 25 | funcs1: proc (a2: pointer; a3: cdouble): cdouble {.cdecl.}; 26 | func2_names: cstringArray; funcs2: proc (a2: pointer; a3: cdouble; 27 | a4: cdouble): cdouble {.cdecl.}; log_offset: cint; log_ctx: pointer): cint {.cdecl, 28 | importc: "av_expr_parse", dynlib: avutildll.} 29 | proc av_expr_eval*(e: ptr AVExpr; const_values: ptr cdouble; opaque: pointer): cdouble {. 30 | cdecl, importc: "av_expr_eval", dynlib: avutildll.} 31 | proc av_expr_free*(e: ptr AVExpr) {.cdecl, importc: "av_expr_free", dynlib: avutildll.} 32 | proc av_strtod*(numstr: cstring; tail: cstringArray): cdouble {.cdecl, 33 | importc: "av_strtod", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/parseutils.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | proc av_parse_ratio*(q: ptr AVRational; str: cstring; max: cint; log_offset: cint; 16 | log_ctx: pointer): cint {.cdecl, importc: "av_parse_ratio", 17 | dynlib: avutildll.} 18 | proc av_parse_video_size*(width_ptr: ptr cint; height_ptr: ptr cint; str: cstring): cint {. 19 | cdecl, importc: "av_parse_video_size", dynlib: avutildll.} 20 | proc av_parse_video_rate*(rate: ptr AVRational; str: cstring): cint {.cdecl, 21 | importc: "av_parse_video_rate", dynlib: avutildll.} 22 | proc av_parse_color*(rgba_color: ptr uint8_t; color_string: cstring; slen: cint; 23 | log_ctx: pointer): cint {.cdecl, importc: "av_parse_color", 24 | dynlib: avutildll.} 25 | proc av_get_known_color_name*(color_idx: cint; rgb: ptr ptr uint8_t): cstring {.cdecl, 26 | importc: "av_get_known_color_name", dynlib: avutildll.} 27 | proc av_parse_time*(timeval: ptr int64_t; timestr: cstring; duration: cint): cint {. 28 | cdecl, importc: "av_parse_time", dynlib: avutildll.} 29 | proc av_find_info_tag*(arg: cstring; arg_size: cint; tag1: cstring; info: cstring): cint {. 30 | cdecl, importc: "av_find_info_tag", dynlib: avutildll.} 31 | proc av_small_strptime*(p: cstring; fmt: cstring; dt: ptr tm): cstring {.cdecl, 32 | importc: "av_small_strptime", dynlib: avutildll.} 33 | proc av_timegm*(tm: ptr tm): time_t {.cdecl, importc: "av_timegm", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/hwcontext_cuda.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | 20 | #ifndef AVUTIL_HWCONTEXT_CUDA_H 21 | #define AVUTIL_HWCONTEXT_CUDA_H 22 | 23 | #ifndef CUDA_VERSION 24 | #include 25 | #endif 26 | 27 | #include "pixfmt.h" 28 | 29 | /** 30 | * @file 31 | * An API-specific header for AV_HWDEVICE_TYPE_CUDA. 32 | * 33 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return 34 | * AVBufferRefs whose data pointer is a CUdeviceptr. 35 | */ 36 | 37 | typedef struct AVCUDADeviceContextInternal AVCUDADeviceContextInternal; 38 | 39 | /** 40 | * This struct is allocated as AVHWDeviceContext.hwctx 41 | */ 42 | typedef struct AVCUDADeviceContext { 43 | CUcontext cuda_ctx; 44 | AVCUDADeviceContextInternal *internal; 45 | } AVCUDADeviceContext; 46 | 47 | /** 48 | * AVHWFramesContext.hwctx is currently not used 49 | */ 50 | 51 | #endif /* AVUTIL_HWCONTEXT_CUDA_H */ 52 | -------------------------------------------------------------------------------- /pp-libavcodec/videotoolbox.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "avcodec.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | //#include // #31 26 | 27 | 28 | //#include // #34 29 | 30 | 31 | //#include "libavcodec/avcodec.h" // #37 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | typedef struct AVVideotoolboxContext { 40 | 41 | 42 | 43 | 44 | VTDecompressionSessionRef session; 45 | 46 | 47 | 48 | 49 | 50 | VTDecompressionOutputCallback output_callback; 51 | 52 | 53 | 54 | 55 | 56 | 57 | OSType cv_pix_fmt_type; 58 | 59 | 60 | 61 | 62 | 63 | CMVideoFormatDescriptionRef cm_fmt_desc; 64 | 65 | 66 | 67 | 68 | 69 | int cm_codec_type; 70 | } AVVideotoolboxContext; 71 | 72 | 73 | 74 | AVVideotoolboxContext *av_videotoolbox_alloc_context(void); 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | int av_videotoolbox_default_init(AVCodecContext *avctx); 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx); 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | void av_videotoolbox_default_free(AVCodecContext *avctx); 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /pp-libavutil/dict.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | //#include // #32 22 | 23 | //#include "version.h" // #34 24 | 25 | 26 | 27 | 28 | 29 | 30 | typedef struct AVDictionaryEntry { 31 | char *key; 32 | char *value; 33 | } AVDictionaryEntry; 34 | 35 | typedef struct AVDictionary AVDictionary; 36 | 37 | 38 | 39 | AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key, 40 | const AVDictionaryEntry *prev, int flags); 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | int av_dict_count(const AVDictionary *m); 49 | 50 | 51 | 52 | int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags); 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags); 61 | 62 | 63 | 64 | int av_dict_parse_string(AVDictionary **pm, const char *str, 65 | const char *key_val_sep, const char *pairs_sep, 66 | int flags); 67 | 68 | 69 | 70 | int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags); 71 | 72 | 73 | 74 | 75 | 76 | void av_dict_free(AVDictionary **m); 77 | 78 | 79 | 80 | int av_dict_get_string(const AVDictionary *m, char **buffer, 81 | const char key_val_sep, const char pairs_sep); 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /libavutil/dict.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVDictionaryEntry* {.bycopy.} = object 17 | key*: cstring 18 | value*: cstring 19 | 20 | 21 | proc av_dict_get*(m: ptr AVDictionary; key: cstring; prev: ptr AVDictionaryEntry; 22 | flags: cint): ptr AVDictionaryEntry {.cdecl, importc: "av_dict_get", 23 | dynlib: avutildll.} 24 | proc av_dict_count*(m: ptr AVDictionary): cint {.cdecl, importc: "av_dict_count", 25 | dynlib: avutildll.} 26 | proc av_dict_set*(pm: ptr ptr AVDictionary; key: cstring; value: cstring; flags: cint): cint {. 27 | cdecl, importc: "av_dict_set", dynlib: avutildll.} 28 | proc av_dict_set_int*(pm: ptr ptr AVDictionary; key: cstring; value: int64_t; flags: cint): cint {. 29 | cdecl, importc: "av_dict_set_int", dynlib: avutildll.} 30 | proc av_dict_parse_string*(pm: ptr ptr AVDictionary; str: cstring; 31 | key_val_sep: cstring; pairs_sep: cstring; flags: cint): cint {. 32 | cdecl, importc: "av_dict_parse_string", dynlib: avutildll.} 33 | proc av_dict_copy*(dst: ptr ptr AVDictionary; src: ptr AVDictionary; flags: cint): cint {. 34 | cdecl, importc: "av_dict_copy", dynlib: avutildll.} 35 | proc av_dict_free*(m: ptr ptr AVDictionary) {.cdecl, importc: "av_dict_free", 36 | dynlib: avutildll.} 37 | proc av_dict_get_string*(m: ptr AVDictionary; buffer: cstringArray; key_val_sep: char; 38 | pairs_sep: char): cint {.cdecl, 39 | importc: "av_dict_get_string", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/hwcontext_qsv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_HWCONTEXT_QSV_H 20 | #define AVUTIL_HWCONTEXT_QSV_H 21 | 22 | #include 23 | 24 | /** 25 | * @file 26 | * An API-specific header for AV_HWDEVICE_TYPE_QSV. 27 | * 28 | * This API does not support dynamic frame pools. AVHWFramesContext.pool must 29 | * contain AVBufferRefs whose data pointer points to an mfxFrameSurface1 struct. 30 | */ 31 | 32 | /** 33 | * This struct is allocated as AVHWDeviceContext.hwctx 34 | */ 35 | typedef struct AVQSVDeviceContext { 36 | mfxSession session; 37 | } AVQSVDeviceContext; 38 | 39 | /** 40 | * This struct is allocated as AVHWFramesContext.hwctx 41 | */ 42 | typedef struct AVQSVFramesContext { 43 | mfxFrameSurface1 *surfaces; 44 | int nb_surfaces; 45 | 46 | /** 47 | * A combination of MFX_MEMTYPE_* describing the frame pool. 48 | */ 49 | int frame_type; 50 | } AVQSVFramesContext; 51 | 52 | #endif /* AVUTIL_HWCONTEXT_QSV_H */ 53 | 54 | -------------------------------------------------------------------------------- /libavutil/hash.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVHashContext* {.bycopy.} = object 17 | 18 | 19 | proc av_hash_alloc*(ctx: ptr ptr AVHashContext; name: cstring): cint {.cdecl, 20 | importc: "av_hash_alloc", dynlib: avutildll.} 21 | proc av_hash_names*(i: cint): cstring {.cdecl, importc: "av_hash_names", 22 | dynlib: avutildll.} 23 | proc av_hash_get_name*(ctx: ptr AVHashContext): cstring {.cdecl, 24 | importc: "av_hash_get_name", dynlib: avutildll.} 25 | proc av_hash_get_size*(ctx: ptr AVHashContext): cint {.cdecl, 26 | importc: "av_hash_get_size", dynlib: avutildll.} 27 | proc av_hash_init*(ctx: ptr AVHashContext) {.cdecl, importc: "av_hash_init", 28 | dynlib: avutildll.} 29 | proc av_hash_update*(ctx: ptr AVHashContext; src: ptr uint8_t; len: cint) {.cdecl, 30 | importc: "av_hash_update", dynlib: avutildll.} 31 | proc av_hash_final*(ctx: ptr AVHashContext; dst: ptr uint8_t) {.cdecl, 32 | importc: "av_hash_final", dynlib: avutildll.} 33 | proc av_hash_final_bin*(ctx: ptr AVHashContext; dst: ptr uint8_t; size: cint) {.cdecl, 34 | importc: "av_hash_final_bin", dynlib: avutildll.} 35 | proc av_hash_final_hex*(ctx: ptr AVHashContext; dst: ptr uint8_t; size: cint) {.cdecl, 36 | importc: "av_hash_final_hex", dynlib: avutildll.} 37 | proc av_hash_final_b64*(ctx: ptr AVHashContext; dst: ptr uint8_t; size: cint) {.cdecl, 38 | importc: "av_hash_final_b64", dynlib: avutildll.} 39 | proc av_hash_freep*(ctx: ptr ptr AVHashContext) {.cdecl, importc: "av_hash_freep", 40 | dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/replaygain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_REPLAYGAIN_H 20 | #define AVUTIL_REPLAYGAIN_H 21 | 22 | #include 23 | 24 | /** 25 | * ReplayGain information (see 26 | * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification). 27 | * The size of this struct is a part of the public ABI. 28 | */ 29 | typedef struct AVReplayGain { 30 | /** 31 | * Track replay gain in microbels (divide by 100000 to get the value in dB). 32 | * Should be set to INT32_MIN when unknown. 33 | */ 34 | int32_t track_gain; 35 | /** 36 | * Peak track amplitude, with 100000 representing full scale (but values 37 | * may overflow). 0 when unknown. 38 | */ 39 | uint32_t track_peak; 40 | /** 41 | * Same as track_gain, but for the whole album. 42 | */ 43 | int32_t album_gain; 44 | /** 45 | * Same as track_peak, but for the whole album, 46 | */ 47 | uint32_t album_peak; 48 | } AVReplayGain; 49 | 50 | #endif /* AVUTIL_REPLAYGAIN_H */ 51 | -------------------------------------------------------------------------------- /pp-libavutil/hash.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | //#include // #29 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | struct AVHashContext; 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | int av_hash_alloc(struct AVHashContext **ctx, const char *name); 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | const char *av_hash_names(int i); 57 | 58 | 59 | 60 | 61 | const char *av_hash_get_name(const struct AVHashContext *ctx); 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | int av_hash_get_size(const struct AVHashContext *ctx); 77 | 78 | 79 | 80 | 81 | 82 | 83 | void av_hash_init(struct AVHashContext *ctx); 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len); 93 | 94 | 95 | 96 | void av_hash_final(struct AVHashContext *ctx, uint8_t *dst); 97 | 98 | 99 | 100 | void av_hash_final_bin(struct AVHashContext *ctx, uint8_t *dst, int size); 101 | 102 | 103 | 104 | void av_hash_final_hex(struct AVHashContext *ctx, uint8_t *dst, int size); 105 | 106 | 107 | 108 | void av_hash_final_b64(struct AVHashContext *ctx, uint8_t *dst, int size); 109 | 110 | 111 | 112 | 113 | 114 | 115 | void av_hash_freep(struct AVHashContext **ctx); 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /libavcodec/jni.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JNI public API functions 3 | * 4 | * Copyright (c) 2015-2016 Matthieu Bouron 5 | * 6 | * This file is part of FFmpeg. 7 | * 8 | * FFmpeg is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * FFmpeg is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with FFmpeg; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef AVCODEC_JNI_H 24 | #define AVCODEC_JNI_H 25 | 26 | /* 27 | * Manually set a Java virtual machine which will be used to retrieve the JNI 28 | * environment. Once a Java VM is set it cannot be changed afterwards, meaning 29 | * you can call multiple times av_jni_set_java_vm with the same Java VM pointer 30 | * however it will error out if you try to set a different Java VM. 31 | * 32 | * @param vm Java virtual machine 33 | * @param log_ctx context used for logging, can be NULL 34 | * @return 0 on success, < 0 otherwise 35 | */ 36 | int av_jni_set_java_vm(void *vm, void *log_ctx); 37 | 38 | /* 39 | * Get the Java virtual machine which has been set with av_jni_set_java_vm. 40 | * 41 | * @param vm Java virtual machine 42 | * @return a pointer to the Java virtual machine 43 | */ 44 | void *av_jni_get_java_vm(void *log_ctx); 45 | 46 | #endif /* AVCODEC_JNI_H */ 47 | -------------------------------------------------------------------------------- /libavcodec/vda.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, avcodec 13 | 14 | 15 | const 16 | kVDADecodeInfo_Asynchronous* = 1 shl 0 17 | kVDADecodeInfo_FrameDropped* = 1 shl 1 18 | 19 | type 20 | vda_context* {.bycopy.} = object 21 | decoder*: VDADecoder 22 | cv_buffer*: CVPixelBufferRef 23 | use_sync_decoding*: cint 24 | width*: cint 25 | height*: cint 26 | format*: cint 27 | cv_pix_fmt_type*: OSType 28 | priv_bitstream*: ptr uint8_t 29 | priv_bitstream_size*: cint 30 | priv_allocated_size*: cint 31 | use_ref_buffer*: cint 32 | 33 | 34 | proc ff_vda_create_decoder*(vda_ctx: ptr vda_context; extradata: ptr uint8_t; 35 | extradata_size: cint): cint {.cdecl, 36 | importc: "ff_vda_create_decoder", dynlib: avcodecdll.} 37 | proc ff_vda_destroy_decoder*(vda_ctx: ptr vda_context): cint {.cdecl, 38 | importc: "ff_vda_destroy_decoder", dynlib: avcodecdll.} 39 | type 40 | AVVDAContext* {.bycopy.} = object 41 | decoder*: VDADecoder 42 | output_callback*: VDADecoderOutputCallback 43 | cv_pix_fmt_type*: OSType 44 | 45 | 46 | proc av_vda_alloc_context*(): ptr AVVDAContext {.cdecl, 47 | importc: "av_vda_alloc_context", dynlib: avcodecdll.} 48 | proc av_vda_default_init*(avctx: ptr AVCodecContext): cint {.cdecl, 49 | importc: "av_vda_default_init", dynlib: avcodecdll.} 50 | proc av_vda_default_init2*(avctx: ptr AVCodecContext; vdactx: ptr AVVDAContext): cint {. 51 | cdecl, importc: "av_vda_default_init2", dynlib: avcodecdll.} 52 | proc av_vda_default_free*(avctx: ptr AVCodecContext) {.cdecl, 53 | importc: "av_vda_default_free", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /libavcodec/vdpau.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, ../libavutil/attributes, avcodec 13 | 14 | 15 | type 16 | AVCodecContext* {.bycopy.} = object 17 | 18 | AVFrame* {.bycopy.} = object 19 | 20 | AVVDPAU_Render2* = proc (a2: ptr AVCodecContext; a3: ptr AVFrame; 21 | a4: ptr VdpPictureInfo; a5: uint32_t; 22 | a6: ptr VdpBitstreamBuffer): cint {.cdecl.} 23 | AVVDPAUContext* {.bycopy.} = object 24 | decoder*: VdpDecoder 25 | render*: ptr VdpDecoderRender 26 | render2*: AVVDPAU_Render2 27 | 28 | 29 | proc av_alloc_vdpaucontext*(): ptr AVVDPAUContext {.cdecl, 30 | importc: "av_alloc_vdpaucontext", dynlib: avcodecdll.} 31 | proc av_vdpau_hwaccel_get_render2*(a2: ptr AVVDPAUContext): AVVDPAU_Render2 {.cdecl, 32 | importc: "av_vdpau_hwaccel_get_render2", dynlib: avcodecdll.} 33 | proc av_vdpau_hwaccel_set_render2*(a2: ptr AVVDPAUContext; a3: AVVDPAU_Render2) {. 34 | cdecl, importc: "av_vdpau_hwaccel_set_render2", dynlib: avcodecdll.} 35 | proc av_vdpau_bind_context*(avctx: ptr AVCodecContext; device: VdpDevice; 36 | get_proc_address: ptr VdpGetProcAddress; flags: cuint): cint {. 37 | cdecl, importc: "av_vdpau_bind_context", dynlib: avcodecdll.} 38 | proc av_vdpau_get_surface_parameters*(avctx: ptr AVCodecContext; 39 | `type`: ptr VdpChromaType; 40 | width: ptr uint32_t; height: ptr uint32_t): cint {. 41 | cdecl, importc: "av_vdpau_get_surface_parameters", dynlib: avcodecdll.} 42 | proc av_vdpau_alloc_context*(): ptr AVVDPAUContext {.cdecl, 43 | importc: "av_vdpau_alloc_context", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /libavutil/threadmessage.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | type 15 | AVThreadMessageFlags* {.size: sizeof(cint).} = enum 16 | AV_THREAD_MESSAGE_NONBLOCK = 1 17 | 18 | 19 | proc av_thread_message_queue_alloc*(mq: ptr ptr AVThreadMessageQueue; nelem: cuint; 20 | elsize: cuint): cint {.cdecl, 21 | importc: "av_thread_message_queue_alloc", dynlib: avutildll.} 22 | proc av_thread_message_queue_free*(mq: ptr ptr AVThreadMessageQueue) {.cdecl, 23 | importc: "av_thread_message_queue_free", dynlib: avutildll.} 24 | proc av_thread_message_queue_send*(mq: ptr AVThreadMessageQueue; msg: pointer; 25 | flags: cuint): cint {.cdecl, 26 | importc: "av_thread_message_queue_send", dynlib: avutildll.} 27 | proc av_thread_message_queue_recv*(mq: ptr AVThreadMessageQueue; msg: pointer; 28 | flags: cuint): cint {.cdecl, 29 | importc: "av_thread_message_queue_recv", dynlib: avutildll.} 30 | proc av_thread_message_queue_set_err_send*(mq: ptr AVThreadMessageQueue; err: cint) {. 31 | cdecl, importc: "av_thread_message_queue_set_err_send", dynlib: avutildll.} 32 | proc av_thread_message_queue_set_err_recv*(mq: ptr AVThreadMessageQueue; err: cint) {. 33 | cdecl, importc: "av_thread_message_queue_set_err_recv", dynlib: avutildll.} 34 | proc av_thread_message_queue_set_free_func*(mq: ptr AVThreadMessageQueue; 35 | free_func: proc (msg: pointer) {.cdecl.}) {.cdecl, 36 | importc: "av_thread_message_queue_set_free_func", dynlib: avutildll.} 37 | proc av_thread_message_flush*(mq: ptr AVThreadMessageQueue) {.cdecl, 38 | importc: "av_thread_message_flush", dynlib: avutildll.} -------------------------------------------------------------------------------- /libavutil/adler32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * @ingroup lavu_adler32 24 | * Public header for Adler-32 hash function implementation. 25 | */ 26 | 27 | #ifndef AVUTIL_ADLER32_H 28 | #define AVUTIL_ADLER32_H 29 | 30 | #include 31 | #include "attributes.h" 32 | 33 | /** 34 | * @defgroup lavu_adler32 Adler-32 35 | * @ingroup lavu_hash 36 | * Adler-32 hash function implementation. 37 | * 38 | * @{ 39 | */ 40 | 41 | /** 42 | * Calculate the Adler32 checksum of a buffer. 43 | * 44 | * Passing the return value to a subsequent av_adler32_update() call 45 | * allows the checksum of multiple buffers to be calculated as though 46 | * they were concatenated. 47 | * 48 | * @param adler initial checksum value 49 | * @param buf pointer to input buffer 50 | * @param len size of input buffer 51 | * @return updated checksum 52 | */ 53 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, 54 | unsigned int len) av_pure; 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | #endif /* AVUTIL_ADLER32_H */ 61 | -------------------------------------------------------------------------------- /libavutil/audio_fifo.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, avutil, fifo, samplefmt 13 | 14 | 15 | 16 | proc av_audio_fifo_free*(af: ptr AVAudioFifo) {.cdecl, importc: "av_audio_fifo_free", 17 | dynlib: avutildll.} 18 | proc av_audio_fifo_alloc*(sample_fmt: AVSampleFormat; channels: cint; 19 | nb_samples: cint): ptr AVAudioFifo {.cdecl, 20 | importc: "av_audio_fifo_alloc", dynlib: avutildll.} 21 | proc av_audio_fifo_realloc*(af: ptr AVAudioFifo; nb_samples: cint): cint {.cdecl, 22 | importc: "av_audio_fifo_realloc", dynlib: avutildll.} 23 | proc av_audio_fifo_write*(af: ptr AVAudioFifo; data: ptr pointer; nb_samples: cint): cint {. 24 | cdecl, importc: "av_audio_fifo_write", dynlib: avutildll.} 25 | proc av_audio_fifo_peek*(af: ptr AVAudioFifo; data: ptr pointer; nb_samples: cint): cint {. 26 | cdecl, importc: "av_audio_fifo_peek", dynlib: avutildll.} 27 | proc av_audio_fifo_peek_at*(af: ptr AVAudioFifo; data: ptr pointer; nb_samples: cint; 28 | offset: cint): cint {.cdecl, 29 | importc: "av_audio_fifo_peek_at", dynlib: avutildll.} 30 | proc av_audio_fifo_read*(af: ptr AVAudioFifo; data: ptr pointer; nb_samples: cint): cint {. 31 | cdecl, importc: "av_audio_fifo_read", dynlib: avutildll.} 32 | proc av_audio_fifo_drain*(af: ptr AVAudioFifo; nb_samples: cint): cint {.cdecl, 33 | importc: "av_audio_fifo_drain", dynlib: avutildll.} 34 | proc av_audio_fifo_reset*(af: ptr AVAudioFifo) {.cdecl, 35 | importc: "av_audio_fifo_reset", dynlib: avutildll.} 36 | proc av_audio_fifo_size*(af: ptr AVAudioFifo): cint {.cdecl, 37 | importc: "av_audio_fifo_size", dynlib: avutildll.} 38 | proc av_audio_fifo_space*(af: ptr AVAudioFifo): cint {.cdecl, 39 | importc: "av_audio_fifo_space", dynlib: avutildll.} -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pp-libavutil/stereo3d.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "frame.h" 14 | 15 | 16 | 17 | 18 | 19 | //#include // #23 20 | 21 | //#include "frame.h" // #25 22 | 23 | 24 | 25 | 26 | enum AVStereo3DType { 27 | 28 | 29 | 30 | AV_STEREO3D_2D, 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | AV_STEREO3D_SIDEBYSIDE, 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | AV_STEREO3D_TOPBOTTOM, 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | AV_STEREO3D_FRAMESEQUENCE, 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | AV_STEREO3D_CHECKERBOARD, 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | AV_STEREO3D_SIDEBYSIDE_QUINCUNX, 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | AV_STEREO3D_LINES, 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | AV_STEREO3D_COLUMNS, 103 | }; 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | typedef struct AVStereo3D { 119 | 120 | 121 | 122 | enum AVStereo3DType type; 123 | 124 | 125 | 126 | 127 | int flags; 128 | } AVStereo3D; 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | AVStereo3D *av_stereo3d_alloc(void); 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame); 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | const char *av_stereo3d_type_name(unsigned int type); 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | int av_stereo3d_from_name(const char *name); 164 | 165 | 166 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pp-libavutil/timecode.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | //#include // #29 24 | //#include "rational.h" // #30 25 | 26 | 27 | 28 | enum AVTimecodeFlag { 29 | AV_TIMECODE_FLAG_DROPFRAME = 1<<0, ///< timecode is drop frame 30 | AV_TIMECODE_FLAG_24HOURSMAX = 1<<1, ///< timecode wraps after 24 hours 31 | AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1<<2, ///< negative time values are allowed 32 | }; 33 | 34 | typedef struct { 35 | int start; ///< timecode frame start (first base frame number) 36 | uint32_t flags; ///< flags such as drop frame, +24 hours support, ... 37 | AVRational rate; ///< frame rate in rational form 38 | unsigned fps; ///< frame per second; must be consistent with the rate field 39 | } AVTimecode; 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | int av_timecode_adjust_ntsc_framenum2(int framenum, int fps); 50 | 51 | 52 | 53 | uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum); 54 | 55 | 56 | 57 | char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum); 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | char *av_timecode_make_smpte_tc_string(char *buf, uint32_t tcsmpte, int prevent_df); 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit); 78 | 79 | 80 | 81 | int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx); 82 | 83 | 84 | 85 | int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx); 86 | 87 | 88 | 89 | 90 | 91 | 92 | int av_timecode_check_frame_rate(AVRational rate); 93 | 94 | 95 | -------------------------------------------------------------------------------- /pp-libavutil/audio_fifo.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "avutil.h" 14 | #include "fifo.h" 15 | #include "samplefmt.h" 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | //#include "avutil.h" // #29 27 | //#include "fifo.h" // #30 28 | //#include "samplefmt.h" // #31 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | typedef struct AVAudioFifo AVAudioFifo; 46 | 47 | 48 | 49 | 50 | 51 | 52 | void av_audio_fifo_free(AVAudioFifo *af); 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, 63 | int nb_samples); 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | av_warn_unused_result 73 | int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples); 74 | 75 | 76 | 77 | int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); 78 | 79 | 80 | 81 | int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples); 82 | 83 | 84 | 85 | int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset); 86 | 87 | 88 | 89 | int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples); 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples); 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | void av_audio_fifo_reset(AVAudioFifo *af); 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | int av_audio_fifo_size(AVAudioFifo *af); 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | int av_audio_fifo_space(AVAudioFifo *af); 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /pp-libavutil/threadmessage.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | typedef struct AVThreadMessageQueue AVThreadMessageQueue; 19 | 20 | typedef enum AVThreadMessageFlags { 21 | 22 | 23 | 24 | 25 | 26 | 27 | AV_THREAD_MESSAGE_NONBLOCK = 1, 28 | 29 | } AVThreadMessageFlags; 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | int av_thread_message_queue_alloc(AVThreadMessageQueue **mq, 41 | unsigned nelem, 42 | unsigned elsize); 43 | 44 | 45 | 46 | 47 | 48 | 49 | void av_thread_message_queue_free(AVThreadMessageQueue **mq); 50 | 51 | 52 | 53 | 54 | int av_thread_message_queue_send(AVThreadMessageQueue *mq, 55 | void *msg, 56 | unsigned flags); 57 | 58 | 59 | 60 | 61 | int av_thread_message_queue_recv(AVThreadMessageQueue *mq, 62 | void *msg, 63 | unsigned flags); 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | void av_thread_message_queue_set_err_send(AVThreadMessageQueue *mq, 74 | int err); 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq, 85 | int err); 86 | 87 | 88 | 89 | 90 | 91 | void av_thread_message_queue_set_free_func(AVThreadMessageQueue *mq, 92 | void (*free_func)(void *msg)); 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | void av_thread_message_flush(AVThreadMessageQueue *mq); 102 | 103 | 104 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libavutil/timecode.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | 15 | type 16 | AVTimecodeFlag* {.size: sizeof(cint).} = enum 17 | AV_TIMECODE_FLAG_DROPFRAME = 1 shl 0, AV_TIMECODE_FLAG_24HOURSMAX = 1 shl 1, 18 | AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1 shl 2 19 | 20 | 21 | type 22 | AVTimecode* {.bycopy.} = object 23 | start*: cint 24 | flags*: uint32_t 25 | rate*: AVRational 26 | fps*: cuint 27 | 28 | 29 | proc av_timecode_adjust_ntsc_framenum2*(framenum: cint; fps: cint): cint {.cdecl, 30 | importc: "av_timecode_adjust_ntsc_framenum2", dynlib: avutildll.} 31 | proc av_timecode_get_smpte_from_framenum*(tc: ptr AVTimecode; framenum: cint): uint32_t {. 32 | cdecl, importc: "av_timecode_get_smpte_from_framenum", dynlib: avutildll.} 33 | proc av_timecode_make_string*(tc: ptr AVTimecode; buf: cstring; framenum: cint): cstring {. 34 | cdecl, importc: "av_timecode_make_string", dynlib: avutildll.} 35 | proc av_timecode_make_smpte_tc_string*(buf: cstring; tcsmpte: uint32_t; 36 | prevent_df: cint): cstring {.cdecl, 37 | importc: "av_timecode_make_smpte_tc_string", dynlib: avutildll.} 38 | proc av_timecode_make_mpeg_tc_string*(buf: cstring; tc25bit: uint32_t): cstring {. 39 | cdecl, importc: "av_timecode_make_mpeg_tc_string", dynlib: avutildll.} 40 | proc av_timecode_init*(tc: ptr AVTimecode; rate: AVRational; flags: cint; 41 | frame_start: cint; log_ctx: pointer): cint {.cdecl, 42 | importc: "av_timecode_init", dynlib: avutildll.} 43 | proc av_timecode_init_from_string*(tc: ptr AVTimecode; rate: AVRational; str: cstring; 44 | log_ctx: pointer): cint {.cdecl, 45 | importc: "av_timecode_init_from_string", dynlib: avutildll.} 46 | proc av_timecode_check_frame_rate*(rate: AVRational): cint {.cdecl, 47 | importc: "av_timecode_check_frame_rate", dynlib: avutildll.} -------------------------------------------------------------------------------- /pp-libavcodec/avfft.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | typedef float FFTSample; 32 | 33 | typedef struct FFTComplex { 34 | FFTSample re, im; 35 | } FFTComplex; 36 | 37 | typedef struct FFTContext FFTContext; 38 | 39 | 40 | 41 | 42 | 43 | 44 | FFTContext *av_fft_init(int nbits, int inverse); 45 | 46 | 47 | 48 | 49 | void av_fft_permute(FFTContext *s, FFTComplex *z); 50 | 51 | 52 | 53 | 54 | 55 | void av_fft_calc(FFTContext *s, FFTComplex *z); 56 | 57 | void av_fft_end(FFTContext *s); 58 | 59 | FFTContext *av_mdct_init(int nbits, int inverse, double scale); 60 | void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); 61 | void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); 62 | void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); 63 | void av_mdct_end(FFTContext *s); 64 | 65 | 66 | 67 | enum RDFTransformType { 68 | DFT_R2C, 69 | IDFT_C2R, 70 | IDFT_R2C, 71 | DFT_C2R, 72 | }; 73 | 74 | typedef struct RDFTContext RDFTContext; 75 | 76 | 77 | 78 | 79 | 80 | 81 | RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); 82 | void av_rdft_calc(RDFTContext *s, FFTSample *data); 83 | void av_rdft_end(RDFTContext *s); 84 | 85 | 86 | 87 | typedef struct DCTContext DCTContext; 88 | 89 | enum DCTTransformType { 90 | DCT_II = 0, 91 | DCT_III, 92 | DCT_I, 93 | DST_I, 94 | }; 95 | 96 | 97 | 98 | DCTContext *av_dct_init(int nbits, enum DCTTransformType type); 99 | void av_dct_calc(DCTContext *s, FFTSample *data); 100 | void av_dct_end (DCTContext *s); 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /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 6 31 | #define LIBSWSCALE_VERSION_MICRO 100 32 | 33 | #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ 34 | LIBSWSCALE_VERSION_MINOR, \ 35 | LIBSWSCALE_VERSION_MICRO) 36 | #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ 37 | LIBSWSCALE_VERSION_MINOR, \ 38 | LIBSWSCALE_VERSION_MICRO) 39 | #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT 40 | 41 | #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) 42 | 43 | /** 44 | * FF_API_* defines may be placed below to indicate public API that will be 45 | * dropped at a future version bump. The defines themselves are not part of 46 | * the public API and may change, break or disappear at any time. 47 | */ 48 | 49 | #ifndef FF_API_SWS_VECTOR 50 | #define FF_API_SWS_VECTOR (LIBSWSCALE_VERSION_MAJOR < 6) 51 | #endif 52 | 53 | #endif /* SWSCALE_VERSION_H */ 54 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pp-libavcodec/dv_profile.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "../libavutil/pixfmt.h" 14 | #include "avcodec.h" 15 | 16 | 17 | 18 | 19 | 20 | //#include // #21 21 | 22 | //#include "libavutil/pixfmt.h" // #23 23 | //#include "libavutil/rational.h" // #24 24 | //#include "avcodec.h" // #25 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | typedef struct AVDVProfile { 38 | int dsf; 39 | int video_stype; 40 | int frame_size; 41 | int difseg_size; 42 | int n_difchan; 43 | AVRational time_base; 44 | int ltc_divisor; 45 | int height; 46 | int width; 47 | AVRational sar[2]; 48 | enum AVPixelFormat pix_fmt; 49 | int bpm; 50 | const uint8_t *block_sizes; 51 | int audio_stride; 52 | int audio_min_samples[3]; 53 | 54 | int audio_samples_dist[5]; 55 | 56 | const uint8_t (*audio_shuffle)[9]; 57 | } AVDVProfile; 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys, 68 | const uint8_t *frame, unsigned buf_size); 69 | 70 | 71 | 72 | 73 | const AVDVProfile *av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt); 74 | 75 | 76 | 77 | 78 | 79 | const AVDVProfile *av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate); 80 | 81 | 82 | -------------------------------------------------------------------------------- /pp-libavcodec/vdpau.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "../libavutil/attributes.h" 14 | #include "avcodec.h" 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | //#include // #51 31 | //#include // #52 32 | //#include "libavutil/avconfig.h" // #53 33 | //#include "libavutil/attributes.h" // #54 34 | 35 | //#include "avcodec.h" // #56 36 | //#include "version.h" // #57 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | struct AVCodecContext; 48 | struct AVFrame; 49 | 50 | typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *, 51 | const VdpPictureInfo *, uint32_t, 52 | const VdpBitstreamBuffer *); 53 | 54 | 55 | 56 | typedef struct AVVDPAUContext { 57 | 58 | 59 | 60 | 61 | 62 | VdpDecoder decoder; 63 | 64 | 65 | 66 | 67 | 68 | 69 | VdpDecoderRender *render; 70 | 71 | 72 | AVVDPAU_Render2 render2; 73 | } AVVDPAUContext; 74 | 75 | 76 | 77 | 78 | 79 | 80 | AVVDPAUContext *av_alloc_vdpaucontext(void); 81 | 82 | AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *); 83 | void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2); 84 | 85 | 86 | 87 | int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, 88 | VdpGetProcAddress *get_proc_address, unsigned flags); 89 | 90 | 91 | 92 | int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type, 93 | uint32_t *width, uint32_t *height); 94 | 95 | 96 | 97 | 98 | 99 | 100 | AVVDPAUContext *av_vdpau_alloc_context(void); 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /pp-libavcodec/xvmc.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avcodecdll 3 | # cdecl 4 | # if defined(windows) 5 | # define avcodecdll "avcodec.dll" 6 | # elif defined(macosx) 7 | # define avcodecdll "libavcodec.dylib" 8 | # else 9 | # define avcodecdll "libavcodec.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | #include "../libavutil/attributes.h" 14 | #include "avcodec.h" 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | //#include // #29 27 | 28 | //#include "libavutil/attributes.h" // #31 29 | //#include "version.h" // #32 30 | //#include "avcodec.h" // #33 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | struct attribute_deprecated xvmc_pix_fmt { 43 | 44 | 45 | 46 | 47 | 48 | 49 | int xvmc_id; 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | short* data_blocks; 59 | 60 | 61 | 62 | 63 | 64 | 65 | XvMCMacroBlock* mv_blocks; 66 | 67 | 68 | 69 | 70 | 71 | 72 | int allocated_mv_blocks; 73 | 74 | 75 | 76 | 77 | 78 | int allocated_data_blocks; 79 | 80 | 81 | 82 | 83 | 84 | 85 | int idct; 86 | 87 | 88 | 89 | 90 | 91 | 92 | int unsigned_intra; 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | XvMCSurface* p_surface; 101 | 102 | 103 | 104 | //@{ 105 | 106 | 107 | 108 | 109 | XvMCSurface* p_past_surface; 110 | 111 | 112 | 113 | 114 | 115 | XvMCSurface* p_future_surface; 116 | 117 | 118 | 119 | 120 | 121 | unsigned int picture_structure; 122 | 123 | 124 | 125 | 126 | 127 | unsigned int flags; 128 | //}@ 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | int start_mv_blocks_num; 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | int filled_mv_blocks_num; 147 | 148 | 149 | 150 | int next_free_data_block_num; 151 | }; 152 | 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /libavcodec/dirac.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common, avcodec 13 | 14 | 15 | type 16 | DiracParseCodes* {.size: sizeof(cint).} = enum 17 | DIRAC_PCODE_SEQ_HEADER = 0x00000000, DIRAC_PCODE_PICTURE_CODED = 0x00000008, 18 | DIRAC_PCODE_INTER_NOREF_CO2 = 0x00000009, 19 | DIRAC_PCODE_INTER_NOREF_CO1 = 0x0000000A, 20 | DIRAC_PCODE_INTRA_REF_CO = 0x0000000C, DIRAC_PCODE_INTER_REF_CO1 = 0x0000000D, 21 | DIRAC_PCODE_INTER_REF_CO2 = 0x0000000E, DIRAC_PCODE_END_SEQ = 0x00000010, 22 | DIRAC_PCODE_AUX = 0x00000020, DIRAC_PCODE_PAD = 0x00000030, 23 | DIRAC_PCODE_PICTURE_RAW = 0x00000048, DIRAC_PCODE_INTRA_REF_RAW = 0x0000004C, 24 | DIRAC_PCODE_PICTURE_LOW_DEL = 0x000000C8, 25 | DIRAC_PCODE_INTRA_REF_PICT = 0x000000CC, DIRAC_PCODE_PICTURE_HQ = 0x000000E8, 26 | DIRAC_PCODE_MAGIC = 0x42424344 27 | 28 | 29 | type 30 | DiracVersionInfo* {.bycopy.} = object 31 | major*: cint 32 | minor*: cint 33 | 34 | AVDiracSeqHeader* {.bycopy.} = object 35 | width*: cuint 36 | height*: cuint 37 | chroma_format*: uint8_t 38 | interlaced*: uint8_t 39 | top_field_first*: uint8_t 40 | frame_rate_index*: uint8_t 41 | aspect_ratio_index*: uint8_t 42 | clean_width*: uint16_t 43 | clean_height*: uint16_t 44 | clean_left_offset*: uint16_t 45 | clean_right_offset*: uint16_t 46 | pixel_range_index*: uint8_t 47 | color_spec_index*: uint8_t 48 | profile*: cint 49 | level*: cint 50 | framerate*: AVRational 51 | sample_aspect_ratio*: AVRational 52 | pix_fmt*: AVPixelFormat 53 | color_range*: AVColorRange 54 | color_primaries*: AVColorPrimaries 55 | color_trc*: AVColorTransferCharacteristic 56 | colorspace*: AVColorSpace 57 | version*: DiracVersionInfo 58 | bit_depth*: cint 59 | 60 | 61 | proc av_dirac_parse_sequence_header*(dsh: ptr ptr AVDiracSeqHeader; buf: ptr uint8_t; 62 | buf_size: csize; log_ctx: pointer): cint {.cdecl, 63 | importc: "av_dirac_parse_sequence_header", dynlib: avcodecdll.} -------------------------------------------------------------------------------- /libavutil/avutil.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avutildll* = "avutil.dll" 5 | elif defined(macosx): 6 | const 7 | avutildll* = "libavutil.dylib" 8 | else: 9 | const 10 | avutildll* = "libavutil.so" 11 | import 12 | ../nim_ffmpeg_common, macros, pixfmt 13 | 14 | proc avutil_version*(): cuint {.cdecl, importc: "avutil_version", dynlib: avutildll.} 15 | proc av_version_info*(): cstring {.cdecl, importc: "av_version_info", 16 | dynlib: avutildll.} 17 | proc avutil_configuration*(): cstring {.cdecl, importc: "avutil_configuration", 18 | dynlib: avutildll.} 19 | proc avutil_license*(): cstring {.cdecl, importc: "avutil_license", dynlib: avutildll.} 20 | type 21 | AVMediaType* {.size: sizeof(cint).} = enum 22 | AVMEDIA_TYPE_UNKNOWN = - 1, AVMEDIA_TYPE_VIDEO, AVMEDIA_TYPE_AUDIO, 23 | AVMEDIA_TYPE_DATA, AVMEDIA_TYPE_SUBTITLE, AVMEDIA_TYPE_ATTACHMENT, 24 | AVMEDIA_TYPE_NB 25 | 26 | 27 | proc av_get_media_type_string*(media_type: AVMediaType): cstring {.cdecl, 28 | importc: "av_get_media_type_string", dynlib: avutildll.} 29 | type 30 | AVPictureType* {.size: sizeof(cint).} = enum 31 | AV_PICTURE_TYPE_NONE = 0, AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, 32 | AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_S, AV_PICTURE_TYPE_SI, AV_PICTURE_TYPE_SP, 33 | AV_PICTURE_TYPE_BI 34 | 35 | 36 | proc av_get_picture_type_char*(pict_type: AVPictureType): char {.cdecl, 37 | importc: "av_get_picture_type_char", dynlib: avutildll.} 38 | 39 | #proc av_x_if_null*(p: pointer; x: pointer): pointer {.inline, cdecl.} = 40 | # return cast[pointer](cast[ptr cint]((if p: p else: x))) 41 | 42 | proc av_int_list_length_for_size*(elsize: cuint; list: pointer; term: uint64_t): cuint {. 43 | cdecl, importc: "av_int_list_length_for_size", dynlib: avutildll.} 44 | proc av_fopen_utf8*(path: cstring; mode: cstring): ptr FILE {.cdecl, 45 | importc: "av_fopen_utf8", dynlib: avutildll.} 46 | proc av_get_time_base_q*(): AVRational {.cdecl, importc: "av_get_time_base_q", 47 | dynlib: avutildll.} 48 | proc av_fourcc_make_string*(buf: cstring; fourcc: uint32_t): cstring {.cdecl, 49 | importc: "av_fourcc_make_string", dynlib: avutildll.} -------------------------------------------------------------------------------- /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< 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /nim_ffmpeg_common.nim: -------------------------------------------------------------------------------- 1 | const AV_NUM_DATA_POINTERS* = 8 2 | const SEEK_CUR* = 0 3 | 4 | type 5 | int16_t* = int16 6 | uint64_t* = uint64 7 | int64_t* = int64 8 | uint8_t* = uint8 9 | uint16_t* = uint16 10 | int32_t* = int32 11 | uint32_t* = uint32 12 | 13 | 14 | AVRational* {.bycopy.} = object 15 | num*: cint 16 | den*: cint 17 | 18 | AVRounding* = enum 19 | AV_ROUND_ZERO = 0, AV_ROUND_INF = 1, AV_ROUND_DOWN = 2, AV_ROUND_UP = 3, 20 | AV_ROUND_NEAR_INF = 5, AV_ROUND_PASS_MINMAX = 8192 21 | 22 | type 23 | #c2nim doesn't convert pure struct typedefs nor reorders forward declarations 24 | AVBuffer* = object 25 | AVBufferPool* = object 26 | AVDictionary* = object 27 | AVBSFInternal* = object 28 | AVBSFList* = object 29 | 30 | type 31 | AVOption* = object 32 | AVCodecContext* = object 33 | AVCodecDefault* = object 34 | #AVPacket* = object 35 | URLContext* = object 36 | FFFrac* = object 37 | AVStreamInternal* = object 38 | AVFormatInternal* = object 39 | AVDeviceCapabilitiesQuery* = object 40 | 41 | type 42 | AVClassCategory* = enum 43 | AV_CLASS_CATEGORY_NA = 0, AV_CLASS_CATEGORY_INPUT, AV_CLASS_CATEGORY_OUTPUT, 44 | AV_CLASS_CATEGORY_MUXER, AV_CLASS_CATEGORY_DEMUXER, AV_CLASS_CATEGORY_ENCODER, 45 | AV_CLASS_CATEGORY_DECODER, AV_CLASS_CATEGORY_FILTER, 46 | AV_CLASS_CATEGORY_BITSTREAM_FILTER, AV_CLASS_CATEGORY_SWSCALER, 47 | AV_CLASS_CATEGORY_SWRESAMPLER, AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, 48 | AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, 49 | AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, AV_CLASS_CATEGORY_DEVICE_OUTPUT, 50 | AV_CLASS_CATEGORY_DEVICE_INPUT, AV_CLASS_CATEGORY_NB 51 | 52 | 53 | type 54 | AVOptionRanges* {.bycopy.} = object 55 | 56 | AVClass* {.bycopy.} = object 57 | class_name*: cstring 58 | item_name*: proc (ctx: pointer): cstring {.cdecl.} 59 | option*: ptr AVOption 60 | version*: cint 61 | log_level_offset_offset*: cint 62 | parent_log_context_offset*: cint 63 | child_next*: proc (obj: pointer; prev: pointer): pointer {.cdecl.} 64 | child_class_next*: proc (prev: ptr AVClass): ptr AVClass {.cdecl.} 65 | category*: AVClassCategory 66 | get_category*: proc (ctx: pointer): AVClassCategory {.cdecl.} 67 | query_ranges*: proc (a2: ptr ptr AVOptionRanges; obj: pointer; key: cstring; 68 | flags: cint): cint {.cdecl.} 69 | 70 | -------------------------------------------------------------------------------- /pp-libavutil/channel_layout.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | //#include // #24 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 | enum AVMatrixEncoding { 47 | AV_MATRIX_ENCODING_NONE, 48 | AV_MATRIX_ENCODING_DOLBY, 49 | AV_MATRIX_ENCODING_DPLII, 50 | AV_MATRIX_ENCODING_DPLIIX, 51 | AV_MATRIX_ENCODING_DPLIIZ, 52 | AV_MATRIX_ENCODING_DOLBYEX, 53 | AV_MATRIX_ENCODING_DOLBYHEADPHONE, 54 | AV_MATRIX_ENCODING_NB 55 | }; 56 | 57 | 58 | 59 | uint64_t av_get_channel_layout(const char *name); 60 | 61 | 62 | 63 | int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, int* nb_channels); 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout); 73 | 74 | struct AVBPrint; 75 | 76 | 77 | 78 | void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout); 79 | 80 | 81 | 82 | 83 | int av_get_channel_layout_nb_channels(uint64_t channel_layout); 84 | 85 | 86 | 87 | 88 | int64_t av_get_default_channel_layout(int nb_channels); 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | int av_get_channel_layout_channel_index(uint64_t channel_layout, 100 | uint64_t channel); 101 | 102 | 103 | 104 | 105 | uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index); 106 | 107 | 108 | 109 | 110 | 111 | 112 | const char *av_get_channel_name(uint64_t channel); 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | const char *av_get_channel_description(uint64_t channel); 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | int av_get_standard_channel_layout(unsigned index, uint64_t *layout, 132 | const char **name); 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pp-libavutil/spherical.h: -------------------------------------------------------------------------------- 1 | #ifdef C2NIM 2 | # dynlib avutildll 3 | # cdecl 4 | # if defined(windows) 5 | # define avutildll "avutil.dll" 6 | # elif defined(macosx) 7 | # define avutildll "libavutil.dylib" 8 | # else 9 | # define avutildll "libavutil.so" 10 | # endif 11 | #endif 12 | #include "../nim_ffmpeg_common.h" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | //#include // #28 24 | //#include // #29 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | enum AVSphericalProjection { 46 | 47 | 48 | 49 | 50 | AV_SPHERICAL_EQUIRECTANGULAR, 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | AV_SPHERICAL_CUBEMAP, 60 | 61 | 62 | 63 | 64 | 65 | 66 | AV_SPHERICAL_EQUIRECTANGULAR_TILE, 67 | }; 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | typedef struct AVSphericalMapping { 77 | 78 | 79 | 80 | enum AVSphericalProjection projection; 81 | 82 | 83 | 84 | int32_t yaw; ///< Rotation around the up vector [-180, 180]. 85 | int32_t pitch; ///< Rotation around the right vector [-90, 90]. 86 | int32_t roll; ///< Rotation around the forward vector [-180, 180]. 87 | 88 | 89 | 90 | 91 | 92 | 93 | uint32_t bound_left; ///< Distance from the left edge 94 | uint32_t bound_top; ///< Distance from the top edge 95 | uint32_t bound_right; ///< Distance from the right edge 96 | uint32_t bound_bottom; ///< Distance from the bottom edge 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | uint32_t padding; 109 | } AVSphericalMapping; 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | AVSphericalMapping *av_spherical_alloc(size_t *size); 118 | 119 | 120 | 121 | void av_spherical_tile_bounds(const AVSphericalMapping *map, 122 | size_t width, size_t height, 123 | size_t *left, size_t *top, 124 | size_t *right, size_t *bottom); 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | const char *av_spherical_projection_name(enum AVSphericalProjection projection); 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | int av_spherical_from_name(const char *name); 143 | 144 | 145 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libavutil/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * @ingroup lavu_md5 24 | * Public header for MD5 hash function implementation. 25 | */ 26 | 27 | #ifndef AVUTIL_MD5_H 28 | #define AVUTIL_MD5_H 29 | 30 | #include 31 | 32 | #include "attributes.h" 33 | #include "version.h" 34 | 35 | /** 36 | * @defgroup lavu_md5 MD5 37 | * @ingroup lavu_hash 38 | * MD5 hash function implementation. 39 | * 40 | * @{ 41 | */ 42 | 43 | extern const int av_md5_size; 44 | 45 | struct AVMD5; 46 | 47 | /** 48 | * Allocate an AVMD5 context. 49 | */ 50 | struct AVMD5 *av_md5_alloc(void); 51 | 52 | /** 53 | * Initialize MD5 hashing. 54 | * 55 | * @param ctx pointer to the function context (of size av_md5_size) 56 | */ 57 | void av_md5_init(struct AVMD5 *ctx); 58 | 59 | /** 60 | * Update hash value. 61 | * 62 | * @param ctx hash function context 63 | * @param src input data to update hash with 64 | * @param len input data length 65 | */ 66 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); 67 | 68 | /** 69 | * Finish hashing and output digest value. 70 | * 71 | * @param ctx hash function context 72 | * @param dst buffer where output digest value is stored 73 | */ 74 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); 75 | 76 | /** 77 | * Hash an array of data. 78 | * 79 | * @param dst The output buffer to write the digest into 80 | * @param src The data to hash 81 | * @param len The length of the data, in bytes 82 | */ 83 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); 84 | 85 | /** 86 | * @} 87 | */ 88 | 89 | #endif /* AVUTIL_MD5_H */ 90 | -------------------------------------------------------------------------------- /libavutil/lfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lagged Fibonacci PRNG 3 | * Copyright (c) 2008 Michael Niedermayer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_LFG_H 23 | #define AVUTIL_LFG_H 24 | 25 | #include 26 | 27 | typedef struct AVLFG { 28 | unsigned int state[64]; 29 | int index; 30 | } AVLFG; 31 | 32 | void av_lfg_init(AVLFG *c, unsigned int seed); 33 | 34 | /** 35 | * Seed the state of the ALFG using binary data. 36 | * 37 | * Return value: 0 on success, negative value (AVERROR) on failure. 38 | */ 39 | int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length); 40 | 41 | /** 42 | * Get the next random unsigned 32-bit number using an ALFG. 43 | * 44 | * Please also consider a simple LCG like state= state*1664525+1013904223, 45 | * it may be good enough and faster for your specific use case. 46 | */ 47 | static inline unsigned int av_lfg_get(AVLFG *c){ 48 | c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; 49 | return c->state[c->index++ & 63]; 50 | } 51 | 52 | /** 53 | * Get the next random unsigned 32-bit number using a MLFG. 54 | * 55 | * Please also consider av_lfg_get() above, it is faster. 56 | */ 57 | static inline unsigned int av_mlfg_get(AVLFG *c){ 58 | unsigned int a= c->state[(c->index-55) & 63]; 59 | unsigned int b= c->state[(c->index-24) & 63]; 60 | return c->state[c->index++ & 63] = 2*a*b+a+b; 61 | } 62 | 63 | /** 64 | * Get the next two numbers generated by a Box-Muller Gaussian 65 | * generator using the random numbers issued by lfg. 66 | * 67 | * @param out array where the two generated numbers are placed 68 | */ 69 | void av_bmg_get(AVLFG *lfg, double out[2]); 70 | 71 | #endif /* AVUTIL_LFG_H */ 72 | -------------------------------------------------------------------------------- /libavutil/ripemd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * Copyright (C) 2013 James Almer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | /** 23 | * @file 24 | * @ingroup lavu_ripemd 25 | * Public header for RIPEMD hash function implementation. 26 | */ 27 | 28 | #ifndef AVUTIL_RIPEMD_H 29 | #define AVUTIL_RIPEMD_H 30 | 31 | #include 32 | 33 | #include "attributes.h" 34 | #include "version.h" 35 | 36 | /** 37 | * @defgroup lavu_ripemd RIPEMD 38 | * @ingroup lavu_hash 39 | * RIPEMD hash function implementation. 40 | * 41 | * @{ 42 | */ 43 | 44 | extern const int av_ripemd_size; 45 | 46 | struct AVRIPEMD; 47 | 48 | /** 49 | * Allocate an AVRIPEMD context. 50 | */ 51 | struct AVRIPEMD *av_ripemd_alloc(void); 52 | 53 | /** 54 | * Initialize RIPEMD hashing. 55 | * 56 | * @param context pointer to the function context (of size av_ripemd_size) 57 | * @param bits number of bits in digest (128, 160, 256 or 320 bits) 58 | * @return zero if initialization succeeded, -1 otherwise 59 | */ 60 | int av_ripemd_init(struct AVRIPEMD* context, int bits); 61 | 62 | /** 63 | * Update hash value. 64 | * 65 | * @param context hash function context 66 | * @param data input data to update hash with 67 | * @param len input data length 68 | */ 69 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); 70 | 71 | /** 72 | * Finish hashing and output digest value. 73 | * 74 | * @param context hash function context 75 | * @param digest buffer where output digest value is stored 76 | */ 77 | void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest); 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | #endif /* AVUTIL_RIPEMD_H */ 84 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libavutil/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com) 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_BASE64_H 22 | #define AVUTIL_BASE64_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_base64 Base64 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | /** 33 | * Decode a base64-encoded string. 34 | * 35 | * @param out buffer for decoded data 36 | * @param in null-terminated input string 37 | * @param out_size size in bytes of the out buffer, must be at 38 | * least 3/4 of the length of in, that is AV_BASE64_DECODE_SIZE(strlen(in)) 39 | * @return number of bytes written, or a negative value in case of 40 | * invalid input 41 | */ 42 | int av_base64_decode(uint8_t *out, const char *in, int out_size); 43 | 44 | /** 45 | * Calculate the output size in bytes needed to decode a base64 string 46 | * with length x to a data buffer. 47 | */ 48 | #define AV_BASE64_DECODE_SIZE(x) ((x) * 3LL / 4) 49 | 50 | /** 51 | * Encode data to base64 and null-terminate. 52 | * 53 | * @param out buffer for encoded data 54 | * @param out_size size in bytes of the out buffer (including the 55 | * null terminator), must be at least AV_BASE64_SIZE(in_size) 56 | * @param in input buffer containing the data to encode 57 | * @param in_size size in bytes of the in buffer 58 | * @return out or NULL in case of error 59 | */ 60 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); 61 | 62 | /** 63 | * Calculate the output size needed to base64-encode x bytes to a 64 | * null-terminated string. 65 | */ 66 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) 67 | 68 | /** 69 | * @} 70 | */ 71 | 72 | #endif /* AVUTIL_BASE64_H */ 73 | -------------------------------------------------------------------------------- /libavutil/hwcontext_dxva2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | 20 | #ifndef AVUTIL_HWCONTEXT_DXVA2_H 21 | #define AVUTIL_HWCONTEXT_DXVA2_H 22 | 23 | /** 24 | * @file 25 | * An API-specific header for AV_HWDEVICE_TYPE_DXVA2. 26 | * 27 | * Only fixed-size pools are supported. 28 | * 29 | * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs 30 | * with the data pointer set to a pointer to IDirect3DSurface9. 31 | */ 32 | 33 | #include 34 | #include 35 | 36 | /** 37 | * This struct is allocated as AVHWDeviceContext.hwctx 38 | */ 39 | typedef struct AVDXVA2DeviceContext { 40 | IDirect3DDeviceManager9 *devmgr; 41 | } AVDXVA2DeviceContext; 42 | 43 | /** 44 | * This struct is allocated as AVHWFramesContext.hwctx 45 | */ 46 | typedef struct AVDXVA2FramesContext { 47 | /** 48 | * The surface type (e.g. DXVA2_VideoProcessorRenderTarget or 49 | * DXVA2_VideoDecoderRenderTarget). Must be set by the caller. 50 | */ 51 | DWORD surface_type; 52 | 53 | /** 54 | * The surface pool. When an external pool is not provided by the caller, 55 | * this will be managed (allocated and filled on init, freed on uninit) by 56 | * libavutil. 57 | */ 58 | IDirect3DSurface9 **surfaces; 59 | int nb_surfaces; 60 | 61 | /** 62 | * Certain drivers require the decoder to be destroyed before the surfaces. 63 | * To allow internally managed pools to work properly in such cases, this 64 | * field is provided. 65 | * 66 | * If it is non-NULL, libavutil will call IDirectXVideoDecoder_Release() on 67 | * it just before the internal surface pool is freed. 68 | */ 69 | IDirectXVideoDecoder *decoder_to_release; 70 | } AVDXVA2FramesContext; 71 | 72 | #endif /* AVUTIL_HWCONTEXT_DXVA2_H */ 73 | -------------------------------------------------------------------------------- /libavcodec/avfft.nim: -------------------------------------------------------------------------------- 1 | {.deadCodeElim: on.} 2 | when defined(windows): 3 | const 4 | avcodecdll* = "avcodec.dll" 5 | elif defined(macosx): 6 | const 7 | avcodecdll* = "libavcodec.dylib" 8 | else: 9 | const 10 | avcodecdll* = "libavcodec.so" 11 | import 12 | ../nim_ffmpeg_common 13 | 14 | type 15 | FFTSample* = cfloat 16 | FFTComplex* {.bycopy.} = object 17 | re*: FFTSample 18 | im*: FFTSample 19 | 20 | 21 | proc av_fft_init*(nbits: cint; inverse: cint): ptr FFTContext {.cdecl, 22 | importc: "av_fft_init", dynlib: avcodecdll.} 23 | proc av_fft_permute*(s: ptr FFTContext; z: ptr FFTComplex) {.cdecl, 24 | importc: "av_fft_permute", dynlib: avcodecdll.} 25 | proc av_fft_calc*(s: ptr FFTContext; z: ptr FFTComplex) {.cdecl, importc: "av_fft_calc", 26 | dynlib: avcodecdll.} 27 | proc av_fft_end*(s: ptr FFTContext) {.cdecl, importc: "av_fft_end", dynlib: avcodecdll.} 28 | proc av_mdct_init*(nbits: cint; inverse: cint; scale: cdouble): ptr FFTContext {.cdecl, 29 | importc: "av_mdct_init", dynlib: avcodecdll.} 30 | proc av_imdct_calc*(s: ptr FFTContext; output: ptr FFTSample; input: ptr FFTSample) {. 31 | cdecl, importc: "av_imdct_calc", dynlib: avcodecdll.} 32 | proc av_imdct_half*(s: ptr FFTContext; output: ptr FFTSample; input: ptr FFTSample) {. 33 | cdecl, importc: "av_imdct_half", dynlib: avcodecdll.} 34 | proc av_mdct_calc*(s: ptr FFTContext; output: ptr FFTSample; input: ptr FFTSample) {. 35 | cdecl, importc: "av_mdct_calc", dynlib: avcodecdll.} 36 | proc av_mdct_end*(s: ptr FFTContext) {.cdecl, importc: "av_mdct_end", 37 | dynlib: avcodecdll.} 38 | type 39 | RDFTransformType* {.size: sizeof(cint).} = enum 40 | DFT_R2C, IDFT_C2R, IDFT_R2C, DFT_C2R 41 | 42 | 43 | 44 | proc av_rdft_init*(nbits: cint; trans: RDFTransformType): ptr RDFTContext {.cdecl, 45 | importc: "av_rdft_init", dynlib: avcodecdll.} 46 | proc av_rdft_calc*(s: ptr RDFTContext; data: ptr FFTSample) {.cdecl, 47 | importc: "av_rdft_calc", dynlib: avcodecdll.} 48 | proc av_rdft_end*(s: ptr RDFTContext) {.cdecl, importc: "av_rdft_end", 49 | dynlib: avcodecdll.} 50 | type 51 | DCTTransformType* {.size: sizeof(cint).} = enum 52 | DCT_II = 0, DCT_III, DCT_I, DST_I 53 | 54 | 55 | proc av_dct_init*(nbits: cint; `type`: DCTTransformType): ptr DCTContext {.cdecl, 56 | importc: "av_dct_init", dynlib: avcodecdll.} 57 | proc av_dct_calc*(s: ptr DCTContext; data: ptr FFTSample) {.cdecl, 58 | importc: "av_dct_calc", dynlib: avcodecdll.} 59 | proc av_dct_end*(s: ptr DCTContext) {.cdecl, importc: "av_dct_end", dynlib: avcodecdll.} --------------------------------------------------------------------------------