Skip to content

Latest commit

 

History

History
298 lines (233 loc) · 11 KB

api-tee.md

File metadata and controls

298 lines (233 loc) · 11 KB

Demuxer and Splitter - Tee API

Tee Construction and Destruction

Demuxers and Splitters are created using a type specific constructor, dsl_tee_demuxer_new and dsl_tee_splitter_new respectively

Pipelines use Tees to create Branches and Branches can use Tees to create more Branches. Therefore, Tees are added to Pipelines and Branches, while Branches are added to Tees.

The relationship between Pipline/Branch and Tee is one to one with the Tee becoming the end component. The relationship between Tees and Branches is one-to-many. Once added to a Pipeline or Branch, a Tee must be removed before it can used with another.

Tees and Branches are deleted by calling dsl_component_delete, dsl_component_delete_many, or dsl_component_delete_all

Adding and removing Branches from a Tee

Branches are added to a Tee by calling dsl_tee_branch_add or dsl_tee_branch_add_many and removed with dsl_tee_branch_remove, dsl_tee_branch_remove_many, or dsl_tee_branch_remove_all.

Tee API

Constructors

Methods

Return Values

The following return codes are used by the Tiler API

#define DSL_RESULT_TEE_RESULT                                       0x000A0000
#define DSL_RESULT_TEE_NAME_NOT_UNIQUE                              0x000A0001
#define DSL_RESULT_TEE_NAME_NOT_FOUND                               0x000A0002
#define DSL_RESULT_TEE_NAME_BAD_FORMAT                              0x000A0003
#define DSL_RESULT_TEE_THREW_EXCEPTION                              0x000A0004
#define DSL_RESULT_TEE_BRANCH_IS_NOT_CHILD                          0x000A0005
#define DSL_RESULT_TEE_BRANCH_ADD_FAILED                            0x000A0006
#define DSL_RESULT_TEE_BRANCH_REMOVE_FAILED                         0x000A0007
#define DSL_RESULT_TEE_HANDLER_ADD_FAILED                           0x000A0008
#define DSL_RESULT_TEE_HANDLER_REMOVE_FAILED                        0x000A0009
#define DSL_RESULT_TEE_COMPONENT_IS_NOT_TEE                         0x000A000A

Constructors

dsl_tee_demuxer_new

DslReturnType dsl_tee_demuxer_new(const wchar_t* name);

The constructor creates a uniquely named Demuxer Tee. Construction will fail if the name is currently in use.

Parameters

  • name - [in] unique name for the Demuxer to create.

Returns

  • DSL_RESULT_SUCCESS on successful creation. One of the Return Values defined above on failure.

Python Example

retval = dsl_tee_demuxer_new('my-demuxer')

dsl_tee_demuxer_new_branch_add_many

DslReturnType dsl_tee_demuxer_new_branch_add_many(const wchar_t* name, const wchar_t** branches);

The constructor creates a uniquely named Demuxer Tee and adds a list of branches to it. Construction will fail if the name is currently in use.

Parameters

  • name - [in] unique name for the Demuxer to create.
  • branches [in] Null terminated listed of unique branch names to add.

Returns

  • DSL_RESULT_SUCCESS on successful creation. One of the Return Values defined above on failure.

Python Example

retval = dsl_tee_demuxer_new_branch_add_many('my-demuxer', 
    ['my-branch-1', 'my-branch-2', None])

dsl_tee_splitter_new

DslReturnType dsl_tee_splitter_new(const wchar_t* name);

The constructor creates a uniquely named Splitter Tee. Construction will fail if the name is currently in use.

Parameters

  • name - [in] unique name for the Splitter to create.

Returns

  • DSL_RESULT_SUCCESS on successful creation. One of the Return Values defined above on failure.

Python Example

retval = dsl_tee_splitter_new('my-demuxer')

dsl_tee_splitter_new_branch_add_many

DslReturnType dsl_tee_splitter_new_branch_add_many(const wchar_t* name, const wchar_t** branches)

The constructor creates a uniquely named Splitter Tee and adds a list of Branches to it. Construction will fail if the name is currently in use.

Parameters

  • name - [in] unique name for the Splitter to create.
  • branches [in] Null terminated listed of unique branch names to add.

Returns

  • DSL_RESULT_SUCCESS on successful creation. One of the Return Values defined above on failure.

Python Example

