Chromium Code Reviews| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 cricket::MediaType media_type() const override { | |
| 89 return cricket::MEDIA_TYPE_AUDIO; | |
| 90 } | |
| 91 | |
| 88 std::string id() const override { return id_; } | 92 std::string id() const override { return id_; } |
| 89 | 93 |
| 90 void Stop() override; | 94 void Stop() override; |
| 91 | 95 |
| 96 void Reconfigure() override; | |
| 97 | |
| 92 private: | 98 private: |
| 93 void Reconfigure(); | |
| 94 | |
| 95 std::string id_; | 99 std::string id_; |
| 96 rtc::scoped_refptr<AudioTrackInterface> track_; | 100 rtc::scoped_refptr<AudioTrackInterface> track_; |
| 97 uint32_t ssrc_; | 101 uint32_t ssrc_; |
| 98 AudioProviderInterface* provider_; | 102 AudioProviderInterface* provider_; |
| 99 bool cached_track_enabled_; | 103 bool cached_track_enabled_; |
| 100 | 104 |
| 101 // Used to pass the data callback from the |track_| to the other end of | 105 // Used to pass the data callback from the |track_| to the other end of |
| 102 // cricket::AudioRenderer. | 106 // cricket::AudioRenderer. |
| 103 rtc::scoped_ptr<LocalAudioSinkAdapter> sink_adapter_; | 107 rtc::scoped_ptr<LocalAudioSinkAdapter> sink_adapter_; |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 class VideoRtpSender : public ObserverInterface, | 110 class VideoRtpSender : public ObserverInterface, |
| 107 public rtc::RefCountedObject<RtpSenderInterface> { | 111 public rtc::RefCountedObject<RtpSenderInterface> { |
| 108 public: | 112 public: |
| 109 VideoRtpSender(VideoTrackInterface* track, | 113 VideoRtpSender(VideoTrackInterface* track, |
| 110 uint32_t ssrc, | 114 uint32_t ssrc, |
| 111 VideoProviderInterface* provider); | 115 VideoProviderInterface* provider); |
| 112 | 116 |
| 113 virtual ~VideoRtpSender(); | 117 virtual ~VideoRtpSender(); |
| 114 | 118 |
| 115 // ObserverInterface implementation | 119 // ObserverInterface implementation |
| 116 void OnChanged() override; | 120 void OnChanged() override; |
| 117 | 121 |
| 118 // RtpSenderInterface implementation | 122 // RtpSenderInterface implementation |
| 119 bool SetTrack(MediaStreamTrackInterface* track) override; | 123 bool SetTrack(MediaStreamTrackInterface* track) override; |
| 120 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { | 124 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { |
| 121 return track_.get(); | 125 return track_.get(); |
| 122 } | 126 } |
| 123 | 127 |
| 128 cricket::MediaType media_type() const override { | |
| 129 return cricket::MEDIA_TYPE_VIDEO; | |
| 130 } | |
| 131 | |
| 124 std::string id() const override { return id_; } | 132 std::string id() const override { return id_; } |
| 125 | 133 |
| 126 void Stop() override; | 134 void Stop() override; |
| 127 | 135 |
| 136 // Calls SetCaptureDevice and SetVideoSend. | |
| 137 void Reconfigure() override; | |
| 138 | |
| 128 private: | 139 private: |
| 129 void Reconfigure(); | 140 // Only calls SetVideoSend. |
|
pthatcher1
2015/11/11 00:45:02
Perhaps this would be more clear as "Only calls Vi
Taylor Brandstetter
2015/11/11 01:33:30
Done.
| |
| 141 void SetVideoSend(); | |
| 130 | 142 |
| 131 std::string id_; | 143 std::string id_; |
| 132 rtc::scoped_refptr<VideoTrackInterface> track_; | 144 rtc::scoped_refptr<VideoTrackInterface> track_; |
| 133 uint32_t ssrc_; | 145 uint32_t ssrc_; |
| 134 VideoProviderInterface* provider_; | 146 VideoProviderInterface* provider_; |
| 135 bool cached_track_enabled_; | 147 bool cached_track_enabled_; |
| 136 }; | 148 }; |
| 137 | 149 |
| 138 } // namespace webrtc | 150 } // namespace webrtc |
| 139 | 151 |
| 140 #endif // TALK_APP_WEBRTC_RTPSENDER_H_ | 152 #endif // TALK_APP_WEBRTC_RTPSENDER_H_ |
| OLD | NEW |