TSDuck v3.40-4120
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::Zlib Class Reference

Implementation of RFC 1951 data compression, a.k.a. More...

#include <tsZlib.h>

Static Public Member Functions

static bool Compress (ByteBlock &out, const ByteBlock &in, int level, Report &report=(ts::NullReport::Instance()))
 Compress data according to the DEFLATE algorithm.
 
static bool Compress (ByteBlock &out, const void *in, size_t in_size, int level, Report &report=(ts::NullReport::Instance()))
 Compress data according to the DEFLATE algorithm.
 
static bool Decompress (ByteBlock &out, const ByteBlock &in, Report &report=(ts::NullReport::Instance()))
 Decompress data according to the DEFLATE algorithm.
 
static bool Decompress (ByteBlock &out, const void *in, size_t in_size, Report &report=(ts::NullReport::Instance()))
 Decompress data according to the DEFLATE algorithm.
 
static UString GetLibraryVersion ()
 Get the Zlib library version.
 

Detailed Description

Implementation of RFC 1951 data compression, a.k.a.

zlib format, a.k.a. DEFLATE.

This interface is a proxy to the zlib library on UNIX systems (Linux, macOS, BSD). On Windows systems, the source code of TSDuck embeds the header-only implementation called "Small Deflate" or "sdefl". The sdefl implementation is also used when the macro TS_NO_ZLIB is defined on any system.

See also
RFC 1950 ZLIB Compressed Data Format Specification version 3.3
RFC 1951 DEFLATE Compressed Data Format Specification version 1.3
https://www.zlib.net
https://github.com/vurtun/lib

Member Function Documentation

◆ GetLibraryVersion()

static UString ts::Zlib::GetLibraryVersion ( )
static

Get the Zlib library version.

Returns
The Zlib library version.

◆ Compress() [1/2]

static bool ts::Zlib::Compress ( ByteBlock out,
const void *  in,
size_t  in_size,
int  level,
Report report = (ts::NullReport::Instance()) 
)
static

Compress data according to the DEFLATE algorithm.

Parameters
[out]outOutput compressed data.
[in]inAddress of input data.
[in]in_sizeSize in bytes of input data.
[in]levelRequested compression level, from 0 to 9.
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

◆ Compress() [2/2]

static bool ts::Zlib::Compress ( ByteBlock out,
const ByteBlock in,
int  level,
Report report = (ts::NullReport::Instance()) 
)
inlinestatic

Compress data according to the DEFLATE algorithm.

Parameters
[out]outOutput compressed data.
[in]inInput data.
[in]levelRequested compression level, from 0 to 9.
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

◆ Decompress() [1/2]

static bool ts::Zlib::Decompress ( ByteBlock out,
const void *  in,
size_t  in_size,
Report report = (ts::NullReport::Instance()) 
)
static

Decompress data according to the DEFLATE algorithm.

Parameters
[out]outOutput decompressed data.
[in]inAddress of input data.
[in]in_sizeSize in bytes of input data.
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

◆ Decompress() [2/2]

static bool ts::Zlib::Decompress ( ByteBlock out,
const ByteBlock in,
Report report = (ts::NullReport::Instance()) 
)
inlinestatic

Decompress data according to the DEFLATE algorithm.

Parameters
[out]outOutput decompressed data.
[in]inInput data.
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

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