Streaming Sources

This guide explains how data can be generated respectively sources of data can be plugged in. After reading this guide, you will know:

What is a Streaming Source?

A Streaming Source provides streaming data. The data can be generated by the Streaming Source itself or generated outside the ADTF world but transformed by the Streaming Source into a data format ADTF Components can handle. If you are looking for a more comprehensive explanation of what Streaming Sources are follow this link.

Create the CMakeLists.txt

For this example we create a Streaming Source that emits characters in a defined interval. The CMakeLists.txt looks like this:

        
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
project (CharacterStreamingSource)

set (STREAMING_SOURCE_NAME happy_character_source)

if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/happy_character_source.h)
  file(WRITE happy_character_source.h)
endif()
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/happy_character_source.cpp)
  file(WRITE happy_character_source.cpp)
endif()

find_package(ADTF COMPONENTS systemsdk filtersdk REQUIRED)

# Adds the happy_character_source project to the Visual Studio solution, which when build
# creates a shared object called happy_character_source.adtfplugin
adtf_add_streaming_service(${STREAMING_SOURCE_NAME} happy_character_source.h happy_character_source.cpp)

# Adds the INSTALL project to the Visual Studio solution, which when build
# copies our Filter to the subdirectory given as the second argument into ${CMAKE_INSTALL_PREFIX}
adtf_install_filter(${STREAMING_SOURCE_NAME} src/examples/bin)

# Generate a plugindescription for our Streaming Source
adtf_create_plugindescription(
    TARGET ${STREAMING_SOURCE_NAME}
    PLUGIN_SUBDIR "src/examples/bin"
    VERSION "0.8.15"
    LICENSE "ADTF"
    SUPPORT_MAIL "support@mycompany.org"
    HOMEPAGE_URL "www.mycompany.org"
)

# Generate a documentation for our Streaming Source
adtf_convert_plugindescription_to_dox(
    TARGET ${STREAMING_SOURCE_NAME}
    DIRECTORY ${CMAKE_BINARY_DIR}/src/doxygen/generated
)
    
      

Use the CMake-GUI to configure relevant properties

Switch to the CMake-GUI and follow these steps:

Implement the Streaming Source inside Visual Studio

Build an ADTF Session for our new Streaming Source

Fire up the Configuration Editor

  1. Create a new project
  2. Select the Filter Graph Editor tab
  3. Next click on the Components tab
  4. Drag and drop the new Happy Character Source from the Components tab into the Filter Graph Editor
  5. Save the project ctrl + s
  6. Switch to the Project View tab
  7. Right click on the ADTF Session and choose Launch with ADTF Control
  8. In the command line of the ADTF Control type rl running
    Streaming output

Congratulations! Now you can flood the ADTF system with any type of data

Where to go next?

Have a look at Streaming Sinks to learn who are the consumers of data.