aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/rtp_rtcp/interface
diff options
context:
space:
mode:
authorphoglund@webrtc.org <phoglund@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-01-14 10:01:55 +0000
committerphoglund@webrtc.org <phoglund@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-01-14 10:01:55 +0000
commita22a9bd9ca66e98f2d51ea082dec8481f2f39e6e (patch)
treefe5d683fdd8ec838722a9c4b1fa1e433ecf7be28 /webrtc/modules/rtp_rtcp/interface
parent49273ffa792293d1b8df17ae90a4f11cd6b6c401 (diff)
downloadwebrtc-a22a9bd9ca66e98f2d51ea082dec8481f2f39e6e.tar.gz
Cleaned up the data path for payload data, made callbacks to rtp_receiver nonoptional.
The audio receiver is now completely independent of rtp_receiver: video will hopefully be too in the next patch. BUG= TEST=vie & voe_auto_test full runs Review URL: https://webrtc-codereview.appspot.com/1014006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3372 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'webrtc/modules/rtp_rtcp/interface')
-rw-r--r--webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h27
-rw-r--r--webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h58
2 files changed, 66 insertions, 19 deletions
diff --git a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h
index 09761d9170..a8e129d86a 100644
--- a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h
+++ b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h
@@ -26,31 +26,19 @@ class Transport;
class RtpRtcp : public Module {
public:
struct Configuration {
- Configuration()
- : id(-1),
- audio(false),
- clock(NULL),
- default_module(NULL),
- incoming_data(NULL),
- incoming_messages(NULL),
- outgoing_transport(NULL),
- rtcp_feedback(NULL),
- intra_frame_callback(NULL),
- bandwidth_callback(NULL),
- rtt_observer(NULL),
- audio_messages(NULL),
- remote_bitrate_estimator(NULL),
- paced_sender(NULL) {
- }
+ Configuration();
+
/* id - Unique identifier of this RTP/RTCP module object
* audio - True for a audio version of the RTP/RTCP module
* object false will create a video version
* clock - The clock to use to read time. If NULL object
* will be using the system clock.
* incoming_data - Callback object that will receive the incoming
- * data
+ * data. May not be NULL; default callback will do
+ * nothing.
* incoming_messages - Callback object that will receive the incoming
- * RTP messages.
+ * RTP messages. May not be NULL; default callback
+ * will do nothing.
* outgoing_transport - Transport object that will be called when packets
* are ready to be sent out on the network
* rtcp_feedback - Callback object that will receive the incoming
@@ -58,7 +46,8 @@ class RtpRtcp : public Module {
* intra_frame_callback - Called when the receiver request a intra frame.
* bandwidth_callback - Called when we receive a changed estimate from
* the receiver of out stream.
- * audio_messages - Telehone events.
+ * audio_messages - Telehone events. May not be NULL; default callback
+ * will do nothing.
* remote_bitrate_estimator - Estimates the bandwidth available for a set of
* streams from the same client.
* paced_sender - Spread any bursts of packets into smaller
diff --git a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h
index 02a62556e6..53701c4716 100644
--- a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h
+++ b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h
@@ -269,5 +269,63 @@ class RtpRtcpClock {
virtual void CurrentNTP(WebRtc_UWord32& secs, WebRtc_UWord32& frac) = 0;
};
+// Null object version of RtpFeedback.
+class NullRtpFeedback : public RtpFeedback {
+ public:
+ virtual ~NullRtpFeedback() {}
+
+ virtual WebRtc_Word32 OnInitializeDecoder(
+ const WebRtc_Word32 id,
+ const WebRtc_Word8 payloadType,
+ const char payloadName[RTP_PAYLOAD_NAME_SIZE],
+ const int frequency,
+ const WebRtc_UWord8 channels,
+ const WebRtc_UWord32 rate) {
+ return 0;
+ }
+
+ virtual void OnPacketTimeout(const WebRtc_Word32 id) {}
+
+ virtual void OnReceivedPacket(const WebRtc_Word32 id,
+ const RtpRtcpPacketType packetType) {}
+
+ virtual void OnPeriodicDeadOrAlive(const WebRtc_Word32 id,
+ const RTPAliveType alive) {}
+
+ virtual void OnIncomingSSRCChanged(const WebRtc_Word32 id,
+ const WebRtc_UWord32 SSRC) {}
+
+ virtual void OnIncomingCSRCChanged(const WebRtc_Word32 id,
+ const WebRtc_UWord32 CSRC,
+ const bool added) {}
+};
+
+// Null object version of RtpData.
+class NullRtpData : public RtpData {
+ public:
+ virtual ~NullRtpData() {}
+ virtual WebRtc_Word32 OnReceivedPayloadData(
+ const WebRtc_UWord8* payloadData,
+ const WebRtc_UWord16 payloadSize,
+ const WebRtcRTPHeader* rtpHeader) {
+ return 0;
+ }
+};
+
+// Null object version of RtpAudioFeedback.
+class NullRtpAudioFeedback : public RtpAudioFeedback {
+ public:
+ virtual ~NullRtpAudioFeedback() {}
+
+ virtual void OnReceivedTelephoneEvent(const WebRtc_Word32 id,
+ const WebRtc_UWord8 event,
+ const bool endOfEvent) {}
+
+ virtual void OnPlayTelephoneEvent(const WebRtc_Word32 id,
+ const WebRtc_UWord8 event,
+ const WebRtc_UWord16 lengthMs,
+ const WebRtc_UWord8 volume) {}
+};
+
} // namespace webrtc
#endif // WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_DEFINES_H_