使用Visual Studio 2010编写GStreamer插件

时间:2023-01-21 16:34:32

I’m trying to write a Gstreamer plugin in Visual Studio 2010.

我正在尝试在Visual Studio 2010中编写Gstreamer插件。

First, I've downloaded GStreamer package for Windows from http://gstreamer.freedesktop.org/download/.

首先,我从http://gstreamer.freedesktop.org/download/下载了适用于Windows的GStreamer软件包。

Then, I’ve added required property sheets and removed the dependency with the Visual Studio runtime as described in http://docs.gstreamer.com/display/GstSDK/Installing+on+Windows. I successfully built some examples from Gstreamer Application Development Manual, so I think that SDK is set up correctly.

然后,我添加了必需的属性表,并删除了Visual Studio运行时的依赖关系,如http://docs.gstreamer.com/display/GstSDK/Installing+on+Windows中所述。我成功地从Gstreamer应用程序开发手册中构建了一些示例,因此我认为SDK已正确设置。

Now, my other goal is to write my own plugins. The Plugin Writer’s Guide describes how to construct the boilerplate in Unix/Linux. I've downloaded gst plugin templates from

现在,我的另一个目标是编写自己的插件。插件编写者指南描述了如何在Unix / Linux中构建样板。我已经从中下载了gst插件模板

git clone git://anongit.freedesktop.org/gstreamer/gst-tmeplate.git

git clone git://anongit.freedesktop.org/gstreamer/gst-tmeplate.git

The guide makes use of make_element utility that creates the boilerplate. I followed the instructions but this utility doesn't work on Windows.

该指南使用make_element实用程序来创建样板文件。我按照说明操作,但此实用程序在Windows上不起作用。

So I added "gstplugin.c" and "gstplugin.h" to my Visual Studio project as is. I noticed that “gstplugin.c” doesn’t have main function, what is the program’s entry point then?

所以我按原样将“gstplugin.c”和“gstplugin.h”添加到我的Visual Studio项目中。我注意到“gstplugin.c”没有main函数,那么程序的入口点是什么?

I tried to build the sample plugin as is (I didn't change templates "gstplugin.c" and "gstplugin.h") and got the following link error:

我试图按原样构建示例插件(我没有更改模板“gstplugin.c”和“gstplugin.h”)并得到以下链接错误:

msvcrt.lib(crtexe.obj) : error LNK2001: unresolved external symbol main

msvcrt.lib(crtexe.obj):错误LNK2001:未解析的外部符号main

How can I write a Gstreamer plugin in Visual Studio? Also, How can I build it? I'm struggling to find good instructions on how to do this.

如何在Visual Studio中编写Gstreamer插件?另外,我该如何构建它?我很难找到关于如何做到这一点的良好指示。

1 个解决方案

#1


0  

I just needed to compile my project as dll (instead of application)

我只需要将我的项目编译为dll(而不是应用程序)

This property can be set in Visual Studio under -> properties -> Configuration Properties -> and then set "Configuration Type" to "Dynamic Library (.dll)".

可以在Visual Studio中的 - > properties - > Configuration Properties - >中设置此属性,然后将“Configuration Type”设置为“Dynamic Library(.dll)”。

#1


0  

I just needed to compile my project as dll (instead of application)

我只需要将我的项目编译为dll(而不是应用程序)

This property can be set in Visual Studio under -> properties -> Configuration Properties -> and then set "Configuration Type" to "Dynamic Library (.dll)".

可以在Visual Studio中的 - > properties - > Configuration Properties - >中设置此属性,然后将“Configuration Type”设置为“Dynamic Library(.dll)”。