mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
Make new USE_BUFFERS command
Make a new USE_BUFFERS command to atomically send a buffer array to the remote client. We can use this to then clean up an old array and go to the PAUSED state if possible. Work on formats. Make one structure that can hold all video formats. Work on pipeline suspend and resume. Add jpeg support to v4l2. Work on enum_formats with a filter in v4l2.
This commit is contained in:
parent
7e858ff694
commit
b67c216a04
24 changed files with 688 additions and 514 deletions
|
|
@ -39,6 +39,10 @@ typedef enum {
|
|||
SPA_PROP_ID_AUDIO_RAW_INFO,
|
||||
} SpaPropIdAudio;
|
||||
|
||||
SpaResult spa_prop_info_fill_audio (SpaPropInfo *info,
|
||||
SpaPropIdAudio id,
|
||||
size_t offset);
|
||||
|
||||
struct _SpaAudioRawFormat {
|
||||
SpaFormat format;
|
||||
SpaAudioRawInfo info;
|
||||
|
|
@ -48,10 +52,6 @@ SpaResult spa_audio_raw_format_init (SpaAudioRawFormat *format);
|
|||
SpaResult spa_audio_raw_format_parse (const SpaFormat *format,
|
||||
SpaAudioRawFormat *rawformat);
|
||||
|
||||
SpaResult spa_audio_raw_fill_prop_info (SpaPropInfo *info,
|
||||
SpaPropIdAudio id,
|
||||
size_t offset);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -81,10 +81,9 @@ typedef enum {
|
|||
SPA_CONTROL_CMD_ADD_MEM = 64,
|
||||
SPA_CONTROL_CMD_REMOVE_MEM = 65,
|
||||
|
||||
SPA_CONTROL_CMD_ADD_BUFFER = 66,
|
||||
SPA_CONTROL_CMD_REMOVE_BUFFER = 67,
|
||||
SPA_CONTROL_CMD_PROCESS_BUFFER = 68,
|
||||
SPA_CONTROL_CMD_REUSE_BUFFER = 69,
|
||||
SPA_CONTROL_CMD_USE_BUFFERS = 66,
|
||||
SPA_CONTROL_CMD_PROCESS_BUFFER = 67,
|
||||
SPA_CONTROL_CMD_REUSE_BUFFER = 68,
|
||||
|
||||
} SpaControlCmd;
|
||||
|
||||
|
|
@ -184,18 +183,12 @@ typedef struct {
|
|||
SpaMemoryRef mem;
|
||||
} SpaControlCmdRemoveMem;
|
||||
|
||||
/* SPA_CONTROL_CMD_ADD_BUFFER */
|
||||
/* SPA_CONTROL_CMD_USE_BUFFERS */
|
||||
typedef struct {
|
||||
uint32_t port_id;
|
||||
uint32_t buffer_id;
|
||||
SpaMemoryChunk mem;
|
||||
} SpaControlCmdAddBuffer;
|
||||
|
||||
/* SPA_CONTROL_CMD_REMOVE_BUFFER */
|
||||
typedef struct {
|
||||
uint32_t port_id;
|
||||
uint32_t buffer_id;
|
||||
} SpaControlCmdRemoveBuffer;
|
||||
uint32_t port_id;
|
||||
unsigned int n_buffers;
|
||||
SpaBuffer **buffers;
|
||||
} SpaControlCmdUseBuffers;
|
||||
|
||||
/* SPA_CONTROL_CMD_PROCESS_BUFFER */
|
||||
typedef struct {
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ typedef struct {
|
|||
/**
|
||||
* SpaPropInfo:
|
||||
* @id: unique id
|
||||
* @offset: offset in structure with data
|
||||
* @name: human readable name
|
||||
* @description: description of the property
|
||||
* @flags: property flags
|
||||
|
|
@ -123,10 +124,10 @@ typedef struct {
|
|||
* @n_range_values: number of elements in @range_values
|
||||
* @range_values: array of possible values
|
||||
* @tags: extra tags, NULL terminated
|
||||
* @offset: offset in structure with data
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
size_t offset;
|
||||
const char *name;
|
||||
const char *description;
|
||||
SpaPropFlags flags;
|
||||
|
|
@ -136,7 +137,6 @@ typedef struct {
|
|||
unsigned int n_range_values;
|
||||
const SpaPropRangeInfo *range_values;
|
||||
const char **tags;
|
||||
size_t offset;
|
||||
} SpaPropInfo;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
42
spa/include/spa/video/encoded.h
Normal file
42
spa/include/spa/video/encoded.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* Simple Plugin API
|
||||
* 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 __SPA_VIDEO_ENCODED_H__
|
||||
#define __SPA_VIDEO_ENCODED_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _SpaVideoInfoJPEG SpaVideoInfoJPEG;
|
||||
|
||||
#include <spa/format.h>
|
||||
#include <spa/video/format.h>
|
||||
|
||||
struct _SpaVideoInfoJPEG {
|
||||
SpaRectangle size;
|
||||
SpaFraction framerate;
|
||||
SpaFraction max_framerate;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_VIDEO_ENCODED_H__ */
|
||||
|
|
@ -26,8 +26,9 @@ extern "C" {
|
|||
|
||||
#include <spa/format.h>
|
||||
#include <spa/video/raw.h>
|
||||
#include <spa/video/encoded.h>
|
||||
|
||||
typedef struct _SpaVideoRawFormat SpaVideoRawFormat;
|
||||
typedef struct _SpaFormatVideo SpaFormatVideo;
|
||||
|
||||
typedef enum {
|
||||
SPA_PROP_ID_VIDEO_FORMAT = SPA_PROP_ID_MEDIA_CUSTOM_START,
|
||||
|
|
@ -47,20 +48,24 @@ typedef enum {
|
|||
SPA_PROP_ID_VIDEO_RAW_INFO,
|
||||
} SpaPropIdVideo;
|
||||
|
||||
struct _SpaVideoRawFormat {
|
||||
SpaResult spa_prop_info_fill_video (SpaPropInfo *info,
|
||||
SpaPropIdVideo id,
|
||||
size_t offset);
|
||||
|
||||
SpaResult spa_format_video_init (SpaMediaType type,
|
||||
SpaMediaSubType subtype,
|
||||
SpaFormatVideo *format);
|
||||
SpaResult spa_format_video_parse (const SpaFormat *format,
|
||||
SpaFormatVideo *dest);
|
||||
|
||||
struct _SpaFormatVideo {
|
||||
SpaFormat format;
|
||||
SpaVideoRawInfo info;
|
||||
union {
|
||||
SpaVideoInfoRaw raw;
|
||||
SpaVideoInfoJPEG jpeg;
|
||||
} info;
|
||||
};
|
||||
|
||||
SpaResult spa_video_raw_format_init (SpaVideoRawFormat *format);
|
||||
SpaResult spa_video_raw_format_parse (const SpaFormat *format,
|
||||
SpaVideoRawFormat *rawformat);
|
||||
|
||||
SpaResult spa_video_raw_fill_default_info (SpaVideoRawInfo *info);
|
||||
SpaResult spa_video_raw_fill_prop_info (SpaPropInfo *info,
|
||||
SpaPropIdVideo id,
|
||||
size_t offset);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _SpaVideoRawInfo SpaVideoRawInfo;
|
||||
typedef struct _SpaVideoInfoRaw SpaVideoInfoRaw;
|
||||
|
||||
#include <spa/props.h>
|
||||
#include <spa/video/chroma.h>
|
||||
|
|
@ -146,7 +146,7 @@ typedef enum {
|
|||
} SpaVideoInterlaceMode;
|
||||
|
||||
/**
|
||||
* SpaVideoRawInfo:
|
||||
* SpaVideoInfoRaw:
|
||||
* @format: the format
|
||||
* @size: the frame size of the video
|
||||
* @framerate: the framerate of the video 0/1 means variable rate
|
||||
|
|
@ -165,7 +165,7 @@ typedef enum {
|
|||
* @transfer_function: the transfer function. used to convert between R'G'B' and RGB
|
||||
* @color_primaries: color primaries. used to convert between R'G'B' and CIE XYZ
|
||||
*/
|
||||
struct _SpaVideoRawInfo {
|
||||
struct _SpaVideoInfoRaw {
|
||||
SpaVideoFormat format;
|
||||
SpaRectangle size;
|
||||
SpaFraction framerate;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue