diff options
author | Bert Vermeulen <bert@biot.com> | 2013-10-30 16:30:05 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2013-10-30 22:41:22 +0100 |
commit | ed41649709abc02362df526cbd725775000e8199 (patch) | |
tree | 1b84a158d78f272153aac98f87a83914e9d390bb /libsigrokdecode.h.in | |
parent | 69075817a626982179e5739bf0eee5e47b8a5f9e (diff) | |
download | libsigrokdecode-ed41649709abc02362df526cbd725775000e8199.tar.gz libsigrokdecode-ed41649709abc02362df526cbd725775000e8199.zip |
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.
Diffstat (limited to 'libsigrokdecode.h.in')
-rw-r--r-- | libsigrokdecode.h.in | 11 |
1 files changed, 4 insertions, 7 deletions
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); |