fix formats

This commit is contained in:
Wim Taymans 2017-04-19 12:33:42 +02:00
parent 7ef4fea2f2
commit e864836300
2 changed files with 6 additions and 5 deletions

View file

@ -615,7 +615,7 @@ handle_id_prop (SpaPODProp *prop, const char *key, GstCaps *res)
if (!(flags & SPA_POD_PROP_FLAG_UNSET))
flags &= ~SPA_POD_PROP_RANGE_MASK;
switch (flags) {
switch (flags & SPA_POD_PROP_RANGE_MASK) {
case SPA_POD_PROP_RANGE_NONE:
if (!(str = spa_type_map_get_type (type.map, id[0])))
return;
@ -654,7 +654,7 @@ handle_int_prop (SpaPODProp *prop, const char *key, GstCaps *res)
if (!(flags & SPA_POD_PROP_FLAG_UNSET))
flags &= ~SPA_POD_PROP_RANGE_MASK;
switch (flags) {
switch (flags & SPA_POD_PROP_RANGE_MASK) {
case SPA_POD_PROP_RANGE_NONE:
gst_caps_set_simple (res, key, G_TYPE_INT, val[0], NULL);
break;
@ -696,7 +696,7 @@ handle_rect_prop (SpaPODProp *prop, const char *width, const char *height, GstCa
if (!(flags & SPA_POD_PROP_FLAG_UNSET))
flags &= ~SPA_POD_PROP_RANGE_MASK;
switch (flags) {
switch (flags & SPA_POD_PROP_RANGE_MASK) {
case SPA_POD_PROP_RANGE_NONE:
gst_caps_set_simple (res, width, G_TYPE_INT, rect[0].width,
height, G_TYPE_INT, rect[0].height, NULL);
@ -747,7 +747,7 @@ handle_fraction_prop (SpaPODProp *prop, const char *key, GstCaps *res)
if (!(flags & SPA_POD_PROP_FLAG_UNSET))
flags &= ~SPA_POD_PROP_RANGE_MASK;
switch (flags) {
switch (flags & SPA_POD_PROP_RANGE_MASK) {
case SPA_POD_PROP_RANGE_NONE:
gst_caps_set_simple (res, key, GST_TYPE_FRACTION, fract[0].num, fract[0].denom, NULL);
break;

View file

@ -513,7 +513,7 @@ spa_v4l2_enum_format (SpaV4l2Source *this,
const FormatInfo *info;
SpaPODFrame f[2];
SpaPODProp *prop;
SpaPODBuilder b = { state->format_buffer, sizeof (state->format_buffer), };
SpaPODBuilder b = { NULL, };
uint32_t media_type, media_subtype, video_format;
if (spa_v4l2_open (this) < 0)
@ -663,6 +663,7 @@ have_size:
media_subtype = *SPA_MEMBER (&this->type, info->media_subtype_offset, uint32_t);
video_format = *SPA_MEMBER (&this->type, info->format_offset, uint32_t);
spa_pod_builder_init (&b, state->format_buffer, sizeof (state->format_buffer));
spa_pod_builder_push_format (&b, &f[0], this->type.format,
media_type,
media_subtype);