void VP8ComponentDecoder::SendToVirtualThread::send(ResizableByteBufferListNode *data) {
    always_assert(data);
    always_assert(data->stream_id < sizeof(vbuffers) / sizeof(vbuffers[0]) &&
                  "INVALID SEND STREAM ID");
    if (!g_threaded || NUM_THREADS == 1) {
        /*
    fprintf(stderr, "VSending (%d) %d bytes of data : ptr %p\n",
            (int)data->stream_id, (int)data->size(),
            (void*)data);*/
        vbuffers[data->stream_id].push(data);
        return;
    }
    auto thread_target_id = thread_target[data->stream_id];
    /*
    fprintf(stderr, "Sending (%d) %d bytes of data : ptr %p to %d\n",
            (int)data->stream_id, (int)data->size(),
            (void*)data, thread_target_id);
    */
    if (thread_target_id >= 0) {
        int retval = all_workers[thread_target_id].send_more_data(data);
        always_assert(retval == 0 && "Communication with thread lost");
    }else {
        always_assert(false && "Cannot send to thread that wasn't bound");
    }
}
void VP8ComponentDecoder::SendToVirtualThread::send(ResizableByteBufferListNode *data) {
    always_assert(data);
    always_assert(data->stream_id < sizeof(vbuffers) / sizeof(vbuffers[0]) &&
                  "INVALID SEND STREAM ID");
    if (!g_threaded || NUM_THREADS == 1) {
         
        vbuffers[data->stream_id].push(data);
        return;
    }
    auto thread_target_id = thread_target[data->stream_id];
     
    if (thread_target_id >= 0) {
        int retval = all_workers[thread_target_id].send_more_data(data);
        always_assert(retval == 0 && "Communication with thread lost");
    }else {
        always_assert(false && "Cannot send to thread that wasn't bound");
    }
}