Skip to content
Snippets Groups Projects
Commit 8ba90d07 authored by Roxie Linden's avatar Roxie Linden
Browse files

Hook up speaker volume.

parent 5f267412
No related branches found
No related tags found
No related merge requests found
......@@ -341,6 +341,28 @@ void LLWebRTCImpl::setMute(bool mute)
});
}
void LLWebRTCImpl::setSpeakerVolume(float volume)
{
mSignalingThread->PostTask(
[this, volume]()
{
auto receivers = mPeerConnection->GetReceivers();
RTC_LOG(LS_INFO) << __FUNCTION__ << "Set volume" << receivers.size();
for (auto &receiver : receivers)
{
webrtc::MediaStreamTrackInterface *track = receiver->track().get();
if (track->kind() == webrtc::MediaStreamTrackInterface::kAudioKind)
{
webrtc::AudioTrackInterface* audio_track = static_cast<webrtc::AudioTrackInterface*>(track);
webrtc::AudioSourceInterface* source = audio_track->GetSource();
source->SetVolume(10.0 * volume);
}
}
});
}
//
// PeerConnectionObserver implementation.
//
......
......@@ -93,6 +93,7 @@ class LLWebRTCAudioInterface
{
public:
virtual void setMute(bool mute) = 0;
virtual void setSpeakerVolume(float volume) = 0; // volume between 0.0 and 1.0
};
class LLWebRTCSignalingObserver
......
......@@ -125,6 +125,7 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface,
// LLWebRTCAudioInterface
//
void setMute(bool mute) override;
void setSpeakerVolume(float folume) override; // range 0.0-1.0
//
// PeerConnectionObserver implementation.
......
This diff is collapsed.
......@@ -712,8 +712,6 @@ class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>,
// We should kill the voice daemon in case of connection alert
bool mTerminateDaemon;
friend class LLWebRTCProtocolParser;
std::string mAccountName;
std::string mAccountPassword;
std::string mChannelSDP;
......@@ -956,118 +954,6 @@ class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>,
LLEventMailDrop mWebRTCPump;
};
/**
* @class LLWebRTCProtocolParser
* @brief This class helps construct new LLIOPipe specializations
* @see LLIOPipe
*
* THOROUGH_DESCRIPTION
*/
class LLWebRTCProtocolParser : public LLIOPipe
{
LOG_CLASS(LLWebRTCProtocolParser);
public:
LLWebRTCProtocolParser();
virtual ~LLWebRTCProtocolParser();
protected:
/* @name LLIOPipe virtual implementations
*/
//@{
/**
* @brief Process the data in buffer
*/
virtual EStatus process_impl(
const LLChannelDescriptors& channels,
buffer_ptr_t& buffer,
bool& eos,
LLSD& context,
LLPumpIO* pump);
//@}
std::string mInput;
// Expat control members
XML_Parser parser;
int responseDepth;
bool ignoringTags;
bool isEvent;
int ignoreDepth;
// Members for processing responses. The values are transient and only valid within a call to processResponse().
int returnCode;
int statusCode;
std::string statusString;
std::string requestId;
std::string actionString;
std::string connectorHandle;
std::string versionID;
std::string mBuildID;
std::string accountHandle;
std::string sessionHandle;
std::string sessionGroupHandle;
std::string alias;
std::string applicationString;
// Members for processing events. The values are transient and only valid within a call to processResponse().
std::string eventTypeString;
int state;
std::string uriString;
bool isChannel;
bool incoming;
bool enabled;
std::string nameString;
std::string audioMediaString;
std::string deviceString;
std::string displayNameString;
int participantType;
bool isLocallyMuted;
bool isModeratorMuted;
bool isSpeaking;
int volume;
F32 energy;
std::string messageHeader;
std::string messageBody;
std::string notificationType;
bool hasText;
bool hasAudio;
bool hasVideo;
bool terminated;
std::string blockMask;
std::string presenceOnly;
std::string autoAcceptMask;
std::string autoAddAsBuddy;
int numberOfAliases;
std::string subscriptionHandle;
std::string subscriptionType;
S32 id;
std::string descriptionString;
LLDate expirationDate;
bool hasExpired;
S32 fontType;
S32 fontStatus;
std::string mediaCompletionType;
// Members for processing text between tags
std::string textBuffer;
bool accumulateText;
void reset();
void processResponse(std::string tag);
static void XMLCALL ExpatStartTag(void *data, const char *el, const char **attr);
static void XMLCALL ExpatEndTag(void *data, const char *el);
static void XMLCALL ExpatCharHandler(void *data, const XML_Char *s, int len);
void StartTag(const char *tag, const char **attr);
void EndTag(const char *tag);
void CharData(const char *buffer, int length);
LLDate expiryTimeStampToLLDate(const std::string& WebRTC_ts);
};
class LLWebRTCSecurity : public LLSingleton<LLWebRTCSecurity>
{
LLSINGLETON(LLWebRTCSecurity);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment