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

Unified Diff: webrtc/api/rtpreceiver.h

Issue 1999853002: Forward the SignalFirstPacketReceived to RtpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Modified the unit test. 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/peerconnection_unittest.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 001264d7a761181f76380a6fc1b27e09569f9f60..3b1fd926cbf33ea67f921e40bbb043cb43f790c9 100644
--- a/webrtc/api/rtpreceiver.h
+++ b/webrtc/api/rtpreceiver.h
@@ -22,6 +22,7 @@
#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"
namespace webrtc {
@@ -34,7 +35,8 @@ class RtpReceiverInternal : public RtpReceiverInterface {
class AudioRtpReceiver : public ObserverInterface,
public AudioSourceInterface::AudioObserver,
- public rtc::RefCountedObject<RtpReceiverInternal> {
+ public rtc::RefCountedObject<RtpReceiverInternal>,
+ public sigslot::has_slots<> {
public:
AudioRtpReceiver(MediaStreamInterface* stream,
const std::string& track_id,
@@ -66,17 +68,25 @@ class AudioRtpReceiver : public ObserverInterface,
// RtpReceiverInternal implementation.
void Stop() override;
+ void SetObserver(RtpReceiverObserverInterface* observer) override;
+
+ cricket::MediaType media_type() override { return cricket::MEDIA_TYPE_AUDIO; }
+
private:
void Reconfigure();
+ void OnFirstAudioPacketReceived();
const std::string id_;
const uint32_t ssrc_;
AudioProviderInterface* provider_; // Set to null in Stop().
const rtc::scoped_refptr<AudioTrackInterface> track_;
bool cached_track_enabled_;
+ RtpReceiverObserverInterface* observer_ = nullptr;
+ bool received_first_packet_ = false;
};
-class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInternal> {
+class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInternal>,
+ public sigslot::has_slots<> {
public:
VideoRtpReceiver(MediaStreamInterface* stream,
const std::string& track_id,
@@ -103,7 +113,13 @@ class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInternal> {
// RtpReceiverInternal implementation.
void Stop() override;
+ void SetObserver(RtpReceiverObserverInterface* observer) override;
+
+ cricket::MediaType media_type() override { return cricket::MEDIA_TYPE_VIDEO; }
+
private:
+ void OnFirstVideoPacketReceived();
+
std::string id_;
uint32_t ssrc_;
VideoProviderInterface* provider_;
@@ -115,6 +131,8 @@ class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInternal> {
// the VideoRtpReceiver is stopped.
rtc::scoped_refptr<VideoTrackSource> source_;
rtc::scoped_refptr<VideoTrackInterface> track_;
+ RtpReceiverObserverInterface* observer_ = nullptr;
+ bool received_first_packet_ = false;
};
} // namespace webrtc
« no previous file with comments | « webrtc/api/peerconnection_unittest.cc ('k') | webrtc/api/rtpreceiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698