Add parallel stats interface with optional stats to APM.

This new parallel GetStatistics function uses Optionals to indicate if stats are valid or not, and no longer relies on default values. It also takes an argument to indicate if receive streams are present, and if not several stats will not be set.

Bug: b/67926135
Change-Id: I175de1c65c414bea6ec9ca8b0b16f07cb2308d9f
Reviewed-on: https://webrtc-review.googlesource.com/17942
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20789}
diff --git a/pc/statscollector.h b/pc/statscollector.h
index bdfe64b..9f74d11 100644
--- a/pc/statscollector.h
+++ b/pc/statscollector.h
@@ -120,9 +120,10 @@
                                  StatsReport::Direction direction);
 
   // Helper method to get stats from the local audio tracks.
-  void UpdateStatsFromExistingLocalAudioTracks();
+  void UpdateStatsFromExistingLocalAudioTracks(bool has_remote_tracks);
   void UpdateReportFromAudioTrack(AudioTrackInterface* track,
-                                  StatsReport* report);
+                                  StatsReport* report,
+                                  bool has_remote_tracks);
 
   // Helper method to get the id for the track identified by ssrc.
   // |direction| tells if the track is for sending or receiving.