this uyarınca, Python bağlamaları kullanarak GArray oluşturmanın mümkün olmadığını düşünüyorum. Bunu aşmak için bir GArray döndürecek küçük bir kütüphane yazıyorum. Bu kitaplık gobject iç gözlemini kullanır ve create_codec_array yöntemini sunar.gobject introspection öğesi türü GstStructure
webrtc_interface.c:149: Warning: Webrtc: webrtc_interface_create_codec_array:
Unknown type: 'GstStructure'
Bu işlev ben kendi içimize mümkün değilim GstStructure elemanları, bir GARRAY dönen: Ben gr-ir-tarayıcı çalıştırdığınızda
/**
* webrtc_interface_create_codec_array:
* @interface: a #WebrtcInterface
*
* creates codecs_array.
*
* Returns: (element-type GstStructure) (transfer full): a #GArray of #GstStructure
*/
GArray *
webrtc_interface_create_codec_array (WebrtcInterface * interface)
{
WebrtcInterfacePrivate *priv ;
g_return_if_fail (interface != NULL);
priv = WEBRTC_INTERFACE_GET_PRIVATE (interface);
gchar * codecs[] = {priv->codec, NULL};
GArray *a = g_array_new (FALSE, TRUE, sizeof (GValue));
int i;
for (i=0; i < g_strv_length (codecs); i++) {
GValue v = G_VALUE_INIT;
GstStructure *s;
g_value_init (&v, GST_TYPE_STRUCTURE);
s = gst_structure_new (codecs[i], NULL, NULL);
gst_value_set_structure (&v, s);
gst_structure_free (s);
g_array_append_val (a, v);
}
return a;
}
, aşağıdaki hatayı alıyorum. Bu durumda eleman tipi açıklama ne olmalıdır?
Çok teşekkürler!