Streaming Sink

This guide is about elements which can consume data. After reading this guide, you will know:

What is a Streaming Sink?

A Streaming Sink accepts data from Filter or Streaming Sources and consumes it e.g. by displaying the data or sending it to a device outside the ADTF System. The Streaming Sink therefore acts like a bridge between the data format of ADTF and the data format expected by the external device. If you are looking for a more comprehensive explanation of what Streaming Sinks are follow this link.

Create the CMakeLists.txt

For this example we create a Streaming Sink that accepts characters. The CMakeLists.txt looks like this:

        
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
project (CharacterStreamingSink)

set (STREAMING_SINK_NAME happy_character_sink)

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

find_package(ADTF COMPONENTS systemsdk filtersdk REQUIRED)

set (EXAMPLE_SOURCES happy_character_sink.h
                     happy_character_sink.cpp)

# Adds the happy_character_sink project to the Visual Studio solution, which when build
# creates a shared object called happy_character_sink.adtfplugin
adtf_add_streaming_service(${STREAMING_SINK_NAME} ${EXAMPLE_SOURCES})
                     
adtf_install_plugin(${STREAMING_SINK_NAME} src/examples/bin)

# Generate a plugindescription for our Streaming Sink
adtf_create_plugindescription(
    TARGET ${STREAMING_SINK_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 Sink
adtf_convert_plugindescription_to_dox(
    TARGET ${STREAMING_SINK_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 Sink inside Visual Studio

Build an ADTF Session for our new Streaming Sink

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. Drag and drop the new Happy Character Sink from the Components tab into the Filter Graph Editor
  6. Connect the Source and Sink
    Streaming output
  7. Save the project ctrl + s
  8. Switch to the Sessions tab
  9. Right click on the ADTF Session and choose Launch with ADTF Control
  10. In the command line of the ADTF Control type rl running
    Streaming output

Congratulations! Now you have an idea of how to consume available data streams in the ADTF System.

Where to go next?

Have a look at the Filter in between to learn who are the Filters in between Streaming Sources and Streaming Sinks.