2013-07-10 00:45:36 +00:00
|
|
|
/*
|
2016-02-10 07:54:43 -08:00
|
|
|
* Copyright 2012 The WebRTC project authors. All Rights Reserved.
|
2013-07-10 00:45:36 +00:00
|
|
|
*
|
2016-02-10 07:54:43 -08:00
|
|
|
* 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.
|
2013-07-10 00:45:36 +00:00
|
|
|
*/
|
|
|
|
|
|
2016-02-10 10:53:12 +01:00
|
|
|
#ifndef WEBRTC_API_MEDIASTREAMPROVIDER_H_
|
|
|
|
|
#define WEBRTC_API_MEDIASTREAMPROVIDER_H_
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2016-04-27 06:47:29 -07:00
|
|
|
#include <memory>
|
|
|
|
|
|
2016-03-16 19:07:43 -07:00
|
|
|
#include "webrtc/api/rtpsenderinterface.h"
|
2015-09-28 16:53:55 -07:00
|
|
|
#include "webrtc/base/basictypes.h"
|
2016-01-13 12:00:26 -08:00
|
|
|
#include "webrtc/base/scoped_ptr.h"
|
2016-02-04 01:24:52 -08:00
|
|
|
#include "webrtc/media/base/videosinkinterface.h"
|
2016-04-08 02:23:55 -07:00
|
|
|
#include "webrtc/media/base/videosourceinterface.h"
|
2015-09-28 16:53:55 -07:00
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
namespace cricket {
|
|
|
|
|
|
2016-03-08 12:37:39 -08:00
|
|
|
class AudioSource;
|
2016-02-04 01:24:52 -08:00
|
|
|
class VideoFrame;
|
2013-07-10 00:45:36 +00:00
|
|
|
struct AudioOptions;
|
|
|
|
|
struct VideoOptions;
|
|
|
|
|
|
|
|
|
|
} // namespace cricket
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2015-12-12 01:37:01 +01:00
|
|
|
class AudioSinkInterface;
|
|
|
|
|
|
2015-09-28 16:53:55 -07:00
|
|
|
// TODO(deadbeef): Change the key from an ssrc to a "sender_id" or
|
|
|
|
|
// "receiver_id" string, which will be the MSID in the short term and MID in
|
|
|
|
|
// the long term.
|
|
|
|
|
|
|
|
|
|
// TODO(deadbeef): These interfaces are effectively just a way for the
|
|
|
|
|
// RtpSenders/Receivers to get to the BaseChannels. These interfaces should be
|
|
|
|
|
// refactored away eventually, as the classes converge.
|
|
|
|
|
|
2015-11-25 11:26:01 -08:00
|
|
|
// This interface is called by AudioRtpSender/Receivers to change the settings
|
|
|
|
|
// of an audio track connected to certain PeerConnection.
|
2013-07-10 00:45:36 +00:00
|
|
|
class AudioProviderInterface {
|
|
|
|
|
public:
|
|
|
|
|
// Enable/disable the audio playout of a remote audio track with |ssrc|.
|
2015-10-09 08:55:48 -07:00
|
|
|
virtual void SetAudioPlayout(uint32_t ssrc, bool enable) = 0;
|
2013-07-10 00:45:36 +00:00
|
|
|
// Enable/disable sending audio on the local audio track with |ssrc|.
|
|
|
|
|
// When |enable| is true |options| should be applied to the audio track.
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
virtual void SetAudioSend(uint32_t ssrc,
|
|
|
|
|
bool enable,
|
2013-07-26 19:17:59 +00:00
|
|
|
const cricket::AudioOptions& options,
|
2016-03-08 12:37:39 -08:00
|
|
|
cricket::AudioSource* source) = 0;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2014-02-13 23:18:49 +00:00
|
|
|
// Sets the audio playout volume of a remote audio track with |ssrc|.
|
|
|
|
|
// |volume| is in the range of [0, 10].
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
virtual void SetAudioPlayoutVolume(uint32_t ssrc, double volume) = 0;
|
2014-02-13 23:18:49 +00:00
|
|
|
|
2015-12-12 01:37:01 +01:00
|
|
|
// Allows for setting a direct audio sink for an incoming audio source.
|
|
|
|
|
// Only one audio sink is supported per ssrc and ownership of the sink is
|
|
|
|
|
// passed to the provider.
|
|
|
|
|
virtual void SetRawAudioSink(
|
|
|
|
|
uint32_t ssrc,
|
2016-04-27 06:47:29 -07:00
|
|
|
std::unique_ptr<webrtc::AudioSinkInterface> sink) = 0;
|
2015-12-12 01:37:01 +01:00
|
|
|
|
2016-03-16 19:07:43 -07:00
|
|
|
virtual RtpParameters GetAudioRtpParameters(uint32_t ssrc) const = 0;
|
|
|
|
|
virtual bool SetAudioRtpParameters(uint32_t ssrc,
|
|
|
|
|
const RtpParameters& parameters) = 0;
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
protected:
|
|
|
|
|
virtual ~AudioProviderInterface() {}
|
|
|
|
|
};
|
|
|
|
|
|
2015-11-25 11:26:01 -08:00
|
|
|
// This interface is called by VideoRtpSender/Receivers to change the settings
|
|
|
|
|
// of a video track connected to a certain PeerConnection.
|
2013-07-10 00:45:36 +00:00
|
|
|
class VideoProviderInterface {
|
|
|
|
|
public:
|
2016-04-08 02:23:55 -07:00
|
|
|
virtual bool SetSource(
|
|
|
|
|
uint32_t ssrc,
|
|
|
|
|
rtc::VideoSourceInterface<cricket::VideoFrame>* source) = 0;
|
2013-07-10 00:45:36 +00:00
|
|
|
// Enable/disable the video playout of a remote video track with |ssrc|.
|
2016-02-04 01:24:52 -08:00
|
|
|
virtual void SetVideoPlayout(
|
|
|
|
|
uint32_t ssrc,
|
|
|
|
|
bool enable,
|
|
|
|
|
rtc::VideoSinkInterface<cricket::VideoFrame>* sink) = 0;
|
2013-07-10 00:45:36 +00:00
|
|
|
// Enable sending video on the local video track with |ssrc|.
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
virtual void SetVideoSend(uint32_t ssrc,
|
|
|
|
|
bool enable,
|
2013-07-10 00:45:36 +00:00
|
|
|
const cricket::VideoOptions* options) = 0;
|
|
|
|
|
|
2016-03-16 19:07:43 -07:00
|
|
|
virtual RtpParameters GetVideoRtpParameters(uint32_t ssrc) const = 0;
|
|
|
|
|
virtual bool SetVideoRtpParameters(uint32_t ssrc,
|
|
|
|
|
const RtpParameters& parameters) = 0;
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
protected:
|
|
|
|
|
virtual ~VideoProviderInterface() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2016-02-10 10:53:12 +01:00
|
|
|
#endif // WEBRTC_API_MEDIASTREAMPROVIDER_H_
|