-SRD_API int srd_session_start(int num_probes, int unitsize, uint64_t samplerate)
-{
- PyObject *args;
- GSList *d;
- struct srd_decoder_instance *di;
- int ret;
-
- srd_dbg("Calling start() on all instances with %d probes, "
- "unitsize %d samplerate %d.", num_probes, unitsize, samplerate);
-
- /* Currently only one item of metadata is passed along to decoders,
- * samplerate. This can be extended as needed.
- */
- if (!(args = Py_BuildValue("{s:l}", "samplerate", (long)samplerate))) {
- srd_err("Unable to build python object for metadata.");
- return SRD_ERR_PYTHON;
- }
-
- /* Run the start() method on all decoders receiving frontend data. */
- for (d = di_list; d; d = d->next) {
- di = d->data;
- di->data_num_probes = num_probes;
- di->data_unitsize = unitsize;
- di->data_samplerate = samplerate;
- if ((ret = srd_instance_start(di, args) != SRD_OK))
- break;
- }
-
- Py_DecRef(args);
-
- return ret;
-}
-
-/* Feed logic samples to decoder session. */
-SRD_API int srd_session_feed(uint64_t start_samplenum, uint8_t * inbuf,
- uint64_t inbuflen)
-{
- GSList *d;
- int ret;
-
- srd_dbg("Calling decode() on all instances with starting sample "
- "number %" PRIu64 ", %" PRIu64 " bytes at 0x%p",
- start_samplenum, inbuflen, inbuf);
-
- for (d = di_list; d; d = d->next) {
- if ((ret = srd_instance_decode(start_samplenum, d->data, inbuf,
- inbuflen)) != SRD_OK)
- return ret;
- }
-
- return SRD_OK;
-}
-
-SRD_API int srd_register_callback(int output_type, srd_pd_output_callback_t cb)
-{
- struct srd_pd_callback *pd_cb;
-
- srd_dbg("Registering new callback for output type %d.", output_type);