mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-27 18:23:00 -04:00
Adjust debug level add AVPixelFormat Image::AVPixFormat(AVPixelFormat new_pixelformat)
This commit is contained in:
@@ -82,7 +82,7 @@ std::list<const CodecData*> get_encoder_data(int wanted_codec, const std::string
|
||||
}
|
||||
}
|
||||
if (wanted_codec and (enc_codecs[i].codec_id != wanted_codec)) {
|
||||
Debug(1, "Not the right codec id %d %s != %d %s for %s",
|
||||
Debug(4, "Not the right codec id %d %s != %d %s for %s",
|
||||
chosen_codec_data->codec_id,
|
||||
avcodec_get_name(chosen_codec_data->codec_id),
|
||||
wanted_codec,
|
||||
|
||||
@@ -5354,4 +5354,38 @@ AVPixelFormat Image::AVPixFormat() const {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AVPixelFormat Image::AVPixFormat(AVPixelFormat new_pixelformat) {
|
||||
switch (new_pixelformat) {
|
||||
case AV_PIX_FMT_YUVJ420P:
|
||||
colours = ZM_COLOUR_YUVJ420P;
|
||||
subpixelorder = ZM_SUBPIX_ORDER_YUVJ420P;
|
||||
break;
|
||||
case AV_PIX_FMT_YUV420P:
|
||||
colours = ZM_COLOUR_YUV420P;
|
||||
subpixelorder = ZM_SUBPIX_ORDER_YUV420P;
|
||||
break;
|
||||
case AV_PIX_FMT_RGBA:
|
||||
colours = ZM_COLOUR_RGB32;
|
||||
subpixelorder = ZM_SUBPIX_ORDER_RGBA;
|
||||
break;
|
||||
case AV_PIX_FMT_BGR24:
|
||||
colours = ZM_COLOUR_RGB24;
|
||||
subpixelorder = ZM_SUBPIX_ORDER_BGR;
|
||||
break;
|
||||
case AV_PIX_FMT_RGB24:
|
||||
colours = ZM_COLOUR_RGB24;
|
||||
subpixelorder = ZM_SUBPIX_ORDER_RGB;
|
||||
break;
|
||||
case AV_PIX_FMT_GRAY8:
|
||||
colours = ZM_COLOUR_GRAY8;
|
||||
subpixelorder = ZM_SUBPIX_ORDER_NONE;
|
||||
break;
|
||||
default:
|
||||
Error("Unknown pixelformat %d %s", new_pixelformat, av_get_pix_fmt_name(new_pixelformat));
|
||||
}
|
||||
Debug(4, "Old size: %d, old pixelformat %d", size, imagePixFormat);
|
||||
size = av_image_get_buffer_size(new_pixelformat, width, height, 32);
|
||||
Debug(4, "New size: %d new pixelformat %d", size, new_pixelformat);
|
||||
linesize = FFALIGN(av_image_get_linesize(new_pixelformat, width, 0), 32);
|
||||
return imagePixFormat = new_pixelformat;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user