Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: how is <index> controlled? #62

Open
ReinhardKeil opened this issue Feb 26, 2025 · 2 comments
Open

Question: how is <index> controlled? #62

ReinhardKeil opened this issue Feb 26, 2025 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation sds-core Belongs to SDS-Framework/sds

Comments

@ReinhardKeil
Copy link
Contributor

ReinhardKeil commented Feb 26, 2025

The SDS data stream is recorded to files with the following naming convention:

<name>.<index>.sds

<name> is a parameter in sdsRecOpen or sdsPlayOpen.

But how is <index> controlled? Is each sdsRecClose or sdsPlayClose incrementing it?

See https://github.com/ARM-software/SDS-Framework/blob/main/documentation/utilities.md

@MiloradCvjetkovic MiloradCvjetkovic added documentation Improvements or additions to documentation sds-core Belongs to SDS-Framework/sds labels Mar 4, 2025
@MiloradCvjetkovic MiloradCvjetkovic moved this to Backlog in SDS Framework Mar 4, 2025
@DavidLesnjak
Copy link
Collaborator

DavidLesnjak commented Mar 4, 2025

For recording, the indexing mechanism works as follows:

  • sdsRecOpen internally calls sdsioOpen (for write) to handle file creation.
  • sdsioOpen creates a new file with the format: <name>.<index>.sds.
  • The name parameter is passed from sdsRecOpen to sdsioOpen.
  • The index starts at 0 and is automatically incremented for each new sdsioOpen call with the same name parameter.
  • Before creating a new file, sdsioOpen checks if a file with the requested <name>.<index>.sds already exists:
    -- If the file exists, the index is incremented
    -- This process continues until the first available (unused) index is found.

For playback:

  • sdsPlayOpen internally calls sdsioOpen (for read) to open sds file to be played.
  • sdsioOpen checks for a file <name>.index.txt, where <name> is parameter in sdsPlayOpen passed to sdsioOpen
  • if <name>.index.txt does not exist it creates one
  • <name>.index.txt holds the index of <name>.<index>.sds file to be opened for playback
  • if index in index file is missing or is invalid actual used index is 0
  • sdsioOpen checks if a file with the <name>.<index>.sds exists.
    -- If exists: file <name>.<index>.sds is opend for playback and index is incremented and stored to <name>.index.txt (index is prepared for next sdsio)
    -- If not: sds file is not opened for playback and index is set 0 and stored to <name>.index.txt

@ReinhardKeil
Copy link
Contributor Author

@ReinhardKeil ReinhardKeil moved this from Backlog to In review in SDS Framework Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation sds-core Belongs to SDS-Framework/sds
Projects
Status: In review
Development

No branches or pull requests

3 participants