Project

General

Profile

Actions

Support Request #11752

closed

Error target pin can not have multiple sources

Added by hidden almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Customer:
AUDI
Department:
Requester's Priority:
Normal
Support Level:
3rd Level
Resolution:
Product Issue Opened
Affected Products:
Platform:
Windows 10 64bit
Topic:
ADTF::Streaming
FAQ Links:

Description

Supportanfrage

When trying to connect more than one source to an input pin in the configuration editor, I get the error:
"target pin can not have multiple sources.
Continue anyway Yes|No"
I wanted to ask, why isn't this possible in adtf3? what should be the right way doing this?
What will happen if I pressed Yes and continued?

Lösung

I wanted to ask, why isn't this possible in adtf3?

Only 1:1 connections are valid for pins.
The only exception is Sample Stream to Input Pin (1:N) to bring same data to different receiver.
But N:1 connections are never allowed.

Especially I don't see any use case for transferring multiple (different) data to one defined streaming input.

What will happen if I pressed Yes and continued?

Then it will be marked as invalid connections. It is possible for the use case connecting more than one incoming connection but only activate a single one and deactivate the other.
Then you can toggle for different launches.

I am sure that the users will start implementing their own filters to merge streams and forward them on one output pin.

we currently do not have such a filter, but in the mean time you can use the following:

#include <adtffiltersdk/adtf_filtersdk.h>

class cSampleStreamMerger: public adtf::filter::cFilter
{
public:
    ADTF_CLASS_ID_NAME(cSampleStreamMerger,
                       "sample_stream_merger.filter.me",
                       "Sample Stream Merger");

    cSampleStreamMerger()
    {
        m_pWriter = CreateOutputPin("output");
    }

    tResult RequestDynamicInputPin(const tChar* strName,
                                   const adtf::ucom::iobject_ptr<const adtf::streaming::IStreamType>& pType)
    {
        CreateInputPin(strName, pType);
        RETURN_NOERROR;
    }

    tResult AcceptType(adtf::streaming::ISampleReader* /*pReader*/,
                       const adtf::ucom::iobject_ptr<const adtf::streaming::IStreamType>& pType)
    {
        if (m_pStreamType)
        {
            RETURN_IF_FAILED(adtf::streaming::is_compatible(pType, m_pStreamType));
        }

        m_pWriter->ChangeType(pType);
        m_pStreamType = pType;
        RETURN_NOERROR;
    }

    tResult ProcessInput(adtf::streaming::ISampleReader* /*pReader*/,
                         const adtf::ucom::iobject_ptr<const adtf::streaming::ISample>& pSample)
    {
        m_pWriter->Write(pSample);
        RETURN_NOERROR;
    }

private:
    adtf::streaming::ISampleWriter* m_pWriter = nullptr;
    adtf::ucom::object_ptr<const adtf::streaming::IStreamType> m_pStreamType;
};

I have created ticket ACORE-10619 to include the above filter into the standard ADTF distribution.

Actions

Also available in: Atom PDF