summaryrefslogtreecommitdiff
path: root/src/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.h')
-rw-r--r--src/core.h75
1 files changed, 7 insertions, 68 deletions
diff --git a/src/core.h b/src/core.h
index a390e0c..ca11ab8 100644
--- a/src/core.h
+++ b/src/core.h
@@ -35,7 +35,8 @@ enum {
/** Media constants */
enum {
- AUDIO_BANDWIDTH = 128000 /**< Bandwidth for audio in bits/s */
+ AUDIO_BANDWIDTH = 128000, /**< Bandwidth for audio in bits/s */
+ VIDEO_SRATE = 90000, /**< Sampling rate for video */
};
@@ -200,6 +201,7 @@ int conf_get_range(const struct conf *conf, const char *name,
struct range *rng);
int conf_get_csv(const struct conf *conf, const char *name,
char *str1, size_t sz1, char *str2, size_t sz2);
+int conf_get_float(const struct conf *conf, const char *name, double *val);
/*
@@ -249,7 +251,7 @@ struct metric {
void metric_init(struct metric *metric);
void metric_reset(struct metric *metric);
void metric_add_packet(struct metric *metric, size_t packetsize);
-uint32_t metric_avg_bitrate(const struct metric *metric);
+double metric_avg_bitrate(const struct metric *metric);
/*
@@ -376,6 +378,7 @@ struct stream {
uint64_t ts_last; /**< Timestamp of last received RTP pkt */
bool terminated; /**< Stream is terminated flag */
uint32_t rtp_timeout_ms; /**< RTP Timeout value in [ms] */
+ bool rtp_estab; /**< True if RTP stream is established */
};
int stream_alloc(struct stream **sp, const struct stream_param *prm,
@@ -419,36 +422,6 @@ const char *uag_allowed_methods(void);
/*
- * Video Display
- */
-
-struct vidisp {
- struct le le;
- const char *name;
- vidisp_alloc_h *alloch;
- vidisp_update_h *updateh;
- vidisp_disp_h *disph;
- vidisp_hide_h *hideh;
-};
-
-struct vidisp *vidisp_get(struct vidisp_st *st);
-
-
-/*
- * Video Source
- */
-
-struct vidsrc {
- struct le le;
- const char *name;
- vidsrc_alloc_h *alloch;
- vidsrc_update_h *updateh;
-};
-
-struct vidsrc *vidsrc_get(struct vidsrc_st *st);
-
-
-/*
* Video Stream
*/
@@ -503,39 +476,5 @@ static inline uint64_t calc_extended_timestamp(uint32_t num_wraps, uint32_t ts)
}
-static inline uint64_t timestamp_duration(const struct timestamp_recv *ts)
-{
- uint64_t last_ext;
-
- if (!ts || !ts->is_set)
- return 0;
-
- last_ext = calc_extended_timestamp(ts->num_wraps, ts->last);
-
- return last_ext - ts->first;
-}
-
-
-/*
- * -1 backwards wrap-around
- * 0 no wrap-around
- * 1 forward wrap-around
- */
-static inline int timestamp_wrap(uint32_t ts_new, uint32_t ts_old)
-{
- int32_t delta;
-
- if (ts_new < ts_old) {
-
- delta = (int32_t)ts_new - (int32_t)ts_old;
-
- if (delta > 0)
- return 1;
- }
- else if ((int32_t)(ts_old - ts_new) > 0) {
-
- return -1;
- }
-
- return 0;
-}
+int timestamp_wrap(uint32_t ts_new, uint32_t ts_old);
+uint64_t timestamp_duration(const struct timestamp_recv *ts);