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

Side by Side Diff: talk/app/webrtc/rtpsenderinterface.h

Issue 1413713003: Adding the ability to create an RtpSender without a track. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding some unit tests for new methods on the sender. Created 5 years, 2 months 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
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 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 29 matching lines...) Expand all
40 40
41 namespace webrtc { 41 namespace webrtc {
42 42
43 class RtpSenderInterface : public rtc::RefCountInterface { 43 class RtpSenderInterface : public rtc::RefCountInterface {
44 public: 44 public:
45 // Returns true if successful in setting the track. 45 // Returns true if successful in setting the track.
46 // Fails if an audio track is set on a video RtpSender, or vice-versa. 46 // Fails if an audio track is set on a video RtpSender, or vice-versa.
47 virtual bool SetTrack(MediaStreamTrackInterface* track) = 0; 47 virtual bool SetTrack(MediaStreamTrackInterface* track) = 0;
48 virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0; 48 virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0;
49 49
50 // Used to set the SSRC of the sender, once a local description has been set.
51 // If |ssrc| is 0, this indiates that the sender should disconnect from the
52 // underlying transport (this occurs if the sender isn't seen in a local
53 // description).
pthatcher1 2015/10/20 17:42:49 Instead of setting SSRC to 0 here, could the calle
Taylor Brandstetter 2015/10/21 00:22:09 Stop is permanent, SetSsrc(0) is not (as we discus
54 // Question for Peter: I know our code always generates nonzero SSRCs,
55 // but what is there to guarantee the peer does?
pthatcher1 2015/10/20 17:42:49 Do you mean the remote peer? It doesn't get to pi
Taylor Brandstetter 2015/10/21 00:22:09 I think you already answered this question, I just
56 virtual void SetSsrc(uint32_t ssrc) = 0;
pthatcher1 2015/10/20 17:42:49 I think we should call this set_ssrc.
Taylor Brandstetter 2015/10/21 00:22:09 I thought a method should only be lowercase_unders
pthatcher1 2015/10/22 07:34:14 Yes, you're right.
57 virtual uint32_t ssrc() const = 0;
58
59 // "audio" or "video".
60 virtual std::string kind() const = 0;
pthatcher1 2015/10/20 17:42:49 I think this should be a cricket::MediaType.
Taylor Brandstetter 2015/10/21 00:22:09 Done.
61
50 // Not to be confused with "mid", this is a field we can temporarily use 62 // Not to be confused with "mid", this is a field we can temporarily use
51 // to uniquely identify a receiver until we implement Unified Plan SDP. 63 // to uniquely identify a receiver until we implement Unified Plan SDP.
52 virtual std::string id() const = 0; 64 virtual std::string id() const = 0;
53 65
66 // TODO(deadbeef): Support one sender having multiple stream ids.
67 virtual void set_stream_id(const std::string& stream_id) = 0;
68 virtual std::string stream_id() const = 0;
69
54 virtual void Stop() = 0; 70 virtual void Stop() = 0;
55 71
56 protected: 72 protected:
57 virtual ~RtpSenderInterface() {} 73 virtual ~RtpSenderInterface() {}
58 }; 74 };
59 75
60 // Define proxy for RtpSenderInterface. 76 // Define proxy for RtpSenderInterface.
61 BEGIN_PROXY_MAP(RtpSender) 77 BEGIN_PROXY_MAP(RtpSender)
62 PROXY_METHOD1(bool, SetTrack, MediaStreamTrackInterface*) 78 PROXY_METHOD1(bool, SetTrack, MediaStreamTrackInterface*)
63 PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track) 79 PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track)
80 PROXY_METHOD1(void, SetSsrc, uint32_t)
81 PROXY_CONSTMETHOD0(uint32_t, ssrc)
82 PROXY_CONSTMETHOD0(std::string, kind)
64 PROXY_CONSTMETHOD0(std::string, id) 83 PROXY_CONSTMETHOD0(std::string, id)
84 PROXY_METHOD1(void, set_stream_id, const std::string&)
85 PROXY_CONSTMETHOD0(std::string, stream_id)
65 PROXY_METHOD0(void, Stop) 86 PROXY_METHOD0(void, Stop)
66 END_PROXY() 87 END_PROXY()
67 88
68 } // namespace webrtc 89 } // namespace webrtc
69 90
70 #endif // TALK_APP_WEBRTC_RTPSENDERINTERFACE_H_ 91 #endif // TALK_APP_WEBRTC_RTPSENDERINTERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698