From ec3e3fc2e8cb40e95470d323f2ba69197faea573 Mon Sep 17 00:00:00 2001 From: mashingan Date: Mon, 6 Jan 2020 14:48:15 +0700 Subject: [PATCH] restructure to nimble package; wip --- config.nims | 1 + examples/config.nims | 1 + examples/metadata.nim | 7 +++-- src/ffmpeg.nim | 3 +- src/ffmpeg/libavcodec/ac3_parser.nim | 11 ++++++-- src/ffmpeg/libavcodec/adts_parser.nim | 9 +++++- src/ffmpeg/libavcodec/avdct.nim | 28 ++++++++++++------- src/ffmpeg/libavcodec/avfft.nim | 40 +++++++++++++++++---------- src/ffmpeg/libavcodec/d3d11va.nim | 17 ++++++++++-- src/ffmpeg/libavcodec/dirac.nim | 40 ++++++++++++++++----------- src/ffmpeg/libavcodec/dv_profile.nim | 19 +++++++++---- src/ffmpeg/libavcodec/dxva2.nim | 17 +++++++++--- src/ffmpeg/libavcodec/jni.nim | 7 +++++ src/ffmpeg/libavcodec/mediacodec.nim | 27 +++++++++++------- src/ffmpeg/libavcodec/qsv.nim | 8 +++++- src/ffmpeg/libavcodec/vaapi.nim | 9 +++--- src/ffmpeg/libavcodec/vdpau.nim | 8 ++++++ tests/config.nims | 1 + 18 files changed, 177 insertions(+), 76 deletions(-) create mode 100644 config.nims create mode 100644 examples/config.nims create mode 100644 tests/config.nims diff --git a/config.nims b/config.nims new file mode 100644 index 0000000..f70ca80 --- /dev/null +++ b/config.nims @@ -0,0 +1 @@ +switch("passC", "$parentDir/cinclude") diff --git a/examples/config.nims b/examples/config.nims new file mode 100644 index 0000000..3bb69f8 --- /dev/null +++ b/examples/config.nims @@ -0,0 +1 @@ +switch("path", "$projectDir/../src") \ No newline at end of file diff --git a/examples/metadata.nim b/examples/metadata.nim index 1a3a92c..664a788 100644 --- a/examples/metadata.nim +++ b/examples/metadata.nim @@ -1,5 +1,6 @@ -import libavformat/avformat -import libavutil/[dict, log] +#import libavformat/avformat +#import libavutil/[dict, log] +import ffmpeg import os, strformat proc main = @@ -27,4 +28,4 @@ proc main = avformat_close_input(addr fmt) -main() \ No newline at end of file +main() diff --git a/src/ffmpeg.nim b/src/ffmpeg.nim index 6c298d9..637dfcc 100644 --- a/src/ffmpeg.nim +++ b/src/ffmpeg.nim @@ -1,7 +1,8 @@ import ffmpeg/utiltypes import ffmpeg/libavcodec/[avcodec, ac3_parser, adts_parser, avdct, avfft, d3d11va, dirac, dv_profile, dxva2, - jni, mediacodec, qsv, vaapi, vdpau, version, + #jni, mediacodec, qsv, vaapi, vdpau, version, + jni, mediacodec, vaapi, vdpau, version, videotoolbox, vorbis_parser, xvmc] import ffmpeg/libavdevice/avdevice diff --git a/src/ffmpeg/libavcodec/ac3_parser.nim b/src/ffmpeg/libavcodec/ac3_parser.nim index 3e99af7..9566249 100644 --- a/src/ffmpeg/libavcodec/ac3_parser.nim +++ b/src/ffmpeg/libavcodec/ac3_parser.nim @@ -24,5 +24,12 @@ ## Extract the bitstream ID and the frame size from AC-3 data. ## -proc av_ac3_parse_header*(buf: ptr uint8_t; size: csize; bitstream_id: ptr uint8_t; - frame_size: ptr uint16_t): cint \ No newline at end of file +when defined(windows): + {.push importc, dynlib: "avcodec(|-55|-56|-57|-58|-59).dll".} +elif defined(macosx): + {.push importc, dynlib: "avcodec(|.55|.56|.57|.58|.59).dylib".} +else:avcodec + {.push importc, dynlib: "avcodec.so(|.55|.56|.57|.58|.59)".} + +proc av_ac3_parse_header*(buf: ptr uint8; size: csize; bitstream_id: ptr uint8; + frame_size: ptr uint16): cint \ No newline at end of file diff --git a/src/ffmpeg/libavcodec/adts_parser.nim b/src/ffmpeg/libavcodec/adts_parser.nim index 77283e0..1dd62b2 100644 --- a/src/ffmpeg/libavcodec/adts_parser.nim +++ b/src/ffmpeg/libavcodec/adts_parser.nim @@ -27,4 +27,11 @@ const ## @return Returns 0 on success, error code on failure. ## -proc av_adts_header_parse*(buf: ptr uint8_t; samples: ptr uint32_t; frames: ptr uint8_t): cint \ No newline at end of file +when defined(windows): + {.push importc, dynlib: "avcodec(|-55|-56|-57|-58|-59).dll".} +elif defined(macosx): + {.push importc, dynlib: "avcodec(|.55|.56|.57|.58|.59).dylib".} +else:avcodec + {.push importc, dynlib: "avcodec.so(|.55|.56|.57|.58|.59)".} + +proc av_adts_header_parse*(buf: ptr uint8; samples: ptr uint32; frames: ptr uint8): cint \ No newline at end of file diff --git a/src/ffmpeg/libavcodec/avdct.nim b/src/ffmpeg/libavcodec/avdct.nim index 0b43eb8..46e7c20 100644 --- a/src/ffmpeg/libavcodec/avdct.nim +++ b/src/ffmpeg/libavcodec/avdct.nim @@ -17,7 +17,7 @@ ## import - libavutil/opt + ../utiltypes ## * ## AVDCT context. @@ -25,11 +25,12 @@ import ## disabled at build time. ## +{.pragma: avdct, importc, header:"".} + type - AVDCT* {.bycopy.} = object + AVDCT* {.avdct.} = object av_class*: ptr AVClass - idct*: proc (block: ptr int16_t) ## * - ## IDCT input permutation. + idct*: proc (`block`: ptr int16) ## IDCT input permutation. ## Several optimized IDCTs need a permutated input (relative to the ## normal order of the reference IDCT). ## This permutation must be performed before the idct_put/add. @@ -42,9 +43,9 @@ type ## - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant ## -> simple_idct_mmx -> ...) ## - ## align 16 - idct_permutation*: array[64, uint8_t] - fdct*: proc (block: ptr int16_t) ## * + ## align 16 + idct_permutation*: array[64, uint8] + fdct*: proc (`block`: ptr int16) ## * ## DCT algorithm. ## must use AVOptions to set this field. ## @@ -54,9 +55,9 @@ type ## must use AVOptions to set this field. ## idct_algo*: cint - get_pixels*: proc (block: ptr int16_t; ## align 16 - pixels: ptr uint8_t; ## align 8 - line_size: ptrdiff_t) + get_pixels*: proc (`block`: ptr int16; ## align 16 + pixels: ptr uint8; ## align 8 + line_size: csize) bits_per_sample*: cint @@ -68,6 +69,13 @@ type ## To free it use av_free() ## +when defined(windows): + {.push importc, dynlib: "avcodec(|-55|-56|-57|-58|-59).dll".} +elif defined(macosx): + {.push importc, dynlib: "avcodec(|.55|.56|.57|.58|.59).dylib".} +else:avcodec + {.push importc, dynlib: "avcodec.so(|.55|.56|.57|.58|.59)".} + proc avcodec_dct_alloc*(): ptr AVDCT proc avcodec_dct_init*(a1: ptr AVDCT): cint proc avcodec_dct_get_class*(): ptr AVClass \ No newline at end of file diff --git a/src/ffmpeg/libavcodec/avfft.nim b/src/ffmpeg/libavcodec/avfft.nim index bc71018..00c2063 100644 --- a/src/ffmpeg/libavcodec/avfft.nim +++ b/src/ffmpeg/libavcodec/avfft.nim @@ -28,12 +28,36 @@ ## @{ ## +{.pragma: avfft, importc, header:"".} + type + FFTContext* {.avfft.} = object FFTSample* = cfloat - FFTComplex* {.bycopy.} = object + FFTComplex* {.avfft.} = object re*: FFTSample im*: FFTSample +## Real Discrete Fourier Transform + +type + RDFTContext* {.avfft.} = object + RDFTransformType* = enum + DFT_R2C, IDFT_C2R, IDFT_R2C, DFT_C2R + +## Discrete Cosine Transform + +type + DCTContext* {.avfft.} = object + DCTTransformType* = enum + DCT_II = 0, DCT_III, DCT_I, DST_I + + +when defined(windows): + {.push importc, dynlib: "avcodec(|-55|-56|-57|-58|-59).dll".} +elif defined(macosx): + {.push importc, dynlib: "avcodec(|.55|.56|.57|.58|.59).dylib".} +else:avcodec + {.push importc, dynlib: "avcodec.so(|.55|.56|.57|.58|.59)".} ## * ## Set up a complex FFT. @@ -59,12 +83,6 @@ proc av_imdct_calc*(s: ptr FFTContext; output: ptr FFTSample; input: ptr FFTSamp proc av_imdct_half*(s: ptr FFTContext; output: ptr FFTSample; input: ptr FFTSample) proc av_mdct_calc*(s: ptr FFTContext; output: ptr FFTSample; input: ptr FFTSample) proc av_mdct_end*(s: ptr FFTContext) -## Real Discrete Fourier Transform - -type - RDFTransformType* = enum - DFT_R2C, IDFT_C2R, IDFT_R2C, DFT_C2R - ## * @@ -76,12 +94,6 @@ type proc av_rdft_init*(nbits: cint; trans: RDFTransformType): ptr RDFTContext proc av_rdft_calc*(s: ptr RDFTContext; data: ptr FFTSample) proc av_rdft_end*(s: ptr RDFTContext) -## Discrete Cosine Transform - -type - DCTTransformType* = enum - DCT_II = 0, DCT_III, DCT_I, DST_I - ## * ## Set up DCT. @@ -94,7 +106,7 @@ type ## @note the first element of the input of DST-I is ignored ## -proc av_dct_init*(nbits: cint; type: DCTTransformType): ptr DCTContext +proc av_dct_init*(nbits: cint; `type`: DCTTransformType): ptr DCTContext proc av_dct_calc*(s: ptr DCTContext; data: ptr FFTSample) proc av_dct_end*(s: ptr DCTContext) ## * diff --git a/src/ffmpeg/libavcodec/d3d11va.nim b/src/ffmpeg/libavcodec/d3d11va.nim index 49d8854..e7db4ed 100644 --- a/src/ffmpeg/libavcodec/d3d11va.nim +++ b/src/ffmpeg/libavcodec/d3d11va.nim @@ -27,9 +27,13 @@ ## Public libavcodec D3D11VA header. ## -when not defined(_WIN32_WINNT) or _WIN32_WINNT < 0x00000602: +when defined(windows): + import winlean + {.pragma: d3d11, importc, header: "".} + +when not defined(WIN32_WINNT):# or WIN32_WINNT < 0x00000602: const - _WIN32_WINNT* = 0x00000602 + WIN32_WINNT* = 0x00000602 ## * ## @defgroup lavc_codec_hwaccel_d3d11va Direct3D11 ## @ingroup lavc_codec_hwaccel @@ -50,6 +54,12 @@ const ## Use av_d3d11va_alloc_context() exclusively to allocate an AVD3D11VAContext. ## +type + ID3D11VideoContext* {.d3d11.} = object + ID3D11VideoDecoder* {.d3d11.} = object + D3D11_VIDEO_DECODER_CONFIG* {.d3d11.} = object + ID3D11VideoDecoderOutputView* {.d3d11.} = object + type AVD3D11VAContext* {.bycopy.} = object decoder*: ptr ID3D11VideoDecoder ## * @@ -70,7 +80,7 @@ type surface*: ptr ptr ID3D11VideoDecoderOutputView ## * ## A bit field configuring the workarounds needed for using the decoder ## - workaround*: uint64_t ## * + workaround*: uint64 ## * ## Private to the FFmpeg AVHWAccel implementation ## report_id*: cuint ## * @@ -86,6 +96,7 @@ type ## proc av_d3d11va_alloc_context*(): ptr AVD3D11VAContext + {.importc, dynlib: "d3d11.dll".} ## * ## @} ## diff --git a/src/ffmpeg/libavcodec/dirac.nim b/src/ffmpeg/libavcodec/dirac.nim index 17df963..29ae879 100644 --- a/src/ffmpeg/libavcodec/dirac.nim +++ b/src/ffmpeg/libavcodec/dirac.nim @@ -28,8 +28,9 @@ ## @author Jordi Ortiz ## -import - avcodec +#import avcodec +import ../libavutil/rational +import ../libavutil/pixfmt ## * ## The spec limits the number of wavelet decompositions to 4 for both @@ -67,26 +68,27 @@ type DIRAC_PCODE_INTRA_REF_PICT = 0x000000CC, DIRAC_PCODE_PICTURE_HQ = 0x000000E8, DIRAC_PCODE_MAGIC = 0x42424344 +{.pragma: dirac, importc, header: "".} type - DiracVersionInfo* {.bycopy.} = object + DiracVersionInfo* {.dirac.} = object major*: cint minor*: cint - AVDiracSeqHeader* {.bycopy.} = object + AVDiracSeqHeader* {.dirac.} = object width*: cuint height*: cuint - chroma_format*: uint8_t ## /< 0: 444 1: 422 2: 420 - interlaced*: uint8_t - top_field_first*: uint8_t - frame_rate_index*: uint8_t ## /< index into dirac_frame_rate[] - aspect_ratio_index*: uint8_t ## /< index into dirac_aspect_ratio[] - clean_width*: uint16_t - clean_height*: uint16_t - clean_left_offset*: uint16_t - clean_right_offset*: uint16_t - pixel_range_index*: uint8_t ## /< index into dirac_pixel_range_presets[] - color_spec_index*: uint8_t ## /< index into dirac_color_spec_presets[] + chroma_format*: uint8 ## /< 0: 444 1: 422 2: 420 + interlaced*: uint8 + top_field_first*: uint8 + frame_rate_index*: uint8 ## /< index into dirac_frame_rate[] + aspect_ratio_index*: uint8 ## /< index into dirac_aspect_ratio[] + clean_width*: uint16 + clean_height*: uint16 + clean_left_offset*: uint16 + clean_right_offset*: uint16 + pixel_range_index*: uint8 ## /< index into dirac_pixel_range_presets[] + color_spec_index*: uint8 ## /< index into dirac_color_spec_presets[] profile*: cint level*: cint framerate*: AVRational @@ -99,6 +101,12 @@ type version*: DiracVersionInfo bit_depth*: cint +when defined(windows): + {.push importc, dynlib: "avcodec(|-55|-56|-57|-58|-59).dll".} +elif defined(macosx): + {.push importc, dynlib: "avcodec(|.55|.56|.57|.58|.59).dylib".} +else:avcodec + {.push importc, dynlib: "avcodec.so(|.55|.56|.57|.58|.59)".} ## * ## Parse a Dirac sequence header. @@ -112,5 +120,5 @@ type ## @return 0 on success, a negative AVERROR code on failure ## -proc av_dirac_parse_sequence_header*(dsh: ptr ptr AVDiracSeqHeader; buf: ptr uint8_t; +proc av_dirac_parse_sequence_header*(dsh: ptr ptr AVDiracSeqHeader; buf: ptr uint8; buf_size: csize; log_ctx: pointer): cint \ No newline at end of file diff --git a/src/ffmpeg/libavcodec/dv_profile.nim b/src/ffmpeg/libavcodec/dv_profile.nim index 9db780b..301e892 100644 --- a/src/ffmpeg/libavcodec/dv_profile.nim +++ b/src/ffmpeg/libavcodec/dv_profile.nim @@ -16,8 +16,8 @@ ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -import - libavutil/pixfmt, libavutil/rational, avcodec +import ../libavutil/pixfmt +import ../libavutil/rational ## minimum number of bytes to read from a DV stream in order to ## determine the profile @@ -33,7 +33,7 @@ const ## type - AVDVProfile* {.bycopy.} = object + AVDVProfile* {.importc, header: "".} = object dsf*: cint ## value of the dsf in the DV header video_stype*: cint ## stype for VAUX source pack frame_size*: cint ## total size of one frame in bytes @@ -46,15 +46,22 @@ type sar*: array[2, AVRational] ## sample aspect ratios for 4:3 and 16:9 pix_fmt*: AVPixelFormat ## picture pixel format bpm*: cint ## blocks per macroblock - block_sizes*: ptr uint8_t ## AC block sizes, in bits + block_sizes*: ptr uint8 ## AC block sizes, in bits audio_stride*: cint ## size of audio_shuffle table audio_min_samples*: array[3, cint] ## min amount of audio samples ## for 48kHz, 44.1kHz and 32kHz audio_samples_dist*: array[5, cint] ## how many samples are supposed to be ## in each frame in a 5 frames window - audio_shuffle*: array[9, uint8_t] ## PCM shuffling table + audio_shuffle*: array[9, uint8] ## PCM shuffling table +when defined(windows): + {.push importc, dynlib: "avcodec(|-55|-56|-57|-58|-59).dll".} +elif defined(macosx): + {.push importc, dynlib: "avcodec(|.55|.56|.57|.58|.59).dylib".} +else:avcodec + {.push importc, dynlib: "avcodec.so(|.55|.56|.57|.58|.59)".} + ## * ## Get a DV profile for the provided compressed frame. ## @@ -64,7 +71,7 @@ type ## @return the DV profile for the supplied data or NULL on failure ## -proc av_dv_frame_profile*(sys: ptr AVDVProfile; frame: ptr uint8_t; buf_size: cuint): ptr AVDVProfile +proc av_dv_frame_profile*(sys: ptr AVDVProfile; frame: ptr uint8; buf_size: cuint): ptr AVDVProfile ## * ## Get a DV profile for the provided stream parameters. ## diff --git a/src/ffmpeg/libavcodec/dxva2.nim b/src/ffmpeg/libavcodec/dxva2.nim index 75edc23..2f53df2 100644 --- a/src/ffmpeg/libavcodec/dxva2.nim +++ b/src/ffmpeg/libavcodec/dxva2.nim @@ -26,9 +26,12 @@ ## Public libavcodec DXVA2 header. ## -when not defined(_WIN32_WINNT) or _WIN32_WINNT < 0x00000602: +when defined(windows): + {.pragma: dxva2, importc, header: "".} + +when not defined(WIN32_WINNT): const - _WIN32_WINNT* = 0x00000602 + WIN32_WINNT* = 0x00000602 ## * ## @defgroup lavc_codec_hwaccel_dxva2 DXVA2 ## @ingroup lavc_codec_hwaccel @@ -48,7 +51,13 @@ const ## type - dxva_context* {.bycopy.} = object + IDirectXVideoDecoder* {.dxva2.} = object + DXVA2_ConfigPictureDecode* {.dxva2.} = object + IDirect3DSurface9* {.importc, header: "".} = object + LPDIRECT3DSURFACE9* = ptr IDirect3DSurface9 + +type + dxva_context* {.importc, header: "".} = object decoder*: ptr IDirectXVideoDecoder ## * ## DXVA2 decoder object ## @@ -64,7 +73,7 @@ type surface*: ptr LPDIRECT3DSURFACE9 ## * ## A bit field configuring the workarounds needed for using the decoder ## - workaround*: uint64_t ## * + workaround*: uint64 ## * ## Private to the FFmpeg AVHWAccel implementation ## report_id*: cuint diff --git a/src/ffmpeg/libavcodec/jni.nim b/src/ffmpeg/libavcodec/jni.nim index 7bd7136..90e475e 100644 --- a/src/ffmpeg/libavcodec/jni.nim +++ b/src/ffmpeg/libavcodec/jni.nim @@ -20,6 +20,13 @@ ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## +when defined(windows): + {.push importc, dynlib: "avcodec(|-55|-56|-57|-58|-59).dll".} +elif defined(macosx): + {.push importc, dynlib: "avcodec(|.55|.56|.57|.58|.59).dylib".} +else:avcodec + {.push importc, dynlib: "avcodec.so(|.55|.56|.57|.58|.59)".} + ## ## Manually set a Java virtual machine which will be used to retrieve the JNI ## environment. Once a Java VM is set it cannot be changed afterwards, meaning diff --git a/src/ffmpeg/libavcodec/mediacodec.nim b/src/ffmpeg/libavcodec/mediacodec.nim index 4c7d150..7471bec 100644 --- a/src/ffmpeg/libavcodec/mediacodec.nim +++ b/src/ffmpeg/libavcodec/mediacodec.nim @@ -20,22 +20,35 @@ ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -import - libavcodec/avcodec +import ../utiltypes ## * ## This structure holds a reference to a android/view/Surface object that will ## be used as output by the decoder. ## ## +{.pragma: meddec, importc, header: "".} type - AVMediaCodecContext* {.bycopy.} = object + AVMediaCodecContext* {.meddec.} = object surface*: pointer ## * ## android/view/Surface object reference. ## +## * +## Opaque structure representing a MediaCodec buffer to render. +## + +type + MediaCodecBuffer* {.meddec.} = object + AVMediaCodecBuffer* = MediaCodecBuffer +when defined(windows): + {.push importc, dynlib: "avcodec(|-55|-56|-57|-58|-59).dll".} +elif defined(macosx): + {.push importc, dynlib: "avcodec(|.55|.56|.57|.58|.59).dylib".} +else:avcodec + {.push importc, dynlib: "avcodec.so(|.55|.56|.57|.58|.59)".} ## * ## Allocate and initialize a MediaCodec context. ## @@ -65,12 +78,6 @@ proc av_mediacodec_default_init*(avctx: ptr AVCodecContext; ## proc av_mediacodec_default_free*(avctx: ptr AVCodecContext) -## * -## Opaque structure representing a MediaCodec buffer to render. -## - -type - AVMediaCodecBuffer* = MediaCodecBuffer ## * ## Release a MediaCodec buffer and render it to the surface that is associated @@ -98,4 +105,4 @@ proc av_mediacodec_release_buffer*(buffer: ptr AVMediaCodecBuffer; render: cint) ## proc av_mediacodec_render_buffer_at_time*(buffer: ptr AVMediaCodecBuffer; - time: int64_t): cint \ No newline at end of file + time: int64): cint \ No newline at end of file diff --git a/src/ffmpeg/libavcodec/qsv.nim b/src/ffmpeg/libavcodec/qsv.nim index b2cbb5d..ac6c19b 100644 --- a/src/ffmpeg/libavcodec/qsv.nim +++ b/src/ffmpeg/libavcodec/qsv.nim @@ -19,7 +19,7 @@ ## import - libavutil/buffer + ../libavutil/buffer ## * ## This struct is used for communicating QSV parameters between libavcodec and @@ -89,4 +89,10 @@ type ## It must be freed by the caller with av_free(). ## +when defined(windows): + {.push importc, dynlib: "avcodec(|-55|-56|-57|-58|-59).dll".} +elif defined(macosx): + {.push importc, dynlib: "avcodec(|.55|.56|.57|.58|.59).dylib".} +else:avcodec + {.push importc, dynlib: "avcodec.so(|.55|.56|.57|.58|.59)".} proc av_qsv_alloc_context*(): ptr AVQSVContext \ No newline at end of file diff --git a/src/ffmpeg/libavcodec/vaapi.nim b/src/ffmpeg/libavcodec/vaapi.nim index 393d776..585fb47 100644 --- a/src/ffmpeg/libavcodec/vaapi.nim +++ b/src/ffmpeg/libavcodec/vaapi.nim @@ -27,8 +27,7 @@ ## Public libavcodec VA API header. ## -import - libavutil/attributes, version +import version when FF_API_STRUCT_VAAPI_CONTEXT: ## * @@ -49,7 +48,7 @@ when FF_API_STRUCT_VAAPI_CONTEXT: ## ## struct attribute_deprecated vaapi_context { type - vaapi_context* {.bycopy.} = object + vaapi_context* {.importc, header: "".} = object display*: pointer ## * ## Window system dependent data ## @@ -62,12 +61,12 @@ when FF_API_STRUCT_VAAPI_CONTEXT: ## - encoding: unused ## - decoding: Set by user ## - config_id*: uint32_t ## * + config_id*: uint32 ## * ## Context ID (video decode pipeline) ## ## - encoding: unused ## - decoding: Set by user ## - context_id*: uint32_t + context_id*: uint32 ## @} \ No newline at end of file diff --git a/src/ffmpeg/libavcodec/vdpau.nim b/src/ffmpeg/libavcodec/vdpau.nim index e41923e..2731d2f 100644 --- a/src/ffmpeg/libavcodec/vdpau.nim +++ b/src/ffmpeg/libavcodec/vdpau.nim @@ -48,6 +48,14 @@ import ../utiltypes, version +type + VdpPictureInfo* {.importc, header: "".} = object + VdpBitStreamBuffer* {.importc, header: "".} = object + VdpDevice* {.importc, header: "".} = object + VdpGetProcAddress* {.importc, header: "".} = object + VdpChromaType* {.importc, header: "".} = object + VdpDecoderProfile* {.importc, header: "".} = object + type AVVDPAU_Render2* = proc (a1: ptr AVCodecContext; a2: ptr AVFrame; a3: ptr VdpPictureInfo; a4: uint32; diff --git a/tests/config.nims b/tests/config.nims new file mode 100644 index 0000000..3bb69f8 --- /dev/null +++ b/tests/config.nims @@ -0,0 +1 @@ +switch("path", "$projectDir/../src") \ No newline at end of file