- case SRD_OUTPUT_ANNOTATION:
- if (convert_pyobj(di, data, &annotation_format, &annotation) != SRD_OK)
- return NULL;
-
- /* TODO: SRD_OUTPUT_ANNOTATION should go back up to the caller */
- ann_info = g_slist_nth_data(pdo->decoder->annotation, annotation_format);
- printf("annotation format %d (%s): ", annotation_format, ann_info[0]);
- for (i = 0; annotation[i]; i++)
- printf("\"%s\" ", annotation[i]);
- printf("\n");
+ case SRD_OUTPUT_ANN:
+ /* Annotations are only fed to callbacks. */
+ if ((cb = srd_find_callback(pdo->output_type))) {
+ /* Annotations need converting from PyObject. */
+ if (convert_pyobj(di, data, &pdata->ann_format,
+ (char ***)&pdata->data) != SRD_OK) {
+ /* An error was already logged. */
+ break;
+ }
+ cb(pdata);
+ }