| 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 27 matching lines...) Expand all Loading... |
| 38 #include "talk/app/webrtc/rtpreceiverinterface.h" | 38 #include "talk/app/webrtc/rtpreceiverinterface.h" |
| 39 #include "webrtc/base/basictypes.h" | 39 #include "webrtc/base/basictypes.h" |
| 40 | 40 |
| 41 namespace webrtc { | 41 namespace webrtc { |
| 42 | 42 |
| 43 class AudioRtpReceiver : public ObserverInterface, | 43 class AudioRtpReceiver : public ObserverInterface, |
| 44 public AudioSourceInterface::AudioObserver, | 44 public AudioSourceInterface::AudioObserver, |
| 45 public rtc::RefCountedObject<RtpReceiverInterface> { | 45 public rtc::RefCountedObject<RtpReceiverInterface> { |
| 46 public: | 46 public: |
| 47 AudioRtpReceiver(AudioTrackInterface* track, | 47 AudioRtpReceiver(AudioTrackInterface* track, |
| 48 uint32 ssrc, | 48 uint32_t ssrc, |
| 49 AudioProviderInterface* provider); | 49 AudioProviderInterface* provider); |
| 50 | 50 |
| 51 virtual ~AudioRtpReceiver(); | 51 virtual ~AudioRtpReceiver(); |
| 52 | 52 |
| 53 // ObserverInterface implementation | 53 // ObserverInterface implementation |
| 54 void OnChanged() override; | 54 void OnChanged() override; |
| 55 | 55 |
| 56 // AudioSourceInterface::AudioObserver implementation | 56 // AudioSourceInterface::AudioObserver implementation |
| 57 void OnSetVolume(double volume) override; | 57 void OnSetVolume(double volume) override; |
| 58 | 58 |
| 59 // RtpReceiverInterface implementation | 59 // RtpReceiverInterface implementation |
| 60 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { | 60 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { |
| 61 return track_.get(); | 61 return track_.get(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 std::string id() const override { return id_; } | 64 std::string id() const override { return id_; } |
| 65 | 65 |
| 66 void Stop() override; | 66 void Stop() override; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 void Reconfigure(); | 69 void Reconfigure(); |
| 70 | 70 |
| 71 std::string id_; | 71 std::string id_; |
| 72 rtc::scoped_refptr<AudioTrackInterface> track_; | 72 rtc::scoped_refptr<AudioTrackInterface> track_; |
| 73 uint32 ssrc_; | 73 uint32_t ssrc_; |
| 74 AudioProviderInterface* provider_; | 74 AudioProviderInterface* provider_; |
| 75 bool cached_track_enabled_; | 75 bool cached_track_enabled_; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInterface> { | 78 class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInterface> { |
| 79 public: | 79 public: |
| 80 VideoRtpReceiver(VideoTrackInterface* track, | 80 VideoRtpReceiver(VideoTrackInterface* track, |
| 81 uint32 ssrc, | 81 uint32_t ssrc, |
| 82 VideoProviderInterface* provider); | 82 VideoProviderInterface* provider); |
| 83 | 83 |
| 84 virtual ~VideoRtpReceiver(); | 84 virtual ~VideoRtpReceiver(); |
| 85 | 85 |
| 86 // RtpReceiverInterface implementation | 86 // RtpReceiverInterface implementation |
| 87 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { | 87 rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { |
| 88 return track_.get(); | 88 return track_.get(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 std::string id() const override { return id_; } | 91 std::string id() const override { return id_; } |
| 92 | 92 |
| 93 void Stop() override; | 93 void Stop() override; |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 std::string id_; | 96 std::string id_; |
| 97 rtc::scoped_refptr<VideoTrackInterface> track_; | 97 rtc::scoped_refptr<VideoTrackInterface> track_; |
| 98 uint32 ssrc_; | 98 uint32_t ssrc_; |
| 99 VideoProviderInterface* provider_; | 99 VideoProviderInterface* provider_; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace webrtc | 102 } // namespace webrtc |
| 103 | 103 |
| 104 #endif // TALK_APP_WEBRTC_RTPRECEIVER_H_ | 104 #endif // TALK_APP_WEBRTC_RTPRECEIVER_H_ |
| OLD | NEW |