MCPcopy Create free account
hub / github.com/RetroShare/RetroShare / showEvent

Method showEvent

plugins/VOIP/gui/VOIPConfigPanel.cpp:125–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void VOIPConfigPanel::showEvent(QShowEvent *)
126{
127 std::cerr << "Creating the audio pipeline" << std::endl;
128
129 inputAudioProcessor = new QtSpeex::SpeexInputProcessor();
130 inputAudioProcessor->open(QIODevice::WriteOnly | QIODevice::Unbuffered);
131
132 inputAudioDevice = AudioDeviceHelper::getPreferedInputDevice();
133 inputAudioDevice->start(inputAudioProcessor);
134
135 connect(inputAudioProcessor, SIGNAL(networkPacketReady()), this, SLOT(emptyBuffer()));
136
137 std::cerr << "Creating the video pipeline" << std::endl;
138
139 // Create the video pipeline.
140 //
141
142 videoInput = new QVideoInputDevice(this) ;
143
144 videoProcessor = new VideoProcessor() ;
145 videoProcessor->setDisplayTarget(NULL) ;
146
147 videoProcessor->setMaximumBandwidth(ui.availableBW_SB->value()) ;
148
149 videoInput->setVideoProcessor(videoProcessor) ;
150
151 graph_source = new voipGraphSource ;
152 ui.voipBwGraph->setSource(graph_source);
153
154 graph_source->setVideoInput(videoInput) ;
155 graph_source->setCollectionTimeLimit(1000*300) ;
156 graph_source->start() ;
157
158 if(ui.showEncoded_CB->isChecked())
159 {
160 videoInput->setEchoVideoTarget(nullptr) ;
161 videoProcessor->setDisplayTarget(ui.videoDisplay) ;
162 }
163 else
164 {
165 videoInput->setEchoVideoTarget(ui.videoDisplay) ;
166 videoProcessor->setDisplayTarget(nullptr);
167 }
168
169 QObject::connect(ui.showEncoded_CB,SIGNAL(toggled(bool)),this,SLOT(togglePreview(bool))) ;
170 QObject::connect(ui.availableBW_SB,SIGNAL(valueChanged(double)),this,SLOT(updateAvailableBW(double))) ;
171
172 loadSettings();
173
174 qtTick = new RsProtectedTimer(this);
175 connect( qtTick, SIGNAL( timeout ( ) ), this, SLOT( on_Tick_timeout() ) );
176 qtTick->start(20);
177
178 videoInput->start();
179}
180
181void VOIPConfigPanel::hideEvent(QHideEvent *)
182{

Callers

nothing calls this directly

Calls 10

setDisplayTargetMethod · 0.80
setMaximumBandwidthMethod · 0.80
valueMethod · 0.80
setVideoProcessorMethod · 0.80
setVideoInputMethod · 0.80
setEchoVideoTargetMethod · 0.80
openMethod · 0.45
startMethod · 0.45
setSourceMethod · 0.45

Tested by

no test coverage detected