[FFmpeg-devel] [PATCH] lavfi: add avfilter_copy_frame_props()

Michael Niedermayer michaelni at gmx.at
Thu May 5 18:50:12 CEST 2011


On Thu, May 05, 2011 at 02:46:59PM +0200, Stefano Sabatini wrote:
> On date Thursday 2011-05-05 01:27:19 +0200, Michael Niedermayer encoded:
> > On Thu, May 05, 2011 at 01:08:55AM +0200, Stefano Sabatini wrote:
> > > On date Tuesday 2011-05-03 01:49:19 +0200, Michael Niedermayer encoded:
> > > > On Tue, May 03, 2011 at 12:20:48AM +0200, Stefano Sabatini wrote:
> > > > > On date Tuesday 2011-05-03 00:06:11 +0200, Michael Niedermayer encoded:
> > > > > > On Mon, May 02, 2011 at 07:26:13PM +0200, Stefano Sabatini wrote:
> > > > > > > On date Monday 2011-05-02 12:42:04 +0200, Michael Niedermayer encoded:
> > > > > > > > On Sun, May 01, 2011 at 04:29:54PM +0200, Stefano Sabatini wrote:
> > > > > > > [...] 
> > > > > > > > >  ffmpeg.c                  |    1 
> > > > > > > > >  ffplay.c                  |    5 ++--
> > > > > > > > >  libavfilter/Makefile      |    2 -
> > > > > > > > >  libavfilter/avcodec.h     |   50 ++++++++++++++++++++++++++++++++++++++++++++++
> > > > > > > > 
> > > > > > > > isnt it possible to just always install libavcodec/avcodec.h even
> > > > > > > > if libavcodec is disabled?
> > > > > > > 
> > > > > > > I would prefer to avoid hacking configure and keep the dependency on
> > > > > > > libavcodec strict, AVFrame should be used only if libavcodec is used,
> > > > > > > so I'd prefer not to make distinctions between compile-time and
> > > > > > > running-time dependencies (and we could need at some point the use of
> > > > > > > some function from libavcodec).
> > > > > > 
> > > > > 
> > > > > > is this change needed at all? #include "libavcodec/avcodec.h" in
> > > > > > libavfilter should use the non installed header and no installed
> > > > > > header from libavfilter shouldneed  libavcodec/avcodec.h for a struct
> > > > > > pointer
> > > > > > am i missing something ?
> > > > > 
> > > > > Do you mean something like this:
> > > > > 
> > > > > struct AVFrame;
> > > > > 
> > > > > static inline
> > > > > void avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
> > > > 
> > > > i was thinking of
> > > > void avfilter_copy_frame_props(AVFilterBufferRef *dst, const struct AVFrame *src);
> > > 
> > > Sorry I can't see the point of avoiding #include
> > > "libavcodec/avcodec.h" when the file is supposed to be used only when
> > > avcodec.h is used in the application, in other words you can avoid
> > > including libavcodec/avcodec.h, but the application will *have* to do
> > > it anyway, and even if you don't include it I can't see the advantage.
> > 
> > the advantage is that we dont have a interdependancy in the headers
> > a user application can use libavfilter on a system without libavcodec
> > just not easily avfilter_copy_frame_props()
> > If the system has both installed a user app can use all.
> > 
> > including the libavcodec header from libavfilter/avcodec.h will
> > require libavcodec/avcodec.h to be installed when libavfilter is
> > installed so you either have libavfilter depend on libavcodec or
> > have to install libavcodec/avcodec.h even when libavcodec is not.
> > 
> > but maybe i miss an option.
> 
> It the user wants to use libavfilter without libavcodec, she
> configures FFmpeg with --disable-libavcodec and compiles, libavfilter
> is compiled but the libavfilter/avcodec.o module is not compiled in
> (and thus avfilter_copy_frame_props won't be available at run-time).
> 
> In the application she won't need AVFrame, *and* she won't include
> libavfilter/avcodec.h, so no need to have libavcodec/avcodec.h
> installed.
> 
> If she wants libavfilter+libavcodec, she will configure/compile FFmpeg
> with --enable-avcodec, and will include libavcodec/avcodec.h. Since
> she's already using libavcodec in her application, avoiding
> libavcodec/avcodec.h inclusion in libavfilter/avcodec.h is pointless.
> 
> In case she may need libavfilter/libavcodec conditionally, she can
> implement the inclusion logic in the application:
> #if CONFIG_AVCODEC
> #include "libavfilter/avcodec.h"
> #endif
> 
> and do the same in the code.
> 
> Of course in order to avoid missing symbols problems, libavfilter
> compiled for a distro should always enable libavcodec, but this is
> definitively not required for custom projects.
> -- 
> FFmpeg = Frightening & Fierce Mean Power Experimenting Generator

>  ffmpeg.c                  |    1 +
>  ffplay.c                  |    5 +++--
>  libavfilter/Makefile      |    5 ++++-
>  libavfilter/avcodec.c     |   42 ++++++++++++++++++++++++++++++++++++++++++
>  libavfilter/avcodec.h     |   40 ++++++++++++++++++++++++++++++++++++++++
>  libavfilter/vsrc_buffer.c |    9 +++------
>  libavfilter/vsrc_movie.c  |    8 ++------
>  7 files changed, 95 insertions(+), 15 deletions(-)
> a80ea37da944fa90ad326fc83f352287725fc095  0004-lavfi-add-avfilter_copy_frame_props.patch
> From de988680f06be04b8bc0707066c63a29a061f8dd Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Sun, 1 May 2011 14:47:05 +0200
> Subject: [PATCH] lavfi: add avfilter_copy_frame_props()

If you prefer this solution, then its ok with me

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110505/3eec956c/attachment.asc>


More information about the ffmpeg-devel mailing list