mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:46:13 +00:00
mpegtsbase: Adapt for latest mpegts lib changes
This commit is contained in:
parent
5d06aed3e2
commit
d6b55b8a66
2 changed files with 12 additions and 13 deletions
|
@ -265,7 +265,7 @@ mpegts_base_finalize (GObject * object)
|
||||||
MpegTSBase *base = GST_MPEGTS_BASE (object);
|
MpegTSBase *base = GST_MPEGTS_BASE (object);
|
||||||
|
|
||||||
if (base->pat) {
|
if (base->pat) {
|
||||||
g_array_unref (base->pat);
|
g_ptr_array_unref (base->pat);
|
||||||
base->pat = NULL;
|
base->pat = NULL;
|
||||||
}
|
}
|
||||||
g_hash_table_destroy (base->programs);
|
g_hash_table_destroy (base->programs);
|
||||||
|
@ -290,7 +290,7 @@ mpegts_get_descriptor_from_stream (MpegTSBaseStream * stream, guint8 tag)
|
||||||
|
|
||||||
desc = gst_mpegts_find_descriptor (pmt->descriptors, tag);
|
desc = gst_mpegts_find_descriptor (pmt->descriptors, tag);
|
||||||
if (desc)
|
if (desc)
|
||||||
return desc->descriptor_data;
|
return desc->data;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ mpegts_get_descriptor_from_program (MpegTSBaseProgram * program, guint8 tag)
|
||||||
|
|
||||||
descriptor = gst_mpegts_find_descriptor (pmt->descriptors, tag);
|
descriptor = gst_mpegts_find_descriptor (pmt->descriptors, tag);
|
||||||
if (descriptor)
|
if (descriptor)
|
||||||
return descriptor->descriptor_data;
|
return descriptor->data;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -441,17 +441,17 @@ mpegts_base_remove_program (MpegTSBase * base, gint program_number)
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint32
|
static guint32
|
||||||
get_registration_from_descriptors (GArray * descriptors)
|
get_registration_from_descriptors (GPtrArray * descriptors)
|
||||||
{
|
{
|
||||||
const GstMpegTsDescriptor *desc;
|
const GstMpegTsDescriptor *desc;
|
||||||
|
|
||||||
if ((desc =
|
if ((desc =
|
||||||
gst_mpegts_find_descriptor (descriptors,
|
gst_mpegts_find_descriptor (descriptors,
|
||||||
GST_MTS_DESC_REGISTRATION))) {
|
GST_MTS_DESC_REGISTRATION))) {
|
||||||
if (G_UNLIKELY (desc->descriptor_length < 4)) {
|
if (G_UNLIKELY (desc->length < 4)) {
|
||||||
GST_WARNING ("Registration descriptor with length < 4. (Corrupted ?)");
|
GST_WARNING ("Registration descriptor with length < 4. (Corrupted ?)");
|
||||||
} else
|
} else
|
||||||
return GST_READ_UINT32_BE (desc->descriptor_data + 2);
|
return GST_READ_UINT32_BE (desc->data + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -715,8 +715,8 @@ mpegts_base_activate_program (MpegTSBase * base, MpegTSBaseProgram * program,
|
||||||
static gboolean
|
static gboolean
|
||||||
mpegts_base_apply_pat (MpegTSBase * base, GstMpegTsSection * section)
|
mpegts_base_apply_pat (MpegTSBase * base, GstMpegTsSection * section)
|
||||||
{
|
{
|
||||||
GArray *pat = gst_mpegts_section_get_pat (section);
|
GPtrArray *pat = gst_mpegts_section_get_pat (section);
|
||||||
GArray *old_pat;
|
GPtrArray *old_pat;
|
||||||
MpegTSBaseProgram *program;
|
MpegTSBaseProgram *program;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
@ -739,7 +739,7 @@ mpegts_base_apply_pat (MpegTSBase * base, GstMpegTsSection * section)
|
||||||
GST_LOG ("Activating new Program Association Table");
|
GST_LOG ("Activating new Program Association Table");
|
||||||
/* activate the new table */
|
/* activate the new table */
|
||||||
for (i = 0; i < pat->len; ++i) {
|
for (i = 0; i < pat->len; ++i) {
|
||||||
GstMpegTsPatProgram *patp = &g_array_index (pat, GstMpegTsPatProgram, i);
|
GstMpegTsPatProgram *patp = g_ptr_array_index (pat, i);
|
||||||
|
|
||||||
program = mpegts_base_get_program (base, patp->program_number);
|
program = mpegts_base_get_program (base, patp->program_number);
|
||||||
if (program) {
|
if (program) {
|
||||||
|
@ -775,8 +775,7 @@ mpegts_base_apply_pat (MpegTSBase * base, GstMpegTsSection * section)
|
||||||
GST_LOG ("Deactivating old Program Association Table");
|
GST_LOG ("Deactivating old Program Association Table");
|
||||||
|
|
||||||
for (i = 0; i < old_pat->len; ++i) {
|
for (i = 0; i < old_pat->len; ++i) {
|
||||||
GstMpegTsPatProgram *patp =
|
GstMpegTsPatProgram *patp = g_ptr_array_index (old_pat, i);
|
||||||
&g_array_index (old_pat, GstMpegTsPatProgram, i);
|
|
||||||
|
|
||||||
program = mpegts_base_get_program (base, patp->program_number);
|
program = mpegts_base_get_program (base, patp->program_number);
|
||||||
if (G_UNLIKELY (program == NULL)) {
|
if (G_UNLIKELY (program == NULL)) {
|
||||||
|
@ -808,7 +807,7 @@ mpegts_base_apply_pat (MpegTSBase * base, GstMpegTsSection * section)
|
||||||
patp->network_or_program_map_PID);
|
patp->network_or_program_map_PID);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_array_unref (old_pat);
|
g_ptr_array_unref (old_pat);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -120,7 +120,7 @@ struct _MpegTSBase {
|
||||||
* accessed from the application thread and the streaming thread */
|
* accessed from the application thread and the streaming thread */
|
||||||
GHashTable *programs;
|
GHashTable *programs;
|
||||||
|
|
||||||
GArray *pat;
|
GPtrArray *pat;
|
||||||
MpegTSPacketizer2 *packetizer;
|
MpegTSPacketizer2 *packetizer;
|
||||||
|
|
||||||
/* arrays that say whether a pid is a known psi pid or a pes pid */
|
/* arrays that say whether a pid is a known psi pid or a pes pid */
|
||||||
|
|
Loading…
Reference in a new issue