我正在使用GStreamer插件创建自定义Kurento模块,我创建了一个名为“RtmpEndpoint”的新模块,它扩展了Endpoint。
我能够构建和安装模块并生成要使用的客户端js API。
但是无法加载模块,错误日志显示:
(gst-plugin-scanner:3379):GStreamer-WARNING *:无法加载插件'/usr/lib/x86_64-linux-gnu/gstreamer-1.5/librtmpendpoint.so':/ usr / lib / x86_64- linux-gnu / gstreamer-1.5 / librtmpendpoint.so:未定义的符号:kms_element_get_type
我确实在源文件和头文件中定义了kms_rtmp_endpoint_get_type()函数,我很困惑为什么会发生这个错误,请帮助,谢谢。
头文件:
typedef struct _KmsRtmpEndpoint KmsRtmpEndpoint;
typedef struct _KmsRtmpEndpointClass KmsRtmpEndpointClass;
struct _KmsRtmpEndpoint
{
KmsElement element;
GstElement *h264depay;
GstElement *pcmudepay;
GstElement *flvmuxer;
GstElement *rtmpsink;
GstPad *videoPad, *audioPad;
gboolean silent;
};
struct _KmsRtmpEndpointClass
{
KmsElementClass parent_class;
};
GType kms_rtmp_endpoint_get_type (void);
和部分源文件:
static GstStaticPadTemplate video_sink = GST_STATIC_PAD_TEMPLATE ("video",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("application/x-rtp, "
"media = (string) \"video\", "
"clock-rate = (int) 90000, " "encoding-name = (string) \"H264\"")
);
static GstStaticPadTemplate audio_sink = GST_STATIC_PAD_TEMPLATE ("audio",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("application/x-rtp, "
"media = (string) \"audio\", "
"payload = (int) " GST_RTP_PAYLOAD_PCMU_STRING ", "
"clock-rate = (int) 8000; "
"application/x-rtp, "
"media = (string) \"audio\", "
"encoding-name = (string) \"PCMU\", clock-rate = (int) [1, MAX ]")
);
#define kms_rtmp_endpoint_parent_class parent_class
G_DEFINE_TYPE (KmsRtmpEndpoint, kms_rtmp_endpoint, KMS_TYPE_ELEMENT);
答案 0 :(得分:-1)
也许您不应在源文件中定义kms_rtmp_endpoint_get_type()
,G_DEFINE_TYPE
会自动生成它。