summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2012-04-12 13:41:50 +0000
committerNanang Izzuddin <nanang@teluu.com>2012-04-12 13:41:50 +0000
commit64d1bed1542041370f054e693dcb131dac889618 (patch)
tree0f8cbd8452cb5bc88a5e9f07be9772ec7d2ff87d /pjmedia/include
parente3cf311ea66955482cc6c8197c685456aa7f41cc (diff)
Re #1476: Initial version of send rate control in video stream, added simple blocking method (block application thread to make send delay when delay is needed).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4043 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia/vid_stream.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/pjmedia/include/pjmedia/vid_stream.h b/pjmedia/include/pjmedia/vid_stream.h
index 634709a0..c812d37d 100644
--- a/pjmedia/include/pjmedia/vid_stream.h
+++ b/pjmedia/include/pjmedia/vid_stream.h
@@ -73,6 +73,51 @@ PJ_BEGIN_DECL
*/
+/**
+ * Enumeration of video stream sending rate control.
+ */
+typedef enum pjmedia_vid_stream_rc_method
+{
+ /**
+ * No sending rate control. All outgoing RTP packets will be transmitted
+ * immediately right after encoding process is done.
+ */
+ PJMEDIA_VID_STREAM_RC_NONE = 0,
+
+ /**
+ * Simple blocking. Each outgoing RTP packet transmission may be delayed
+ * to avoid peak bandwidth that is much higher than specified. The thread
+ * invoking the video stream put_frame(), e.g: video capture device thread,
+ * will be blocked whenever transmission delay takes place.
+ */
+ PJMEDIA_VID_STREAM_RC_SIMPLE_BLOCKING = 1
+
+} pjmedia_vid_stream_rc_method;
+
+
+/**
+ * Structure of configuration settings for video stream sending rate control.
+ */
+typedef struct pjmedia_vid_stream_rc_config
+{
+ /**
+ * Rate control method.
+ *
+ * Default: PJMEDIA_VID_STREAM_RC_SIMPLE_BLOCKING.
+ */
+ pjmedia_vid_stream_rc_method method;
+
+ /**
+ * Upstream/outgoing bandwidth. If this is set to zero, the video stream
+ * will use codec maximum bitrate setting.
+ *
+ * Default: 0 (follow codec maximum bitrate).
+ */
+ unsigned bandwidth;
+
+} pjmedia_vid_stream_rc_config;
+
+
/**
* This structure describes video stream information. Each video stream
* corresponds to one "m=" line in SDP session descriptor, and it has
@@ -117,6 +162,9 @@ typedef struct pjmedia_vid_stream_info
pj_bool_t rtcp_sdes_bye_disabled;
/**< Disable automatic sending of RTCP
SDES and BYE. */
+
+ pjmedia_vid_stream_rc_config rc_cfg;
+ /**< Stream send rate control settings. */
} pjmedia_vid_stream_info;
@@ -145,6 +193,15 @@ pjmedia_vid_stream_info_from_sdp(pjmedia_vid_stream_info *si,
unsigned stream_idx);
+/**
+ * Initialize the video stream rate control with default settings.
+ *
+ * @param cfg Video stream rate control structure to be initialized.
+ */
+PJ_DECL(void)
+pjmedia_vid_stream_rc_config_default(pjmedia_vid_stream_rc_config *cfg);
+
+
/*
* Opaque declaration for video stream.
*/