rtsprange: improve docs
[platform/upstream/gstreamer.git] / gst-libs / gst / rtsp / gstrtsprange.h
1 /* GStreamer
2  * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 /*
20  * Unless otherwise indicated, Source Code is licensed under MIT license.
21  * See further explanation attached in License Statement (distributed in the file
22  * LICENSE).
23  *
24  * Permission is hereby granted, free of charge, to any person obtaining a copy of
25  * this software and associated documentation files (the "Software"), to deal in
26  * the Software without restriction, including without limitation the rights to
27  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
28  * of the Software, and to permit persons to whom the Software is furnished to do
29  * so, subject to the following conditions:
30  *
31  * The above copyright notice and this permission notice shall be included in all
32  * copies or substantial portions of the Software.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40  * SOFTWARE.
41  */
42
43 #ifndef __GST_RTSP_RANGE_H__
44 #define __GST_RTSP_RANGE_H__
45
46 #include <glib.h>
47
48 #include <gst/rtsp/gstrtspdefs.h>
49
50 G_BEGIN_DECLS
51
52 /**
53  * GstRTSPRangeUnit:
54  * @GST_RTSP_RANGE_SMPTE: SMPTE timecode
55  * @GST_RTSP_RANGE_SMPTE_30_DROP: 29.97 frames per second
56  * @GST_RTSP_RANGE_SMPTE_25: 25 frames per second
57  * @GST_RTSP_RANGE_NPT: Normal play time
58  * @GST_RTSP_RANGE_CLOCK: Absolute time expressed as ISO 8601 timestamps
59  *
60  * Different possible time range units.
61  */
62 typedef enum
63 {
64   GST_RTSP_RANGE_SMPTE,
65   GST_RTSP_RANGE_SMPTE_30_DROP,
66   GST_RTSP_RANGE_SMPTE_25,
67   GST_RTSP_RANGE_NPT,
68   GST_RTSP_RANGE_CLOCK
69 } GstRTSPRangeUnit;
70
71 typedef struct _GstRTSPTimeRange GstRTSPTimeRange;
72 typedef struct _GstRTSPTime GstRTSPTime;
73 typedef struct _GstRTSPTime2 GstRTSPTime2;
74
75 /**
76  * GstRTSPTimeType:
77  * @GST_RTSP_TIME_SECONDS: seconds
78  * @GST_RTSP_TIME_NOW: now
79  * @GST_RTSP_TIME_END: end
80  * @GST_RTSP_TIME_FRAMES: frames and subframes
81  * @GST_RTSP_TIME_UTC: UTC time
82  *
83  * Possible time types.
84  */
85 typedef enum {
86   GST_RTSP_TIME_SECONDS,
87   GST_RTSP_TIME_NOW,
88   GST_RTSP_TIME_END,
89   GST_RTSP_TIME_FRAMES,
90   GST_RTSP_TIME_UTC
91 } GstRTSPTimeType;
92
93 /**
94  * GstRTSPTime:
95  * @type: the time of the time
96  * @seconds: seconds when @type is GST_RTSP_TIME_SECONDS,
97  *           GST_RTSP_TIME_UTC and GST_RTSP_TIME_FRAMES
98  *
99  * A time indication.
100  */
101 struct _GstRTSPTime {
102   GstRTSPTimeType type;
103   gdouble         seconds;
104 };
105
106 /**
107  * GstRTSPTime2:
108  * @frames: frames and subframes when type in GstRTSPTime is
109  *          GST_RTSP_TIME_FRAMES
110  * @year: year when type is GST_RTSP_TIME_UTC
111  * @month: month when type is GST_RTSP_TIME_UTC
112  * @day: day when type is GST_RTSP_TIME_UTC
113  *
114  * Extra fields for a time indication.
115  *
116  * Since: 1.1.1
117  */
118 struct _GstRTSPTime2 {
119   gdouble         frames;
120   guint           year;
121   guint           month;
122   guint           day;
123 };
124
125 /**
126  * GstRTSPTimeRange:
127  * @unit: the time units used
128  * @min: the minimum interval
129  * @max: the maximum interval
130  * @min2: extra fields in the minimum interval (Since: 1.1.1)
131  * @max2: extra fields in the maximum interval (Since: 1.1.1)
132  *
133  * A time range.
134  */
135 struct _GstRTSPTimeRange {
136   GstRTSPRangeUnit unit;
137
138   GstRTSPTime  min;
139   GstRTSPTime  max;
140   GstRTSPTime2 min2;
141   GstRTSPTime2 max2;
142 };
143
144 GstRTSPResult   gst_rtsp_range_parse        (const gchar *rangestr, GstRTSPTimeRange **range);
145 gchar *         gst_rtsp_range_to_string    (const GstRTSPTimeRange *range);
146 void            gst_rtsp_range_free         (GstRTSPTimeRange *range);
147
148 G_END_DECLS
149
150 #endif /* __GST_RTSP_RANGE_H__ */