diff options
Diffstat (limited to 'remoting/host/session_manager.cc')
-rw-r--r-- | remoting/host/session_manager.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/remoting/host/session_manager.cc b/remoting/host/session_manager.cc index a61a6bdd..1867f07 100644 --- a/remoting/host/session_manager.cc +++ b/remoting/host/session_manager.cc @@ -328,18 +328,16 @@ void SessionManager::DoRateControl() { ScheduleNextRateControl(); } -void SessionManager::DoSendUpdate(ChromotingHostMessage* message, - Encoder::EncodingState state) { +void SessionManager::DoSendVideoPacket(VideoPacket* packet) { DCHECK_EQ(network_loop_, MessageLoop::current()); TraceContext::tracer()->PrintString("DoSendUpdate"); for (ClientConnectionList::const_iterator i = clients_.begin(); i < clients_.end(); ++i) { - (*i)->SendUpdateStreamPacketMessage(*message); + (*i)->SendVideoPacket(*packet); } - - delete message; + delete packet; TraceContext::tracer()->PrintString("DoSendUpdate done"); } @@ -399,19 +397,20 @@ void SessionManager::DoEncode( TraceContext::tracer()->PrintString("Encode Done"); } -void SessionManager::EncodeDataAvailableTask( - ChromotingHostMessage* message, Encoder::EncodingState state) { +void SessionManager::EncodeDataAvailableTask(VideoPacket* packet) { DCHECK_EQ(encode_loop_, MessageLoop::current()); + bool last = (packet->flags() & VideoPacket::LAST_PACKET) != 0; + // Before a new encode task starts, notify clients a new update // stream is coming. // Notify this will keep a reference to the DataBuffer in the // task. The ownership will eventually pass to the ClientConnections. network_loop_->PostTask( FROM_HERE, - NewTracedMethod(this, &SessionManager::DoSendUpdate, message, state)); + NewTracedMethod(this, &SessionManager::DoSendVideoPacket, packet)); - if (state & Encoder::EncodingEnded) { + if (last) { capture_loop_->PostTask( FROM_HERE, NewTracedMethod(this, &SessionManager::DoFinishEncode)); } |