mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	 1be939c672
			
		
	
	
		1be939c672
		
	
	
	
	
		
			
			The vast majority of users will want to build with a build system, so let's add a minimal example there to avoid guesswork.
		
			
				
	
	
		
			58 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| /** \page page_tutorial1 Tutorial - Part 1: Getting started
 | |
| 
 | |
| 
 | |
| \ref page_tutorial "Index" | \ref page_tutorial2
 | |
| 
 | |
| In this tutorial we show the basics of a simple PipeWire application.
 | |
| Use this tutorial to get started and help you set up your development
 | |
| environment.
 | |
| 
 | |
| ## Initialization
 | |
| 
 | |
| Let get started with the simplest application.
 | |
| 
 | |
| \code{.c}
 | |
| #include <pipewire/pipewire.h>
 | |
| 
 | |
| int main(int argc, char *argv[])
 | |
| {
 | |
| 	pw_init(&argc, &argv);
 | |
| 
 | |
| 	fprintf(stdout, "Compiled with libpipewire %s\n"
 | |
|                         "Linked with libpipewire %s\n",
 | |
|                                 pw_get_headers_version(),
 | |
|                                 pw_get_library_version());
 | |
| 	return 0;
 | |
| }
 | |
| \endcode
 | |
| 
 | |
| Before you can use any PipeWire functions, you need to call `pw_init()`.
 | |
| 
 | |
| ## Compilation
 | |
| 
 | |
| PipeWire provides a pkg-config file named `libpipewire-0.3` (note: the version
 | |
| suffix may change with future releases of pipewire).
 | |
| To compile the simple test application, copy it into a test1.c file and
 | |
| use pkg-config to provide the required dependencies:
 | |
| 
 | |
|     gcc -Wall test1.c -o test1 $(pkg-config --cflags --libs libpipewire-0.3)
 | |
| 
 | |
| then run it with:
 | |
| 
 | |
|     # ./test1
 | |
|     Compiled with libpipewire 0.3.5
 | |
|     Linked with libpipewire 0.3.5
 | |
|     #
 | |
| 
 | |
| Use your build system's pkg-config support to integrate it into your project.
 | |
| For example, a minimal [meson.build](https://mesonbuild.com/) entry would look
 | |
| like this:
 | |
| 
 | |
|     project('test1', ['c'])
 | |
|     pipewire_dep = dependency('libpipewire-0.3')
 | |
|     executable('test1', 'test1.c',
 | |
|                dependencies: [pipewire_dep])
 | |
| 
 | |
| \ref page_tutorial "Index" | \ref page_tutorial2
 | |
| 
 | |
| */
 |