From de5a10a044a9e13f913d1bf9d61607a42d7671ea Mon Sep 17 00:00:00 2001 From: "amyfong@webrtc.org" Date: Tue, 3 Jan 2012 21:06:26 +0000 Subject: [PATCH] Added in setting the minimum bit rate of a codec to ViE Custom Call Review URL: http://webrtc-codereview.appspot.com/333019 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1319 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../source/vie_autotest_custom_call.cc | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/video_engine/test/auto_test/source/vie_autotest_custom_call.cc b/src/video_engine/test/auto_test/source/vie_autotest_custom_call.cc index 7d0ef0be6..d9c209e70 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest_custom_call.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest_custom_call.cc @@ -26,6 +26,7 @@ #define DEFAULT_VIDEO_CODEC_WIDTH 640 #define DEFAULT_VIDEO_CODEC_HEIGHT 480 #define DEFAULT_VIDEO_CODEC_BITRATE 300 +#define DEFAULT_VIDEO_CODEC_MIN_BITRATE 100 #define DEFAULT_VIDEO_CODEC_MAX_BITRATE 1000 #define DEFAULT_AUDIO_PORT 11113 #define DEFAULT_AUDIO_CODEC "ISAC" @@ -122,6 +123,8 @@ bool SetVideoCodecSize(webrtc::ViECodec* ptrViECodec, webrtc::VideoCodec& videoCodec); bool SetVideoCodecBitrate(webrtc::ViECodec* ptrViECodec, webrtc::VideoCodec& videoCodec); +bool SetVideoCodecMinBitrate(webrtc::ViECodec* ptrViECodec, + webrtc::VideoCodec& videoCodec); bool SetVideoCodecMaxBitrate(webrtc::ViECodec* ptrViECodec, webrtc::VideoCodec& videoCodec); bool SetVideoCodecMaxFramerate(webrtc::ViECodec* ptrViECodec, @@ -268,6 +271,7 @@ int ViEAutoTest::ViECustomCall() SetVideoCodecType(ptrViECodec, videoSendCodec); SetVideoCodecSize(ptrViECodec, videoSendCodec); SetVideoCodecBitrate(ptrViECodec, videoSendCodec); + SetVideoCodecMinBitrate(ptrViECodec, videoSendCodec); SetVideoCodecMaxBitrate(ptrViECodec, videoSendCodec); SetVideoCodecMaxFramerate(ptrViECodec, videoSendCodec); SetVideoCodecTemporalLayer(videoSendCodec); @@ -576,6 +580,7 @@ int ViEAutoTest::ViECustomCall() SetVideoCodecType(ptrViECodec, videoSendCodec); SetVideoCodecSize(ptrViECodec, videoSendCodec); SetVideoCodecBitrate(ptrViECodec, videoSendCodec); + SetVideoCodecMinBitrate(ptrViECodec, videoSendCodec); SetVideoCodecMaxBitrate(ptrViECodec, videoSendCodec); SetVideoCodecMaxFramerate(ptrViECodec, videoSendCodec); SetVideoCodecTemporalLayer(videoSendCodec); @@ -1660,6 +1665,21 @@ bool SetVideoCodecMaxBitrate(webrtc::ViECodec* ptrViECodec, return true; } +bool SetVideoCodecMinBitrate(webrtc::ViECodec* ptrViECodec, + webrtc::VideoCodec& videoCodec) { + std::string str; + std::cout << std::endl; + std::cout << "Choose min bitrate (in fps). Press enter for default (" + << DEFAULT_VIDEO_CODEC_MIN_BITRATE << "): "; + std::getline(std::cin, str); + char minBitRate = atoi(str.c_str()); + videoCodec.minBitrate = DEFAULT_VIDEO_CODEC_MIN_BITRATE; + if (minBitRate != 0) { + videoCodec.minBitrate = minBitRate; + } + return true; +} + bool SetVideoCodecMaxFramerate(webrtc::ViECodec* ptrViECodec, webrtc::VideoCodec& videoCodec) { std::string str; @@ -2007,6 +2027,8 @@ void PrintVideoCodec(webrtc::VideoCodec videoCodec) { std::cout << "\t\theight: " << videoCodec.height << std::endl; std::cout << "\t\tstartBitrate: " << videoCodec.startBitrate << std::endl; + std::cout << "\t\tminBitrate: " << videoCodec.minBitrate + << std::endl; std::cout << "\t\tmaxBitrate: " << videoCodec.maxBitrate << std::endl; std::cout << "\t\tmaxFramerate: " << (int)videoCodec.maxFramerate