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

Unified Diff: talk/media/base/fakemediaengine.h

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: google::int32 Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: talk/media/base/fakemediaengine.h
diff --git a/talk/media/base/fakemediaengine.h b/talk/media/base/fakemediaengine.h
index 3c48aed8df4719e8e8a842dbd630c375030a760c..c18e023d41ba7ef97d71e91a4e4f8f2989592c41 100644
--- a/talk/media/base/fakemediaengine.h
+++ b/talk/media/base/fakemediaengine.h
@@ -113,7 +113,7 @@ template <class Base> class RtpHelper : public Base {
send_streams_.push_back(sp);
return true;
}
- virtual bool RemoveSendStream(uint32 ssrc) {
+ virtual bool RemoveSendStream(uint32_t ssrc) {
return RemoveStreamBySsrc(&send_streams_, ssrc);
}
virtual bool AddRecvStream(const StreamParams& sp) {
@@ -124,10 +124,10 @@ template <class Base> class RtpHelper : public Base {
receive_streams_.push_back(sp);
return true;
}
- virtual bool RemoveRecvStream(uint32 ssrc) {
+ virtual bool RemoveRecvStream(uint32_t ssrc) {
return RemoveStreamBySsrc(&receive_streams_, ssrc);
}
- bool IsStreamMuted(uint32 ssrc) const {
+ bool IsStreamMuted(uint32_t ssrc) const {
bool ret = muted_streams_.find(ssrc) != muted_streams_.end();
// If |ssrc = 0| check if the first send stream is muted.
if (!ret && ssrc == 0 && !send_streams_.empty()) {
@@ -142,15 +142,15 @@ template <class Base> class RtpHelper : public Base {
const std::vector<StreamParams>& recv_streams() const {
return receive_streams_;
}
- bool HasRecvStream(uint32 ssrc) const {
+ bool HasRecvStream(uint32_t ssrc) const {
return GetStreamBySsrc(receive_streams_, ssrc) != nullptr;
}
- bool HasSendStream(uint32 ssrc) const {
+ bool HasSendStream(uint32_t ssrc) const {
return GetStreamBySsrc(send_streams_, ssrc) != nullptr;
}
// TODO(perkj): This is to support legacy unit test that only check one
// sending stream.
- uint32 send_ssrc() const {
+ uint32_t send_ssrc() const {
if (send_streams_.empty())
return 0;
return send_streams_[0].first_ssrc();
@@ -169,7 +169,7 @@ template <class Base> class RtpHelper : public Base {
}
protected:
- bool MuteStream(uint32 ssrc, bool mute) {
+ bool MuteStream(uint32_t ssrc, bool mute) {
if (!HasSendStream(ssrc) && ssrc != 0) {
return false;
}
@@ -218,10 +218,10 @@ template <class Base> class RtpHelper : public Base {
std::list<std::string> rtcp_packets_;
std::vector<StreamParams> send_streams_;
std::vector<StreamParams> receive_streams_;
- std::set<uint32> muted_streams_;
+ std::set<uint32_t> muted_streams_;
bool fail_set_send_codecs_;
bool fail_set_recv_codecs_;
- uint32 send_ssrc_;
+ uint32_t send_ssrc_;
std::string rtcp_cname_;
bool ready_to_send_;
};
@@ -229,10 +229,12 @@ template <class Base> class RtpHelper : public Base {
class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
public:
struct DtmfInfo {
- DtmfInfo(uint32 ssrc, int event_code, int duration, int flags)
- : ssrc(ssrc), event_code(event_code), duration(duration), flags(flags) {
- }
- uint32 ssrc;
+ DtmfInfo(uint32_t ssrc, int event_code, int duration, int flags)
+ : ssrc(ssrc),
+ event_code(event_code),
+ duration(duration),
+ flags(flags) {}
+ uint32_t ssrc;
int event_code;
int duration;
int flags;
@@ -257,7 +259,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
}
const AudioOptions& options() const { return options_; }
- uint32 ringback_tone_ssrc() const { return ringback_tone_ssrc_; }
+ uint32_t ringback_tone_ssrc() const { return ringback_tone_ssrc_; }
bool ringback_tone_play() const { return ringback_tone_play_; }
bool ringback_tone_loop() const { return ringback_tone_loop_; }
@@ -282,7 +284,8 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
}
return set_sending(flag != SEND_NOTHING);
}
- virtual bool SetAudioSend(uint32 ssrc, bool mute,
+ virtual bool SetAudioSend(uint32_t ssrc,
+ bool mute,
const AudioOptions* options,
AudioRenderer* renderer) {
if (!SetLocalRenderer(ssrc, renderer)) {
@@ -302,14 +305,14 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
output_scalings_[sp.first_ssrc()] = OutputScaling();
return true;
}
- virtual bool RemoveRecvStream(uint32 ssrc) {
+ virtual bool RemoveRecvStream(uint32_t ssrc) {
if (!RtpHelper<VoiceMediaChannel>::RemoveRecvStream(ssrc))
return false;
output_scalings_.erase(ssrc);
return true;
}
- virtual bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) {
- std::map<uint32, AudioRenderer*>::iterator it =
+ virtual bool SetRemoteRenderer(uint32_t ssrc, AudioRenderer* renderer) {
+ std::map<uint32_t, AudioRenderer*>::iterator it =
remote_renderers_.find(ssrc);
if (renderer) {
if (it != remote_renderers_.end()) {
@@ -338,7 +341,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
int penalty_decay, int type_event_delay) {}
virtual bool SetRingbackTone(const char* buf, int len) { return true; }
- virtual bool PlayRingbackTone(uint32 ssrc, bool play, bool loop) {
+ virtual bool PlayRingbackTone(uint32_t ssrc, bool play, bool loop) {
ringback_tone_ssrc_ = ssrc;
ringback_tone_play_ = play;
ringback_tone_loop_ = loop;
@@ -355,15 +358,17 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
}
return false;
}
- virtual bool InsertDtmf(uint32 ssrc, int event_code, int duration,
+ virtual bool InsertDtmf(uint32_t ssrc,
+ int event_code,
+ int duration,
int flags) {
dtmf_info_queue_.push_back(DtmfInfo(ssrc, event_code, duration, flags));
return true;
}
- virtual bool SetOutputScaling(uint32 ssrc, double left, double right) {
+ virtual bool SetOutputScaling(uint32_t ssrc, double left, double right) {
if (0 == ssrc) {
- std::map<uint32, OutputScaling>::iterator it;
+ std::map<uint32_t, OutputScaling>::iterator it;
for (it = output_scalings_.begin(); it != output_scalings_.end(); ++it) {
it->second.left = left;
it->second.right = right;
@@ -376,7 +381,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
}
return false;
}
- bool GetOutputScaling(uint32 ssrc, double* left, double* right) {
+ bool GetOutputScaling(uint32_t ssrc, double* left, double* right) {
if (output_scalings_.find(ssrc) == output_scalings_.end())
return false;
*left = output_scalings_[ssrc].left;
@@ -385,7 +390,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
}
virtual bool GetStats(VoiceMediaInfo* info) { return false; }
- virtual void GetLastMediaError(uint32* ssrc,
+ virtual void GetLastMediaError(uint32_t* ssrc,
VoiceMediaChannel::Error* error) {
*ssrc = 0;
*error = fail_set_send_ ? VoiceMediaChannel::ERROR_REC_DEVICE_OPEN_FAILED
@@ -393,7 +398,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
}
void set_fail_set_send(bool fail) { fail_set_send_ = fail; }
- void TriggerError(uint32 ssrc, VoiceMediaChannel::Error error) {
+ void TriggerError(uint32_t ssrc, VoiceMediaChannel::Error error) {
VoiceMediaChannel::SignalMediaError(ssrc, error);
}
@@ -450,7 +455,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
options_.SetAll(options);
return true;
}
- bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer) {
+ bool SetLocalRenderer(uint32_t ssrc, AudioRenderer* renderer) {
auto it = local_renderers_.find(ssrc);
if (renderer) {
if (it != local_renderers_.end()) {
@@ -471,21 +476,23 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
FakeVoiceEngine* engine_;
std::vector<AudioCodec> recv_codecs_;
std::vector<AudioCodec> send_codecs_;
- std::map<uint32, OutputScaling> output_scalings_;
+ std::map<uint32_t, OutputScaling> output_scalings_;
std::vector<DtmfInfo> dtmf_info_queue_;
bool fail_set_send_;
- uint32 ringback_tone_ssrc_;
+ uint32_t ringback_tone_ssrc_;
bool ringback_tone_play_;
bool ringback_tone_loop_;
int time_since_last_typing_;
AudioOptions options_;
- std::map<uint32, VoiceChannelAudioSink*> local_renderers_;
- std::map<uint32, AudioRenderer*> remote_renderers_;
+ std::map<uint32_t, VoiceChannelAudioSink*> local_renderers_;
+ std::map<uint32_t, AudioRenderer*> remote_renderers_;
};
// A helper function to compare the FakeVoiceMediaChannel::DtmfInfo.
inline bool CompareDtmfInfo(const FakeVoiceMediaChannel::DtmfInfo& info,
- uint32 ssrc, int event_code, int duration,
+ uint32_t ssrc,
+ int event_code,
+ int duration,
int flags) {
return (info.duration == duration && info.event_code == event_code &&
info.flags == flags && info.ssrc == ssrc);
@@ -509,18 +516,18 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
const std::vector<VideoCodec>& codecs() const { return send_codecs(); }
bool rendering() const { return playout(); }
const VideoOptions& options() const { return options_; }
- const std::map<uint32, VideoRenderer*>& renderers() const {
+ const std::map<uint32_t, VideoRenderer*>& renderers() const {
return renderers_;
}
int max_bps() const { return max_bps_; }
- bool GetSendStreamFormat(uint32 ssrc, VideoFormat* format) {
+ bool GetSendStreamFormat(uint32_t ssrc, VideoFormat* format) {
if (send_formats_.find(ssrc) == send_formats_.end()) {
return false;
}
*format = send_formats_[ssrc];
return true;
}
- virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) {
+ virtual bool SetSendStreamFormat(uint32_t ssrc, const VideoFormat& format) {
if (send_formats_.find(ssrc) == send_formats_.end()) {
return false;
}
@@ -545,7 +552,7 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
SetSendStreamDefaultFormat(sp.first_ssrc());
return true;
}
- virtual bool RemoveSendStream(uint32 ssrc) {
+ virtual bool RemoveSendStream(uint32_t ssrc) {
send_formats_.erase(ssrc);
return RtpHelper<VideoMediaChannel>::RemoveSendStream(ssrc);
}
@@ -561,7 +568,7 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
set_playout(render);
return true;
}
- virtual bool SetRenderer(uint32 ssrc, VideoRenderer* r) {
+ virtual bool SetRenderer(uint32_t ssrc, VideoRenderer* r) {
if (ssrc != 0 && renderers_.find(ssrc) == renderers_.end()) {
return false;
}
@@ -572,7 +579,8 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
}
virtual bool SetSend(bool send) { return set_sending(send); }
- virtual bool SetVideoSend(uint32 ssrc, bool mute,
+ virtual bool SetVideoSend(uint32_t ssrc,
+ bool mute,
const VideoOptions* options) {
if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, mute)) {
return false;
@@ -582,11 +590,11 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
}
return true;
}
- virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) {
+ virtual bool SetCapturer(uint32_t ssrc, VideoCapturer* capturer) {
capturers_[ssrc] = capturer;
return true;
}
- bool HasCapturer(uint32 ssrc) const {
+ bool HasCapturer(uint32_t ssrc) const {
return capturers_.find(ssrc) != capturers_.end();
}
virtual bool AddRecvStream(const StreamParams& sp) {
@@ -595,7 +603,7 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
renderers_[sp.first_ssrc()] = NULL;
return true;
}
- virtual bool RemoveRecvStream(uint32 ssrc) {
+ virtual bool RemoveRecvStream(uint32_t ssrc) {
if (!RtpHelper<VideoMediaChannel>::RemoveRecvStream(ssrc))
return false;
renderers_.erase(ssrc);
@@ -649,7 +657,7 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
}
// Be default, each send stream uses the first send codec format.
- void SetSendStreamDefaultFormat(uint32 ssrc) {
+ void SetSendStreamDefaultFormat(uint32_t ssrc) {
if (!send_codecs_.empty()) {
send_formats_[ssrc] = VideoFormat(
send_codecs_[0].width, send_codecs_[0].height,
@@ -661,9 +669,9 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
FakeVideoEngine* engine_;
std::vector<VideoCodec> recv_codecs_;
std::vector<VideoCodec> send_codecs_;
- std::map<uint32, VideoRenderer*> renderers_;
- std::map<uint32, VideoFormat> send_formats_;
- std::map<uint32, VideoCapturer*> capturers_;
+ std::map<uint32_t, VideoRenderer*> renderers_;
+ std::map<uint32_t, VideoFormat> send_formats_;
+ std::map<uint32_t, VideoCapturer*> capturers_;
bool sent_intra_frame_;
bool requested_intra_frame_;
VideoOptions options_;
@@ -697,7 +705,7 @@ class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> {
return false;
return true;
}
- virtual bool RemoveRecvStream(uint32 ssrc) {
+ virtual bool RemoveRecvStream(uint32_t ssrc) {
if (!RtpHelper<DataMediaChannel>::RemoveRecvStream(ssrc))
return false;
return true;
@@ -858,7 +866,8 @@ class FakeVoiceEngine : public FakeBaseEngine {
bool StartAecDump(rtc::PlatformFile file) { return false; }
- bool RegisterProcessor(uint32 ssrc, VoiceProcessor* voice_processor,
+ bool RegisterProcessor(uint32_t ssrc,
+ VoiceProcessor* voice_processor,
MediaProcessorDirection direction) {
if (direction == MPD_RX) {
rx_processor_ = voice_processor;
@@ -870,7 +879,8 @@ class FakeVoiceEngine : public FakeBaseEngine {
return false;
}
- bool UnregisterProcessor(uint32 ssrc, VoiceProcessor* voice_processor,
+ bool UnregisterProcessor(uint32_t ssrc,
+ VoiceProcessor* voice_processor,
MediaProcessorDirection direction) {
bool unregistered = false;
if (direction & MPD_RX) {

Powered by Google App Engine
This is Rietveld 408576698