Lines Matching refs:data
34 uint8_t data[35*9];
55 static void qcelp_free_context(PayloadContext *data)
57 av_free(data);
60 static int return_stored_frame(AVFormatContext *ctx, PayloadContext *data,
64 static int store_packet(AVFormatContext *ctx, PayloadContext *data,
88 if (interleave_size != data->interleave_size) {
91 data->interleave_size = interleave_size;
92 data->interleave_index = 0;
94 data->group[i].size = 0;
97 if (interleave_index < data->interleave_index) {
99 if (data->group_finished) {
100 /* No more data in the packets in this interleaving group, just
102 data->interleave_index = 0;
106 for (; data->interleave_index <= interleave_size;
107 data->interleave_index++)
108 data->group[data->interleave_index].size = 0;
110 if (len > sizeof(data->next_data))
112 memcpy(data->next_data, buf, len);
113 data->next_size = len;
114 data->next_timestamp = *timestamp;
117 data->interleave_index = 0;
118 return return_stored_frame(ctx, data, st, pkt, timestamp, buf, len);
121 if (interleave_index > data->interleave_index) {
123 for (; data->interleave_index < interleave_index;
124 data->interleave_index++)
125 data->group[data->interleave_index].size = 0;
127 data->interleave_index = interleave_index;
135 if (len - 1 - frame_size > sizeof(data->group[0].data))
140 memcpy(pkt->data, &buf[1], frame_size);
143 ip = &data->group[data->interleave_index];
146 memcpy(ip->data, &buf[1 + frame_size], ip->size);
148 * RFC. If there's no data left in this packet, there shouldn't be any
150 data->group_finished = ip->size == 0;
153 data->interleave_index = 0;
154 return !data->group_finished;
156 data->interleave_index++;
161 static int return_stored_frame(AVFormatContext *ctx, PayloadContext *data,
165 InterleavePacket* ip = &data->group[data->interleave_index];
168 if (data->group_finished && data->interleave_index == 0) {
169 *timestamp = data->next_timestamp;
170 ret = store_packet(ctx, data, st, pkt, timestamp, data->next_data,
171 data->next_size);
172 data->next_size = 0;
177 /* No stored data for this interleave block, output an empty packet */
180 pkt->data[0] = 0; // Blank - could also be 14, Erasure
184 if (ip->data[ip->pos] >= FF_ARRAY_ELEMS(frame_sizes))
186 frame_size = frame_sizes[ip->data[ip->pos]];
192 memcpy(pkt->data, &ip->data[ip->pos], frame_size);
195 data->group_finished = ip->pos >= ip->size;
199 if (data->interleave_index == data->interleave_size) {
200 data->interleave_index = 0;
201 if (!data->group_finished)
204 return data->next_size > 0;
206 data->interleave_index++;
211 static int qcelp_parse_packet(AVFormatContext *ctx, PayloadContext *data,
216 return store_packet(ctx, data, st, pkt, timestamp, buf, len);
218 return return_stored_frame(ctx, data, st, pkt, timestamp, buf, len);