From ed41649709abc02362df526cbd725775000e8199 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Wed, 30 Oct 2013 16:30:05 +0100 Subject: Pass metadata to PDs only at runtime, not at decoder start The SRD_CONF_NUM_PROBES metadata key was removed. It wasn't actually used for anything, since this is trivially available via the configured (or default) probe list. The SRD_CONF_UNITSIZE key was removed. The unit size is instead derived from the probe list: the number of probes packed into the least amount of space possible defines the unit size. PD changes: * The start() method no longer takes a 'metadata' parameter. * Metadata now comes in only via the metadata() method, which takes a key and value. The only key defined so far is SRD_CONF_SAMPLERATE, which is exported into the module namespace. API changes: * srd_session_send() now takes an end_samplenum parameter, and had its options rearranged. * srd_session_config_set() is now srd_session_metadata_set(). This keeps "config" options for a future feature to allow PDs or frontends to configure each other's options on the fly, up and down the stack. --- libsigrokdecode.h.in | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'libsigrokdecode.h.in') diff --git a/libsigrokdecode.h.in b/libsigrokdecode.h.in index c61a0e4..3eaace6 100644 --- a/libsigrokdecode.h.in +++ b/libsigrokdecode.h.in @@ -167,9 +167,7 @@ enum { #define SRD_MAX_NUM_PROBES 64 enum { - SRD_CONF_NUM_PROBES = 10000, - SRD_CONF_UNITSIZE, - SRD_CONF_SAMPLERATE, + SRD_CONF_SAMPLERATE = 10000, }; struct srd_decoder { @@ -242,9 +240,7 @@ struct srd_decoder_inst { GSList *pd_output; int dec_num_probes; int *dec_probemap; - int data_num_probes; int data_unitsize; - uint64_t data_samplerate; GSList *next_di; }; @@ -304,10 +300,11 @@ SRD_API struct srd_decoder_inst *srd_inst_find_by_id(struct srd_session *sess, const char *inst_id); SRD_API int srd_session_new(struct srd_session **sess); SRD_API int srd_session_start(struct srd_session *sess); -SRD_API int srd_session_config_set(struct srd_session *sess, int key, +SRD_API int srd_session_metadata_set(struct srd_session *sess, int key, GVariant *data); SRD_API int srd_session_send(struct srd_session *sess, - uint64_t start_samplenum, const uint8_t *inbuf, uint64_t inbuflen); + uint64_t start_samplenum, uint64_t end_samplenum, + const uint8_t *inbuf, uint64_t inbuflen); SRD_API int srd_session_destroy(struct srd_session *sess); SRD_API int srd_pd_output_callback_add(struct srd_session *sess, int output_type, srd_pd_output_callback_t cb, void *cb_data); -- cgit v1.2.3-70-g09d2