Skip to content

Commit

Permalink
Bug 1870786 - Fix the type of RTP timestamps in WebrtcGmpVideoEncoder…
Browse files Browse the repository at this point in the history
…. r=webrtc-reviewers,pehrsons,media-playback-reviewers,aosmond

The keys inserted in the map come from GMPVideoEncodedFrame::TimeStamp,
which returns a uint64_t, and truncation is probably not wanted,
although it might just work in practice.

Differential Revision: https://phabricator.services.mozilla.com/D197012
  • Loading branch information
glandium authored and MrAlex94 committed May 28, 2024
1 parent 0bcd201 commit 04b5800
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ struct EncodedFrame {
uint8_t y_;
uint8_t u_;
uint8_t v_;
uint32_t timestamp_;
uint64_t timestamp_;
} idr_nalu;
};
#pragma pack(pop)
Expand Down
2 changes: 1 addition & 1 deletion dom/media/gtest/TestGMPRemoveAndDelete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ void GMPRemoveTest::gmp_Decode() {
uint8_t y_;
uint8_t u_;
uint8_t v_;
uint32_t timestamp_;
uint64_t timestamp_;
} idr_nalu;
};
#pragma pack(pop)
Expand Down
2 changes: 1 addition & 1 deletion dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ void WebrtcGmpVideoEncoder::Encoded(

webrtc::VideoFrameType ft;
GmpFrameTypeToWebrtcFrameType(aEncodedFrame->FrameType(), &ft);
uint32_t timestamp = (aEncodedFrame->TimeStamp() * 90ll + 999) / 1000;
uint64_t timestamp = (aEncodedFrame->TimeStamp() * 90ll + 999) / 1000;

GMP_LOG_DEBUG("GMP Encoded: %" PRIu64 ", type %d, len %d",
aEncodedFrame->TimeStamp(), aEncodedFrame->BufferType(),
Expand Down
2 changes: 1 addition & 1 deletion dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class WebrtcGmpVideoEncoder : public GMPVideoEncoderCallbackProxy,
int64_t timestamp_us;
};
// Map rtp time -> input image data
DataMutex<std::map<uint32_t, InputImageData>> mInputImageMap;
DataMutex<std::map<uint64_t, InputImageData>> mInputImageMap;

MediaEventProducer<uint64_t> mInitPluginEvent;
MediaEventProducer<uint64_t> mReleasePluginEvent;
Expand Down

0 comments on commit 04b5800

Please sign in to comment.