Browse code

vidstab*: Remove accidentally exported av_2_vs_pixel_format()

Also correctly namespace other functions in vidstabutils, and decrease
difference from Libav.

Initial-patch-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Timothy Gu authored on 2014/08/22 11:12:09
Showing 4 changed files
... ...
@@ -63,7 +63,7 @@ AVFILTER_DEFINE_CLASS(vidstabdetect);
63 63
 static av_cold int init(AVFilterContext *ctx)
64 64
 {
65 65
     StabData *sd = ctx->priv;
66
-    vs_set_mem_and_log_functions();
66
+    ff_vs_init();
67 67
     sd->class = &vidstabdetect_class;
68 68
     av_log(ctx, AV_LOG_VERBOSE, "vidstabdetect filter: init %s\n", LIBVIDSTAB_VERSION);
69 69
     return 0;
... ...
@@ -106,7 +106,8 @@ static int config_input(AVFilterLink *inlink)
106 106
     VSFrameInfo fi;
107 107
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
108 108
 
109
-    vsFrameInfoInit(&fi, inlink->w, inlink->h, av_2_vs_pixel_format(ctx, inlink->format));
109
+    vsFrameInfoInit(&fi, inlink->w, inlink->h,
110
+                    ff_av2vs_pixfmt(ctx, inlink->format));
110 111
     if (fi.bytesPerPixel != av_get_bits_per_pixel(desc)/8) {
111 112
         av_log(ctx, AV_LOG_ERROR, "pixel-format error: wrong bits/per/pixel, please report a BUG");
112 113
         return AVERROR(EINVAL);
... ...
@@ -107,7 +107,7 @@ AVFILTER_DEFINE_CLASS(vidstabtransform);
107 107
 static av_cold int init(AVFilterContext *ctx)
108 108
 {
109 109
     TransformContext *tc = ctx->priv;
110
-    vs_set_mem_and_log_functions();
110
+    ff_vs_init();
111 111
     tc->class = &vidstabtransform_class;
112 112
     av_log(ctx, AV_LOG_VERBOSE, "vidstabtransform filter: init %s\n", LIBVIDSTAB_VERSION);
113 113
     return 0;
... ...
@@ -151,9 +151,9 @@ static int config_input(AVFilterLink *inlink)
151 151
     VSFrameInfo fi_dest;
152 152
 
153 153
     if (!vsFrameInfoInit(&fi_src, inlink->w, inlink->h,
154
-                         av_2_vs_pixel_format(ctx, inlink->format)) ||
154
+                         ff_av2vs_pixfmt(ctx, inlink->format)) ||
155 155
         !vsFrameInfoInit(&fi_dest, inlink->w, inlink->h,
156
-                         av_2_vs_pixel_format(ctx, inlink->format))) {
156
+                         ff_av2vs_pixfmt(ctx, inlink->format))) {
157 157
         av_log(ctx, AV_LOG_ERROR, "unknown pixel format: %i (%s)",
158 158
                inlink->format, desc->name);
159 159
         return AVERROR(EINVAL);
... ...
@@ -21,7 +21,7 @@
21 21
 #include "vidstabutils.h"
22 22
 
23 23
 /** convert AV's pixelformat to vid.stab pixelformat */
24
-VSPixelFormat av_2_vs_pixel_format(AVFilterContext *ctx, enum AVPixelFormat pf)
24
+VSPixelFormat ff_av2vs_pixfmt(AVFilterContext *ctx, enum AVPixelFormat pf)
25 25
 {
26 26
     switch (pf) {
27 27
     case AV_PIX_FMT_YUV420P:  return PF_YUV420P;
... ...
@@ -47,7 +47,7 @@ typedef struct {
47 47
 } VS2AVLogCtx;
48 48
 
49 49
 /** wrapper to log vs_log into av_log */
50
-static int vs_2_av_log_wrapper(int type, const char *tag, const char *format, ...)
50
+static int vs2av_log(int type, const char *tag, const char *format, ...)
51 51
 {
52 52
     va_list ap;
53 53
     VS2AVLogCtx ctx;
... ...
@@ -66,7 +66,7 @@ static int vs_2_av_log_wrapper(int type, const char *tag, const char *format, ..
66 66
 }
67 67
 
68 68
 /** sets the memory allocation function and logging constants to av versions */
69
-void vs_set_mem_and_log_functions(void)
69
+void ff_vs_init(void)
70 70
 {
71 71
     vs_malloc  = av_malloc;
72 72
     vs_zalloc  = av_mallocz;
... ...
@@ -78,7 +78,7 @@ void vs_set_mem_and_log_functions(void)
78 78
     VS_INFO_TYPE  = AV_LOG_INFO;
79 79
     VS_MSG_TYPE   = AV_LOG_VERBOSE;
80 80
 
81
-    vs_log   = vs_2_av_log_wrapper;
81
+    vs_log   = vs2av_log;
82 82
 
83 83
     VS_ERROR = 0;
84 84
     VS_OK    = 1;
... ...
@@ -28,9 +28,9 @@
28 28
 /* ** some conversions from avlib to vid.stab constants and functions *** */
29 29
 
30 30
 /** converts the pixelformat of avlib into the one of the vid.stab library */
31
-VSPixelFormat av_2_vs_pixel_format(AVFilterContext *ctx, enum AVPixelFormat pf);
31
+VSPixelFormat ff_av2vs_pixfmt(AVFilterContext *ctx, enum AVPixelFormat pf);
32 32
 
33 33
 /** sets the memory allocation function and logging constants to av versions */
34
-void vs_set_mem_and_log_functions(void);
34
+void ff_vs_init(void);
35 35
 
36 36
 #endif