create fix_deprecated_pix_fmt function to adjust deprecated pixfmts
parent
0f7c46e2cc
commit
430d64ba67
|
@ -425,6 +425,26 @@ int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void fix_deprecated_pix_fmt(AVCodecContext *ctx) {
|
||||
// Fix deprecated formats
|
||||
switch ( ctx->pix_fmt ) {
|
||||
case AV_PIX_FMT_YUVJ422P :
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUV422P;
|
||||
break;
|
||||
case AV_PIX_FMT_YUVJ444P :
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUV444P;
|
||||
break;
|
||||
case AV_PIX_FMT_YUVJ440P :
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUV440P;
|
||||
break;
|
||||
case AV_PIX_FMT_NONE :
|
||||
case AV_PIX_FMT_YUVJ420P :
|
||||
default:
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUV420P;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if LIBAVCODEC_VERSION_CHECK(56, 8, 0, 60, 100)
|
||||
#else
|
||||
unsigned int zm_av_packet_ref( AVPacket *dst, AVPacket *src ) {
|
||||
|
|
|
@ -379,6 +379,7 @@ void zm_dump_codecpar(const AVCodecParameters *par);
|
|||
#endif
|
||||
|
||||
int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt);
|
||||
void fix_deprecated_pix_fmt(AVCodecContext *);
|
||||
|
||||
bool is_video_stream(const AVStream *);
|
||||
bool is_audio_stream(const AVStream *);
|
||||
|
@ -423,4 +424,5 @@ int zm_add_samples_to_fifo(AVAudioFifo *fifo, AVFrame *frame);
|
|||
int zm_get_samples_from_fifo(AVAudioFifo *fifo, AVFrame *frame);
|
||||
|
||||
|
||||
|
||||
#endif // ZM_FFMPEG_H
|
||||
|
|
Loading…
Reference in New Issue