klv: make KLV support optional via ENABLE_KLV, disabled by default
This prevents the building of the klv library and plugin, and disables KLV support and dependency in the Pleora plugin.
This commit is contained in:
parent
feca1a7969
commit
a6e97d08df
@ -2,6 +2,8 @@ cmake_minimum_required(VERSION "2.8.0")
|
|||||||
|
|
||||||
project(gst-plugins-vision)
|
project(gst-plugins-vision)
|
||||||
|
|
||||||
|
option(ENABLE_KLV "Whether to enable KLV support" OFF)
|
||||||
|
|
||||||
set(CMAKE_SHARED_MODULE_PREFIX "lib")
|
set(CMAKE_SHARED_MODULE_PREFIX "lib")
|
||||||
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
|
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
|
||||||
|
|
||||||
|
|||||||
@ -1 +1,3 @@
|
|||||||
add_subdirectory (klv)
|
if (ENABLE_KLV)
|
||||||
|
add_subdirectory (klv)
|
||||||
|
endif ()
|
||||||
@ -4,7 +4,11 @@ endif (OPENCV_FOUND)
|
|||||||
|
|
||||||
add_subdirectory (bayerutils)
|
add_subdirectory (bayerutils)
|
||||||
add_subdirectory (extractcolor)
|
add_subdirectory (extractcolor)
|
||||||
add_subdirectory (klv)
|
|
||||||
|
if (ENABLE_KLV)
|
||||||
|
add_subdirectory (klv)
|
||||||
|
endif ()
|
||||||
|
|
||||||
add_subdirectory (misb)
|
add_subdirectory (misb)
|
||||||
add_subdirectory (select)
|
add_subdirectory (select)
|
||||||
add_subdirectory (videoadjust)
|
add_subdirectory (videoadjust)
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
if (ENABLE_KLV)
|
||||||
|
add_definitions(-DGST_PLUGINS_VISION_ENABLE_KLV)
|
||||||
|
endif ()
|
||||||
|
|
||||||
add_definitions(-D_XKEYCHECK_H)
|
add_definitions(-D_XKEYCHECK_H)
|
||||||
|
|
||||||
set (SOURCES
|
set (SOURCES
|
||||||
@ -32,13 +36,21 @@ add_library (${libname} MODULE
|
|||||||
${SOURCES}
|
${SOURCES}
|
||||||
${HEADERS})
|
${HEADERS})
|
||||||
|
|
||||||
target_link_libraries (${libname}
|
set (LIBRARIES
|
||||||
${GLIB2_LIBRARIES}
|
${GLIB2_LIBRARIES}
|
||||||
${GOBJECT_LIBRARIES}
|
${GOBJECT_LIBRARIES}
|
||||||
${GSTREAMER_LIBRARY}
|
${GSTREAMER_LIBRARY}
|
||||||
${GSTREAMER_BASE_LIBRARY}
|
${GSTREAMER_BASE_LIBRARY}
|
||||||
${GSTREAMER_VIDEO_LIBRARY}
|
${GSTREAMER_VIDEO_LIBRARY}
|
||||||
gstklv-1.0-0)
|
)
|
||||||
|
|
||||||
|
if (ENABLE_KLV)
|
||||||
|
set (LIBRARIES ${LIBRARIES} gstklv-1.0-0)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
target_link_libraries (${libname}
|
||||||
|
${LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
install (FILES $<TARGET_PDB_FILE:${libname}> DESTINATION ${PDB_INSTALL_DIR} COMPONENT pdb OPTIONAL)
|
install (FILES $<TARGET_PDB_FILE:${libname}> DESTINATION ${PDB_INSTALL_DIR} COMPONENT pdb OPTIONAL)
|
||||||
|
|||||||
@ -94,7 +94,7 @@ enum
|
|||||||
#define DEFAULT_PROP_INFO "Pleora eBUS GStreamer Sink"
|
#define DEFAULT_PROP_INFO "Pleora eBUS GStreamer Sink"
|
||||||
#define DEFAULT_PROP_SERIAL "0001"
|
#define DEFAULT_PROP_SERIAL "0001"
|
||||||
#define DEFAULT_PROP_MAC ""
|
#define DEFAULT_PROP_MAC ""
|
||||||
#define DEFAULT_PROP_OUTPUT_KLV TRUE
|
#define DEFAULT_PROP_OUTPUT_KLV FALSE
|
||||||
#define DEFAULT_PROP_AUTO_MULTICAST FALSE
|
#define DEFAULT_PROP_AUTO_MULTICAST FALSE
|
||||||
#define DEFAULT_PROP_MULTICAST_GROUP "239.192.1.1"
|
#define DEFAULT_PROP_MULTICAST_GROUP "239.192.1.1"
|
||||||
#define DEFAULT_PROP_MULTICAST_PORT 1042
|
#define DEFAULT_PROP_MULTICAST_PORT 1042
|
||||||
@ -197,12 +197,14 @@ gst_pleorasink_class_init (GstPleoraSinkClass * klass)
|
|||||||
DEFAULT_PROP_MAC,
|
DEFAULT_PROP_MAC,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
||||||
GST_PARAM_MUTABLE_READY)));
|
GST_PARAM_MUTABLE_READY)));
|
||||||
|
#ifdef GST_PLUGINS_VISION_ENABLE_KLV
|
||||||
g_object_class_install_property (gobject_class, PROP_OUTPUT_KLV,
|
g_object_class_install_property (gobject_class, PROP_OUTPUT_KLV,
|
||||||
g_param_spec_boolean ("output-klv", "Output KLV",
|
g_param_spec_boolean ("output-klv", "Output KLV",
|
||||||
"Whether to output KLV as chunk data according to MISB ST1608",
|
"Whether to output KLV as chunk data according to MISB ST1608",
|
||||||
DEFAULT_PROP_OUTPUT_KLV,
|
DEFAULT_PROP_OUTPUT_KLV,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
||||||
GST_PARAM_MUTABLE_READY)));
|
GST_PARAM_MUTABLE_READY)));
|
||||||
|
#endif
|
||||||
g_object_class_install_property (gobject_class, PROP_AUTO_MULTICAST,
|
g_object_class_install_property (gobject_class, PROP_AUTO_MULTICAST,
|
||||||
g_param_spec_boolean ("auto-multicast", "Auto multicast",
|
g_param_spec_boolean ("auto-multicast", "Auto multicast",
|
||||||
"Automatically multicast video, removing the need for a controller",
|
"Automatically multicast video, removing the need for a controller",
|
||||||
|
|||||||
@ -101,7 +101,7 @@ enum
|
|||||||
#define DEFAULT_PROP_PACKET_SIZE 0
|
#define DEFAULT_PROP_PACKET_SIZE 0
|
||||||
#define DEFAULT_PROP_CONFIG_FILE ""
|
#define DEFAULT_PROP_CONFIG_FILE ""
|
||||||
#define DEFAULT_PROP_CONFIG_FILE_CONNECT TRUE
|
#define DEFAULT_PROP_CONFIG_FILE_CONNECT TRUE
|
||||||
#define DEFAULT_PROP_OUTPUT_KLV TRUE
|
#define DEFAULT_PROP_OUTPUT_KLV FALSE
|
||||||
|
|
||||||
#define VIDEO_CAPS_MAKE_BAYER8(format) \
|
#define VIDEO_CAPS_MAKE_BAYER8(format) \
|
||||||
"video/x-bayer, " \
|
"video/x-bayer, " \
|
||||||
@ -226,12 +226,14 @@ gst_pleorasrc_class_init (GstPleoraSrcClass * klass)
|
|||||||
"connects using properties and then restores configuration",
|
"connects using properties and then restores configuration",
|
||||||
DEFAULT_PROP_CONFIG_FILE_CONNECT,
|
DEFAULT_PROP_CONFIG_FILE_CONNECT,
|
||||||
(GParamFlags) (G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE)));
|
(GParamFlags) (G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE)));
|
||||||
|
#ifdef GST_PLUGINS_VISION_ENABLE_KLV
|
||||||
g_object_class_install_property (gobject_class, PROP_OUTPUT_KLV,
|
g_object_class_install_property (gobject_class, PROP_OUTPUT_KLV,
|
||||||
g_param_spec_boolean ("output-klv", "Output KLV",
|
g_param_spec_boolean ("output-klv", "Output KLV",
|
||||||
"Whether to output MISB ST1608 KLV as buffer meta",
|
"Whether to output MISB ST1608 KLV as buffer meta",
|
||||||
DEFAULT_PROP_OUTPUT_KLV,
|
DEFAULT_PROP_OUTPUT_KLV,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
||||||
GST_PARAM_MUTABLE_READY)));
|
GST_PARAM_MUTABLE_READY)));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1646,6 +1648,7 @@ gst_pleorasrc_create (GstPushSrc * psrc, GstBuffer ** buf)
|
|||||||
clock_time = gst_clock_get_time (clock);
|
clock_time = gst_clock_get_time (clock);
|
||||||
gst_object_unref (clock);
|
gst_object_unref (clock);
|
||||||
|
|
||||||
|
#ifdef GST_PLUGINS_VISION_ENABLE_KLV
|
||||||
if (src->output_klv && pvbuffer->HasChunks ()) {
|
if (src->output_klv && pvbuffer->HasChunks ()) {
|
||||||
guint32 num_chunks;
|
guint32 num_chunks;
|
||||||
num_chunks = pvbuffer->GetChunkCount ();
|
num_chunks = pvbuffer->GetChunkCount ();
|
||||||
@ -1697,6 +1700,7 @@ gst_pleorasrc_create (GstPushSrc * psrc, GstBuffer ** buf)
|
|||||||
gst_buffer_add_klv_meta_from_data (*buf, chunk_data, chunk_size);
|
gst_buffer_add_klv_meta_from_data (*buf, chunk_data, chunk_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // GST_PLUGINS_VISION_ENABLE_KLV
|
||||||
|
|
||||||
if (src->pleora_stride != src->gst_stride) {
|
if (src->pleora_stride != src->gst_stride) {
|
||||||
src->pipeline->ReleaseBuffer (pvbuffer);
|
src->pipeline->ReleaseBuffer (pvbuffer);
|
||||||
|
|||||||
@ -313,8 +313,10 @@ GByteArray * GstStreamingChannelSource::GetKlvByteArray (GstBuffer * buf)
|
|||||||
gpointer iter = NULL;
|
gpointer iter = NULL;
|
||||||
GByteArray *byte_array;
|
GByteArray *byte_array;
|
||||||
|
|
||||||
/* spec says KLV can all be in one chunk, or multiple chunks, we do one chunk */
|
|
||||||
byte_array = g_byte_array_new ();
|
byte_array = g_byte_array_new ();
|
||||||
|
|
||||||
|
#ifdef GST_PLUGINS_VISION_ENABLE_KLV
|
||||||
|
/* spec says KLV can all be in one chunk, or multiple chunks, we do one chunk */
|
||||||
while ((klv_meta = (GstKLVMeta *) gst_buffer_iterate_meta_filtered (buf,
|
while ((klv_meta = (GstKLVMeta *) gst_buffer_iterate_meta_filtered (buf,
|
||||||
&iter, GST_KLV_META_API_TYPE))) {
|
&iter, GST_KLV_META_API_TYPE))) {
|
||||||
gsize klv_size;
|
gsize klv_size;
|
||||||
@ -334,6 +336,7 @@ GByteArray * GstStreamingChannelSource::GetKlvByteArray (GstBuffer * buf)
|
|||||||
const guint padding_len = GST_ROUND_UP_4 (byte_array->len) - byte_array->len;
|
const guint padding_len = GST_ROUND_UP_4 (byte_array->len) - byte_array->len;
|
||||||
g_byte_array_append (byte_array, padding, padding_len);
|
g_byte_array_append (byte_array, padding, padding_len);
|
||||||
}
|
}
|
||||||
|
#endif // GST_PLUGINS_VISION_ENABLE_KLV
|
||||||
|
|
||||||
return byte_array;
|
return byte_array;
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user