Skip to content

Commit

Permalink
add support for auto judge H264 or h265
Browse files Browse the repository at this point in the history
  • Loading branch information
liangzhuohua committed Jun 19, 2024
1 parent 6a67e50 commit 0a866a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/wifi/WFBReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,17 @@ void WFBReceiver::handleRtp(uint8_t *payload, uint16_t packet_size) {
// judge H264 or h265
if (isH264(header->getPayloadData())) {
QmlNativeAPI::Instance().playerCodec = "H264";
QmlNativeAPI::Instance().PutLog("debug",
"judge Codec " + QmlNativeAPI::Instance().playerCodec.toStdString());
} else if (isH265(header->getPayloadData())) {
QmlNativeAPI::Instance().playerCodec = "H265";
QmlNativeAPI::Instance().PutLog("debug",
"judge Codec " + QmlNativeAPI::Instance().playerCodec.toStdString());
}else{
QmlNativeAPI::Instance().playerCodec = "H264";
QmlNativeAPI::Instance().PutLog("debug",
"judge Codec failed set codec "
+ QmlNativeAPI::Instance().playerCodec.toStdString());
}
}
QmlNativeAPI::Instance().NotifyRtpStream(header->pt, ntohl(header->ssrc));
Expand Down

0 comments on commit 0a866a0

Please sign in to comment.