Skip to content

Commit 42fcf20

Browse files
committed
Pass the actual temporal id to GMPVideoEncodedFrame
1 parent ad3f690 commit 42fcf20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

module/gmp-openh264.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,13 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
708708
// Buffer up the data.
709709
uint32_t length = 0;
710710
std::vector<uint32_t> lengths;
711+
unsigned char temporalId = 0;
711712

712713
for (int i = 0; i < encoded->iLayerNum; ++i) {
713714
lengths.push_back (0);
714715
uint8_t* tmp = encoded->sLayerInfo[i].pBsBuf;
716+
assert(encoded->sLayerInfo[i].uiSpatialId == 0);
717+
temporalId = encoded->sLayerInfo[i].uiTemporalId;
715718
for (int j = 0; j < encoded->sLayerInfo[i].iNalCount; ++j) {
716719
lengths[i] += encoded->sLayerInfo[i].pNalLengthInByte[j];
717720
// Convert from 4-byte start codes to GMP_BufferLength32 (NAL lengths)
@@ -746,7 +749,7 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
746749
f->SetBufferType (GMP_BufferLength32);
747750

748751
if (gmp_api_version_ >= kGMPVersion36) {
749-
f->SetTemporalLayerId (encoded->iLayerNum);
752+
f->SetTemporalLayerId (temporalId);
750753
}
751754

752755
GMPLOG (GL_DEBUG, "Encoding complete. type= "

0 commit comments

Comments
 (0)