mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	monitor: return factory_name in the object_info
Pass a factory_name in the object_info of monitor and device. Restructure the factory name to mean something functionaly. With the factory to library mapping this then means that the implementation of certain factories can be configured in the config file.
This commit is contained in:
		
							parent
							
								
									89a86db0c4
								
							
						
					
					
						commit
						1d1f035e78
					
				
					 26 changed files with 218 additions and 168 deletions
				
			
		| 
						 | 
				
			
			@ -42,8 +42,6 @@
 | 
			
		|||
 | 
			
		||||
static const char default_device[] = "/dev/video0";
 | 
			
		||||
 | 
			
		||||
extern const struct spa_handle_factory spa_v4l2_source_factory;
 | 
			
		||||
 | 
			
		||||
struct props {
 | 
			
		||||
	char device[64];
 | 
			
		||||
	char device_name[128];
 | 
			
		||||
| 
						 | 
				
			
			@ -103,7 +101,7 @@ static int emit_info(struct impl *this, bool full)
 | 
			
		|||
 | 
			
		||||
		oinfo = SPA_DEVICE_OBJECT_INFO_INIT();
 | 
			
		||||
		oinfo.type = SPA_TYPE_INTERFACE_Node;
 | 
			
		||||
		oinfo.factory = &spa_v4l2_source_factory;
 | 
			
		||||
		oinfo.factory_name = "api.v4l2.source";
 | 
			
		||||
		oinfo.change_mask = SPA_DEVICE_OBJECT_CHANGE_MASK_PROPS;
 | 
			
		||||
		oinfo.props = &SPA_DICT_INIT(items, 6);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -266,7 +264,7 @@ static int impl_enum_interface_info(const struct spa_handle_factory *factory,
 | 
			
		|||
 | 
			
		||||
const struct spa_handle_factory spa_v4l2_device_factory = {
 | 
			
		||||
	SPA_VERSION_HANDLE_FACTORY,
 | 
			
		||||
	NAME,
 | 
			
		||||
	"api.v4l2.device",
 | 
			
		||||
	NULL,
 | 
			
		||||
	impl_get_size,
 | 
			
		||||
	impl_init,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,8 +40,6 @@
 | 
			
		|||
 | 
			
		||||
#define NAME "v4l2-monitor"
 | 
			
		||||
 | 
			
		||||
extern const struct spa_handle_factory spa_v4l2_device_factory;
 | 
			
		||||
 | 
			
		||||
struct impl {
 | 
			
		||||
	struct spa_handle handle;
 | 
			
		||||
	struct spa_monitor monitor;
 | 
			
		||||
| 
						 | 
				
			
			@ -100,7 +98,7 @@ static int emit_object_info(struct impl *this, uint32_t id, struct udev_device *
 | 
			
		|||
	info = SPA_MONITOR_OBJECT_INFO_INIT();
 | 
			
		||||
 | 
			
		||||
	info.type = SPA_TYPE_INTERFACE_Device;
 | 
			
		||||
	info.factory = &spa_v4l2_device_factory;
 | 
			
		||||
	info.factory_name = "api.v4l2.device";
 | 
			
		||||
	info.change_mask = SPA_MONITOR_OBJECT_CHANGE_MASK_FLAGS |
 | 
			
		||||
		SPA_MONITOR_OBJECT_CHANGE_MASK_PROPS;
 | 
			
		||||
	info.flags = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -394,7 +392,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
 | 
			
		|||
 | 
			
		||||
const struct spa_handle_factory spa_v4l2_monitor_factory = {
 | 
			
		||||
	SPA_VERSION_HANDLE_FACTORY,
 | 
			
		||||
	NAME,
 | 
			
		||||
	"api.v4l2.monitor",
 | 
			
		||||
	NULL,
 | 
			
		||||
	impl_get_size,
 | 
			
		||||
	impl_init,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1045,7 +1045,7 @@ static int impl_enum_interface_info(const struct spa_handle_factory *factory,
 | 
			
		|||
 | 
			
		||||
const struct spa_handle_factory spa_v4l2_source_factory = {
 | 
			
		||||
	SPA_VERSION_HANDLE_FACTORY,
 | 
			
		||||
	NAME,
 | 
			
		||||
	"api.v4l2.source",
 | 
			
		||||
	NULL,
 | 
			
		||||
	impl_get_size,
 | 
			
		||||
	impl_init,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue