• Home
  • Raw
  • Download

Lines Matching full:decoder

44 wcap_decoder_decode_rectangle(struct wcap_decoder *decoder,  in wcap_decoder_decode_rectangle()  argument
47 uint32_t v, *p = decoder->p, *d; in wcap_decoder_decode_rectangle()
52 d = decoder->frame + (rect->y2 - 1) * decoder->width; in wcap_decoder_decode_rectangle()
75 d -= decoder->width; in wcap_decoder_decode_rectangle()
85 decoder->p = p; in wcap_decoder_decode_rectangle()
89 wcap_decoder_get_frame(struct wcap_decoder *decoder) in wcap_decoder_get_frame() argument
95 if (decoder->p == decoder->end) in wcap_decoder_get_frame()
98 header = decoder->p; in wcap_decoder_get_frame()
99 decoder->msecs = header->msecs; in wcap_decoder_get_frame()
100 decoder->count++; in wcap_decoder_get_frame()
103 decoder->p = (uint32_t *) (rects + header->nrects); in wcap_decoder_get_frame()
105 wcap_decoder_decode_rectangle(decoder, &rects[i]); in wcap_decoder_get_frame()
113 struct wcap_decoder *decoder; in wcap_decoder_create() local
118 decoder = malloc(sizeof *decoder); in wcap_decoder_create()
119 if (decoder == NULL) in wcap_decoder_create()
122 decoder->fd = open(filename, O_RDONLY); in wcap_decoder_create()
123 if (decoder->fd == -1) { in wcap_decoder_create()
124 free(decoder); in wcap_decoder_create()
128 fstat(decoder->fd, &buf); in wcap_decoder_create()
129 decoder->size = buf.st_size; in wcap_decoder_create()
130 decoder->map = mmap(NULL, decoder->size, in wcap_decoder_create()
131 PROT_READ, MAP_PRIVATE, decoder->fd, 0); in wcap_decoder_create()
132 if (decoder->map == MAP_FAILED) { in wcap_decoder_create()
134 close(decoder->fd); in wcap_decoder_create()
135 free(decoder); in wcap_decoder_create()
139 header = decoder->map; in wcap_decoder_create()
140 decoder->format = header->format; in wcap_decoder_create()
141 decoder->count = 0; in wcap_decoder_create()
142 decoder->width = header->width; in wcap_decoder_create()
143 decoder->height = header->height; in wcap_decoder_create()
144 decoder->p = header + 1; in wcap_decoder_create()
145 decoder->end = decoder->map + decoder->size; in wcap_decoder_create()
148 decoder->frame = malloc(frame_size); in wcap_decoder_create()
149 if (decoder->frame == NULL) { in wcap_decoder_create()
150 close(decoder->fd); in wcap_decoder_create()
151 free(decoder); in wcap_decoder_create()
154 memset(decoder->frame, 0, frame_size); in wcap_decoder_create()
156 return decoder; in wcap_decoder_create()
160 wcap_decoder_destroy(struct wcap_decoder *decoder) in wcap_decoder_destroy() argument
162 munmap(decoder->map, decoder->size); in wcap_decoder_destroy()
163 close(decoder->fd); in wcap_decoder_destroy()
164 free(decoder->frame); in wcap_decoder_destroy()
165 free(decoder); in wcap_decoder_destroy()