Skip to content

Conversation

cboulay
Copy link
Collaborator

@cboulay cboulay commented Sep 29, 2021

This adds new methods to the C API and an overloaded method to the C++ API to allow the user to set the buffer length with a double instead of an integer. This is necessary in very-high channel count and samplerate situations where even 1-second is too much. Obviously a sub-1-second buffer means that the system won't be able to recover from a disconnect without data loss but at these data rates that isn't really possible anyway (unless we want to start buffering to disk).

@cboulay
Copy link
Collaborator Author

cboulay commented Oct 6, 2021

@tstenner had a good idea to make this lsl_create_outlet_ex and lsl_create_inlet_ex, where the new additional argument can receive bitwise-OR'd flags. So in common.h, we'd have

typedef enum {
    transp_default = 0,                        // keep legacy behavior
    transp_buffsize_samples = 1,       // the supplied int is in samples
    transp_buffsize_thousandths = 2, // Indicates whether the supplied int should be (double)/1000
    transp_synch = 4,                          // the outlet will use synchronous (blocking) zero-copy pushes
    transp_disable_endianness = 8,   // disable endianness conversions
} lsl_transport_options_t;

@cboulay
Copy link
Collaborator Author

cboulay commented Oct 6, 2021

This is such a trivial detail, but do we have any consistency as to whether the common short-form for 'buffer' should be buf or buff?

@cboulay cboulay force-pushed the cboulay/double_buflen branch from bad96d6 to 08024cc Compare October 8, 2021 14:53
@cboulay
Copy link
Collaborator Author

cboulay commented Oct 8, 2021

Rebased on #155. Let's wait on that one to be merged so we can easily see the (comparatively very small) changes.

Copy link
Collaborator

@tstenner tstenner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor things, but other than that an excellent addition

@tstenner
Copy link
Collaborator

Rebased and merged in 0b35dba

@tstenner tstenner closed this Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants