~morphis/aethercast/audio-streaming

« back to all changes in this revision

Viewing changes to src/mcs/miracastsourceclient.cpp

  • Committer: CI Train Bot
  • Author(s): Simon Fels
  • Date: 2016-04-29 09:54:49 UTC
  • mfrom: (136.1.17 trunk)
  • Revision ID: ci-train-bot@canonical.com-20160429095449-diyen52l869w9siw
Various fixes and improvements for stability

* React on RTSP timeouts and disconnect when one happens
* Don't save state on shutdown as its already saved
* Implement state saving / property guards
* Implement proper dbus errors and fix spec
* Fix H264Encoder tests
* Implement backend logic for the Enabled property
* Add Enabled property for our manager interface
* Bring back resending of failed packets
* Handle error/terminate cases for buffer queue
Approved by: Alfonso Sanchez-Beato

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
    auto udp_stream = std::make_shared<mcs::network::UdpStream>();
219
219
 
220
220
    media_manager_ = MediaManagerFactory::CreateSource(peer_address, udp_stream);
221
 
    source_.reset(wds::Source::Create(this, media_manager_.get()));
 
221
    media_manager_->SetDelegate(shared_from_this());
 
222
    source_.reset(wds::Source::Create(this, media_manager_.get(), this));
222
223
 
223
224
    source_->Start();
224
225
    return sp;
225
226
}
226
227
 
 
228
void MiracastSourceClient::NotifyConnectionClosed() {
 
229
    if (auto sp = delegate_.lock())
 
230
        sp->OnConnectionClosed();
 
231
}
 
232
 
 
233
void MiracastSourceClient::OnSourceNetworkError() {
 
234
    NotifyConnectionClosed();
 
235
}
 
236
 
 
237
void MiracastSourceClient::ErrorOccurred(wds::ErrorType error) {
 
238
    if (error != wds::ErrorType::TimeoutError)
 
239
        return;
 
240
 
 
241
    MCS_ERROR("Detected RTSP timeout; disconnecting ..");
 
242
 
 
243
    NotifyConnectionClosed();
 
244
}
 
245
 
 
246
void MiracastSourceClient::SessionCompleted() {
 
247
    MCS_DEBUG("");
 
248
}
 
249
 
227
250
} // namespace mcs