docs: add since markers to capsfeatures docs
[platform/upstream/gstreamer.git] / gst / gstcapsfeatures.c
1 /* GStreamer
2  * Copyright (C) 2013 Collabora Ltd.
3  *   Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21 /**
22  * SECTION:gstcapsfeatures
23  * @short_description: A set of features in caps 
24  * @see_also: #GstCaps
25  *
26  * #GstCapsFeatures can optionally be set on a #GstCaps to add requirements
27  * for additional features for a specific #GstStructure. Caps structures with
28  * the same name but with a non-equal set of caps features are not compatible.
29  * If a pad supports multiple sets of features it has to add multiple equal
30  * structures with different feature sets to the caps.
31  *
32  * Empty #GstCapsFeatures are equivalent with the #GstCapsFeatures that only
33  * contain #GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY.
34  *
35  * Examples for caps features would be the requirement of a specific #GstMemory
36  * types or the requirement of having a specific #GstMeta on the buffer. Features
37  * are given as a string of the format "memory:GstMemoryTypeName" or
38  * "meta:GstMetaAPIName".
39  *
40  * Since: 1.2
41  */
42
43 #ifdef HAVE_CONFIG_H
44 #include "config.h"
45 #endif
46
47 #include <string.h>
48 #include "gst_private.h"
49 #include "gstcapsfeatures.h"
50 #include <gst/gst.h>
51
52 GST_DEBUG_CATEGORY_STATIC (gst_caps_features_debug);
53 #define GST_CAT_DEFAULT gst_caps_features_debug
54
55 struct _GstCapsFeatures
56 {
57   GType type;
58   gint *parent_refcount;
59   GArray *array;
60   gboolean is_any;
61 };
62
63 GType _gst_caps_features_type = 0;
64 GstCapsFeatures *_gst_caps_features_any = NULL;
65 GstCapsFeatures *_gst_caps_features_memory_system_memory = NULL;
66 static GQuark _gst_caps_feature_memory_system_memory = 0;
67
68 G_DEFINE_BOXED_TYPE (GstCapsFeatures, gst_caps_features,
69     gst_caps_features_copy, gst_caps_features_free);
70
71 #define IS_MUTABLE(features) \
72     (!features->parent_refcount || \
73      g_atomic_int_get (features->parent_refcount) == 1)
74
75 static void
76 gst_caps_features_transform_to_string (const GValue * src_value,
77     GValue * dest_value);
78
79 void
80 _priv_gst_caps_features_initialize (void)
81 {
82   _gst_caps_features_type = gst_caps_features_get_type ();
83   _gst_caps_feature_memory_system_memory =
84       g_quark_from_static_string (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY);
85
86   g_value_register_transform_func (_gst_caps_features_type, G_TYPE_STRING,
87       gst_caps_features_transform_to_string);
88
89   _gst_caps_features_any = gst_caps_features_new_any ();
90   _gst_caps_features_memory_system_memory =
91       gst_caps_features_new_id (_gst_caps_feature_memory_system_memory, 0);
92
93   GST_DEBUG_CATEGORY_INIT (gst_caps_features_debug, "caps-features", 0,
94       "GstCapsFeatures debug");
95 }
96
97 gboolean
98 gst_is_caps_features (gconstpointer obj)
99 {
100   const GstCapsFeatures *features = obj;
101
102   return (obj != NULL && features->type == _gst_caps_features_type);
103 }
104
105 static gboolean
106 gst_caps_feature_name_is_valid (const gchar * feature)
107 {
108 #ifndef G_DISABLE_CHECKS
109   while (TRUE) {
110     if (g_ascii_isalpha (*feature))
111       feature++;
112     else if (*feature == ':')
113       break;
114     else
115       return FALSE;
116   }
117
118   if (*feature != ':')
119     return FALSE;
120
121   feature++;
122   if (*feature == '\0' || !g_ascii_isalpha (*feature))
123     return FALSE;
124
125   while (TRUE) {
126     if (g_ascii_isalnum (*feature))
127       feature++;
128     else if (*feature == '\0')
129       break;
130     else
131       return FALSE;
132   }
133 #endif
134
135   return TRUE;
136 }
137
138 /**
139  * gst_caps_features_new_empty:
140  *
141  * Creates a new, empty #GstCapsFeatures.
142  *
143  * Free-function: gst_caps_features_free
144  *
145  * Returns: (transfer full): a new, empty #GstCapsFeatures
146  *
147  * Since: 1.2
148  */
149 GstCapsFeatures *
150 gst_caps_features_new_empty (void)
151 {
152   GstCapsFeatures *features;
153
154   features = g_slice_new (GstCapsFeatures);
155   features->type = _gst_caps_features_type;
156   features->parent_refcount = NULL;
157   features->array = g_array_new (FALSE, FALSE, sizeof (GQuark));
158   features->is_any = FALSE;
159
160   GST_TRACE ("created caps features %p", features);
161
162   return features;
163 }
164
165 /**
166  * gst_caps_features_new_any:
167  *
168  * Creates a new, ANY #GstCapsFeatures. This will be equal
169  * to any other #GstCapsFeatures but caps with these are
170  * unfixed.
171  *
172  * Free-function: gst_caps_features_free
173  *
174  * Returns: (transfer full): a new, ANY #GstCapsFeatures
175  *
176  * Since: 1.2
177  */
178 GstCapsFeatures *
179 gst_caps_features_new_any (void)
180 {
181   GstCapsFeatures *features;
182
183   features = gst_caps_features_new_empty ();
184   features->is_any = TRUE;
185
186   return features;
187 }
188
189 /**
190  * gst_caps_features_new:
191  * @feature1: name of first feature to set
192  * @...: additional features
193  *
194  * Creates a new #GstCapsFeatures with the given features.
195  * The last argument must be NULL.
196  *
197  * Free-function: gst_caps_features_free
198  *
199  * Returns: (transfer full): a new, empty #GstCapsFeatures
200  *
201  * Since: 1.2
202  */
203 GstCapsFeatures *
204 gst_caps_features_new (const gchar * feature1, ...)
205 {
206   GstCapsFeatures *features;
207   va_list varargs;
208
209   g_return_val_if_fail (feature1 != NULL, NULL);
210
211   va_start (varargs, feature1);
212   features = gst_caps_features_new_valist (feature1, varargs);
213   va_end (varargs);
214
215   return features;
216 }
217
218 /**
219  * gst_caps_features_new_valist:
220  * @feature1: name of first feature to set
221  * @varargs: variable argument list
222  *
223  * Creates a new #GstCapsFeatures with the given features.
224  *
225  * Free-function: gst_caps_features_free
226  *
227  * Returns: (transfer full): a new, empty #GstCapsFeatures
228  *
229  * Since: 1.2
230  */
231 GstCapsFeatures *
232 gst_caps_features_new_valist (const gchar * feature1, va_list varargs)
233 {
234   GstCapsFeatures *features;
235
236   g_return_val_if_fail (feature1 != NULL, NULL);
237
238   features = gst_caps_features_new_empty ();
239
240   while (feature1) {
241     gst_caps_features_add (features, feature1);
242     feature1 = va_arg (varargs, const gchar *);
243   }
244
245   return features;
246 }
247
248 /**
249  * gst_caps_features_new_id:
250  * @feature1: name of first feature to set
251  * @...: additional features
252  *
253  * Creates a new #GstCapsFeatures with the given features.
254  * The last argument must be 0.
255  *
256  * Free-function: gst_caps_features_free
257  *
258  * Returns: (transfer full): a new, empty #GstCapsFeatures
259  *
260  * Since: 1.2
261  */
262 GstCapsFeatures *
263 gst_caps_features_new_id (GQuark feature1, ...)
264 {
265   GstCapsFeatures *features;
266   va_list varargs;
267
268   g_return_val_if_fail (feature1 != 0, NULL);
269
270   va_start (varargs, feature1);
271   features = gst_caps_features_new_id_valist (feature1, varargs);
272   va_end (varargs);
273
274   return features;
275 }
276
277 /**
278  * gst_caps_features_new_id_valist:
279  * @feature1: name of first feature to set
280  * @varargs: variable argument list
281  *
282  * Creates a new #GstCapsFeatures with the given features.
283  *
284  * Free-function: gst_caps_features_free
285  *
286  * Returns: (transfer full): a new, empty #GstCapsFeatures
287  *
288  * Since: 1.2
289  */
290 GstCapsFeatures *
291 gst_caps_features_new_id_valist (GQuark feature1, va_list varargs)
292 {
293   GstCapsFeatures *features;
294
295   g_return_val_if_fail (feature1 != 0, NULL);
296
297   features = gst_caps_features_new_empty ();
298
299   while (feature1) {
300     gst_caps_features_add_id (features, feature1);
301     feature1 = va_arg (varargs, GQuark);
302   }
303
304   return features;
305 }
306
307 /**
308  * gst_caps_features_set_parent_refcount:
309  * @features: a #GstCapsFeatures
310  * @refcount: (in): a pointer to the parent's refcount
311  *
312  * Sets the parent_refcount field of #GstCapsFeatures. This field is used to
313  * determine whether a caps features is mutable or not. This function should only be
314  * called by code implementing parent objects of #GstCapsFeatures, as described in
315  * the MT Refcounting section of the design documents.
316  *
317  * Returns: %TRUE if the parent refcount could be set.
318  *
319  * Since: 1.2
320  */
321 gboolean
322 gst_caps_features_set_parent_refcount (GstCapsFeatures * features,
323     gint * refcount)
324 {
325   g_return_val_if_fail (features != NULL, FALSE);
326
327   /* if we have a parent_refcount already, we can only clear
328    * if with a NULL refcount */
329   if (features->parent_refcount) {
330     if (refcount != NULL) {
331       g_return_val_if_fail (refcount == NULL, FALSE);
332       return FALSE;
333     }
334   } else {
335     if (refcount == NULL) {
336       g_return_val_if_fail (refcount != NULL, FALSE);
337       return FALSE;
338     }
339   }
340
341   features->parent_refcount = refcount;
342
343   return TRUE;
344 }
345
346 /**
347  * gst_caps_features_copy:
348  * @features: a #GstCapsFeatures to duplicate
349  *
350  * Duplicates a #GstCapsFeatures and all its values.
351  *
352  * Free-function: gst_caps_features_free
353  *
354  * Returns: (transfer full): a new #GstCapsFeatures.
355  *
356  * Since: 1.2
357  */
358 GstCapsFeatures *
359 gst_caps_features_copy (const GstCapsFeatures * features)
360 {
361   GstCapsFeatures *copy;
362   guint i, n;
363
364   g_return_val_if_fail (features != NULL, NULL);
365
366   copy = gst_caps_features_new_empty ();
367   n = gst_caps_features_get_size (features);
368   for (i = 0; i < n; i++)
369     gst_caps_features_add_id (copy, gst_caps_features_get_nth_id (features, i));
370
371   return copy;
372 }
373
374 /**
375  * gst_caps_features_free:
376  * @features: (in) (transfer full): the #GstCapsFeatures to free
377  *
378  * Frees a #GstCapsFeatures and all its values. The caps features must not
379  * have a parent when this function is called.
380  *
381  * Since: 1.2
382  */
383 void
384 gst_caps_features_free (GstCapsFeatures * features)
385 {
386   g_return_if_fail (features != NULL);
387   g_return_if_fail (features->parent_refcount == NULL);
388
389   g_array_free (features->array, TRUE);
390 #ifdef USE_POISONING
391   memset (features, 0xff, sizeof (GstCapsFeatures));
392 #endif
393   GST_TRACE ("free caps features %p", features);
394
395   g_slice_free (GstCapsFeatures, features);
396 }
397
398 /**
399  * gst_caps_features_to_string:
400  * @features: a #GstCapsFeatures
401  *
402  * Converts @features to a human-readable string representation.
403  *
404  * For debugging purposes its easier to do something like this:
405  * |[
406  * GST_LOG ("features is %" GST_PTR_FORMAT, features);
407  * ]|
408  * This prints the features in human readble form.
409  *
410  * Free-function: g_free
411  *
412  * Returns: (transfer full): a pointer to string allocated by g_malloc().
413  *     g_free() after usage.
414  *
415  * Since: 1.2
416  */
417 gchar *
418 gst_caps_features_to_string (const GstCapsFeatures * features)
419 {
420   GString *s;
421
422   g_return_val_if_fail (features != NULL, NULL);
423
424   s = g_string_sized_new (FEATURES_ESTIMATED_STRING_LEN (features));
425
426   priv_gst_caps_features_append_to_gstring (features, s);
427
428   return g_string_free (s, FALSE);
429 }
430
431 void
432 priv_gst_caps_features_append_to_gstring (const GstCapsFeatures * features,
433     GString * s)
434 {
435   guint i, n;
436
437   g_return_if_fail (features != NULL);
438
439   if (features->array->len == 0 && features->is_any) {
440     g_string_append (s, "ANY");
441     return;
442   }
443
444   n = features->array->len;
445   for (i = 0; i < n; i++) {
446     GQuark *quark = &g_array_index (features->array, GQuark, i);
447
448     g_string_append (s, g_quark_to_string (*quark));
449     if (i + 1 < n)
450       g_string_append (s, ", ");
451   }
452 }
453
454 /**
455  * gst_caps_features_from_string:
456  * @features: a string representation of a #GstCapsFeatures.
457  *
458  * Creates a #GstCapsFeatures from a string representation.
459  *
460  * Free-function: gst_caps_features_free
461  *
462  * Returns: (transfer full): a new #GstCapsFeatures or NULL when the string could
463  *     not be parsed. Free with gst_caps_features_free() after use.
464  *
465  * Since: 1.2
466  */
467 GstCapsFeatures *
468 gst_caps_features_from_string (const gchar * features)
469 {
470   GstCapsFeatures *ret;
471   gboolean escape = FALSE;
472   const gchar *features_orig = features;
473   const gchar *feature;
474
475   ret = gst_caps_features_new_empty ();
476
477   if (!features || *features == '\0')
478     return ret;
479
480   if (strcmp (features, "ANY") == 0) {
481     ret->is_any = TRUE;
482     return ret;
483   }
484
485   /* Skip trailing spaces */
486   while (*features == ' ')
487     features++;
488
489   feature = features;
490   while (TRUE) {
491     gchar c = *features;
492
493     if (c == '\\') {
494       escape = TRUE;
495       features++;
496       continue;
497     } else if ((!escape && c == ',') || c == '\0') {
498       guint len = features - feature + 1;
499       gchar *tmp;
500       gchar *p;
501
502       if (len == 1) {
503         g_warning ("Failed deserialize caps features '%s'", features_orig);
504         gst_caps_features_free (ret);
505         return NULL;
506       }
507
508       tmp = g_malloc (len);
509       memcpy (tmp, feature, len - 1);
510       tmp[len - 1] = '\0';
511
512       p = tmp + len - 1;
513       while (*p == ' ') {
514         *p = '\0';
515         p--;
516       }
517
518       if (strstr (tmp, " ") != NULL || *tmp == '\0') {
519         g_free (tmp);
520         g_warning ("Failed deserialize caps features '%s'", features_orig);
521         gst_caps_features_free (ret);
522         return NULL;
523       }
524
525       gst_caps_features_add (ret, tmp);
526       g_free (tmp);
527
528       if (c == '\0')
529         break;
530
531       /* Skip to the next value */
532       features++;
533       while (*features == ' ')
534         features++;
535       feature = features;
536     } else {
537       escape = FALSE;
538       features++;
539     }
540   }
541
542   return ret;
543 }
544
545 /**
546  * gst_caps_features_get_size:
547  * @features: a #GstCapsFeatures.
548  *
549  * Returns the number of features in @features.
550  *
551  * Returns: The number of features in @features.
552  *
553  * Since: 1.2
554  */
555 guint
556 gst_caps_features_get_size (const GstCapsFeatures * features)
557 {
558   g_return_val_if_fail (features != NULL, 0);
559
560   return features->array->len;
561 }
562
563 /**
564  * gst_caps_features_get_nth:
565  * @features: a #GstCapsFeatures.
566  * @i: index of the feature
567  *
568  * Returns the @i-th feature of @features.
569  *
570  * Returns: The @i-th feature of @features.
571  *
572  * Since: 1.2
573  */
574 const gchar *
575 gst_caps_features_get_nth (const GstCapsFeatures * features, guint i)
576 {
577   const gchar *feature;
578   GQuark quark;
579
580   g_return_val_if_fail (features != NULL, NULL);
581
582   quark = gst_caps_features_get_nth_id (features, i);
583   if (!quark)
584     return NULL;
585
586   feature = g_quark_to_string (quark);
587   return feature;
588 }
589
590 /**
591  * gst_caps_features_get_nth_id:
592  * @features: a #GstCapsFeatures.
593  * @i: index of the feature
594  *
595  * Returns the @i-th feature of @features.
596  *
597  * Returns: The @i-th feature of @features.
598  *
599  * Since: 1.2
600  */
601 GQuark
602 gst_caps_features_get_nth_id (const GstCapsFeatures * features, guint i)
603 {
604   GQuark *quark;
605
606   g_return_val_if_fail (features != NULL, 0);
607   g_return_val_if_fail (i < features->array->len, 0);
608
609   quark = &g_array_index (features->array, GQuark, i);
610
611   return *quark;
612 }
613
614 /**
615  * gst_caps_features_contains:
616  * @features: a #GstCapsFeatures.
617  * @feature: a feature
618  *
619  * Check if @features contains @feature.
620  *
621  * Returns: %TRUE if @features contains @feature.
622  *
623  * Since: 1.2
624  */
625 gboolean
626 gst_caps_features_contains (const GstCapsFeatures * features,
627     const gchar * feature)
628 {
629   g_return_val_if_fail (features != NULL, FALSE);
630   g_return_val_if_fail (feature != NULL, FALSE);
631
632   return gst_caps_features_contains_id (features,
633       g_quark_from_string (feature));
634 }
635
636 /**
637  * gst_caps_features_contains_id:
638  * @features: a #GstCapsFeatures.
639  * @feature: a feature
640  *
641  * Check if @features contains @feature.
642  *
643  * Returns: %TRUE if @features contains @feature.
644  *
645  * Since: 1.2
646  */
647 gboolean
648 gst_caps_features_contains_id (const GstCapsFeatures * features, GQuark feature)
649 {
650   guint i, n;
651
652   g_return_val_if_fail (features != NULL, FALSE);
653   g_return_val_if_fail (feature != 0, FALSE);
654
655   if (features->is_any)
656     return TRUE;
657
658   n = features->array->len;
659   if (n == 0)
660     return feature == _gst_caps_feature_memory_system_memory;
661
662   for (i = 0; i < n; i++) {
663     if (gst_caps_features_get_nth_id (features, i) == feature)
664       return TRUE;
665   }
666
667   return FALSE;
668 }
669
670 /**
671  * gst_caps_features_is_equal:
672  * @features1: a #GstCapsFeatures.
673  * @features2: a #GstCapsFeatures.
674  *
675  * Check if @features1 and @features2 are equal.
676  *
677  * Returns: %TRUE if @features1 and @features2 are equal.
678  *
679  * Since: 1.2
680  */
681 gboolean
682 gst_caps_features_is_equal (const GstCapsFeatures * features1,
683     const GstCapsFeatures * features2)
684 {
685   guint i, n;
686
687   g_return_val_if_fail (features1 != NULL, FALSE);
688   g_return_val_if_fail (features2 != NULL, FALSE);
689
690   if (features1->is_any || features2->is_any)
691     return TRUE;
692
693   /* Check for the sysmem==empty case */
694   if (features1->array->len == 0 && features2->array->len == 0)
695     return TRUE;
696   if (features1->array->len == 0 && features2->array->len == 1
697       && gst_caps_features_contains_id (features2,
698           _gst_caps_feature_memory_system_memory))
699     return TRUE;
700   if (features2->array->len == 0 && features1->array->len == 1
701       && gst_caps_features_contains_id (features1,
702           _gst_caps_feature_memory_system_memory))
703     return TRUE;
704
705   if (features1->array->len != features2->array->len)
706     return FALSE;
707
708   n = features1->array->len;
709   for (i = 0; i < n; i++)
710     if (!gst_caps_features_contains_id (features2,
711             gst_caps_features_get_nth_id (features1, i)))
712       return FALSE;
713
714   return TRUE;
715 }
716
717 /**
718  * gst_caps_features_is_any:
719  * @features: a #GstCapsFeatures.
720  *
721  * Check if @features is %GST_CAPS_FEATURES_ANY.
722  *
723  * Returns: %TRUE if @features is %GST_CAPS_FEATURES_ANY.
724  *
725  * Since: 1.2
726  */
727 gboolean
728 gst_caps_features_is_any (const GstCapsFeatures * features)
729 {
730   g_return_val_if_fail (features != NULL, FALSE);
731
732   return features->is_any;
733 }
734
735 /**
736  * gst_caps_features_add:
737  * @features: a #GstCapsFeatures.
738  * @feature: a feature.
739  *
740  * Adds @feature to @features.
741  *
742  * Since: 1.2
743  */
744 void
745 gst_caps_features_add (GstCapsFeatures * features, const gchar * feature)
746 {
747   g_return_if_fail (features != NULL);
748   g_return_if_fail (IS_MUTABLE (features));
749   g_return_if_fail (feature != NULL);
750   g_return_if_fail (!features->is_any);
751
752   gst_caps_features_add_id (features, g_quark_from_string (feature));
753 }
754
755 /**
756  * gst_caps_features_add_id:
757  * @features: a #GstCapsFeatures.
758  * @feature: a feature.
759  *
760  * Adds @feature to @features.
761  *
762  * Since: 1.2
763  */
764 void
765 gst_caps_features_add_id (GstCapsFeatures * features, GQuark feature)
766 {
767   g_return_if_fail (features != NULL);
768   g_return_if_fail (IS_MUTABLE (features));
769   g_return_if_fail (feature != 0);
770   g_return_if_fail (!features->is_any);
771
772   if (!gst_caps_feature_name_is_valid (g_quark_to_string (feature))) {
773     g_warning ("Invalid caps feature name: %s", g_quark_to_string (feature));
774     return;
775   }
776
777   /* If features is empty it will contain sysmem, however
778    * we want to add it explicitely if it is tried to be
779    * added as first features
780    */
781   if (features->array->len > 0
782       && gst_caps_features_contains_id (features, feature))
783     return;
784
785   g_array_append_val (features->array, feature);
786 }
787
788 /**
789  * gst_caps_features_remove:
790  * @features: a #GstCapsFeatures.
791  * @feature: a feature.
792  *
793  * Removes @feature from @features.
794  *
795  * Since: 1.2
796  */
797 void
798 gst_caps_features_remove (GstCapsFeatures * features, const gchar * feature)
799 {
800   g_return_if_fail (features != NULL);
801   g_return_if_fail (IS_MUTABLE (features));
802   g_return_if_fail (feature != NULL);
803
804   gst_caps_features_remove_id (features, g_quark_from_string (feature));
805 }
806
807 /**
808  * gst_caps_features_remove_id:
809  * @features: a #GstCapsFeatures.
810  * @feature: a feature.
811  *
812  * Removes @feature from @features.
813  *
814  * Since: 1.2
815  */
816 void
817 gst_caps_features_remove_id (GstCapsFeatures * features, GQuark feature)
818 {
819   guint i, n;
820
821   g_return_if_fail (features != NULL);
822   g_return_if_fail (IS_MUTABLE (features));
823   g_return_if_fail (feature != 0);
824
825   n = features->array->len;
826   for (i = 0; i < n; i++) {
827     GQuark quark = gst_caps_features_get_nth_id (features, i);
828
829     if (quark == feature) {
830       g_array_remove_index_fast (features->array, i);
831       return;
832     }
833   }
834 }
835
836 static void
837 gst_caps_features_transform_to_string (const GValue * src_value,
838     GValue * dest_value)
839 {
840   g_return_if_fail (src_value != NULL);
841   g_return_if_fail (dest_value != NULL);
842
843   dest_value->data[0].v_pointer =
844       gst_caps_features_to_string (src_value->data[0].v_pointer);
845 }