Files
platform-external-webrtc/webrtc/api/mediastreamprovider.h
skvlad dc1c62cd30 Enable setting the maximum bitrate limit in RtpSender.
This change allows the application to limit the bitrate of the outgoing
audio and video streams at runtime. The API roughly follows the WebRTC
API draft, defining the RTCRtpParameters structure witn exactly one
encoding (simulcast streams are not exposed in the API for now).
(https://www.w3.org/TR/webrtc/#idl-def-RTCRtpParameters)

BUG=

Review URL: https://codereview.webrtc.org/1788583004

Cr-Commit-Position: refs/heads/master@{#12025}
2016-03-17 02:07:49 +00:00

101 lines
3.6 KiB
C++

/*
* Copyright 2012 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 WEBRTC_API_MEDIASTREAMPROVIDER_H_
#define WEBRTC_API_MEDIASTREAMPROVIDER_H_
#include "webrtc/api/rtpsenderinterface.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/media/base/videosinkinterface.h"
namespace cricket {
class AudioSource;
class VideoCapturer;
class VideoFrame;
class VideoRenderer;
struct AudioOptions;
struct VideoOptions;
} // namespace cricket
namespace webrtc {
class AudioSinkInterface;
// 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.
// This interface is called by AudioRtpSender/Receivers to change the settings
// of an audio track connected to certain PeerConnection.
class AudioProviderInterface {
public:
// Enable/disable the audio playout of a remote audio track with |ssrc|.
virtual void SetAudioPlayout(uint32_t ssrc, bool enable) = 0;
// Enable/disable sending audio on the local audio track with |ssrc|.
// When |enable| is true |options| should be applied to the audio track.
virtual void SetAudioSend(uint32_t ssrc,
bool enable,
const cricket::AudioOptions& options,
cricket::AudioSource* source) = 0;
// Sets the audio playout volume of a remote audio track with |ssrc|.
// |volume| is in the range of [0, 10].
virtual void SetAudioPlayoutVolume(uint32_t ssrc, double volume) = 0;
// 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,
rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) = 0;
virtual RtpParameters GetAudioRtpParameters(uint32_t ssrc) const = 0;
virtual bool SetAudioRtpParameters(uint32_t ssrc,
const RtpParameters& parameters) = 0;
protected:
virtual ~AudioProviderInterface() {}
};
// This interface is called by VideoRtpSender/Receivers to change the settings
// of a video track connected to a certain PeerConnection.
class VideoProviderInterface {
public:
virtual bool SetCaptureDevice(uint32_t ssrc,
cricket::VideoCapturer* camera) = 0;
// Enable/disable the video playout of a remote video track with |ssrc|.
virtual void SetVideoPlayout(
uint32_t ssrc,
bool enable,
rtc::VideoSinkInterface<cricket::VideoFrame>* sink) = 0;
// Enable sending video on the local video track with |ssrc|.
virtual void SetVideoSend(uint32_t ssrc,
bool enable,
const cricket::VideoOptions* options) = 0;
virtual RtpParameters GetVideoRtpParameters(uint32_t ssrc) const = 0;
virtual bool SetVideoRtpParameters(uint32_t ssrc,
const RtpParameters& parameters) = 0;
protected:
virtual ~VideoProviderInterface() {}
};
} // namespace webrtc
#endif // WEBRTC_API_MEDIASTREAMPROVIDER_H_