Filter SDK/C API

From Avisynth wiki
Revision as of 17:13, 24 December 2016 by Admin (Talk | contribs)

Jump to: navigation, search

The header, avisynth_c.h, declares all the classes, structures and miscellaneous constants that you might need when writing a plugin. All external plugins should #include it:

#include "avisynth_c.h"

Contents

differences C and C++

perhaps put somewhere else.

CreateScriptEnvironment

Classes

See C++ API for descriptions. If there is no C++ API equivalent, the description is given here.

C++ API C API Description
C++ API C API
.. ..

AvisynthError doesn't exist AVS_FilterInfo VideoFrameBuffer AVS_VideoFrameBuffer VideoFrame AVS_VideoFrame AlignPlanar doesn't exist FillBorder doesn't exist ConvertAudio doesn't exist IScriptEnvironment AVS_ScriptEnvironment PVideoFrame - IClip AVS_Clip PClip - AVSValue AVS_Value

AVS_FilterInfo is a structure with members (the first three are structures too):

  • AVS_Clip (no members)
  • AVS_ScriptEnvironment (no members)
  • AVS_VideoFrame
  • get_parity
  • get_audio
  • set_cache_hints
  • free_filter
  • error
  • user_data

AVS_VideoFrame is a structure with members:

  • offset, pitch, row_size, height, offsetU, offsetV, pitchUV
  • row_sizeUV, heightUV

AVS_VideoInfo is a structure with members:

  • width, height
  • fps_numerator, fps_denominator
  • num_frames
  • pixel_type
  • audio_samples_per_second
  • sample_type
  • num_audio_samples
  • nchannels
  • image_type


AVS_Value is a structure with members:

  • type // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
              // for some function e'rror
  • array_size;
 union {
   void * clip; // do not use directly, use avs_take_clip
   char boolean;
   int integer;
   float floating_pt;
   const char * string;
   const AVS_Value * array;
 } d;


Structures

Constants


source: http://forum.doom9.org/showthread.php?p=1464911#post1464911

compiling plugins: http://forum.doom9.org/showthread.php?p=1092380#post1092380

example: http://forum.doom9.org/showthread.php?p=1001260#post1001260

For now the api is described here: http://www.kevina.org/avisynth_c/api.html . An example is given here: http://www.kevina.org/avisynth_c/example.html .

In v2.60 (AVISYNTH_INTERFACE_VERSION = 5) the following functions are added to the C interface:

 avs_is_yv24
 avs_is_yv16
 avs_is_yv12
 avs_is_yv411
 avs_is_y8
 avs_is_color_space
 avs_get_plane_width_subsampling
 avs_get_plane_height_subsampling
 avs_bits_per_pixel
 avs_bytes_from_pixels
 avs_row_size
 avs_bmp_size
 avs_get_row_size_p
 avs_get_height_p
Personal tools