[FFmpeg-devel] [PATCH V4 1/2] avutil: add ROI data struct and bump version

Michael Niedermayer michael at niedermayer.cc
Thu Jan 3 00:07:14 EET 2019


On Wed, Jan 02, 2019 at 09:50:24PM +0100, Vittorio Giovara wrote:
> On Wed, Jan 2, 2019 at 6:45 PM James Almer <jamrial at gmail.com> wrote:
> 
> > On 1/2/2019 2:18 PM, Vittorio Giovara wrote:
> > > On Wed, Jan 2, 2019 at 4:13 PM Vittorio Giovara <
> > vittorio.giovara at gmail.com>
> > > wrote:
> > >
> > >>
> > >>
> > >> On Fri, Dec 28, 2018 at 3:17 AM Guo, Yejun <yejun.guo at intel.com> wrote:
> > >>
> > >
> > > AVRegionOfInterest {
> > >  size_t top/left/right/bottom
> > > }
> > >
> > > AVRegionOfInterestSet {
> > >  int rois_nb;
> > >  AVRegionOfInterest *rois;
> >
> > This will go south as soon as you start copying, referencing and freeing
> > frames and/or frame side data.
> >
> > All side data types need to be a contiguous array of bytes in memory
> > with no pointers.
> >
> 
> Hmm you're right, but embedding an entire array is pretty bad too,
> especially because it locks the struct size...
> Do you have any alternative ideas for this?

the array element size could be added in addition to the number of
entries. that way elements can be added after the array and also
the individual elements can be extended

int rois_nb;
int roi_size;
AVRegionOfInterest rois[rois_nb];

Alternativly some "int version" could be used but we dont use that style
elsewhere


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190102/ac86e9e9/attachment.sig>


More information about the ffmpeg-devel mailing list