Imported Upstream version 6.1
[platform/upstream/ffmpeg.git] / libavcodec / libopencore-amr.c
index 539f0de..641a156 100644 (file)
@@ -30,8 +30,8 @@
 #include "avcodec.h"
 #include "audio_frame_queue.h"
 #include "codec_internal.h"
+#include "decode.h"
 #include "encode.h"
-#include "internal.h"
 
 #if CONFIG_LIBOPENCORE_AMRNB_DECODER || CONFIG_LIBOPENCORE_AMRWB_DECODER
 static int amr_decode_fix_avctx(AVCodecContext *avctx)
@@ -106,8 +106,8 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, AVFrame *frame,
     enum Mode dec_mode;
     int packet_size, ret;
 
-    ff_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",
-            buf, buf_size, avctx->frame_number);
+    ff_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%"PRId64"!!\n",
+            buf, buf_size, avctx->frame_num);
 
     /* get output buffer */
     frame->nb_samples = 160;
@@ -135,9 +135,10 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
 const FFCodec ff_libopencore_amrnb_decoder = {
     .p.name         = "libopencore_amrnb",
-    .p.long_name    = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
+    CODEC_LONG_NAME("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
     .p.type         = AVMEDIA_TYPE_AUDIO,
     .p.id           = AV_CODEC_ID_AMR_NB,
+    .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE,
     .priv_data_size = sizeof(AMRContext),
     .init           = amr_nb_decode_init,
     .close          = amr_nb_decode_close,
@@ -290,14 +291,16 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
 
 const FFCodec ff_libopencore_amrnb_encoder = {
     .p.name         = "libopencore_amrnb",
-    .p.long_name    = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
+    CODEC_LONG_NAME("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
     .p.type         = AVMEDIA_TYPE_AUDIO,
     .p.id           = AV_CODEC_ID_AMR_NB,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+                      AV_CODEC_CAP_SMALL_LAST_FRAME,
+    .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE,
     .priv_data_size = sizeof(AMRContext),
     .init           = amr_nb_encode_init,
     FF_CODEC_ENCODE_CB(amr_nb_encode_frame),
     .close          = amr_nb_encode_close,
-    .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME,
     .p.sample_fmts  = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
                                                      AV_SAMPLE_FMT_NONE },
     .p.priv_class   = &amrnb_class,
@@ -374,11 +377,12 @@ static int amr_wb_decode_close(AVCodecContext *avctx)
 
 const FFCodec ff_libopencore_amrwb_decoder = {
     .p.name         = "libopencore_amrwb",
-    .p.long_name    = NULL_IF_CONFIG_SMALL("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"),
+    CODEC_LONG_NAME("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"),
     .p.type         = AVMEDIA_TYPE_AUDIO,
     .p.id           = AV_CODEC_ID_AMR_WB,
     .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
     .p.wrapper_name = "libopencore_amrwb",
+    .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE,
     .priv_data_size = sizeof(AMRWBContext),
     .init           = amr_wb_decode_init,
     .close          = amr_wb_decode_close,