]> git.sesse.net Git - ffmpeg/blobdiff - doc/tablegen.txt
avformat/dashenc: Added option for Segment file format
[ffmpeg] / doc / tablegen.txt
index 8dfcd7d354d7cad9cea1b8b5bad2abbebc82c37b..4c4f036e6a76eab3f059c5880e6d6ea9522f3de8 100644 (file)
@@ -12,6 +12,7 @@ the tables as a header file using the tableprint.h helpers.
 Both of these files will be compiled for the host system, so to avoid
 breakage with cross-compilation neither of them may include, directly
 or indirectly, config.h or avconfig.h.
+This means that e.g. libavutil/mathematics.h is ok but libavutil/libm.h is not.
 Due to this, the .c file or Makefile may have to provide additional defines
 or stubs, though if possible this should be avoided.
 In particular, CONFIG_HARDCODED_TABLES should always be defined to 0.
@@ -27,9 +28,14 @@ them.
 The printing code typically looks like this:
     write_fileheader();
     printf("static const uint8_t my_array[100] = {\n");
-    write_uint8_array(my_array, 100);
+    write_uint8_t_array(my_array, 100);
     printf("};\n");
 
+This is the more generic form, in case you need to do something special.
+Usually you should instead use the short form:
+    write_fileheader();
+    WRITE_ARRAY("static const", uint8_t, my_array);
+
 write_fileheader() adds some minor things like a "this is a generated file"
 comment and some standard includes.
 tablegen.h defines some write functions for one- and two-dimensional arrays