mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
context: move pw_context_find_factory to impl
This commit is contained in:
parent
73eea24443
commit
3084809bed
4 changed files with 28 additions and 29 deletions
|
|
@ -1067,29 +1067,6 @@ error:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Find a factory by name
|
|
||||||
*
|
|
||||||
* \param context the context object
|
|
||||||
* \param name the name of the factory to find
|
|
||||||
*
|
|
||||||
* Find in the list of factories registered in \a context for one with
|
|
||||||
* the given \a name.
|
|
||||||
*
|
|
||||||
* \memberof pw_context
|
|
||||||
*/
|
|
||||||
SPA_EXPORT
|
|
||||||
struct pw_impl_factory *pw_context_find_factory(struct pw_context *context,
|
|
||||||
const char *name)
|
|
||||||
{
|
|
||||||
struct pw_impl_factory *factory;
|
|
||||||
|
|
||||||
spa_list_for_each(factory, &context->factory_list, link) {
|
|
||||||
if (strcmp(factory->info.name, name) == 0)
|
|
||||||
return factory;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int collect_nodes(struct pw_impl_node *driver)
|
static int collect_nodes(struct pw_impl_node *driver)
|
||||||
{
|
{
|
||||||
struct spa_list queue;
|
struct spa_list queue;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ struct pw_context;
|
||||||
|
|
||||||
struct pw_global;
|
struct pw_global;
|
||||||
struct pw_impl_client;
|
struct pw_impl_client;
|
||||||
struct pw_impl_factory;
|
|
||||||
|
|
||||||
#include <pipewire/core.h>
|
#include <pipewire/core.h>
|
||||||
#include <pipewire/loop.h>
|
#include <pipewire/loop.h>
|
||||||
|
|
@ -143,11 +142,6 @@ int pw_context_for_each_global(struct pw_context *context, /**< the context */
|
||||||
struct pw_global *pw_context_find_global(struct pw_context *context, /**< the context */
|
struct pw_global *pw_context_find_global(struct pw_context *context, /**< the context */
|
||||||
uint32_t id /**< the global id */);
|
uint32_t id /**< the global id */);
|
||||||
|
|
||||||
/** Find a factory by name */
|
|
||||||
struct pw_impl_factory *
|
|
||||||
pw_context_find_factory(struct pw_context *context /**< the context */,
|
|
||||||
const char *name /**< the factory name */);
|
|
||||||
|
|
||||||
/** add a spa library for the given factory_name regex */
|
/** add a spa library for the given factory_name regex */
|
||||||
int pw_context_add_spa_lib(struct pw_context *context, const char *factory_regex, const char *lib);
|
int pw_context_add_spa_lib(struct pw_context *context, const char *factory_regex, const char *lib);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -288,3 +288,26 @@ void *pw_impl_factory_create_object(struct pw_impl_factory *factory,
|
||||||
resource, type, version, properties, new_id);
|
resource, type, version, properties, new_id);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Find a factory by name
|
||||||
|
*
|
||||||
|
* \param context the context object
|
||||||
|
* \param name the name of the factory to find
|
||||||
|
*
|
||||||
|
* Find in the list of factories registered in \a context for one with
|
||||||
|
* the given \a name.
|
||||||
|
*
|
||||||
|
* \memberof pw_context
|
||||||
|
*/
|
||||||
|
SPA_EXPORT
|
||||||
|
struct pw_impl_factory *pw_context_find_factory(struct pw_context *context,
|
||||||
|
const char *name)
|
||||||
|
{
|
||||||
|
struct pw_impl_factory *factory;
|
||||||
|
|
||||||
|
spa_list_for_each(factory, &context->factory_list, link) {
|
||||||
|
if (strcmp(factory->info.name, name) == 0)
|
||||||
|
return factory;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,11 @@ void *pw_impl_factory_create_object(struct pw_impl_factory *factory,
|
||||||
struct pw_properties *properties,
|
struct pw_properties *properties,
|
||||||
uint32_t new_id);
|
uint32_t new_id);
|
||||||
|
|
||||||
|
/** Find a factory by name */
|
||||||
|
struct pw_impl_factory *
|
||||||
|
pw_context_find_factory(struct pw_context *context /**< the context */,
|
||||||
|
const char *name /**< the factory name */);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue