mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
Revert "video: Add extra field indicating if modifier value is valid"
This reverts commit 1e6920c33b.
Causes an ABI break.
This commit is contained in:
parent
bdc0720bcb
commit
afedd107a8
3 changed files with 7 additions and 25 deletions
|
|
@ -42,9 +42,7 @@ static inline int
|
||||||
spa_format_video_raw_parse(const struct spa_pod *format,
|
spa_format_video_raw_parse(const struct spa_pod *format,
|
||||||
struct spa_video_info_raw *info)
|
struct spa_video_info_raw *info)
|
||||||
{
|
{
|
||||||
int res;
|
return spa_pod_parse_object(format,
|
||||||
|
|
||||||
res = spa_pod_parse_object(format,
|
|
||||||
SPA_TYPE_OBJECT_Format, NULL,
|
SPA_TYPE_OBJECT_Format, NULL,
|
||||||
SPA_FORMAT_VIDEO_format, SPA_POD_OPT_Id(&info->format),
|
SPA_FORMAT_VIDEO_format, SPA_POD_OPT_Id(&info->format),
|
||||||
SPA_FORMAT_VIDEO_modifier, SPA_POD_OPT_Long(&info->modifier),
|
SPA_FORMAT_VIDEO_modifier, SPA_POD_OPT_Long(&info->modifier),
|
||||||
|
|
@ -61,26 +59,16 @@ spa_format_video_raw_parse(const struct spa_pod *format,
|
||||||
SPA_FORMAT_VIDEO_colorMatrix, SPA_POD_OPT_Id(&info->color_matrix),
|
SPA_FORMAT_VIDEO_colorMatrix, SPA_POD_OPT_Id(&info->color_matrix),
|
||||||
SPA_FORMAT_VIDEO_transferFunction, SPA_POD_OPT_Id(&info->transfer_function),
|
SPA_FORMAT_VIDEO_transferFunction, SPA_POD_OPT_Id(&info->transfer_function),
|
||||||
SPA_FORMAT_VIDEO_colorPrimaries, SPA_POD_OPT_Id(&info->color_primaries));
|
SPA_FORMAT_VIDEO_colorPrimaries, SPA_POD_OPT_Id(&info->color_primaries));
|
||||||
|
|
||||||
info->use_modifier = spa_pod_find_prop (format, NULL, SPA_FORMAT_VIDEO_modifier) ? true : false;
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
spa_format_video_dsp_parse(const struct spa_pod *format,
|
spa_format_video_dsp_parse(const struct spa_pod *format,
|
||||||
struct spa_video_info_dsp *info)
|
struct spa_video_info_dsp *info)
|
||||||
{
|
{
|
||||||
int res;
|
return spa_pod_parse_object(format,
|
||||||
|
|
||||||
res = spa_pod_parse_object(format,
|
|
||||||
SPA_TYPE_OBJECT_Format, NULL,
|
SPA_TYPE_OBJECT_Format, NULL,
|
||||||
SPA_FORMAT_VIDEO_format, SPA_POD_OPT_Id(&info->format),
|
SPA_FORMAT_VIDEO_format, SPA_POD_OPT_Id(&info->format),
|
||||||
SPA_FORMAT_VIDEO_modifier, SPA_POD_OPT_Long(&info->modifier));
|
SPA_FORMAT_VIDEO_modifier, SPA_POD_OPT_Long(&info->modifier));
|
||||||
|
|
||||||
info->use_modifier = spa_pod_find_prop (format, NULL, SPA_FORMAT_VIDEO_modifier) ? true : false;
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct spa_pod *
|
static inline struct spa_pod *
|
||||||
|
|
@ -102,7 +90,7 @@ spa_format_video_raw_build(struct spa_pod_builder *builder, uint32_t id,
|
||||||
if (info->framerate.denom != 0)
|
if (info->framerate.denom != 0)
|
||||||
spa_pod_builder_add(builder,
|
spa_pod_builder_add(builder,
|
||||||
SPA_FORMAT_VIDEO_framerate, SPA_POD_Fraction(&info->framerate), 0);
|
SPA_FORMAT_VIDEO_framerate, SPA_POD_Fraction(&info->framerate), 0);
|
||||||
if (info->use_modifier)
|
if (info->modifier != 0)
|
||||||
spa_pod_builder_add(builder,
|
spa_pod_builder_add(builder,
|
||||||
SPA_FORMAT_VIDEO_modifier, SPA_POD_Long(info->modifier), 0);
|
SPA_FORMAT_VIDEO_modifier, SPA_POD_Long(info->modifier), 0);
|
||||||
if (info->max_framerate.denom != 0)
|
if (info->max_framerate.denom != 0)
|
||||||
|
|
@ -154,7 +142,7 @@ spa_format_video_dsp_build(struct spa_pod_builder *builder, uint32_t id,
|
||||||
if (info->format != SPA_VIDEO_FORMAT_UNKNOWN)
|
if (info->format != SPA_VIDEO_FORMAT_UNKNOWN)
|
||||||
spa_pod_builder_add(builder,
|
spa_pod_builder_add(builder,
|
||||||
SPA_FORMAT_VIDEO_format, SPA_POD_Id(info->format), 0);
|
SPA_FORMAT_VIDEO_format, SPA_POD_Id(info->format), 0);
|
||||||
if (info->use_modifier)
|
if (info->modifier)
|
||||||
spa_pod_builder_add(builder,
|
spa_pod_builder_add(builder,
|
||||||
SPA_FORMAT_VIDEO_modifier, SPA_POD_Long(info->modifier), 0);
|
SPA_FORMAT_VIDEO_modifier, SPA_POD_Long(info->modifier), 0);
|
||||||
return (struct spa_pod*)spa_pod_builder_pop(builder, &f);
|
return (struct spa_pod*)spa_pod_builder_pop(builder, &f);
|
||||||
|
|
|
||||||
|
|
@ -186,9 +186,7 @@ enum spa_video_interlace_mode {
|
||||||
*/
|
*/
|
||||||
struct spa_video_info_raw {
|
struct spa_video_info_raw {
|
||||||
enum spa_video_format format; /**< the format */
|
enum spa_video_format format; /**< the format */
|
||||||
|
int64_t modifier; /**< format modifier
|
||||||
bool use_modifier; /**< whether the modifier field has a valid value */
|
|
||||||
uint64_t modifier; /**< format modifier
|
|
||||||
* only used with DMA-BUF */
|
* only used with DMA-BUF */
|
||||||
struct spa_rectangle size; /**< the frame size of the video */
|
struct spa_rectangle size; /**< the frame size of the video */
|
||||||
struct spa_fraction framerate; /**< the framerate of the video, 0/1 means variable rate */
|
struct spa_fraction framerate; /**< the framerate of the video, 0/1 means variable rate */
|
||||||
|
|
@ -212,8 +210,7 @@ struct spa_video_info_raw {
|
||||||
|
|
||||||
struct spa_video_info_dsp {
|
struct spa_video_info_dsp {
|
||||||
enum spa_video_format format;
|
enum spa_video_format format;
|
||||||
bool use_modifier;
|
int64_t modifier;
|
||||||
uint64_t modifier;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SPA_VIDEO_INFO_DSP_INIT(...) ((struct spa_video_info_dsp) { __VA_ARGS__ })
|
#define SPA_VIDEO_INFO_DSP_INIT(...) ((struct spa_video_info_dsp) { __VA_ARGS__ })
|
||||||
|
|
|
||||||
|
|
@ -676,10 +676,7 @@ static int port_set_format(struct impl *impl, struct port *port,
|
||||||
info.media_subtype == port->current_format->media_subtype &&
|
info.media_subtype == port->current_format->media_subtype &&
|
||||||
info.info.raw.format == port->current_format->info.raw.format &&
|
info.info.raw.format == port->current_format->info.raw.format &&
|
||||||
info.info.raw.size.width == port->current_format->info.raw.size.width &&
|
info.info.raw.size.width == port->current_format->info.raw.size.width &&
|
||||||
info.info.raw.size.height == port->current_format->info.raw.size.height &&
|
info.info.raw.size.height == port->current_format->info.raw.size.height)
|
||||||
info.info.raw.use_modifier == port->current_format->info.raw.use_modifier &&
|
|
||||||
(!info.info.raw.use_modifier ||
|
|
||||||
info.info.raw.modifier == port->current_format->info.raw.modifier))
|
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case SPA_MEDIA_SUBTYPE_mjpg:
|
case SPA_MEDIA_SUBTYPE_mjpg:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue