Код: Выделить всё
--- res_format_attr_h264.c.orig 2019-02-25 11:41:21.487089361 +0200
+++ res_format_attr_h264.c 2019-02-28 11:21:51.117788005 +0200
@@ -105,8 +105,7 @@
struct h264_attr *attr1 = ast_format_get_attribute_data(format1);
struct h264_attr *attr2 = ast_format_get_attribute_data(format2);
- if (!attr1 || !attr1->PROFILE_IDC || !attr2 || !attr2->PROFILE_IDC ||
- (attr1->PROFILE_IDC == attr2->PROFILE_IDC)) {
+ if (!attr1 || !attr2 || (attr1 && attr2 && !memcmp(attr1, attr2, sizeof(*attr1)))) {
return AST_FORMAT_CMP_EQUAL;
}
@@ -124,6 +123,9 @@
if (!cloned) {
return NULL;
}
+
+ ast_log(AST_LOG_WARNING, "h264_getjoint");
+
attr = ast_format_get_attribute_data(cloned);
attr1 = ast_format_get_attribute_data(format1);
@@ -175,6 +177,9 @@
if (!cloned) {
return NULL;
}
+
+ ast_log(AST_LOG_WARNING, "h264_parse_sdp_fmtp: %s", attributes);
+
attr = ast_format_get_attribute_data(cloned);
attr->REDUNDANT_PIC_CAP = H264_ATTR_KEY_UNSET;
@@ -306,6 +311,8 @@
ast_str_append(str, 0, "\r\n");
}
+ ast_log(AST_LOG_WARNING, "h264_generate_sdp_fmtp: %s", ast_str_buffer(str));
+
return;
}
Код: Выделить всё
--- res_format_attr_h264.c.orig 2019-02-25 11:41:21.487089361 +0200
+++ res_format_attr_h264.c 2019-03-01 16:31:05.389176706 +0200
@@ -105,8 +105,7 @@
struct h264_attr *attr1 = ast_format_get_attribute_data(format1);
struct h264_attr *attr2 = ast_format_get_attribute_data(format2);
- if (!attr1 || !attr1->PROFILE_IDC || !attr2 || !attr2->PROFILE_IDC ||
- (attr1->PROFILE_IDC == attr2->PROFILE_IDC)) {
+ if (!attr1 || !attr2 || (attr1 && attr2 && !memcmp(attr1, attr2, sizeof(*attr1)))) {
return AST_FORMAT_CMP_EQUAL;
}
@@ -129,6 +128,10 @@
attr1 = ast_format_get_attribute_data(format1);
attr2 = ast_format_get_attribute_data(format2);
+ ast_log(AST_LOG_WARNING, "h264_getjoint: %x %x %x = %x %x %x\n",
+ attr1 ? attr1->PROFILE_IDC:0, attr1 ? attr1->PROFILE_IOP:0, attr1 ? attr1->LEVEL:0,
+ attr2 ? attr2->PROFILE_IDC:0, attr2 ? attr2->PROFILE_IOP:0, attr2 ? attr2->LEVEL:0);
+
DETERMINE_JOINT(attr, attr1, attr2, PROFILE_IDC);
DETERMINE_JOINT(attr, attr1, attr2, PROFILE_IOP);
DETERMINE_JOINT(attr, attr1, attr2, LEVEL);
@@ -175,6 +178,7 @@
if (!cloned) {
return NULL;
}
+ ast_log(AST_LOG_WARNING, "h264_parse_sdp_fmtp: %s\n", attributes);
attr = ast_format_get_attribute_data(cloned);
attr->REDUNDANT_PIC_CAP = H264_ATTR_KEY_UNSET;
@@ -189,6 +193,7 @@
attrib = ast_strip(attrib);
if (sscanf(attrib, "profile-level-id=%lx", &val2) == 1) {
+ ast_log(AST_LOG_WARNING, "h264_parse_sdp_fmtp: profile-level-id= (%lx)\n", val2);
attr->PROFILE_IDC = ((val2 >> 16) & 0xFF);
attr->PROFILE_IOP = ((val2 >> 8) & 0xFF);
attr->LEVEL = (val2 & 0xFF);
@@ -284,6 +289,7 @@
APPEND_IF_NOT_H264_UNSET(attr->PACKETIZATION_MODE, str, "packetization-mode");
APPEND_IF_NOT_H264_UNSET(attr->LEVEL_ASYMMETRY_ALLOWED, str, "level-asymmetry-allowed");
+ ast_log(AST_LOG_WARNING, "h264_generate_sdp_fmtp: profile-level-id= (%02X%02X%02X)\n", attr->PROFILE_IDC, attr->PROFILE_IOP, attr->LEVEL);
if (attr->PROFILE_IDC && attr->PROFILE_IOP && attr->LEVEL) {
if (added) {
ast_str_append(str, 0, ";");
@@ -306,6 +312,7 @@
ast_str_append(str, 0, "\r\n");
}
+ ast_log(AST_LOG_WARNING, "h264_generate_sdp_fmtp: %d, %s\n", ast_str_size(str), ast_str_buffer(str));
return;
}
Код: Выделить всё
if (attr->PROFILE_IDC && attr->PROFILE_IOP && attr->LEVEL) {
Код: Выделить всё
if (attr->PROFILE_IDC || attr->PROFILE_IOP || attr->LEVEL) {
Код: Выделить всё
--- res_format_attr_h264.c.orig 2019-02-25 11:41:21.487089361 +0200
+++ res_format_attr_h264.c 2019-03-01 16:42:31.406440601 +0200
@@ -105,8 +105,7 @@
struct h264_attr *attr1 = ast_format_get_attribute_data(format1);
struct h264_attr *attr2 = ast_format_get_attribute_data(format2);
- if (!attr1 || !attr1->PROFILE_IDC || !attr2 || !attr2->PROFILE_IDC ||
- (attr1->PROFILE_IDC == attr2->PROFILE_IDC)) {
+ if (!attr1 || !attr2 || (attr1 && attr2 && !memcmp(attr1, attr2, sizeof(*attr1)))) {
return AST_FORMAT_CMP_EQUAL;
}
@@ -129,6 +128,10 @@
attr1 = ast_format_get_attribute_data(format1);
attr2 = ast_format_get_attribute_data(format2);
+ ast_log(AST_LOG_WARNING, "h264_getjoint: %x %x %x = %x %x %x\n",
+ attr1 ? attr1->PROFILE_IDC:0, attr1 ? attr1->PROFILE_IOP:0, attr1 ? attr1->LEVEL:0,
+ attr2 ? attr2->PROFILE_IDC:0, attr2 ? attr2->PROFILE_IOP:0, attr2 ? attr2->LEVEL:0);
+
DETERMINE_JOINT(attr, attr1, attr2, PROFILE_IDC);
DETERMINE_JOINT(attr, attr1, attr2, PROFILE_IOP);
DETERMINE_JOINT(attr, attr1, attr2, LEVEL);
@@ -175,6 +178,7 @@
if (!cloned) {
return NULL;
}
+ ast_log(AST_LOG_WARNING, "h264_parse_sdp_fmtp: %s\n", attributes);
attr = ast_format_get_attribute_data(cloned);
attr->REDUNDANT_PIC_CAP = H264_ATTR_KEY_UNSET;
@@ -189,6 +193,7 @@
attrib = ast_strip(attrib);
if (sscanf(attrib, "profile-level-id=%lx", &val2) == 1) {
+ ast_log(AST_LOG_WARNING, "h264_parse_sdp_fmtp: profile-level-id= (%lx)\n", val2);
attr->PROFILE_IDC = ((val2 >> 16) & 0xFF);
attr->PROFILE_IOP = ((val2 >> 8) & 0xFF);
attr->LEVEL = (val2 & 0xFF);
@@ -284,7 +289,8 @@
APPEND_IF_NOT_H264_UNSET(attr->PACKETIZATION_MODE, str, "packetization-mode");
APPEND_IF_NOT_H264_UNSET(attr->LEVEL_ASYMMETRY_ALLOWED, str, "level-asymmetry-allowed");
- if (attr->PROFILE_IDC && attr->PROFILE_IOP && attr->LEVEL) {
+ ast_log(AST_LOG_WARNING, "h264_generate_sdp_fmtp: profile-level-id= (%02X%02X%02X)\n", attr->PROFILE_IDC, attr->PROFILE_IOP, attr->LEVEL);
+ if (attr->PROFILE_IDC || attr->PROFILE_IOP || attr->LEVEL) {
if (added) {
ast_str_append(str, 0, ";");
} else if (0 < ast_str_append(str, 0, "a=fmtp:%u ", payload)) {
@@ -306,6 +312,7 @@
ast_str_append(str, 0, "\r\n");
}
+ ast_log(AST_LOG_WARNING, "h264_generate_sdp_fmtp: %d, %s\n", ast_str_size(str), ast_str_buffer(str));
return;
}
Код: Выделить всё
if (attr->PROFILE_IDC && attr->LEVEL) {
Код: Выделить всё
if (attr->PROFILE_IDC || attr->PROFILE_IOP || attr->LEVEL) {
Код: Выделить всё
v=0
o=root 1129822023 1129822023 IN IP4 192.168.1.246
s=Asterisk PBX 13.22.0
c=IN IP4 192.168.1.246
b=CT:384
t=0 0
m=audio 16570 RTP/AVP 0 2 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv
m=video 11252 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=4D001F
a=sendrecv