retval = dsl_tee_splitter_new_branch_add_many('my-demuxer', 
   ['my-branch-1', 'my-branch-2', None])

Methods

dsl_tee_branch_add

DslReturnType dsl_tee_branch_add(const wchar_t* name, const wchar_t* branch);

This service adds a single branch to a named Spliter or Demuxer Tee. The add service will fail if the branch is currently in-use. The branches in-use state will be set to true on successful add.

Parameters

  • branch - [in] unique name for the Branch to update.
  • component - [in] unique name of the Component to add.

Returns

  • DSL_RESULT_SUCCESS on successful add. One of the Return Values defined above on failure

Python Example

retval = dsl_tee_branch_add('my-splitter', 'my-branch’)

dsl_tee_branch_add_many

DslReturnType dsl_tee_branch_add_many(const wchar_t* name, const wchar_t** branches);

This service adds a list of named Branches to a Null termainted list of branches to a named Splitter or Demuxer Tee. Each of the branches in-use state will be set to true on successful add.

Parameters

  • name - [in] unique name for the Spliter to update.
  • branches - [in] a NULL terminated array of uniquely named Components to add.

Returns

  • DSL_RESULT_SUCCESS on successful add. One of the Return Values defined above on failure.

Python Example

retval = dsl_tee_branch_add_many('my-splitter', 
   ['my-branch-1', 'my-branch-2', None])

dsl_tee_branch_remove

DslReturnType dsl_tee_branch_remove(const wchar_t* name, const wchar_t* branch);

This service removes a single named Branch from a Demuxer or Splitter Tee. The remove service will fail if the Branch is not currently in-use by the Tee. The branches' in-use state will be set to false on successful removal.

Parameters

  • name - [in] unique name for the Demuxer or Spltter Tee to update.
  • branch - [in] unique name of the Branch to remove.

Returns

  • DSL_RESULT_SUCCESS on successful add. One of the Return Values defined above on failure

Python Example

retval = dsl_tee_branch_remove('my-splitter', 'my-branch')

dsl_tee_branch_remove_many

DslReturnType dsl_tee_branch_remove_many(const wchar_t* name, const wchar_t** branches);

This service removes a list of named components from a named Branch. The remove service will fail if any of branches are currently not-in-use by the named Branch. All of the removed branches' in-use state will be set to false on successful removal.

Parameters

  • name - [in] unique name for the Demuxer or Splitter Tee to update.
  • components - [in] a NULL terminated array of uniquely named Brances to remove.

Returns

  • DSL_RESULT_SUCCESS on successful add. One of the Return Values defined above on failure

Python Example

retval = dsl_tee_branch_remove_many('my-splitter',
    ['my-branch-1', 'my-branch-2', None])

dsl_tee_branch_remove_all

DslReturnType dsl_tee_branch_remove_all(const wchar_t* name);

This service removes all child branches from a named Demuxer or Splitter Tee. All of the removed branches' in-use state will be set to false on successful removal.

Parameters

  • name - [in] unique name for the Branch to update.

Returns

  • DSL_RESULT_SUCCESS on successful add. One of the Return Values defined above on failure

Python Example

retval = dsl_tee_branch_remove_all('my-splitter')

dsl_tee_pph_add

DslReturnType dsl_tee_pph_add(const wchar_t* name, const wchar_t* handler);

This services adds a named Pad-Probe-Handler to the sink pad (only) of the Named Tee component. The PPH will be invoked on every buffer-ready event for the sink pad. More than one PPH can be added to a single Tee Component.

Parameters

  • name [in] unique name of the Tee to update
  • handler [in] uninque name of the PPH to add

Returns

  • DSL_RESULT_SUCCESS on successful add. One of the Return Values defined above on failure

Python Example

retval = dsl_tee_pph_add('my-demuxer-tee', 'my-meter-pph')

dsl_tee_pph_remove

DslReturnType dsl_tee_pph_remove(const wchar_t* name, const wchar_t* handler);

This services removes a named Pad-Probe-Handler from a named Tee. The services will fail if the handler is not a child of the Tee

Parameters

  • name [in] unique name of the Tee to update.
  • handler [in] unique name of the Pad probe handler to remove.

Returns

  • DSL_RESULT_SUCCESS on successful remove. One of the Return Values defined above on failure

Python Example

retval = dsl_tee_pph_remove('my-demuxer-tee', 'my-meter-pph')


API Reference