TSDuck v3.46-4964
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::CRC32 Class Reference

#include <tsCRC32.h>

Public Types

enum  Validation {
  IGNORE = 0 ,
  CHECK = 1 ,
  COMPUTE = 2
}

Public Member Functions

 CRC32 ()
 CRC32 (const void *data, size_t size)
void add (const void *data, size_t size)
 operator uint32_t () const
void reset ()
uint32_t value () const

Detailed Description

Cyclic Redundancy Check as used in MPEG sections.

Member Enumeration Documentation

◆ Validation

What to do with a CRC32. Used when building MPEG sections.

Enumerator
IGNORE 

Ignore the section CRC32.

CHECK 

Check that the value of the CRC32 of the section is correct and fail if it isn't.

COMPUTE 

Recompute a fresh new CRC32 value based on the content of the section.

Constructor & Destructor Documentation

◆ CRC32() [1/2]

ts::CRC32::CRC32 ( )

Default constructor.

◆ CRC32() [2/2]

ts::CRC32::CRC32 ( const void * data,
size_t size )
inline

Constructor, compute the CRC32 of a data area.

Parameters
[in]dataAddress of area to analyze.
[in]sizeSize in bytes of area to analyze.

Member Function Documentation

◆ add()

void ts::CRC32::add ( const void * data,
size_t size )

Continue the computation of a data area, following a previous CRC32.

Parameters
[in]dataAddress of area to analyze.
[in]sizeSize in bytes of area to analyze.

◆ value()

uint32_t ts::CRC32::value ( ) const

Get the value of the CRC32 as computed so far.

Returns
The value of the CRC32 as computed so far.

◆ operator uint32_t()

ts::CRC32::operator uint32_t ( ) const
inline

Convert to a 32-bit integer. Same as value() method.

Returns
The value of the CRC32 as computed so far.

◆ reset()

void ts::CRC32::reset ( )
inline

Reset the CRC32 computation, restart a new computation.


The documentation for this class was generated from the following file: