pod: use {} as object delimited, like json

Use <> for sequence
This commit is contained in:
Wim Taymans 2018-08-30 09:53:29 +02:00
parent ff6a244d8f
commit 2631db14a8
7 changed files with 24 additions and 24 deletions

View file

@ -328,7 +328,7 @@ int main(int argc, char *argv[])
* )
*/
fmt = spa_pod_builder_add(&b,
"<", SPA_TYPE_OBJECT_Format, 0,
"{", SPA_TYPE_OBJECT_Format, 0,
":", SPA_FORMAT_mediaType, "I", SPA_MEDIA_TYPE_video,
":", SPA_FORMAT_mediaSubtype, "I", SPA_MEDIA_SUBTYPE_raw,
":", SPA_FORMAT_VIDEO_format, "Ieu", SPA_VIDEO_FORMAT_I420,
@ -340,7 +340,7 @@ int main(int argc, char *argv[])
":", SPA_FORMAT_VIDEO_framerate, "Fru", &SPA_FRACTION(25,1),
2, &SPA_FRACTION(0,1),
&SPA_FRACTION(INT32_MAX,1),
">", NULL);
"}", NULL);
spa_debug_pod(0, spa_debug_types, &fmt->pod);
spa_debug_format(0, NULL, &fmt->pod);

View file

@ -42,7 +42,7 @@ int main(int argc, char *argv[])
spa_pod_builder_init(&b, buffer, sizeof(buffer));
fmt = spa_pod_builder_add(&b,
"<",0,format,
"{",0,format,
" [ i", video, "i",raw,"]"
" :", format, "ieu", I420,
2, I420, YUY2,
@ -52,17 +52,17 @@ int main(int argc, char *argv[])
" :", framerate, "Fru", &SPA_FRACTION(25,1),
2, &SPA_FRACTION(0,1),
&SPA_FRACTION(INT32_MAX, 1),
">", NULL);
"}", NULL);
spa_debug_pod(0, NULL, fmt);
spa_pod_parser_pod(&prs, fmt);
res = spa_pod_parser_get(&prs,
"<"
"{"
" [ i",&media_type,"*i"/*,&media_subtype,*/" ]"
" :", framerate, "V", &pod,
" :", 10, "?V", &pod2,
" :", format, "?i", &fmt_value,
">", NULL);
"}", NULL);
printf("res :%d\n", res);
printf("media-type:%d media-subtype:%d\n", media_type, media_subtype);
@ -73,18 +73,18 @@ int main(int argc, char *argv[])
spa_pod_builder_init(&b, buffer, sizeof(buffer));
pod = spa_pod_builder_add(&b,
"<",0,format,
"{",0,format,
" P", NULL,
" [ i", 44, "i",45,"]"
">", NULL);
"}", NULL);
spa_debug_pod(0, NULL, pod);
spa_pod_parser_pod(&prs, pod);
res = spa_pod_parser_get(&prs,
"<"
"{"
" ?[ i",&media_type,"i",&media_subtype," ]"
" [ i", &video, "i",&raw,"]"
">", NULL);
"}", NULL);
printf("res :%d\n", res);
printf("video:%d raw:%d\n", video, raw);