mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
inspect: improve output
Keep state variable to enumerate things. This allows us to remove the expectation that the same index will give the same item. Use a new rectangle type for video size. When enumerating sizes, this allows us to specify relations between width and height more easily. Remove the struct and bytes type, they are like pointer. Add filter to enum_formats to speed up enumerations.
This commit is contained in:
parent
77bc2a1793
commit
b9320c67c2
27 changed files with 414 additions and 287 deletions
|
|
@ -240,12 +240,14 @@ struct _SpaNode {
|
|||
* SpaNode::port_enum_formats:
|
||||
* @handle: a #SpaHandle
|
||||
* @port_id: the port to query
|
||||
* @index: the format index to retrieve
|
||||
* @format: pointer to a format
|
||||
* @filter: a format filter
|
||||
* @state: a state variable, %NULL to get the first item
|
||||
*
|
||||
* Enumerate all possible formats on @port_id of @node.
|
||||
* Enumerate all possible formats on @port_id of @node that are compatible
|
||||
* with @filter..
|
||||
*
|
||||
* Use the index to retrieve the formats one by one until the function
|
||||
* Use @state to retrieve the formats one by one until the function
|
||||
* returns #SPA_RESULT_ENUM_END.
|
||||
*
|
||||
* The result format can be queried and modified and ultimately be used
|
||||
|
|
@ -254,13 +256,13 @@ struct _SpaNode {
|
|||
* Returns: #SPA_RESULT_OK on success
|
||||
* #SPA_RESULT_INVALID_ARGUMENTS when node or format is %NULL
|
||||
* #SPA_RESULT_INVALID_PORT when port_id is not valid
|
||||
* #SPA_RESULT_ENUM_END when no format exists for @index
|
||||
*
|
||||
* #SPA_RESULT_ENUM_END when no format exists
|
||||
*/
|
||||
SpaResult (*port_enum_formats) (SpaHandle *handle,
|
||||
uint32_t port_id,
|
||||
unsigned int index,
|
||||
SpaFormat **format);
|
||||
SpaFormat **format,
|
||||
const SpaFormat *filter,
|
||||
void **state);
|
||||
/**
|
||||
* SpaNode::port_set_format:
|
||||
* @handle: a #SpaHandle
|
||||
|
|
|
|||
|
|
@ -102,10 +102,10 @@ struct _SpaHandleFactory {
|
|||
/**
|
||||
* SpaHandle::enum_interface_info:
|
||||
* @factory: a #SpaHandleFactory
|
||||
* @index: the interface index
|
||||
* @info: result to hold SpaInterfaceInfo.
|
||||
* @state: state to keep track of the enumeration, %NULL for first item
|
||||
*
|
||||
* Get the interface information at @index.
|
||||
* Enumerate the interface information for @factory.
|
||||
*
|
||||
* Returns: #SPA_RESULT_OK on success
|
||||
* #SPA_RESULT_NOT_IMPLEMENTED when there are no interfaces
|
||||
|
|
@ -113,14 +113,14 @@ struct _SpaHandleFactory {
|
|||
* #SPA_RESULT_ENUM_END when there are no more infos
|
||||
*/
|
||||
SpaResult (*enum_interface_info) (const SpaHandleFactory *factory,
|
||||
unsigned int index,
|
||||
const SpaInterfaceInfo **info);
|
||||
const SpaInterfaceInfo **info,
|
||||
void **state);
|
||||
};
|
||||
|
||||
/**
|
||||
* SpaEnumHandleFactoryFunc:
|
||||
* @index: the index to enumerate
|
||||
* @factory: a location to hold the factory result
|
||||
* @state: state to keep track of the enumeration
|
||||
*
|
||||
* The function signature of the entry point in a plugin.
|
||||
*
|
||||
|
|
@ -128,13 +128,13 @@ struct _SpaHandleFactory {
|
|||
* #SPA_RESULT_INVALID_ARGUMENTS when factory is %NULL
|
||||
* #SPA_RESULT_ENUM_END when there are no more factories
|
||||
*/
|
||||
typedef SpaResult (*SpaEnumHandleFactoryFunc) (unsigned int index,
|
||||
const SpaHandleFactory **factory);
|
||||
typedef SpaResult (*SpaEnumHandleFactoryFunc) (const SpaHandleFactory **factory,
|
||||
void **state);
|
||||
|
||||
/**
|
||||
* spa_enum_handle_factory:
|
||||
* @index: the index to enumerate
|
||||
* @factory: a location to hold the factory result
|
||||
* @state: state to keep track of the enumeration
|
||||
*
|
||||
* The entry point in a plugin.
|
||||
*
|
||||
|
|
@ -142,8 +142,8 @@ typedef SpaResult (*SpaEnumHandleFactoryFunc) (unsigned int index,
|
|||
* #SPA_RESULT_INVALID_ARGUMENTS when factory is %NULL
|
||||
* #SPA_RESULT_ENUM_END when there are no more factories
|
||||
*/
|
||||
SpaResult spa_enum_handle_factory (unsigned int index,
|
||||
const SpaHandleFactory **factory);
|
||||
SpaResult spa_enum_handle_factory (const SpaHandleFactory **factory,
|
||||
void **state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
|
|
|||
|
|
@ -46,13 +46,17 @@ typedef enum {
|
|||
SPA_PROP_TYPE_FLOAT,
|
||||
SPA_PROP_TYPE_DOUBLE,
|
||||
SPA_PROP_TYPE_STRING,
|
||||
SPA_PROP_TYPE_POINTER,
|
||||
SPA_PROP_TYPE_RECTANGLE,
|
||||
SPA_PROP_TYPE_FRACTION,
|
||||
SPA_PROP_TYPE_BITMASK,
|
||||
SPA_PROP_TYPE_BYTES,
|
||||
SPA_PROP_TYPE_STRUCT,
|
||||
SPA_PROP_TYPE_POINTER
|
||||
} SpaPropType;
|
||||
|
||||
typedef struct {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
} SpaRectangle;
|
||||
|
||||
typedef struct {
|
||||
uint32_t num;
|
||||
uint32_t denom;
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ typedef struct _SpaVideoRawFormat SpaVideoRawFormat;
|
|||
|
||||
typedef enum {
|
||||
SPA_PROP_ID_VIDEO_FORMAT = SPA_PROP_ID_MEDIA_CUSTOM_START,
|
||||
SPA_PROP_ID_VIDEO_WIDTH,
|
||||
SPA_PROP_ID_VIDEO_HEIGHT,
|
||||
SPA_PROP_ID_VIDEO_SIZE,
|
||||
SPA_PROP_ID_VIDEO_FRAMERATE,
|
||||
SPA_PROP_ID_VIDEO_MAX_FRAMERATE,
|
||||
SPA_PROP_ID_VIDEO_VIEWS,
|
||||
|
|
|
|||
|
|
@ -148,8 +148,7 @@ typedef enum {
|
|||
/**
|
||||
* SpaVideoRawInfo:
|
||||
* @format: the format
|
||||
* @width: the width of the video
|
||||
* @height: the height of the video
|
||||
* @size: the frame size of the video
|
||||
* @framerate: the framerate of the video 0/1 means variable rate
|
||||
* @max_framerate: the maximum framerate of the video. This is only valid when
|
||||
* @framerate is 0/1
|
||||
|
|
@ -168,8 +167,7 @@ typedef enum {
|
|||
*/
|
||||
struct _SpaVideoRawInfo {
|
||||
SpaVideoFormat format;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
SpaRectangle size;
|
||||
SpaFraction framerate;
|
||||
SpaFraction max_framerate;
|
||||
unsigned int views;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue