Improve negotiation

Try to link ports based on compatible formats
Add methods to filter formats.
This commit is contained in:
Wim Taymans 2017-02-10 10:17:07 +01:00
parent 1370fafd5b
commit df86fcec10
12 changed files with 229 additions and 95 deletions

View file

@ -305,3 +305,19 @@ fallback:
return res;
}
SpaResult
spa_format_audio_filter (SpaFormatAudio *format,
const SpaFormat *filter)
{
SpaFormatAudio af;
SpaResult res;
if (filter == NULL)
return SPA_RESULT_OK;
if ((res = spa_format_audio_parse (filter, &af)) != SPA_RESULT_OK)
return res;
return SPA_RESULT_NOT_IMPLEMENTED;
}

View file

@ -637,3 +637,19 @@ fallback:
return res;
}
SpaResult
spa_format_video_filter (SpaFormatVideo *format,
const SpaFormat *filter)
{
SpaFormatVideo vf;
SpaResult res;
if (filter == NULL)
return SPA_RESULT_OK;
if ((res = spa_format_video_parse (filter, &vf)) != SPA_RESULT_OK)
return res;
return SPA_RESULT_NOT_IMPLEMENTED;
}