Skip to content

Commit

Permalink
Expose via GMP API temporal layer info at encoder initialization and …
Browse files Browse the repository at this point in the history
…on a per frame basis. (#3821)
  • Loading branch information
aosmond authored Dec 12, 2024
1 parent edbef4d commit ad3f690
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
8 changes: 8 additions & 0 deletions module/gmp-openh264.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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="
Expand Down

0 comments on commit ad3f690

Please sign in to comment.