[FFmpeg-soc] [soc]: r4716 - in afilters: Makefile.dummy avfilter.c avfilter.h defaults.c dummy.c

Benoit Fouet benoit.fouet at free.fr
Wed Jul 15 20:51:18 CEST 2009


kdub wrote :
> Author: kdub
> Date: Wed Jul 15 18:10:17 2009
> New Revision: 4716
>
> Log:
> Modifications to the avfilter.h to handle PCM format conversions
>
> Modified:
>    afilters/Makefile.dummy
>    afilters/avfilter.c
>    afilters/avfilter.h
>    afilters/defaults.c
>    afilters/dummy.c
>
> Modified: afilters/Makefile.dummy
> ==============================================================================
> --- afilters/Makefile.dummy	Tue Jul 14 10:22:53 2009	(r4715)
> +++ afilters/Makefile.dummy	Wed Jul 15 18:10:17 2009	(r4716)
> @@ -1,2 +1,2 @@
>  all:
> -	gcc dummy.c -o dummy -I./ffmpeg -lm ./ffmpeg/libavfilter/libavfilter.a ffmpeg/libavcodec/libavcodec.a  ffmpeg/libavformat/libavformat.a ffmpeg/libavutil/libavutil.a
> +	gcc dummy.c -o dummy -I./ffmpeg -I./ffmpeg/libavcodec -lm ./ffmpeg/libavfilter/libavfilter.a ffmpeg/libavcodec/libavcodec.a  ffmpeg/libavformat/libavformat.a ffmpeg/libavutil/libavutil.a
>
>   

is this really needed ? I see you always include files with their
relative path to ffmpeg root

> Modified: afilters/avfilter.c
> ==============================================================================
> --- afilters/avfilter.c	Tue Jul 14 10:22:53 2009	(r4715)
> +++ afilters/avfilter.c	Wed Jul 15 18:10:17 2009	(r4716)
> @@ -20,6 +20,7 @@
>   */
>  
>  #include "libavcodec/imgconvert.h"
> +#include "libavcodec/audioconvert.h"
>  #include "avfilter.h"
>  
>  unsigned avfilter_version(void) {
> @@ -95,7 +96,15 @@ int avfilter_link(AVFilterContext *src, 
>      link->dstpad  = dstpad;
>  
>  
> -    link->format  = PIX_FMT_NONE;
> +    link->v_format  = PIX_FMT_NONE;
> +
> +    /* detect if input/output are the same pcm format*/
> +    if (1)
> +    {
> +        link->av_conv = NULL;
> +    } else {
> +//        link->conv = av_audio_convert_alloc(out, 1, in, 1, matrcx, 0);
> +    }
>   

??

>  
>      /* FIXME shouldnt do static buffer alloc like this really, should be
>         variable */
> @@ -253,6 +262,10 @@ void avfilter_filter_buffer(AVFilterLink
>  
>      int input_func = 1, output_func = 1;
>  
> +    /* convert, if necessary */
> +//    if (link->av_conv)
> +//        av_audio_convert();
> +
>   

same here ?

>      if (!(filter_output_buffer = dst->filter_buffer))
>      {
>          av_log(0,0,"LINK HAS NO OUTPUT?\n", 0);
> @@ -304,7 +317,7 @@ void avfilter_draw_slice(AVFilterLink *l
>  
>      /* copy the slice if needed for permission reasons */
>      if(link->srcpic) {
> -        avcodec_get_chroma_sub_sample(link->format, &hsub, &vsub);
> +        avcodec_get_chroma_sub_sample(link->v_format, &hsub, &vsub);
>  
>          for(i = 0; i < 4; i ++) {
>              if(link->srcpic->data[i]) {
> @@ -318,7 +331,7 @@ void avfilter_draw_slice(AVFilterLink *l
>  
>          for(i = 0; i < 4; i ++) {
>              int planew =
> -                ff_get_plane_bytewidth(link->format, link->cur_pic->w, i);
> +                ff_get_plane_bytewidth(link->v_format, link->cur_pic->w, i);
>  
>              if(!src[i]) continue;
>  
>
> Modified: afilters/avfilter.h
> ==============================================================================
> --- afilters/avfilter.h	Tue Jul 14 10:22:53 2009	(r4715)
> +++ afilters/avfilter.h	Wed Jul 15 18:10:17 2009	(r4716)
> @@ -36,6 +36,7 @@
>  
>  #include <stddef.h>
>  #include "libavcodec/avcodec.h"
> +#include "libavcodec/audioconvert.h"
>  
>  /**
>   * Returns the LIBAVFILTER_VERSION_INT constant.
> @@ -128,11 +129,6 @@ typedef struct AVFilterBufferRef
>  
>  }AVFilterBufferRef;
>  
> -
> -
> -
> -
> -
>   

cosmetics

>  /**
>   * Adds a new reference to a picture.
>   * @param ref   an existing reference to the picture
> @@ -378,7 +374,6 @@ struct AVFilterPad
>       */
>      int (*config_props)(AVFilterLink *link);
>  
> -
>   

ditto

>      /**
>       * Process an audio buffer. Filters can hook into this function to do the
>       * actual audio processing
> @@ -492,7 +487,8 @@ struct AVFilterLink
>  
>      int w;                      ///< agreed upon image width
>      int h;                      ///< agreed upon image height
> -    enum PixelFormat format;    ///< agreed upon image colorspace
> +    enum PixelFormat v_format;    ///< agreed upon image colorspace [for video]
> +    enum SampleFormat a_format;   ///< agreed upon sample format [for audio]
>  
>      /**
>       * Lists of formats supported by the input and output filters respectively.
> @@ -515,7 +511,10 @@ struct AVFilterLink
>  
>      /** the audio buffer reference is sent accross the link by the source. */
>      AVFilterBufferRef *srcbuf;
> +
>      int link_size; /* size of data sent accross link each time */
> +    AVAudioConvert *av_conv; /*context for translating accross links */
> +
>   

those comments are not doxygen compatible

>      AVFilterBufferRef *cur_buf;
>      AVFilterBufferRef *outbuf;
>  };
>
> Modified: afilters/dummy.c
> ==============================================================================
> --- afilters/dummy.c	Tue Jul 14 10:22:53 2009	(r4715)
> +++ afilters/dummy.c	Wed Jul 15 18:10:17 2009	(r4716)
>   

how is this related to the change at stake ?

Ben


More information about the FFmpeg-soc mailing list