dash: add set/get property for nodes

Add a way to set/get properties for given nodes:

- root
- baseurl
- representation
This commit is contained in:
Stéphane Cerveau 2019-09-02 14:52:53 +02:00 committed by GStreamer Merge Bot
parent ac74b042ec
commit d1b3b19088
11 changed files with 835 additions and 8 deletions

View file

@ -24,8 +24,52 @@
G_DEFINE_TYPE (GstMPDAdaptationSetNode, gst_mpd_adaptation_set_node,
GST_TYPE_MPD_REPRESENTATION_BASE_NODE);
enum
{
PROP_MPD_ADAPTATION_SET_0,
PROP_MPD_ADAPTATION_SET_ID,
PROP_MPD_ADAPTATION_SET_CONTENT_TYPE,
};
/* GObject VMethods */
static void
gst_mpd_adaptation_set_node_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMPDAdaptationSetNode *self = GST_MPD_ADAPTATION_SET_NODE (object);
switch (prop_id) {
case PROP_MPD_ADAPTATION_SET_ID:
self->id = g_value_get_int (value);
break;
case PROP_MPD_ADAPTATION_SET_CONTENT_TYPE:
g_free (self->contentType);
self->contentType = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_adaptation_set_node_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMPDAdaptationSetNode *self = GST_MPD_ADAPTATION_SET_NODE (object);
switch (prop_id) {
case PROP_MPD_ADAPTATION_SET_ID:
g_value_set_int (value, self->id);
break;
case PROP_MPD_ADAPTATION_SET_CONTENT_TYPE:
g_value_set_string (value, self->contentType);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_adaptation_set_node_finalize (GObject * object)
{
@ -157,8 +201,19 @@ gst_mpd_adaptation_set_node_class_init (GstMPDAdaptationSetNodeClass * klass)
m_klass = GST_MPD_NODE_CLASS (klass);
object_class->finalize = gst_mpd_adaptation_set_node_finalize;
object_class->set_property = gst_mpd_adaptation_set_node_set_property;
object_class->get_property = gst_mpd_adaptation_set_node_get_property;
m_klass->get_xml_node = gst_mpd_adaptation_set_get_xml_node;
g_object_class_install_property (object_class, PROP_MPD_ADAPTATION_SET_ID,
g_param_spec_int ("id", "id",
"adaptation set id", 0, G_MAXINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_ADAPTATION_SET_CONTENT_TYPE, g_param_spec_string ("content-type",
"content type", "content type of the adaptation set", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void

View file

@ -23,8 +23,61 @@
G_DEFINE_TYPE (GstMPDBaseURLNode, gst_mpd_baseurl_node, GST_TYPE_MPD_NODE);
enum
{
PROP_MPD_BASEURL_0,
PROP_MPD_BASEURL_URL,
PROP_MPD_BASEURL_SERVICE_LOCATION,
PROP_MPD_BASEURL_BYTE_RANGE,
};
/* GObject VMethods */
static void
gst_mpd_baseurl_node_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMPDBaseURLNode *self = GST_MPD_BASEURL_NODE (object);
switch (prop_id) {
case PROP_MPD_BASEURL_URL:
g_free (self->baseURL);
self->baseURL = g_value_dup_string (value);
break;
case PROP_MPD_BASEURL_SERVICE_LOCATION:
g_free (self->serviceLocation);
self->serviceLocation = g_value_dup_string (value);
break;
case PROP_MPD_BASEURL_BYTE_RANGE:
g_free (self->byteRange);
self->byteRange = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_baseurl_node_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMPDBaseURLNode *self = GST_MPD_BASEURL_NODE (object);
switch (prop_id) {
case PROP_MPD_BASEURL_URL:
g_value_set_string (value, self->baseURL);
break;
case PROP_MPD_BASEURL_SERVICE_LOCATION:
g_value_set_string (value, self->serviceLocation);
break;
case PROP_MPD_BASEURL_BYTE_RANGE:
g_value_set_string (value, self->byteRange);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_baseurl_node_finalize (GObject * object)
{
@ -71,8 +124,24 @@ gst_mpd_baseurl_node_class_init (GstMPDBaseURLNodeClass * klass)
m_klass = GST_MPD_NODE_CLASS (klass);
object_class->finalize = gst_mpd_baseurl_node_finalize;
object_class->set_property = gst_mpd_baseurl_node_set_property;
object_class->get_property = gst_mpd_baseurl_node_get_property;
m_klass->get_xml_node = gst_mpd_baseurl_get_xml_node;
g_object_class_install_property (object_class, PROP_MPD_BASEURL_URL,
g_param_spec_string ("url", "base url",
"url of the base url", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_BASEURL_SERVICE_LOCATION,
g_param_spec_string ("service-location", "service location",
"service location", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_MPD_BASEURL_BYTE_RANGE,
g_param_spec_string ("byte-range", "byte range", "byte range", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void

View file

@ -24,8 +24,51 @@
G_DEFINE_TYPE (GstMPDMultSegmentBaseNode, gst_mpd_mult_segment_base_node,
GST_TYPE_MPD_NODE);
enum
{
PROP_MPD_MULT_SEGMENT_BASE_0 = 100,
PROP_MPD_MULT_SEGMENT_BASE_DURATION,
PROP_MPD_MULT_SEGMENT_BASE_START_NUMBER,
};
/* GObject VMethods */
static void
gst_mpd_mult_segment_base_node_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMPDMultSegmentBaseNode *self = GST_MPD_MULT_SEGMENT_BASE_NODE (object);
switch (prop_id) {
case PROP_MPD_MULT_SEGMENT_BASE_DURATION:
self->duration = g_value_get_uint (value);
break;
case PROP_MPD_MULT_SEGMENT_BASE_START_NUMBER:
self->startNumber = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_mult_segment_base_node_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMPDMultSegmentBaseNode *self = GST_MPD_MULT_SEGMENT_BASE_NODE (object);
switch (prop_id) {
case PROP_MPD_MULT_SEGMENT_BASE_DURATION:
g_value_set_uint (value, self->duration);
break;
case PROP_MPD_MULT_SEGMENT_BASE_START_NUMBER:
g_value_set_uint (value, self->startNumber);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_mult_segment_base_node_finalize (GObject * object)
{
@ -73,6 +116,19 @@ gst_mpd_mult_segment_base_node_class_init (GstMPDMultSegmentBaseNodeClass *
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gst_mpd_mult_segment_base_node_finalize;
object_class->set_property = gst_mpd_mult_segment_base_node_set_property;
object_class->get_property = gst_mpd_mult_segment_base_node_get_property;
g_object_class_install_property (object_class,
PROP_MPD_MULT_SEGMENT_BASE_DURATION, g_param_spec_uint ("duration",
"duration", "duration of segment", 0, G_MAXINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_MULT_SEGMENT_BASE_START_NUMBER,
g_param_spec_uint ("start-number", "start number",
"start number in the segment list", 0, G_MAXINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void

View file

@ -22,8 +22,67 @@
#include "gstmpdparser.h"
G_DEFINE_TYPE (GstMPDPeriodNode, gst_mpd_period_node, GST_TYPE_MPD_NODE);
enum
{
PROP_MPD_PERIOD_0,
PROP_MPD_PERIOD_ID,
PROP_MPD_PERIOD_START,
PROP_MPD_PERIOD_DURATION,
PROP_MPD_PERIOD_BITSTREAM_SWITCHING,
};
/* GObject VMethods */
static void
gst_mpd_period_node_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMPDPeriodNode *self = GST_MPD_PERIOD_NODE (object);
switch (prop_id) {
case PROP_MPD_PERIOD_ID:
g_free (self->id);
self->id = g_value_dup_string (value);
break;
case PROP_MPD_PERIOD_START:
self->start = g_value_get_uint64 (value);
break;
case PROP_MPD_PERIOD_DURATION:
self->duration = g_value_get_uint64 (value);
break;
case PROP_MPD_PERIOD_BITSTREAM_SWITCHING:
self->bitstreamSwitching = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_period_node_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMPDPeriodNode *self = GST_MPD_PERIOD_NODE (object);
switch (prop_id) {
case PROP_MPD_PERIOD_ID:
g_value_set_string (value, self->id);
break;
case PROP_MPD_PERIOD_START:
g_value_set_uint64 (value, self->start);
break;
case PROP_MPD_PERIOD_DURATION:
g_value_set_uint64 (value, self->duration);
break;
case PROP_MPD_PERIOD_BITSTREAM_SWITCHING:
g_value_set_boolean (value, self->bitstreamSwitching);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_period_node_finalize (GObject * object)
{
@ -90,12 +149,38 @@ gst_mpd_period_node_class_init (GstMPDPeriodNodeClass * klass)
GObjectClass *object_class;
GstMPDNodeClass *m_klass;
object_class = G_OBJECT_CLASS (klass);
m_klass = GST_MPD_NODE_CLASS (klass);
object_class->finalize = gst_mpd_period_node_finalize;
object_class->set_property = gst_mpd_period_node_set_property;
object_class->get_property = gst_mpd_period_node_get_property;
m_klass->get_xml_node = gst_mpd_period_get_xml_node;
g_object_class_install_property (object_class, PROP_MPD_PERIOD_ID,
g_param_spec_string ("id", "id",
"unique id for period", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_MPD_PERIOD_START,
g_param_spec_uint64 ("start", "Period start",
"Period start",
0, G_MAXUINT64, 0,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (object_class, PROP_MPD_PERIOD_DURATION,
g_param_spec_uint64 ("duration", "period duration",
"Period duration",
0, G_MAXUINT64, 0,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (object_class,
PROP_MPD_PERIOD_BITSTREAM_SWITCHING,
g_param_spec_boolean ("bitstream-switching", "Bitstream switching",
"Bitstream switching", FALSE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
static void

View file

@ -24,8 +24,166 @@
G_DEFINE_TYPE (GstMPDRepresentationBaseNode, gst_mpd_representation_base_node,
GST_TYPE_MPD_NODE);
enum
{
PROP_MPD_REPRESENTATION_BASE_0 = 100,
PROP_MPD_REPRESENTATION_BASE_PROFILES,
PROP_MPD_REPRESENTATION_BASE_WIDTH,
PROP_MPD_REPRESENTATION_BASE_HEIGHT,
PROP_MPD_REPRESENTATION_BASE_SAR,
PROP_MPD_REPRESENTATION_BASE_MIN_FRAME_RATE,
PROP_MPD_REPRESENTATION_BASE_MAX_FRAME_RATE,
PROP_MPD_REPRESENTATION_BASE_FRAME_RATE,
PROP_MPD_REPRESENTATION_BASE_AUDIO_SAMPLING_RATE,
PROP_MPD_REPRESENTATION_BASE_MIMETYPE,
PROP_MPD_REPRESENTATION_BASE_SEGMENT_PROFILES,
PROP_MPD_REPRESENTATION_BASE_CODECS,
PROP_MPD_REPRESENTATION_BASE_MAX_SAP_PERIOD,
PROP_MPD_REPRESENTATION_BASE_START_WITH_SAP,
PROP_MPD_REPRESENTATION_BASE_MAX_PLAYOUT_RATE,
PROP_MPD_REPRESENTATION_BASE_CODING_DEPENDENCY,
PROP_MPD_REPRESENTATION_BASE_SCAN_TYPE,
};
/* GObject VMethods */
static void
gst_mpd_representation_base_node_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMPDRepresentationBaseNode *self =
GST_MPD_REPRESENTATION_BASE_NODE (object);
switch (prop_id) {
case PROP_MPD_REPRESENTATION_BASE_PROFILES:
g_free (self->profiles);
self->profiles = g_value_dup_string (value);
break;
case PROP_MPD_REPRESENTATION_BASE_WIDTH:
self->width = g_value_get_uint (value);
break;
case PROP_MPD_REPRESENTATION_BASE_HEIGHT:
self->height = g_value_get_uint (value);
break;
case PROP_MPD_REPRESENTATION_BASE_SAR:
g_slice_free (GstXMLRatio, self->sar);
self->sar = gst_xml_helper_clone_ratio (g_value_get_pointer (value));
break;
case PROP_MPD_REPRESENTATION_BASE_MIN_FRAME_RATE:
g_slice_free (GstXMLFrameRate, self->minFrameRate);
self->minFrameRate =
gst_xml_helper_clone_frame_rate (g_value_get_pointer (value));
break;
case PROP_MPD_REPRESENTATION_BASE_MAX_FRAME_RATE:
g_slice_free (GstXMLFrameRate, self->maxFrameRate);
self->maxFrameRate =
gst_xml_helper_clone_frame_rate (g_value_get_pointer (value));
break;
case PROP_MPD_REPRESENTATION_BASE_FRAME_RATE:
g_slice_free (GstXMLFrameRate, self->frameRate);
self->frameRate =
gst_xml_helper_clone_frame_rate (g_value_get_pointer (value));
break;
case PROP_MPD_REPRESENTATION_BASE_AUDIO_SAMPLING_RATE:
g_free (self->audioSamplingRate);
self->audioSamplingRate =
g_strdup_printf ("%u", g_value_get_uint (value));
break;
case PROP_MPD_REPRESENTATION_BASE_MIMETYPE:
g_free (self->mimeType);
self->mimeType = g_value_dup_string (value);
break;
case PROP_MPD_REPRESENTATION_BASE_SEGMENT_PROFILES:
g_free (self->segmentProfiles);
self->segmentProfiles = g_value_dup_string (value);
break;
case PROP_MPD_REPRESENTATION_BASE_CODECS:
g_free (self->codecs);
self->codecs = g_value_dup_string (value);
break;
case PROP_MPD_REPRESENTATION_BASE_MAX_SAP_PERIOD:
self->maximumSAPPeriod = g_value_get_double (value);
break;
case PROP_MPD_REPRESENTATION_BASE_START_WITH_SAP:
self->startWithSAP = g_value_get_int (value);
break;
case PROP_MPD_REPRESENTATION_BASE_MAX_PLAYOUT_RATE:
self->maxPlayoutRate = g_value_get_double (value);
break;
case PROP_MPD_REPRESENTATION_BASE_CODING_DEPENDENCY:
self->codingDependency = g_value_get_boolean (value);
break;
case PROP_MPD_REPRESENTATION_BASE_SCAN_TYPE:
g_free (self->scanType);
self->scanType = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_representation_base_node_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMPDRepresentationBaseNode *self =
GST_MPD_REPRESENTATION_BASE_NODE (object);
switch (prop_id) {
case PROP_MPD_REPRESENTATION_BASE_PROFILES:
g_value_set_string (value, self->profiles);
break;
case PROP_MPD_REPRESENTATION_BASE_WIDTH:
g_value_set_uint (value, self->width);
break;
case PROP_MPD_REPRESENTATION_BASE_HEIGHT:
g_value_set_uint (value, self->height);
break;
case PROP_MPD_REPRESENTATION_BASE_SAR:
g_value_set_pointer (value, self->sar);
break;
case PROP_MPD_REPRESENTATION_BASE_MIN_FRAME_RATE:
g_value_set_pointer (value, self->minFrameRate);
break;
case PROP_MPD_REPRESENTATION_BASE_MAX_FRAME_RATE:
g_value_set_pointer (value, self->maxFrameRate);
break;
case PROP_MPD_REPRESENTATION_BASE_FRAME_RATE:
g_value_set_pointer (value, self->frameRate);
break;
case PROP_MPD_REPRESENTATION_BASE_AUDIO_SAMPLING_RATE:
g_value_set_uint (value, atoi (self->audioSamplingRate));
break;
case PROP_MPD_REPRESENTATION_BASE_MIMETYPE:
g_value_set_string (value, self->mimeType);
break;
case PROP_MPD_REPRESENTATION_BASE_SEGMENT_PROFILES:
g_value_set_string (value, self->segmentProfiles);
break;
case PROP_MPD_REPRESENTATION_BASE_CODECS:
g_value_set_string (value, self->codecs);
break;
case PROP_MPD_REPRESENTATION_BASE_MAX_SAP_PERIOD:
g_value_set_double (value, self->maximumSAPPeriod);
break;
case PROP_MPD_REPRESENTATION_BASE_START_WITH_SAP:
g_value_set_int (value, self->startWithSAP);
break;
case PROP_MPD_REPRESENTATION_BASE_MAX_PLAYOUT_RATE:
g_value_set_double (value, self->maxPlayoutRate);
break;
case PROP_MPD_REPRESENTATION_BASE_CODING_DEPENDENCY:
g_value_set_boolean (value, self->codingDependency);
self->codingDependency = g_value_get_boolean (value);
break;
case PROP_MPD_REPRESENTATION_BASE_SCAN_TYPE:
g_value_set_string (value, self->scanType);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_representation_base_node_finalize (GObject * object)
{
@ -126,6 +284,31 @@ gst_mpd_representation_base_node_class_init (GstMPDRepresentationBaseNodeClass *
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gst_mpd_representation_base_node_finalize;
object_class->set_property = gst_mpd_representation_base_node_set_property;
object_class->get_property = gst_mpd_representation_base_node_get_property;
g_object_class_install_property (object_class,
PROP_MPD_REPRESENTATION_BASE_WIDTH, g_param_spec_uint ("width",
"width", "representation width", 0, G_MAXUINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_REPRESENTATION_BASE_HEIGHT, g_param_spec_uint ("height",
"height", "representation height", 0, G_MAXUINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_REPRESENTATION_BASE_MIMETYPE, g_param_spec_string ("mime-type",
"mimetype", "representation mimetype", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_REPRESENTATION_BASE_CODECS, g_param_spec_string ("codecs",
"codecs", "representation codec", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_REPRESENTATION_BASE_AUDIO_SAMPLING_RATE,
g_param_spec_uint ("audio-sampling-rate", "audio sampling rate",
"representation audio sampling rate", 0, G_MAXUINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void

View file

@ -24,8 +24,59 @@
G_DEFINE_TYPE (GstMPDRepresentationNode, gst_mpd_representation_node,
GST_TYPE_MPD_REPRESENTATION_BASE_NODE);
enum
{
PROP_MPD_REPRESENTATION_0,
PROP_MPD_REPRESENTATION_ID,
PROP_MPD_REPRESENTATION_BANDWIDTH,
PROP_MPD_REPRESENTATION_QUALITY_RANKING,
};
/* GObject VMethods */
static void
gst_mpd_representation_node_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMPDRepresentationNode *self = GST_MPD_REPRESENTATION_NODE (object);
switch (prop_id) {
case PROP_MPD_REPRESENTATION_ID:
g_free (self->id);
self->id = g_value_dup_string (value);
break;
case PROP_MPD_REPRESENTATION_BANDWIDTH:
self->bandwidth = g_value_get_uint (value);
break;
case PROP_MPD_REPRESENTATION_QUALITY_RANKING:
self->qualityRanking = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_representation_node_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMPDRepresentationNode *self = GST_MPD_REPRESENTATION_NODE (object);
switch (prop_id) {
case PROP_MPD_REPRESENTATION_ID:
g_value_set_string (value, self->id);
break;
case PROP_MPD_REPRESENTATION_BANDWIDTH:
g_value_set_uint (value, self->bandwidth);
break;
case PROP_MPD_REPRESENTATION_QUALITY_RANKING:
g_value_set_uint (value, self->qualityRanking);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_representation_node_finalize (GObject * object)
{
@ -102,8 +153,20 @@ gst_mpd_representation_node_class_init (GstMPDRepresentationNodeClass * klass)
m_klass = GST_MPD_NODE_CLASS (klass);
object_class->finalize = gst_mpd_representation_node_finalize;
object_class->set_property = gst_mpd_representation_node_set_property;
object_class->get_property = gst_mpd_representation_node_get_property;
m_klass->get_xml_node = gst_mpd_representation_get_xml_node;
g_object_class_install_property (object_class,
PROP_MPD_REPRESENTATION_BANDWIDTH, g_param_spec_uint ("bandwidth",
"bandwidth", "representation bandwidth", 0, G_MAXUINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_REPRESENTATION_QUALITY_RANKING,
g_param_spec_uint ("quality-ranking", "quality ranking",
"representation quality ranking", 0, G_MAXUINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void

View file

@ -23,8 +23,144 @@
G_DEFINE_TYPE (GstMPDRootNode, gst_mpd_root_node, GST_TYPE_MPD_NODE);
enum
{
PROP_MPD_ROOT_0,
PROP_MPD_ROOT_DEFAULT_NAMESPACE,
PROP_MPD_ROOT_NAMESPACE_XSI,
PROP_MPD_ROOT_NAMESPACE_EXT,
PROP_MPD_ROOT_SCHEMA_LOCATION,
PROP_MPD_ROOT_ID,
PROP_MPD_ROOT_PROFILES,
PROP_MPD_ROOT_TYPE,
PROP_MPD_ROOT_PUBLISH_TIME,
PROP_MPD_ROOT_AVAILABILTY_START_TIME,
PROP_MPD_ROOT_AVAILABILTY_END_TIME,
PROP_MPD_ROOT_MEDIA_PRESENTATION_DURATION,
PROP_MPD_ROOT_MINIMUM_UPDATE_PERIOD,
PROP_MPD_ROOT_MIN_BUFFER_TIME,
PROP_MPD_ROOT_TIMESHIFT_BUFFER_DEPTH,
PROP_MPD_ROOT_SUGGESTED_PRESENTATION_DELAY,
PROP_MPD_ROOT_MAX_SEGMENT_DURATION,
PROP_MPD_ROOT_MAX_SUBSEGMENT_DURATION,
};
/* GObject VMethods */
static void
gst_mpd_root_node_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMPDRootNode *self = GST_MPD_ROOT_NODE (object);
switch (prop_id) {
case PROP_MPD_ROOT_DEFAULT_NAMESPACE:
g_free (self->default_namespace);
self->default_namespace = g_value_dup_string (value);
break;
case PROP_MPD_ROOT_NAMESPACE_XSI:
g_free (self->namespace_xsi);
self->namespace_xsi = g_value_dup_string (value);
break;
case PROP_MPD_ROOT_NAMESPACE_EXT:
g_free (self->namespace_ext);
self->namespace_ext = g_value_dup_string (value);
break;
case PROP_MPD_ROOT_SCHEMA_LOCATION:
g_free (self->schemaLocation);
self->schemaLocation = g_value_dup_string (value);
break;
case PROP_MPD_ROOT_ID:
g_free (self->id);
self->id = g_value_dup_string (value);
break;
case PROP_MPD_ROOT_PROFILES:
g_free (self->profiles);
self->profiles = g_value_dup_string (value);
break;
case PROP_MPD_ROOT_TYPE:
self->type = (GstMPDFileType) g_value_get_int (value);
break;
case PROP_MPD_ROOT_AVAILABILTY_START_TIME:
if (self->availabilityStartTime)
gst_date_time_unref (self->availabilityStartTime);
self->availabilityStartTime = g_value_get_boxed (value);
break;
case PROP_MPD_ROOT_AVAILABILTY_END_TIME:
if (self->availabilityEndTime)
gst_date_time_unref (self->availabilityEndTime);
self->availabilityEndTime = g_value_get_boxed (value);
break;
case PROP_MPD_ROOT_PUBLISH_TIME:
if (self->publishTime)
gst_date_time_unref (self->publishTime);
self->publishTime = g_value_get_boxed (value);
break;
case PROP_MPD_ROOT_MEDIA_PRESENTATION_DURATION:
self->mediaPresentationDuration = g_value_get_uint64 (value);
break;
case PROP_MPD_ROOT_MINIMUM_UPDATE_PERIOD:
self->minimumUpdatePeriod = g_value_get_uint64 (value);
break;
case PROP_MPD_ROOT_MIN_BUFFER_TIME:
self->minBufferTime = g_value_get_uint64 (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_root_node_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMPDRootNode *self = GST_MPD_ROOT_NODE (object);
switch (prop_id) {
case PROP_MPD_ROOT_DEFAULT_NAMESPACE:
g_value_set_string (value, self->default_namespace);
break;
case PROP_MPD_ROOT_NAMESPACE_XSI:
g_value_set_string (value, self->namespace_xsi);
break;
case PROP_MPD_ROOT_NAMESPACE_EXT:
g_value_set_string (value, self->namespace_ext);
break;
case PROP_MPD_ROOT_SCHEMA_LOCATION:
g_value_set_string (value, self->schemaLocation);
break;
case PROP_MPD_ROOT_ID:
g_value_set_string (value, self->id);
break;
case PROP_MPD_ROOT_PROFILES:
g_value_set_string (value, self->profiles);
break;
case PROP_MPD_ROOT_TYPE:
g_value_set_int (value, self->type);
break;
case PROP_MPD_ROOT_AVAILABILTY_START_TIME:
g_value_set_boxed (value, self->availabilityStartTime);
break;
case PROP_MPD_ROOT_AVAILABILTY_END_TIME:
g_value_set_boxed (value, self->availabilityEndTime);
break;
case PROP_MPD_ROOT_PUBLISH_TIME:
g_value_set_boxed (value, self->publishTime);
break;
case PROP_MPD_ROOT_MEDIA_PRESENTATION_DURATION:
g_value_set_uint64 (value, self->mediaPresentationDuration);
break;
case PROP_MPD_ROOT_MINIMUM_UPDATE_PERIOD:
g_value_set_uint64 (value, self->minimumUpdatePeriod);
break;
case PROP_MPD_ROOT_MIN_BUFFER_TIME:
g_value_set_uint64 (value, self->minBufferTime);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_root_node_finalize (GObject * object)
{
@ -41,6 +177,8 @@ gst_mpd_root_node_finalize (GObject * object)
gst_date_time_unref (self->availabilityStartTime);
if (self->availabilityEndTime)
gst_date_time_unref (self->availabilityEndTime);
if (self->publishTime)
gst_date_time_unref (self->publishTime);
g_list_free_full (self->ProgramInfos,
(GDestroyNotify) gst_mpd_program_information_node_free);
@ -88,6 +226,8 @@ gst_mpd_root_get_xml_node (GstMPDNode * node)
gst_xml_helper_set_prop_date_time (root_xml_node, "availabilityEndTime",
self->availabilityEndTime);
gst_xml_helper_set_prop_date_time (root_xml_node, "publishTime",
self->publishTime);
if (self->mediaPresentationDuration)
gst_xml_helper_set_prop_duration (root_xml_node,
@ -95,7 +235,7 @@ gst_mpd_root_get_xml_node (GstMPDNode * node)
if (self->minimumUpdatePeriod)
gst_xml_helper_set_prop_duration (root_xml_node, "minimumUpdatePeriod",
self->minimumUpdatePeriod);
if (self->minimumUpdatePeriod)
if (self->minBufferTime)
gst_xml_helper_set_prop_duration (root_xml_node, "minBufferTime",
self->minBufferTime);
if (self->timeShiftBufferDepth)
@ -148,13 +288,73 @@ gst_mpd_root_node_class_init (GstMPDRootNodeClass * klass)
GObjectClass *object_class;
GstMPDNodeClass *m_klass;
object_class = G_OBJECT_CLASS (klass);
m_klass = GST_MPD_NODE_CLASS (klass);
object_class->finalize = gst_mpd_root_node_finalize;
object_class->set_property = gst_mpd_root_node_set_property;
object_class->get_property = gst_mpd_root_node_get_property;
m_klass->get_xml_buffer = gst_mpd_root_get_xml_buffer;
m_klass->get_xml_node = gst_mpd_root_get_xml_node;
g_object_class_install_property (object_class,
PROP_MPD_ROOT_DEFAULT_NAMESPACE, g_param_spec_string ("default-namespace",
"default namespace", "default namespace", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_MPD_ROOT_NAMESPACE_XSI,
g_param_spec_string ("namespace-xsi", "namespace xsi", "namespace xsi",
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_MPD_ROOT_NAMESPACE_EXT,
g_param_spec_string ("namespace-ext", "namespace ext", "namespace ext",
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_MPD_ROOT_SCHEMA_LOCATION,
g_param_spec_string ("schema-location", "schema location",
"schema location for period", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_MPD_ROOT_ID,
g_param_spec_string ("id", "id", "unique id for period", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_MPD_ROOT_PROFILES,
g_param_spec_string ("profiles", "profiles", "profiles", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_MPD_ROOT_TYPE,
g_param_spec_int ("type", "MPD type",
"MPD type",
GST_MPD_FILE_TYPE_STATIC, GST_MPD_FILE_TYPE_DYNAMIC,
GST_MPD_FILE_TYPE_STATIC,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (object_class,
PROP_MPD_ROOT_AVAILABILTY_START_TIME,
g_param_spec_boxed ("availability-start-time", "Availability start time",
"MPD availability start time", GST_TYPE_DATE_TIME,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_ROOT_AVAILABILTY_END_TIME,
g_param_spec_boxed ("availability-end-time", "Availability end time",
"MPD availability end time", GST_TYPE_DATE_TIME,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_ROOT_PUBLISH_TIME,
g_param_spec_boxed ("publish-time", "publish time",
"MPD publish time", GST_TYPE_DATE_TIME,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_ROOT_MEDIA_PRESENTATION_DURATION,
g_param_spec_uint64 ("media-presentation-duration",
"media presentation duration", "media presentation duration", 0,
G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_ROOT_MINIMUM_UPDATE_PERIOD,
g_param_spec_uint64 ("minimum-update-period",
"minimum update period", "minimum update period", 0,
G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_ROOT_MIN_BUFFER_TIME,
g_param_spec_uint64 ("min-buffer-time", "mininim buffer time",
"mininim buffer time", 0,
G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void
@ -169,6 +369,7 @@ gst_mpd_root_node_init (GstMPDRootNode * self)
self->type = GST_MPD_FILE_TYPE_STATIC;
self->availabilityStartTime = NULL;
self->availabilityEndTime = NULL;
self->publishTime = NULL;
self->mediaPresentationDuration = 0; /* [ms] */
self->minimumUpdatePeriod = 0; /* [ms] */
self->minBufferTime = 2000; /* [ms] */

View file

@ -41,6 +41,7 @@ struct _GstMPDRootNode
GstMPDFileType type;
GstDateTime *availabilityStartTime;
GstDateTime *availabilityEndTime;
GstDateTime *publishTime;
guint64 mediaPresentationDuration; /* [ms] */
guint64 minimumUpdatePeriod; /* [ms] */
guint64 minBufferTime; /* [ms] */

View file

@ -24,8 +24,65 @@
G_DEFINE_TYPE (GstMPDSegmentTemplateNode, gst_mpd_segment_template_node,
GST_TYPE_MPD_MULT_SEGMENT_BASE_NODE);
enum
{
PROP_MPD_SEGMENT_TEMPLATE_0,
PROP_MPD_SEGMENT_TEMPLATE_MEDIA,
PROP_MPD_SEGMENT_TEMPLATE_INDEX,
PROP_MPD_SEGMENT_TEMPLATE_INITIALIZATION,
PROP_MPD_SEGMENT_TEMPLATE_BITSTREAM_SWITCHING,
};
/* GObject VMethods */
static void
gst_mpd_segment_template_node_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMPDSegmentTemplateNode *self = GST_MPD_SEGMENT_TEMPLATE_NODE (object);
switch (prop_id) {
case PROP_MPD_SEGMENT_TEMPLATE_MEDIA:
self->media = g_value_dup_string (value);
break;
case PROP_MPD_SEGMENT_TEMPLATE_INDEX:
self->index = g_value_dup_string (value);
break;
case PROP_MPD_SEGMENT_TEMPLATE_INITIALIZATION:
self->initialization = g_value_dup_string (value);
break;
case PROP_MPD_SEGMENT_TEMPLATE_BITSTREAM_SWITCHING:
self->bitstreamSwitching = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_segment_template_node_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMPDSegmentTemplateNode *self = GST_MPD_SEGMENT_TEMPLATE_NODE (object);
switch (prop_id) {
case PROP_MPD_SEGMENT_TEMPLATE_MEDIA:
g_value_set_string (value, self->media);
break;
case PROP_MPD_SEGMENT_TEMPLATE_INDEX:
g_value_set_string (value, self->index);
break;
case PROP_MPD_SEGMENT_TEMPLATE_INITIALIZATION:
g_value_set_string (value, self->initialization);
break;
case PROP_MPD_SEGMENT_TEMPLATE_BITSTREAM_SWITCHING:
g_value_set_string (value, self->bitstreamSwitching);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_segment_template_node_finalize (GObject * object)
{
@ -84,8 +141,26 @@ gst_mpd_segment_template_node_class_init (GstMPDSegmentTemplateNodeClass *
m_klass = GST_MPD_NODE_CLASS (klass);
object_class->finalize = gst_mpd_segment_template_node_finalize;
object_class->set_property = gst_mpd_segment_template_node_set_property;
object_class->get_property = gst_mpd_segment_template_node_get_property;
m_klass->get_xml_node = gst_mpd_segment_template_get_xml_node;
g_object_class_install_property (object_class,
PROP_MPD_SEGMENT_TEMPLATE_MEDIA, g_param_spec_string ("media",
"media", "media", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_SEGMENT_TEMPLATE_INDEX, g_param_spec_string ("index",
"index", "index", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_SEGMENT_TEMPLATE_INITIALIZATION,
g_param_spec_string ("initialization", "initialization", "initialization",
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MPD_SEGMENT_TEMPLATE_BITSTREAM_SWITCHING,
g_param_spec_string ("bitstream-switching", "bitstream switching",
"bitstream switching", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void

View file

@ -25,8 +25,45 @@
G_DEFINE_TYPE (GstMPDSegmentURLNode, gst_mpd_segment_url_node,
GST_TYPE_MPD_NODE);
enum
{
PROP_MPD_SEGMENT_URL_0,
PROP_MPD_SEGMENT_URL_MEDIA,
};
/* GObject VMethods */
static void
gst_mpd_segment_url_node_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMPDSegmentURLNode *self = GST_MPD_SEGMENT_URL_NODE (object);
switch (prop_id) {
case PROP_MPD_SEGMENT_URL_MEDIA:
g_free (self->media);
self->media = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_segment_url_node_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMPDSegmentURLNode *self = GST_MPD_SEGMENT_URL_NODE (object);
switch (prop_id) {
case PROP_MPD_SEGMENT_URL_MEDIA:
g_value_set_string (value, self->media);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_mpd_segment_url_node_finalize (GObject * object)
{
@ -79,8 +116,15 @@ gst_mpd_segment_url_node_class_init (GstMPDSegmentURLNodeClass * klass)
m_klass = GST_MPD_NODE_CLASS (klass);
object_class->finalize = gst_mpd_segment_url_node_finalize;
object_class->set_property = gst_mpd_segment_url_node_set_property;
object_class->get_property = gst_mpd_segment_url_node_get_property;
m_klass->get_xml_node = gst_mpd_segment_url_get_xml_node;
g_object_class_install_property (object_class,
PROP_MPD_SEGMENT_URL_MEDIA, g_param_spec_string ("media",
"media", "media description", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void

View file

@ -21,15 +21,8 @@
#include "gstmpdutctimingnode.h"
#include "gstmpdparser.h"
enum
{
PROP_MPD_UTCTIMING_0,
};
G_DEFINE_TYPE (GstMPDUTCTimingNode, gst_mpd_utctiming_node, GST_TYPE_MPD_NODE);
/* GObject VMethods */
static const struct GstMPDUTCTimingMethod gst_mpd_utctiming_methods[] = {
{"urn:mpeg:dash:utc:ntp:2014", GST_MPD_UTCTIMING_TYPE_NTP},
{"urn:mpeg:dash:utc:sntp:2014", GST_MPD_UTCTIMING_TYPE_SNTP},
@ -53,6 +46,8 @@ static const struct GstMPDUTCTimingMethod gst_mpd_utctiming_methods[] = {
{NULL, 0}
};
/* GObject VMethods */
static void
gst_mpd_utctiming_node_finalize (GObject * object)
{