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

Unified Diff: webrtc/api/rtpreceiver.h

Issue 2046173002: Use VoiceChannel/VideoChannel directly from RtpSender/RtpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Moving code that needs to execute out of RTC_DCHECKs. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/remoteaudiosource.cc ('k') | webrtc/api/rtpreceiver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/rtpreceiver.h
diff --git a/webrtc/api/rtpreceiver.h b/webrtc/api/rtpreceiver.h
index 3b1fd926cbf33ea67f921e40bbb043cb43f790c9..4b3bd4d4abc431e0412c3b8b2c296e450c0863e6 100644
--- a/webrtc/api/rtpreceiver.h
+++ b/webrtc/api/rtpreceiver.h
@@ -10,20 +10,21 @@
// This file contains classes that implement RtpReceiverInterface.
// An RtpReceiver associates a MediaStreamTrackInterface with an underlying
-// transport (provided by AudioProviderInterface/VideoProviderInterface)
+// transport (provided by cricket::VoiceChannel/cricket::VideoChannel)
#ifndef WEBRTC_API_RTPRECEIVER_H_
#define WEBRTC_API_RTPRECEIVER_H_
#include <string>
-#include "webrtc/api/mediastreamprovider.h"
+#include "webrtc/api/mediastreaminterface.h"
#include "webrtc/api/rtpreceiverinterface.h"
#include "webrtc/api/remoteaudiosource.h"
#include "webrtc/api/videotracksource.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/base/sigslot.h"
#include "webrtc/media/base/videobroadcaster.h"
+#include "webrtc/pc/channel.h"
namespace webrtc {
@@ -41,7 +42,7 @@ class AudioRtpReceiver : public ObserverInterface,
AudioRtpReceiver(MediaStreamInterface* stream,
const std::string& track_id,
uint32_t ssrc,
- AudioProviderInterface* provider);
+ cricket::VoiceChannel* channel);
virtual ~AudioRtpReceiver();
@@ -60,6 +61,10 @@ class AudioRtpReceiver : public ObserverInterface,
return track_.get();
}
+ cricket::MediaType media_type() const override {
+ return cricket::MEDIA_TYPE_AUDIO;
+ }
+
std::string id() const override { return id_; }
RtpParameters GetParameters() const override;
@@ -70,17 +75,21 @@ class AudioRtpReceiver : public ObserverInterface,
void SetObserver(RtpReceiverObserverInterface* observer) override;
- cricket::MediaType media_type() override { return cricket::MEDIA_TYPE_AUDIO; }
+ // Does not take ownership.
+ // Should call SetChannel(nullptr) before |channel| is destroyed.
+ void SetChannel(cricket::VoiceChannel* channel);
private:
void Reconfigure();
- void OnFirstAudioPacketReceived();
+ void OnFirstPacketReceived(cricket::BaseChannel* channel);
const std::string id_;
const uint32_t ssrc_;
- AudioProviderInterface* provider_; // Set to null in Stop().
+ cricket::VoiceChannel* channel_;
const rtc::scoped_refptr<AudioTrackInterface> track_;
bool cached_track_enabled_;
+ double cached_volume_ = 1;
+ bool stopped_ = false;
RtpReceiverObserverInterface* observer_ = nullptr;
bool received_first_packet_ = false;
};
@@ -92,7 +101,7 @@ class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInternal>,
const std::string& track_id,
rtc::Thread* worker_thread,
uint32_t ssrc,
- VideoProviderInterface* provider);
+ cricket::VideoChannel* channel);
virtual ~VideoRtpReceiver();
@@ -105,6 +114,10 @@ class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInternal>,
return track_.get();
}
+ cricket::MediaType media_type() const override {
+ return cricket::MEDIA_TYPE_VIDEO;
+ }
+
std::string id() const override { return id_; }
RtpParameters GetParameters() const override;
@@ -115,14 +128,16 @@ class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInternal>,
void SetObserver(RtpReceiverObserverInterface* observer) override;
- cricket::MediaType media_type() override { return cricket::MEDIA_TYPE_VIDEO; }
+ // Does not take ownership.
+ // Should call SetChannel(nullptr) before |channel| is destroyed.
+ void SetChannel(cricket::VideoChannel* channel);
private:
- void OnFirstVideoPacketReceived();
+ void OnFirstPacketReceived(cricket::BaseChannel* channel);
std::string id_;
uint32_t ssrc_;
- VideoProviderInterface* provider_;
+ cricket::VideoChannel* channel_;
// |broadcaster_| is needed since the decoder can only handle one sink.
// It might be better if the decoder can handle multiple sinks and consider
// the VideoSinkWants.
@@ -131,6 +146,7 @@ class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInternal>,
// the VideoRtpReceiver is stopped.
rtc::scoped_refptr<VideoTrackSource> source_;
rtc::scoped_refptr<VideoTrackInterface> track_;
+ bool stopped_ = false;
RtpReceiverObserverInterface* observer_ = nullptr;
bool received_first_packet_ = false;
};
« no previous file with comments | « webrtc/api/remoteaudiosource.cc ('k') | webrtc/api/rtpreceiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698