| Index: webrtc/pc/mediasession.h
|
| diff --git a/webrtc/pc/mediasession.h b/webrtc/pc/mediasession.h
|
| index 39ac26bd8dad104c5b10b0d450caf7cf67e85233..37cb438b4eb00e4332ba72f36c2f55b0fc31cc72 100644
|
| --- a/webrtc/pc/mediasession.h
|
| +++ b/webrtc/pc/mediasession.h
|
| @@ -52,6 +52,8 @@ enum MediaContentDirection {
|
| MD_SENDRECV
|
| };
|
|
|
| +std::string MediaContentDirectionToString(MediaContentDirection direction);
|
| +
|
| enum CryptoType {
|
| CT_NONE,
|
| CT_SDES,
|
| @@ -79,6 +81,30 @@ const int kBufferedModeDisabled = 0;
|
| // Default RTCP CNAME for unit tests.
|
| const char kDefaultRtcpCname[] = "DefaultRtcpCname";
|
|
|
| +struct RtpTransceiverDirection {
|
| + bool send;
|
| + bool recv;
|
| +
|
| + RtpTransceiverDirection(bool send, bool recv) : send(send), recv(recv) {}
|
| +
|
| + bool operator==(const RtpTransceiverDirection& o) const {
|
| + return send == o.send && recv == o.recv;
|
| + }
|
| +
|
| + bool operator!=(const RtpTransceiverDirection& o) const {
|
| + return !(*this == o);
|
| + }
|
| +
|
| + static RtpTransceiverDirection FromMediaContentDirection(
|
| + MediaContentDirection md);
|
| +
|
| + MediaContentDirection ToMediaContentDirection() const;
|
| +};
|
| +
|
| +RtpTransceiverDirection
|
| +NegotiateRtpTransceiverDirection(RtpTransceiverDirection offer,
|
| + RtpTransceiverDirection wants);
|
| +
|
| struct MediaSessionOptions {
|
| MediaSessionOptions()
|
| : recv_audio(true),
|
| @@ -395,8 +421,11 @@ class MediaSessionDescriptionFactory {
|
| MediaSessionDescriptionFactory(ChannelManager* cmanager,
|
| const TransportDescriptionFactory* factory);
|
|
|
| - const AudioCodecs& audio_codecs() const { return audio_codecs_; }
|
| - void set_audio_codecs(const AudioCodecs& codecs) { audio_codecs_ = codecs; }
|
| + const AudioCodecs& audio_codecs() const;
|
| + const AudioCodecs& audio_send_codecs() const;
|
| + const AudioCodecs& audio_recv_codecs() const;
|
| + void set_audio_codecs(const AudioCodecs& send_codecs,
|
| + const AudioCodecs& recv_codecs);
|
| void set_audio_rtp_header_extensions(const RtpHeaderExtensions& extensions) {
|
| audio_rtp_extensions_ = extensions;
|
| }
|
| @@ -430,7 +459,15 @@ class MediaSessionDescriptionFactory {
|
| const SessionDescription* current_description) const;
|
|
|
| private:
|
| + const AudioCodecs& GetAudioCodecsForOffer(
|
| + const RtpTransceiverDirection& direction) const;
|
| + const AudioCodecs& GetAudioCodecsForAnswer(
|
| + const RtpTransceiverDirection& offer,
|
| + const RtpTransceiverDirection& answer) const;
|
| void GetCodecsToOffer(const SessionDescription* current_description,
|
| + const AudioCodecs& supported_audio_codecs,
|
| + const VideoCodecs& supported_video_codecs,
|
| + const DataCodecs& supported_data_codecs,
|
| AudioCodecs* audio_codecs,
|
| VideoCodecs* video_codecs,
|
| DataCodecs* data_codecs) const;
|
| @@ -502,7 +539,9 @@ class MediaSessionDescriptionFactory {
|
| StreamParamsVec* current_streams,
|
| SessionDescription* answer) const;
|
|
|
| - AudioCodecs audio_codecs_;
|
| + AudioCodecs audio_send_codecs_;
|
| + AudioCodecs audio_recv_codecs_;
|
| + AudioCodecs audio_sendrecv_codecs_;
|
| RtpHeaderExtensions audio_rtp_extensions_;
|
| VideoCodecs video_codecs_;
|
| RtpHeaderExtensions video_rtp_extensions_;
|
|
|