Lines Matching defs:nalu
153 static void remove_scep_3_bytes(NALUnit *nalu)
158 uint8_t *data = nalu->data;
160 while (i < nalu->length) {
161 if (nalu->length - i > 3 && AV_RB24(&data[i]) == 0x000003) {
170 nalu->length = j;
173 static int get_next_nal_unit(CodecParserContext *ctx, NALUnit *nalu)
178 nalu->start_code_length = 4;
180 nalu->start_code_length = 3;
184 ctx->buf_ptr += nalu->start_code_length;
194 nalu->data = (uint8_t *)nalu_start + nalu->start_code_length;
195 nalu->length = ctx->buf_ptr - nalu->data;
196 nalu->type = *nalu->data & 0x1F;
201 static int decrypt_nal_unit(HLSCryptoContext *crypto_ctx, NALUnit *nalu)
213 remove_scep_3_bytes(nalu);
215 data = nalu->data + 32;
216 rem_bytes = nalu->length - 32;
237 NALUnit nalu;
248 memset(&nalu, 0, sizeof(nalu));
249 ret = get_next_nal_unit(&ctx, &nalu);
252 if ((nalu.type == 0x01 || nalu.type == 0x05) && nalu.length > 48) {
253 int encrypted_nalu_length = nalu.length;
254 ret = decrypt_nal_unit(crypto_ctx, &nalu);
257 move_nalu = nalu.length != encrypted_nalu_length;
260 memmove(data_ptr, nalu.data - nalu.start_code_length, nalu.start_code_length + nalu.length);
261 data_ptr += nalu.start_code_length + nalu.length;