:orphan: .. index:: pair: group; Test API to operate the DLNA UPnP Content Directory Service .. _doxid-group__tapi__upnp__cd__service: Test API to operate the DLNA UPnP Content Directory Service =========================================================== .. toctree:: :hidden: enum_tapi_upnp_cd_object_type.rst enum_tapi_upnp_cd_resource_type.rst struct_tapi_upnp_cd_container.rst struct_tapi_upnp_cd_container_node.rst struct_tapi_upnp_cd_contributor.rst struct_tapi_upnp_cd_contributor_node.rst struct_tapi_upnp_cd_object.rst struct_tapi_upnp_cd_resource.rst struct_tapi_upnp_cd_resource_node.rst Overview ~~~~~~~~ Definition of Test API for DLNA UPnP Content Directory Service features. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // typedefs typedef enum :ref:`tapi_upnp_cd_resource_type` :ref:`tapi_upnp_cd_resource_type`; typedef enum :ref:`tapi_upnp_cd_object_type` :ref:`tapi_upnp_cd_object_type`; typedef struct :ref:`tapi_upnp_cd_contributor` :ref:`tapi_upnp_cd_contributor`; typedef struct :ref:`tapi_upnp_cd_contributor_node` :target:`tapi_upnp_cd_contributor_node`; typedef struct :ref:`tapi_upnp_cd_resource` :ref:`tapi_upnp_cd_resource`; typedef struct :ref:`tapi_upnp_cd_resource_node` :ref:`tapi_upnp_cd_resource_node`; typedef struct :ref:`tapi_upnp_cd_object` :ref:`tapi_upnp_cd_object`; typedef struct :ref:`tapi_upnp_cd_container` :ref:`tapi_upnp_cd_container`; typedef struct :ref:`tapi_upnp_cd_container_node` :ref:`tapi_upnp_cd_container_node`; typedef void (*:ref:`cd_handler`)( tapi_upnp_cd_container_node *, void * ); // enums enum :ref:`tapi_upnp_cd_object_type`; enum :ref:`tapi_upnp_cd_resource_type`; // structs struct :ref:`tapi_upnp_cd_container`; struct :ref:`tapi_upnp_cd_container_node`; struct :ref:`tapi_upnp_cd_contributor`; struct :ref:`tapi_upnp_cd_contributor_node`; struct :ref:`tapi_upnp_cd_object`; struct :ref:`tapi_upnp_cd_resource`; struct :ref:`tapi_upnp_cd_resource_node`; // global functions void :ref:`tapi_upnp_cd_tree_dfs`(:ref:`tapi_upnp_cd_container_node`* container, :ref:`cd_handler` presearch, :ref:`cd_handler` postsearch, void* user_data); static :ref:`tapi_upnp_cd_container_node`* :ref:`tapi_upnp_cd_get_parent`(const :ref:`tapi_upnp_cd_container_node`* container); :ref:`te_errno` :ref:`tapi_upnp_cd_get_root`(:ref:`rcf_rpc_server`* rpcs, const :ref:`tapi_upnp_service_info`* service, :ref:`tapi_upnp_cd_container_node`* container); :ref:`te_errno` :ref:`tapi_upnp_cd_get_children`(:ref:`rcf_rpc_server`* rpcs, const :ref:`tapi_upnp_service_info`* service, :ref:`tapi_upnp_cd_container_node`* container); :ref:`te_errno` :ref:`tapi_upnp_cd_get_tree`(:ref:`rcf_rpc_server`* rpcs, const :ref:`tapi_upnp_service_info`* service, const char* path_filter, :ref:`tapi_upnp_cd_container_node`* container); void :ref:`tapi_upnp_cd_remove_container`(:ref:`tapi_upnp_cd_container_node`* container); void :ref:`tapi_upnp_cd_remove_tree`(:ref:`tapi_upnp_cd_container_node`* root); void :ref:`tapi_upnp_print_content_directory`(const :ref:`tapi_upnp_cd_container_node`* container); size_t :ref:`tapi_upnp_cd_get_objects_count`(const :ref:`tapi_upnp_cd_container_node`* container, :ref:`tapi_upnp_cd_object_type` type); .. _details-group__tapi__upnp__cd__service: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Definition of Test API for DLNA UPnP Content Directory Service features. Copyright (C) 2004-2022 OKTET Labs Ltd. All rights reserved. Typedefs -------- .. index:: pair: typedef; tapi_upnp_cd_resource_type .. _doxid-group__tapi__upnp__cd__service_1ga7203c8c94e9c51c0b3ddd3b4b91766fc: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_upnp_cd_resource_type` tapi_upnp_cd_resource_type Multimedia content types which can be returned as a resource. .. index:: pair: typedef; tapi_upnp_cd_object_type .. _doxid-group__tapi__upnp__cd__service_1ga910c30e454f27fb82ffeea8ceca120fd: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_upnp_cd_object_type` tapi_upnp_cd_object_type Object type that is either container (i.e contains other objects) or item. .. index:: pair: typedef; tapi_upnp_cd_contributor .. _doxid-group__tapi__upnp__cd__service_1ga34bcbb04d9a89fe02b703e782a0d3a71: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_upnp_cd_contributor` tapi_upnp_cd_contributor Parameters of a contributors resource in ContentDirectory service. .. index:: pair: typedef; tapi_upnp_cd_resource .. _doxid-group__tapi__upnp__cd__service_1ga9172ed45dcd7e0ecd37d49e401898791: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_upnp_cd_resource` tapi_upnp_cd_resource Parameters of a resource in ContentDirectory service. .. index:: pair: typedef; tapi_upnp_cd_resource_node .. _doxid-group__tapi__upnp__cd__service_1gada1603fc8d9d01b1b8306bea9ca22856: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_upnp_cd_resource_node` tapi_upnp_cd_resource_node Node of the :ref:`tapi_upnp_cd_resource ` list. .. index:: pair: typedef; tapi_upnp_cd_object .. _doxid-group__tapi__upnp__cd__service_1ga6f0f055c319f75853a8632389c703266: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_upnp_cd_object` tapi_upnp_cd_object Parameters of an object (common for items and containers) in ContentDirectory service. .. index:: pair: typedef; tapi_upnp_cd_container .. _doxid-group__tapi__upnp__cd__service_1gaf029c6190121ac774048a4d5f66646cf: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_upnp_cd_container` tapi_upnp_cd_container A container context in ContentDirectory service. .. index:: pair: typedef; tapi_upnp_cd_container_node .. _doxid-group__tapi__upnp__cd__service_1gad36f13ddcbabdd165ba4b231192be66f: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_upnp_cd_container_node` tapi_upnp_cd_container_node Node of the :ref:`tapi_upnp_cd_container ` list. .. index:: pair: typedef; cd_handler .. _doxid-group__tapi__upnp__cd__service_1gad683719c4a0d577196bc11e53f033492: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef void (*cd_handler)( tapi_upnp_cd_container_node *, void * ) Prototype of function of handler for using in .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - container - Container context .. rubric:: See also: :ref:`tapi_upnp_cd_tree_dfs `. Global Functions ---------------- .. index:: pair: function; tapi_upnp_cd_tree_dfs .. _doxid-group__tapi__upnp__cd__service_1ga7e7a66c349816a5f0637f479d62b191d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tapi_upnp_cd_tree_dfs(:ref:`tapi_upnp_cd_container_node`* container, :ref:`cd_handler` presearch, :ref:`cd_handler` postsearch, void* user_data) Recursively call callbacks on each container in UPnP ContentDirectory tree using depth-first search on tree. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - container - UPnP ContentDirectory subtree root element. * - presearch - Pre search handler that is called on subtree node. * - postsearch - Post search handler that is called on subtree node. * - user_data - Additional data to post to ``presearch`` and ``postsearch`` handlers. .. index:: pair: function; tapi_upnp_cd_get_parent .. _doxid-group__tapi__upnp__cd__service_1ga465fcb64bf77a6ca05746f7fdb205cf5: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`tapi_upnp_cd_container_node`* tapi_upnp_cd_get_parent(const :ref:`tapi_upnp_cd_container_node`* container) Retrieve information about a container parent object. It does not invoke action on UPnP Control Point just gets parent from child context. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - container - The container location which contains parent content. .. rubric:: Returns: Parent container, or ``NULL`` if ``container`` has no parent, i.e. it is a root object. .. index:: pair: function; tapi_upnp_cd_get_root .. _doxid-group__tapi__upnp__cd__service_1ga53b79c9f1ef0ed71bd674980407f9c38: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_upnp_cd_get_root(:ref:`rcf_rpc_server`* rpcs, const :ref:`tapi_upnp_service_info`* service, :ref:`tapi_upnp_cd_container_node`* container) Retrieve information about a root container. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rpcs - RPC server handle. * - service - ContentDirectory service context. * - container - The container location where information will be saved. .. rubric:: Returns: Status code. On success, ``0``. .. index:: pair: function; tapi_upnp_cd_get_children .. _doxid-group__tapi__upnp__cd__service_1gaad3890e7a7d8f177a47a4acd4938de55: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_upnp_cd_get_children(:ref:`rcf_rpc_server`* rpcs, const :ref:`tapi_upnp_service_info`* service, :ref:`tapi_upnp_cd_container_node`* container) Retrieve information about a container child objects. Returned data about the children will be saved inside the children list of ``container``. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rpcs - RPC server handle. * - service - ContentDirectory service context. * - container - The container location which contains parent content. .. rubric:: Returns: Status code. On success, ``0``. .. index:: pair: function; tapi_upnp_cd_get_tree .. _doxid-group__tapi__upnp__cd__service_1ga0572d32e0021ecb4c72f2835e59c366a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_upnp_cd_get_tree(:ref:`rcf_rpc_server`* rpcs, const :ref:`tapi_upnp_service_info`* service, const char* path_filter, :ref:`tapi_upnp_cd_container_node`* container) Retrieve tree structure and data of Content Directory which placement is matched to ``path_filter``, for example, Video/Folders. This function releases ``container`` before retrieve a new data. Note, ``container`` should be released with either **tapi_upnp_cd_remove_container** or **tapi_upnp_cd_remove_tree** when it is no longer needed. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rpcs - RPC server handle. * - service - ContentDirectory service context. * - path_filter - Root path to retrieve data from. May be ``NULL`` or empty string to retrieve all content. * - container - Container to put data to. * - TE_ENODATA - There are no data which is satisfied to ``path_filter``. .. rubric:: Returns: Status code. On success, ``0``, on error ``container`` will be not changed. .. index:: pair: function; tapi_upnp_cd_remove_container .. _doxid-group__tapi__upnp__cd__service_1ga10ff2b07a00477ac6a599ff63b13f44c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tapi_upnp_cd_remove_container(:ref:`tapi_upnp_cd_container_node`* container) Remove the UPnP ContentDirectory container from the tree with all of it children, free content memory and update parent. User should care about freeing ``container`` if needed. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - container - Container context. .. index:: pair: function; tapi_upnp_cd_remove_tree .. _doxid-group__tapi__upnp__cd__service_1gadaf875ee55ae6971163a0e124775e820: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tapi_upnp_cd_remove_tree(:ref:`tapi_upnp_cd_container_node`* root) Remove the all UPnP ContentDirectory containers: go through all parents to the root node and then remove all of it children. User should care about freeing ``root`` if needed. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - root - Container context. .. rubric:: See also: :ref:`tapi_upnp_cd_remove_container ` .. index:: pair: function; tapi_upnp_print_content_directory .. _doxid-group__tapi__upnp__cd__service_1ga991ea14658885de07320cd1f0bfd9eee: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tapi_upnp_print_content_directory(const :ref:`tapi_upnp_cd_container_node`* container) Print UPnP Content Directory context using RING function. This function should be used for debugging purpose. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - container - Container context. .. index:: pair: function; tapi_upnp_cd_get_objects_count .. _doxid-group__tapi__upnp__cd__service_1gaae48af137760f491f9e873a7c572f566: .. ref-code-block:: cpp :class: doxyrest-title-code-block size_t tapi_upnp_cd_get_objects_count(const :ref:`tapi_upnp_cd_container_node`* container, :ref:`tapi_upnp_cd_object_type` type) Get a number of UPnP Content Directory objects. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - container - Container context. * - type - Content Directory object type. .. rubric:: Returns: Number of UPnP Content Directory objects.