Quoting Martin Storsjö (2016-06-23 21:46:50)
> On Thu, 23 Jun 2016, Anton Khirnov wrote:
> 
> > Quoting Martin Storsjö (2016-06-23 13:06:41)
> >> +AVCodec ff_libopenh264_decoder = {
> >> +    .name           = "libopenh264",
> >> +    .type           = AVMEDIA_TYPE_VIDEO,
> >> +    .id             = AV_CODEC_ID_H264,
> >> +    .priv_data_size = sizeof(SVCContext),
> >> +    .init           = svc_decode_init,
> >> +    .decode         = svc_decode_frame,
> >> +    .close          = svc_decode_close,
> >> +    .long_name      = NULL_IF_CONFIG_SMALL("OpenH264"),
> >> +    .capabilities   = AV_CODEC_CAP_DELAY, // The decoder itself doesn't 
> >> have delay, but the BSF might
> >
> > It does call ff_get_buffer(), so it should be flagged as DR I think.
> > Even though it's not "proper" DR.
> 
> Hmm, good point. If not setting the flags, the avframe would be allocated 
> and filled locally, right?

I think these days the flag makes almost no difference in lavc
internals. Its main purpose is just to signal to the caller that he
shouldn't expect his get_buffer() callback to be used.

> 
> I guess I could do that as well (pointing to the buffers returned by the 
> decoder); would the refcounting take care of duplicating it in case the 
> caller wants to retain it past the next decode call?

No, refcounting cannot magically substitute the data in all the
references the caller might have made. I think the copy is unavoidable
here.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to