OLD | NEW |
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 cricket::AudioRenderer::Sink* sink_; | 65 cricket::AudioRenderer::Sink* sink_; |
66 // Critical section protecting |sink_|. | 66 // Critical section protecting |sink_|. |
67 rtc::CriticalSection lock_; | 67 rtc::CriticalSection lock_; |
68 }; | 68 }; |
69 | 69 |
70 class AudioRtpSender : public ObserverInterface, | 70 class AudioRtpSender : public ObserverInterface, |
71 public rtc::RefCountedObject<RtpSenderInterface> { | 71 public rtc::RefCountedObject<RtpSenderInterface> { |
72 public: | 72 public: |
73 AudioRtpSender(AudioTrackInterface* track, | 73 AudioRtpSender(AudioTrackInterface* track, |
74 uint32 ssrc, | 74 uint32_t ssrc, |
75 AudioProviderInterface* provider); | 75 AudioProviderInterface* provider); |
76 | 76 |
77 virtual ~AudioRtpSender(); | 77 virtual ~AudioRtpSender(); |
78 | 78 |
79 // ObserverInterface implementation | 79 // ObserverInterface implementation |
80 void OnChanged() override; | 80 void OnChanged() override; |
81 | 81 |
82 // RtpSenderInterface implementation | 82 // RtpSenderInterface implementation |
83 bool SetTrack(MediaStreamTrackInterface* track) override; | 83 bool SetTrack(MediaStreamTrackInterface* track) override; |
84 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { | 84 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { |
85 return track_.get(); | 85 return track_.get(); |
86 } | 86 } |
87 | 87 |
88 std::string id() const override { return id_; } | 88 std::string id() const override { return id_; } |
89 | 89 |
90 void Stop() override; | 90 void Stop() override; |
91 | 91 |
92 private: | 92 private: |
93 void Reconfigure(); | 93 void Reconfigure(); |
94 | 94 |
95 std::string id_; | 95 std::string id_; |
96 rtc::scoped_refptr<AudioTrackInterface> track_; | 96 rtc::scoped_refptr<AudioTrackInterface> track_; |
97 uint32 ssrc_; | 97 uint32_t ssrc_; |
98 AudioProviderInterface* provider_; | 98 AudioProviderInterface* provider_; |
99 bool cached_track_enabled_; | 99 bool cached_track_enabled_; |
100 | 100 |
101 // Used to pass the data callback from the |track_| to the other end of | 101 // Used to pass the data callback from the |track_| to the other end of |
102 // cricket::AudioRenderer. | 102 // cricket::AudioRenderer. |
103 rtc::scoped_ptr<LocalAudioSinkAdapter> sink_adapter_; | 103 rtc::scoped_ptr<LocalAudioSinkAdapter> sink_adapter_; |
104 }; | 104 }; |
105 | 105 |
106 class VideoRtpSender : public ObserverInterface, | 106 class VideoRtpSender : public ObserverInterface, |
107 public rtc::RefCountedObject<RtpSenderInterface> { | 107 public rtc::RefCountedObject<RtpSenderInterface> { |
108 public: | 108 public: |
109 VideoRtpSender(VideoTrackInterface* track, | 109 VideoRtpSender(VideoTrackInterface* track, |
110 uint32 ssrc, | 110 uint32_t ssrc, |
111 VideoProviderInterface* provider); | 111 VideoProviderInterface* provider); |
112 | 112 |
113 virtual ~VideoRtpSender(); | 113 virtual ~VideoRtpSender(); |
114 | 114 |
115 // ObserverInterface implementation | 115 // ObserverInterface implementation |
116 void OnChanged() override; | 116 void OnChanged() override; |
117 | 117 |
118 // RtpSenderInterface implementation | 118 // RtpSenderInterface implementation |
119 bool SetTrack(MediaStreamTrackInterface* track) override; | 119 bool SetTrack(MediaStreamTrackInterface* track) override; |
120 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { | 120 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { |
121 return track_.get(); | 121 return track_.get(); |
122 } | 122 } |
123 | 123 |
124 std::string id() const override { return id_; } | 124 std::string id() const override { return id_; } |
125 | 125 |
126 void Stop() override; | 126 void Stop() override; |
127 | 127 |
128 private: | 128 private: |
129 void Reconfigure(); | 129 void Reconfigure(); |
130 | 130 |
131 std::string id_; | 131 std::string id_; |
132 rtc::scoped_refptr<VideoTrackInterface> track_; | 132 rtc::scoped_refptr<VideoTrackInterface> track_; |
133 uint32 ssrc_; | 133 uint32_t ssrc_; |
134 VideoProviderInterface* provider_; | 134 VideoProviderInterface* provider_; |
135 bool cached_track_enabled_; | 135 bool cached_track_enabled_; |
136 }; | 136 }; |
137 | 137 |
138 } // namespace webrtc | 138 } // namespace webrtc |
139 | 139 |
140 #endif // TALK_APP_WEBRTC_RTPSENDER_H_ | 140 #endif // TALK_APP_WEBRTC_RTPSENDER_H_ |
OLD | NEW |