Re: [PATCH v7 2/3] gstreamer: Avoid memory copy if strides are different

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 24, 2017 at 07:35:25AM -0500, Frediano Ziglio wrote:
> > > +         * stride is different simply passing appropriate offset and
> > > stride */
> > > +        gsize offset = src->left * encoder->format->bpp / 8;
> > > +        gint stride = bitmap->stride;
> > > +        gst_buffer_add_video_meta_full(buffer, GST_VIDEO_FRAME_FLAG_NONE,
> > > +                                       encoder->format->gst_format,
> > > bitmap->x, bitmap->y,
> > > +                                       1, &offset, &stride);
> > 
> > and here, I'd go with something inbetween the initial patch and my first
> > suggestion, ie
> > gsize offset[] = { src->left * encoder->format->bpp / 8 };
> > gint stride[] = { bitmap->stride };
> > Sorry for that :-/
> > 
> 
> I don't see this as much as an improvement, unless you don't
> know much C language.
> And at least I'd use plural for the arrays.

When I see
int some_int;
foo(&some_int);
it usually means that foo() is going to modify some_int, it rarely means
that foo() expects an array of int, hence the suggestions to make the
array more explicit. Feel free to ignore it.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]