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.10)
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)
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/happy_character_source.cpp)
  file(WRITE happy_character_source.cpp)

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 Filter
adtf_create_plugindescription(TARGET ${STREAMING_SOURCE_NAME} PLUGIN_SUBDIR "src/examples/bin")

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.