void Demuxer::feedStream(Stream& stream)
 {
     sf::Lock l(m_synchronized);
     
     while ((!didReachEndOfFile() || hasPendingDataForStream(stream)) && stream.needsMoreData())
     {
         AVPacket* pkt = NULL;
         
         pkt = gatherQueuedPacketForStream(stream);
         
         if (!pkt)
             pkt = readPacket();
         
         if (!pkt)
         {
             m_eofReached = true;
         }
         else
         {
             if (!distributePacket(pkt, stream))
             {
                 av_free_packet(pkt);
                 av_free(pkt);
             }
         }
     }
 }
Beispiel #2
0
void Network::runTick() {
    if (state != Running) {
        return;
    }

    // TODO: consider the balance between scheduling and messaging (bounded-buffer problem)

    // Deliver messages
    processMessages();

    // Schedule
    distributePacket(Packet(MsgTick), -1);
}
Beispiel #3
0
void Network::runSetup() {
    if (state != Running) {
        return;
    }
    distributePacket(Packet(MsgSetup), -1);
}