[Cin] ffmpeg.git removes some fields from public API ....

Phyllis Smith phylsmith2017 at gmail.com
Fri Oct 30 00:02:35 CET 2020


Andrew,

> This is ffmpeg - moves fast, but break things! :}
>
Don't quote me on this, but GG says he does not know about "moves fast" but
knows about "break things!"  That is because "moving fast" is relative but
"breaking things" is absolute.

Anyway he just now looked at the patch along with your more recent email
about it being not a good idea (digging into internals).  So he is still
going to wait to see if they stop working on them so it becomes clear what
they end up with.  Really, thanks for your effort and continuing to give us
an early warning.  GG/Phyllis

>
> May be you should raise question to ffmpeg-devel, because if there is no
> suitable public api for some operations you need in CinGG series either
> better to be partially reverted or API is added ..
>
> I made simple patch, for CinGG itself, but right now I have trouble
> compiling CinGG even with this patch due to some other error (see my other
> email).
>
> diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C
> b/cinelerra-5.1/cinelerra/ffmpeg.C
> index 97b6698a..916b2077 100644
> --- a/cinelerra-5.1/cinelerra/ffmpeg.C
> +++ b/cinelerra-5.1/cinelerra/ffmpeg.C
> @@ -720,7 +720,7 @@ int FFStream::seek(int64_t no, double rate)
>         AVRational time_base = st->time_base;
>         int64_t tstmp = time_base.num > 0 ? secs *
> time_base.den/time_base.num : 0;
>         if( !tstmp ) {
> -               if( st->nb_index_entries > 0 ) tstmp =
> st->index_entries[0].timestamp;
> +               if( st->internal->nb_index_entries > 0 ) tstmp =
> st->internal->index_entries[0].timestamp;
>                 else if( st->start_time != AV_NOPTS_VALUE ) tstmp =
> st->start_time;
>                 else if( st->first_dts != AV_NOPTS_VALUE ) tstmp =
> st->first_dts;
>                 else tstmp = INT64_MIN+1;
> @@ -3943,10 +3943,10 @@ void FFStream::load_markers(IndexMarks &marks,
> double rate)
>         int in = 0;
>         int64_t sz = marks.size();
>         int max_entries = fmt_ctx->max_index_size / sizeof(AVIndexEntry) -
> 1;
> -       int nb_ent = st->nb_index_entries;
> +       int nb_ent = st->internal->nb_index_entries;
>  // some formats already have an index
>         if( nb_ent > 0 ) {
> -               AVIndexEntry *ep = &st->index_entries[nb_ent-1];
> +               AVIndexEntry *ep = &st->internal->index_entries[nb_ent-1];
>                 int64_t tstmp = ep->timestamp;
>                 if( nudge != AV_NOPTS_VALUE ) tstmp -= nudge;
>                 double secs = ffmpeg->to_secs(tstmp, st->time_base);
> diff --git a/cinelerra-5.1/cinelerra/ffmpeg.h
> b/cinelerra-5.1/cinelerra/ffmpeg.h
> index 2e1f201f..46749802 100644
> --- a/cinelerra-5.1/cinelerra/ffmpeg.h
> +++ b/cinelerra-5.1/cinelerra/ffmpeg.h
> @@ -26,6 +26,7 @@
>
>  extern "C" {
>  #include "libavformat/avformat.h"
> +#include "libavformat/internal.h"
>  #include "libavformat/avio.h"
>  #include "libavcodec/avcodec.h"
>  #include "libavfilter/avfilter.h"
>
> may be this can be conditionalized on ffmpeg/libavformat version ...? If
> there will be no other way around this change.
>
>
>
> >
> > On Thu, Oct 29, 2020 at 10:42 AM Andrew Randrianasulu via Cin <
> > cin at lists.cinelerra-gg.org> wrote:
> >
> > >
> > >
> https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/cea7c19cda0ea1630ae1de8c102ab14231b9db10
> > >
> > > =====
> > > lavf: move AVStream.*index_entries* to AVStreamInternal
> > >
> > >  Those are private fields, no reason to have them exposed in a public
> > >  header. Since there are some (semi-)public fields located after these,
> > >  even though this section is supposed to be private, keep some dummy
> > >  padding there until the next major bump to preserve ABI compatibility.
> > > ======
> > >
> > > so, now CinGG fails to build:
> > >
> > > ffmpeg.C:723:11: error: no member named 'nb_index_entries' in
> 'AVStream'
> > >                 if( st->nb_index_entries > 0 ) tstmp =
> > > st->index_entries[0].timestamp;
> > >                     ~~  ^
> > > ffmpeg.C:723:46: error: no member named 'index_entries' in 'AVStream'
> > >                 if( st->nb_index_entries > 0 ) tstmp =
> > > st->index_entries[0].timestamp;
> > >                                                        ~~  ^
> > > 8 warnings generated.
> > > clang++ `cat i686/c_flags`  -DMSGQUAL=filebase -c filebase.C -o
> > > i686/filebase.o
> > > In file included from filebaseaudio.C:24:
> > > In file included from ./file.h:37:
> > > In file included from ./formattools.h:26:
> > > In file included from
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/guicast.h:35:
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bcpan.h:96:6:
> > > warning: 'BC_Pan::activate' hides overloaded virtual function
> > > [-Woverloaded-virtual]
> > >         int activate(int popup_x = -1, int popup_y = -1);
> > >             ^
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bcwindowbase.h:375:14:
> > > note: hidden overloaded virtual function 'BC_WindowBase::activate'
> declared
> > > here: different number of parameters (0 vs 2)
> > >         virtual int activate();
> > >                     ^
> > > In file included from filebaseaudio.C:24:
> > > In file included from ./file.h:37:
> > > In file included from ./formattools.h:26:
> > > In file included from
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/guicast.h:36:
> > > In file included from
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bcfilebox.h:33:
> > > In file included from
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bctextbox.h:25:
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bclistbox.h:190:6:
> > > warning: 'BC_ListBox::activate' hides overloaded virtual function
> > > [-Woverloaded-virtual]
> > >         int activate(int take_focus = 1);
> > >             ^
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bcwindowbase.h:375:14:
> > > note: hidden overloaded virtual function 'BC_WindowBase::activate'
> declared
> > > here: different number of parameters (0 vs 1)
> > >         virtual int activate();
> > >                     ^
> > > In file included from filebaseaudio.C:24:
> > > In file included from ./file.h:37:
> > > In file included from ./formattools.h:26:
> > > In file included from
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/guicast.h:36:
> > > In file included from
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bcfilebox.h:33:
> > > In file included from
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bctextbox.h:25:
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bclistbox.h:191:6:
> > > warning: 'BC_ListBox::activate' hides overloaded virtual function
> > > [-Woverloaded-virtual]
> > >         int activate(int x, int y, int w=-1, int h=-1);
> > >             ^
> > >
> /dev/shm/tmp/cinelerra-goodguy-20201029/cinelerra-5.1/cinelerra/../guicast/bcwindowbase.h:375:14:
> > > note: hidden overloaded virtual function 'BC_WindowBase::activate'
> declared
> > > here: different number of parameters (0 vs 4)
> > >         virtual int activate();
> > >                     ^
> > > ffmpeg.C:3922:5: warning: absolute value function 'abs' given an
> argument
> > > of type 'long long' but has parameter of type 'int' which may cause
> > > truncation of value [-Wabsolute-value]
> > > if( abs(pos-aud->curr_pos) > 1 )
> > >     ^
> > > ffmpeg.C:3922:5: note: use function 'std::abs' instead
> > > if( abs(pos-aud->curr_pos) > 1 )
> > >     ^~~
> > >     std::abs
> > > ffmpeg.C:3922:5: note: include the header <cstdlib> or explicitly
> provide
> > > a declaration for 'std::abs'
> > > ffmpeg.C:3955:19: error: no member named 'nb_index_entries' in
> 'AVStream'
> > >         int nb_ent = st->nb_index_entries;
> > >                      ~~  ^
> > > ffmpeg.C:3958:27: error: no member named 'index_entries' in 'AVStream'
> > >                 AVIndexEntry *ep = &st->index_entries[nb_ent-1];
> > >                                     ~~  ^
> > > 6 warnings and 4 errors generated.
> > > make[2]: *** [Makefile:563: i686/ffmpeg.o] Error 1
> > > make[2]: *** Waiting for unfinished jobs....
> > >
> > > -----
> > >
> > > Fix may be as simple as adding internal-> to those lines ...
> > >
> > > Looking at ffmpeg commit above ....
> > >
> > >
> > >
> https://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff/7e87288f73242dac6344e65f892569102893fac0..cea7c19cda0ea1630ae1de8c102ab14231b9db10:/libavformat/flacdec.c
> > >
> > > -    if(index<0 || index >= s->streams[0]->nb_index_entries)
> > > +    if(index<0 || index >= s->streams[0]->internal->nb_index_entries)
> > >
> > > (from flac demuxer)
> > > --
> > > Cin mailing list
> > > Cin at lists.cinelerra-gg.org
> > > https://lists.cinelerra-gg.org/mailman/listinfo/cin
> > >
> >
>
>
> --
> Cin mailing list
> Cin at lists.cinelerra-gg.org
> https://lists.cinelerra-gg.org/mailman/listinfo/cin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20201029/a472b499/attachment-0001.htm>


More information about the Cin mailing list