Browse Source

Add functions to return library license and library configuration.

Originally committed as revision 20547 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diego Biurrun 15 years ago
parent
commit
c173693698

+ 1 - 0
configure

@@ -2794,6 +2794,7 @@ cat > $TMPH <<EOF
 #ifndef FFMPEG_CONFIG_H
 #define FFMPEG_CONFIG_H
 #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
+#define FFMPEG_LICENSE "$(c_escape $license)"
 #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
 #define CC_TYPE "$cc_type"
 #define CC_VERSION $cc_version

+ 10 - 0
libavcodec/avcodec.h

@@ -3066,6 +3066,16 @@ AVCodec *av_codec_next(AVCodec *c);
  */
 unsigned avcodec_version(void);
 
+/**
+ * Returns the libavcodec build-time configuration.
+ */
+const char * avcodec_configuration(void);
+
+/**
+ * Returns the libavcodec license.
+ */
+const char * avcodec_license(void);
+
 /**
  * Initializes libavcodec.
  *

+ 11 - 0
libavcodec/utils.c

@@ -905,6 +905,17 @@ unsigned avcodec_version( void )
   return LIBAVCODEC_VERSION_INT;
 }
 
+const char * avcodec_configuration(void)
+{
+    return FFMPEG_CONFIGURATION;
+}
+
+const char * avcodec_license(void)
+{
+#define LICENSE_PREFIX "libavcodec license: "
+    return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
+
 void avcodec_init(void)
 {
     static int initialized = 0;

+ 11 - 0
libavdevice/avdevice.c

@@ -22,3 +22,14 @@ unsigned avdevice_version(void)
 {
     return LIBAVDEVICE_VERSION_INT;
 }
+
+const char * avdevice_configuration(void)
+{
+    return FFMPEG_CONFIGURATION;
+}
+
+const char * avdevice_license(void)
+{
+#define LICENSE_PREFIX "libavdevice license: "
+    return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}

+ 10 - 0
libavdevice/avdevice.h

@@ -38,6 +38,16 @@
  */
 unsigned avdevice_version(void);
 
+/**
+ * Returns the libavdevice build-time configuration.
+ */
+const char * avdevice_configuration(void);
+
+/**
+ * Returns the libavdevice license.
+ */
+const char * avdevice_license(void);
+
 /**
  * Initialize libavdevice and register all the input and output devices.
  * @warning This function is not thread safe.

+ 11 - 0
libavfilter/avfilter.c

@@ -28,6 +28,17 @@ unsigned avfilter_version(void) {
     return LIBAVFILTER_VERSION_INT;
 }
 
+const char * avfilter_configuration(void)
+{
+    return FFMPEG_CONFIGURATION;
+}
+
+const char * avfilter_license(void)
+{
+#define LICENSE_PREFIX "libavfilter license: "
+    return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
+
 /** helper macros to get the in/out pad on the dst/src filter */
 #define link_dpad(link)     link->dst-> input_pads[link->dstpad]
 #define link_spad(link)     link->src->output_pads[link->srcpad]

+ 11 - 0
libavfilter/avfilter.h

@@ -44,6 +44,17 @@
  */
 unsigned avfilter_version(void);
 
+/**
+ * Returns the libavfilter build-time configuration.
+ */
+const char * avfilter_configuration(void);
+
+/**
+ * Returns the libavfilter license.
+ */
+const char * avfilter_license(void);
+
+
 typedef struct AVFilterContext AVFilterContext;
 typedef struct AVFilterLink    AVFilterLink;
 typedef struct AVFilterPad     AVFilterPad;

+ 10 - 0
libavformat/avformat.h

@@ -40,6 +40,16 @@
  */
 unsigned avformat_version(void);
 
+/**
+ * Returns the libavformat build-time configuration.
+ */
+const char * avformat_configuration(void);
+
+/**
+ * Returns the libavformat license.
+ */
+const char * avformat_license(void);
+
 #include <time.h>
 #include <stdio.h>  /* FILE */
 #include "libavcodec/avcodec.h"

+ 11 - 0
libavformat/utils.c

@@ -41,6 +41,17 @@ unsigned avformat_version(void)
     return LIBAVFORMAT_VERSION_INT;
 }
 
+const char * avformat_configuration(void)
+{
+    return FFMPEG_CONFIGURATION;
+}
+
+const char * avformat_license(void)
+{
+#define LICENSE_PREFIX "libavformat license: "
+    return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
+
 /* fraction handling */
 
 /**

+ 10 - 0
libavutil/avutil.h

@@ -53,6 +53,16 @@
  */
 unsigned avutil_version(void);
 
+/**
+ * Returns the libavutil build-time configuration.
+ */
+const char * avutil_configuration(void);
+
+/**
+ * Returns the libavutil license.
+ */
+const char * avutil_license(void);
+
 #include "common.h"
 #include "mathematics.h"
 #include "rational.h"

Some files were not shown because too many files changed in this diff