mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
dashdemux: Move code around to keep all sidx related functions together
https://bugzilla.gnome.org/show_bug.cgi?id=741104
This commit is contained in:
parent
c4ad30d6b4
commit
7d4f6ca0a9
1 changed files with 31 additions and 30 deletions
|
@ -27,36 +27,6 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
void
|
||||
gst_isoff_sidx_parser_init (GstSidxParser * parser)
|
||||
{
|
||||
parser->status = GST_ISOFF_SIDX_PARSER_INIT;
|
||||
parser->cumulative_entry_size = 0;
|
||||
parser->sidx.entries = NULL;
|
||||
parser->sidx.entries_count = 0;
|
||||
}
|
||||
|
||||
void
|
||||
gst_isoff_sidx_parser_clear (GstSidxParser * parser)
|
||||
{
|
||||
g_free (parser->sidx.entries);
|
||||
parser->sidx.entries = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_isoff_parse_sidx_entry (GstSidxBoxEntry * entry, GstByteReader * reader)
|
||||
{
|
||||
guint32 aux;
|
||||
|
||||
aux = gst_byte_reader_get_uint32_be_unchecked (reader);
|
||||
entry->ref_type = aux >> 31;
|
||||
entry->size = aux & 0x7FFFFFFF;
|
||||
entry->duration = gst_byte_reader_get_uint32_be_unchecked (reader);
|
||||
aux = gst_byte_reader_get_uint32_be_unchecked (reader);
|
||||
entry->starts_with_sap = aux >> 31;
|
||||
entry->sap_type = ((aux >> 28) & 0x7);
|
||||
entry->sap_delta_time = aux & 0xFFFFFFF;
|
||||
}
|
||||
|
||||
/* gst_isoff_parse_box:
|
||||
* @reader:
|
||||
|
@ -112,6 +82,37 @@ not_enough_data:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gst_isoff_sidx_parser_init (GstSidxParser * parser)
|
||||
{
|
||||
parser->status = GST_ISOFF_SIDX_PARSER_INIT;
|
||||
parser->cumulative_entry_size = 0;
|
||||
parser->sidx.entries = NULL;
|
||||
parser->sidx.entries_count = 0;
|
||||
}
|
||||
|
||||
void
|
||||
gst_isoff_sidx_parser_clear (GstSidxParser * parser)
|
||||
{
|
||||
g_free (parser->sidx.entries);
|
||||
parser->sidx.entries = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_isoff_parse_sidx_entry (GstSidxBoxEntry * entry, GstByteReader * reader)
|
||||
{
|
||||
guint32 aux;
|
||||
|
||||
aux = gst_byte_reader_get_uint32_be_unchecked (reader);
|
||||
entry->ref_type = aux >> 31;
|
||||
entry->size = aux & 0x7FFFFFFF;
|
||||
entry->duration = gst_byte_reader_get_uint32_be_unchecked (reader);
|
||||
aux = gst_byte_reader_get_uint32_be_unchecked (reader);
|
||||
entry->starts_with_sap = aux >> 31;
|
||||
entry->sap_type = ((aux >> 28) & 0x7);
|
||||
entry->sap_delta_time = aux & 0xFFFFFFF;
|
||||
}
|
||||
|
||||
GstIsoffParserResult
|
||||
gst_isoff_sidx_parser_add_buffer (GstSidxParser * parser, GstBuffer * buffer,
|
||||
guint * consumed)
|
||||
|
|
Loading…
Reference in a new issue