Here we hit a road block on using Deku for the SCTE35 spec. The Upid
type is more complex in terms of serialization which makes it very
complicated to use Deku.
Besides the problem above. It seems like using Deku will make
maintainance more complicated due to the externsive use of magic macros.
Which also does impact development. I still believe Deku is a great
project to be used in more straight forward binary formats.
Implements the generic Splice Descriptor definition using the Deku
declarative library macros.
I've implemented only the generic variant of the Splice Descriptors to
check how it would look like using Deku.
Using the Deku library we can implement a `no_std` compatible read and
write structs/enums. We don't need to write manually encoding code and
rely completely on the Deku derive macros to do the right job.
I've implemented the SpliceTime part of the spec as a proof of concept
of the use of Deku. It worked great for this small structure.
Move all code related to the "serde" feature to a separated module. Add
missing getter methods to some structs. Add missing derive to public
structs. Makes all tests pass.
Signed-off-by: Rafael Caricio <rafael@caricio.com>
Add support for creating `SpliceTime` instances from anything that
implements the trait `ClockTimeExt`. This makes redundant to implement
the `From` trait for the `std::time::Duration` struct, since it
implements the `ClockTimeExt` trait.
Signed-off-by: Rafael Caricio <rafael@caricio.com>
Adds a new field to the serde struct that represents a human readable
duration of time. This makes easier to debug the SCTE markers.
This commit also simplifies a bit the code using Default trait and other
simplifications.
Fixed the calculation of the sizes of sections in the final SCTE struct.
We were not calculating correctly the amount of bytes of the sections.
Now we use the Recorder pattern which returns the exact amount of bytes
written.