[FFmpeg-cvslog] ffmpeg: allow switching to qatars buffersrc API

Michael Niedermayer git at videolan.org
Thu May 17 04:12:57 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May 17 00:10:47 2012 +0200| [6579bc439b98501efe14f9043f9582c4161a5209] | committer: Michael Niedermayer

ffmpeg: allow switching to qatars buffersrc API

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6579bc439b98501efe14f9043f9582c4161a5209
---

 ffmpeg.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 801ce2f..54ad2a3 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2639,7 +2639,11 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
         /* no picture yet */
         if (!pkt->size)
             for (i = 0; i < ist->nb_filters; i++)
+#ifdef SRCA
+                av_buffersrc_buffer(ist->filters[i]->filter, NULL);
+#else
                 av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
+#endif
         return ret;
     }
 
@@ -2703,11 +2707,17 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
 
             av_assert0(buf->refcount>0);
             buf->refcount++;
+#ifdef SRCA
+            av_buffersrc_buffer(ist->filters[i]->filter, fb);
+        } else
+        if(av_buffersrc_write_frame(ist->filters[i]->filter, decoded_frame)<0) {
+#else
             av_buffersrc_add_ref(ist->filters[i]->filter, fb,
                                  AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT |
                                  AV_BUFFERSRC_FLAG_NO_COPY);
         } else
         if(av_buffersrc_add_frame(ist->filters[i]->filter, decoded_frame, 0)<0) {
+#endif
             av_log(NULL, AV_LOG_FATAL, "Failed to inject frame into filter network\n");
             exit_program(1);
         }



More information about the ffmpeg-cvslog mailing list