[FFmpeg-soc] [soc]: r2030 - libavfilter/diffs/04_ffmpeg_filters.diff
vitor
subversion at mplayerhq.hu
Mon Mar 24 20:20:15 CET 2008
Author: vitor
Date: Mon Mar 24 20:20:14 2008
New Revision: 2030
Log:
Reduce ffmpeg.c dependance in avfilter_vf_graph
Modified:
libavfilter/diffs/04_ffmpeg_filters.diff
Modified: libavfilter/diffs/04_ffmpeg_filters.diff
==============================================================================
--- libavfilter/diffs/04_ffmpeg_filters.diff (original)
+++ libavfilter/diffs/04_ffmpeg_filters.diff Mon Mar 24 20:20:14 2008
@@ -1,6 +1,6 @@
Index: ffmpeg.c
===================================================================
---- ffmpeg.c (revision 11963)
+--- ffmpeg.c (revision 12379)
+++ ffmpeg.c (working copy)
@@ -36,6 +36,11 @@
#include "avstring.h"
@@ -14,7 +14,7 @@ Index: ffmpeg.c
#if !defined(HAVE_GETRUSAGE) && defined(HAVE_GETPROCESSTIMES)
#include <windows.h>
#endif
-@@ -139,6 +144,9 @@
+@@ -135,6 +140,9 @@
static int loop_input = 0;
static int loop_output = AVFMT_NOOUTPUTLOOP;
static int qp_hist = 0;
@@ -24,7 +24,7 @@ Index: ffmpeg.c
static int intra_only = 0;
static int audio_sample_rate = 44100;
-@@ -277,6 +285,13 @@
+@@ -273,6 +281,13 @@
is not defined */
int64_t pts; /* current pts */
int is_start; /* is 1 at the start and after a discontinuity */
@@ -38,7 +38,7 @@ Index: ffmpeg.c
} AVInputStream;
typedef struct AVInputFile {
-@@ -292,6 +307,269 @@
+@@ -288,6 +303,260 @@
static struct termios oldtty;
#endif
@@ -207,8 +207,6 @@ Index: ffmpeg.c
+static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
+{
+ AVFilterContext *curr_filter;
-+ /** filter graph containing the user specified filters */
-+ AVFilterContext *filt_graph;
+ /** filter graph containing all filters including input & output */
+ AVFilterContext *filt_graph_all;
+ AVCodecContext *codec = ost->st->codec;
@@ -277,16 +275,9 @@ Index: ffmpeg.c
+ }
+
+ if(vfilters) {
-+ if(!(filt_graph = avfilter_open(avfilter_get_by_name("graph"), NULL)))
-+ return -1;
-+ if(avfilter_init_filter(filt_graph, vfilters, NULL))
-+ return -1;
-+ if(avfilter_link(curr_filter, 0, filt_graph, 0))
-+ return -1;
-+ if(avfilter_link(filt_graph, 0, ist->out_video_filter, 0))
-+ return -1;
-+
-+ avfilter_graph_add_filter(filt_graph_all, filt_graph);
++ graph_load_from_desc3(filt_graph_all,
++ avfilter_graph_parse_chain(vfilters),
++ curr_filter, 0, ist->out_video_filter, 0);
+ } else {
+ if(avfilter_link(curr_filter, 0, ist->out_video_filter, 0) < 0)
+ return -1;
@@ -308,7 +299,7 @@ Index: ffmpeg.c
static void term_exit(void)
{
#ifdef HAVE_TERMIOS_H
-@@ -754,6 +1032,9 @@
+@@ -754,6 +1023,9 @@
if (nb_frames <= 0)
return;
@@ -318,7 +309,7 @@ Index: ffmpeg.c
if (ost->video_crop) {
if (av_picture_crop((AVPicture *)&picture_crop_temp, (AVPicture *)in_picture, dec->pix_fmt, ost->topBand, ost->leftBand) < 0) {
av_log(NULL, AV_LOG_ERROR, "error cropping picture\n");
-@@ -763,6 +1044,7 @@
+@@ -763,6 +1035,7 @@
} else {
formatted_picture = in_picture;
}
@@ -326,7 +317,7 @@ Index: ffmpeg.c
final_picture = formatted_picture;
padding_src = formatted_picture;
-@@ -778,12 +1060,14 @@
+@@ -778,12 +1051,14 @@
}
}
@@ -341,7 +332,7 @@ Index: ffmpeg.c
if (ost->video_pad) {
av_picture_pad((AVPicture*)final_picture, (AVPicture *)padding_src,
-@@ -1163,6 +1447,17 @@
+@@ -1165,6 +1440,17 @@
&buffer_to_free);
}
@@ -359,7 +350,7 @@ Index: ffmpeg.c
// preprocess audio (volume)
if (ist->st->codec->codec_type == CODEC_TYPE_AUDIO) {
if (audio_volume != 256) {
-@@ -1225,10 +1520,23 @@
+@@ -1227,10 +1513,23 @@
do_audio_out(os, ost, ist, data_buf, data_size);
break;
case CODEC_TYPE_VIDEO:
@@ -383,7 +374,7 @@ Index: ffmpeg.c
break;
case CODEC_TYPE_SUBTITLE:
do_subtitle_out(os, ost, ist, &subtitle,
-@@ -1689,10 +1997,21 @@
+@@ -1693,10 +1992,21 @@
fprintf(stderr, "Cannot get resampling context\n");
exit(1);
}
@@ -405,7 +396,7 @@ Index: ffmpeg.c
break;
case CODEC_TYPE_SUBTITLE:
ost->encoding_needed = 1;
-@@ -3803,6 +4122,9 @@
+@@ -3804,6 +4114,9 @@
#ifdef CONFIG_VHOOK
{ "vhook", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)add_frame_hooker}, "insert video processing module", "module" },
#endif
More information about the FFmpeg-soc
mailing list