Commit 3f70a629 authored by Sebastian Ramacher's avatar Sebastian Ramacher

New upstream version 1.5

parent 1cc19d76
......@@ -4,7 +4,7 @@ LIBDIR = $(PREFIX)/lib
DATADIR = $(PREFIX)/share
INCLUDE = $(DESTDIR)$(INCLUDEDIR)/bitstream
PKGCONFIG = $(DESTDIR)$(DATADIR)/pkgconfig
VERSION = 1.4
VERSION = 1.5
all:
ln -nsf .. examples/bitstream
......
1.4 (not released yet)
1.5 (6 November 2018)
=================
- Add SDES
- Fix hvcc header size
- Add more ATSC A/52 support
- Misc descriptors fixes
1.4 (1 July 2018)
=================
- Add RTCP helpers
- Add support for SMPTE 352
- Misc descriptors fixes
1.3 (29 Jan 2018)
=================
......
/*****************************************************************************
* a52.h: ATSC A/52:2012 Digital Audio Compression Standard
*****************************************************************************
* Copyright (C) 2013-2014 VideoLAN
* Copyright (C) 2013-2018 VideoLAN
*
* Authors: Benjamin Cohen <bencoh@notk.org>
*
......@@ -302,6 +302,28 @@ static inline void a52e_set_fscod2(uint8_t *p_a52, uint8_t i_fscod)
p_a52[4] |= (i_fscod & 0x3) << 4;
}
static inline uint8_t a52e_get_acmod(const uint8_t *p_a52)
{
return (p_a52[4] & 0xe) >> 1;
}
static inline void a52e_set_acmod(uint8_t *p_a52, uint8_t i_acmod)
{
p_a52[4] &= ~0xe;
p_a52[4] |= (i_acmod & 0x7) << 1;
}
static inline uint8_t a52e_get_lfeon(const uint8_t *p_a52)
{
return p_a52[4] & 0x1;
}
static inline void a52e_set_lfeon(uint8_t *p_a52, uint8_t i_lfeon)
{
p_a52[4] &= ~0x1;
p_a52[4] |= i_lfeon & 0x1;
}
static inline bool a52e_sync_compare_formats(const uint8_t *p_a521, const uint8_t *p_a522)
{
return !memcmp(p_a521, p_a522, A52_SYNCINFO_SIZE);
......
......@@ -70,6 +70,7 @@ static inline const char *desc65_get_scrambling_mode_txt(uint8_t i_mode)
i_mode == 0x03 ? "DVB-CSA3 in standart mode" :
i_mode == 0x04 ? "DVB-CSA3 in minimally enhanced mode" :
i_mode == 0x05 ? "DVB-CSA3 in fully enhanced mode" :
i_mode == 0x10 ? "DVB-CISSA version 1" :
i_mode >= 0x06 && i_mode <= 0x6f ? "Reserved" :
i_mode >= 0x70 && i_mode <= 0x7f ? "ATIS defined" :
i_mode >= 0x80 && i_mode <= 0xfe ? "User defined" : "Reserved";
......
......@@ -30,6 +30,19 @@ static inline void rtcp_fb_set_ssrc_pkt_sender(uint8_t *p_rtcp_fb,
p_rtcp_fb[7] = pi_ssrc[3];
}
static inline void rtcp_fb_set_int_ssrc_pkt_sender(uint8_t *p_rtcp_fb, uint32_t i_ssrc)
{
p_rtcp_fb[4] = (i_ssrc >> 24) & 0xff;
p_rtcp_fb[5] = (i_ssrc >> 16) & 0xff;
p_rtcp_fb[6] = (i_ssrc >> 8) & 0xff;
p_rtcp_fb[7] = i_ssrc & 0xff;
}
static inline uint32_t rtcp_fb_get_int_ssrc_pkt_sender(const uint8_t *p_rtcp_fb)
{
return (p_rtcp_fb[4] << 24) | (p_rtcp_fb[5] << 16) | (p_rtcp_fb[6] << 8) | p_rtcp_fb[7];
}
static inline void rtcp_fb_set_ssrc_media_src(uint8_t *p_rtcp_fb,
const uint8_t pi_ssrc[4])
{
......
#ifndef __BITSTREAM_IETF_RTCP_SDES_H__
# define __BITSTREAM_IETF_RTCP_SDES_H__
# include <inttypes.h>
# include <bitstream/ietf/rtcp.h>
# define RTCP_SDES_SIZE 10
# define RTCP_PT_SDES 202
static inline void rtcp_sdes_set_pt(uint8_t *p_rtcp_rr)
{
rtcp_set_pt(p_rtcp_rr, RTCP_PT_SDES);
}
static inline uint8_t rtcp_sdes_get_cname(const uint8_t *p_rtcp_sdes)
{
return p_rtcp_sdes[8];
}
static inline void rtcp_sdes_set_cname(uint8_t *p_rtcp_sdes, uint8_t cname)
{
p_rtcp_sdes[8] = cname;
}
static inline int8_t rtcp_sdes_get_name_length(const uint8_t *p_rtcp_sdes)
{
return p_rtcp_sdes[9];
}
static inline void rtcp_sdes_set_name_length(uint8_t *p_rtcp_sdes,
int8_t name_length)
{
p_rtcp_sdes[9] = name_length;
}
#endif /* !__BITSTREAM_IETF_RTCP_SDES_H__ */
......@@ -168,6 +168,19 @@ static inline void rtp_get_ssrc(const uint8_t *p_rtp, uint8_t pi_ssrc[4])
pi_ssrc[3] = p_rtp[11];
}
static inline void rtp_set_int_ssrc(uint8_t *p_rtp, uint32_t i_ssrc)
{
p_rtp[8] = (i_ssrc >> 24) & 0xff;
p_rtp[9] = (i_ssrc >> 16) & 0xff;
p_rtp[10] = (i_ssrc >> 8) & 0xff;
p_rtp[11] = i_ssrc & 0xff;
}
static inline uint32_t rtp_get_int_ssrc(const uint8_t *p_rtp)
{
return (p_rtp[8] << 24) | (p_rtp[9] << 16) | (p_rtp[10] << 8) | p_rtp[11];
}
static inline uint8_t *rtp_extension(uint8_t *p_rtp)
{
return p_rtp + RTP_HEADER_SIZE + 4 * rtp_get_cc(p_rtp);
......
......@@ -336,7 +336,7 @@ static inline void h265eob_init(uint8_t *p_h265eob)
/*****************************************************************************
* H265 hvcC structure
*****************************************************************************/
#define H265HVCC_HEADER 22
#define H265HVCC_HEADER 23
#define H265HVCC_ARRAY_HEADER 3
#define H265HVCC_NALU_HEADER 2
......
......@@ -228,6 +228,23 @@ static inline bool mpga_sync_compare_formats(const uint8_t *p_mpga1, const uint8
return i_mode1 == i_mode2;
}
/* same but without comparing bitrate (free bitrate) */
static inline bool mpga_sync_compare_formats_free(const uint8_t *p_mpga1, const uint8_t *p_mpga2)
{
if (!(p_mpga1[0] == p_mpga2[0] &&
(p_mpga1[1] & 0xfe) == (p_mpga2[1] & 0xfe) &&
(p_mpga1[2] & 0xc) == (p_mpga2[2] & 0xc)))
return false;
/* consider stereo and joint stereo the same - because encoders can
* switch on the fly */
uint8_t i_mode1 = mpga_get_mode(p_mpga1);
uint8_t i_mode2 = mpga_get_mode(p_mpga2);
if (i_mode1 == MPGA_MODE_JOINT) i_mode1 = MPGA_MODE_STEREO;
if (i_mode2 == MPGA_MODE_JOINT) i_mode2 = MPGA_MODE_STEREO;
return i_mode1 == i_mode2;
}
#ifdef __cplusplus
}
#endif
......
......@@ -670,7 +670,8 @@ static inline bool scte35_private_validate(const uint8_t *p_scte35)
static inline bool scte35_validate(const uint8_t *p_scte35)
{
if (psi_get_syntax(p_scte35) ||
psi_get_tableid(p_scte35) != SCTE35_TABLE_ID)
psi_get_tableid(p_scte35) != SCTE35_TABLE_ID ||
psi_get_length(p_scte35) < SCTE35_HEADER2_SIZE + PSI_CRC_SIZE)
return false;
if (!psi_check_crc(p_scte35))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment