* 19961108T143720.25Z
*/
static GstRTSPResult
-parse_utc_time (const gchar * str, GstRTSPTime * time, const gchar * limit)
+parse_utc_time (const gchar * str, GstRTSPTime * time, GstRTSPTime2 * time2,
+ const gchar * limit)
{
if (str[0] == '\0') {
&mins, &secs) != 6)
return GST_RTSP_EINVAL;
- time->year = year;
- time->month = month;
- time->day = day;
+ time2->year = year;
+ time2->month = month;
+ time2->day = day;
time->seconds = ((hours * 60) + mins) * 60 + secs;
}
return GST_RTSP_OK;
if (p == NULL || p == str)
return GST_RTSP_EINVAL;
- if ((res = parse_utc_time (str, &range->min, p)) != GST_RTSP_OK)
+ if ((res = parse_utc_time (str, &range->min, &range->min2, p)) != GST_RTSP_OK)
goto done;
- res = parse_utc_time (p + 1, &range->max, NULL);
+ res = parse_utc_time (p + 1, &range->max, &range->max2, NULL);
done:
return res;
* hours:minutes:seconds:frames.subframes
*/
static GstRTSPResult
-parse_smpte_time (const gchar * str, GstRTSPTime * time, const gchar * limit)
+parse_smpte_time (const gchar * str, GstRTSPTime * time, GstRTSPTime2 * time2,
+ const gchar * limit)
{
gint hours, mins, secs;
str = strchr (str + 1, ':');
str = strchr (str + 1, ':');
if (str && (limit == NULL || str < limit))
- time->frames = gst_strtod (str + 1);
+ time2->frames = gst_strtod (str + 1);
}
return GST_RTSP_OK;
}
if (p == NULL || p == str)
return GST_RTSP_EINVAL;
- if ((res = parse_smpte_time (str, &range->min, p)) != GST_RTSP_OK)
+ if ((res =
+ parse_smpte_time (str, &range->min, &range->min2, p)) != GST_RTSP_OK)
goto done;
- res = parse_smpte_time (p + 1, &range->max, NULL);
+ res = parse_smpte_time (p + 1, &range->max, &range->max2, NULL);
done:
return res;
typedef struct _GstRTSPTimeRange GstRTSPTimeRange;
typedef struct _GstRTSPTime GstRTSPTime;
+typedef struct _GstRTSPTime2 GstRTSPTime2;
/**
* GstRTSPTimeType:
* @type: the time of the time
* @seconds: seconds when @type is GST_RTSP_TIME_SECONDS,
* GST_RTSP_TIME_UTC and GST_RTSP_TIME_FRAMES
- * @frames: frames and subframes when @type is GST_RTSP_TIME_FRAMES
- * @year: year when @type is GST_RTSP_TIME_UTC
- * @month: month when @type is GST_RTSP_TIME_UTC
- * @day: day when @type is GST_RTSP_TIME_UTC
*
* A time indication.
*/
struct _GstRTSPTime {
GstRTSPTimeType type;
gdouble seconds;
+};
+
+/**
+ * GstRTSPTime2:
+ * @frames: frames and subframes when type in GstRTSPTime is
+ * GST_RTSP_TIME_FRAMES
+ * @year: year when type is GST_RTSP_TIME_UTC
+ * @month: month when type is GST_RTSP_TIME_UTC
+ * @day: day when type is GST_RTSP_TIME_UTC
+ *
+ * A time indication.
+ */
+struct _GstRTSPTime2 {
gdouble frames;
guint year;
guint month;
struct _GstRTSPTimeRange {
GstRTSPRangeUnit unit;
- GstRTSPTime min;
- GstRTSPTime max;
+ GstRTSPTime min;
+ GstRTSPTime max;
+ GstRTSPTime2 min2;
+ GstRTSPTime2 max2;
};
GstRTSPResult gst_rtsp_range_parse (const gchar *rangestr, GstRTSPTimeRange **range);
fail_unless (range->unit == GST_RTSP_RANGE_SMPTE);
fail_unless (range->min.type == GST_RTSP_TIME_FRAMES);
fail_unless (range->min.seconds == 0.0);
- fail_unless (range->min.frames == 0.0);
+ fail_unless (range->min2.frames == 0.0);
fail_unless (range->max.type == GST_RTSP_TIME_END);
gst_rtsp_range_free (range);
fail_unless (range->unit == GST_RTSP_RANGE_SMPTE);
fail_unless (range->min.type == GST_RTSP_TIME_FRAMES);
fail_unless (range->min.seconds == 38063.0);
- fail_unless (range->min.frames == 0.0);
+ fail_unless (range->min2.frames == 0.0);
fail_unless (range->max.type == GST_RTSP_TIME_FRAMES);
fail_unless (range->max.seconds == 72729.0);
- fail_unless (range->max.frames == 20.89);
+ fail_unless (range->max2.frames == 20.89);
gst_rtsp_range_free (range);
}
&range) == GST_RTSP_OK);
fail_unless (range->unit == GST_RTSP_RANGE_CLOCK);
fail_unless (range->min.type == GST_RTSP_TIME_UTC);
- fail_unless (range->min.year == 2000);
- fail_unless (range->min.month == 10);
- fail_unless (range->min.day == 10);
+ fail_unless (range->min2.year == 2000);
+ fail_unless (range->min2.month == 10);
+ fail_unless (range->min2.day == 10);
fail_unless (range->min.seconds == 44625.0);
fail_unless (range->max.type == GST_RTSP_TIME_END);
gst_rtsp_range_free (range);
("clock=19700101T103423Z-30001230T201209.89Z", &range) == GST_RTSP_OK);
fail_unless (range->unit == GST_RTSP_RANGE_CLOCK);
fail_unless (range->min.type == GST_RTSP_TIME_UTC);
- fail_unless (range->min.year == 1970);
- fail_unless (range->min.month == 1);
- fail_unless (range->min.day == 1);
+ fail_unless (range->min2.year == 1970);
+ fail_unless (range->min2.month == 1);
+ fail_unless (range->min2.day == 1);
fail_unless (range->min.seconds == 38063.0);
fail_unless (range->max.type == GST_RTSP_TIME_UTC);
- fail_unless (range->max.year == 3000);
- fail_unless (range->max.month == 12);
- fail_unless (range->max.day == 30);
+ fail_unless (range->max2.year == 3000);
+ fail_unless (range->max2.month == 12);
+ fail_unless (range->max2.day == 30);
fail_unless (range->max.seconds == 72729.89);
gst_rtsp_range_free (range);
}