From fac59ca16ac401e1490f86fe7f70e9cff7ba995d Mon Sep 17 00:00:00 2001 From: mpromonet Date: Sun, 22 Jan 2023 16:39:05 +0100 Subject: [PATCH] upgrade libyuv --- include/jpegdecoder.h | 8 ++++---- include/jpegencoder.h | 2 +- include/vpxencoder.h | 2 +- include/x264encoder.h | 2 +- include/x265encoder.h | 8 ++++---- include/yuvconverter.h | 14 +++++++------- libyuv | 2 +- src/v4l2dump.cpp | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/include/jpegdecoder.h b/include/jpegdecoder.h index 241441a..f7e1048 100644 --- a/include/jpegdecoder.h +++ b/include/jpegdecoder.h @@ -29,9 +29,9 @@ class JpegDecoder : public Codec { } void convertAndWrite(const char* buffer, unsigned int rsize, V4l2Output* videoOutput) { - uint8 *i420_p0 = m_i420buffer; - uint8 *i420_p1 = i420_p0 + m_width * m_height; - uint8 *i420_p2 = i420_p1 + m_width * m_height / 2; + uint8_t *i420_p0 = m_i420buffer; + uint8_t *i420_p1 = i420_p0 + m_width * m_height; + uint8_t *i420_p2 = i420_p1 + m_width * m_height / 2; jpeg_mem_src(&m_cinfo, (unsigned char*)buffer, rsize); jpeg_read_header(&m_cinfo, TRUE); @@ -58,7 +58,7 @@ class JpegDecoder : public Codec { libyuv::ConvertFromI420(i420_p0, m_width, i420_p1, (m_width + 1) / 2, i420_p2, (m_width + 1) / 2, - (uint8 *)outBuffer, 0, + (uint8_t *)outBuffer, 0, m_width, m_height, m_outformat); diff --git a/include/jpegencoder.h b/include/jpegencoder.h index c5a1741..511cd37 100644 --- a/include/jpegencoder.h +++ b/include/jpegencoder.h @@ -49,7 +49,7 @@ class JpegEncoder : public Codec { unsigned char * buffer_u = buffer_y + m_width*m_height; unsigned char * buffer_v = buffer_u + m_width*m_height/4; - libyuv::ConvertToI420((const uint8*)buffer, rsize, + libyuv::ConvertToI420((const uint8_t*)buffer, rsize, buffer_y, m_width, buffer_u, (m_width+1)/2, buffer_v, (m_width+1)/2, diff --git a/include/vpxencoder.h b/include/vpxencoder.h index 2ad179a..31aa510 100644 --- a/include/vpxencoder.h +++ b/include/vpxencoder.h @@ -80,7 +80,7 @@ class VpxEncoder : public Codec { void convertAndWrite(const char* buffer, unsigned int rsize, V4l2Output* videoOutput) { - libyuv::ConvertToI420((const uint8*)buffer, rsize, + libyuv::ConvertToI420((const uint8_t*)buffer, rsize, m_input.planes[0], m_width, m_input.planes[1], (m_width+1)/2, m_input.planes[2], (m_width+1)/2, diff --git a/include/x264encoder.h b/include/x264encoder.h index 6173ad0..ff80f48 100644 --- a/include/x264encoder.h +++ b/include/x264encoder.h @@ -80,7 +80,7 @@ class X264Encoder : public Codec { void convertAndWrite(const char* buffer, unsigned int rsize, V4l2Output* videoOutput) { - libyuv::ConvertToI420((const uint8*)buffer, rsize, + libyuv::ConvertToI420((const uint8_t*)buffer, rsize, m_pic_in.img.plane[0], m_width, m_pic_in.img.plane[1], (m_width+1)/2, m_pic_in.img.plane[2], (m_width+1)/2, diff --git a/include/x265encoder.h b/include/x265encoder.h index 32f5ef1..17ced81 100644 --- a/include/x265encoder.h +++ b/include/x265encoder.h @@ -82,10 +82,10 @@ class X265Encoder : public Codec { void convertAndWrite(const char* buffer, unsigned int rsize, V4l2Output* videoOutput) { - libyuv::ConvertToI420((const uint8*)buffer, rsize, - (uint8*)m_pic_in->planes[0], m_width, - (uint8*)m_pic_in->planes[1], (m_width+1)/2, - (uint8*)m_pic_in->planes[2], (m_width+1)/2, + libyuv::ConvertToI420((const uint8_t*)buffer, rsize, + (uint8_t*)m_pic_in->planes[0], m_width, + (uint8_t*)m_pic_in->planes[1], (m_width+1)/2, + (uint8_t*)m_pic_in->planes[2], (m_width+1)/2, 0, 0, m_width, m_height, m_width, m_height, diff --git a/include/yuvconverter.h b/include/yuvconverter.h index b158df7..891cbe7 100644 --- a/include/yuvconverter.h +++ b/include/yuvconverter.h @@ -18,7 +18,7 @@ class YuvConverter : public Codec YuvConverter(int outformat, int informat, int width, int height, const std::map &opt, int verbose) : Codec(informat, width, height), m_outformat(outformat) { - m_i420 = new uint8[width * height * 2]; + m_i420 = new uint8_t[width * height * 2]; } ~YuvConverter() @@ -28,11 +28,11 @@ class YuvConverter : public Codec void convertAndWrite(const char *buffer, unsigned int rsize, V4l2Output *videoOutput) { - uint8 *i420_p0 = m_i420; - uint8 *i420_p1 = i420_p0 + m_width * m_height; - uint8 *i420_p2 = i420_p1 + m_width * m_height / 2; + uint8_t *i420_p0 = m_i420; + uint8_t *i420_p1 = i420_p0 + m_width * m_height; + uint8_t *i420_p2 = i420_p1 + m_width * m_height / 2; - libyuv::ConvertToI420((const uint8 *)buffer, rsize, + libyuv::ConvertToI420((const uint8_t *)buffer, rsize, i420_p0, m_width, i420_p1, (m_width + 1) / 2, i420_p2, (m_width + 1) / 2, @@ -45,7 +45,7 @@ class YuvConverter : public Codec libyuv::ConvertFromI420(i420_p0, m_width, i420_p1, (m_width + 1) / 2, i420_p2, (m_width + 1) / 2, - (uint8 *)outBuffer, 0, + (uint8_t *)outBuffer, 0, m_width, m_height, m_outformat); @@ -54,7 +54,7 @@ class YuvConverter : public Codec } private: - uint8 *m_i420; + uint8_t *m_i420; int m_outformat; public: diff --git a/libyuv b/libyuv index d204db6..0809713 160000 --- a/libyuv +++ b/libyuv @@ -1 +1 @@ -Subproject commit d204db647e591ccf0e2589236ecea90330d65a66 +Subproject commit 08097137751c4c2fb211bd00c69641e4c9ea723f diff --git a/src/v4l2dump.cpp b/src/v4l2dump.cpp index 5e7eeed..dcfa9cc 100644 --- a/src/v4l2dump.cpp +++ b/src/v4l2dump.cpp @@ -133,7 +133,7 @@ int main(int argc, char* argv[]) ||(videoCapture->getFormat() == V4L2_PIX_FMT_MJPEG) ) { int width = 0; int height = 0; - if (libyuv::MJPGSize((const uint8*)buffer, rsize, &width, &height) == 0) { + if (libyuv::MJPGSize((const uint8_t*)buffer, rsize, &width, &height) == 0) { LOG(NOTICE) << "libyuv::MJPGSize " << width << "x" << height; } else { LOG(WARN) << "libyuv::MJPGSize error";