【发布时间】:2020-07-30 13:36:08
【问题描述】:
我正在尝试为使用 gobject 的结构创建 ctypes 包装器。
结构体定义如下:
struct GstMetaStruc
{
GstMeta meta;
GstStructure* structure;
};
GstMeta 有一个现有的自省包装器,可以让我访问基本元对象。
我目前的错误方法如下所示:
import ctypes
import gi
gi.require_version("Gst", "1.0")
from gi.repository import Gst
class TcamMeta(ctypes.Structure):
"""
"""
_fields_ = [("meta", Gst.Meta),
("structure", ctypes.POINTER(Gst.Structure))]
是否可以将 ctype 定义与现有的 python 包装类混合使用?
有没有更好的方法来为派生类型定义 python 类?
【问题讨论】:
标签: python gstreamer ctypes gobject