Lines Matching refs:write
144 } write;
419 if (p->write.current)
420 item_free(p->write.current);
422 if (p->write.memchunk.memblock)
423 pa_memblock_unref(p->write.memchunk.memblock);
603 p->write.current = pa_queue_pop(p->send_queue);
605 if (!p->write.current)
607 p->write.index = 0;
608 p->write.data = NULL;
609 p->write.minibuf_validsize = 0;
610 pa_memchunk_reset(&p->write.memchunk);
612 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH] = 0;
613 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_CHANNEL] = htonl((uint32_t) -1);
614 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_OFFSET_HI] = 0;
615 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_OFFSET_LO] = 0;
616 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_FLAGS] = 0;
618 if (p->write.current->type == PA_PSTREAM_ITEM_PACKET) {
621 pa_assert(p->write.current->packet);
623 p->write.data = (void *) pa_packet_data(p->write.current->packet, &plen);
624 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH] = htonl((uint32_t) plen);
627 memcpy(&p->write.minibuf[PA_PSTREAM_DESCRIPTOR_SIZE], p->write.data, plen);
628 p->write.minibuf_validsize = PA_PSTREAM_DESCRIPTOR_SIZE + plen;
631 } else if (p->write.current->type == PA_PSTREAM_ITEM_SHMRELEASE) {
633 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_FLAGS] = htonl(PA_FLAG_SHMRELEASE);
634 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_OFFSET_HI] = htonl(p->write.current->block_id);
636 } else if (p->write.current->type == PA_PSTREAM_ITEM_SHMREVOKE) {
638 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_FLAGS] = htonl(PA_FLAG_SHMREVOKE);
639 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_OFFSET_HI] = htonl(p->write.current->block_id);
645 pa_assert(p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK);
646 pa_assert(p->write.current->chunk.memblock);
648 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_CHANNEL] = htonl(p->write.current->channel);
649 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_OFFSET_HI] = htonl((uint32_t) (((uint64_t) p->write.current->offset) >> 32));
650 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_OFFSET_LO] = htonl((uint32_t) ((uint64_t) p->write.current->offset));
652 flags = (uint32_t) (p->write.current->seek_mode & PA_FLAG_SEEKMASK);
658 uint32_t *shm_info = (uint32_t *) &p->write.minibuf[PA_PSTREAM_DESCRIPTOR_SIZE];
660 pa_mempool *current_pool = pa_memblock_get_pool(p->write.current->chunk.memblock);
669 p->write.current->chunk.memblock,
702 shm_info[PA_PSTREAM_SHM_INDEX] = htonl((uint32_t) (offset + p->write.current->chunk.index));
703 shm_info[PA_PSTREAM_SHM_LENGTH] = htonl((uint32_t) p->write.current->chunk.length);
705 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH] = htonl(shm_size);
706 p->write.minibuf_validsize = PA_PSTREAM_DESCRIPTOR_SIZE + shm_size;
719 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH] = htonl((uint32_t) p->write.current->chunk.length);
720 p->write.memchunk = p->write.current->chunk;
721 pa_memblock_ref(p->write.memchunk.memblock);
724 p->write.descriptor[PA_PSTREAM_DESCRIPTOR_FLAGS] = htonl(flags);
728 if ((p->send_ancil_data_now = p->write.current->with_ancil_data))
729 p->write_ancil_data = &p->write.current->ancil_data;
756 if (!p->write.current)
759 if (!p->write.current) {
765 if (p->write.minibuf_validsize > 0) {
766 d = p->write.minibuf + p->write.index;
767 l = p->write.minibuf_validsize - p->write.index;
768 } else if (p->write.index < PA_PSTREAM_DESCRIPTOR_SIZE) {
769 d = (uint8_t*) p->write.descriptor + p->write.index;
770 l = PA_PSTREAM_DESCRIPTOR_SIZE - p->write.index;
772 pa_assert(p->write.data || p->write.memchunk.memblock);
774 if (p->write.data)
775 d = p->write.data;
777 d = pa_memblock_acquire_chunk(&p->write.memchunk);
778 release_memblock = p->write.memchunk.memblock;
781 d = (uint8_t*) d + p->write.index - PA_PSTREAM_DESCRIPTOR_SIZE;
782 l = ntohl(p->write.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH]) - (p->write.index - PA_PSTREAM_DESCRIPTOR_SIZE);
810 p->write.index += (size_t) r;
812 if (p->write.index >= PA_PSTREAM_DESCRIPTOR_SIZE + ntohl(p->write.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH])) {
813 pa_assert(p->write.current);
814 item_free(p->write.current);
815 p->write.current = NULL;
817 if (p->write.memchunk.memblock)
818 pa_memblock_unref(p->write.memchunk.memblock);
820 pa_memchunk_reset(&p->write.memchunk);
1174 b = p->write.current || !pa_queue_isempty(p->send_queue);