mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pod: make format like other PODs
This commit is contained in:
parent
e2d930e394
commit
f02f93cda9
13 changed files with 125 additions and 87 deletions
|
|
@ -95,7 +95,7 @@ pinos_serialize_format_get_size (const SpaFormat *format)
|
|||
if (format == NULL)
|
||||
return 0;
|
||||
|
||||
return SPA_FORMAT_SIZE (format);
|
||||
return SPA_POD_SIZE (format);
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
@ -106,7 +106,7 @@ pinos_serialize_format_serialize (void *dest, const SpaFormat *format)
|
|||
if (format == NULL)
|
||||
return 0;
|
||||
|
||||
size = SPA_FORMAT_SIZE (format);
|
||||
size = SPA_POD_SIZE (format);
|
||||
memcpy (dest, format, size);
|
||||
|
||||
return size;
|
||||
|
|
|
|||
|
|
@ -444,13 +444,13 @@ gst_caps_from_format (const SpaFormat *format)
|
|||
{
|
||||
GstCaps *res = NULL;
|
||||
|
||||
if (format->media_type == SPA_MEDIA_TYPE_VIDEO) {
|
||||
if (format->body.media_type == SPA_MEDIA_TYPE_VIDEO) {
|
||||
SpaVideoInfo f;
|
||||
|
||||
if (spa_format_video_parse (format, &f) < 0)
|
||||
return NULL;
|
||||
|
||||
if (format->media_subtype == SPA_MEDIA_SUBTYPE_RAW) {
|
||||
if (format->body.media_subtype == SPA_MEDIA_SUBTYPE_RAW) {
|
||||
res = gst_caps_new_simple ("video/x-raw",
|
||||
"format", G_TYPE_STRING, gst_video_format_to_string (f.info.raw.format),
|
||||
"width", G_TYPE_INT, f.info.raw.size.width,
|
||||
|
|
@ -458,14 +458,14 @@ gst_caps_from_format (const SpaFormat *format)
|
|||
"framerate", GST_TYPE_FRACTION, f.info.raw.framerate.num, f.info.raw.framerate.denom,
|
||||
NULL);
|
||||
}
|
||||
else if (format->media_subtype == SPA_MEDIA_SUBTYPE_MJPG) {
|
||||
else if (format->body.media_subtype == SPA_MEDIA_SUBTYPE_MJPG) {
|
||||
res = gst_caps_new_simple ("image/jpeg",
|
||||
"width", G_TYPE_INT, f.info.mjpg.size.width,
|
||||
"height", G_TYPE_INT, f.info.mjpg.size.height,
|
||||
"framerate", GST_TYPE_FRACTION, f.info.mjpg.framerate.num, f.info.mjpg.framerate.denom,
|
||||
NULL);
|
||||
}
|
||||
else if (format->media_subtype == SPA_MEDIA_SUBTYPE_H264) {
|
||||
else if (format->body.media_subtype == SPA_MEDIA_SUBTYPE_H264) {
|
||||
res = gst_caps_new_simple ("video/x-h264",
|
||||
"width", G_TYPE_INT, f.info.h264.size.width,
|
||||
"height", G_TYPE_INT, f.info.h264.size.height,
|
||||
|
|
@ -474,13 +474,13 @@ gst_caps_from_format (const SpaFormat *format)
|
|||
"alignment", G_TYPE_STRING, "au",
|
||||
NULL);
|
||||
}
|
||||
} else if (format->media_type == SPA_MEDIA_TYPE_AUDIO) {
|
||||
} else if (format->body.media_type == SPA_MEDIA_TYPE_AUDIO) {
|
||||
SpaAudioInfo f;
|
||||
|
||||
if (spa_format_audio_parse (format, &f) < 0)
|
||||
return NULL;
|
||||
|
||||
if (format->media_subtype == SPA_MEDIA_SUBTYPE_RAW) {
|
||||
if (format->body.media_subtype == SPA_MEDIA_SUBTYPE_RAW) {
|
||||
res = gst_caps_new_simple ("audio/x-raw",
|
||||
"format", G_TYPE_STRING, gst_audio_format_to_string (f.info.raw.format),
|
||||
"layout", G_TYPE_STRING, "interleaved",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue