Lines Matching refs:meta

58 ensure_surface_proxy (GstVaapiVideoMeta * meta)  in ensure_surface_proxy()  argument
60 if (!meta->proxy) in ensure_surface_proxy()
63 if (meta->buffer) { in ensure_surface_proxy()
64 GstMemory *const mem = gst_buffer_peek_memory (meta->buffer, 0); in ensure_surface_proxy()
73 set_display (GstVaapiVideoMeta * meta, GstVaapiDisplay * display) in set_display() argument
75 gst_vaapi_display_replace (&meta->display, display); in set_display()
79 set_image (GstVaapiVideoMeta * meta, GstVaapiImage * image) in set_image() argument
81 meta->image = gst_vaapi_object_ref (image); in set_image()
82 set_display (meta, gst_vaapi_object_get_display (GST_VAAPI_OBJECT (image))); in set_image()
86 set_image_from_pool (GstVaapiVideoMeta * meta, GstVaapiVideoPool * pool) in set_image_from_pool() argument
94 set_image (meta, image); in set_image_from_pool()
95 meta->image_pool = gst_vaapi_video_pool_ref (pool); in set_image_from_pool()
100 set_surface_proxy (GstVaapiVideoMeta * meta, GstVaapiSurfaceProxy * proxy) in set_surface_proxy() argument
108 meta->proxy = gst_vaapi_surface_proxy_ref (proxy); in set_surface_proxy()
109 set_display (meta, gst_vaapi_object_get_display (GST_VAAPI_OBJECT (surface))); in set_surface_proxy()
114 set_surface_proxy_from_pool (GstVaapiVideoMeta * meta, GstVaapiVideoPool * pool) in set_surface_proxy_from_pool() argument
123 success = set_surface_proxy (meta, proxy); in set_surface_proxy_from_pool()
129 gst_vaapi_video_meta_destroy_image (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_destroy_image() argument
131 if (meta->image) { in gst_vaapi_video_meta_destroy_image()
132 if (meta->image_pool) in gst_vaapi_video_meta_destroy_image()
133 gst_vaapi_video_pool_put_object (meta->image_pool, meta->image); in gst_vaapi_video_meta_destroy_image()
134 gst_vaapi_object_unref (meta->image); in gst_vaapi_video_meta_destroy_image()
135 meta->image = NULL; in gst_vaapi_video_meta_destroy_image()
137 gst_vaapi_video_pool_replace (&meta->image_pool, NULL); in gst_vaapi_video_meta_destroy_image()
141 gst_vaapi_video_meta_destroy_proxy (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_destroy_proxy() argument
143 gst_vaapi_surface_proxy_replace (&meta->proxy, NULL); in gst_vaapi_video_meta_destroy_proxy()
147 gst_vaapi_video_meta_finalize (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_finalize() argument
149 gst_vaapi_video_meta_destroy_image (meta); in gst_vaapi_video_meta_finalize()
150 gst_vaapi_video_meta_destroy_proxy (meta); in gst_vaapi_video_meta_finalize()
151 gst_vaapi_display_replace (&meta->display, NULL); in gst_vaapi_video_meta_finalize()
155 gst_vaapi_video_meta_init (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_init() argument
157 meta->buffer = NULL; in gst_vaapi_video_meta_init()
158 meta->ref_count = 1; in gst_vaapi_video_meta_init()
159 meta->display = NULL; in gst_vaapi_video_meta_init()
160 meta->image_pool = NULL; in gst_vaapi_video_meta_init()
161 meta->image = NULL; in gst_vaapi_video_meta_init()
162 meta->proxy = NULL; in gst_vaapi_video_meta_init()
163 meta->converter = NULL; in gst_vaapi_video_meta_init()
164 meta->render_flags = 0; in gst_vaapi_video_meta_init()
165 meta->has_render_rect = FALSE; in gst_vaapi_video_meta_init()
175 _gst_vaapi_video_meta_destroy (GstVaapiVideoMeta * meta) in _gst_vaapi_video_meta_destroy() argument
177 g_slice_free1 (sizeof (*meta), meta); in _gst_vaapi_video_meta_destroy()
183 GstVaapiVideoMeta *meta; in _gst_vaapi_video_meta_new() local
185 meta = _gst_vaapi_video_meta_create (); in _gst_vaapi_video_meta_new()
186 if (!meta) in _gst_vaapi_video_meta_new()
188 gst_vaapi_video_meta_init (meta); in _gst_vaapi_video_meta_new()
189 return meta; in _gst_vaapi_video_meta_new()
193 _gst_vaapi_video_meta_free (GstVaapiVideoMeta * meta) in _gst_vaapi_video_meta_free() argument
195 g_atomic_int_inc (&meta->ref_count); in _gst_vaapi_video_meta_free()
197 gst_vaapi_video_meta_finalize (meta); in _gst_vaapi_video_meta_free()
199 if (G_LIKELY (g_atomic_int_dec_and_test (&meta->ref_count))) in _gst_vaapi_video_meta_free()
200 _gst_vaapi_video_meta_destroy (meta); in _gst_vaapi_video_meta_free()
214 gst_vaapi_video_meta_copy (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_copy() argument
218 g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), NULL); in gst_vaapi_video_meta_copy()
220 if (meta->image_pool) in gst_vaapi_video_meta_copy()
229 copy->display = gst_object_ref (meta->display); in gst_vaapi_video_meta_copy()
231 copy->image = meta->image ? gst_vaapi_object_ref (meta->image) : NULL; in gst_vaapi_video_meta_copy()
232 copy->proxy = meta->proxy ? gst_vaapi_surface_proxy_copy (meta->proxy) : NULL; in gst_vaapi_video_meta_copy()
233 copy->converter = meta->converter; in gst_vaapi_video_meta_copy()
234 copy->render_flags = meta->render_flags; in gst_vaapi_video_meta_copy()
236 copy->has_render_rect = meta->has_render_rect; in gst_vaapi_video_meta_copy()
238 copy->render_rect = meta->render_rect; in gst_vaapi_video_meta_copy()
258 GstVaapiVideoMeta *meta; in gst_vaapi_video_meta_new() local
262 meta = _gst_vaapi_video_meta_new (); in gst_vaapi_video_meta_new()
263 if (G_UNLIKELY (!meta)) in gst_vaapi_video_meta_new()
266 set_display (meta, display); in gst_vaapi_video_meta_new()
267 return meta; in gst_vaapi_video_meta_new()
286 GstVaapiVideoMeta *meta; in gst_vaapi_video_meta_new_from_pool() local
291 meta = _gst_vaapi_video_meta_new (); in gst_vaapi_video_meta_new_from_pool()
292 if (G_UNLIKELY (!meta)) in gst_vaapi_video_meta_new_from_pool()
298 if (!set_image_from_pool (meta, pool)) in gst_vaapi_video_meta_new_from_pool()
302 if (!set_surface_proxy_from_pool (meta, pool)) in gst_vaapi_video_meta_new_from_pool()
309 set_display (meta, gst_vaapi_video_pool_get_display (pool)); in gst_vaapi_video_meta_new_from_pool()
310 return meta; in gst_vaapi_video_meta_new_from_pool()
315 gst_vaapi_video_meta_unref (meta); in gst_vaapi_video_meta_new_from_pool()
335 GstVaapiVideoMeta *meta; in gst_vaapi_video_meta_new_with_image() local
339 meta = _gst_vaapi_video_meta_new (); in gst_vaapi_video_meta_new_with_image()
340 if (G_UNLIKELY (!meta)) in gst_vaapi_video_meta_new_with_image()
343 gst_vaapi_video_meta_set_image (meta, image); in gst_vaapi_video_meta_new_with_image()
344 return meta; in gst_vaapi_video_meta_new_with_image()
362 GstVaapiVideoMeta *meta; in gst_vaapi_video_meta_new_with_surface_proxy() local
366 meta = _gst_vaapi_video_meta_new (); in gst_vaapi_video_meta_new_with_surface_proxy()
367 if (G_UNLIKELY (!meta)) in gst_vaapi_video_meta_new_with_surface_proxy()
370 gst_vaapi_video_meta_set_surface_proxy (meta, proxy); in gst_vaapi_video_meta_new_with_surface_proxy()
371 return meta; in gst_vaapi_video_meta_new_with_surface_proxy()
383 gst_vaapi_video_meta_ref (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_ref() argument
385 g_return_val_if_fail (meta != NULL, NULL); in gst_vaapi_video_meta_ref()
387 g_atomic_int_inc (&meta->ref_count); in gst_vaapi_video_meta_ref()
388 return meta; in gst_vaapi_video_meta_ref()
399 gst_vaapi_video_meta_unref (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_unref() argument
401 g_return_if_fail (meta != NULL); in gst_vaapi_video_meta_unref()
402 g_return_if_fail (meta->ref_count > 0); in gst_vaapi_video_meta_unref()
404 if (g_atomic_int_dec_and_test (&meta->ref_count)) in gst_vaapi_video_meta_unref()
405 _gst_vaapi_video_meta_free (meta); in gst_vaapi_video_meta_unref()
452 gst_vaapi_video_meta_get_display (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_get_display() argument
454 g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), NULL); in gst_vaapi_video_meta_get_display()
456 return meta->display; in gst_vaapi_video_meta_get_display()
471 gst_vaapi_video_meta_get_image (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_get_image() argument
473 g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), NULL); in gst_vaapi_video_meta_get_image()
475 return meta->image; in gst_vaapi_video_meta_get_image()
488 gst_vaapi_video_meta_set_image (GstVaapiVideoMeta * meta, GstVaapiImage * image) in gst_vaapi_video_meta_set_image() argument
490 g_return_if_fail (GST_VAAPI_IS_VIDEO_META (meta)); in gst_vaapi_video_meta_set_image()
492 gst_vaapi_video_meta_destroy_image (meta); in gst_vaapi_video_meta_set_image()
495 set_image (meta, image); in gst_vaapi_video_meta_set_image()
510 gst_vaapi_video_meta_set_image_from_pool (GstVaapiVideoMeta * meta, in gst_vaapi_video_meta_set_image_from_pool() argument
513 g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), FALSE); in gst_vaapi_video_meta_set_image_from_pool()
518 gst_vaapi_video_meta_destroy_image (meta); in gst_vaapi_video_meta_set_image_from_pool()
520 return set_image_from_pool (meta, pool); in gst_vaapi_video_meta_set_image_from_pool()
535 gst_vaapi_video_meta_get_surface (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_get_surface() argument
537 g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), NULL); in gst_vaapi_video_meta_get_surface()
539 return ensure_surface_proxy (meta) ? in gst_vaapi_video_meta_get_surface()
540 GST_VAAPI_SURFACE_PROXY_SURFACE (meta->proxy) : NULL; in gst_vaapi_video_meta_get_surface()
555 gst_vaapi_video_meta_get_surface_proxy (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_get_surface_proxy() argument
557 g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), NULL); in gst_vaapi_video_meta_get_surface_proxy()
559 return ensure_surface_proxy (meta) ? meta->proxy : NULL; in gst_vaapi_video_meta_get_surface_proxy()
572 gst_vaapi_video_meta_set_surface_proxy (GstVaapiVideoMeta * meta, in gst_vaapi_video_meta_set_surface_proxy() argument
577 g_return_if_fail (GST_VAAPI_IS_VIDEO_META (meta)); in gst_vaapi_video_meta_set_surface_proxy()
579 gst_vaapi_video_meta_destroy_proxy (meta); in gst_vaapi_video_meta_set_surface_proxy()
582 if (!set_surface_proxy (meta, proxy)) in gst_vaapi_video_meta_set_surface_proxy()
587 gst_vaapi_video_meta_set_render_rect (meta, crop_rect); in gst_vaapi_video_meta_set_surface_proxy()
600 gst_vaapi_video_meta_get_render_flags (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_get_render_flags() argument
602 g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), 0); in gst_vaapi_video_meta_get_render_flags()
603 g_return_val_if_fail (meta->proxy != NULL, 0); in gst_vaapi_video_meta_get_render_flags()
605 return meta->render_flags; in gst_vaapi_video_meta_get_render_flags()
616 gst_vaapi_video_meta_set_render_flags (GstVaapiVideoMeta * meta, guint flags) in gst_vaapi_video_meta_set_render_flags() argument
618 g_return_if_fail (GST_VAAPI_IS_VIDEO_META (meta)); in gst_vaapi_video_meta_set_render_flags()
619 g_return_if_fail (meta->proxy != NULL); in gst_vaapi_video_meta_set_render_flags()
621 meta->render_flags = flags; in gst_vaapi_video_meta_set_render_flags()
633 gst_vaapi_video_meta_get_render_rect (GstVaapiVideoMeta * meta) in gst_vaapi_video_meta_get_render_rect() argument
635 g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), NULL); in gst_vaapi_video_meta_get_render_rect()
637 if (!meta->has_render_rect) in gst_vaapi_video_meta_get_render_rect()
639 return &meta->render_rect; in gst_vaapi_video_meta_get_render_rect()
650 gst_vaapi_video_meta_set_render_rect (GstVaapiVideoMeta * meta, in gst_vaapi_video_meta_set_render_rect() argument
653 g_return_if_fail (GST_VAAPI_IS_VIDEO_META (meta)); in gst_vaapi_video_meta_set_render_rect()
655 meta->has_render_rect = rect != NULL; in gst_vaapi_video_meta_set_render_rect()
656 if (meta->has_render_rect) in gst_vaapi_video_meta_set_render_rect()
657 meta->render_rect = *rect; in gst_vaapi_video_meta_set_render_rect()
660 #define GST_VAAPI_VIDEO_META_HOLDER(meta) \ argument
661 ((GstVaapiVideoMetaHolder *) (meta))
667 GstVaapiVideoMeta *meta; member
671 gst_vaapi_video_meta_holder_init (GstVaapiVideoMetaHolder * meta, in gst_vaapi_video_meta_holder_init() argument
674 meta->meta = NULL; in gst_vaapi_video_meta_holder_init()
679 gst_vaapi_video_meta_holder_free (GstVaapiVideoMetaHolder * meta, in gst_vaapi_video_meta_holder_free() argument
682 if (meta->meta) in gst_vaapi_video_meta_holder_free()
683 gst_vaapi_video_meta_unref (meta->meta); in gst_vaapi_video_meta_holder_free()
687 gst_vaapi_video_meta_holder_transform (GstBuffer * dst_buffer, GstMeta * meta, in gst_vaapi_video_meta_holder_transform() argument
690 GstVaapiVideoMetaHolder *const src_meta = GST_VAAPI_VIDEO_META_HOLDER (meta); in gst_vaapi_video_meta_holder_transform()
694 gst_vaapi_video_meta_copy (src_meta->meta); in gst_vaapi_video_meta_holder_transform()
736 GstVaapiVideoMeta *meta; in gst_buffer_get_vaapi_video_meta() local
745 meta = GST_VAAPI_VIDEO_META_HOLDER (m)->meta; in gst_buffer_get_vaapi_video_meta()
746 if (meta) in gst_buffer_get_vaapi_video_meta()
747 meta->buffer = buffer; in gst_buffer_get_vaapi_video_meta()
748 return meta; in gst_buffer_get_vaapi_video_meta()
752 gst_buffer_set_vaapi_video_meta (GstBuffer * buffer, GstVaapiVideoMeta * meta) in gst_buffer_set_vaapi_video_meta() argument
757 g_return_if_fail (GST_VAAPI_IS_VIDEO_META (meta)); in gst_buffer_set_vaapi_video_meta()
761 GST_VAAPI_VIDEO_META_HOLDER (m)->meta = gst_vaapi_video_meta_ref (meta); in gst_buffer_set_vaapi_video_meta()