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
diff --git a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h
index 09761d9..a8e129d 100644
--- a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h
+++ b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h
@@ -26,31 +26,19 @@
 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 @@
     *  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 02a6255..53701c4 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 @@
   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_