generate_raw_frame((uint16_t*)(in_frame->data[0]), i, enc_ctx->sample_rate,
enc_ctx->channels, enc_ctx->frame_size);
- in_frame_bytes = in_frame->nb_samples * av_frame_get_channels(in_frame) * sizeof(uint16_t);
+ in_frame_bytes = in_frame->nb_samples * in_frame->channels * sizeof(uint16_t);
if (in_frame_bytes > in_frame->linesize[0]) {
av_log(NULL, AV_LOG_ERROR, "Incorrect value of input frame linesize\n");
return 1;
av_log(NULL, AV_LOG_ERROR, "Error frames before and after decoding has different sample format\n");
return AVERROR_UNKNOWN;
}
- out_frame_bytes = out_frame->nb_samples * av_frame_get_channels(out_frame) * sizeof(uint16_t);
+ out_frame_bytes = out_frame->nb_samples * out_frame->channels * sizeof(uint16_t);
if (out_frame_bytes > out_frame->linesize[0]) {
av_log(NULL, AV_LOG_ERROR, "Incorrect value of output frame linesize\n");
return 1;
return number_of_written_bytes;
}
printf("%d, %10"PRId64", %10"PRId64", %8"PRId64", %8d, 0x%08lx\n", video_stream,
- fr->pts, fr->pkt_dts, av_frame_get_pkt_duration(fr),
+ fr->pts, fr->pkt_dts, fr->pkt_duration,
number_of_written_bytes, av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes));
}
av_packet_unref(&pkt);
}
av_packet_unref(&pkt);
av_init_packet(&pkt);
- } while ((!end_of_stream || got_frame) && (no_seeking || (fr->pts + av_frame_get_pkt_duration(fr) <= ts_end)));
+ } while ((!end_of_stream || got_frame) && (no_seeking || (fr->pts + fr->pkt_duration <= ts_end)));
av_packet_unref(&pkt);
av_freep(&byte_buffer);
av_frame_free(&msg.frame);
break;
}
- av_frame_set_metadata(msg.frame, meta);
+ msg.frame->metadata = meta;
/* allocate a real frame in order to simulate "real" work */
msg.frame->format = AV_PIX_FMT_RGBA;
if (ret < 0)
break;
av_assert0(msg.magic == MAGIC);
- meta = av_frame_get_metadata(msg.frame);
+ meta = msg.frame->metadata;
e = av_dict_get(meta, "sig", NULL, 0);
av_log(NULL, AV_LOG_INFO, "got \"%s\" (%p)\n", e->value, msg.frame);
av_frame_free(&msg.frame);