mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	Enable header metadata
Enable the header metadata so that we have timestamps again. Rework allocation in the link a little. Reuse previously allocated buffers when possible. Keep track of where the buffers was allocated. Make some more convenience functions to initialize buffer headers. Make it so that we move allocations to the app. Make some helpers to make memfd memory in pinos now that we will be able to do all allocation there.
This commit is contained in:
		
							parent
							
								
									24108e01c1
								
							
						
					
					
						commit
						9d4048e73a
					
				
					 15 changed files with 504 additions and 157 deletions
				
			
		
							
								
								
									
										55
									
								
								pinos/server/utils.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								pinos/server/utils.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,55 @@
 | 
			
		|||
/* Pinos
 | 
			
		||||
 * Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
 | 
			
		||||
 *
 | 
			
		||||
 * This library is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU Library General Public
 | 
			
		||||
 * License as published by the Free Software Foundation; either
 | 
			
		||||
 * version 2 of the License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This library is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * Library General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Library General Public
 | 
			
		||||
 * License along with this library; if not, write to the
 | 
			
		||||
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 | 
			
		||||
 * Boston, MA 02110-1301, USA.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __PINOS_UTILS_H__
 | 
			
		||||
#define __PINOS_UTILS_H__
 | 
			
		||||
 | 
			
		||||
#include <glib-object.h>
 | 
			
		||||
 | 
			
		||||
G_BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
typedef struct _PinosMemblock PinosMemblock;
 | 
			
		||||
 | 
			
		||||
#include <pinos/server/daemon.h>
 | 
			
		||||
 | 
			
		||||
typedef enum {
 | 
			
		||||
  PINOS_MEMBLOCK_FLAG_NONE           = 0,
 | 
			
		||||
  PINOS_MEMBLOCK_FLAG_WITH_FD        = (1 << 0),
 | 
			
		||||
  PINOS_MEMBLOCK_FLAG_MAP_READ       = (1 << 1),
 | 
			
		||||
  PINOS_MEMBLOCK_FLAG_MAP_WRITE      = (1 << 2),
 | 
			
		||||
  PINOS_MEMBLOCK_FLAG_SEAL           = (1 << 3),
 | 
			
		||||
} PinosMemblockFlags;
 | 
			
		||||
 | 
			
		||||
#define PINOS_MEMBLOCK_FLAG_MAP_READWRITE (PINOS_MEMBLOCK_FLAG_MAP_READ | PINOS_MEMBLOCK_FLAG_MAP_WRITE)
 | 
			
		||||
 | 
			
		||||
struct _PinosMemblock {
 | 
			
		||||
  PinosMemblockFlags flags;
 | 
			
		||||
  int                fd;
 | 
			
		||||
  gpointer          *ptr;
 | 
			
		||||
  gsize              size;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
gboolean      pinos_memblock_alloc     (PinosMemblockFlags  flags,
 | 
			
		||||
                                        gsize               size,
 | 
			
		||||
                                        PinosMemblock      *mem);
 | 
			
		||||
void          pinos_memblock_free      (PinosMemblock      *mem);
 | 
			
		||||
 | 
			
		||||
G_END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif /* __PINOS_UTILS_H__ */
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue