mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	spa: ffmpeg: implement spa_handle_factory::get_size
This method is necessary for the creation of a handle, so implement it for both the encoder and decoder.
This commit is contained in:
		
							parent
							
								
									6cb8fb899d
								
							
						
					
					
						commit
						f2bd2ef6fb
					
				
					 4 changed files with 18 additions and 0 deletions
				
			
		| 
						 | 
					@ -458,6 +458,12 @@ impl_get_interface(struct spa_handle *handle, const char *type, void **interface
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					size_t
 | 
				
			||||||
 | 
					spa_ffmpeg_dec_get_size(const struct spa_handle_factory *factory, const struct spa_dict *params)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return sizeof(struct impl);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
spa_ffmpeg_dec_init(struct spa_handle *handle,
 | 
					spa_ffmpeg_dec_init(struct spa_handle *handle,
 | 
				
			||||||
		    const struct spa_dict *info,
 | 
							    const struct spa_dict *info,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -437,6 +437,12 @@ impl_get_interface(struct spa_handle *handle, const char *type, void **interface
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					size_t
 | 
				
			||||||
 | 
					spa_ffmpeg_enc_get_size(const struct spa_handle_factory *factory, const struct spa_dict *params)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return sizeof(struct impl);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
spa_ffmpeg_enc_init(struct spa_handle *handle,
 | 
					spa_ffmpeg_enc_init(struct spa_handle *handle,
 | 
				
			||||||
		    const struct spa_dict *info,
 | 
							    const struct spa_dict *info,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -141,9 +141,11 @@ int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (av_codec_is_encoder(c)) {
 | 
						if (av_codec_is_encoder(c)) {
 | 
				
			||||||
		snprintf(name, sizeof(name), "encoder.%s", c->name);
 | 
							snprintf(name, sizeof(name), "encoder.%s", c->name);
 | 
				
			||||||
 | 
							f.get_size = spa_ffmpeg_enc_get_size;
 | 
				
			||||||
		f.init = ffmpeg_enc_init;
 | 
							f.init = ffmpeg_enc_init;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		snprintf(name, sizeof(name), "decoder.%s", c->name);
 | 
							snprintf(name, sizeof(name), "decoder.%s", c->name);
 | 
				
			||||||
 | 
							f.get_size = spa_ffmpeg_dec_get_size;
 | 
				
			||||||
		f.init = ffmpeg_dec_init;
 | 
							f.init = ffmpeg_dec_init;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,10 +7,14 @@
 | 
				
			||||||
struct spa_dict;
 | 
					struct spa_dict;
 | 
				
			||||||
struct spa_handle;
 | 
					struct spa_handle;
 | 
				
			||||||
struct spa_support;
 | 
					struct spa_support;
 | 
				
			||||||
 | 
					struct spa_handle_factory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int spa_ffmpeg_dec_init(struct spa_handle *handle, const struct spa_dict *info,
 | 
					int spa_ffmpeg_dec_init(struct spa_handle *handle, const struct spa_dict *info,
 | 
				
			||||||
			const struct spa_support *support, uint32_t n_support);
 | 
								const struct spa_support *support, uint32_t n_support);
 | 
				
			||||||
int spa_ffmpeg_enc_init(struct spa_handle *handle, const struct spa_dict *info,
 | 
					int spa_ffmpeg_enc_init(struct spa_handle *handle, const struct spa_dict *info,
 | 
				
			||||||
			const struct spa_support *support, uint32_t n_support);
 | 
								const struct spa_support *support, uint32_t n_support);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					size_t spa_ffmpeg_dec_get_size(const struct spa_handle_factory *factory, const struct spa_dict *params);
 | 
				
			||||||
 | 
					size_t spa_ffmpeg_enc_get_size(const struct spa_handle_factory *factory, const struct spa_dict *params);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue