-
Notifications
You must be signed in to change notification settings - Fork 194
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
Extract alternating words #1069
Comments
It strongly depends on the following things:
In the very simplest case you can currently just parse the 2 streams separately and then combine them manually, all in KS. Otherwise, I guess, currently an opaque type would be better. "chains" proposal #196 is highly relevant for your problem. |
Thanks for the quick reply:
I should have been more clear: the layout above is of a single stream. I.e., the words from the two sources are interleaved in one stream.
I think I see where you're going and indeed the two sources, while having the same format as each other, will in some files have a certain format and a different one in other files.
Any chance you can share some (pseudo-)code so that I can try it out?
I think I see how it would help. Is it correct that |
Now I understand better, so you don't need to combine them as I presumed, instead you need to split them. I guess it is some multimedia file format.
I understood your requirements wrong. I feel like an opaque type accepting an I guess something like the following (but it is uncertain, you would have to do some experiments, I don't remember if seq:
...
- id: your_interleaved_blob
type: your_opaque_type(count_of_streams) #accepts _io implicitly
instances:
audio:
pos: 0
type: your_audio_codec_structure
io: your_interleaved_blob.as<a_type_mocking_your_opaque_type>.audio_io_proxy._io # the custom code in your_opaque_type should create an audio_io_proxy field, which type is placeholder
#io: your_interleaved_blob.as<a_type_mocking_your_opaque_type>.audio_io # if you bypass the proxy types
-affected-by: 500 # this way we document issues in the issue tracker that block optimal specification, see https://github.com/kaitai-io/kaitai_struct_doc/pull/47 for more info
types:
placeholder: {}
a_type_mocking_your_opaque_type:
-affected-by: 500
#params:
# - id: audio_io
# type: io
seq:
- id: audio_io_proxy
type: placeholder
- id: video_io_proxy
type: placeholder #500 should be relevant too |
I call #500 "interfaces proposal" |
Before heading out and writing an opaque type plugin I was wondering if someone knows a direct kaitai way to decode a data structure that looks like:
The goal is to have the date from Sources 1 and 2 available for further decoding. I know$N$ .
I'm not fluent in kaitai and could not think of ways to use
repeat
andinstances
(with some_index
arithmetic) to achieve this.Any help would be appreciated!
The text was updated successfully, but these errors were encountered: