Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: talk/session/media/bundlefilter.h

Issue 1437683005: Remove BundleFilter filtering of RTCP. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | talk/session/media/bundlefilter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 10 matching lines...) Expand all
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #ifndef TALK_SESSION_MEDIA_BUNDLEFILTER_H_ 28 #ifndef TALK_SESSION_MEDIA_BUNDLEFILTER_H_
29 #define TALK_SESSION_MEDIA_BUNDLEFILTER_H_ 29 #define TALK_SESSION_MEDIA_BUNDLEFILTER_H_
30 30
31 #include <stdint.h>
32
31 #include <set> 33 #include <set>
32 #include <vector> 34 #include <vector>
33 35
34 #include "talk/media/base/streamparams.h" 36 #include "talk/media/base/streamparams.h"
35 #include "webrtc/base/basictypes.h" 37 #include "webrtc/base/basictypes.h"
36 38
37 namespace cricket { 39 namespace cricket {
38 40
39 // In case of single RTP session and single transport channel, all session 41 // In case of single RTP session and single transport channel, all session
40 // ( or media) channels share a common transport channel. Hence they all get 42 // ( or media) channels share a common transport channel. Hence they all get
41 // SignalReadPacket when packet received on transport channel. This requires 43 // SignalReadPacket when packet received on transport channel. This requires
42 // cricket::BaseChannel to know all the valid sources, else media channel 44 // cricket::BaseChannel to know all the valid sources, else media channel
43 // will decode invalid packets. 45 // will decode invalid packets.
44 // 46 //
45 // This class determines whether a packet is destined for cricket::BaseChannel. 47 // This class determines whether a packet is destined for cricket::BaseChannel.
46 // For rtp packets, this is decided based on the payload type. For rtcp packets, 48 // For rtp packets, this is decided based on the payload type. For rtcp packets,
47 // this is decided based on the sender ssrc values. 49 // this is decided based on the sender ssrc values.
hta-webrtc 2015/11/12 16:47:53 You need to change this comment too.
pbos-webrtc 2015/11/13 11:10:16 Done.
48 class BundleFilter { 50 class BundleFilter {
49 public: 51 public:
50 BundleFilter(); 52 BundleFilter();
51 ~BundleFilter(); 53 ~BundleFilter();
52 54
53 // Determines packet belongs to valid cricket::BaseChannel. 55 // Determines packet belongs to valid cricket::BaseChannel.
54 bool DemuxPacket(const char* data, size_t len, bool rtcp); 56 bool DemuxPacket(const uint8_t* data, size_t len);
hta-webrtc 2015/11/12 16:47:53 Since that's not what it does any more, what about
juberti 2015/11/13 07:34:23 This name still seems fine to me. In the future th
pbos-webrtc 2015/11/13 11:10:16 Going with not changing it, but I changed the comm
55 57
56 // Adds the supported payload type. 58 // Adds the supported payload type.
57 void AddPayloadType(int payload_type); 59 void AddPayloadType(int payload_type);
58 60
59 // Adding a valid source to the filter. 61 // Public for unittests.
60 bool AddStream(const StreamParams& stream);
61
62 // Removes source from the filter.
63 bool RemoveStream(uint32_t ssrc);
64
65 // Utility methods added for unitest.
66 // True if |streams_| is not empty.
67 bool HasStreams() const;
68 bool FindStream(uint32_t ssrc) const;
69 bool FindPayloadType(int pl_type) const; 62 bool FindPayloadType(int pl_type) const;
70 void ClearAllPayloadTypes(); 63 void ClearAllPayloadTypes();
71 64
72
73 private: 65 private:
74 std::set<int> payload_types_; 66 std::set<int> payload_types_;
75 std::vector<StreamParams> streams_;
76 }; 67 };
77 68
78 } // namespace cricket 69 } // namespace cricket
79 70
80 #endif // TALK_SESSION_MEDIA_BUNDLEFILTER_H_ 71 #endif // TALK_SESSION_MEDIA_BUNDLEFILTER_H_
OLDNEW
« no previous file with comments | « no previous file | talk/session/media/bundlefilter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698