Commit 755d4117 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Updated version 1.2 from 'upstream/1.2'

with Debian dir ab235993d18538eda0a12f6e6f6c9aec945ac840
parents ec9355e3 8d8f7dcc
PREFIX ?= /usr/local
INCLUDE = $(subst //,/,$(DESTDIR)/$(PREFIX)/include/bitstream)
VERSION = 1.1
VERSION = 1.2
all:
@echo "Run \"make install\" to install biTStream into $(INCLUDE)"
......@@ -19,12 +19,16 @@ install:
@install -m 644 ietf/* $(INCLUDE)/ietf
@install -d $(INCLUDE)/ieee
@install -m 644 ieee/* $(INCLUDE)/ieee
@install -d $(INCLUDE)/itu
@install -m 644 itu/* $(INCLUDE)/itu
@install -d $(INCLUDE)/mpeg
@install -m 644 mpeg/*.h $(INCLUDE)/mpeg
@install -d $(INCLUDE)/mpeg/psi
@install -m 644 mpeg/psi/*.h $(INCLUDE)/mpeg/psi
@install -d $(INCLUDE)/scte
@install -m 644 scte/*.h $(INCLUDE)/scte
@install -d $(INCLUDE)/smpte
@install -m 644 smpte/*.h $(INCLUDE)/smpte
uninstall:
@echo "REMOVE $(INCLUDE)"
......
1.2 (31 Jan 2017)
=================
- Add partial support for ITU-T H.265
- Add support for DVB-VBI
- Add support for SCTE 104
- Add support for SMPTE 2010
- Add support for SMPTE RDD 08 (OP-47 subtitles)
- Add support for SMPTE 291
- Add support for SMPTE 337
- Add support for RFC 4175 video
- Add support for hbrmt 2022-6
- Add support for RTP RFC 2250
- Improve support of RTCP
- Fix character set for Chinese DVB strings
- Fix A/52 bitrate table
1.1 (5 Oct 2015)
================
- Rename fields in BAT, RST and SIT to match those of SDT
......
......@@ -105,6 +105,10 @@ static const uint16_t a52_frame_size_code_tab[38][3] = {
/* A/52 Bitrate Table (A/52:2012 Table 5.18) */
static const uint16_t a52_bitrate_tab[38] = {
32, 32,
40, 40,
48, 48,
56, 56,
64, 64,
80, 80,
96, 96,
......@@ -118,12 +122,8 @@ static const uint16_t a52_bitrate_tab[38] = {
384, 384,
448, 448,
512, 512,
640, 640,
768, 768,
896, 896,
1024, 1024,
1152, 1152,
1280, 1280
576, 576,
640, 640
};
static inline uint16_t a52_get_sync(const uint8_t *p_a52)
......
......@@ -90,7 +90,7 @@ static inline const char *desc46_get_teletexttype_txt(uint8_t i_type)
i_type == 0x02 ? "Teletext subtitle page" :
i_type == 0x03 ? "Additional information page" :
i_type == 0x04 ? "Programme schedule page" :
i_type == 0x05 ? "Teletext subtitle page for hearing impaired people schedule page" : "Reserved";
i_type == 0x05 ? "Teletext subtitle page for hearing impaired people" : "Reserved";
}
static inline void desc46n_set_teletextmagazine(uint8_t *p_desc_n,
......@@ -131,7 +131,7 @@ static inline void desc46_print(uint8_t *p_desc, f_print pf_print,
switch (i_print_type) {
case PRINT_XML:
pf_print(opaque,
"<%s language=\"%3.3s\" type=\"0x%hhx\" type_txt=\"%s\" mag=\"%hhu\" page=\"0x%hhux\"/>",
"<%s language=\"%3.3s\" type=\"0x%hhx\" type_txt=\"%s\" mag=\"%hhu\" page=\"0x%hhx\"/>",
desc_get_tag(p_desc) == 0x46 ? "VBI_TELX_DESC" : "TELX_DESC",
(const char *)desc46n_get_code(p_desc_n),
desc46n_get_teletexttype(p_desc_n),
......@@ -141,7 +141,7 @@ static inline void desc46_print(uint8_t *p_desc, f_print pf_print,
break;
default:
pf_print(opaque,
" - desc %x %s language=%3.3s type=0x%hhx type_txt=\"%s\" mag=%hhu page=0x%hhux",
" - desc %x %s language=%3.3s type=0x%hhx type_txt=\"%s\" mag=%hhu page=0x%hhx",
desc_get_tag(p_desc),
desc_get_tag(p_desc) == 0x46 ? "vbi_telx" : "telx",
(const char *)desc46n_get_code(p_desc_n),
......
......@@ -166,12 +166,11 @@ static inline void desc64_print(const uint8_t *p_desc,
psz_text = dvb_string_xml_escape(psz_text);
pf_print(print_opaque,
"<DATA_BROADCAST_DESC broadcast_id=\"0x%04x\" component_tag=\"%u\""
" selector_byte=\"%s\" selector_byte_txt=\"%s\" lang=\"%3.3s\""
" selector_byte=\"%s\" lang=\"%3.3s\""
" text=\"%s\"/>",
desc64_get_broadcast_id(p_desc),
desc64_get_component_tag(p_desc),
psz_selector_byte,
psz_selector_byte_txt,
(char *)desc64_get_lang(p_desc),
psz_text);
break;
......
......@@ -109,10 +109,9 @@ static inline void desc66_print(const uint8_t *p_desc, f_print pf_print,
case PRINT_XML:
pf_print(opaque,
"<DATA_BROADCAST_ID_DESC broadcast_id=\"0x%04x\""
" selector_byte=\"%s\" selector_byte_txt=\"%s\"/>",
" selector_byte=\"%s\"/>",
desc66_get_broadcast_id(p_desc),
psz_selector_byte,
psz_selector_byte_txt
psz_selector_byte
);
break;
default:
......
......@@ -99,10 +99,9 @@ static inline void desc67_print(const uint8_t *p_desc, f_print pf_print,
case PRINT_XML:
pf_print(opaque,
!b_dsng_desc
? "<TRANSPORT_STREAM_DESC bytes=\"%s\" bytes_txt=\"%s\"/>"
: "<DSNG_DESC bytes=\"%s\" bytes_txt=\"%s\"/>",
psz_bytes,
psz_bytes_txt
? "<TRANSPORT_STREAM_DESC bytes=\"%s\"/>"
: "<DSNG_DESC bytes=\"%s\"/>",
psz_bytes
);
break;
default:
......
......@@ -69,7 +69,7 @@ static inline uint32_t desc6dn_get_frequency(const uint8_t *p_desc_n)
return (p_desc_n[2] << 24) | (p_desc_n[3] << 16) | (p_desc_n[4] << 8) | p_desc_n[5];
}
static inline void desc6dn_set_frequency(uint8_t *p_desc_n, uint16_t i_frequency)
static inline void desc6dn_set_frequency(uint8_t *p_desc_n, uint32_t i_frequency)
{
p_desc_n[2] = (i_frequency >> 24) & 0xff;
p_desc_n[3] = (i_frequency >> 16) & 0xff;
......
......@@ -64,19 +64,25 @@ static inline void eit_print(uint8_t *p_eit,
switch (i_print_type) {
case PRINT_XML:
pf_print(print_opaque,
"<EIT tableid=\"0x%02x\" type=\"%s\" service_id=\"%u\" version=\"%u\""
" current_next=\"%u\" tsid=\"%u\" onid=\"%u\">",
"<EIT tableid=\"0x%02x\" type=\"%s\" service_id=\"%u\""
" version=\"%u\" section=\"%u\" last_section=\"%u\""
" current_next=\"%u\" segment_last_section=\"%u\""
" tsid=\"%u\" onid=\"%u\">",
i_tid, psz_tid,
eit_get_sid(p_eit),
psi_get_version(p_eit),
psi_get_section(p_eit),
psi_get_lastsection(p_eit),
!psi_get_current(p_eit) ? 0 : 1,
eit_get_segment_last_sec_number(p_eit),
eit_get_tsid(p_eit),
eit_get_onid(p_eit)
);
break;
default:
pf_print(print_opaque,
"new EIT tableid=0x%02x type=%s service_id=%u version=%u%s section=%u/%u tsid=%u"
"new EIT tableid=0x%02x type=%s service_id=%u version=%u%s"
" section=%u/%u segment_last_section=%u tsid=%u"
" onid=%u",
i_tid, psz_tid,
eit_get_sid(p_eit),
......@@ -84,6 +90,7 @@ static inline void eit_print(uint8_t *p_eit,
!psi_get_current(p_eit) ? " (next)" : "",
psi_get_section(p_eit),
psi_get_lastsection(p_eit),
eit_get_segment_last_sec_number(p_eit),
eit_get_tsid(p_eit),
eit_get_onid(p_eit)
);
......
......@@ -52,7 +52,7 @@ static const char *ppsz_dvb_encodings[] = {
"ISO-8859-14", "ISO-8859-15", "", "", "", "",
/* 0x10 - 0x1f */
"", "UTF-16", "KSC5601-1987", "GB2312", "BIG-5", "UTF-8",
"", "UCS-2BE", "EUC-KR", "GB2312", "UCS-2BE", "UTF-8",
"", "", "", "", "", "", "", "", "", "", NULL
};
static const char *ppsz_dvb_encodings10[] = {
......
/*****************************************************************************
* telx.h: ETSI EN 300 706 Enhanced Teletext
*****************************************************************************
* Copyright (C) 2016 OpenHeadend
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*****************************************************************************/
/*
* Normative references:
* - ETSI EN 300 706 V1.2.1 (2003-04) (enhanced teletext)
*/
#ifndef __BITSTREAM_DVB_TELX_H__
#define __BITSTREAM_DVB_TELX_H__
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C"
{
#endif
/*****************************************************************************
* Packet identification
*****************************************************************************/
#define TELX_RUN_IN 0xaa
#define TELX_FRAMING_CODE 0xe4
#ifdef __cplusplus
}
#endif
#endif
/*****************************************************************************
* vbi.h: ETSI EN 301 775 Carriage of VBI in DVB
*****************************************************************************
* Copyright (C) 2016 OpenHeadend
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*****************************************************************************/
/*
* Normative references:
* - ETSI EN 300 775 V1.2.1 (2003-05) (carriage of VBI in DVB)
*/
#ifndef __BITSTREAM_DVB_VBI_H__
#define __BITSTREAM_DVB_VBI_H__
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C"
{
#endif
/*****************************************************************************
* PES data field
*****************************************************************************/
#define DVBVBI_HEADER_SIZE 1
#define DVBVBI_UNIT_HEADER_SIZE 2
#define DVBVBI_DATA_IDENTIFIER 0x10
#define DVBVBI_ID_TTX_NONSUB 0x02
#define DVBVBI_ID_TTX_SUB 0x03
#define DVBVBI_ID_TTX_INVERTED 0xc0
#define DVBVBI_ID_VPS 0xc3
#define DVBVBI_ID_WSS 0xc4
#define DVBVBI_ID_CEA608 0xc5
#define DVBVBI_ID_RAWVBI 0xc6
#define DVBVBI_ID_STUFFING 0xff
#define DVBVBI_LENGTH 0x2c
/*****************************************************************************
* Teletext data field
*****************************************************************************/
#define DVBVBITTX_FRAMING_CODE 0xe4
static inline void dvbvbittx_set_field(uint8_t *p, bool field)
{
p[0] |= 0xc0;
if (field)
p[0] |= 0x20;
else
p[0] &= ~0x20;
}
static inline bool dvbvbittx_get_field(const uint8_t *p)
{
return p[0] & 0x20;
}
static inline void dvbvbittx_set_line(uint8_t *p, uint8_t line)
{
p[0] &= ~0x1f;
p[0] |= 0xc0 | (line & 0x1f);
}
static inline uint8_t dvbvbittx_get_line(const uint8_t *p)
{
return p[0] & 0x1f;
}
#ifdef __cplusplus
}
#endif
#endif
......@@ -35,6 +35,7 @@
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <bitstream/mpeg/ts.h>
#include <bitstream/mpeg/psi.h>
......@@ -1751,7 +1752,8 @@ static void output_psi_section(uint8_t *section, uint16_t pid, uint8_t *cc) {
if (section_offset == section_length)
psi_split_end(ts, &ts_offset);
write(fileno(stdout), ts, TS_SIZE);
if (write(fileno(stdout), ts, TS_SIZE) < 0)
perror("write");
} while (section_offset < section_length);
}
......
......@@ -293,7 +293,9 @@ static void handle_pat(void)
for (i_pmt = 0; i_pmt < i_nb_sids; i_pmt++)
if (pp_sids[i_pmt]->i_sid == i_sid) {
pp_sids[i_pmt]->i_sid = 0;
handle_pmt_es(pp_sids[i_pmt]->p_current_pmt, false);
if (pp_sids[i_pmt]->p_current_pmt != NULL)
handle_pmt_es(pp_sids[i_pmt]->p_current_pmt,
false);
free(pp_sids[i_pmt]->p_current_pmt);
pp_sids[i_pmt]->p_current_pmt = NULL;
psi_table_free(pp_sids[i]->pp_eit_sections);
......@@ -1198,25 +1200,42 @@ int main(int i_argc, char **ppsz_argv)
break;
}
bool b_is_last_invalid = false;
while (!feof(stdin) && !ferror(stdin)) {
uint8_t p_ts[TS_SIZE];
size_t i_ret = fread(p_ts, sizeof(p_ts), 1, stdin);
if (i_ret != 1) continue;
if (!ts_validate(p_ts)) {
switch (i_print_type) {
case PRINT_XML:
printf("<ERROR type=\"invalid_ts\"/>\n");
break;
default:
printf("invalid TS packet\n");
if (!b_is_last_invalid) {
switch (i_print_type) {
case PRINT_XML:
printf("<ERROR type=\"invalid_ts\"/>\n");
break;
default:
printf("invalid TS packet\n");
}
b_is_last_invalid = true;
}
} else {
uint16_t i_pid = ts_get_pid(p_ts);
ts_pid_t *p_pid = &p_pids[i_pid];
if (p_pid->i_psi_refcount)
handle_psi_packet(p_ts);
p_pid->i_last_cc = ts_get_cc(p_ts);
int i;
for (i = 1; i < TS_SIZE; i++) {
if (ts_validate(p_ts + i)) {
memmove(p_ts, p_ts + i, TS_SIZE - i);
i_ret = fread(p_ts + TS_SIZE - i, i, 1, stdin);
if (i_ret != 1) continue;
break;
}
}
if (i == TS_SIZE)
continue;
}
uint16_t i_pid = ts_get_pid(p_ts);
ts_pid_t *p_pid = &p_pids[i_pid];
if (p_pid->i_psi_refcount)
handle_psi_packet(p_ts);
p_pid->i_last_cc = ts_get_cc(p_ts);
b_is_last_invalid = false;
}
switch (i_print_type) {
......
......@@ -141,9 +141,9 @@ new SDT actual tsid=10000 version=1 onid=40000
- desc 4b nvod_reference tsid=10200 onid=40200 sid=20200
- desc 5f private_data specifier=0xaabbccdd
end SDT
new EIT tableid=0x4e type=actual_pf service_id=20000 version=0 section=0/0 tsid=10000 onid=40000
new EIT tableid=0x4e type=actual_pf service_id=20000 version=0 section=0/0 segment_last_section=0 tsid=10000 onid=40000
end EIT
new EIT tableid=0x4e type=actual_pf service_id=20000 version=1 section=0/0 tsid=10000 onid=40000
new EIT tableid=0x4e type=actual_pf service_id=20000 version=1 section=0/0 segment_last_section=0 tsid=10000 onid=40000
* EVENT id=30000 start_time=1234567890 start_time_dec="2009-02-13 23:31:30 UTC" duration=86399 duration_dec=23:59:59 running=2 free_CA=0
- desc 4d short_event lang=eng event_name="Major TV event" text="The event of the century!"
* EVENT id=30100 start_time=1 start_time_dec="1970-01-01 00:00:01 UTC" duration=3600 duration_dec=01:00:00 running=1 free_CA=0
......@@ -247,9 +247,9 @@ new PMT program=20000 version=1 pcrpid=110
- desc 7a ac3 component_type_flag=1 component_type=10 bsid_flag=1 bsid=20 mainid_flag=1 mainid=30 asvc_flag=1 asvc=40 mixinfoexists=1 substream1_flag=1 substream1=50 substream2_flag=1 substream2=60 substream3_flag=1 substream3=70
- desc 7b dts sample_rate_code=8 bit_rate_code=11 nblks=5 fsize=95 surround_mode=3 lfe_flag=1 extended_surround_flag=2
* ES pid=122 streamtype=0x06 streamtype_txt="13818-1 PES private data"
- desc 46 vbi_telx language=eng type=0x1 type_txt="Initial teletext page" mag=3 page=0x255x
- desc 46 vbi_telx language=bul type=0x2 type_txt="Teletext subtitle page" mag=2 page=0x127x
- desc 46 vbi_telx language=fre type=0x3 type_txt="Additional information page" mag=1 page=0x64x
- desc 46 vbi_telx language=eng type=0x1 type_txt="Initial teletext page" mag=3 page=0xff
- desc 46 vbi_telx language=bul type=0x2 type_txt="Teletext subtitle page" mag=2 page=0x7f
- desc 46 vbi_telx language=fre type=0x3 type_txt="Additional information page" mag=1 page=0x40
- desc 45 vbi_data service_id=0x01 length=8 service_txt="EBU teletext"
- vbi_data field_parity=1 line_offset=0
- vbi_data field_parity=0 line_offset=1
......@@ -273,9 +273,9 @@ new PMT program=20000 version=1 pcrpid=110
- vbi_data field_parity=1 line_offset=23
- desc 45 vbi_data service_id=0x06 length=0 service_txt="Closed Captioning"
* ES pid=123 streamtype=0x06 streamtype_txt="13818-1 PES private data"
- desc 56 telx language=eng type=0x1 type_txt="Initial teletext page" mag=3 page=0x255x
- desc 56 telx language=bul type=0x2 type_txt="Teletext subtitle page" mag=2 page=0x127x
- desc 56 telx language=fre type=0x3 type_txt="Additional information page" mag=1 page=0x64x
- desc 56 telx language=eng type=0x1 type_txt="Initial teletext page" mag=3 page=0xff
- desc 56 telx language=bul type=0x2 type_txt="Teletext subtitle page" mag=2 page=0x7f
- desc 56 telx language=fre type=0x3 type_txt="Additional information page" mag=1 page=0x40
- desc 60 service_move new_onid=10000 new_tsid=15000 new_service_id=20000
- desc 65 scrambling scrambling_mode=0x01 scrambling_mode_txt="DVB-CSA1"
* ES pid=124 streamtype=0x06 streamtype_txt="13818-1 PES private data"
......
......@@ -30,13 +30,13 @@
</TSDT>
<TSDT version="1" current_next="1">
<DESC id="0x67" length="3" value="445642">
<TRANSPORT_STREAM_DESC bytes="445642" bytes_txt="DVB"/>
<TRANSPORT_STREAM_DESC bytes="445642"/>
</DESC>
<DESC id="0x67" length="4" value="434f4e54">
<TRANSPORT_STREAM_DESC bytes="434f4e54" bytes_txt="CONT"/>
<TRANSPORT_STREAM_DESC bytes="434f4e54"/>
</DESC>
<DESC id="0x68" length="33" value="313233342c534e475f48656164717561727465722c534e475f50726f7669646572">
<DSNG_DESC bytes="313233342c534e475f48656164717561727465722c534e475f50726f7669646572" bytes_txt="1234,SNG_Headquarter,SNG_Provider"/>
<DSNG_DESC bytes="313233342c534e475f48656164717561727465722c534e475f50726f7669646572"/>
</DESC>
</TSDT>
<NIT tid="64" networkid="40000" version="0" current_next="1">
......@@ -228,10 +228,10 @@
<PRIVATE_DATA_SPECIFIER_DESC specifier="0xaabbccdd" />
</DESC>
<DESC id="0x64" length="22" value="11224e054259225445656e6709536f6d652074657874">
<DATA_BROADCAST_DESC broadcast_id="0x1122" component_tag="78" selector_byte="4259225445" selector_byte_txt="BY.TE" lang="eng" text="Some text"/>
<DATA_BROADCAST_DESC broadcast_id="0x1122" component_tag="78" selector_byte="4259225445" lang="eng" text="Some text"/>
</DESC>
<DESC id="0x66" length="6" value="1122554e4958">
<DATA_BROADCAST_ID_DESC broadcast_id="0x1122" selector_byte="554e4958" selector_byte_txt="UNIX"/>
<DATA_BROADCAST_ID_DESC broadcast_id="0x1122" selector_byte="554e4958"/>
</DESC>
</SERVICE>
<SERVICE sid="20300" eit_schedule="1" eit_pf="1" running="2" free_CA="1">
......@@ -248,9 +248,9 @@
</DESC>
</SERVICE>
</SDT>
<EIT tableid="0x4e" type="actual_pf" service_id="20000" version="0" current_next="1" tsid="10000" onid="40000">
<EIT tableid="0x4e" type="actual_pf" service_id="20000" version="0" section="0" last_section="0" current_next="1" segment_last_section="0" tsid="10000" onid="40000">
</EIT>
<EIT tableid="0x4e" type="actual_pf" service_id="20000" version="1" current_next="1" tsid="10000" onid="40000">
<EIT tableid="0x4e" type="actual_pf" service_id="20000" version="1" section="0" last_section="0" current_next="1" segment_last_section="0" tsid="10000" onid="40000">
<EVENT id="30000" start_time="1234567890" start_time_dec="2009-02-13 23:31:30 UTC" duration="86399" duration_dec="23:59:59" running="2" free_CA="0">
<DESC id="0x4d" length="44" value="656e670e4d616a6f72205456206576656e7419546865206576656e74206f66207468652063656e7475727921">
<SHORT_EVENT_DESC lang="eng" event_name="Major TV event" text="The event of the century!"/>
......@@ -445,9 +445,9 @@
</ES>
<ES pid="122" streamtype="0x06" streamtype_txt="13818-1 PES private data">
<DESC id="0x46" length="15" value="656e670bff62756c127f6672651940">
<VBI_TELX_DESC language="eng" type="0x1" type_txt="Initial teletext page" mag="3" page="0x255x"/>
<VBI_TELX_DESC language="bul" type="0x2" type_txt="Teletext subtitle page" mag="2" page="0x127x"/>
<VBI_TELX_DESC language="fre" type="0x3" type_txt="Additional information page" mag="1" page="0x64x"/>
<VBI_TELX_DESC language="eng" type="0x1" type_txt="Initial teletext page" mag="3" page="0xff"/>
<VBI_TELX_DESC language="bul" type="0x2" type_txt="Teletext subtitle page" mag="2" page="0x7f"/>
<VBI_TELX_DESC language="fre" type="0x3" type_txt="Additional information page" mag="1" page="0x40"/>
</DESC>
<DESC id="0x45" length="27" value="0108e0c1e2c3e4c5e6c70304123456780401ca0504d4f5d6f70600">
<VBI_DATA_DESC>
......@@ -483,9 +483,9 @@
</ES>
<ES pid="123" streamtype="0x06" streamtype_txt="13818-1 PES private data">
<DESC id="0x56" length="15" value="656e670bff62756c127f6672651940">
<TELX_DESC language="eng" type="0x1" type_txt="Initial teletext page" mag="3" page="0x255x"/>
<TELX_DESC language="bul" type="0x2" type_txt="Teletext subtitle page" mag="2" page="0x127x"/>
<TELX_DESC language="fre" type="0x3" type_txt="Additional information page" mag="1" page="0x64x"/>
<TELX_DESC language="eng" type="0x1" type_txt="Initial teletext page" mag="3" page="0xff"/>
<TELX_DESC language="bul" type="0x2" type_txt="Teletext subtitle page" mag="2" page="0x7f"/>
<TELX_DESC language="fre" type="0x3" type_txt="Additional information page" mag="1" page="0x40"/>
</DESC>
<DESC id="0x60" length="6" value="27103a984e20">
<SERVICE_MOVE_DESC new_onid="10000" new_tsid="15000" new_service_id="20000"/>
......
/*****************************************************************************
* rfc4175.h: RFC Profile for uncompressed video
*****************************************************************************
* Copyright (C) 2016 Open Broadcast Systems Ltd.
*
* Authors: Rostislav Pehlivanov <rpehlivanov@obe.tv>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*****************************************************************************/
/*
* Normative references:
* - IETF RFC 4175 Uncompressed
*/
#ifndef __BITSTREAM_IETF_RFC4175_H__
#define __BITSTREAM_IETF_RFC4175_H__
#include <stdint.h> /* uint8_t, uint16_t, etc... */
#ifdef __cplusplus
extern "C"
{
#endif
#define RFC_4175_EXT_SEQ_NUM_LEN 2
#define RFC_4175_HEADER_LEN 6 /* Note: extended sequence number not included */
/* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Extended Sequence Number | Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |F| Line No |C| Offset |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Length |F| Line No |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |C| Offset | .
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ .
* . .
* . Two (partial) lines of video data .
* . .
* +---------------------------------------------------------------+
*/
static inline void rfc4175_set_extended_sequence_number(uint8_t *buf, uint16_t number)
{
buf[0] = (number >> 8) & 0xff;
buf[1] = number & 0xff;
}
static inline uint16_t rfc4175_get_extended_sequence_number(const uint8_t *buf)
{
return (buf[0] << 8) | buf[1];
}
static inline void rfc4175_set_line_length(uint8_t *buf, uint16_t length)
{
buf[0] = (length >> 8) & 0xff;
buf[1] = length & 0xff;
}
static inline uint16_t rfc4175_get_line_length(const uint8_t *buf)
{
return (buf[0] << 8) | buf[1];
}
static inline void rfc4175_set_line_field_id(uint8_t *buf, uint8_t id)
{
buf[2] |= (!!id) << 7;
}
static inline uint8_t rfc4175_get_line_field_id(const uint8_t *buf)
{
return buf[2] >> 7;
}
static inline void rfc4175_set_line_number(uint8_t *buf, uint16_t number)
{
buf[2] |= (number >> 8) & 0x7f;
buf[3] = number & 0xff;
}
static inline uint16_t rfc4175_get_line_number(const uint8_t *buf)
{
return ((buf[2] & 0x7f) << 8) | buf[3];
}
static inline void rfc4175_set_line_continuation(uint8_t *buf, uint8_t continuation)
{
buf[4] |= (!!continuation) << 7;
}
static inline uint8_t rfc4175_get_line_continuation(const uint8_t *buf)
{
return buf[4] >> 7;
}
static inline void rfc4175_set_line_offset(uint8_t *buf, uint16_t offset)
{
buf[4] |= (offset >> 8) & 0x7f;
buf[5] = offset & 0xff;
}
static inline uint16_t rfc4175_get_line_offset(const uint8_t *buf)
{
return ((buf[4] & 0x7f) << 8) | buf[5];
}
#ifdef __cplusplus
}
#endif
#endif
......@@ -4,68 +4,34 @@
# include <inttypes.h>
# define RTCP_RTP_VERSION 2
# define RTCP_PT_SR 200
static inline void rtcp_sr_set_rtp_version(uint8_t *p_rtcp_sr)
static inline void rtcp_set_rtp_version(uint8_t *p_rtcp)
{
p_rtcp_sr[0] = RTCP_RTP_VERSION << 6;
p_rtcp[0] = RTCP_RTP_VERSION << 6;
}
static inline void rtcp_sr_set_pt(uint8_t *p_rtcp_sr)
static inline uint8_t rtcp_get_pt(const uint8_t *p_rtcp)
{
p_rtcp_sr[1] = RTCP_PT_SR;
return p_rtcp[1];
}
static inline void rtcp_sr_set_length(uint8_t *p_rtcp_sr,
uint16_t length)
{
p_rtcp_sr[2] = length >> 8;
p_rtcp_sr[3] = length & 0xff;
}
static inline void rtcp_sr_set_ntp_time_msw(uint8_t *p_rtcp_sr,
uint32_t ntp_time_msw)
{
p_rtcp_sr[8] = (ntp_time_msw >> 24) & 0xff;
p_rtcp_sr[9] = (ntp_time_msw >> 16) & 0xff;
p_rtcp_sr[10] = (ntp_time_msw >> 8) & 0xff;
p_rtcp_sr[11] = ntp_time_msw & 0xff;
}
static inline void rtcp_sr_set_ntp_time_lsw(uint8_t *p_rtcp_sr,
uint32_t ntp_time_lsw)
static inline void rtcp_set_pt(uint8_t *p_rtcp, uint8_t pt)
{
p_rtcp_sr[12] = (ntp_time_lsw >> 24) & 0xff;
p_rtcp_sr[13] = (ntp_time_lsw >> 16) & 0xff;
p_rtcp_sr[14] = (ntp_time_lsw >> 8) & 0xff;
p_rtcp_sr[15] = ntp_time_lsw & 0xff;
p_rtcp[1] = pt;
}
static inline void rtcp_sr_set_rtp_time(uint8_t *p_rtcp_sr,
uint32_t rtp_time)
static inline uint16_t rtcp_get_length(const uint8_t *p_rtcp)
{
p_rtcp_sr[16] = (rtp_time >> 24) & 0xff;
p_rtcp_sr[17] = (rtp_time >> 16) & 0xff;
p_rtcp_sr[18] = (rtp_time >> 8) & 0xff;
p_rtcp_sr[19] = rtp_time & 0xff;
return (p_rtcp[2] << 8) | p_rtcp[3];
}