Lines Matching refs:cntr

431 static int detect_container_version(struct container_context *cntr)
433 struct parser_state *state = cntr->private_data;
438 memcpy(&header.magic, cntr->magic, sizeof(cntr->magic));
439 err = container_recursive_read(cntr,
440 (char *)&header + sizeof(cntr->magic),
441 sizeof(header) - sizeof(cntr->magic));
444 if (cntr->eof)
450 static int allocate_for_block_cache(struct container_context *cntr,
474 err = container_recursive_read(cntr, cache + sizeof(*header),
480 if (cntr->eof) {
490 static int cache_data_block(struct container_context *cntr,
496 err = container_recursive_read(cntr, &header->type,
500 if (cntr->eof)
509 err = container_recursive_read(cntr, &header->size,
513 if (cntr->eof)
516 return allocate_for_block_cache(cntr, header, buf);
519 static int detect_format_block(struct container_context *cntr)
521 struct parser_state *state = cntr->private_data;
528 err = cache_data_block(cntr, &header, &buf);
556 static int voc_parser_pre_process(struct container_context *cntr,
562 struct parser_state *state = cntr->private_data;
566 err = detect_container_version(cntr);
570 err = detect_format_block(cntr);
600 static int write_container_header(struct container_context *cntr,
603 struct builder_state *state = cntr->private_data;
611 return container_recursive_write(cntr, header, sizeof(*header));
614 static int write_v120_format_block(struct container_context *cntr,
619 struct builder_state *state = cntr->private_data;
629 return container_recursive_write(cntr, block, sizeof(*block));
632 static int write_extended_v110_format_block(struct container_context *cntr,
636 struct builder_state *state = cntr->private_data;
656 return container_recursive_write(cntr, block, sizeof(*block));
659 static int write_v110_format_block(struct container_context *cntr,
664 struct builder_state *state = cntr->private_data;
677 return container_recursive_write(cntr, block, sizeof(*block));
680 static int write_data_blocks(struct container_context *cntr,
690 struct builder_state *state = cntr->private_data;
693 err = write_container_header(cntr, &buf.header);
698 err = write_v120_format_block(cntr, &buf.v120_format,
702 err = write_extended_v110_format_block(cntr,
708 err = write_v110_format_block(cntr, &buf.v110_data,
715 static int voc_builder_pre_process(struct container_context *cntr,
721 struct builder_state *state = cntr->private_data;
764 return write_data_blocks(cntr, *frames_per_second, *byte_count);
767 static int write_block_terminator(struct container_context *cntr)
772 return container_recursive_write(cntr, &block, sizeof(block));
775 static int write_data_size(struct container_context *cntr, uint64_t byte_count)
777 struct builder_state *state = cntr->private_data;
785 err = container_seek_offset(cntr, offset);
794 if (byte_count > cntr->max_size - offset)
795 byte_count = cntr->max_size;
800 return container_recursive_write(cntr, &size_field, sizeof(size_field));
803 static int voc_builder_post_process(struct container_context *cntr,
808 err = write_block_terminator(cntr);
812 return write_data_size(cntr, handled_byte_count);