Skip to content

Commit ad3f690

Browse files
authored
Expose via GMP API temporal layer info at encoder initialization and on a per frame basis. (#3821)
1 parent edbef4d commit ad3f690

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LIBDIR_NAME=lib
2929
SHAREDLIB_DIR=$(PREFIX)/lib
3030
PROJECT_NAME=openh264
3131
MODULE_NAME=gmpopenh264
32-
GMP_API_BRANCH=Firefox114_2
32+
GMP_API_BRANCH=Firefox135
3333
GTEST_VER=release-1.8.1
3434
CCASFLAGS=$(CFLAGS)
3535
STATIC_LDFLAGS=-lstdc++

module/gmp-openh264.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,10 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
445445
}
446446
}
447447

448+
if (gmp_api_version_ >= kGMPVersion36) {
449+
param.iTemporalLayerNum = codecSettings.mTemporalLayerNum;
450+
}
451+
448452
//for controlling the NAL size (normally for packetization-mode=0)
449453
if (maxPayloadSize != 0) {
450454
if (gmp_api_version_ < kGMPVersion35) {
@@ -741,6 +745,10 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
741745
f->SetCompleteFrame (true);
742746
f->SetBufferType (GMP_BufferLength32);
743747

748+
if (gmp_api_version_ >= kGMPVersion36) {
749+
f->SetTemporalLayerId (encoded->iLayerNum);
750+
}
751+
744752
GMPLOG (GL_DEBUG, "Encoding complete. type= "
745753
<< f->FrameType()
746754
<< " length="

0 commit comments

Comments
 (0)