| Index: remoting/host/session_manager.cc
|
| ===================================================================
|
| --- remoting/host/session_manager.cc (revision 64676)
|
| +++ remoting/host/session_manager.cc (working copy)
|
| @@ -328,17 +328,19 @@
|
| ScheduleNextRateControl();
|
| }
|
|
|
| -void SessionManager::DoSendVideoPacket(VideoPacket* packet) {
|
| +void SessionManager::DoSendUpdate(ChromotingHostMessage* message,
|
| + Encoder::EncodingState state) {
|
| DCHECK_EQ(network_loop_, MessageLoop::current());
|
|
|
| TraceContext::tracer()->PrintString("DoSendUpdate");
|
|
|
| for (ClientConnectionList::const_iterator i = clients_.begin();
|
| i < clients_.end(); ++i) {
|
| - (*i)->SendVideoPacket(*packet);
|
| + (*i)->SendUpdateStreamPacketMessage(*message);
|
| }
|
| - delete packet;
|
|
|
| + delete message;
|
| +
|
| TraceContext::tracer()->PrintString("DoSendUpdate done");
|
| }
|
|
|
| @@ -397,20 +399,19 @@
|
| TraceContext::tracer()->PrintString("Encode Done");
|
| }
|
|
|
| -void SessionManager::EncodeDataAvailableTask(VideoPacket* packet) {
|
| +void SessionManager::EncodeDataAvailableTask(
|
| + ChromotingHostMessage* message, Encoder::EncodingState state) {
|
| 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::DoSendVideoPacket, packet));
|
| + NewTracedMethod(this, &SessionManager::DoSendUpdate, message, state));
|
|
|
| - if (last) {
|
| + if (state & Encoder::EncodingEnded) {
|
| capture_loop_->PostTask(
|
| FROM_HERE, NewTracedMethod(this, &SessionManager::DoFinishEncode));
|
| }
|
|
|