Commit 5b5f2a4b authored by Georgi Chorbadzhiyski's avatar Georgi Chorbadzhiyski

dvb/si: Add support for descriptor 0x51 (Mosaic descriptor).

parent 86e286ae
......@@ -114,6 +114,7 @@ Supported DVB descriptors
* Descriptor 0x4e: Extended event descriptor
* Descriptor 0x4f: Time shifted event descriptor
* Descriptor 0x50: Component descriptor
* Descriptor 0x51: Mosaic descriptor
* Descriptor 0x52: Stream identifier descriptor
* Descriptor 0x54: Content descriptor
* Descriptor 0x55: Parental rating descriptor
......
......@@ -14,7 +14,6 @@ so if you like something just do it and send a patch.
- Descriptor 0x6a: AC-3 descriptor
- Add support (parser, generator, example) for these DVB descriptors:
- Descriptor 0x51: mosaic_descriptor
- Descriptor 0x53: CA_identifier_descriptor
- Descriptor 0x57: telephone_descriptor
- Descriptor 0x5b: multilingual_network_name_descriptor
......
This diff is collapsed.
......@@ -51,6 +51,7 @@
#include <bitstream/dvb/si/desc_4e.h>
#include <bitstream/dvb/si/desc_4f.h>
#include <bitstream/dvb/si/desc_50.h>
#include <bitstream/dvb/si/desc_51.h>
#include <bitstream/dvb/si/desc_52.h>
#include <bitstream/dvb/si/desc_54.h>
#include <bitstream/dvb/si/desc_55.h>
......
......@@ -643,7 +643,69 @@ static void build_desc50(uint8_t *desc) {
desc50_set_text(desc, (uint8_t *)text, strlen(text)); // Not required
}
/* --- Descriptor 0x51: mosaic_descriptor */
/* DVB Descriptor 0x51: Mosaic descriptor */
static void build_desc51(uint8_t *desc) {
uint8_t k = 0;
uint8_t *cell_n;
desc51_init(desc);
desc51_set_mosaic_entry_point(desc, 1);
desc51_set_horizontal_cells(desc, 2); // +1 == 3
desc51_set_vertical_cells(desc, 2); // +1 == 3 (3x3 == 9 cells)
desc_set_length(desc, 255);
cell_n = desc51_get_logical_cell(desc, k++);
{
desc51n_set_logical_cell_id(cell_n, 0);
desc51n_set_logical_cell_presentation_info(cell_n, 1);
desc51n_set_elementary_cell_field_length(cell_n, 3);
{
desc51n_set_elementary_cell_id(cell_n, 0, 0);
desc51n_set_elementary_cell_id(cell_n, 1, 1);
desc51n_set_elementary_cell_id(cell_n, 2, 2);
}
desc51n_set_cell_linkage_info(cell_n, 1); // bouquet_id
desc51n_set_bouquet_id(cell_n, onid + 100);
}
cell_n = desc51_get_logical_cell(desc, k++);
{
desc51n_set_logical_cell_id(cell_n, 1);
desc51n_set_logical_cell_presentation_info(cell_n, 2);
desc51n_set_elementary_cell_field_length(cell_n, 3);
{
desc51n_set_elementary_cell_id(cell_n, 0, 3);
desc51n_set_elementary_cell_id(cell_n, 1, 4);
desc51n_set_elementary_cell_id(cell_n, 2, 5);
}
desc51n_set_cell_linkage_info(cell_n, 2); // 2 or 3, onid, tsid, sid
desc51n_set_onid(cell_n, onid + 500);
desc51n_set_tsid(cell_n, tsid + 500);
desc51n_set_sid(cell_n, sid + 500);
}
cell_n = desc51_get_logical_cell(desc, k++);
{
desc51n_set_logical_cell_id(cell_n, 2);
desc51n_set_logical_cell_presentation_info(cell_n, 3);
desc51n_set_elementary_cell_field_length(cell_n, 3);
{
desc51n_set_elementary_cell_id(cell_n, 0, 6);
desc51n_set_elementary_cell_id(cell_n, 1, 7);
desc51n_set_elementary_cell_id(cell_n, 2, 8);
}
desc51n_set_cell_linkage_info(cell_n, 4); // onid, tsid, sid, event_id
desc51n_set_onid(cell_n, onid + 1000);
desc51n_set_tsid(cell_n, tsid + 1000);
desc51n_set_sid(cell_n, sid + 1000);
desc51n_set_event_id(cell_n, event_id + 1000);
}
cell_n = desc51_get_logical_cell(desc, k);
desc_set_length(desc, cell_n - desc - DESC_HEADER_SIZE);
}
/* DVB Descriptor 0x52: Stream identifier descriptor */
static void build_desc52(uint8_t *desc) {
desc52_init(desc);
......@@ -1303,6 +1365,9 @@ static void generate_sdt(void) {
desc = descs_get_desc(desc_loop, desc_counter++);
build_desc49(desc, true);
desc = descs_get_desc(desc_loop, desc_counter++);
build_desc51(desc);
desc = descs_get_desc(desc_loop, desc_counter++);
build_desc5f(desc);
......
......@@ -146,6 +146,7 @@ static inline void descl_print(uint8_t *p_descl, uint16_t i_length,
CASE_DESC_ICONV(4e)
CASE_DESC(4f)
CASE_DESC_ICONV(50)
CASE_DESC(51)
CASE_DESC(52)
CASE_DESC(54)
CASE_DESC(55)
......
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