• Home
  • Raw
  • Download

Lines Matching refs:section

169 __common_section_checks (GstMpegtsSection * section, guint min_size,  in __common_section_checks()  argument
175 if (section->section_length < min_size) { in __common_section_checks()
178 section->pid, section->table_id, section->section_length, min_size); in __common_section_checks()
183 if (!section->short_section in __common_section_checks()
184 && (_calc_crc32 (section->data, section->section_length) != 0)) { in __common_section_checks()
185 GST_WARNING ("PID:0x%04x table_id:0x%02x, Bad CRC on section", section->pid, in __common_section_checks()
186 section->table_id); in __common_section_checks()
191 res = parsefunc (section); in __common_section_checks()
194 section->pid, section->table_id); in __common_section_checks()
196 section->destroy_parsed = destroynotify; in __common_section_checks()
205 _gst_mpegts_section_free (GstMpegtsSection * section) in _gst_mpegts_section_free() argument
207 GST_DEBUG ("Freeing section type %d", section->section_type); in _gst_mpegts_section_free()
209 if (section->cached_parsed && section->destroy_parsed) in _gst_mpegts_section_free()
210 section->destroy_parsed (section->cached_parsed); in _gst_mpegts_section_free()
212 g_free (section->data); in _gst_mpegts_section_free()
214 g_slice_free (GstMpegtsSection, section); in _gst_mpegts_section_free()
218 _gst_mpegts_section_copy (GstMpegtsSection * section) in _gst_mpegts_section_copy() argument
227 copy->section_type = section->section_type; in _gst_mpegts_section_copy()
228 copy->pid = section->pid; in _gst_mpegts_section_copy()
229 copy->table_id = section->table_id; in _gst_mpegts_section_copy()
230 copy->subtable_extension = section->subtable_extension; in _gst_mpegts_section_copy()
231 copy->version_number = section->version_number; in _gst_mpegts_section_copy()
232 copy->current_next_indicator = section->current_next_indicator; in _gst_mpegts_section_copy()
233 copy->section_number = section->section_number; in _gst_mpegts_section_copy()
234 copy->last_section_number = section->last_section_number; in _gst_mpegts_section_copy()
235 copy->crc = section->crc; in _gst_mpegts_section_copy()
237 copy->data = g_memdup2 (section->data, section->section_length); in _gst_mpegts_section_copy()
238 copy->section_length = section->section_length; in _gst_mpegts_section_copy()
242 copy->offset = section->offset; in _gst_mpegts_section_copy()
243 copy->short_section = section->short_section; in _gst_mpegts_section_copy()
257 gst_mpegts_section_get_data (GstMpegtsSection * section) in gst_mpegts_section_get_data() argument
259 return g_bytes_new (section->data, section->section_length); in gst_mpegts_section_get_data()
274 GstMpegtsSection *section; in gst_message_parse_mpegts_section() local
282 &section, NULL)) in gst_message_parse_mpegts_section()
285 return section; in gst_message_parse_mpegts_section()
289 _mpegts_section_get_structure (GstMpegtsSection * section) in _mpegts_section_get_structure() argument
294 switch (section->section_type) { in _mpegts_section_get_structure()
332 section, NULL); in _mpegts_section_get_structure()
348 gst_message_new_mpegts_section (GstObject * parent, GstMpegtsSection * section) in gst_message_new_mpegts_section() argument
353 st = _mpegts_section_get_structure (section); in gst_message_new_mpegts_section()
370 gst_event_new_mpegts_section (GstMpegtsSection * section) in gst_event_new_mpegts_section() argument
375 structure = _mpegts_section_get_structure (section); in gst_event_new_mpegts_section()
395 GstMpegtsSection *section; in gst_event_parse_mpegts_section() local
403 &section, NULL)) in gst_event_parse_mpegts_section()
406 return section; in gst_event_parse_mpegts_section()
420 gst_mpegts_section_send_event (GstMpegtsSection * section, GstElement * element) in gst_mpegts_section_send_event() argument
424 g_return_val_if_fail (section != NULL, FALSE); in gst_mpegts_section_send_event()
427 event = gst_event_new_mpegts_section (section); in gst_mpegts_section_send_event()
455 _parse_pat (GstMpegtsSection * section) in _parse_pat() argument
463 data = section->data + 8; in _parse_pat()
466 end = section->data + section->section_length; in _parse_pat()
515 gst_mpegts_section_get_pat (GstMpegtsSection * section) in gst_mpegts_section_get_pat() argument
517 g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_PAT, NULL); in gst_mpegts_section_get_pat()
518 g_return_val_if_fail (section->cached_parsed || section->data, NULL); in gst_mpegts_section_get_pat()
520 if (!section->cached_parsed) in gst_mpegts_section_get_pat()
521 section->cached_parsed = in gst_mpegts_section_get_pat()
522 __common_section_checks (section, 12, _parse_pat, in gst_mpegts_section_get_pat()
525 if (section->cached_parsed) in gst_mpegts_section_get_pat()
526 return g_ptr_array_ref ((GPtrArray *) section->cached_parsed); in gst_mpegts_section_get_pat()
567 _packetize_pat (GstMpegtsSection * section) in _packetize_pat() argument
574 programs = gst_mpegts_section_get_pat (section); in _packetize_pat()
587 _packetize_common_section (section, length); in _packetize_pat()
588 data = section->data + 8; in _packetize_pat()
622 GstMpegtsSection *section; in gst_mpegts_section_from_pat() local
624 section = _gst_mpegts_section_init (0x00, in gst_mpegts_section_from_pat()
627 section->subtable_extension = ts_id; in gst_mpegts_section_from_pat()
628 section->cached_parsed = (gpointer) programs; in gst_mpegts_section_from_pat()
629 section->packetizer = _packetize_pat; in gst_mpegts_section_from_pat()
630 section->destroy_parsed = (GDestroyNotify) g_ptr_array_unref; in gst_mpegts_section_from_pat()
632 return section; in gst_mpegts_section_from_pat()
688 _parse_pmt (GstMpegtsSection * section) in _parse_pmt() argument
698 data = section->data; in _parse_pmt()
699 end = data + section->section_length; in _parse_pmt()
701 GST_DEBUG ("Parsing %d Program Map Table", section->subtable_extension); in _parse_pmt()
705 pmt->program_number = section->subtable_extension; in _parse_pmt()
718 section->pid, program_info_length, (gint) (end - data)); in _parse_pmt()
747 GST_WARNING ("PID %d invalid stream info length %d left %d", section->pid, in _parse_pmt()
787 gst_mpegts_section_get_pmt (GstMpegtsSection * section) in gst_mpegts_section_get_pmt() argument
789 g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_PMT, NULL); in gst_mpegts_section_get_pmt()
790 g_return_val_if_fail (section->cached_parsed || section->data, NULL); in gst_mpegts_section_get_pmt()
792 if (!section->cached_parsed) in gst_mpegts_section_get_pmt()
793 section->cached_parsed = in gst_mpegts_section_get_pmt()
794 __common_section_checks (section, 16, _parse_pmt, in gst_mpegts_section_get_pmt()
797 return (const GstMpegtsPMT *) section->cached_parsed; in gst_mpegts_section_get_pmt()
845 _packetize_pmt (GstMpegtsSection * section) in _packetize_pmt() argument
854 pmt = gst_mpegts_section_get_pmt (section); in _packetize_pmt()
896 _packetize_common_section (section, length); in _packetize_pmt()
897 data = section->data + 8; in _packetize_pmt()
950 GstMpegtsSection *section; in gst_mpegts_section_from_pmt() local
954 section = _gst_mpegts_section_init (pid, GST_MTS_TABLE_ID_TS_PROGRAM_MAP); in gst_mpegts_section_from_pmt()
956 section->subtable_extension = pmt->program_number; in gst_mpegts_section_from_pmt()
957 section->cached_parsed = (gpointer) pmt; in gst_mpegts_section_from_pmt()
958 section->packetizer = _packetize_pmt; in gst_mpegts_section_from_pmt()
959 section->destroy_parsed = (GDestroyNotify) _gst_mpegts_pmt_free; in gst_mpegts_section_from_pmt()
961 return section; in gst_mpegts_section_from_pmt()
966 _parse_cat (GstMpegtsSection * section) in _parse_cat() argument
972 data = section->data + 8; in _parse_cat()
975 desc_len = section->section_length - 4 - 8; in _parse_cat()
993 gst_mpegts_section_get_cat (GstMpegtsSection * section) in gst_mpegts_section_get_cat() argument
995 g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_CAT, NULL); in gst_mpegts_section_get_cat()
996 g_return_val_if_fail (section->cached_parsed || section->data, NULL); in gst_mpegts_section_get_cat()
998 if (!section->cached_parsed) in gst_mpegts_section_get_cat()
999 section->cached_parsed = in gst_mpegts_section_get_cat()
1000 __common_section_checks (section, 12, _parse_cat, in gst_mpegts_section_get_cat()
1003 if (section->cached_parsed) in gst_mpegts_section_get_cat()
1004 return g_ptr_array_ref ((GPtrArray *) section->cached_parsed); in gst_mpegts_section_get_cat()
1022 gst_mpegts_section_get_tsdt (GstMpegtsSection * section) in gst_mpegts_section_get_tsdt() argument
1024 g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_TSDT, NULL); in gst_mpegts_section_get_tsdt()
1025 g_return_val_if_fail (section->cached_parsed || section->data, NULL); in gst_mpegts_section_get_tsdt()
1027 if (section->cached_parsed) in gst_mpegts_section_get_tsdt()
1028 return g_ptr_array_ref ((GPtrArray *) section->cached_parsed); in gst_mpegts_section_get_tsdt()
1121 GstMpegtsSection *section; in _gst_mpegts_section_init() local
1123 section = g_slice_new0 (GstMpegtsSection); in _gst_mpegts_section_init()
1124 gst_mini_object_init (GST_MINI_OBJECT_CAST (section), 0, MPEG_TYPE_TS_SECTION, in _gst_mpegts_section_init()
1128 section->pid = pid; in _gst_mpegts_section_init()
1129 section->table_id = table_id; in _gst_mpegts_section_init()
1130 section->current_next_indicator = TRUE; in _gst_mpegts_section_init()
1131 section->section_type = _identify_section (pid, table_id); in _gst_mpegts_section_init()
1133 return section; in _gst_mpegts_section_init()
1137 _packetize_common_section (GstMpegtsSection * section, gsize length) in _packetize_common_section() argument
1141 section->section_length = length; in _packetize_common_section()
1142 data = section->data = g_malloc (length); in _packetize_common_section()
1145 *data++ = section->table_id; in _packetize_common_section()
1150 switch (section->section_type) { in _packetize_common_section()
1162 GST_WRITE_UINT16_BE (data, (section->section_length - 3) | 0x3000); in _packetize_common_section()
1165 GST_WRITE_UINT16_BE (data, (section->section_length - 3) | 0x7000); in _packetize_common_section()
1169 if (section->short_section) in _packetize_common_section()
1177 GST_WRITE_UINT16_BE (data, section->subtable_extension); in _packetize_common_section()
1184 ((section->version_number & 0x1F) << 1) | in _packetize_common_section()
1185 (section->current_next_indicator & 0x01); in _packetize_common_section()
1188 *data++ = section->section_number; in _packetize_common_section()
1190 *data++ = section->last_section_number; in _packetize_common_section()
1303 gst_mpegts_section_packetize (GstMpegtsSection * section, gsize * output_size) in gst_mpegts_section_packetize() argument
1306 g_return_val_if_fail (section != NULL, NULL); in gst_mpegts_section_packetize()
1310 if (section->data) { in gst_mpegts_section_packetize()
1311 *output_size = section->section_length; in gst_mpegts_section_packetize()
1312 return section->data; in gst_mpegts_section_packetize()
1315 g_return_val_if_fail (section->packetizer != NULL, NULL); in gst_mpegts_section_packetize()
1317 if (!section->packetizer (section)) in gst_mpegts_section_packetize()
1320 if (!section->short_section) { in gst_mpegts_section_packetize()
1322 crc = section->data + section->section_length - 4; in gst_mpegts_section_packetize()
1323 GST_WRITE_UINT32_BE (crc, _calc_crc32 (section->data, crc - section->data)); in gst_mpegts_section_packetize()
1326 *output_size = section->section_length; in gst_mpegts_section_packetize()
1328 return section->data; in gst_mpegts_section_packetize()