webrtc_m130/api/test/mock_rtpreceiver.h

40 lines
1.4 KiB
C
Raw Normal View History

/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef API_TEST_MOCK_RTPRECEIVER_H_
#define API_TEST_MOCK_RTPRECEIVER_H_
#include <string>
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ ) Reason for revert: Re-land, reverting did not fix bug. https://bugs.chromium.org/p/webrtc/issues/detail?id=7465 Original issue's description: > Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ ) > > Reason for revert: > Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see > > https://bugs.chromium.org/p/webrtc/issues/detail?id=7465 > > Original issue's description: > > Added the GetSources() to the RtpReceiverInterface and implemented > > it for the AudioRtpReceiver. > > > > This method returns a vector of RtpSource(both CSRC source and SSRC > > source) which contains the ID of a source, the timestamp, the source > > type (SSRC or CSRC) and the audio level. > > > > The RtpSource objects are buffered and maintained by the > > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called, > > the info of the contributing source will be pulled along the object > > chain: > > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel -> > > AudioReceiveStream -> voe::Channel -> RtpRtcp module > > > > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource > > > > BUG=chromium:703122 > > TBR=stefan@webrtc.org, danilchap@webrtc.org > > > > Review-Url: https://codereview.webrtc.org/2770233003 > > Cr-Commit-Position: refs/heads/master@{#17591} > > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053 > > TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org > # Not skipping CQ checks because original CL landed more than 1 days ago. > BUG=chromium:703122 > > Review-Url: https://codereview.webrtc.org/2809613002 > Cr-Commit-Position: refs/heads/master@{#17616} > Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675 TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:703122 Review-Url: https://codereview.webrtc.org/2810623003 Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
#include <vector>
#include "api/rtp_receiver_interface.h"
#include "test/gmock.h"
namespace webrtc {
class MockRtpReceiver : public rtc::RefCountedObject<RtpReceiverInterface> {
public:
MOCK_METHOD1(SetTrack, void(MediaStreamTrackInterface*));
MOCK_CONST_METHOD0(track, rtc::scoped_refptr<MediaStreamTrackInterface>());
MOCK_CONST_METHOD0(streams,
std::vector<rtc::scoped_refptr<MediaStreamInterface>>());
MOCK_CONST_METHOD0(media_type, cricket::MediaType());
MOCK_CONST_METHOD0(id, std::string());
MOCK_CONST_METHOD0(GetParameters, RtpParameters());
MOCK_METHOD1(SetParameters, bool(const RtpParameters&));
MOCK_METHOD1(SetObserver, void(RtpReceiverObserverInterface*));
MOCK_METHOD1(SetJitterBufferMinimumDelay, void(absl::optional<double>));
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ ) Reason for revert: Re-land, reverting did not fix bug. https://bugs.chromium.org/p/webrtc/issues/detail?id=7465 Original issue's description: > Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ ) > > Reason for revert: > Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see > > https://bugs.chromium.org/p/webrtc/issues/detail?id=7465 > > Original issue's description: > > Added the GetSources() to the RtpReceiverInterface and implemented > > it for the AudioRtpReceiver. > > > > This method returns a vector of RtpSource(both CSRC source and SSRC > > source) which contains the ID of a source, the timestamp, the source > > type (SSRC or CSRC) and the audio level. > > > > The RtpSource objects are buffered and maintained by the > > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called, > > the info of the contributing source will be pulled along the object > > chain: > > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel -> > > AudioReceiveStream -> voe::Channel -> RtpRtcp module > > > > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource > > > > BUG=chromium:703122 > > TBR=stefan@webrtc.org, danilchap@webrtc.org > > > > Review-Url: https://codereview.webrtc.org/2770233003 > > Cr-Commit-Position: refs/heads/master@{#17591} > > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053 > > TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org > # Not skipping CQ checks because original CL landed more than 1 days ago. > BUG=chromium:703122 > > Review-Url: https://codereview.webrtc.org/2809613002 > Cr-Commit-Position: refs/heads/master@{#17616} > Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675 TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:703122 Review-Url: https://codereview.webrtc.org/2810623003 Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
MOCK_CONST_METHOD0(GetSources, std::vector<RtpSource>());
};
} // namespace webrtc
#endif // API_TEST_MOCK_RTPRECEIVER_H_