00001 /* 00002 * Filter layer - default implementations 00003 * Copyright (c) 2007 Bobby Bingham 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #include "libavutil/avassert.h" 00023 #include "libavutil/audioconvert.h" 00024 #include "libavutil/imgutils.h" 00025 #include "libavutil/samplefmt.h" 00026 00027 #include "avfilter.h" 00028 #include "internal.h" 00029 #include "formats.h" 00030 00031 static void set_common_formats(AVFilterContext *ctx, AVFilterFormats *fmts, 00032 enum AVMediaType type, int offin, int offout) 00033 { 00034 int i; 00035 for (i = 0; i < ctx->input_count; i++) 00036 if (ctx->inputs[i] && ctx->inputs[i]->type == type) 00037 ff_formats_ref(fmts, (AVFilterFormats **)((uint8_t *)ctx->inputs[i]+offout)); 00038 00039 for (i = 0; i < ctx->output_count; i++) 00040 if (ctx->outputs[i] && ctx->outputs[i]->type == type) 00041 ff_formats_ref(fmts, (AVFilterFormats **)((uint8_t *)ctx->outputs[i]+offin)); 00042 00043 if (!fmts->refcount) { 00044 av_free(fmts->formats); 00045 av_free(fmts->refs); 00046 av_free(fmts); 00047 } 00048 }
1.5.8