Initial implementation of NI IMAQdx element
This commit is contained in:
parent
c3f2b1db5d
commit
6c745ca706
@ -10,6 +10,10 @@ if (NIIMAQ_FOUND)
|
||||
add_subdirectory (niimaq)
|
||||
endif (NIIMAQ_FOUND)
|
||||
|
||||
if (NIIMAQDX_FOUND)
|
||||
add_subdirectory (niimaqdx)
|
||||
endif (NIIMAQDX_FOUND)
|
||||
|
||||
if (IOTECHDAQX_FOUND)
|
||||
add_subdirectory (iotechdaqx)
|
||||
endif (IOTECHDAQX_FOUND)
|
||||
|
||||
25
sys/niimaqdx/CMakeLists.txt
Normal file
25
sys/niimaqdx/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
|
||||
set ( SOURCES
|
||||
gstniimaqdx.c )
|
||||
|
||||
set ( HEADERS
|
||||
gstniimaqdx.h )
|
||||
|
||||
include_directories ( AFTER
|
||||
.
|
||||
${NIIMAQDX_INCLUDE_DIR} )
|
||||
|
||||
add_library ( libgstimaqdx MODULE
|
||||
${SOURCES}
|
||||
${HEADERS} )
|
||||
|
||||
target_link_libraries ( libgstimaqdx
|
||||
general ${GLIB2_LIBRARIES}
|
||||
general ${GSTREAMER_LIBRARIES}
|
||||
general ${GSTREAMER_BASE_LIBRARY}
|
||||
general ${GSTREAMER_INTERFACE_LIBRARY}
|
||||
general ${NIIMAQDX_LIBRARIES} )
|
||||
|
||||
install (TARGETS libgstimaqdx
|
||||
LIBRARY DESTINATION lib/gstreamer-0.10)
|
||||
1072
sys/niimaqdx/gstniimaqdx.c
Normal file
1072
sys/niimaqdx/gstniimaqdx.c
Normal file
File diff suppressed because it is too large
Load Diff
89
sys/niimaqdx/gstniimaqdx.h
Normal file
89
sys/niimaqdx/gstniimaqdx.h
Normal file
@ -0,0 +1,89 @@
|
||||
/* GStreamer
|
||||
* Copyright (C) <2006> Eric Jonas <jonas@mit.edu>
|
||||
* Copyright (C) <2006> Antoine Tremblay <hexa00@gmail.com>
|
||||
* Copyright (C) 2013 United States Government, Joshua M. Doe <oss@nvl.army.mil>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_NIIMAQDXSRC_H__
|
||||
#define __GST_NIIMAQDXSRC_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstpushsrc.h>
|
||||
#include <gst/video/video.h>
|
||||
|
||||
#include <niimaqdx.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_NIIMAQDXSRC \
|
||||
(gst_niimaqdxsrc_get_type())
|
||||
#define GST_NIIMAQDXSRC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NIIMAQDXSRC,GstNiImaqDxSrc))
|
||||
#define GST_NIIMAQDXSRC_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NIIMAQDXSRC,GstNiImaqDxSrcClass))
|
||||
#define GST_IS_NIIMAQDXSRC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NIIMAQDXSRC))
|
||||
#define GST_IS_NIIMAQDXSRC_CLASS(obj) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NIIMAQDXSRC))
|
||||
#define GST_NIIMAQDXSRC_GET_CLASS(klass) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((klass), GST_TYPE_NIIMAQDXSRC, GstNiImaqDxSrcClass))
|
||||
|
||||
typedef struct _GstNiImaqDxSrc GstNiImaqDxSrc;
|
||||
typedef struct _GstNiImaqDxSrcClass GstNiImaqDxSrcClass;
|
||||
|
||||
struct _GstNiImaqDxSrc {
|
||||
GstPushSrc element;
|
||||
|
||||
/* properties */
|
||||
gchar *device_name;
|
||||
gint ringbuffer_count;
|
||||
|
||||
/* image info */
|
||||
GstVideoFormat format;
|
||||
int width;
|
||||
int height;
|
||||
gint framesize;
|
||||
|
||||
gint64 n_frames; /* total frames sent */
|
||||
uInt32 cumbufnum;
|
||||
gint64 n_dropped_frames;
|
||||
|
||||
GstClockTime *times;
|
||||
IMAQdxSession session;
|
||||
|
||||
gboolean session_started;
|
||||
GstClockTime base_time;
|
||||
|
||||
GstDateTime *start_time;
|
||||
gboolean start_time_sent;
|
||||
|
||||
GMutex *mutex;
|
||||
};
|
||||
|
||||
struct _GstNiImaqDxSrcClass {
|
||||
GstPushSrcClass parent_class;
|
||||
|
||||
/* probed interfaces */
|
||||
GList *devices;
|
||||
};
|
||||
|
||||
GType gst_niimaqdxsrc_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_NIIMAQDXSRC_H__ */
|
||||
@ -1,6 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C++ Express 2010
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "niimaq", "niimaq\niimaq.vcxproj", "{C617FD30-1297-417A-99F0-4F45B48EA8DF}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "videoadjust", "videoadjust\videoadjust.vcxproj", "{B77B6B47-9CB4-4A0B-B76F-877E57F90ADD}"
|
||||
@ -9,28 +9,46 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "phoenix", "phoenix\phoenix.
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "edt", "edt\edt.vcxproj", "{351947AF-6445-4644-987D-FFE4FDDD3B4C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libniimaqdx", "niimaqdx\niimaqdx.vcxproj", "{A212EA33-4648-42CB-83C8-72F484AB7855}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C617FD30-1297-417A-99F0-4F45B48EA8DF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C617FD30-1297-417A-99F0-4F45B48EA8DF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C617FD30-1297-417A-99F0-4F45B48EA8DF}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{C617FD30-1297-417A-99F0-4F45B48EA8DF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C617FD30-1297-417A-99F0-4F45B48EA8DF}.Release|Win32.Build.0 = Release|Win32
|
||||
{C617FD30-1297-417A-99F0-4F45B48EA8DF}.Release|x64.ActiveCfg = Release|Win32
|
||||
{B77B6B47-9CB4-4A0B-B76F-877E57F90ADD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B77B6B47-9CB4-4A0B-B76F-877E57F90ADD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B77B6B47-9CB4-4A0B-B76F-877E57F90ADD}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{B77B6B47-9CB4-4A0B-B76F-877E57F90ADD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B77B6B47-9CB4-4A0B-B76F-877E57F90ADD}.Release|Win32.Build.0 = Release|Win32
|
||||
{B77B6B47-9CB4-4A0B-B76F-877E57F90ADD}.Release|x64.ActiveCfg = Release|Win32
|
||||
{55049618-6388-411C-818C-9140D6F8CE99}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{55049618-6388-411C-818C-9140D6F8CE99}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{55049618-6388-411C-818C-9140D6F8CE99}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{55049618-6388-411C-818C-9140D6F8CE99}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{55049618-6388-411C-818C-9140D6F8CE99}.Release|Win32.Build.0 = Release|Win32
|
||||
{55049618-6388-411C-818C-9140D6F8CE99}.Release|x64.ActiveCfg = Release|Win32
|
||||
{351947AF-6445-4644-987D-FFE4FDDD3B4C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{351947AF-6445-4644-987D-FFE4FDDD3B4C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{351947AF-6445-4644-987D-FFE4FDDD3B4C}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{351947AF-6445-4644-987D-FFE4FDDD3B4C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{351947AF-6445-4644-987D-FFE4FDDD3B4C}.Release|Win32.Build.0 = Release|Win32
|
||||
{351947AF-6445-4644-987D-FFE4FDDD3B4C}.Release|x64.ActiveCfg = Release|Win32
|
||||
{A212EA33-4648-42CB-83C8-72F484AB7855}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A212EA33-4648-42CB-83C8-72F484AB7855}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A212EA33-4648-42CB-83C8-72F484AB7855}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{A212EA33-4648-42CB-83C8-72F484AB7855}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A212EA33-4648-42CB-83C8-72F484AB7855}.Release|Win32.Build.0 = Release|Win32
|
||||
{A212EA33-4648-42CB-83C8-72F484AB7855}.Release|x64.ActiveCfg = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
17
vs2010/niimaqdx/niimaqdx.props
Normal file
17
vs2010/niimaqdx/niimaqdx.props
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" ?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="UserMacros"/>
|
||||
<PropertyGroup>
|
||||
<niimaqImported>true</niimaqImported>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>C:\Program Files (x86)\National Instruments\NI-IMAQdx\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories>C:\Program Files (x86)\National Instruments\NI-IMAQdx\lib\msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>niimaqdx.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup/>
|
||||
</Project>
|
||||
103
vs2010/niimaqdx/niimaqdx.vcxproj
Normal file
103
vs2010/niimaqdx/niimaqdx.vcxproj
Normal file
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\sys\niimaqdx\gstniimaqdx.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\sys\niimaqdx\gstniimaqdx.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{A212EA33-4648-42CB-83C8-72F484AB7855}</ProjectGuid>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<ProjectName>libniimaqdx</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Platform)'=='Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(GSTREAMER_SDK_ROOT_X86)\share\vs\2010\libs\gstreamer-0.10.props" Condition="exists('$(GSTREAMER_SDK_ROOT_X86)\share\vs\2010\libs\gstreamer-0.10.props')" />
|
||||
<Import Project="$(GSTREAMER_SDK_ROOT_X86)\share\vs\2010\msvc\x86.props" Condition="exists('$(GSTREAMER_SDK_ROOT_X86)\share\vs\2010\msvc\x86.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Platform)'=='x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(GSTREAMER_SDK_ROOT_X86_64)\share\vs\2010\libs\gstreamer-0.10.props" Condition="exists('$(GSTREAMER_SDK_ROOT_X86_64)\share\vs\2010\libs\gstreamer-0.10.props')" />
|
||||
<Import Project="$(GSTREAMER_SDK_ROOT_X86_64)\share\vs\2010\msvc\x86_64.props" Condition="exists('$(GSTREAMER_SDK_ROOT_X86_64)\share\vs\2010\msvc\x86_64.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="niimaqdx.props" />
|
||||
<Import Project="..\..\..\..\gstreamer-sdk\0.10\x86\share\vs\2010\libs\gstreamer-interfaces-0.10.props" />
|
||||
<Import Project="..\..\..\..\gstreamer-sdk\0.10\x86\share\vs\2010\libs\gstreamer-video-0.10.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="niimaqdx.props" />
|
||||
<Import Project="..\..\..\..\gstreamer-sdk\0.10\x86\share\vs\2010\libs\gstreamer-interfaces-0.10.props" />
|
||||
<Import Project="..\..\..\..\gstreamer-sdk\0.10\x86\share\vs\2010\libs\gstreamer-video-0.10.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>HAVE_CONFIG_H;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
27
vs2010/niimaqdx/niimaqdx.vcxproj.filters
Normal file
27
vs2010/niimaqdx/niimaqdx.vcxproj.filters
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{f49096c0-8698-4459-8a7c-b799838532bf}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{c8c60a9e-7c9b-4932-afca-9b3e73adfac0}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{159c54cd-3e1e-4614-997b-fee4b885b408}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\sys\niimaqdx\gstniimaqdx.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\sys\niimaqdx\gstniimaqdx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Loading…
x
Reference in New Issue
Block a user