diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/multimedia/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/multimedia/platform/darwin/avfvideobuffer.mm | 4 | ||||
-rw-r--r-- | src/multimedia/platform/gstreamer/common/qgstutils.cpp | 4 | ||||
-rw-r--r-- | src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp | 6 | ||||
-rw-r--r-- | src/multimedia/shaders/p010.frag (renamed from src/multimedia/shaders/p010le.frag) | 0 | ||||
-rw-r--r-- | src/multimedia/shaders/p010be.frag | 25 | ||||
-rw-r--r-- | src/multimedia/video/qvideoframe.cpp | 12 | ||||
-rw-r--r-- | src/multimedia/video/qvideoframeconversionhelper.cpp | 20 | ||||
-rw-r--r-- | src/multimedia/video/qvideosurfaceformat.cpp | 18 | ||||
-rw-r--r-- | src/multimedia/video/qvideosurfaceformat.h | 6 | ||||
-rw-r--r-- | src/multimedia/video/qvideotexturehelper.cpp | 35 |
11 files changed, 31 insertions, 102 deletions
diff --git a/src/multimedia/CMakeLists.txt b/src/multimedia/CMakeLists.txt index 063da1340..ff924771b 100644 --- a/src/multimedia/CMakeLists.txt +++ b/src/multimedia/CMakeLists.txt @@ -486,6 +486,5 @@ qt_internal_add_shaders(Multimedia "shaders" "shaders/yuv_yv.frag" "shaders/yuyv.frag" "shaders/ayuv.frag" - "shaders/p010le.frag" - "shaders/p010be.frag" + "shaders/p010.frag" ) diff --git a/src/multimedia/platform/darwin/avfvideobuffer.mm b/src/multimedia/platform/darwin/avfvideobuffer.mm index d822b550d..a0052bb04 100644 --- a/src/multimedia/platform/darwin/avfvideobuffer.mm +++ b/src/multimedia/platform/darwin/avfvideobuffer.mm @@ -255,7 +255,7 @@ QVideoSurfaceFormat::PixelFormat AVFVideoBuffer::fromCVPixelFormat(unsigned avPi return QVideoSurfaceFormat::Format_NV12; case kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange: case kCVPixelFormatType_420YpCbCr10BiPlanarFullRange: - return QVideoSurfaceFormat::Format_P010LE; + return QVideoSurfaceFormat::Format_P010; case kCVPixelFormatType_422YpCbCr8: return QVideoSurfaceFormat::Format_UYVY; case kCVPixelFormatType_422YpCbCr8_yuvs: @@ -283,7 +283,7 @@ bool AVFVideoBuffer::toCVPixelFormat(QVideoSurfaceFormat::PixelFormat qtFormat, case QVideoSurfaceFormat::Format_NV12: conv = kCVPixelFormatType_420YpCbCr8BiPlanarFullRange; break; - case QVideoSurfaceFormat::Format_P010LE: + case QVideoSurfaceFormat::Format_P010: conv = kCVPixelFormatType_420YpCbCr10BiPlanarFullRange; break; case QVideoSurfaceFormat::Format_UYVY: diff --git a/src/multimedia/platform/gstreamer/common/qgstutils.cpp b/src/multimedia/platform/gstreamer/common/qgstutils.cpp index 6d8e14527..ef220ba5d 100644 --- a/src/multimedia/platform/gstreamer/common/qgstutils.cpp +++ b/src/multimedia/platform/gstreamer/common/qgstutils.cpp @@ -179,8 +179,6 @@ static const VideoFormat qt_videoFormatLookup[] = { QVideoSurfaceFormat::Format_NV12 , GST_VIDEO_FORMAT_NV12 }, { QVideoSurfaceFormat::Format_NV21 , GST_VIDEO_FORMAT_NV21 }, { QVideoSurfaceFormat::Format_AYUV444, GST_VIDEO_FORMAT_AYUV }, - { QVideoSurfaceFormat::Format_P010LE , GST_VIDEO_FORMAT_P010_10LE }, - { QVideoSurfaceFormat::Format_P010BE , GST_VIDEO_FORMAT_P010_10BE }, { QVideoSurfaceFormat::Format_Y8 , GST_VIDEO_FORMAT_GRAY8 }, #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN { QVideoSurfaceFormat::Format_RGB32 , GST_VIDEO_FORMAT_BGRx }, @@ -191,6 +189,7 @@ static const VideoFormat qt_videoFormatLookup[] = { QVideoSurfaceFormat::Format_RGB555 , GST_VIDEO_FORMAT_BGR15 }, { QVideoSurfaceFormat::Format_BGR555 , GST_VIDEO_FORMAT_RGB15 }, { QVideoSurfaceFormat::Format_Y16 , GST_VIDEO_FORMAT_GRAY16_LE }, + { QVideoSurfaceFormat::Format_P010 , GST_VIDEO_FORMAT_P010_10LE }, #else { QVideoSurfaceFormat::Format_RGB32 , GST_VIDEO_FORMAT_xRGB }, { QVideoSurfaceFormat::Format_BGR32 , GST_VIDEO_FORMAT_xBGR }, @@ -200,6 +199,7 @@ static const VideoFormat qt_videoFormatLookup[] = { QVideoSurfaceFormat::Format_RGB555 , GST_VIDEO_FORMAT_RGB15 }, { QVideoSurfaceFormat::Format_BGR555 , GST_VIDEO_FORMAT_BGR15 }, { QVideoSurfaceFormat::Format_Y16 , GST_VIDEO_FORMAT_GRAY16_BE }, + { QVideoSurfaceFormat::Format_P010 , GST_VIDEO_FORMAT_P010_10BE }, #endif { QVideoSurfaceFormat::Format_RGB565, GST_VIDEO_FORMAT_RGB16 } }; diff --git a/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp b/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp index 4f5f9ba9f..ff8daa24b 100644 --- a/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp +++ b/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp @@ -105,8 +105,7 @@ QGstMutableCaps QGstVideoRenderer::getCaps() // << QVideoSurfaceFormat::Format_NV12 // << QVideoSurfaceFormat::Format_NV21 << QVideoSurfaceFormat::Format_AYUV444 -// << QVideoSurfaceFormat::Format_P010LE -// << QVideoSurfaceFormat::Format_P010BE +// << QVideoSurfaceFormat::Format_P010 // << QVideoSurfaceFormat::Format_Y8 << QVideoSurfaceFormat::Format_RGB32 << QVideoSurfaceFormat::Format_BGR32 @@ -137,8 +136,7 @@ QGstMutableCaps QGstVideoRenderer::getCaps() << QVideoSurfaceFormat::Format_NV12 << QVideoSurfaceFormat::Format_NV21 << QVideoSurfaceFormat::Format_AYUV444 - << QVideoSurfaceFormat::Format_P010LE - << QVideoSurfaceFormat::Format_P010BE + << QVideoSurfaceFormat::Format_P010 << QVideoSurfaceFormat::Format_Y8 << QVideoSurfaceFormat::Format_RGB32 << QVideoSurfaceFormat::Format_BGR32 diff --git a/src/multimedia/shaders/p010le.frag b/src/multimedia/shaders/p010.frag index 9ef6bd648..9ef6bd648 100644 --- a/src/multimedia/shaders/p010le.frag +++ b/src/multimedia/shaders/p010.frag diff --git a/src/multimedia/shaders/p010be.frag b/src/multimedia/shaders/p010be.frag deleted file mode 100644 index b098361ad..000000000 --- a/src/multimedia/shaders/p010be.frag +++ /dev/null @@ -1,25 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 plane1TexCoord; -layout(location = 1) in vec2 plane2TexCoord; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - mat4 matrix; - mat4 colorMatrix; - float opacity; - float plane1Width; - float plane2Width; - float plane3Width; -} ubuf; - -layout(binding = 1) uniform sampler2D plane1Texture; -layout(binding = 2) uniform sampler2D plane2Texture; - -void main() -{ - float Y = texture(plane1Texture, plane1TexCoord).r; - vec2 UV = texture(plane2Texture, plane2TexCoord).br; - vec4 color = vec4(Y, UV.x, UV.y, 1.); - fragColor = ubuf.colorMatrix * color * ubuf.opacity; -} diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp index 720a7948b..81cb62611 100644 --- a/src/multimedia/video/qvideoframe.cpp +++ b/src/multimedia/video/qvideoframe.cpp @@ -85,10 +85,8 @@ static bool pixelFormatHasAlpha[QVideoSurfaceFormat::NPixelFormats] = false, //Format_Y8, false, //Format_Y16, - false, //Format_P010LE, - false, //Format_P010BE, - false, //Format_P016LE, - false, //Format_P016BE, + false, //Format_P010, + false, //Format_P016, false, //Format_Jpeg, @@ -609,10 +607,8 @@ bool QVideoFrame::map(QVideoFrame::MapMode mode) case QVideoSurfaceFormat::Format_NV21: case QVideoSurfaceFormat::Format_IMC2: case QVideoSurfaceFormat::Format_IMC4: - case QVideoSurfaceFormat::Format_P010BE: - case QVideoSurfaceFormat::Format_P010LE: - case QVideoSurfaceFormat::Format_P016BE: - case QVideoSurfaceFormat::Format_P016LE: { + case QVideoSurfaceFormat::Format_P010: + case QVideoSurfaceFormat::Format_P016: { // Semi planar, Full resolution Y plane with interleaved subsampled U and V planes. d->mapData.nPlanes = 2; d->mapData.bytesPerLine[1] = d->mapData.bytesPerLine[0]; diff --git a/src/multimedia/video/qvideoframeconversionhelper.cpp b/src/multimedia/video/qvideoframeconversionhelper.cpp index bd1c21f24..672b83a03 100644 --- a/src/multimedia/video/qvideoframeconversionhelper.cpp +++ b/src/multimedia/video/qvideoframeconversionhelper.cpp @@ -511,7 +511,7 @@ static inline void planarYUV420_16bit_to_ARGB32(const uchar *y, int yStride, } } -static void QT_FASTCALL qt_convert_P016LE_to_ARGB32(const QVideoFrame &frame, uchar *output) +static void QT_FASTCALL qt_convert_P016_to_ARGB32(const QVideoFrame &frame, uchar *output) { FETCH_INFO_BIPLANAR(frame) planarYUV420_16bit_to_ARGB32(plane1 + 1, plane1Stride, @@ -523,18 +523,6 @@ static void QT_FASTCALL qt_convert_P016LE_to_ARGB32(const QVideoFrame &frame, uc } -static void QT_FASTCALL qt_convert_P016BE_to_ARGB32(const QVideoFrame &frame, uchar *output) -{ - FETCH_INFO_BIPLANAR(frame) - planarYUV420_16bit_to_ARGB32(plane1, plane1Stride, - plane2, plane2Stride, - plane2 + 2, plane2Stride, - 4, - reinterpret_cast<quint32*>(output), - width, height); - -} - static VideoFrameConvertFunc qConvertFuncs[QVideoSurfaceFormat::NPixelFormats] = { /* Format_Invalid */ nullptr, // Not needed /* Format_ARGB32 */ nullptr, // Not needed @@ -563,10 +551,8 @@ static VideoFrameConvertFunc qConvertFuncs[QVideoSurfaceFormat::NPixelFormats] = /* Format_IMC4 */ qt_convert_IMC4_to_ARGB32, /* Format_Y8 */ nullptr, // Not needed /* Format_Y16 */ nullptr, // Not needed - /* Format_P010LE */ qt_convert_P016LE_to_ARGB32, - /* Format_P010BE */ qt_convert_P016BE_to_ARGB32, - /* Format_P016LE */ qt_convert_P016LE_to_ARGB32, - /* Format_P016BE */ qt_convert_P016BE_to_ARGB32, + /* Format_P010 */ qt_convert_P016_to_ARGB32, + /* Format_P016 */ qt_convert_P016_to_ARGB32, /* Format_Jpeg */ nullptr, // Not needed }; diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp index 8c562c2b8..c0b27c428 100644 --- a/src/multimedia/video/qvideosurfaceformat.cpp +++ b/src/multimedia/video/qvideosurfaceformat.cpp @@ -486,10 +486,8 @@ QImage::Format QVideoSurfaceFormat::imageFormatFromPixelFormat(QVideoSurfaceForm case QVideoSurfaceFormat::Format_IMC2: case QVideoSurfaceFormat::Format_IMC3: case QVideoSurfaceFormat::Format_IMC4: - case QVideoSurfaceFormat::Format_P010LE: - case QVideoSurfaceFormat::Format_P010BE: - case QVideoSurfaceFormat::Format_P016LE: - case QVideoSurfaceFormat::Format_P016BE: + case QVideoSurfaceFormat::Format_P010: + case QVideoSurfaceFormat::Format_P016: case QVideoSurfaceFormat::Format_Jpeg: case QVideoSurfaceFormat::Format_Invalid: return QImage::Format_Invalid; @@ -617,14 +615,10 @@ QDebug operator<<(QDebug dbg, QVideoSurfaceFormat::PixelFormat pf) return dbg << "Format_Y8"; case QVideoSurfaceFormat::Format_Y16: return dbg << "Format_Y16"; - case QVideoSurfaceFormat::Format_P010LE: - return dbg << "Format_P010LE"; - case QVideoSurfaceFormat::Format_P010BE: - return dbg << "Format_P010BE"; - case QVideoSurfaceFormat::Format_P016LE: - return dbg << "Format_P016LE"; - case QVideoSurfaceFormat::Format_P016BE: - return dbg << "Format_P016BE"; + case QVideoSurfaceFormat::Format_P010: + return dbg << "Format_P010"; + case QVideoSurfaceFormat::Format_P016: + return dbg << "Format_P016"; case QVideoSurfaceFormat::Format_Jpeg: return dbg << "Format_Jpeg"; diff --git a/src/multimedia/video/qvideosurfaceformat.h b/src/multimedia/video/qvideosurfaceformat.h index 6e231125f..8f601e4c2 100644 --- a/src/multimedia/video/qvideosurfaceformat.h +++ b/src/multimedia/video/qvideosurfaceformat.h @@ -90,10 +90,8 @@ public: Format_Y8, Format_Y16, - Format_P010LE, - Format_P010BE, - Format_P016LE, - Format_P016BE, + Format_P010, + Format_P016, Format_Jpeg, }; diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp index 1eed562aa..ed3742b47 100644 --- a/src/multimedia/video/qvideotexturehelper.cpp +++ b/src/multimedia/video/qvideotexturehelper.cpp @@ -181,26 +181,16 @@ static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats] { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, - // Format_P010LE + // Format_P010 { 2, { QRhiTexture::R16, QRhiTexture::RG16, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 2, 2 }, { 1, 1 } } }, - // Format_P010BE - { 2, - { QRhiTexture::RG8, QRhiTexture::BGRA8, QRhiTexture::UnknownFormat }, - { { 1, 1 }, { 2, 2 }, { 1, 1 } } - }, - // Format_P016LE + // Format_P016 { 2, { QRhiTexture::R16, QRhiTexture::RG16, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 2, 2 }, { 1, 1 } } }, - // Format_P016BE - { 2, - { QRhiTexture::RG8, QRhiTexture::BGRA8, QRhiTexture::UnknownFormat }, - { { 1, 1 }, { 2, 2 }, { 1, 1 } } - }, // Format_Jpeg { 1, @@ -252,10 +242,8 @@ QString vertexShaderFileName(QVideoSurfaceFormat::PixelFormat format) case QVideoSurfaceFormat::Format_YUYV: case QVideoSurfaceFormat::Format_NV12: case QVideoSurfaceFormat::Format_NV21: - case QVideoSurfaceFormat::Format_P010LE: - case QVideoSurfaceFormat::Format_P010BE: - case QVideoSurfaceFormat::Format_P016LE: - case QVideoSurfaceFormat::Format_P016BE: + case QVideoSurfaceFormat::Format_P010: + case QVideoSurfaceFormat::Format_P016: return QStringLiteral(":/qt-project.org/multimedia/shaders/yuv.vert.qsb"); } } @@ -302,12 +290,9 @@ QString fragmentShaderFileName(QVideoSurfaceFormat::PixelFormat format) return QStringLiteral(":/qt-project.org/multimedia/shaders/nv12.frag.qsb"); case QVideoSurfaceFormat::Format_NV21: return QStringLiteral(":/qt-project.org/multimedia/shaders/nv21.frag.qsb"); - case QVideoSurfaceFormat::Format_P010LE: - case QVideoSurfaceFormat::Format_P016LE: - return QStringLiteral(":/qt-project.org/multimedia/shaders/p010le.frag.qsb"); - case QVideoSurfaceFormat::Format_P010BE: - case QVideoSurfaceFormat::Format_P016BE: - return QStringLiteral(":/qt-project.org/multimedia/shaders/p010be.frag.qsb"); + case QVideoSurfaceFormat::Format_P010: + case QVideoSurfaceFormat::Format_P016: + return QStringLiteral(":/qt-project.org/multimedia/shaders/p010.frag.qsb"); } } @@ -394,10 +379,8 @@ QByteArray uniformData(const QVideoSurfaceFormat &format, const QMatrix4x4 &tran } case QVideoSurfaceFormat::Format_NV12: case QVideoSurfaceFormat::Format_NV21: - case QVideoSurfaceFormat::Format_P010LE: - case QVideoSurfaceFormat::Format_P010BE: - case QVideoSurfaceFormat::Format_P016LE: - case QVideoSurfaceFormat::Format_P016BE: { + case QVideoSurfaceFormat::Format_P010: + case QVideoSurfaceFormat::Format_P016: { static constexpr float pw[] = { 1, 1, 0 }; planeWidth = pw; break; |