Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: webrtc/media/base/mediachannel.h

Issue 1695663003: Drop VideoOptions from VideoSendParameters. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 ost << "}"; 851 ost << "}";
852 return ost.str(); 852 return ost.str();
853 } 853 }
854 854
855 std::vector<Codec> codecs; 855 std::vector<Codec> codecs;
856 std::vector<RtpHeaderExtension> extensions; 856 std::vector<RtpHeaderExtension> extensions;
857 // TODO(pthatcher): Add streams. 857 // TODO(pthatcher): Add streams.
858 RtcpParameters rtcp; 858 RtcpParameters rtcp;
859 }; 859 };
860 860
861 template <class Codec, class Options> 861 template <class Codec>
862 struct RtpSendParameters : RtpParameters<Codec> { 862 struct RtpSendParameters : RtpParameters<Codec> {
863 std::string ToString() const override { 863 std::string ToString() const override {
864 std::ostringstream ost; 864 std::ostringstream ost;
865 ost << "{"; 865 ost << "{";
866 ost << "codecs: " << VectorToString(this->codecs) << ", "; 866 ost << "codecs: " << VectorToString(this->codecs) << ", ";
867 ost << "extensions: " << VectorToString(this->extensions) << ", "; 867 ost << "extensions: " << VectorToString(this->extensions) << ", ";
868 ost << "max_bandwidth_bps: " << max_bandwidth_bps << ", "; 868 ost << "max_bandwidth_bps: " << max_bandwidth_bps << ", ";
869 ost << "}";
870 return ost.str();
871 }
872
873 int max_bandwidth_bps = -1;
874 };
875
876 struct AudioSendParameters : RtpSendParameters<AudioCodec> {
877 std::string ToString() const override {
878 std::ostringstream ost;
879 ost << "{";
880 ost << "codecs: " << VectorToString(this->codecs) << ", ";
881 ost << "extensions: " << VectorToString(this->extensions) << ", ";
882 ost << "max_bandwidth_bps: " << max_bandwidth_bps << ", ";
869 ost << "options: " << options.ToString(); 883 ost << "options: " << options.ToString();
870 ost << "}"; 884 ost << "}";
871 return ost.str(); 885 return ost.str();
872 } 886 }
873 887
874 int max_bandwidth_bps = -1; 888 AudioOptions options;
875 Options options;
876 };
877
878 struct AudioSendParameters : RtpSendParameters<AudioCodec, AudioOptions> {
879 }; 889 };
880 890
881 struct AudioRecvParameters : RtpParameters<AudioCodec> { 891 struct AudioRecvParameters : RtpParameters<AudioCodec> {
882 }; 892 };
883 893
884 class VoiceMediaChannel : public MediaChannel { 894 class VoiceMediaChannel : public MediaChannel {
885 public: 895 public:
886 enum Error { 896 enum Error {
887 ERROR_NONE = 0, // No error. 897 ERROR_NONE = 0, // No error.
888 ERROR_OTHER, // Other errors. 898 ERROR_OTHER, // Other errors.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 // DTMF event 0-9, *, #, A-D. 948 // DTMF event 0-9, *, #, A-D.
939 virtual bool InsertDtmf(uint32_t ssrc, int event, int duration) = 0; 949 virtual bool InsertDtmf(uint32_t ssrc, int event, int duration) = 0;
940 // Gets quality stats for the channel. 950 // Gets quality stats for the channel.
941 virtual bool GetStats(VoiceMediaInfo* info) = 0; 951 virtual bool GetStats(VoiceMediaInfo* info) = 0;
942 952
943 virtual void SetRawAudioSink( 953 virtual void SetRawAudioSink(
944 uint32_t ssrc, 954 uint32_t ssrc,
945 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) = 0; 955 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) = 0;
946 }; 956 };
947 957
948 struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> { 958 struct VideoSendParameters : RtpSendParameters<VideoCodec> {
949 }; 959 };
950 960
951 struct VideoRecvParameters : RtpParameters<VideoCodec> { 961 struct VideoRecvParameters : RtpParameters<VideoCodec> {
952 }; 962 };
953 963
954 class VideoMediaChannel : public MediaChannel { 964 class VideoMediaChannel : public MediaChannel {
955 public: 965 public:
956 enum Error { 966 enum Error {
957 ERROR_NONE = 0, // No error. 967 ERROR_NONE = 0, // No error.
958 ERROR_OTHER, // Other errors. 968 ERROR_OTHER, // Other errors.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 // TODO(pthatcher): Make these true by default? 1062 // TODO(pthatcher): Make these true by default?
1053 ordered(false), 1063 ordered(false),
1054 reliable(false), 1064 reliable(false),
1055 max_rtx_count(0), 1065 max_rtx_count(0),
1056 max_rtx_ms(0) { 1066 max_rtx_ms(0) {
1057 } 1067 }
1058 }; 1068 };
1059 1069
1060 enum SendDataResult { SDR_SUCCESS, SDR_ERROR, SDR_BLOCK }; 1070 enum SendDataResult { SDR_SUCCESS, SDR_ERROR, SDR_BLOCK };
1061 1071
1062 struct DataOptions { 1072 struct DataSendParameters : RtpSendParameters<DataCodec> {
1063 std::string ToString() const {
1064 return "{}";
1065 }
1066 };
1067
1068 struct DataSendParameters : RtpSendParameters<DataCodec, DataOptions> {
1069 std::string ToString() const { 1073 std::string ToString() const {
1070 std::ostringstream ost; 1074 std::ostringstream ost;
1071 // Options and extensions aren't used. 1075 // Options and extensions aren't used.
1072 ost << "{"; 1076 ost << "{";
1073 ost << "codecs: " << VectorToString(codecs) << ", "; 1077 ost << "codecs: " << VectorToString(codecs) << ", ";
1074 ost << "max_bandwidth_bps: " << max_bandwidth_bps; 1078 ost << "max_bandwidth_bps: " << max_bandwidth_bps;
1075 ost << "}"; 1079 ost << "}";
1076 return ost.str(); 1080 return ost.str();
1077 } 1081 }
1078 }; 1082 };
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 // Signal when the media channel is ready to send the stream. Arguments are: 1118 // Signal when the media channel is ready to send the stream. Arguments are:
1115 // writable(bool) 1119 // writable(bool)
1116 sigslot::signal1<bool> SignalReadyToSend; 1120 sigslot::signal1<bool> SignalReadyToSend;
1117 // Signal for notifying that the remote side has closed the DataChannel. 1121 // Signal for notifying that the remote side has closed the DataChannel.
1118 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; 1122 sigslot::signal1<uint32_t> SignalStreamClosedRemotely;
1119 }; 1123 };
1120 1124
1121 } // namespace cricket 1125 } // namespace cricket
1122 1126
1123 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ 1127 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698