Browse code

Implement avfilter_graph_alloc().

Originally committed as revision 25673 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini authored on 2010/11/05 05:34:19
Showing 6 changed files
... ...
@@ -13,6 +13,9 @@ libavutil:   2009-03-08
13 13
 
14 14
 API changes, most recent first:
15 15
 
16
+2010-11-04 - r25672 - lavfi 1.55.0 - avfilter_graph_alloc()
17
+  Add avfilter_graph_alloc() to libavfilter/avfiltergraph.h.
18
+
16 19
 2010-11-02 - r25654 - lavcore 0.12.0 - av_get_bits_per_sample_fmt()
17 20
   Add av_get_bits_per_sample_fmt() to libavcore/samplefmt.h and
18 21
   deprecate av_get_bits_per_sample_format().
... ...
@@ -345,7 +345,7 @@ static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
345 345
     char args[255];
346 346
     int ret;
347 347
 
348
-    graph = av_mallocz(sizeof(AVFilterGraph));
348
+    graph = avfilter_graph_alloc();
349 349
 
350 350
     if ((ret = avfilter_open(&ist->input_video_filter, avfilter_get_by_name("buffer"), "src")) < 0)
351 351
         return ret;
... ...
@@ -1795,7 +1795,7 @@ static int video_thread(void *arg)
1795 1795
     char sws_flags_str[128];
1796 1796
     FFSinkContext ffsink_ctx = { .pix_fmt = PIX_FMT_YUV420P };
1797 1797
     AVFilterContext *filt_src = NULL, *filt_out = NULL;
1798
-    AVFilterGraph *graph = av_mallocz(sizeof(AVFilterGraph));
1798
+    AVFilterGraph *graph = avfilter_graph_alloc();
1799 1799
     snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%d", sws_flags);
1800 1800
     graph->scale_sws_opts = av_strdup(sws_flags_str);
1801 1801
 
... ...
@@ -25,7 +25,7 @@
25 25
 #include "libavutil/avutil.h"
26 26
 
27 27
 #define LIBAVFILTER_VERSION_MAJOR  1
28
-#define LIBAVFILTER_VERSION_MINOR 54
28
+#define LIBAVFILTER_VERSION_MINOR 55
29 29
 #define LIBAVFILTER_VERSION_MICRO  0
30 30
 
31 31
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
... ...
@@ -26,6 +26,11 @@
26 26
 #include "avfilter.h"
27 27
 #include "avfiltergraph.h"
28 28
 
29
+AVFilterGraph *avfilter_graph_alloc(void)
30
+{
31
+    return av_mallocz(sizeof(AVFilterGraph));
32
+}
33
+
29 34
 void avfilter_graph_destroy(AVFilterGraph *graph)
30 35
 {
31 36
     for(; graph->filter_count > 0; graph->filter_count --)
... ...
@@ -32,6 +32,11 @@ typedef struct AVFilterGraph {
32 32
 } AVFilterGraph;
33 33
 
34 34
 /**
35
+ * Allocate a filter graph.
36
+ */
37
+AVFilterGraph *avfilter_graph_alloc(void);
38
+
39
+/**
35 40
  * Get a filter instance with name name from graph.
36 41
  *
37 42
  * @return the pointer to the found filter instance or NULL if it