[vlc-commits] vt_utils: implements picture context copy
Thomas Guillem
git at videolan.org
Wed Jun 7 09:03:57 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jun 6 11:53:11 2017 +0200| [a83f896e9b653ed356081e548a41c873c0382f29] | committer: Thomas Guillem
vt_utils: implements picture context copy
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a83f896e9b653ed356081e548a41c873c0382f29
---
modules/codec/vt_utils.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/modules/codec/vt_utils.c b/modules/codec/vt_utils.c
index 3f2e79da93..3faf8598dd 100644
--- a/modules/codec/vt_utils.c
+++ b/modules/codec/vt_utils.c
@@ -55,6 +55,18 @@ cvpxpic_destroy_cb(picture_context_t *opaque)
free(opaque);
}
+static picture_context_t *
+cvpxpic_copy_cb(struct picture_context_t *opaque)
+{
+ struct cvpxpic_ctx *src_ctx = (struct cvpxpic_ctx *)opaque;
+ struct cvpxpic_ctx *dst_ctx = malloc(sizeof(struct cvpxpic_ctx));
+ if (dst_ctx == NULL)
+ return NULL;
+ *dst_ctx = *src_ctx;
+ dst_ctx->cvpx = CVPixelBufferRetain(dst_ctx->cvpx);
+ return &dst_ctx->s;
+}
+
int
cvpxpic_attach(picture_t *p_pic, CVPixelBufferRef cvpx)
{
@@ -66,6 +78,7 @@ cvpxpic_attach(picture_t *p_pic, CVPixelBufferRef cvpx)
return VLC_ENOMEM;
}
ctx->s.destroy = cvpxpic_destroy_cb;
+ ctx->s.copy = cvpxpic_copy_cb;
ctx->cvpx = CVPixelBufferRetain(cvpx);
p_pic->context = &ctx->s;
More information about the vlc-commits
mailing list