mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
dash: move parser nodes/types to separated files
Rename GstMpdClient to GstMPDClient and use GObject model. Move nodes to file from gstmpdparser.c: - GstMPDRootNode - GstMPDBaseURLNode - GstMPDUTCTimingNode - GstMPDMetricsNode - GstMPDMetricsRangeNode - GstMPDSNode - GstMPDSegmentTimelineNode - GstSegmentTemplateNode - GstMPDSegmentURLNode - GstMPDSegmentListNode - GstMPDPeriodNode - GstMPDRepresentationNode - GstMPDsubRepresentationNode - GstMPDAdaptationSetNode - GstMPDContentComponentNode - GstMPDSubsetNode - GstMPDProgramInformationNode Move types to gstmpdhelper from gstmpdparser.c: - GstURLType - GstDescriptorType - GstSegmentBaseType - GstMPDMultSegmentBaseType - GstMPDRepresentationBaseType Cleanup naming when possible.
This commit is contained in:
parent
86b251b7d1
commit
c28e7d928d
44 changed files with 4045 additions and 1986 deletions
|
@ -475,14 +475,14 @@ gst_dash_demux_get_live_seek_range (GstAdaptiveDemux * demux, gint64 * start,
|
|||
GTimeSpan stream_now;
|
||||
GstClockTime seg_duration;
|
||||
|
||||
if (self->client->mpd_node->availabilityStartTime == NULL)
|
||||
if (self->client->mpd_root_node->availabilityStartTime == NULL)
|
||||
return FALSE;
|
||||
|
||||
seg_duration = gst_mpd_client_get_maximum_segment_duration (self->client);
|
||||
now = gst_dash_demux_get_server_now_utc (self);
|
||||
mstart =
|
||||
gst_date_time_to_g_date_time (self->client->
|
||||
mpd_node->availabilityStartTime);
|
||||
gst_date_time_to_g_date_time (self->client->mpd_root_node->
|
||||
availabilityStartTime);
|
||||
stream_now = g_date_time_difference (now, mstart);
|
||||
g_date_time_unref (now);
|
||||
g_date_time_unref (mstart);
|
||||
|
@ -491,11 +491,13 @@ gst_dash_demux_get_live_seek_range (GstAdaptiveDemux * demux, gint64 * start,
|
|||
return FALSE;
|
||||
|
||||
*stop = stream_now * GST_USECOND;
|
||||
if (self->client->mpd_node->timeShiftBufferDepth == GST_MPD_DURATION_NONE) {
|
||||
if (self->client->mpd_root_node->timeShiftBufferDepth ==
|
||||
GST_MPD_DURATION_NONE) {
|
||||
*start = 0;
|
||||
} else {
|
||||
*start =
|
||||
*stop - (self->client->mpd_node->timeShiftBufferDepth * GST_MSECOND);
|
||||
*stop -
|
||||
(self->client->mpd_root_node->timeShiftBufferDepth * GST_MSECOND);
|
||||
if (*start < 0)
|
||||
*start = 0;
|
||||
}
|
||||
|
@ -749,14 +751,14 @@ gst_dash_demux_get_property (GObject * object, guint prop_id, GValue * value,
|
|||
|
||||
static gboolean
|
||||
gst_dash_demux_setup_mpdparser_streams (GstDashDemux * demux,
|
||||
GstMpdClient * client)
|
||||
GstMPDClient * client)
|
||||
{
|
||||
gboolean has_streams = FALSE;
|
||||
GList *adapt_sets, *iter;
|
||||
|
||||
adapt_sets = gst_mpd_client_get_adaptation_sets (client);
|
||||
for (iter = adapt_sets; iter; iter = g_list_next (iter)) {
|
||||
GstAdaptationSetNode *adapt_set_node = iter->data;
|
||||
GstMPDAdaptationSetNode *adapt_set_node = iter->data;
|
||||
|
||||
gst_mpd_client_setup_streaming (client, adapt_set_node);
|
||||
has_streams = TRUE;
|
||||
|
@ -814,7 +816,7 @@ gst_dash_demux_setup_all_streams (GstDashDemux * demux)
|
|||
GST_LOG_OBJECT (demux, "Creating stream %d %" GST_PTR_FORMAT, i, caps);
|
||||
|
||||
if (active_stream->cur_adapt_set) {
|
||||
GstAdaptationSetNode *adp_set = active_stream->cur_adapt_set;
|
||||
GstMPDAdaptationSetNode *adp_set = active_stream->cur_adapt_set;
|
||||
lang = adp_set->lang;
|
||||
|
||||
/* Fallback to the language in ContentComponent node */
|
||||
|
@ -822,7 +824,7 @@ gst_dash_demux_setup_all_streams (GstDashDemux * demux)
|
|||
GList *it;
|
||||
|
||||
for (it = adp_set->ContentComponents; it; it = it->next) {
|
||||
GstContentComponentNode *cc_node = it->data;
|
||||
GstMPDContentComponentNode *cc_node = it->data;
|
||||
if (cc_node->lang) {
|
||||
lang = cc_node->lang;
|
||||
break;
|
||||
|
@ -864,9 +866,9 @@ gst_dash_demux_setup_all_streams (GstDashDemux * demux)
|
|||
active_stream->cur_adapt_set->RepresentationBase &&
|
||||
active_stream->cur_adapt_set->RepresentationBase->ContentProtection) {
|
||||
GST_DEBUG_OBJECT (demux, "Adding ContentProtection events to source pad");
|
||||
g_list_foreach (active_stream->cur_adapt_set->RepresentationBase->
|
||||
ContentProtection, gst_dash_demux_send_content_protection_event,
|
||||
stream);
|
||||
g_list_foreach (active_stream->cur_adapt_set->
|
||||
RepresentationBase->ContentProtection,
|
||||
gst_dash_demux_send_content_protection_event, stream);
|
||||
}
|
||||
|
||||
gst_isoff_sidx_parser_init (&stream->sidx_parser);
|
||||
|
@ -878,7 +880,7 @@ gst_dash_demux_setup_all_streams (GstDashDemux * demux)
|
|||
static void
|
||||
gst_dash_demux_send_content_protection_event (gpointer data, gpointer userdata)
|
||||
{
|
||||
GstDescriptorType *cp = (GstDescriptorType *) data;
|
||||
GstMPDDescriptorType *cp = (GstMPDDescriptorType *) data;
|
||||
GstDashDemuxStream *stream = (GstDashDemuxStream *) userdata;
|
||||
GstEvent *event;
|
||||
GstBuffer *pssi;
|
||||
|
@ -939,7 +941,7 @@ gst_dash_demux_setup_streams (GstAdaptiveDemux * demux)
|
|||
period_idx = 0;
|
||||
if (gst_mpd_client_is_live (dashdemux->client)) {
|
||||
GDateTime *g_now;
|
||||
if (dashdemux->client->mpd_node->availabilityStartTime == NULL) {
|
||||
if (dashdemux->client->mpd_root_node->availabilityStartTime == NULL) {
|
||||
ret = FALSE;
|
||||
GST_ERROR_OBJECT (demux, "MPD does not have availabilityStartTime");
|
||||
goto done;
|
||||
|
@ -958,9 +960,9 @@ gst_dash_demux_setup_streams (GstAdaptiveDemux * demux)
|
|||
/* get period index for period encompassing the current time */
|
||||
g_now = gst_dash_demux_get_server_now_utc (dashdemux);
|
||||
now = gst_date_time_new_from_g_date_time (g_now);
|
||||
if (dashdemux->client->mpd_node->suggestedPresentationDelay != -1) {
|
||||
if (dashdemux->client->mpd_root_node->suggestedPresentationDelay != -1) {
|
||||
GstDateTime *target = gst_mpd_client_add_time_difference (now,
|
||||
dashdemux->client->mpd_node->suggestedPresentationDelay * -1000);
|
||||
dashdemux->client->mpd_root_node->suggestedPresentationDelay * -1000);
|
||||
gst_date_time_unref (now);
|
||||
now = target;
|
||||
} else if (dashdemux->default_presentation_delay) {
|
||||
|
@ -2215,7 +2217,7 @@ gst_dash_demux_stream_select_bitrate (GstAdaptiveDemuxStream * stream,
|
|||
new_index = gst_mpd_client_get_rep_idx_with_min_bandwidth (rep_list);
|
||||
|
||||
if (new_index != active_stream->representation_idx) {
|
||||
GstRepresentationNode *rep = g_list_nth_data (rep_list, new_index);
|
||||
GstMPDRepresentationNode *rep = g_list_nth_data (rep_list, new_index);
|
||||
GST_INFO_OBJECT (demux, "Changing representation idx: %d %d %u",
|
||||
dashstream->index, new_index, rep->bandwidth);
|
||||
if (gst_mpd_client_setup_representation (demux->client, active_stream, rep)) {
|
||||
|
@ -2384,7 +2386,7 @@ static gint64
|
|||
gst_dash_demux_get_manifest_update_interval (GstAdaptiveDemux * demux)
|
||||
{
|
||||
GstDashDemux *dashdemux = GST_DASH_DEMUX_CAST (demux);
|
||||
return MIN (dashdemux->client->mpd_node->minimumUpdatePeriod * 1000,
|
||||
return MIN (dashdemux->client->mpd_root_node->minimumUpdatePeriod * 1000,
|
||||
SLOW_CLOCK_UPDATE_INTERVAL);
|
||||
}
|
||||
|
||||
|
@ -2393,7 +2395,7 @@ gst_dash_demux_update_manifest_data (GstAdaptiveDemux * demux,
|
|||
GstBuffer * buffer)
|
||||
{
|
||||
GstDashDemux *dashdemux = GST_DASH_DEMUX_CAST (demux);
|
||||
GstMpdClient *new_client = NULL;
|
||||
GstMPDClient *new_client = NULL;
|
||||
GstMapInfo mapinfo;
|
||||
|
||||
GST_DEBUG_OBJECT (demux, "Updating manifest file from URL");
|
||||
|
@ -2956,8 +2958,8 @@ gst_dash_demux_parse_isobmff (GstAdaptiveDemux * demux,
|
|||
}
|
||||
}
|
||||
dash_stream->sidx_position =
|
||||
SIDX (dash_stream)->entries[SIDX (dash_stream)->
|
||||
entry_index].pts;
|
||||
SIDX (dash_stream)->entries[SIDX (dash_stream)->entry_index].
|
||||
pts;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3104,8 +3106,8 @@ gst_dash_demux_find_sync_samples (GstAdaptiveDemux * demux,
|
|||
} else if ((trun->flags & GST_TRUN_FLAGS_FIRST_SAMPLE_FLAGS_PRESENT)
|
||||
&& k == 0) {
|
||||
sample_flags = trun->first_sample_flags;
|
||||
} else if (traf->
|
||||
tfhd.flags & GST_TFHD_FLAGS_DEFAULT_SAMPLE_FLAGS_PRESENT) {
|
||||
} else if (traf->tfhd.
|
||||
flags & GST_TFHD_FLAGS_DEFAULT_SAMPLE_FLAGS_PRESENT) {
|
||||
sample_flags = traf->tfhd.default_sample_flags;
|
||||
} else {
|
||||
trex_sample_flags = TRUE;
|
||||
|
@ -3115,8 +3117,8 @@ gst_dash_demux_find_sync_samples (GstAdaptiveDemux * demux,
|
|||
#if 0
|
||||
if (trun->flags & GST_TRUN_FLAGS_SAMPLE_DURATION_PRESENT) {
|
||||
sample_duration = sample->sample_duration;
|
||||
} else if (traf->
|
||||
tfhd.flags & GST_TFHD_FLAGS_DEFAULT_SAMPLE_DURATION_PRESENT) {
|
||||
} else if (traf->tfhd.
|
||||
flags & GST_TFHD_FLAGS_DEFAULT_SAMPLE_DURATION_PRESENT) {
|
||||
sample_duration = traf->tfhd.default_sample_duration;
|
||||
} else {
|
||||
GST_FIXME_OBJECT (stream->pad,
|
||||
|
@ -3129,8 +3131,8 @@ gst_dash_demux_find_sync_samples (GstAdaptiveDemux * demux,
|
|||
|
||||
if (trun->flags & GST_TRUN_FLAGS_SAMPLE_SIZE_PRESENT) {
|
||||
prev_sample_end += sample->sample_size;
|
||||
} else if (traf->
|
||||
tfhd.flags & GST_TFHD_FLAGS_DEFAULT_SAMPLE_SIZE_PRESENT) {
|
||||
} else if (traf->tfhd.
|
||||
flags & GST_TFHD_FLAGS_DEFAULT_SAMPLE_SIZE_PRESENT) {
|
||||
prev_sample_end += traf->tfhd.default_sample_size;
|
||||
} else {
|
||||
GST_FIXME_OBJECT (stream->pad,
|
||||
|
|
|
@ -125,7 +125,7 @@ struct _GstDashDemux
|
|||
|
||||
GSList *next_periods;
|
||||
|
||||
GstMpdClient *client; /* MPD client */
|
||||
GstMPDClient *client; /* MPD client */
|
||||
GMutex client_lock;
|
||||
|
||||
GstDashDemuxClockDrift *clock_drift;
|
||||
|
|
127
ext/dash/gstmpdadaptationsetnode.c
Normal file
127
ext/dash/gstmpdadaptationsetnode.c
Normal file
|
@ -0,0 +1,127 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdadaptationsetnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDAdaptationSetNode, gst_mpd_adaptation_set_node,
|
||||
GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_adaptation_set_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDAdaptationSetNode *self = GST_MPD_ADAPTATION_SET_NODE (object);
|
||||
|
||||
if (self->lang)
|
||||
xmlFree (self->lang);
|
||||
if (self->contentType)
|
||||
xmlFree (self->contentType);
|
||||
g_slice_free (GstXMLRatio, self->par);
|
||||
g_slice_free (GstXMLConditionalUintType, self->segmentAlignment);
|
||||
g_slice_free (GstXMLConditionalUintType, self->subsegmentAlignment);
|
||||
g_list_free_full (self->Accessibility,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
g_list_free_full (self->Role,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
g_list_free_full (self->Rating,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
g_list_free_full (self->Viewpoint,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
gst_mpd_helper_representation_base_type_free (self->RepresentationBase);
|
||||
gst_mpd_helper_segment_base_type_free (self->SegmentBase);
|
||||
gst_mpd_segment_list_node_free (self->SegmentList);
|
||||
gst_mpd_segment_template_node_free (self->SegmentTemplate);
|
||||
g_list_free_full (self->BaseURLs, (GDestroyNotify) gst_mpd_baseurl_node_free);
|
||||
g_list_free_full (self->Representations,
|
||||
(GDestroyNotify) gst_mpd_representation_node_free);
|
||||
g_list_free_full (self->ContentComponents,
|
||||
(GDestroyNotify) gst_mpd_content_component_node_free);
|
||||
if (self->xlink_href)
|
||||
xmlFree (self->xlink_href);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_adaptation_set_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_adaptation_set_node_class_init (GstMPDAdaptationSetNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_adaptation_set_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_adaptation_set_node_init (GstMPDAdaptationSetNode * self)
|
||||
{
|
||||
self->id = 0;
|
||||
self->group = 0;
|
||||
self->lang = NULL; /* LangVectorType RFC 5646 */
|
||||
self->contentType = NULL;
|
||||
self->par = 0;
|
||||
self->minBandwidth = 0;
|
||||
self->maxBandwidth = 0;
|
||||
self->minWidth = 0;
|
||||
self->maxWidth = 0;
|
||||
self->minHeight = 0;
|
||||
self->maxHeight = 0;
|
||||
self->segmentAlignment = NULL;
|
||||
self->subsegmentAlignment = NULL;
|
||||
self->subsegmentStartsWithSAP = GST_SAP_TYPE_0;
|
||||
self->bitstreamSwitching = FALSE;
|
||||
/* list of Accessibility DescriptorType nodes */
|
||||
self->Accessibility = NULL;
|
||||
/* list of Role DescriptorType nodes */
|
||||
self->Role = NULL;
|
||||
/* list of Rating DescriptorType nodes */
|
||||
self->Rating = NULL;
|
||||
/* list of Viewpoint DescriptorType nodes */
|
||||
self->Viewpoint = NULL;
|
||||
/* RepresentationBase extension */
|
||||
self->RepresentationBase = NULL;
|
||||
/* SegmentBase node */
|
||||
self->SegmentBase = NULL;
|
||||
/* SegmentList node */
|
||||
self->SegmentList = NULL;
|
||||
/* SegmentTemplate node */
|
||||
self->SegmentTemplate = NULL;
|
||||
/* list of BaseURL nodes */
|
||||
self->BaseURLs = NULL;
|
||||
/* list of Representation nodes */
|
||||
self->Representations = NULL;
|
||||
/* list of ContentComponent nodes */
|
||||
self->ContentComponents = NULL;
|
||||
|
||||
self->xlink_href = NULL;
|
||||
self->actuate = GST_MPD_XLINK_ACTUATE_ON_REQUEST;
|
||||
}
|
||||
|
||||
GstMPDAdaptationSetNode *
|
||||
gst_mpd_adaptation_set_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_ADAPTATION_SET_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_adaptation_set_node_free (GstMPDAdaptationSetNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
104
ext/dash/gstmpdadaptationsetnode.h
Normal file
104
ext/dash/gstmpdadaptationsetnode.h
Normal file
|
@ -0,0 +1,104 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDADAPTATIONSETNODE_H__
|
||||
#define __GSTMPDADAPTATIONSETNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
#include "gstmpdsegmentlistnode.h"
|
||||
#include "gstmpdsegmenttemplatenode.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_ADAPTATION_SET_NODE gst_mpd_adaptation_set_node_get_type ()
|
||||
#define GST_MPD_ADAPTATION_SET_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_ADAPTATION_SET_NODE, GstMPDAdaptationSetNode))
|
||||
#define GST_MPD_ADAPTATION_SET_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_ADAPTATION_SET_NODE, GstMPDAdaptationSetNodeClass))
|
||||
#define GST_IS_MPD_ADAPTATION_SET_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_ADAPTATION_SET_NODE))
|
||||
#define GST_IS_MPD_ADAPTATION_SET_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_ADAPTATION_SET_NODE))
|
||||
#define GST_MPD_ADAPTATION_SET_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_ADAPTATION_SET_NODE, GstMPDAdaptationSetNodeClass))
|
||||
|
||||
typedef struct _GstMPDAdaptationSetNode GstMPDAdaptationSetNode;
|
||||
typedef struct _GstMPDAdaptationSetNodeClass GstMPDAdaptationSetNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDAdaptationSetNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
guint id;
|
||||
guint group;
|
||||
gchar *lang; /* LangVectorType RFC 5646 */
|
||||
gchar *contentType;
|
||||
GstXMLRatio *par;
|
||||
guint minBandwidth;
|
||||
guint maxBandwidth;
|
||||
guint minWidth;
|
||||
guint maxWidth;
|
||||
guint minHeight;
|
||||
guint maxHeight;
|
||||
GstXMLConditionalUintType *segmentAlignment;
|
||||
GstXMLConditionalUintType *subsegmentAlignment;
|
||||
GstMPDSAPType subsegmentStartsWithSAP;
|
||||
gboolean bitstreamSwitching;
|
||||
/* list of Accessibility DescriptorType nodes */
|
||||
GList *Accessibility;
|
||||
/* list of Role DescriptorType nodes */
|
||||
GList *Role;
|
||||
/* list of Rating DescriptorType nodes */
|
||||
GList *Rating;
|
||||
/* list of Viewpoint DescriptorType nodes */
|
||||
GList *Viewpoint;
|
||||
/* RepresentationBase extension */
|
||||
GstMPDRepresentationBaseType *RepresentationBase;
|
||||
/* SegmentBase node */
|
||||
GstMPDSegmentBaseType *SegmentBase;
|
||||
/* SegmentList node */
|
||||
GstMPDSegmentListNode *SegmentList;
|
||||
/* SegmentTemplate node */
|
||||
GstMPDSegmentTemplateNode *SegmentTemplate;
|
||||
/* list of BaseURL nodes */
|
||||
GList *BaseURLs;
|
||||
/* list of Representation nodes */
|
||||
GList *Representations;
|
||||
/* list of ContentComponent nodes */
|
||||
GList *ContentComponents;
|
||||
|
||||
gchar *xlink_href;
|
||||
GstMPDXLinkActuate actuate;
|
||||
};
|
||||
|
||||
struct _GstMPDAdaptationSetNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_adaptation_set_node_get_type (void);
|
||||
|
||||
GstMPDAdaptationSetNode * gst_mpd_adaptation_set_node_new (void);
|
||||
void gst_mpd_adaptation_set_node_free (GstMPDAdaptationSetNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDADAPTATIONSETNODE_H__ */
|
66
ext/dash/gstmpdbaseurlnode.c
Normal file
66
ext/dash/gstmpdbaseurlnode.c
Normal file
|
@ -0,0 +1,66 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdbaseurlnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDBaseURLNode, gst_mpd_baseurl_node, GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_baseurl_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDBaseURLNode *self = GST_MPD_BASEURL_NODE (object);
|
||||
|
||||
g_free (self->baseURL);
|
||||
g_free (self->serviceLocation);
|
||||
g_free (self->byteRange);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_baseurl_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_baseurl_node_class_init (GstMPDBaseURLNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_baseurl_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_baseurl_node_init (GstMPDBaseURLNode * self)
|
||||
{
|
||||
self->baseURL = NULL;
|
||||
self->serviceLocation = NULL;
|
||||
self->byteRange = NULL;
|
||||
}
|
||||
|
||||
GstMPDBaseURLNode *
|
||||
gst_mpd_baseurl_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_BASEURL_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_baseurl_node_free (GstMPDBaseURLNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
66
ext/dash/gstmpdbaseurlnode.h
Normal file
66
ext/dash/gstmpdbaseurlnode.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDBASEURLNODE_H__
|
||||
#define __GSTMPDBASEURLNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_BASEURL_NODE gst_mpd_baseurl_node_get_type ()
|
||||
#define GST_MPD_BASEURL_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_BASEURL_NODE, GstMPDBaseURLNode))
|
||||
#define GST_MPD_BASEURL_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_BASEURL_NODE, GstMPDBaseURLNodeClass))
|
||||
#define GST_IS_MPD_BASEURL_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_BASEURL_NODE))
|
||||
#define GST_IS_MPD_BASEURL_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_BASEURL_NODE))
|
||||
#define GST_MPD_BASEURL_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_BASEURL_NODE, GstMPDBaseURLNodeClass))
|
||||
|
||||
typedef struct _GstMPDBaseURLNode GstMPDBaseURLNode;
|
||||
typedef struct _GstMPDBaseURLNodeClass GstMPDBaseURLNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDBaseURLNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
gchar *baseURL;
|
||||
gchar *serviceLocation;
|
||||
gchar *byteRange;
|
||||
/* TODO add missing fields such as weight etc.*/
|
||||
};
|
||||
|
||||
struct _GstMPDBaseURLNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_baseurl_node_get_type (void);
|
||||
|
||||
GstMPDBaseURLNode * gst_mpd_baseurl_node_new (void);
|
||||
void gst_mpd_baseurl_node_free (GstMPDBaseURLNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDBASEURLNODE_H__ */
|
File diff suppressed because it is too large
Load diff
|
@ -25,14 +25,13 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_MPD_CLIENT_LOCK(c) g_mutex_lock (&c->lock);
|
||||
#define GST_MPD_CLIENT_UNLOCK(c) g_mutex_unlock (&c->lock);
|
||||
#define GST_TYPE_MPD_CLIENT gst_mpd_client_get_type ()
|
||||
G_DECLARE_FINAL_TYPE (GstMPDClient, gst_mpd_client, GST, MPD_CLIENT, GstObject)
|
||||
|
||||
typedef struct _GstMpdClient GstMpdClient;
|
||||
|
||||
struct _GstMpdClient
|
||||
struct _GstMPDClient
|
||||
{
|
||||
GstMPDNode *mpd_node; /* active MPD manifest file */
|
||||
GstObject parent_instance;
|
||||
GstMPDRootNode *mpd_root_node; /* mpd root node */
|
||||
|
||||
GList *periods; /* list of GstStreamPeriod */
|
||||
guint period_idx; /* index of current Period */
|
||||
|
@ -51,71 +50,71 @@ struct _GstMpdClient
|
|||
};
|
||||
|
||||
/* Basic initialization/deinitialization functions */
|
||||
GstMpdClient *gst_mpd_client_new (void);
|
||||
void gst_mpd_client_active_streams_free (GstMpdClient * client);
|
||||
void gst_mpd_client_free (GstMpdClient * client);
|
||||
GstMPDClient *gst_mpd_client_new (void);
|
||||
void gst_mpd_client_active_streams_free (GstMPDClient * client);
|
||||
void gst_mpd_client_free (GstMPDClient * client);
|
||||
|
||||
/* main mpd parsing methods from xml data */
|
||||
gboolean gst_mpd_client_parse (GstMpdClient * client, const gchar * data, gint size);
|
||||
gboolean gst_mpd_client_parse (GstMPDClient * client, const gchar * data, gint size);
|
||||
|
||||
void gst_mpd_client_set_uri_downloader (GstMpdClient * client, GstUriDownloader * download);
|
||||
void gst_mpd_client_check_profiles (GstMpdClient * client);
|
||||
void gst_mpd_client_fetch_on_load_external_resources (GstMpdClient * client);
|
||||
void gst_mpd_client_set_uri_downloader (GstMPDClient * client, GstUriDownloader * download);
|
||||
void gst_mpd_client_check_profiles (GstMPDClient * client);
|
||||
void gst_mpd_client_fetch_on_load_external_resources (GstMPDClient * client);
|
||||
|
||||
/* Streaming management */
|
||||
gboolean gst_mpd_client_setup_media_presentation (GstMpdClient *client, GstClockTime time, gint period_index, const gchar *period_id);
|
||||
gboolean gst_mpd_client_setup_streaming (GstMpdClient * client, GstAdaptationSetNode * adapt_set);
|
||||
gboolean gst_mpd_client_setup_representation (GstMpdClient *client, GstActiveStream *stream, GstRepresentationNode *representation);
|
||||
gboolean gst_mpd_client_setup_media_presentation (GstMPDClient *client, GstClockTime time, gint period_index, const gchar *period_id);
|
||||
gboolean gst_mpd_client_setup_streaming (GstMPDClient * client, GstMPDAdaptationSetNode * adapt_set);
|
||||
gboolean gst_mpd_client_setup_representation (GstMPDClient *client, GstActiveStream *stream, GstMPDRepresentationNode *representation);
|
||||
|
||||
GstClockTime gst_mpd_client_get_next_fragment_duration (GstMpdClient * client, GstActiveStream * stream);
|
||||
GstClockTime gst_mpd_client_get_media_presentation_duration (GstMpdClient *client);
|
||||
GstClockTime gst_mpd_client_get_maximum_segment_duration (GstMpdClient * client);
|
||||
gboolean gst_mpd_client_get_last_fragment_timestamp_end (GstMpdClient * client, guint stream_idx, GstClockTime * ts);
|
||||
gboolean gst_mpd_client_get_next_fragment_timestamp (GstMpdClient * client, guint stream_idx, GstClockTime * ts);
|
||||
gboolean gst_mpd_client_get_next_fragment (GstMpdClient *client, guint indexStream, GstMediaFragmentInfo * fragment);
|
||||
gboolean gst_mpd_client_get_next_header (GstMpdClient *client, gchar **uri, guint stream_idx, gint64 * range_start, gint64 * range_end);
|
||||
gboolean gst_mpd_client_get_next_header_index (GstMpdClient *client, gchar **uri, guint stream_idx, gint64 * range_start, gint64 * range_end);
|
||||
gboolean gst_mpd_client_is_live (GstMpdClient * client);
|
||||
gboolean gst_mpd_client_stream_seek (GstMpdClient * client, GstActiveStream * stream, gboolean forward, GstSeekFlags flags, GstClockTime ts, GstClockTime * final_ts);
|
||||
gboolean gst_mpd_client_seek_to_time (GstMpdClient * client, GDateTime * time);
|
||||
GstClockTime gst_mpd_client_get_stream_presentation_offset (GstMpdClient *client, guint stream_idx);
|
||||
gchar** gst_mpd_client_get_utc_timing_sources (GstMpdClient *client, guint methods, GstMPDUTCTimingType *selected_method);
|
||||
GstClockTime gst_mpd_client_get_period_start_time (GstMpdClient *client);
|
||||
GstClockTime gst_mpd_client_get_next_fragment_duration (GstMPDClient * client, GstActiveStream * stream);
|
||||
GstClockTime gst_mpd_client_get_media_presentation_duration (GstMPDClient *client);
|
||||
GstClockTime gst_mpd_client_get_maximum_segment_duration (GstMPDClient * client);
|
||||
gboolean gst_mpd_client_get_last_fragment_timestamp_end (GstMPDClient * client, guint stream_idx, GstClockTime * ts);
|
||||
gboolean gst_mpd_client_get_next_fragment_timestamp (GstMPDClient * client, guint stream_idx, GstClockTime * ts);
|
||||
gboolean gst_mpd_client_get_next_fragment (GstMPDClient *client, guint indexStream, GstMediaFragmentInfo * fragment);
|
||||
gboolean gst_mpd_client_get_next_header (GstMPDClient *client, gchar **uri, guint stream_idx, gint64 * range_start, gint64 * range_end);
|
||||
gboolean gst_mpd_client_get_next_header_index (GstMPDClient *client, gchar **uri, guint stream_idx, gint64 * range_start, gint64 * range_end);
|
||||
gboolean gst_mpd_client_is_live (GstMPDClient * client);
|
||||
gboolean gst_mpd_client_stream_seek (GstMPDClient * client, GstActiveStream * stream, gboolean forward, GstSeekFlags flags, GstClockTime ts, GstClockTime * final_ts);
|
||||
gboolean gst_mpd_client_seek_to_time (GstMPDClient * client, GDateTime * time);
|
||||
GstClockTime gst_mpd_client_get_stream_presentation_offset (GstMPDClient *client, guint stream_idx);
|
||||
gchar** gst_mpd_client_get_utc_timing_sources (GstMPDClient *client, guint methods, GstMPDUTCTimingType *selected_method);
|
||||
GstClockTime gst_mpd_client_get_period_start_time (GstMPDClient *client);
|
||||
|
||||
/* Period selection */
|
||||
guint gst_mpd_client_get_period_index_at_time (GstMpdClient * client, GstDateTime * time);
|
||||
gboolean gst_mpd_client_set_period_index (GstMpdClient *client, guint period_idx);
|
||||
gboolean gst_mpd_client_set_period_id (GstMpdClient *client, const gchar * period_id);
|
||||
guint gst_mpd_client_get_period_index (GstMpdClient *client);
|
||||
const gchar *gst_mpd_client_get_period_id (GstMpdClient *client);
|
||||
gboolean gst_mpd_client_has_next_period (GstMpdClient *client);
|
||||
gboolean gst_mpd_client_has_previous_period (GstMpdClient * client);
|
||||
guint gst_mpd_client_get_period_index_at_time (GstMPDClient * client, GstDateTime * time);
|
||||
gboolean gst_mpd_client_set_period_index (GstMPDClient *client, guint period_idx);
|
||||
gboolean gst_mpd_client_set_period_id (GstMPDClient *client, const gchar * period_id);
|
||||
guint gst_mpd_client_get_period_index (GstMPDClient *client);
|
||||
const gchar *gst_mpd_client_get_period_id (GstMPDClient *client);
|
||||
gboolean gst_mpd_client_has_next_period (GstMPDClient *client);
|
||||
gboolean gst_mpd_client_has_previous_period (GstMPDClient * client);
|
||||
|
||||
/* Representation selection */
|
||||
gint gst_mpd_client_get_rep_idx_with_max_bandwidth (GList *Representations, gint64 max_bandwidth, gint max_video_width, gint max_video_height, gint max_video_framerate_n, gint max_video_framerate_d);
|
||||
gint gst_mpd_client_get_rep_idx_with_min_bandwidth (GList * Representations);
|
||||
|
||||
GstDateTime *
|
||||
gst_mpd_client_get_availability_start_time (GstMpdClient * client);
|
||||
gst_mpd_client_get_availability_start_time (GstMPDClient * client);
|
||||
|
||||
/* URL management */
|
||||
const gchar *gst_mpd_client_get_baseURL (GstMpdClient *client, guint indexStream);
|
||||
gchar *gst_mpd_client_parse_baseURL (GstMpdClient * client, GstActiveStream * stream, gchar ** query);
|
||||
const gchar *gst_mpd_client_get_baseURL (GstMPDClient *client, guint indexStream);
|
||||
gchar *gst_mpd_client_parse_baseURL (GstMPDClient * client, GstActiveStream * stream, gchar ** query);
|
||||
|
||||
/* Active stream */
|
||||
guint gst_mpd_client_get_nb_active_stream (GstMpdClient *client);
|
||||
GstActiveStream *gst_mpd_client_get_active_stream_by_index (GstMpdClient *client, guint stream_idx);
|
||||
guint gst_mpd_client_get_nb_active_stream (GstMPDClient *client);
|
||||
GstActiveStream *gst_mpd_client_get_active_stream_by_index (GstMPDClient *client, guint stream_idx);
|
||||
gboolean gst_mpd_client_active_stream_contains_subtitles (GstActiveStream * stream);
|
||||
|
||||
/* AdaptationSet */
|
||||
guint gst_mpd_client_get_nb_adaptationSet (GstMpdClient *client);
|
||||
GList * gst_mpd_client_get_adaptation_sets (GstMpdClient * client);
|
||||
guint gst_mpd_client_get_nb_adaptationSet (GstMPDClient *client);
|
||||
GList * gst_mpd_client_get_adaptation_sets (GstMPDClient * client);
|
||||
|
||||
/* Segment */
|
||||
gboolean gst_mpd_client_has_next_segment (GstMpdClient * client, GstActiveStream * stream, gboolean forward);
|
||||
GstFlowReturn gst_mpd_client_advance_segment (GstMpdClient * client, GstActiveStream * stream, gboolean forward);
|
||||
void gst_mpd_client_seek_to_first_segment (GstMpdClient * client);
|
||||
GstDateTime *gst_mpd_client_get_next_segment_availability_start_time (GstMpdClient * client, GstActiveStream * stream);
|
||||
gboolean gst_mpd_client_has_next_segment (GstMPDClient * client, GstActiveStream * stream, gboolean forward);
|
||||
GstFlowReturn gst_mpd_client_advance_segment (GstMPDClient * client, GstActiveStream * stream, gboolean forward);
|
||||
void gst_mpd_client_seek_to_first_segment (GstMPDClient * client);
|
||||
GstDateTime *gst_mpd_client_get_next_segment_availability_start_time (GstMPDClient * client, GstActiveStream * stream);
|
||||
|
||||
/* Get audio/video stream parameters (caps, width, height, rate, number of channels) */
|
||||
GstCaps * gst_mpd_client_get_stream_caps (GstActiveStream * stream);
|
||||
|
@ -127,14 +126,14 @@ guint gst_mpd_client_get_audio_stream_rate (GstActiveStream * stream);
|
|||
guint gst_mpd_client_get_audio_stream_num_channels (GstActiveStream * stream);
|
||||
|
||||
/* Support multi language */
|
||||
guint gst_mpd_client_get_list_and_nb_of_audio_language (GstMpdClient *client, GList **lang);
|
||||
guint gst_mpd_client_get_list_and_nb_of_audio_language (GstMPDClient *client, GList **lang);
|
||||
|
||||
gint64 gst_mpd_client_calculate_time_difference (const GstDateTime * t1, const GstDateTime * t2);
|
||||
GstDateTime *gst_mpd_client_add_time_difference (GstDateTime * t1, gint64 usecs);
|
||||
gint64 gst_mpd_client_parse_default_presentation_delay(GstMpdClient * client, const gchar * default_presentation_delay);
|
||||
gint64 gst_mpd_client_parse_default_presentation_delay(GstMPDClient * client, const gchar * default_presentation_delay);
|
||||
|
||||
/* profiles */
|
||||
gboolean gst_mpd_client_has_isoff_ondemand_profile (GstMpdClient *client);
|
||||
gboolean gst_mpd_client_has_isoff_ondemand_profile (GstMPDClient *client);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
85
ext/dash/gstmpdcontentcomponentnode.c
Normal file
85
ext/dash/gstmpdcontentcomponentnode.c
Normal file
|
@ -0,0 +1,85 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdcontentcomponentnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GstMPDContentComponentNode, gst_mpd_content_component_node,
|
||||
GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_content_component_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDContentComponentNode *self = GST_MPD_CONTENT_COMPONENT_NODE (object);
|
||||
|
||||
if (self->lang)
|
||||
xmlFree (self->lang);
|
||||
if (self->contentType)
|
||||
xmlFree (self->contentType);
|
||||
g_slice_free (GstXMLRatio, self->par);
|
||||
g_list_free_full (self->Accessibility,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
g_list_free_full (self->Role,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
g_list_free_full (self->Rating,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
g_list_free_full (self->Viewpoint,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_content_component_node_parent_class)->finalize
|
||||
(object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_content_component_node_class_init (GstMPDContentComponentNodeClass *
|
||||
klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_content_component_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_content_component_node_init (GstMPDContentComponentNode * self)
|
||||
{
|
||||
self->id = 0;
|
||||
self->lang = NULL;
|
||||
self->contentType = NULL;
|
||||
self->par = 0;
|
||||
self->Accessibility = 0;
|
||||
self->Role = NULL;
|
||||
self->Rating = NULL;
|
||||
self->Viewpoint = NULL;
|
||||
}
|
||||
|
||||
GstMPDContentComponentNode *
|
||||
gst_mpd_content_component_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_CONTENT_COMPONENT_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_content_component_node_free (GstMPDContentComponentNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
74
ext/dash/gstmpdcontentcomponentnode.h
Normal file
74
ext/dash/gstmpdcontentcomponentnode.h
Normal file
|
@ -0,0 +1,74 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDCONTENTCOMPONENTNODE_H__
|
||||
#define __GSTMPDCONTENTCOMPONENTNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_CONTENT_COMPONENT_NODE gst_mpd_content_component_node_get_type ()
|
||||
#define GST_MPD_CONTENT_COMPONENT_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_CONTENT_COMPONENT_NODE, GstMPDContentComponentNode))
|
||||
#define GST_MPD_CONTENT_COMPONENT_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_CONTENT_COMPONENT_NODE, GstMPDContentComponentNodeClass))
|
||||
#define GST_IS_MPD_CONTENT_COMPONENT_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_CONTENT_COMPONENT_NODE))
|
||||
#define GST_IS_MPD_CONTENT_COMPONENT_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_CONTENT_COMPONENT_NODE))
|
||||
#define GST_MPD_CONTENT_COMPONENT_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_CONTENT_COMPONENT_NODE, GstMPDContentComponentNodeClass))
|
||||
|
||||
typedef struct _GstMPDContentComponentNode GstMPDContentComponentNode;
|
||||
typedef struct _GstMPDContentComponentNodeClass GstMPDContentComponentNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDContentComponentNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
guint id;
|
||||
gchar *lang; /* LangVectorType RFC 5646 */
|
||||
gchar *contentType;
|
||||
GstXMLRatio *par;
|
||||
/* list of Accessibility DescriptorType nodes */
|
||||
GList *Accessibility;
|
||||
/* list of Role DescriptorType nodes */
|
||||
GList *Role;
|
||||
/* list of Rating DescriptorType nodes */
|
||||
GList *Rating;
|
||||
/* list of Viewpoint DescriptorType nodes */
|
||||
GList *Viewpoint;
|
||||
};
|
||||
|
||||
struct _GstMPDContentComponentNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_content_component_node_get_type (void);
|
||||
|
||||
GstMPDContentComponentNode * gst_mpd_content_component_node_new (void);
|
||||
void gst_mpd_content_component_node_free (GstMPDContentComponentNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDCONTENTCOMPONENTNODE_H__ */
|
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
|
||||
#include "gstmpdhelper.h"
|
||||
#include "gstmpdbaseurlnode.h"
|
||||
|
||||
gboolean
|
||||
gst_mpd_helper_get_mpd_type (xmlNode * a_node,
|
||||
|
@ -76,3 +77,162 @@ gst_mpd_helper_get_SAP_type (xmlNode * a_node,
|
|||
|
||||
return exists;
|
||||
}
|
||||
|
||||
GstMPDURLType *
|
||||
gst_mpd_helper_URLType_clone (GstMPDURLType * url)
|
||||
{
|
||||
|
||||
GstMPDURLType *clone = NULL;
|
||||
|
||||
if (url) {
|
||||
clone = g_slice_new0 (GstMPDURLType);
|
||||
if (url->sourceURL) {
|
||||
clone->sourceURL = xmlMemStrdup (url->sourceURL);
|
||||
}
|
||||
clone->range = gst_xml_helper_clone_range (url->range);
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_helper_url_type_node_free (GstMPDURLType * url_type_node)
|
||||
{
|
||||
if (url_type_node) {
|
||||
if (url_type_node->sourceURL)
|
||||
xmlFree (url_type_node->sourceURL);
|
||||
g_slice_free (GstXMLRange, url_type_node->range);
|
||||
g_slice_free (GstMPDURLType, url_type_node);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_helper_descriptor_type_free (GstMPDDescriptorType * descriptor_type)
|
||||
{
|
||||
if (descriptor_type) {
|
||||
if (descriptor_type->schemeIdUri)
|
||||
xmlFree (descriptor_type->schemeIdUri);
|
||||
if (descriptor_type->value)
|
||||
xmlFree (descriptor_type->value);
|
||||
g_slice_free (GstMPDDescriptorType, descriptor_type);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_helper_segment_base_type_free (GstMPDSegmentBaseType * seg_base_type)
|
||||
{
|
||||
if (seg_base_type) {
|
||||
if (seg_base_type->indexRange)
|
||||
g_slice_free (GstXMLRange, seg_base_type->indexRange);
|
||||
gst_mpd_helper_url_type_node_free (seg_base_type->Initialization);
|
||||
gst_mpd_helper_url_type_node_free (seg_base_type->RepresentationIndex);
|
||||
g_slice_free (GstMPDSegmentBaseType, seg_base_type);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_helper_mult_seg_base_type_free (GstMPDMultSegmentBaseType *
|
||||
mult_seg_base_type)
|
||||
{
|
||||
if (mult_seg_base_type) {
|
||||
/* SegmentBaseType extension */
|
||||
gst_mpd_helper_segment_base_type_free (mult_seg_base_type->SegBaseType);
|
||||
gst_mpd_segment_timeline_node_free (mult_seg_base_type->SegmentTimeline);
|
||||
gst_mpd_helper_url_type_node_free (mult_seg_base_type->BitstreamSwitching);
|
||||
g_slice_free (GstMPDMultSegmentBaseType, mult_seg_base_type);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_helper_representation_base_type_free (GstMPDRepresentationBaseType *
|
||||
representation_base)
|
||||
{
|
||||
if (representation_base) {
|
||||
if (representation_base->profiles)
|
||||
xmlFree (representation_base->profiles);
|
||||
g_slice_free (GstXMLRatio, representation_base->sar);
|
||||
g_slice_free (GstXMLFrameRate, representation_base->frameRate);
|
||||
g_slice_free (GstXMLFrameRate, representation_base->minFrameRate);
|
||||
g_slice_free (GstXMLFrameRate, representation_base->maxFrameRate);
|
||||
if (representation_base->audioSamplingRate)
|
||||
xmlFree (representation_base->audioSamplingRate);
|
||||
if (representation_base->mimeType)
|
||||
xmlFree (representation_base->mimeType);
|
||||
if (representation_base->segmentProfiles)
|
||||
xmlFree (representation_base->segmentProfiles);
|
||||
if (representation_base->codecs)
|
||||
xmlFree (representation_base->codecs);
|
||||
if (representation_base->scanType)
|
||||
xmlFree (representation_base->scanType);
|
||||
g_list_free_full (representation_base->FramePacking,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
g_list_free_full (representation_base->AudioChannelConfiguration,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
g_list_free_full (representation_base->ContentProtection,
|
||||
(GDestroyNotify) gst_mpd_helper_descriptor_type_free);
|
||||
g_slice_free (GstMPDRepresentationBaseType, representation_base);
|
||||
}
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gst_mpd_helper_mimetype_to_caps (const gchar * mimeType)
|
||||
{
|
||||
if (mimeType == NULL)
|
||||
return NULL;
|
||||
if (strcmp (mimeType, "video/mp2t") == 0) {
|
||||
return "video/mpegts, systemstream=(bool) true";
|
||||
} else if (strcmp (mimeType, "video/mp4") == 0) {
|
||||
return "video/quicktime";
|
||||
} else if (strcmp (mimeType, "audio/mp4") == 0) {
|
||||
return "audio/x-m4a";
|
||||
} else if (strcmp (mimeType, "text/vtt") == 0) {
|
||||
return "application/x-subtitle-vtt";
|
||||
} else
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
/*
|
||||
* Combine a base url with the current stream base url from the list of
|
||||
* baseURLs. Takes ownership of base and returns a new base.
|
||||
*/
|
||||
GstUri *
|
||||
gst_mpd_helper_combine_urls (GstUri * base, GList * list, gchar ** query,
|
||||
guint idx)
|
||||
{
|
||||
GstMPDBaseURLNode *baseURL;
|
||||
GstUri *ret = base;
|
||||
|
||||
if (list != NULL) {
|
||||
baseURL = g_list_nth_data (list, idx);
|
||||
if (!baseURL) {
|
||||
baseURL = list->data;
|
||||
}
|
||||
|
||||
ret = gst_uri_from_string_with_base (base, baseURL->baseURL);
|
||||
gst_uri_unref (base);
|
||||
|
||||
if (ret && query) {
|
||||
g_free (*query);
|
||||
*query = gst_uri_get_query_string (ret);
|
||||
if (*query) {
|
||||
ret = gst_uri_make_writable (ret);
|
||||
gst_uri_set_query_table (ret, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* comparison functions */
|
||||
int
|
||||
gst_mpd_helper_strncmp_ext (const char *s1, const char *s2)
|
||||
{
|
||||
if (s1 == NULL && s2 == NULL)
|
||||
return 0;
|
||||
if (s1 == NULL && s2 != NULL)
|
||||
return 1;
|
||||
if (s2 == NULL && s1 != NULL)
|
||||
return 1;
|
||||
return strncmp (s1, s2, strlen (s2));
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define __GST_MPDHELPER_H__
|
||||
|
||||
#include "gstxmlhelper.h"
|
||||
#include "gstmpdsegmenttimelinenode.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -42,8 +43,91 @@ typedef enum
|
|||
GST_SAP_TYPE_6
|
||||
} GstMPDSAPType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GST_MPD_XLINK_ACTUATE_ON_REQUEST,
|
||||
GST_MPD_XLINK_ACTUATE_ON_LOAD
|
||||
} GstMPDXLinkActuate;
|
||||
|
||||
typedef struct _GstMPDURLType
|
||||
{
|
||||
gchar *sourceURL;
|
||||
GstXMLRange *range;
|
||||
} GstMPDURLType;
|
||||
|
||||
typedef struct _GstMPDDescriptorType
|
||||
{
|
||||
gchar *schemeIdUri;
|
||||
gchar *value;
|
||||
} GstMPDDescriptorType;
|
||||
|
||||
typedef struct _GstMPDSegmentBaseType
|
||||
{
|
||||
guint timescale;
|
||||
guint64 presentationTimeOffset;
|
||||
GstXMLRange *indexRange;
|
||||
gboolean indexRangeExact;
|
||||
/* Initialization node */
|
||||
GstMPDURLType *Initialization;
|
||||
/* RepresentationIndex node */
|
||||
GstMPDURLType *RepresentationIndex;
|
||||
} GstMPDSegmentBaseType;
|
||||
|
||||
typedef struct _GstMPDMultSegmentBaseType
|
||||
{
|
||||
guint duration; /* in seconds */
|
||||
guint startNumber;
|
||||
/* SegmentBaseType extension */
|
||||
GstMPDSegmentBaseType *SegBaseType;
|
||||
/* SegmentTimeline node */
|
||||
GstMPDSegmentTimelineNode *SegmentTimeline;
|
||||
/* BitstreamSwitching node */
|
||||
GstMPDURLType *BitstreamSwitching;
|
||||
} GstMPDMultSegmentBaseType;
|
||||
|
||||
typedef struct _GstMPDRepresentationBaseType
|
||||
{
|
||||
gchar *profiles;
|
||||
guint width;
|
||||
guint height;
|
||||
GstXMLRatio *sar;
|
||||
GstXMLFrameRate *minFrameRate;
|
||||
GstXMLFrameRate *maxFrameRate;
|
||||
GstXMLFrameRate *frameRate;
|
||||
gchar *audioSamplingRate;
|
||||
gchar *mimeType;
|
||||
gchar *segmentProfiles;
|
||||
gchar *codecs;
|
||||
gdouble maximumSAPPeriod;
|
||||
GstMPDSAPType startWithSAP;
|
||||
gdouble maxPlayoutRate;
|
||||
gboolean codingDependency;
|
||||
gchar *scanType;
|
||||
/* list of FramePacking DescriptorType nodes */
|
||||
GList *FramePacking;
|
||||
/* list of AudioChannelConfiguration DescriptorType nodes */
|
||||
GList *AudioChannelConfiguration;
|
||||
/* list of ContentProtection DescriptorType nodes */
|
||||
GList *ContentProtection;
|
||||
} GstMPDRepresentationBaseType;
|
||||
|
||||
gboolean gst_mpd_helper_get_mpd_type (xmlNode * a_node, const gchar * property_name, GstMPDFileType * property_value);
|
||||
gboolean gst_mpd_helper_get_SAP_type (xmlNode * a_node, const gchar * property_name, GstMPDSAPType * property_value);
|
||||
|
||||
GstMPDURLType *gst_mpd_helper_URLType_clone (GstMPDURLType * url);
|
||||
void gst_mpd_helper_url_type_node_free (GstMPDURLType * url_type_node);
|
||||
void gst_mpd_helper_descriptor_type_free (GstMPDDescriptorType *
|
||||
descriptor_type);
|
||||
void gst_mpd_helper_segment_base_type_free (GstMPDSegmentBaseType * seg_base_type);
|
||||
void gst_mpd_helper_mult_seg_base_type_free (GstMPDMultSegmentBaseType *
|
||||
mult_seg_base_type);
|
||||
void
|
||||
gst_mpd_helper_representation_base_type_free (GstMPDRepresentationBaseType *
|
||||
representation_base);
|
||||
|
||||
const gchar * gst_mpd_helper_mimetype_to_caps (const gchar * mimeType);
|
||||
GstUri *gst_mpd_helper_combine_urls (GstUri * base, GList * list, gchar ** query, guint idx);
|
||||
int gst_mpd_helper_strncmp_ext (const char *s1, const char *s2);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_MPDHELPER_H__ */
|
||||
|
|
66
ext/dash/gstmpdmetricsnode.c
Normal file
66
ext/dash/gstmpdmetricsnode.c
Normal file
|
@ -0,0 +1,66 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdmetricsnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDMetricsNode, gst_mpd_metrics_node, GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_metrics_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDMetricsNode *self = GST_MPD_METRICS_NODE (object);
|
||||
|
||||
g_free (self->metrics);
|
||||
g_list_free_full (self->MetricsRanges,
|
||||
(GDestroyNotify) gst_mpd_metrics_range_node_free);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_metrics_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_metrics_node_class_init (GstMPDMetricsNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_metrics_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_metrics_node_init (GstMPDMetricsNode * self)
|
||||
{
|
||||
self->metrics = NULL;
|
||||
self->MetricsRanges = NULL;
|
||||
self->Reportings = NULL;
|
||||
}
|
||||
|
||||
GstMPDMetricsNode *
|
||||
gst_mpd_metrics_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_METRICS_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_metrics_node_free (GstMPDMetricsNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
71
ext/dash/gstmpdmetricsnode.h
Normal file
71
ext/dash/gstmpdmetricsnode.h
Normal file
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* No description.
|
||||
*
|
||||
* gstmpdmetricsnode.h
|
||||
*
|
||||
* Copyright (C) 2019 Collabora inc.
|
||||
* Authors:
|
||||
* Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDMETRICSNODE_H__
|
||||
#define __GSTMPDMETRICSNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_METRICS_NODE gst_mpd_metrics_node_get_type ()
|
||||
#define GST_MPD_METRICS_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_METRICS_NODE, GstMPDMetricsNode))
|
||||
#define GST_MPD_METRICS_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_METRICS_NODE, GstMPDMetricsNodeClass))
|
||||
#define GST_IS_MPD_METRICS_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_METRICS_NODE))
|
||||
#define GST_IS_MPD_METRICS_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_METRICS_NODE))
|
||||
#define GST_MPD_METRICS_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_METRICS_NODE, GstMPDMetricsNodeClass))
|
||||
|
||||
typedef struct _GstMPDMetricsNode GstMPDMetricsNode;
|
||||
typedef struct _GstMPDMetricsNodeClass GstMPDMetricsNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDMetricsNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
gchar *metrics;
|
||||
/* list of Metrics Range nodes */
|
||||
GList *MetricsRanges;
|
||||
/* list of Reporting nodes */
|
||||
GList *Reportings;
|
||||
};
|
||||
|
||||
struct _GstMPDMetricsNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_metrics_node_get_type (void);
|
||||
|
||||
GstMPDMetricsNode * gst_mpd_metrics_node_new (void);
|
||||
void gst_mpd_metrics_node_free (GstMPDMetricsNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDMETRICSNODE_H__ */
|
52
ext/dash/gstmpdmetricsrangenode.c
Normal file
52
ext/dash/gstmpdmetricsrangenode.c
Normal file
|
@ -0,0 +1,52 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdmetricsrangenode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDMetricsRangeNode, gst_mpd_metrics_range_node,
|
||||
GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_metrics_range_node_class_init (GstMPDMetricsRangeNodeClass * klass)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_metrics_range_node_init (GstMPDMetricsRangeNode * self)
|
||||
{
|
||||
self->starttime = 0; /* [ms] */
|
||||
self->duration = 0; /* [ms] */
|
||||
}
|
||||
|
||||
GstMPDMetricsRangeNode *
|
||||
gst_mpd_metrics_range_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_METRICS_RANGE_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_metrics_range_node_free (GstMPDMetricsRangeNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
64
ext/dash/gstmpdmetricsrangenode.h
Normal file
64
ext/dash/gstmpdmetricsrangenode.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDMETRICSRANGENODE_H__
|
||||
#define __GSTMPDMETRICSRANGENODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_METRICS_RANGE_NODE gst_mpd_metrics_range_node_get_type ()
|
||||
#define GST_MPD_METRICS_RANGE_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_METRICS_RANGE_NODE, GstMPDMetricsRangeNode))
|
||||
#define GST_MPD_METRICS_RANGE_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_METRICS_RANGE_NODE, GstMPDMetricsRangeNodeClass))
|
||||
#define GST_IS_MPD_METRICS_RANGE_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_METRICS_RANGE_NODE))
|
||||
#define GST_IS_MPD_METRICS_RANGE_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_METRICS_RANGE_NODE))
|
||||
#define GST_MPD_METRICS_RANGE_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_METRICS_RANGE_NODE, GstMPDMetricsRangeNodeClass))
|
||||
|
||||
typedef struct _GstMPDMetricsRangeNode GstMPDMetricsRangeNode;
|
||||
typedef struct _GstMPDMetricsRangeNodeClass GstMPDMetricsRangeNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDMetricsRangeNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
guint64 starttime; /* [ms] */
|
||||
guint64 duration; /* [ms] */
|
||||
};
|
||||
|
||||
struct _GstMPDMetricsRangeNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_metrics_range_node_get_type (void);
|
||||
|
||||
GstMPDMetricsRangeNode * gst_mpd_metrics_range_node_new (void);
|
||||
void gst_mpd_metrics_range_node_free (GstMPDMetricsRangeNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDMETRICSRANGENODE_H__ */
|
File diff suppressed because it is too large
Load diff
|
@ -31,6 +31,24 @@
|
|||
#include <gst/uridownloader/gsturidownloader.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
#include "gstmpdhelper.h"
|
||||
#include "gstxmlhelper.h"
|
||||
#include "gstmpdrootnode.h"
|
||||
#include "gstmpdbaseurlnode.h"
|
||||
#include "gstmpdutctimingnode.h"
|
||||
#include "gstmpdmetricsnode.h"
|
||||
#include "gstmpdmetricsrangenode.h"
|
||||
#include "gstmpdsnode.h"
|
||||
#include "gstmpdsegmenttimelinenode.h"
|
||||
#include "gstmpdsegmenttemplatenode.h"
|
||||
#include "gstmpdsegmenturlnode.h"
|
||||
#include "gstmpdsegmentlistnode.h"
|
||||
#include "gstmpdperiodnode.h"
|
||||
#include "gstmpdrepresentationnode.h"
|
||||
#include "gstmpdsubrepresentationnode.h"
|
||||
#include "gstmpdcontentcomponentnode.h"
|
||||
#include "gstmpdadaptationsetnode.h"
|
||||
#include "gstmpdsubsetnode.h"
|
||||
#include "gstmpdprograminformationnode.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -38,29 +56,6 @@ typedef struct _GstActiveStream GstActiveStream;
|
|||
typedef struct _GstStreamPeriod GstStreamPeriod;
|
||||
typedef struct _GstMediaFragmentInfo GstMediaFragmentInfo;
|
||||
typedef struct _GstMediaSegment GstMediaSegment;
|
||||
typedef struct _GstMPDNode GstMPDNode;
|
||||
typedef struct _GstPeriodNode GstPeriodNode;
|
||||
typedef struct _GstRepresentationBaseType GstRepresentationBaseType;
|
||||
typedef struct _GstDescriptorType GstDescriptorType;
|
||||
typedef struct _GstContentComponentNode GstContentComponentNode;
|
||||
typedef struct _GstAdaptationSetNode GstAdaptationSetNode;
|
||||
typedef struct _GstRepresentationNode GstRepresentationNode;
|
||||
typedef struct _GstSubRepresentationNode GstSubRepresentationNode;
|
||||
typedef struct _GstSegmentListNode GstSegmentListNode;
|
||||
typedef struct _GstSegmentTemplateNode GstSegmentTemplateNode;
|
||||
typedef struct _GstSegmentURLNode GstSegmentURLNode;
|
||||
typedef struct _GstBaseURL GstBaseURL;
|
||||
|
||||
typedef struct _GstSubsetNode GstSubsetNode;
|
||||
typedef struct _GstProgramInformationNode GstProgramInformationNode;
|
||||
typedef struct _GstMetricsRangeNode GstMetricsRangeNode;
|
||||
typedef struct _GstMetricsNode GstMetricsNode;
|
||||
typedef struct _GstUTCTimingNode GstUTCTimingNode;
|
||||
typedef struct _GstSNode GstSNode;
|
||||
typedef struct _GstSegmentTimelineNode GstSegmentTimelineNode;
|
||||
typedef struct _GstSegmentBaseType GstSegmentBaseType;
|
||||
typedef struct _GstURLType GstURLType;
|
||||
typedef struct _GstMultSegmentBaseType GstMultSegmentBaseType;
|
||||
|
||||
|
||||
#define GST_MPD_DURATION_NONE ((guint64)-1)
|
||||
|
@ -73,320 +68,6 @@ typedef enum
|
|||
GST_STREAM_APPLICATION /* application stream (optional): for timed text/subtitles */
|
||||
} GstStreamMimeType;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GST_XLINK_ACTUATE_ON_REQUEST,
|
||||
GST_XLINK_ACTUATE_ON_LOAD
|
||||
} GstXLinkActuate;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GST_MPD_UTCTIMING_TYPE_UNKNOWN = 0x00,
|
||||
GST_MPD_UTCTIMING_TYPE_NTP = 0x01,
|
||||
GST_MPD_UTCTIMING_TYPE_SNTP = 0x02,
|
||||
GST_MPD_UTCTIMING_TYPE_HTTP_HEAD = 0x04,
|
||||
GST_MPD_UTCTIMING_TYPE_HTTP_XSDATE = 0x08,
|
||||
GST_MPD_UTCTIMING_TYPE_HTTP_ISO = 0x10,
|
||||
GST_MPD_UTCTIMING_TYPE_HTTP_NTP = 0x20,
|
||||
GST_MPD_UTCTIMING_TYPE_DIRECT = 0x40
|
||||
} GstMPDUTCTimingType;
|
||||
|
||||
struct _GstBaseURL
|
||||
{
|
||||
gchar *baseURL;
|
||||
gchar *serviceLocation;
|
||||
gchar *byteRange;
|
||||
};
|
||||
|
||||
struct _GstSNode
|
||||
{
|
||||
guint64 t;
|
||||
guint64 d;
|
||||
gint r;
|
||||
};
|
||||
|
||||
struct _GstSegmentTimelineNode
|
||||
{
|
||||
/* list of S nodes */
|
||||
GQueue S;
|
||||
};
|
||||
|
||||
struct _GstURLType
|
||||
{
|
||||
gchar *sourceURL;
|
||||
GstXMLRange *range;
|
||||
};
|
||||
|
||||
struct _GstSegmentBaseType
|
||||
{
|
||||
guint timescale;
|
||||
guint64 presentationTimeOffset;
|
||||
GstXMLRange *indexRange;
|
||||
gboolean indexRangeExact;
|
||||
/* Initialization node */
|
||||
GstURLType *Initialization;
|
||||
/* RepresentationIndex node */
|
||||
GstURLType *RepresentationIndex;
|
||||
};
|
||||
|
||||
struct _GstMultSegmentBaseType
|
||||
{
|
||||
guint duration; /* in seconds */
|
||||
guint startNumber;
|
||||
/* SegmentBaseType extension */
|
||||
GstSegmentBaseType *SegBaseType;
|
||||
/* SegmentTimeline node */
|
||||
GstSegmentTimelineNode *SegmentTimeline;
|
||||
/* BitstreamSwitching node */
|
||||
GstURLType *BitstreamSwitching;
|
||||
};
|
||||
|
||||
struct _GstSegmentListNode
|
||||
{
|
||||
/* extension */
|
||||
GstMultSegmentBaseType *MultSegBaseType;
|
||||
/* list of SegmentURL nodes */
|
||||
GList *SegmentURL;
|
||||
|
||||
gchar *xlink_href;
|
||||
GstXLinkActuate actuate;
|
||||
};
|
||||
|
||||
struct _GstSegmentTemplateNode
|
||||
{
|
||||
/* extension */
|
||||
GstMultSegmentBaseType *MultSegBaseType;
|
||||
gchar *media;
|
||||
gchar *index;
|
||||
gchar *initialization;
|
||||
gchar *bitstreamSwitching;
|
||||
};
|
||||
|
||||
struct _GstSegmentURLNode
|
||||
{
|
||||
gchar *media;
|
||||
GstXMLRange *mediaRange;
|
||||
gchar *index;
|
||||
GstXMLRange *indexRange;
|
||||
};
|
||||
|
||||
struct _GstRepresentationBaseType
|
||||
{
|
||||
gchar *profiles;
|
||||
guint width;
|
||||
guint height;
|
||||
GstXMLRatio *sar;
|
||||
GstXMLFrameRate *minFrameRate;
|
||||
GstXMLFrameRate *maxFrameRate;
|
||||
GstXMLFrameRate *frameRate;
|
||||
gchar *audioSamplingRate;
|
||||
gchar *mimeType;
|
||||
gchar *segmentProfiles;
|
||||
gchar *codecs;
|
||||
gdouble maximumSAPPeriod;
|
||||
GstMPDSAPType startWithSAP;
|
||||
gdouble maxPlayoutRate;
|
||||
gboolean codingDependency;
|
||||
gchar *scanType;
|
||||
/* list of FramePacking DescriptorType nodes */
|
||||
GList *FramePacking;
|
||||
/* list of AudioChannelConfiguration DescriptorType nodes */
|
||||
GList *AudioChannelConfiguration;
|
||||
/* list of ContentProtection DescriptorType nodes */
|
||||
GList *ContentProtection;
|
||||
};
|
||||
|
||||
struct _GstSubRepresentationNode
|
||||
{
|
||||
/* RepresentationBase extension */
|
||||
GstRepresentationBaseType *RepresentationBase;
|
||||
guint level;
|
||||
guint *dependencyLevel; /* UIntVectorType */
|
||||
guint size; /* size of "dependencyLevel" array */
|
||||
guint bandwidth;
|
||||
gchar **contentComponent; /* StringVectorType */
|
||||
};
|
||||
|
||||
struct _GstRepresentationNode
|
||||
{
|
||||
gchar *id;
|
||||
guint bandwidth;
|
||||
guint qualityRanking;
|
||||
gchar **dependencyId; /* StringVectorType */
|
||||
gchar **mediaStreamStructureId; /* StringVectorType */
|
||||
/* RepresentationBase extension */
|
||||
GstRepresentationBaseType *RepresentationBase;
|
||||
/* list of BaseURL nodes */
|
||||
GList *BaseURLs;
|
||||
/* list of SubRepresentation nodes */
|
||||
GList *SubRepresentations;
|
||||
/* SegmentBase node */
|
||||
GstSegmentBaseType *SegmentBase;
|
||||
/* SegmentTemplate node */
|
||||
GstSegmentTemplateNode *SegmentTemplate;
|
||||
/* SegmentList node */
|
||||
GstSegmentListNode *SegmentList;
|
||||
};
|
||||
|
||||
struct _GstDescriptorType
|
||||
{
|
||||
gchar *schemeIdUri;
|
||||
gchar *value;
|
||||
};
|
||||
|
||||
struct _GstContentComponentNode
|
||||
{
|
||||
guint id;
|
||||
gchar *lang; /* LangVectorType RFC 5646 */
|
||||
gchar *contentType;
|
||||
GstXMLRatio *par;
|
||||
/* list of Accessibility DescriptorType nodes */
|
||||
GList *Accessibility;
|
||||
/* list of Role DescriptorType nodes */
|
||||
GList *Role;
|
||||
/* list of Rating DescriptorType nodes */
|
||||
GList *Rating;
|
||||
/* list of Viewpoint DescriptorType nodes */
|
||||
GList *Viewpoint;
|
||||
};
|
||||
|
||||
struct _GstAdaptationSetNode
|
||||
{
|
||||
guint id;
|
||||
guint group;
|
||||
gchar *lang; /* LangVectorType RFC 5646 */
|
||||
gchar *contentType;
|
||||
GstXMLRatio *par;
|
||||
guint minBandwidth;
|
||||
guint maxBandwidth;
|
||||
guint minWidth;
|
||||
guint maxWidth;
|
||||
guint minHeight;
|
||||
guint maxHeight;
|
||||
GstXMLConditionalUintType *segmentAlignment;
|
||||
GstXMLConditionalUintType *subsegmentAlignment;
|
||||
GstMPDSAPType subsegmentStartsWithSAP;
|
||||
gboolean bitstreamSwitching;
|
||||
/* list of Accessibility DescriptorType nodes */
|
||||
GList *Accessibility;
|
||||
/* list of Role DescriptorType nodes */
|
||||
GList *Role;
|
||||
/* list of Rating DescriptorType nodes */
|
||||
GList *Rating;
|
||||
/* list of Viewpoint DescriptorType nodes */
|
||||
GList *Viewpoint;
|
||||
/* RepresentationBase extension */
|
||||
GstRepresentationBaseType *RepresentationBase;
|
||||
/* SegmentBase node */
|
||||
GstSegmentBaseType *SegmentBase;
|
||||
/* SegmentList node */
|
||||
GstSegmentListNode *SegmentList;
|
||||
/* SegmentTemplate node */
|
||||
GstSegmentTemplateNode *SegmentTemplate;
|
||||
/* list of BaseURL nodes */
|
||||
GList *BaseURLs;
|
||||
/* list of Representation nodes */
|
||||
GList *Representations;
|
||||
/* list of ContentComponent nodes */
|
||||
GList *ContentComponents;
|
||||
|
||||
gchar *xlink_href;
|
||||
GstXLinkActuate actuate;
|
||||
};
|
||||
|
||||
struct _GstSubsetNode
|
||||
{
|
||||
guint *contains; /* UIntVectorType */
|
||||
guint size; /* size of the "contains" array */
|
||||
};
|
||||
|
||||
struct _GstPeriodNode
|
||||
{
|
||||
gchar *id;
|
||||
guint64 start; /* [ms] */
|
||||
guint64 duration; /* [ms] */
|
||||
gboolean bitstreamSwitching;
|
||||
/* SegmentBase node */
|
||||
GstSegmentBaseType *SegmentBase;
|
||||
/* SegmentList node */
|
||||
GstSegmentListNode *SegmentList;
|
||||
/* SegmentTemplate node */
|
||||
GstSegmentTemplateNode *SegmentTemplate;
|
||||
/* list of Adaptation Set nodes */
|
||||
GList *AdaptationSets;
|
||||
/* list of Representation nodes */
|
||||
GList *Subsets;
|
||||
/* list of BaseURL nodes */
|
||||
GList *BaseURLs;
|
||||
|
||||
gchar *xlink_href;
|
||||
GstXLinkActuate actuate;
|
||||
};
|
||||
|
||||
struct _GstProgramInformationNode
|
||||
{
|
||||
gchar *lang; /* LangVectorType RFC 5646 */
|
||||
gchar *moreInformationURL;
|
||||
/* children nodes */
|
||||
gchar *Title;
|
||||
gchar *Source;
|
||||
gchar *Copyright;
|
||||
};
|
||||
|
||||
struct _GstMetricsRangeNode
|
||||
{
|
||||
guint64 starttime; /* [ms] */
|
||||
guint64 duration; /* [ms] */
|
||||
};
|
||||
|
||||
struct _GstMetricsNode
|
||||
{
|
||||
gchar *metrics;
|
||||
/* list of Metrics Range nodes */
|
||||
GList *MetricsRanges;
|
||||
/* list of Reporting nodes */
|
||||
GList *Reportings;
|
||||
};
|
||||
|
||||
struct _GstUTCTimingNode {
|
||||
GstMPDUTCTimingType method;
|
||||
/* NULL terminated array of strings */
|
||||
gchar **urls;
|
||||
};
|
||||
|
||||
struct _GstMPDNode
|
||||
{
|
||||
gchar *default_namespace;
|
||||
gchar *namespace_xsi;
|
||||
gchar *namespace_ext;
|
||||
gchar *schemaLocation;
|
||||
gchar *id;
|
||||
gchar *profiles;
|
||||
GstMPDFileType type;
|
||||
GstDateTime *availabilityStartTime;
|
||||
GstDateTime *availabilityEndTime;
|
||||
guint64 mediaPresentationDuration; /* [ms] */
|
||||
guint64 minimumUpdatePeriod; /* [ms] */
|
||||
guint64 minBufferTime; /* [ms] */
|
||||
guint64 timeShiftBufferDepth; /* [ms] */
|
||||
guint64 suggestedPresentationDelay; /* [ms] */
|
||||
guint64 maxSegmentDuration; /* [ms] */
|
||||
guint64 maxSubsegmentDuration; /* [ms] */
|
||||
/* list of BaseURL nodes */
|
||||
GList *BaseURLs;
|
||||
/* list of Location nodes */
|
||||
GList *Locations;
|
||||
/* List of ProgramInformation nodes */
|
||||
GList *ProgramInfo;
|
||||
/* list of Periods nodes */
|
||||
GList *Periods;
|
||||
/* list of Metrics nodes */
|
||||
GList *Metrics;
|
||||
/* list of GstUTCTimingNode nodes */
|
||||
GList *UTCTiming;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstStreamPeriod:
|
||||
*
|
||||
|
@ -394,7 +75,7 @@ struct _GstMPDNode
|
|||
*/
|
||||
struct _GstStreamPeriod
|
||||
{
|
||||
GstPeriodNode *period; /* Stream period */
|
||||
GstMPDPeriodNode *period; /* Stream period */
|
||||
guint number; /* Period number */
|
||||
GstClockTime start; /* Period start time */
|
||||
GstClockTime duration; /* Period duration */
|
||||
|
@ -407,7 +88,7 @@ struct _GstStreamPeriod
|
|||
*/
|
||||
struct _GstMediaSegment
|
||||
{
|
||||
GstSegmentURLNode *SegmentURL; /* this is NULL when using a SegmentTemplate */
|
||||
GstMPDSegmentURLNode *SegmentURL; /* this is NULL when using a SegmentTemplate */
|
||||
guint number; /* segment number */
|
||||
gint repeat; /* number of extra repetitions (0 = played only once) */
|
||||
guint64 scale_start; /* start time in timescale units */
|
||||
|
@ -445,12 +126,12 @@ struct _GstActiveStream
|
|||
gchar *queryURL; /* active queryURL used for last request */
|
||||
guint max_bandwidth; /* max bandwidth allowed for this mimeType */
|
||||
|
||||
GstAdaptationSetNode *cur_adapt_set; /* active adaptation set */
|
||||
GstMPDAdaptationSetNode *cur_adapt_set; /* active adaptation set */
|
||||
gint representation_idx; /* index of current representation */
|
||||
GstRepresentationNode *cur_representation; /* active representation */
|
||||
GstSegmentBaseType *cur_segment_base; /* active segment base */
|
||||
GstSegmentListNode *cur_segment_list; /* active segment list */
|
||||
GstSegmentTemplateNode *cur_seg_template; /* active segment template */
|
||||
GstMPDRepresentationNode *cur_representation; /* active representation */
|
||||
GstMPDSegmentBaseType *cur_segment_base; /* active segment base */
|
||||
GstMPDSegmentListNode *cur_segment_list; /* active segment list */
|
||||
GstMPDSegmentTemplateNode *cur_seg_template; /* active segment template */
|
||||
gint segment_index; /* index of next sequence chunk */
|
||||
guint segment_repeat_index; /* index of the repeat count of a segment */
|
||||
GPtrArray *segments; /* array of GstMediaSegment */
|
||||
|
@ -458,34 +139,25 @@ struct _GstActiveStream
|
|||
};
|
||||
|
||||
/* MPD file parsing */
|
||||
gboolean gst_mpdparser_get_mpd_node (GstMPDNode ** mpd_node, const gchar * data, gint size);
|
||||
GstSegmentListNode * gst_mpdparser_get_external_segment_list (const gchar * data, gint size, GstSegmentListNode * parent);
|
||||
gboolean gst_mpdparser_get_mpd_root_node (GstMPDRootNode ** mpd_root_node, const gchar * data, gint size);
|
||||
GstMPDSegmentListNode * gst_mpdparser_get_external_segment_list (const gchar * data, gint size, GstMPDSegmentListNode * parent);
|
||||
GList * gst_mpdparser_get_external_periods (const gchar * data, gint size);
|
||||
GList * gst_mpdparser_get_external_adaptation_sets (const gchar * data, gint size, GstPeriodNode* period);
|
||||
GList * gst_mpdparser_get_external_adaptation_sets (const gchar * data, gint size, GstMPDPeriodNode* period);
|
||||
|
||||
/* navigation functions */
|
||||
GstStreamMimeType gst_mpdparser_representation_get_mimetype (GstAdaptationSetNode * adapt_set, GstRepresentationNode * rep);
|
||||
GstStreamMimeType gst_mpdparser_representation_get_mimetype (GstMPDAdaptationSetNode * adapt_set, GstMPDRepresentationNode * rep);
|
||||
|
||||
/* Memory management */
|
||||
void gst_mpdparser_free_mpd_node (GstMPDNode * mpd_node);
|
||||
void gst_mpdparser_free_period_node (GstPeriodNode * period_node);
|
||||
void gst_mpdparser_free_adaptation_set_node (GstAdaptationSetNode * adaptation_set_node);
|
||||
void gst_mpdparser_free_segment_list_node (GstSegmentListNode * segment_list_node);
|
||||
void gst_mpdparser_free_stream_period (GstStreamPeriod * stream_period);
|
||||
void gst_mpdparser_free_media_segment (GstMediaSegment * media_segment);
|
||||
void gst_mpdparser_free_active_stream (GstActiveStream * active_stream);
|
||||
void gst_mpdparser_free_base_url_node (GstBaseURL * base_url_node);
|
||||
|
||||
void gst_mpdparser_media_fragment_info_clear (GstMediaFragmentInfo * fragment);
|
||||
/* Active stream methods*/
|
||||
void gst_mpdparser_init_active_stream_segments (GstActiveStream * stream);
|
||||
gchar *gst_mpdparser_get_mediaURL (GstActiveStream * stream, GstSegmentURLNode * segmentURL);
|
||||
const gchar *gst_mpdparser_get_initializationURL (GstActiveStream * stream, GstURLType * InitializationURL);
|
||||
|
||||
/*Helper methods */
|
||||
gchar *gst_mpdparser_get_mediaURL (GstActiveStream * stream, GstMPDSegmentURLNode * segmentURL);
|
||||
const gchar *gst_mpdparser_get_initializationURL (GstActiveStream * stream, GstMPDURLType * InitializationURL);
|
||||
gchar *gst_mpdparser_build_URL_from_template (const gchar * url_template, const gchar * id, guint number, guint bandwidth, guint64 time);
|
||||
const gchar *gst_mpdparser_mimetype_to_caps (const gchar * mimeType);
|
||||
GstUri *combine_urls (GstUri * base, GList * list, gchar ** query, guint idx);
|
||||
int strncmp_ext (const char *s1, const char *s2);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_MPDPARSER_H__ */
|
||||
|
|
83
ext/dash/gstmpdperiodnode.c
Normal file
83
ext/dash/gstmpdperiodnode.c
Normal file
|
@ -0,0 +1,83 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdperiodnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDPeriodNode, gst_mpd_period_node, GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_period_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDPeriodNode *self = GST_MPD_PERIOD_NODE (object);
|
||||
|
||||
if (self->id)
|
||||
xmlFree (self->id);
|
||||
gst_mpd_helper_segment_base_type_free (self->SegmentBase);
|
||||
gst_mpd_segment_list_node_free (self->SegmentList);
|
||||
gst_mpd_segment_template_node_free (self->SegmentTemplate);
|
||||
g_list_free_full (self->AdaptationSets,
|
||||
(GDestroyNotify) gst_mpd_adaptation_set_node_free);
|
||||
g_list_free_full (self->Subsets, (GDestroyNotify) gst_mpd_subset_node_free);
|
||||
g_list_free_full (self->BaseURLs, (GDestroyNotify) gst_mpd_baseurl_node_free);
|
||||
if (self->xlink_href)
|
||||
xmlFree (self->xlink_href);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_period_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_period_node_class_init (GstMPDPeriodNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_period_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_period_node_init (GstMPDPeriodNode * self)
|
||||
{
|
||||
self->id = NULL;
|
||||
self->start = 0; /* [ms] */
|
||||
self->duration = 0; /* [ms] */
|
||||
self->bitstreamSwitching = 0;
|
||||
self->SegmentBase = NULL;
|
||||
self->SegmentList = NULL;
|
||||
self->SegmentTemplate = NULL;
|
||||
self->AdaptationSets = NULL;
|
||||
self->Subsets = NULL;
|
||||
self->BaseURLs = NULL;
|
||||
self->xlink_href = NULL;
|
||||
self->actuate = 0;
|
||||
}
|
||||
|
||||
GstMPDPeriodNode *
|
||||
gst_mpd_period_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_PERIOD_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_period_node_free (GstMPDPeriodNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
84
ext/dash/gstmpdperiodnode.h
Normal file
84
ext/dash/gstmpdperiodnode.h
Normal file
|
@ -0,0 +1,84 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDPERIODNODE_H__
|
||||
#define __GSTMPDPERIODNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
#include "gstmpdsegmentlistnode.h"
|
||||
#include "gstmpdsegmenttemplatenode.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
struct _GstSegmentTemplateNode;
|
||||
|
||||
#define GST_TYPE_MPD_PERIOD_NODE gst_mpd_period_node_get_type ()
|
||||
#define GST_MPD_PERIOD_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_PERIOD_NODE, GstMPDPeriodNode))
|
||||
#define GST_MPD_PERIOD_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_PERIOD_NODE, GstMPDPeriodNodeClass))
|
||||
#define GST_IS_MPD_PERIOD_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_PERIOD_NODE))
|
||||
#define GST_IS_MPD_PERIOD_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_PERIOD_NODE))
|
||||
#define GST_MPD_PERIOD_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_PERIOD_NODE, GstMPDPeriodNodeClass))
|
||||
|
||||
typedef struct _GstMPDPeriodNode GstMPDPeriodNode;
|
||||
typedef struct _GstMPDPeriodNodeClass GstMPDPeriodNodeClass;
|
||||
|
||||
struct _GstMPDPeriodNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
gchar *id;
|
||||
guint64 start; /* [ms] */
|
||||
guint64 duration; /* [ms] */
|
||||
gboolean bitstreamSwitching;
|
||||
/* SegmentBase node */
|
||||
GstMPDSegmentBaseType *SegmentBase;
|
||||
/* SegmentList node */
|
||||
GstMPDSegmentListNode *SegmentList;
|
||||
/* SegmentTemplate node */
|
||||
GstMPDSegmentTemplateNode *SegmentTemplate;
|
||||
/* list of Adaptation Set nodes */
|
||||
GList *AdaptationSets;
|
||||
/* list of Representation nodes */
|
||||
GList *Subsets;
|
||||
/* list of BaseURL nodes */
|
||||
GList *BaseURLs;
|
||||
|
||||
gchar *xlink_href;
|
||||
int actuate;
|
||||
};
|
||||
|
||||
struct _GstMPDPeriodNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_period_node_get_type (void);
|
||||
|
||||
GstMPDPeriodNode * gst_mpd_period_node_new (void);
|
||||
void gst_mpd_period_node_free (GstMPDPeriodNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDPERIODNODE_H__ */
|
79
ext/dash/gstmpdprograminformationnode.c
Normal file
79
ext/dash/gstmpdprograminformationnode.c
Normal file
|
@ -0,0 +1,79 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdprograminformationnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDProgramInformationNode, gst_mpd_program_information_node,
|
||||
GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_program_information_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDProgramInformationNode *self =
|
||||
GST_MPD_PROGRAM_INFORMATION_NODE (object);
|
||||
|
||||
if (self->lang)
|
||||
xmlFree (self->lang);
|
||||
if (self->moreInformationURL)
|
||||
xmlFree (self->moreInformationURL);
|
||||
if (self->Title)
|
||||
xmlFree (self->Title);
|
||||
if (self->Source)
|
||||
xmlFree (self->Source);
|
||||
if (self->Copyright)
|
||||
xmlFree (self->Copyright);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_program_information_node_parent_class)->finalize
|
||||
(object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_program_information_node_class_init (GstMPDProgramInformationNodeClass *
|
||||
klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_program_information_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_program_information_node_init (GstMPDProgramInformationNode * self)
|
||||
{
|
||||
self->lang = NULL;
|
||||
self->moreInformationURL = NULL;
|
||||
self->Title = NULL;
|
||||
self->Source = NULL;
|
||||
self->Copyright = NULL;
|
||||
}
|
||||
|
||||
GstMPDProgramInformationNode *
|
||||
gst_mpd_program_information_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_PROGRAM_INFORMATION_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_program_information_node_free (GstMPDProgramInformationNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
68
ext/dash/gstmpdprograminformationnode.h
Normal file
68
ext/dash/gstmpdprograminformationnode.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDPROGRAMINFORMATIONNODE_H__
|
||||
#define __GSTMPDPROGRAMINFORMATIONNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_PROGRAM_INFORMATION_NODE gst_mpd_program_information_node_get_type ()
|
||||
#define GST_MPD_PROGRAM_INFORMATION_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_PROGRAM_INFORMATION_NODE, GstMPDProgramInformationNode))
|
||||
#define GST_MPD_PROGRAM_INFORMATION_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_PROGRAM_INFORMATION_NODE, GstMPDProgramInformationNodeClass))
|
||||
#define GST_IS_MPD_PROGRAM_INFORMATION_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_PROGRAM_INFORMATION_NODE))
|
||||
#define GST_IS_MPD_PROGRAM_INFORMATION_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_PROGRAM_INFORMATION_NODE))
|
||||
#define GST_MPD_PROGRAM_INFORMATION_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_PROGRAM_INFORMATION_NODE, GstMPDProgramInformationNodeClass))
|
||||
|
||||
typedef struct _GstMPDProgramInformationNode GstMPDProgramInformationNode;
|
||||
typedef struct _GstMPDProgramInformationNodeClass GstMPDProgramInformationNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDProgramInformationNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
gchar *lang; /* LangVectorType RFC 5646 */
|
||||
gchar *moreInformationURL;
|
||||
/* children nodes */
|
||||
gchar *Title;
|
||||
gchar *Source;
|
||||
gchar *Copyright;
|
||||
};
|
||||
|
||||
struct _GstMPDProgramInformationNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_program_information_node_get_type (void);
|
||||
|
||||
GstMPDProgramInformationNode * gst_mpd_program_information_node_new (void);
|
||||
void gst_mpd_program_information_node_free (GstMPDProgramInformationNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDPROGRAMINFORMATIONNODE_H__ */
|
83
ext/dash/gstmpdrepresentationnode.c
Normal file
83
ext/dash/gstmpdrepresentationnode.c
Normal file
|
@ -0,0 +1,83 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdrepresentationnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDRepresentationNode, gst_mpd_representation_node,
|
||||
GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_representation_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDRepresentationNode *self = GST_MPD_REPRESENTATION_NODE (object);
|
||||
|
||||
if (self->id)
|
||||
xmlFree (self->id);
|
||||
g_strfreev (self->dependencyId);
|
||||
g_strfreev (self->mediaStreamStructureId);
|
||||
gst_mpd_helper_representation_base_type_free (self->RepresentationBase);
|
||||
g_list_free_full (self->SubRepresentations,
|
||||
(GDestroyNotify) gst_mpd_sub_representation_node_free);
|
||||
gst_mpd_helper_segment_base_type_free (self->SegmentBase);
|
||||
gst_mpd_segment_template_node_free (self->SegmentTemplate);
|
||||
gst_mpd_segment_list_node_free (self->SegmentList);
|
||||
g_list_free_full (self->BaseURLs, (GDestroyNotify) gst_mpd_baseurl_node_free);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_representation_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_representation_node_class_init (GstMPDRepresentationNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_representation_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_representation_node_init (GstMPDRepresentationNode * self)
|
||||
{
|
||||
self->id = NULL;
|
||||
self->bandwidth = 0;
|
||||
self->qualityRanking = 0;
|
||||
self->dependencyId = NULL;
|
||||
self->mediaStreamStructureId = NULL;
|
||||
self->RepresentationBase = NULL;
|
||||
self->BaseURLs = NULL;
|
||||
self->SubRepresentations = NULL;
|
||||
self->SegmentBase = NULL;
|
||||
self->SegmentTemplate = NULL;
|
||||
self->SegmentList = NULL;
|
||||
}
|
||||
|
||||
GstMPDRepresentationNode *
|
||||
gst_mpd_representation_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_REPRESENTATION_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_representation_node_free (GstMPDRepresentationNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
81
ext/dash/gstmpdrepresentationnode.h
Normal file
81
ext/dash/gstmpdrepresentationnode.h
Normal file
|
@ -0,0 +1,81 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDREPRESENTATIONNODE_H__
|
||||
#define __GSTMPDREPRESENTATIONNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
#include "gstmpdsegmentlistnode.h"
|
||||
#include "gstmpdsegmenttemplatenode.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_REPRESENTATION_NODE gst_mpd_representation_node_get_type ()
|
||||
#define GST_MPD_REPRESENTATION_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_REPRESENTATION_NODE, GstMPDRepresentationNode))
|
||||
#define GST_MPD_REPRESENTATION_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_REPRESENTATION_NODE, GstMPDRepresentationNodeClass))
|
||||
#define GST_IS_MPD_REPRESENTATION_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_REPRESENTATION_NODE))
|
||||
#define GST_IS_MPD_REPRESENTATION_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_REPRESENTATION_NODE))
|
||||
#define GST_MPD_REPRESENTATION_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_REPRESENTATION_NODE, GstMPDRepresentationNodeClass))
|
||||
|
||||
typedef struct _GstMPDRepresentationNode GstMPDRepresentationNode;
|
||||
typedef struct _GstMPDRepresentationNodeClass GstMPDRepresentationNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDRepresentationNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
gchar *id;
|
||||
guint bandwidth;
|
||||
guint qualityRanking;
|
||||
gchar **dependencyId; /* StringVectorType */
|
||||
gchar **mediaStreamStructureId; /* StringVectorType */
|
||||
/* RepresentationBase extension */
|
||||
GstMPDRepresentationBaseType *RepresentationBase;
|
||||
/* list of BaseURL nodes */
|
||||
GList *BaseURLs;
|
||||
/* list of SubRepresentation nodes */
|
||||
GList *SubRepresentations;
|
||||
/* SegmentBase node */
|
||||
GstMPDSegmentBaseType *SegmentBase;
|
||||
/* SegmentTemplate node */
|
||||
GstMPDSegmentTemplateNode *SegmentTemplate;
|
||||
/* SegmentList node */
|
||||
GstMPDSegmentListNode *SegmentList;
|
||||
};
|
||||
|
||||
struct _GstMPDRepresentationNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_representation_node_get_type (void);
|
||||
|
||||
GstMPDRepresentationNode * gst_mpd_representation_node_new (void);
|
||||
void gst_mpd_representation_node_free (GstMPDRepresentationNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDREPRESENTATIONNODE_H__ */
|
108
ext/dash/gstmpdrootnode.c
Normal file
108
ext/dash/gstmpdrootnode.c
Normal file
|
@ -0,0 +1,108 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdrootnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDRootNode, gst_mpd_root_node, GST_TYPE_OBJECT);
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_root_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDRootNode *self = GST_MPD_ROOT_NODE (object);
|
||||
|
||||
g_free (self->default_namespace);
|
||||
g_free (self->namespace_xsi);
|
||||
g_free (self->namespace_ext);
|
||||
g_free (self->schemaLocation);
|
||||
g_free (self->id);
|
||||
g_free (self->profiles);
|
||||
|
||||
if (self->availabilityStartTime)
|
||||
gst_date_time_unref (self->availabilityStartTime);
|
||||
if (self->availabilityEndTime)
|
||||
gst_date_time_unref (self->availabilityEndTime);
|
||||
|
||||
g_list_free_full (self->ProgramInfos,
|
||||
(GDestroyNotify) gst_mpd_program_information_node_free);
|
||||
g_list_free_full (self->BaseURLs, (GDestroyNotify) gst_mpd_baseurl_node_free);
|
||||
g_list_free_full (self->Locations, (GDestroyNotify) g_free);
|
||||
g_list_free_full (self->Periods, (GDestroyNotify) gst_mpd_period_node_free);
|
||||
g_list_free_full (self->Metrics, (GDestroyNotify) gst_mpd_metrics_node_free);
|
||||
g_list_free_full (self->UTCTimings,
|
||||
(GDestroyNotify) gst_mpd_utctiming_node_free);
|
||||
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_root_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_root_node_class_init (GstMPDRootNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_root_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_root_node_init (GstMPDRootNode * self)
|
||||
{
|
||||
self->default_namespace = NULL;
|
||||
self->namespace_xsi = NULL;
|
||||
self->namespace_ext = NULL;
|
||||
self->schemaLocation = NULL;
|
||||
self->id = NULL;
|
||||
self->profiles = NULL;
|
||||
self->type = GST_MPD_FILE_TYPE_STATIC;
|
||||
self->availabilityStartTime = NULL;
|
||||
self->availabilityEndTime = NULL;
|
||||
self->mediaPresentationDuration = 0; /* [ms] */
|
||||
self->minimumUpdatePeriod = 0; /* [ms] */
|
||||
self->minBufferTime = 2000; /* [ms] */
|
||||
self->timeShiftBufferDepth = 0; /* [ms] */
|
||||
self->suggestedPresentationDelay = 0; /* [ms] */
|
||||
self->maxSegmentDuration = 0; /* [ms] */
|
||||
self->maxSubsegmentDuration = 0; /* [ms] */
|
||||
/* list of BaseURL nodes */
|
||||
self->BaseURLs = NULL;
|
||||
/* list of Location nodes */
|
||||
self->Locations = NULL;
|
||||
/* List of ProgramInformation nodes */
|
||||
self->ProgramInfos = NULL;
|
||||
/* list of Periods nodes */
|
||||
self->Periods = NULL;
|
||||
/* list of Metrics nodes */
|
||||
self->Metrics = NULL;
|
||||
/* list of GstUTCTimingNode nodes */
|
||||
self->UTCTimings = NULL;
|
||||
}
|
||||
|
||||
GstMPDRootNode *
|
||||
gst_mpd_root_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_ROOT_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_root_node_free (GstMPDRootNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
89
ext/dash/gstmpdrootnode.h
Normal file
89
ext/dash/gstmpdrootnode.h
Normal file
|
@ -0,0 +1,89 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDROOTNODE_H__
|
||||
#define __GSTMPDROOTNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_ROOT_NODE gst_mpd_root_node_get_type ()
|
||||
#define GST_MPD_ROOT_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_ROOT_NODE, GstMPDRootNode))
|
||||
#define GST_MPD_ROOT_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_ROOT_NODE, GstMPDRootNodeClass))
|
||||
#define GST_IS_MPD_ROOT_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_ROOT_NODE))
|
||||
#define GST_IS_MPD_ROOT_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_ROOT_NODE))
|
||||
#define GST_MPD_ROOT_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_ROOT_NODE, GstMPDRootNodeClass))
|
||||
|
||||
typedef struct _GstMPDRootNode GstMPDRootNode;
|
||||
typedef struct _GstMPDRootNodeClass GstMPDRootNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDRootNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
gchar *default_namespace;
|
||||
gchar *namespace_xsi;
|
||||
gchar *namespace_ext;
|
||||
gchar *schemaLocation;
|
||||
gchar *id;
|
||||
gchar *profiles;
|
||||
GstMPDFileType type;
|
||||
GstDateTime *availabilityStartTime;
|
||||
GstDateTime *availabilityEndTime;
|
||||
guint64 mediaPresentationDuration; /* [ms] */
|
||||
guint64 minimumUpdatePeriod; /* [ms] */
|
||||
guint64 minBufferTime; /* [ms] */
|
||||
guint64 timeShiftBufferDepth; /* [ms] */
|
||||
guint64 suggestedPresentationDelay; /* [ms] */
|
||||
guint64 maxSegmentDuration; /* [ms] */
|
||||
guint64 maxSubsegmentDuration; /* [ms] */
|
||||
/* list of BaseURL nodes */
|
||||
GList *BaseURLs;
|
||||
/* list of Location nodes */
|
||||
GList *Locations;
|
||||
/* List of ProgramInformation nodes */
|
||||
GList *ProgramInfos;
|
||||
/* list of Periods nodes */
|
||||
GList *Periods;
|
||||
/* list of Metrics nodes */
|
||||
GList *Metrics;
|
||||
/* list of GstUTCTimingNode nodes */
|
||||
GList *UTCTimings;
|
||||
};
|
||||
|
||||
struct _GstMPDRootNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_root_node_get_type (void);
|
||||
|
||||
GstMPDRootNode * gst_mpd_root_node_new (void);
|
||||
void gst_mpd_root_node_free (GstMPDRootNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GSTMPDROOTNODE_H__ */
|
81
ext/dash/gstmpdsegmentlistnode.c
Normal file
81
ext/dash/gstmpdsegmentlistnode.c
Normal file
|
@ -0,0 +1,81 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdsegmentlistnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDSegmentListNode, gst_mpd_segment_list_node,
|
||||
GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_segment_list_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDSegmentListNode *self = GST_MPD_SEGMENT_LIST_NODE (object);
|
||||
|
||||
g_list_free_full (self->SegmentURL,
|
||||
(GDestroyNotify) gst_mpd_segment_url_node_free);
|
||||
/* MultipleSegmentBaseType extension */
|
||||
gst_mpd_helper_mult_seg_base_type_free (self->MultSegBaseType);
|
||||
if (self->xlink_href)
|
||||
xmlFree (self->xlink_href);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_segment_list_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_segment_list_node_class_init (GstMPDSegmentListNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_segment_list_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_segment_list_node_init (GstMPDSegmentListNode * self)
|
||||
{
|
||||
self->MultSegBaseType = NULL;
|
||||
self->SegmentURL = NULL;
|
||||
self->xlink_href = NULL;
|
||||
self->actuate = GST_MPD_XLINK_ACTUATE_ON_REQUEST;
|
||||
}
|
||||
|
||||
GstMPDSegmentListNode *
|
||||
gst_mpd_segment_list_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_SEGMENT_LIST_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_segment_list_node_free (GstMPDSegmentListNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_segment_list_node_add_segment (GstMPDSegmentListNode * self,
|
||||
GstMPDSegmentURLNode * segment_url)
|
||||
{
|
||||
g_return_if_fail (self != NULL);
|
||||
|
||||
self->SegmentURL = g_list_append (self->SegmentURL, segment_url);
|
||||
}
|
72
ext/dash/gstmpdsegmentlistnode.h
Normal file
72
ext/dash/gstmpdsegmentlistnode.h
Normal file
|
@ -0,0 +1,72 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDSEGMENTLISTNODE_H__
|
||||
#define __GSTMPDSEGMENTLISTNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
#include "gstmpdsegmenturlnode.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_SEGMENT_LIST_NODE gst_mpd_segment_list_node_get_type ()
|
||||
#define GST_MPD_SEGMENT_LIST_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_SEGMENT_LIST_NODE, GstMPDSegmentListNode))
|
||||
#define GST_MPD_SEGMENT_LIST_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_SEGMENT_LIST_NODE, GstMPDSegmentListNodeClass))
|
||||
#define GST_IS_MPD_SEGMENT_LIST_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_SEGMENT_LIST_NODE))
|
||||
#define GST_IS_MPD_SEGMENT_LIST_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_SEGMENT_LIST_NODE))
|
||||
#define GST_MPD_SEGMENT_LIST_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_SEGMENT_LIST_NODE, GstMPDSegmentListNodeClass))
|
||||
|
||||
typedef struct _GstMPDSegmentListNode GstMPDSegmentListNode;
|
||||
typedef struct _GstMPDSegmentListNodeClass GstMPDSegmentListNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDSegmentListNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
/* extension */
|
||||
GstMPDMultSegmentBaseType *MultSegBaseType;
|
||||
/* list of SegmentURL nodes */
|
||||
GList *SegmentURL;
|
||||
|
||||
gchar *xlink_href;
|
||||
GstMPDXLinkActuate actuate;
|
||||
};
|
||||
|
||||
struct _GstMPDSegmentListNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_segment_list_node_get_type (void);
|
||||
|
||||
GstMPDSegmentListNode * gst_mpd_segment_list_node_new (void);
|
||||
void gst_mpd_segment_list_node_free (GstMPDSegmentListNode* self);
|
||||
|
||||
void gst_mpd_segment_list_node_add_segment(GstMPDSegmentListNode * self, GstMPDSegmentURLNode * segment_url);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDSEGMENTLISTNODE_H__ */
|
78
ext/dash/gstmpdsegmenttemplatenode.c
Normal file
78
ext/dash/gstmpdsegmenttemplatenode.c
Normal file
|
@ -0,0 +1,78 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdsegmenttemplatenode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDSegmentTemplateNode, gst_mpd_segment_template_node,
|
||||
GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_segment_template_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDSegmentTemplateNode *self = GST_MPD_SEGMENT_TEMPLATE_NODE (object);
|
||||
|
||||
if (self->media)
|
||||
xmlFree (self->media);
|
||||
if (self->index)
|
||||
xmlFree (self->index);
|
||||
if (self->initialization)
|
||||
xmlFree (self->initialization);
|
||||
if (self->bitstreamSwitching)
|
||||
xmlFree (self->bitstreamSwitching);
|
||||
/* MultipleSegmentBaseType extension */
|
||||
gst_mpd_helper_mult_seg_base_type_free (self->MultSegBaseType);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_segment_template_node_parent_class)->finalize
|
||||
(object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_segment_template_node_class_init (GstMPDSegmentTemplateNodeClass *
|
||||
klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_segment_template_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_segment_template_node_init (GstMPDSegmentTemplateNode * self)
|
||||
{
|
||||
self->MultSegBaseType = NULL;
|
||||
self->media = NULL;
|
||||
self->index = NULL;
|
||||
self->initialization = NULL;
|
||||
self->bitstreamSwitching = NULL;
|
||||
}
|
||||
|
||||
GstMPDSegmentTemplateNode *
|
||||
gst_mpd_segment_template_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_SEGMENT_TEMPLATE_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_segment_template_node_free (GstMPDSegmentTemplateNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
68
ext/dash/gstmpdsegmenttemplatenode.h
Normal file
68
ext/dash/gstmpdsegmenttemplatenode.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDSEGMENTTEMPLATENODE_H__
|
||||
#define __GSTMPDSEGMENTTEMPLATENODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_SEGMENT_TEMPLATE_NODE gst_mpd_segment_template_node_get_type ()
|
||||
#define GST_MPD_SEGMENT_TEMPLATE_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_SEGMENT_TEMPLATE_NODE, GstMPDSegmentTemplateNode))
|
||||
#define GST_MPD_SEGMENT_TEMPLATE_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_SEGMENT_TEMPLATE_NODE, GstMPDSegmentTemplateNodeClass))
|
||||
#define GST_IS_MPD_SEGMENT_TEMPLATE_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_SEGMENT_TEMPLATE_NODE))
|
||||
#define GST_IS_MPD_SEGMENT_TEMPLATE_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_SEGMENT_TEMPLATE_NODE))
|
||||
#define GST_MPD_SEGMENT_TEMPLATE_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_SEGMENT_TEMPLATE_NODE, GstMPDSegmentTemplateNodeClass))
|
||||
|
||||
typedef struct _GstMPDSegmentTemplateNode GstMPDSegmentTemplateNode;
|
||||
typedef struct _GstMPDSegmentTemplateNodeClass GstMPDSegmentTemplateNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDSegmentTemplateNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
/* extension */
|
||||
GstMPDMultSegmentBaseType *MultSegBaseType;
|
||||
gchar *media;
|
||||
gchar *index;
|
||||
gchar *initialization;
|
||||
gchar *bitstreamSwitching;
|
||||
};
|
||||
|
||||
struct _GstMPDSegmentTemplateNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_segment_template_node_get_type (void);
|
||||
|
||||
GstMPDSegmentTemplateNode * gst_mpd_segment_template_node_new (void);
|
||||
void gst_mpd_segment_template_node_free (GstMPDSegmentTemplateNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDSEGMENTTEMPLATENODE_H__ */
|
88
ext/dash/gstmpdsegmenttimelinenode.c
Normal file
88
ext/dash/gstmpdsegmenttimelinenode.c
Normal file
|
@ -0,0 +1,88 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdsegmenttimelinenode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDSegmentTimelineNode, gst_mpd_segment_timeline_node,
|
||||
GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_segment_timeline_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDSegmentTimelineNode *self = GST_MPD_SEGMENT_TIMELINE_NODE (object);
|
||||
|
||||
g_queue_foreach (&self->S, (GFunc) gst_mpd_s_node_free, NULL);
|
||||
g_queue_clear (&self->S);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_segment_timeline_node_parent_class)->finalize
|
||||
(object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_segment_timeline_node_class_init (GstMPDSegmentTimelineNodeClass *
|
||||
klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_segment_timeline_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_segment_timeline_node_init (GstMPDSegmentTimelineNode * self)
|
||||
{
|
||||
g_queue_init (&self->S);
|
||||
}
|
||||
|
||||
GstMPDSegmentTimelineNode *
|
||||
gst_mpd_segment_timeline_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_SEGMENT_TIMELINE_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_segment_timeline_node_free (GstMPDSegmentTimelineNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
||||
|
||||
GstMPDSegmentTimelineNode *
|
||||
gst_mpd_segment_timeline_node_clone (GstMPDSegmentTimelineNode *
|
||||
segment_timeline)
|
||||
{
|
||||
GstMPDSegmentTimelineNode *clone = NULL;
|
||||
GList *list;
|
||||
|
||||
if (segment_timeline) {
|
||||
clone = gst_mpd_segment_timeline_node_new ();
|
||||
for (list = g_queue_peek_head_link (&segment_timeline->S); list;
|
||||
list = g_list_next (list)) {
|
||||
GstMPDSNode *s_node;
|
||||
s_node = (GstMPDSNode *) list->data;
|
||||
if (s_node) {
|
||||
g_queue_push_tail (&clone->S, gst_mpd_s_node_clone (s_node));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
66
ext/dash/gstmpdsegmenttimelinenode.h
Normal file
66
ext/dash/gstmpdsegmenttimelinenode.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDSEGMENTTIMELINENODE_H__
|
||||
#define __GSTMPDSEGMENTTIMELINENODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstxmlhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_SEGMENT_TIMELINE_NODE gst_mpd_segment_timeline_node_get_type ()
|
||||
#define GST_MPD_SEGMENT_TIMELINE_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_SEGMENT_TIMELINE_NODE, GstMPDSegmentTimelineNode))
|
||||
#define GST_MPD_SEGMENT_TIMELINE_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_SEGMENT_TIMELINE_NODE, GstMPDSegmentTimelineNodeClass))
|
||||
#define GST_IS_MPD_SEGMENT_TIMELINE_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_SEGMENT_TIMELINE_NODE))
|
||||
#define GST_IS_MPD_SEGMENT_TIMELINE_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_SEGMENT_TIMELINE_NODE))
|
||||
#define GST_MPD_SEGMENT_TIMELINE_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_SEGMENT_TIMELINE_NODE, GstMPDSegmentTimelineNodeClass))
|
||||
|
||||
typedef struct _GstMPDSegmentTimelineNode GstMPDSegmentTimelineNode;
|
||||
typedef struct _GstMPDSegmentTimelineNodeClass GstMPDSegmentTimelineNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDSegmentTimelineNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
/* list of S nodes */
|
||||
GQueue S;
|
||||
};
|
||||
|
||||
struct _GstMPDSegmentTimelineNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_segment_timeline_node_get_type (void);
|
||||
|
||||
GstMPDSegmentTimelineNode * gst_mpd_segment_timeline_node_new (void);
|
||||
void gst_mpd_segment_timeline_node_free (GstMPDSegmentTimelineNode* self);
|
||||
|
||||
GstMPDSegmentTimelineNode *gst_mpd_segment_timeline_node_clone (GstMPDSegmentTimelineNode * pointer);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDSEGMENTTIMELINENODE_H__ */
|
87
ext/dash/gstmpdsegmenturlnode.c
Normal file
87
ext/dash/gstmpdsegmenturlnode.c
Normal file
|
@ -0,0 +1,87 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdsegmenturlnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDSegmentURLNode, gst_mpd_segment_url_node, GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_segment_url_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDSegmentURLNode *self = GST_MPD_SEGMENT_URL_NODE (object);
|
||||
|
||||
if (self->media)
|
||||
xmlFree (self->media);
|
||||
g_slice_free (GstXMLRange, self->mediaRange);
|
||||
if (self->index)
|
||||
xmlFree (self->index);
|
||||
g_slice_free (GstXMLRange, self->indexRange);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_segment_url_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_segment_url_node_class_init (GstMPDSegmentURLNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_segment_url_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_segment_url_node_init (GstMPDSegmentURLNode * self)
|
||||
{
|
||||
self->media = NULL;
|
||||
self->mediaRange = NULL;
|
||||
self->index = NULL;
|
||||
self->indexRange = NULL;
|
||||
}
|
||||
|
||||
GstMPDSegmentURLNode *
|
||||
gst_mpd_segment_url_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_SEGMENT_URL_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_segment_url_node_free (GstMPDSegmentURLNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
||||
|
||||
GstMPDSegmentURLNode *
|
||||
gst_mpd_segment_url_node_clone (GstMPDSegmentURLNode * seg_url)
|
||||
{
|
||||
GstMPDSegmentURLNode *clone = NULL;
|
||||
|
||||
if (seg_url) {
|
||||
clone = gst_mpd_segment_url_node_new ();
|
||||
clone->media = xmlMemStrdup (seg_url->media);
|
||||
clone->mediaRange = gst_xml_helper_clone_range (seg_url->mediaRange);
|
||||
clone->index = xmlMemStrdup (seg_url->index);
|
||||
clone->indexRange = gst_xml_helper_clone_range (seg_url->indexRange);
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
68
ext/dash/gstmpdsegmenturlnode.h
Normal file
68
ext/dash/gstmpdsegmenturlnode.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDSEGMENTURLNODE_H__
|
||||
#define __GSTMPDSEGMENTURLNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_SEGMENT_URL_NODE gst_mpd_segment_url_node_get_type ()
|
||||
#define GST_MPD_SEGMENT_URL_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_SEGMENT_URL_NODE, GstMPDSegmentURLNode))
|
||||
#define GST_MPD_SEGMENT_URL_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_SEGMENT_URL_NODE, GstMPDSegmentURLNodeClass))
|
||||
#define GST_IS_MPD_SEGMENT_URL_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_SEGMENT_URL_NODE))
|
||||
#define GST_IS_MPD_SEGMENT_URL_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_SEGMENT_URL_NODE))
|
||||
#define GST_MPD_SEGMENT_URL_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_SEGMENT_URL_NODE, GstMPDSegmentURLNodeClass))
|
||||
|
||||
typedef struct _GstMPDSegmentURLNode GstMPDSegmentURLNode;
|
||||
typedef struct _GstMPDSegmentURLNodeClass GstMPDSegmentURLNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDSegmentURLNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
gchar *media;
|
||||
GstXMLRange *mediaRange;
|
||||
gchar *index;
|
||||
GstXMLRange *indexRange;
|
||||
};
|
||||
|
||||
struct _GstMPDSegmentURLNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_segment_url_node_get_type (void);
|
||||
|
||||
GstMPDSegmentURLNode * gst_mpd_segment_url_node_new (void);
|
||||
void gst_mpd_segment_url_node_free (GstMPDSegmentURLNode* self);
|
||||
|
||||
GstMPDSegmentURLNode *gst_mpd_segment_url_node_clone (GstMPDSegmentURLNode * seg_url);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDSEGMENTURLNODE_H__ */
|
67
ext/dash/gstmpdsnode.c
Normal file
67
ext/dash/gstmpdsnode.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdsnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDSNode, gst_mpd_s_node, GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_s_node_class_init (GstMPDSNodeClass * klass)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_s_node_init (GstMPDSNode * self)
|
||||
{
|
||||
self->t = 0;
|
||||
self->d = 0;
|
||||
self->r = 0;
|
||||
}
|
||||
|
||||
GstMPDSNode *
|
||||
gst_mpd_s_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_S_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_s_node_free (GstMPDSNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
||||
|
||||
GstMPDSNode *
|
||||
gst_mpd_s_node_clone (GstMPDSNode * s_node)
|
||||
{
|
||||
GstMPDSNode *clone = NULL;
|
||||
|
||||
if (s_node) {
|
||||
clone = gst_mpd_s_node_new ();
|
||||
clone->t = s_node->t;
|
||||
clone->d = s_node->d;
|
||||
clone->r = s_node->r;
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
67
ext/dash/gstmpdsnode.h
Normal file
67
ext/dash/gstmpdsnode.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDSNODE_H__
|
||||
#define __GSTMPDSNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_S_NODE gst_mpd_s_node_get_type ()
|
||||
#define GST_MPD_S_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_S_NODE, GstMPDSNode))
|
||||
#define GST_MPD_S_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_S_NODE, GstMPDSNodeClass))
|
||||
#define GST_IS_MPD_S_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_S_NODE))
|
||||
#define GST_IS_MPD_S_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_S_NODE))
|
||||
#define GST_MPD_S_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_S_NODE, GstMPDSNodeClass))
|
||||
|
||||
typedef struct _GstMPDSNode GstMPDSNode;
|
||||
typedef struct _GstMPDSNodeClass GstMPDSNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDSNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
guint64 t;
|
||||
guint64 d;
|
||||
gint r;
|
||||
};
|
||||
|
||||
struct _GstMPDSNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_s_node_get_type (void);
|
||||
|
||||
GstMPDSNode * gst_mpd_s_node_new (void);
|
||||
void gst_mpd_s_node_free (GstMPDSNode* self);
|
||||
|
||||
GstMPDSNode *gst_mpd_s_node_clone (GstMPDSNode * pointer);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDSNODE_H__ */
|
73
ext/dash/gstmpdsubrepresentationnode.c
Normal file
73
ext/dash/gstmpdsubrepresentationnode.c
Normal file
|
@ -0,0 +1,73 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdsubrepresentationnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDSubRepresentationNode, gst_mpd_sub_representation_node,
|
||||
GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_sub_representation_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDSubRepresentationNode *self = GST_MPD_SUB_REPRESENTATION_NODE (object);
|
||||
|
||||
gst_mpd_helper_representation_base_type_free (self->RepresentationBase);
|
||||
if (self->dependencyLevel)
|
||||
xmlFree (self->dependencyLevel);
|
||||
g_strfreev (self->contentComponent);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_sub_representation_node_parent_class)->finalize
|
||||
(object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_sub_representation_node_class_init (GstMPDSubRepresentationNodeClass *
|
||||
klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_sub_representation_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_sub_representation_node_init (GstMPDSubRepresentationNode * self)
|
||||
{
|
||||
self->RepresentationBase = NULL;
|
||||
self->level = 0;
|
||||
self->dependencyLevel = NULL;
|
||||
self->size = 0;
|
||||
self->bandwidth = 0;
|
||||
self->contentComponent = NULL;
|
||||
}
|
||||
|
||||
GstMPDSubRepresentationNode *
|
||||
gst_mpd_sub_representation_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_SUB_REPRESENTATION_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_sub_representation_node_free (GstMPDSubRepresentationNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
69
ext/dash/gstmpdsubrepresentationnode.h
Normal file
69
ext/dash/gstmpdsubrepresentationnode.h
Normal file
|
@ -0,0 +1,69 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDSUBREPRESENTATIONNODE_H__
|
||||
#define __GSTMPDSUBREPRESENTATIONNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_SUB_REPRESENTATION_NODE gst_mpd_sub_representation_node_get_type ()
|
||||
#define GST_MPD_SUB_REPRESENTATION_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_SUB_REPRESENTATION_NODE, GstMPDSubRepresentationNode))
|
||||
#define GST_MPD_SUB_REPRESENTATION_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_SUB_REPRESENTATION_NODE, GstMPDSubRepresentationNodeClass))
|
||||
#define GST_IS_MPD_SUB_REPRESENTATION_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_SUB_REPRESENTATION_NODE))
|
||||
#define GST_IS_MPD_SUB_REPRESENTATION_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_SUB_REPRESENTATION_NODE))
|
||||
#define GST_MPD_SUB_REPRESENTATION_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_SUB_REPRESENTATION_NODE, GstMPDSubRepresentationNodeClass))
|
||||
|
||||
typedef struct _GstMPDSubRepresentationNode GstMPDSubRepresentationNode;
|
||||
typedef struct _GstMPDSubRepresentationNodeClass GstMPDSubRepresentationNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDSubRepresentationNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
/* RepresentationBase extension */
|
||||
GstMPDRepresentationBaseType *RepresentationBase;
|
||||
guint level;
|
||||
guint *dependencyLevel; /* UIntVectorType */
|
||||
guint size; /* size of "dependencyLevel" array */
|
||||
guint bandwidth;
|
||||
gchar **contentComponent; /* StringVectorType */
|
||||
};
|
||||
|
||||
struct _GstMPDSubRepresentationNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_sub_representation_node_get_type (void);
|
||||
|
||||
GstMPDSubRepresentationNode * gst_mpd_sub_representation_node_new (void);
|
||||
void gst_mpd_sub_representation_node_free (GstMPDSubRepresentationNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDSUBREPRESENTATIONNODE_H__ */
|
64
ext/dash/gstmpdsubsetnode.c
Normal file
64
ext/dash/gstmpdsubsetnode.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdsubsetnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
G_DEFINE_TYPE (GstMPDSubsetNode, gst_mpd_subset_node, GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_subset_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDSubsetNode *self = GST_MPD_SUBSET_NODE (object);
|
||||
|
||||
if (self->contains)
|
||||
xmlFree (self->contains);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_subset_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_subset_node_class_init (GstMPDSubsetNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_subset_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_subset_node_init (GstMPDSubsetNode * self)
|
||||
{
|
||||
self->size = 0;
|
||||
self->contains = NULL;
|
||||
}
|
||||
|
||||
GstMPDSubsetNode *
|
||||
gst_mpd_subset_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_SUBSET_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_subset_node_free (GstMPDSubsetNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
64
ext/dash/gstmpdsubsetnode.h
Normal file
64
ext/dash/gstmpdsubsetnode.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDSUBSETNODE_H__
|
||||
#define __GSTMPDSUBSETNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstmpdhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_SUBSET_NODE gst_mpd_subset_node_get_type ()
|
||||
#define GST_MPD_SUBSET_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_SUBSET_NODE, GstMPDSubsetNode))
|
||||
#define GST_MPD_SUBSET_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_SUBSET_NODE, GstMPDSubsetNodeClass))
|
||||
#define GST_IS_MPD_SUBSET_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_SUBSET_NODE))
|
||||
#define GST_IS_MPD_SUBSET_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_SUBSET_NODE))
|
||||
#define GST_MPD_SUBSET_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_SUBSET_NODE, GstMPDSubsetNodeClass))
|
||||
|
||||
typedef struct _GstMPDSubsetNode GstMPDSubsetNode;
|
||||
typedef struct _GstMPDSubsetNodeClass GstMPDSubsetNodeClass;
|
||||
|
||||
|
||||
struct _GstMPDSubsetNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
guint *contains; /* UIntVectorType */
|
||||
guint size; /* size of the "contains" array */
|
||||
};
|
||||
|
||||
struct _GstMPDSubsetNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_subset_node_get_type (void);
|
||||
|
||||
GstMPDSubsetNode * gst_mpd_subset_node_new (void);
|
||||
void gst_mpd_subset_node_free (GstMPDSubsetNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDSUBSETNODE_H__ */
|
68
ext/dash/gstmpdutctimingnode.c
Normal file
68
ext/dash/gstmpdutctimingnode.c
Normal file
|
@ -0,0 +1,68 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
#include "gstmpdutctimingnode.h"
|
||||
#include "gstmpdparser.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_MPD_UTCTIMING_0,
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GstMPDUTCTimingNode, gst_mpd_utctiming_node, GST_TYPE_OBJECT);
|
||||
|
||||
/* GObject VMethods */
|
||||
|
||||
static void
|
||||
gst_mpd_utctiming_node_finalize (GObject * object)
|
||||
{
|
||||
GstMPDUTCTimingNode *self = GST_MPD_UTCTIMING_NODE (object);
|
||||
|
||||
g_strfreev (self->urls);
|
||||
|
||||
G_OBJECT_CLASS (gst_mpd_utctiming_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_utctiming_node_class_init (GstMPDUTCTimingNodeClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
object_class->finalize = gst_mpd_utctiming_node_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpd_utctiming_node_init (GstMPDUTCTimingNode * self)
|
||||
{
|
||||
self->method = 0;
|
||||
self->urls = NULL;
|
||||
}
|
||||
|
||||
GstMPDUTCTimingNode *
|
||||
gst_mpd_utctiming_node_new (void)
|
||||
{
|
||||
return g_object_new (GST_TYPE_MPD_UTCTIMING_NODE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gst_mpd_utctiming_node_free (GstMPDUTCTimingNode * self)
|
||||
{
|
||||
if (self)
|
||||
gst_object_unref (self);
|
||||
}
|
78
ext/dash/gstmpdutctimingnode.h
Normal file
78
ext/dash/gstmpdutctimingnode.h
Normal file
|
@ -0,0 +1,78 @@
|
|||
/* GStreamer
|
||||
*
|
||||
* Copyright (C) 2019 Collabora Ltd.
|
||||
* Author: Stéphane Cerveau <scerveau@collabora.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library (COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GSTMPDUTCTIMINGNODE_H__
|
||||
#define __GSTMPDUTCTIMINGNODE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstxmlhelper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPD_UTCTIMING_NODE gst_mpd_utctiming_node_get_type ()
|
||||
#define GST_MPD_UTCTIMING_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPD_UTCTIMING_NODE, GstMPDUTCTimingNode))
|
||||
#define GST_MPD_UTCTIMING_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPD_UTCTIMING_NODE, GstMPDUTCTimingNodeClass))
|
||||
#define GST_IS_MPD_UTCTIMING_NODE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPD_UTCTIMING_NODE))
|
||||
#define GST_IS_MPD_UTCTIMING_NODE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPD_UTCTIMING_NODE))
|
||||
#define GST_MPD_UTCTIMING_NODE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPD_UTCTIMING_NODE, GstMPDUTCTimingNodeClass))
|
||||
|
||||
typedef struct _GstMPDUTCTimingNode GstMPDUTCTimingNode;
|
||||
typedef struct _GstMPDUTCTimingNodeClass GstMPDUTCTimingNodeClass;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GST_MPD_UTCTIMING_TYPE_UNKNOWN = 0x00,
|
||||
GST_MPD_UTCTIMING_TYPE_NTP = 0x01,
|
||||
GST_MPD_UTCTIMING_TYPE_SNTP = 0x02,
|
||||
GST_MPD_UTCTIMING_TYPE_HTTP_HEAD = 0x04,
|
||||
GST_MPD_UTCTIMING_TYPE_HTTP_XSDATE = 0x08,
|
||||
GST_MPD_UTCTIMING_TYPE_HTTP_ISO = 0x10,
|
||||
GST_MPD_UTCTIMING_TYPE_HTTP_NTP = 0x20,
|
||||
GST_MPD_UTCTIMING_TYPE_DIRECT = 0x40
|
||||
} GstMPDUTCTimingType;
|
||||
|
||||
struct _GstMPDUTCTimingNode
|
||||
{
|
||||
GstObject parent_instance;
|
||||
GstMPDUTCTimingType method;
|
||||
/* NULL terminated array of strings */
|
||||
gchar **urls;
|
||||
/* TODO add missing fields such as weight etc.*/
|
||||
};
|
||||
|
||||
struct _GstMPDUTCTimingNodeClass {
|
||||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
G_GNUC_INTERNAL GType gst_mpd_utctiming_node_get_type (void);
|
||||
|
||||
GstMPDUTCTimingNode * gst_mpd_utctiming_node_new (void);
|
||||
void gst_mpd_utctiming_node_free (GstMPDUTCTimingNode* self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSTMPDUTCTIMINGNODE_H__ */
|
|
@ -1,5 +1,22 @@
|
|||
dash_sources = [
|
||||
'gstdashdemux.c',
|
||||
'gstmpdrootnode.c',
|
||||
'gstmpdbaseurlnode.c',
|
||||
'gstmpdutctimingnode.c',
|
||||
'gstmpdmetricsnode.c',
|
||||
'gstmpdmetricsrangenode.c',
|
||||
'gstmpdsnode.c',
|
||||
'gstmpdsegmenttimelinenode.c',
|
||||
'gstmpdsegmenttemplatenode.c',
|
||||
'gstmpdsegmenturlnode.c',
|
||||
'gstmpdsegmentlistnode.c',
|
||||
'gstmpdperiodnode.c',
|
||||
'gstmpdrepresentationnode.c',
|
||||
'gstmpdsubrepresentationnode.c',
|
||||
'gstmpdcontentcomponentnode.c',
|
||||
'gstmpdadaptationsetnode.c',
|
||||
'gstmpdsubsetnode.c',
|
||||
'gstmpdprograminformationnode.c',
|
||||
'gstxmlhelper.c',
|
||||
'gstmpdhelper.c',
|
||||
'gstmpdparser.c',
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue