- The
pes::StreamType
andStreamId
types changed from enums to structs. These changes reduce the risk of silent breakage in future releases of this crate, if support for additionalStreamType
orStreamId
values are added. descriptor::iso_639_language::Code::code()
no longer takes any arguments, and now returnsCow<'_, str>
rather thanResult<String, ..>
(due to the switch from theencoding
crate to theencoding_rs
crate).
- Removed the dependency on the unmaintained
encoding
create and switched toencoding_rs
. See RUSTSEC-2021-0153.
- Updated to Rust 2021 edition
packet::TransportScramblingControl
changed from an enum to a struct. Newis_scrambled()
andscheme()
methods onTransportScramblingControl
replace the functionality of the old enum variants. The changed type layout slightly improves performance.packet::AdaptationControl
changed from an enum to a struct. Itshas_payload()
method now takesself
by reference, and a newhas_adaptation_field()
method has been added. The changed type layout slightly improves performance.
FormatIdentifier
is now re-exported from the smptera-format-identifiers-rust crate so that calling code can more easily use the same version of it as thempeg2ts-reader
crate.
Iso639LanguageDescriptor::languages()
now producesResult<Language>
rather than justLanguage
- Since we don't support decryption, scrambled TS packets (packets with values of
transport_scrambling_control
other than0
) are now dropped, to prevent the application being passed bogus data AdaptationFieldExtension::new()
changed to returnResult
- Fixed a panic when parsing truncated PMT data
- Fixed a panic when parsing a truncated descriptor value
- Fixed a panic when parsing a truncated language code in
iso_639_language_descriptor
- Fixed a panic when reported PES header length does not fit within available space
- Fixed a panic due to a bug parsing PES header
ESCR_base
field - Fixes a panic when
PES_header_data_length
is not long enough to accommodate all the headers actually present - Fixed so we accept very short but still syntactically valid PSI sections previously rejected in some cases
- Fixed a panic on TS packet with
adaptation_field_extension_flag
set, butadaptation_field_extension_length
is0
- The
pes::ElementaryStreamConsumer
type and its methods are now parameterised to gain access to the context object you provided to the demultiplexer. Thanks @fkaa. RegistrationDescriptor::format_identifier()
return type changed from u32 to a value of theFormatIdentifier
enum from the smptera-format-identifiers-rust crate. AlsoRegistrationDescriptor
fields are no longer public.Pid::new()
is now aconst
function. Other crates can now definePid
constants.- Definitions of constants for 'PAT' and 'stuffing' PIDs have been relocated, now that don't have to be in the same
module as the
Pid
type.
- Implementation of
TryFrom<u16>
forPid
- The
descriptor_enum!{}
macro no longer provides a default case (which used to produceError
), so callers which don't define mappings for all possible descriptor tag values (0
-255
) will now get a compiler error.
- Fixed incorrect value of
Timestamp::MAX
.
- Added
Timestamp::TIMEBASE
constant.
AVC_video_descriptor()
parsing.maximum_bitrate_descriptor()
parsing.Timestamp::likely_wrapped_since()
utility for detecting wraparound, and supportingTimestamp::MAX
constant.
- Made
mpegts_crc::sum_32()
public. - Added types to
psi
module for handling 'compact syntax' sections (mirroring existing types for handling 'section syntax' sections).
StreamType::is_pes()
util function to identify those StreamType values that the spec expects to carry PES content.
- Made the methods of
descriptor::iso_639_language::Language
public (they were private by mistake) - Drop TS packets that have
transport_error_indicator
flag set, rather than passing known-bad data to the application.
- Some more descriptor-tag values in
CoreDescriptors
(but not the descriptor definitions themselves yet).
- Removed the
StreamConstructor
trait, and merged its previous responsibilities intoDemuxContext
. This makes it much simpler for client code to gain access to any relevantDemuxContext
state when the demuxer requests a handler for a newly discovered stream within the TS. - Added a
StreamId
enum to replace theu8
previously used as the return value forPesHeader::stream_id()
- Removed single usage of
hex-slice
crate; resulting Debug impl is not quite so nice, but now there's one less dependency. - Avoid calling
start_stream()
onElementaryStreamConsumer
after parsing errors. It was only intended to be called when the substream was first encountered in the multiplex.
- Avoid panics due to 0-length
adaptation_field
, larger-than-expectedprogram_info_length
and too smallsection_length
. All found through fuzz testing.
- All public API members now have at least minimal documentation
- Removed the
demultiplex::UnhandledPid
type to try and simplify the API slightly. - Removed
PesPacketConsumer
. The typesPesPacketFilter
andPesPacketConsumer
seem in hindsight to be redundant (the first just being a thin wrapper for the second).PesPacketFilter
now implements the complete functionality. - Removed
PmtSection::program_info_length()
andStreamInfo::es_info_length()
from public API. - Changed
PmtSection::pcr_pid()
to return aPid
(got missed when others changed fromu16
toPid
) in version 0.7.0.
- Removed some unused dependencies
- Changed the representation of PID values in the API from plain
u16
to a newPid
wrapper, so that the API can't represent invalid PID values. FilterRequest::ByStream
changes from tuple to struct variant, and gainsprogram_id
of the program to which the stream belongs.- All uses of
println!()
have been replaced with use ofwarn!()
from thelog
crate.
- PES data is no longer truncated at the end of the TS packet with
payload_unit_start_indicator
- Many methods previously taking a
Packet
by value now instead take it by reference. This breaks with the old API, but may deliver a small performance improvement for some workloads. - Many objects that previously offered a no-args
new()
method have had this replaced with adefault()
impl. - The
PCR
type has been renamedClockRef
, since it's used to represent the values of both Prograem Clock Reference and Elementry Stream Clock Reference fields. descriptor::RegistrationDescriptor
becamedescriptor::registration::RegistrationDescriptor
. New descriptor implementations will be added each in their own source file.- Moved PAT/PMT types from
demultiplex
module intopsi::pat
andpsi::pmt
modules. - Refactored some methods returning custom
Iterator
types to instead returnimpl Iterator
, so that the actual iterator types can be hidden from the public API pes_packet_length
is now represented asenum PesLength
, rather than directly as au16
, so that the special status of the length-value 0 can be made explicit (it's now mapped toPesLength::Unbounded
)
- Added
iso_639_language_descriptor
support