From ad3f6904796d3ff57d282fd2d9f1dc52268bd7d1 Mon Sep 17 00:00:00 2001 From: Andrew Osmond Date: Thu, 12 Dec 2024 04:06:51 -0500 Subject: [PATCH] Expose via GMP API temporal layer info at encoder initialization and on a per frame basis. (#3821) --- Makefile | 2 +- module/gmp-openh264.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fc3c9a794e..ce80e23c6d 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ LIBDIR_NAME=lib SHAREDLIB_DIR=$(PREFIX)/lib PROJECT_NAME=openh264 MODULE_NAME=gmpopenh264 -GMP_API_BRANCH=Firefox114_2 +GMP_API_BRANCH=Firefox135 GTEST_VER=release-1.8.1 CCASFLAGS=$(CFLAGS) STATIC_LDFLAGS=-lstdc++ diff --git a/module/gmp-openh264.cpp b/module/gmp-openh264.cpp index 7093884122..29a143fe77 100644 --- a/module/gmp-openh264.cpp +++ b/module/gmp-openh264.cpp @@ -445,6 +445,10 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted { } } + if (gmp_api_version_ >= kGMPVersion36) { + param.iTemporalLayerNum = codecSettings.mTemporalLayerNum; + } + //for controlling the NAL size (normally for packetization-mode=0) if (maxPayloadSize != 0) { if (gmp_api_version_ < kGMPVersion35) { @@ -741,6 +745,10 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted { f->SetCompleteFrame (true); f->SetBufferType (GMP_BufferLength32); + if (gmp_api_version_ >= kGMPVersion36) { + f->SetTemporalLayerId (encoded->iLayerNum); + } + GMPLOG (GL_DEBUG, "Encoding complete. type= " << f->FrameType() << " length="