OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * libjingle | |
3 * Copyright 2015 Google Inc. | |
4 * | |
5 * Redistribution and use in source and binary forms, with or without | |
6 * modification, are permitted provided that the following conditions are met: | |
7 * | |
8 * 1. Redistributions of source code must retain the above copyright notice, | |
9 * this list of conditions and the following disclaimer. | |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | |
11 * this list of conditions and the following disclaimer in the documentation | |
12 * and/or other materials provided with the distribution. | |
13 * 3. The name of the author may not be used to endorse or promote products | |
14 * derived from this software without specific prior written permission. | |
15 * | |
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | |
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | |
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
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, | |
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 | |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
26 */ | |
27 | |
28 // This file contains classes that implement RtpReceiverInterface. | |
29 // An RtpReceiver associates a MediaStreamTrackInterface with an underlying | |
30 // transport (provided by AudioProviderInterface/VideoProviderInterface) | |
31 | |
32 #ifndef TALK_APP_WEBRTC_RTPRECEIVER_H_ | |
33 #define TALK_APP_WEBRTC_RTPRECEIVER_H_ | |
34 | |
35 #include <string> | |
36 | |
37 #include "talk/app/webrtc/mediastreamprovider.h" | |
38 #include "talk/app/webrtc/rtpreceiverinterface.h" | |
39 #include "webrtc/base/basictypes.h" | |
40 | |
41 namespace webrtc { | |
42 | |
43 class AudioRtpReceiver : public ObserverInterface, | |
44 public AudioSourceInterface::AudioObserver, | |
45 public RtpReceiverInterface { | |
46 public: | |
47 AudioRtpReceiver(AudioTrackInterface* track, | |
48 uint32 ssrc, | |
49 const std::string& mid, | |
50 AudioProviderInterface* provider); | |
51 | |
52 virtual ~AudioRtpReceiver(); | |
53 | |
54 // ObserverInterface implementation | |
55 void OnChanged() override; | |
56 | |
57 // AudioSourceInterface::AudioObserver implementation | |
58 void OnSetVolume(double volume) override; | |
59 | |
60 // RtpReceiverInterface implementation | |
61 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { | |
62 return track_.get(); | |
63 } | |
64 std::string mid() const override { return mid_; } | |
pthatcher1
2015/09/17 04:25:46
I think we should either remove this or just call
Taylor Brandstetter
2015/09/23 00:10:45
Removed.
| |
65 | |
66 // Detach from AudioProviderInterface | |
67 void Stop() override; | |
pthatcher1
2015/09/17 04:25:46
Does this also shutdown the media, or does setLoca
Taylor Brandstetter
2015/09/23 00:10:45
I'm not completely sure what "shutdown the media"
| |
68 | |
69 private: | |
70 void UpdateEnabled(); | |
71 | |
72 rtc::scoped_refptr<AudioTrackInterface> track_; | |
73 uint32 ssrc_; | |
pthatcher1
2015/09/17 04:25:46
Can you put a TODO to change the key we use for pa
Taylor Brandstetter
2015/09/23 00:10:45
Done.
| |
74 std::string mid_; | |
75 AudioProviderInterface* provider_; | |
pthatcher1
2015/09/17 04:25:46
Can you comment that this is just a crazy way to g
Taylor Brandstetter
2015/09/23 00:10:45
Done.
| |
76 bool enabled_; | |
pthatcher1
2015/09/17 04:25:46
Can you rename this to track_enabled_? That would
Taylor Brandstetter
2015/09/23 00:10:45
Changed to cached_track_enabled_.
| |
77 }; | |
78 | |
79 class VideoRtpReceiver : public RtpReceiverInterface { | |
pthatcher1
2015/09/17 04:25:46
All the comment I left for audio apply to video (e
| |
80 public: | |
81 VideoRtpReceiver(VideoTrackInterface* track, | |
82 uint32 ssrc, | |
83 const std::string& mid, | |
84 VideoProviderInterface* provider); | |
85 | |
86 virtual ~VideoRtpReceiver(); | |
87 | |
88 // RtpReceiverInterface implementation | |
89 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { | |
90 return track_.get(); | |
91 } | |
92 std::string mid() const override { return mid_; } | |
93 | |
94 // Detach from VideoProviderInterface | |
95 void Stop() override; | |
96 | |
97 private: | |
98 void UpdateEnabled(); | |
99 | |
100 rtc::scoped_refptr<VideoTrackInterface> track_; | |
101 uint32 ssrc_; | |
102 std::string mid_; | |
103 VideoProviderInterface* provider_; | |
104 }; | |
105 | |
106 } // namespace webrtc | |
107 | |
108 #endif // TALK_APP_WEBRTC_RTPRECEIVER_H_ | |
OLD | NEW |