@ -29,6 +29,7 @@
# include <vpx/vp8cx.h>
# include <vpx/vp8cx.h>
# include "avcodec.h"
# include "avcodec.h"
# include "encode.h"
# include "internal.h"
# include "internal.h"
# include "libavutil/avassert.h"
# include "libavutil/avassert.h"
# include "libvpx.h"
# include "libvpx.h"
@ -1173,7 +1174,7 @@ static inline void cx_pktcpy(struct FrameListData *dst,
static int storeframe ( AVCodecContext * avctx , struct FrameListData * cx_frame ,
static int storeframe ( AVCodecContext * avctx , struct FrameListData * cx_frame ,
AVPacket * pkt )
AVPacket * pkt )
{
{
int ret = ff_alloc_packet2 ( avctx , pkt , cx_frame - > sz , 0 ) ;
int ret = ff_get_encode_buffer ( avctx , pkt , cx_frame - > sz , 0 ) ;
uint8_t * side_data ;
uint8_t * side_data ;
if ( ret > = 0 ) {
if ( ret > = 0 ) {
int pict_type ;
int pict_type ;
@ -1830,11 +1831,12 @@ const AVCodec ff_libvpx_vp8_encoder = {
. long_name = NULL_IF_CONFIG_SMALL ( " libvpx VP8 " ) ,
. long_name = NULL_IF_CONFIG_SMALL ( " libvpx VP8 " ) ,
. type = AVMEDIA_TYPE_VIDEO ,
. type = AVMEDIA_TYPE_VIDEO ,
. id = AV_CODEC_ID_VP8 ,
. id = AV_CODEC_ID_VP8 ,
. capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_OTHER_THREADS ,
. priv_data_size = sizeof ( VPxContext ) ,
. priv_data_size = sizeof ( VPxContext ) ,
. init = vp8_init ,
. init = vp8_init ,
. encode2 = vpx_encode ,
. encode2 = vpx_encode ,
. close = vpx_free ,
. close = vpx_free ,
. capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS ,
. caps_internal = FF_CODEC_CAP_AUTO_THREADS ,
. caps_internal = FF_CODEC_CAP_AUTO_THREADS ,
. pix_fmts = ( const enum AVPixelFormat [ ] ) { AV_PIX_FMT_YUV420P , AV_PIX_FMT_YUVA420P , AV_PIX_FMT_NONE } ,
. pix_fmts = ( const enum AVPixelFormat [ ] ) { AV_PIX_FMT_YUV420P , AV_PIX_FMT_YUVA420P , AV_PIX_FMT_NONE } ,
. priv_class = & class_vp8 ,
. priv_class = & class_vp8 ,
@ -1861,11 +1863,12 @@ AVCodec ff_libvpx_vp9_encoder = {
. long_name = NULL_IF_CONFIG_SMALL ( " libvpx VP9 " ) ,
. long_name = NULL_IF_CONFIG_SMALL ( " libvpx VP9 " ) ,
. type = AVMEDIA_TYPE_VIDEO ,
. type = AVMEDIA_TYPE_VIDEO ,
. id = AV_CODEC_ID_VP9 ,
. id = AV_CODEC_ID_VP9 ,
. capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_OTHER_THREADS ,
. priv_data_size = sizeof ( VPxContext ) ,
. priv_data_size = sizeof ( VPxContext ) ,
. init = vp9_init ,
. init = vp9_init ,
. encode2 = vpx_encode ,
. encode2 = vpx_encode ,
. close = vpx_free ,
. close = vpx_free ,
. capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS ,
. caps_internal = FF_CODEC_CAP_AUTO_THREADS ,
. caps_internal = FF_CODEC_CAP_AUTO_THREADS ,
. profiles = NULL_IF_CONFIG_SMALL ( ff_vp9_profiles ) ,
. profiles = NULL_IF_CONFIG_SMALL ( ff_vp9_profiles ) ,
. priv_class = & class_vp9 ,
. priv_class = & class_vp9 ,