From ec205925917cbc6f7bdf18cbaa6fde07763f3d89 Mon Sep 17 00:00:00 2001 From: "Joshua M. Doe" Date: Thu, 6 Feb 2020 13:33:56 -0500 Subject: [PATCH] klv: add klv library, klvinject and klvinspect elements Create as a separate library until gst-plugins-base MR124 is merged into tag --- CMakeLists.txt | 2 + gst-libs/CMakeLists.txt | 1 + gst-libs/klv/CMakeLists.txt | 30 +++++ {sys/pleora => gst-libs/klv}/klv.c | 0 {sys/pleora => gst-libs/klv}/klv.h | 9 +- gst/CMakeLists.txt | 1 + gst/klv/CMakeLists.txt | 32 +++++ gst/klv/gstklv.c | 43 ++++++ gst/klv/gstklvinject.c | 186 ++++++++++++++++++++++++++ gst/klv/gstklvinject.h | 50 +++++++ gst/klv/gstklvinspect.c | 124 +++++++++++++++++ gst/klv/gstklvinspect.h | 50 +++++++ sys/pleora/CMakeLists.txt | 10 +- sys/pleora/streamingchannelsource.cpp | 10 -- 14 files changed, 533 insertions(+), 15 deletions(-) create mode 100644 gst-libs/CMakeLists.txt create mode 100644 gst-libs/klv/CMakeLists.txt rename {sys/pleora => gst-libs/klv}/klv.c (100%) rename {sys/pleora => gst-libs/klv}/klv.h (90%) create mode 100644 gst/klv/CMakeLists.txt create mode 100644 gst/klv/gstklv.c create mode 100644 gst/klv/gstklvinject.c create mode 100644 gst/klv/gstklvinject.h create mode 100644 gst/klv/gstklvinspect.c create mode 100644 gst/klv/gstklvinspect.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ef98f67..c8e4b89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,8 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ${PREFIX} CACHE PATH "Directory to install plugins, under lib/gstreamer-1.0" FORCE) endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +add_subdirectory(gst-libs) + # Build the plugins add_subdirectory(ext) add_subdirectory(gst) diff --git a/gst-libs/CMakeLists.txt b/gst-libs/CMakeLists.txt new file mode 100644 index 0000000..0dc1f09 --- /dev/null +++ b/gst-libs/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory (klv) \ No newline at end of file diff --git a/gst-libs/klv/CMakeLists.txt b/gst-libs/klv/CMakeLists.txt new file mode 100644 index 0000000..ca5d395 --- /dev/null +++ b/gst-libs/klv/CMakeLists.txt @@ -0,0 +1,30 @@ +add_definitions(-DBUILDING_GST_KLV) + +set (SOURCES + klv.c) + +set (HEADERS + klv.h) + +include_directories (AFTER + ${PROJECT_SOURCE_DIR}/common + ) + +set (libname libgstklv-1.0-0) + +add_library (${libname} SHARED + ${SOURCES} + ${HEADERS}) + +target_link_libraries (${libname} + ${GLIB2_LIBRARIES} + ${GOBJECT_LIBRARIES} + ${GSTREAMER_LIBRARY} + ${GSTREAMER_BASE_LIBRARY} + ${GSTREAMER_VIDEO_LIBRARY}) + +set (pdbfile "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/${libname}.pdb") +install (FILES ${pdbfile} DESTINATION lib/gstreamer-1.0 COMPONENT pdb) +install (TARGETS ${libname} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib) \ No newline at end of file diff --git a/sys/pleora/klv.c b/gst-libs/klv/klv.c similarity index 100% rename from sys/pleora/klv.c rename to gst-libs/klv/klv.c diff --git a/sys/pleora/klv.h b/gst-libs/klv/klv.h similarity index 90% rename from sys/pleora/klv.h rename to gst-libs/klv/klv.h index 8ce4f36..4964d74 100644 --- a/sys/pleora/klv.h +++ b/gst-libs/klv/klv.h @@ -23,7 +23,14 @@ #include // FIXME: include this for now until gst-plugins-base MR124 is accepted -#define GST_TAG_API +//#define GST_API_EXPORT __declspec(dllexport) extern +//#define GST_TAG_API GST_API_EXPORT +#ifdef BUILDING_GST_KLV +#define GST_KLV_API __declspec(dllexport) extern +#else +#define GST_KLV_API __declspec(dllimport) extern +#endif +#define GST_TAG_API GST_KLV_API G_BEGIN_DECLS diff --git a/gst/CMakeLists.txt b/gst/CMakeLists.txt index ba625a1..9a39f1e 100644 --- a/gst/CMakeLists.txt +++ b/gst/CMakeLists.txt @@ -3,6 +3,7 @@ if (OPENCV_FOUND) endif (OPENCV_FOUND) add_subdirectory (extractcolor) +add_subdirectory (klv) add_subdirectory (misb) add_subdirectory (select) add_subdirectory (videoadjust) diff --git a/gst/klv/CMakeLists.txt b/gst/klv/CMakeLists.txt new file mode 100644 index 0000000..92ca37b --- /dev/null +++ b/gst/klv/CMakeLists.txt @@ -0,0 +1,32 @@ +set (SOURCES + gstklv.c + gstklvinject.c + gstklvinspect.c) + +set (HEADERS + gstklvinject.h + gstklvinspect.h) + +include_directories (AFTER + ${PROJECT_SOURCE_DIR}/common + ${PROJECT_SOURCE_DIR}/gst-libs/klv + ) + +set (libname libgstklv) + +add_library (${libname} MODULE + ${SOURCES} + ${HEADERS}) + +target_link_libraries (${libname} + ${GLIB2_LIBRARIES} + ${GOBJECT_LIBRARIES} + ${GSTREAMER_LIBRARY} + ${GSTREAMER_BASE_LIBRARY} + ${GSTREAMER_VIDEO_LIBRARY} + libgstklv-1.0-0) + +set (pdbfile "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/${libname}.pdb") +install (FILES ${pdbfile} DESTINATION lib/gstreamer-1.0 COMPONENT pdb) +install (TARGETS ${libname} + LIBRARY DESTINATION lib/gstreamer-1.0) \ No newline at end of file diff --git a/gst/klv/gstklv.c b/gst/klv/gstklv.c new file mode 100644 index 0000000..b80ad97 --- /dev/null +++ b/gst/klv/gstklv.c @@ -0,0 +1,43 @@ +/* GStreamer + * Copyright (C) 2016 William Manley + * + * 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., 51 Franklin Street, Suite 500, + * Boston, MA 02110-1335, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "gstklvinject.h" +#include "gstklvinspect.h" + +static gboolean +plugin_init (GstPlugin * plugin) +{ + return gst_element_register (plugin, "klvinspect", GST_RANK_NONE, + GST_TYPE_KLVINSPECT) + && gst_element_register (plugin, "klvinject", GST_RANK_NONE, + GST_TYPE_KLVINJECT); +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + klv, + "Elements for working with KLV data", + plugin_init, GST_PACKAGE_VERSION, GST_PACKAGE_LICENSE, GST_PACKAGE_NAME, + GST_PACKAGE_ORIGIN); diff --git a/gst/klv/gstklvinject.c b/gst/klv/gstklvinject.c new file mode 100644 index 0000000..59abf96 --- /dev/null +++ b/gst/klv/gstklvinject.c @@ -0,0 +1,186 @@ +/* GStreamer + * Copyright (C) 2016 William Manley + * + * 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., 51 Franklin Street, Suite 500, + * Boston, MA 02110-1335, USA. + */ +/** + * SECTION:element-gstklvinject + * + * The klvinject element injects KLV metadata on passing buffers. + * + * + * Example launch line + * |[ + * gst-launch -v fakesrc ! klvinject ! fakesink + * ]| + * FIXME Describe what the pipeline does. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include "gstklvinject.h" +#include "klv.h" + +GST_DEBUG_CATEGORY_STATIC (gst_klvinject_debug_category); +#define GST_CAT_DEFAULT gst_klvinject_debug_category + +/* prototypes */ +static GstFlowReturn gst_klvinject_transform_ip (GstBaseTransform * trans, + GstBuffer * buf); + +enum +{ + PROP_0 +}; + +/* pad templates */ + +#define SRC_CAPS "ANY" +#define SINK_CAPS "ANY" + + +/* class initialization */ + +G_DEFINE_TYPE_WITH_CODE (GstKlvInject, gst_klvinject, GST_TYPE_BASE_TRANSFORM, + GST_DEBUG_CATEGORY_INIT (gst_klvinject_debug_category, "klvinject", 0, + "debug category for klvinject element")); + +static void +gst_klvinject_class_init (GstKlvInjectClass * klass) +{ + GstBaseTransformClass *base_transform_class = + GST_BASE_TRANSFORM_CLASS (klass); + + /* Setting up pads and setting metadata should be moved to + base_class_init if you intend to subclass this class. */ + gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gst_caps_from_string (SRC_CAPS))); + gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gst_caps_from_string (SINK_CAPS))); + + gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass), + "Inject KLV", "Filter", "Inject KLV metadata", + "Joshua M. Doe "); + + base_transform_class->transform_ip = + GST_DEBUG_FUNCPTR (gst_klvinject_transform_ip); + + base_transform_class->passthrough_on_same_caps = TRUE; + base_transform_class->transform_ip_on_passthrough = TRUE; +} + +static void +gst_klvinject_init (GstKlvInject * filt) +{ +} + +static void +gst_klvinject_dispose (GstKlvInject * filt) +{ +} + +static void +gst_klvinject_add_test_meta (GstKlvInject * filt, GstBuffer * buf) +{ +/* Add KLV meta for testing, here: Motion Imagery Standards Board (MISB) + * Engineering Guideline MISB EG 0902 - MISB Minimum Metadata Set. + * Also see: SMPTE S336M for KLV specification, also ITU-R BT.1563-1 */ + const guint8 klv_header[16] = { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x0b, 0x01, + 0x01, 0x0e, 0x01, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00 + }; + GDateTime *dt = g_date_time_new_now_utc (); + gint64 ut = g_date_time_to_unix (dt) * 1000000; /* microseconds */ + GstByteWriter bw; + + ut += g_date_time_get_microsecond (dt); + + gst_byte_writer_init (&bw); + + /* KLV header */ + gst_byte_writer_put_data (&bw, klv_header, 16); + + /* Total length in BER long form (verbatim as long as <= 127) */ + gst_byte_writer_put_uint8 (&bw, + (1 + 1 + 8) + (1 + 1 + 14) + (1 + 1 + 4) + (1 + 1 + 4) + (1 + 1 + 2)); + + /* Tag 1: unix timestamp */ + gst_byte_writer_put_uint8 (&bw, 2); /* local tag: unix timestamp */ + gst_byte_writer_put_uint8 (&bw, 8); /* data length (BER short form) */ + gst_byte_writer_put_uint64_be (&bw, ut); + + /* Tag 2: Image Coordinate System */ + gst_byte_writer_put_uint8 (&bw, 12); /* local tag: unix timestamp */ + gst_byte_writer_put_uint8 (&bw, 14); /* data length (BER short form) */ + gst_byte_writer_put_data (&bw, (guint8 *) "Geodetic WGS84", 14); + + /* Tag 3: Sensor Latitude */ + gst_byte_writer_put_uint8 (&bw, 13); /* local tag: latitude */ + gst_byte_writer_put_uint8 (&bw, 4); /* data length (BER short form) */ + { + /* Map -(2^31-1)..(2^31-1) to +/-90 with 0x80000000 = error */ + gdouble latitude = 51.449825; + gint32 val = (gint) ((latitude / 90.0) * 2147483647.0); + gst_byte_writer_put_int32_be (&bw, val); + } + + /* Tag 4: Sensor Longitude */ + gst_byte_writer_put_uint8 (&bw, 14); /* local tag: longitude */ + gst_byte_writer_put_uint8 (&bw, 4); /* data length (BER short form) */ + { + /* Map -(2^31-1)..(2^31-1) to +/-180 with 0x80000000 = error */ + gdouble longitude = -2.600439; + gint32 val = (gint) ((longitude / 180.0) * 2147483647.0); + gst_byte_writer_put_int32_be (&bw, val); + } + + /* Tag 5: Sensor True Altitude (MSL) (elevation) */ + gst_byte_writer_put_uint8 (&bw, 15); /* local tag: elevation */ + gst_byte_writer_put_uint8 (&bw, 2); /* data length (BER short form) */ + { + /* Map 0..(2^16-1) to -900..19000 meters, so resolution 0.303654536m */ + gdouble elevation = 10.0; + guint16 val = ((elevation + 900.0 + 0.151827268) / 19900.0) * 65535.0; + gst_byte_writer_put_int16_be (&bw, val); + } + + { + gsize klv_size = gst_byte_writer_get_size (&bw); + guint8 *klv_data = gst_byte_writer_reset_and_get_data (&bw); + + gst_buffer_add_klv_meta_take_data (buf, klv_data, klv_size); + } + + g_date_time_unref (dt); +} + +static GstFlowReturn +gst_klvinject_transform_ip (GstBaseTransform * trans, GstBuffer * buf) +{ + GstKlvInject *filt = GST_KLVINJECT (trans); + + GST_LOG_OBJECT (filt, "Injecting test KLV metadata"); + gst_klvinject_add_test_meta (filt, buf); + + return GST_FLOW_OK; +} diff --git a/gst/klv/gstklvinject.h b/gst/klv/gstklvinject.h new file mode 100644 index 0000000..53fa1d8 --- /dev/null +++ b/gst/klv/gstklvinject.h @@ -0,0 +1,50 @@ +/* GStreamer + * Copyright (C) 2016 William Manley + * + * 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., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef _GST_KLVINJECT_H_ +#define _GST_KLVINJECT_H_ + +#include + +G_BEGIN_DECLS + +#define GST_TYPE_KLVINJECT (gst_klvinject_get_type()) +#define GST_KLVINJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_KLVINJECT,GstKlvInject)) +#define GST_KLVINJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_KLVINJECT,GstKlvInjectClass)) +#define GST_IS_KLVINJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_KLVINJECT)) +#define GST_IS_KLVINJECT_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_KLVINJECT)) + +typedef struct _GstKlvInject GstKlvInject; +typedef struct _GstKlvInjectClass GstKlvInjectClass; + +struct _GstKlvInject +{ + GstBaseTransform base_klvinject; +}; + +struct _GstKlvInjectClass +{ + GstBaseTransformClass base_klvinject_class; +}; + +GType gst_klvinject_get_type (void); + +G_END_DECLS + +#endif /* _GST_KLVINJECT_H_ */ diff --git a/gst/klv/gstklvinspect.c b/gst/klv/gstklvinspect.c new file mode 100644 index 0000000..a213deb --- /dev/null +++ b/gst/klv/gstklvinspect.c @@ -0,0 +1,124 @@ +/* GStreamer + * Copyright (C) 2016 William Manley + * + * 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., 51 Franklin Street, Suite 500, + * Boston, MA 02110-1335, USA. + */ +/** + * SECTION:element-gstklvinspect + * + * The klvinspect element inspects KLV metadata on passing buffers. + * + * + * Example launch line + * |[ + * gst-launch -v fakesrc ! klvinspect ! fakesink + * ]| + * FIXME Describe what the pipeline does. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include "gstklvinspect.h" +#include "klv.h" + +GST_DEBUG_CATEGORY_STATIC (gst_klvinspect_debug_category); +#define GST_CAT_DEFAULT gst_klvinspect_debug_category + +/* prototypes */ +static GstFlowReturn gst_klvinspect_transform_ip (GstBaseTransform * trans, + GstBuffer * buf); + +enum +{ + PROP_0 +}; + +/* pad templates */ + +#define SRC_CAPS "ANY" +#define SINK_CAPS "ANY" + + +/* class initialization */ + +G_DEFINE_TYPE_WITH_CODE (GstKlvInspect, gst_klvinspect, GST_TYPE_BASE_TRANSFORM, + GST_DEBUG_CATEGORY_INIT (gst_klvinspect_debug_category, "klvinspect", 0, + "debug category for klvinspect element")); + +static void +gst_klvinspect_class_init (GstKlvInspectClass * klass) +{ + GstBaseTransformClass *base_transform_class = + GST_BASE_TRANSFORM_CLASS (klass); + + /* Setting up pads and setting metadata should be moved to + base_class_init if you intend to subclass this class. */ + gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gst_caps_from_string (SRC_CAPS))); + gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gst_caps_from_string (SINK_CAPS))); + + gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass), + "Inspect KLV", "Filter", "Inspect KLV metadata", + "Joshua M. Doe "); + + base_transform_class->transform_ip = + GST_DEBUG_FUNCPTR (gst_klvinspect_transform_ip); + + base_transform_class->passthrough_on_same_caps = TRUE; + base_transform_class->transform_ip_on_passthrough = TRUE; +} + +static void +gst_klvinspect_init (GstKlvInspect * filt) +{ +} + +static void +gst_klvinspect_dispose (GstKlvInspect * filt) +{ +} + +static GstFlowReturn +gst_klvinspect_transform_ip (GstBaseTransform * trans, GstBuffer * buf) +{ + GstKlvInspect *filt = GST_KLVINSPECT (trans); + GstKLVMeta *klv_meta; + gpointer iter = NULL; + gint n_klv_meta_found = 0; + + while ((klv_meta = (GstKLVMeta *) gst_buffer_iterate_meta_filtered (buf, + &iter, GST_KLV_META_API_TYPE))) { + gsize klv_size; + const guint8 *klv_data; + klv_data = gst_klv_meta_get_data (klv_meta, &klv_size); + if (klv_data) { + GST_MEMDUMP_OBJECT (filt, "KLV data", klv_data, (guint) klv_size); + ++n_klv_meta_found; + } + } + + GST_LOG_OBJECT (filt, "Found %d KLV meta", n_klv_meta_found); + + return GST_FLOW_OK; +} diff --git a/gst/klv/gstklvinspect.h b/gst/klv/gstklvinspect.h new file mode 100644 index 0000000..fe66e64 --- /dev/null +++ b/gst/klv/gstklvinspect.h @@ -0,0 +1,50 @@ +/* GStreamer + * Copyright (C) 2016 William Manley + * + * 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., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef _GST_KLVINSPECT_H_ +#define _GST_KLVINSPECT_H_ + +#include + +G_BEGIN_DECLS + +#define GST_TYPE_KLVINSPECT (gst_klvinspect_get_type()) +#define GST_KLVINSPECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_KLVINSPECT,GstKlvInspect)) +#define GST_KLVINSPECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_KLVINSPECT,GstKlvInspectClass)) +#define GST_IS_KLVINSPECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_KLVINSPECT)) +#define GST_IS_KLVINSPECT_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_KLVINSPECT)) + +typedef struct _GstKlvInspect GstKlvInspect; +typedef struct _GstKlvInspectClass GstKlvInspectClass; + +struct _GstKlvInspect +{ + GstBaseTransform base_klvinspect; +}; + +struct _GstKlvInspectClass +{ + GstBaseTransformClass base_klvinspect_class; +}; + +GType gst_klvinspect_get_type (void); + +G_END_DECLS + +#endif /* _GST_KLVINSPECT_H_ */ diff --git a/sys/pleora/CMakeLists.txt b/sys/pleora/CMakeLists.txt index 428bbf3..3b7bfd9 100644 --- a/sys/pleora/CMakeLists.txt +++ b/sys/pleora/CMakeLists.txt @@ -1,12 +1,10 @@ add_definitions(-D_XKEYCHECK_H) set (SOURCES - klv.c gstpleora.cpp gstpleorasrc.cpp) set (HEADERS - klv.h gstpleorasrc.h) if (Pleora_VERSION_MAJOR GREATER 5) @@ -21,7 +19,10 @@ if (Pleora_VERSION_MAJOR GREATER 5) endif () include_directories (AFTER - ${Pleora_INCLUDE_DIR}) + ${Pleora_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/common + ${PROJECT_SOURCE_DIR}/gst-libs/klv + ) link_directories(${Pleora_LIBRARY_DIR}) @@ -36,7 +37,8 @@ target_link_libraries (${libname} ${GOBJECT_LIBRARIES} ${GSTREAMER_LIBRARY} ${GSTREAMER_BASE_LIBRARY} - ${GSTREAMER_VIDEO_LIBRARY}) + ${GSTREAMER_VIDEO_LIBRARY} + libgstklv-1.0-0) set (pdbfile "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/${libname}.pdb") install (FILES ${pdbfile} DESTINATION lib/gstreamer-1.0 COMPONENT pdb) diff --git a/sys/pleora/streamingchannelsource.cpp b/sys/pleora/streamingchannelsource.cpp index 8247a94..e85d508 100644 --- a/sys/pleora/streamingchannelsource.cpp +++ b/sys/pleora/streamingchannelsource.cpp @@ -313,16 +313,6 @@ GByteArray * GstStreamingChannelSource::GetKlvByteArray (GstBuffer * buf) gpointer iter = NULL; GByteArray *byte_array; - { - //FIXME put fake data for testing - const guint8 klv_header[18] = - { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x0b, 0x01, 0x01, 0x0e, 0x01, 0x03, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0xFF }; - buf = gst_buffer_make_writable (buf); - gst_buffer_add_klv_meta_from_data (buf, klv_header, sizeof (klv_header)); - gst_buffer_add_klv_meta_from_data (buf, klv_header, sizeof (klv_header)); - } - /* spec says KLV can all be in one chunk, or multiple chunks, we do one chunk */ byte_array = g_byte_array_new (); while ((klv_meta = (GstKLVMeta *) gst_buffer_iterate_meta_filtered (buf,