| Index: remoting/host/session_manager.cc
|
| diff --git a/remoting/host/session_manager.cc b/remoting/host/session_manager.cc
|
| index a61a6bddeaf6fe22c88fcd9111898884f9d2a239..1867f0747aad0f1e2e12cb8ed6020e043160ac7b 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));
|
| }
|
|
|