[asterisk-commits] file: branch file/mf-attributes r417747 - /team/file/mf-attributes/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 2 05:05:18 CDT 2014


Author: file
Date: Wed Jul  2 05:05:14 2014
New Revision: 417747

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=417747
Log:
Make h263_getjoint in res_format_attr_h263 equivalent to the old code.

Modified:
    team/file/mf-attributes/res/res_format_attr_h263.c

Modified: team/file/mf-attributes/res/res_format_attr_h263.c
URL: http://svnview.digium.com/svn/asterisk/team/file/mf-attributes/res/res_format_attr_h263.c?view=diff&rev=417747&r1=417746&r2=417747
==============================================================================
--- team/file/mf-attributes/res/res_format_attr_h263.c (original)
+++ team/file/mf-attributes/res/res_format_attr_h263.c Wed Jul  2 05:05:14 2014
@@ -91,7 +91,42 @@
 
 static struct ast_format *h263_getjoint(const struct ast_format *format1, const struct ast_format *format2)
 {
-	return ast_format_clone(format1);
+	struct ast_format *cloned;
+	struct h263_attr *attr, *attr1, *attr2;
+
+	cloned = ast_format_clone(format1);
+	if (!cloned) {
+		return NULL;
+	}
+	attr = ast_format_get_attribute_data(cloned);
+
+	attr1 = ast_format_get_attribute_data(format1);
+	attr2 = ast_format_get_attribute_data(format2);
+
+	attr->SQCIF = (attr1 && attr1->SQCIF) ? attr1->SQCIF : (attr2 && attr2->SQCIF) ? attr2->SQCIF : 0;
+	attr->QCIF = (attr1 && attr1->QCIF) ? attr1->QCIF : (attr2 && attr2->QCIF) ? attr2->QCIF : 0;
+	attr->CIF = (attr1 && attr1->CIF) ? attr1->CIF : (attr2 && attr2->CIF) ? attr2->CIF : 0;
+	attr->CIF4 = (attr1 && attr1->CIF4) ? attr1->CIF4 : (attr2 && attr2->CIF4) ? attr2->CIF4 : 0;
+	attr->VGA = (attr1 && attr1->VGA) ? attr1->VGA : (attr2 && attr2->VGA) ? attr2->VGA : 0;
+	attr->CUSTOM_XMAX = (attr1 && attr1->CUSTOM_XMAX) ? attr1->CUSTOM_XMAX : (attr2 && attr2->CUSTOM_XMAX) ? attr2->CUSTOM_XMAX : 0;
+	attr->CUSTOM_YMAX = (attr1 && attr1->CUSTOM_YMAX) ? attr1->CUSTOM_YMAX : (attr2 && attr2->CUSTOM_YMAX) ? attr2->CUSTOM_YMAX : 0;
+	attr->CUSTOM_MPI = (attr1 && attr1->CUSTOM_MPI) ? attr1->CUSTOM_MPI : (attr2 && attr2->CUSTOM_MPI) ? attr2->CUSTOM_MPI : 0;
+	attr->F = (attr1 && attr1->F) ? attr1->F : (attr2 && attr2->F) ? attr2->F : 0;
+	attr->I = (attr1 && attr1->I) ? attr1->I : (attr2 && attr2->I) ? attr2->I : 0;
+	attr->J = (attr1 && attr1->J) ? attr1->J : (attr2 && attr2->J) ? attr2->J : 0;
+	attr->T = (attr1 && attr1->T) ? attr1->T : (attr2 && attr2->T) ? attr2->T : 0;
+	attr->K = (attr1 && attr1->K) ? attr1->K : (attr2 && attr2->K) ? attr2->K : 0;
+	attr->N = (attr1 && attr1->N) ? attr1->N : (attr2 && attr2->N) ? attr2->N : 0;
+	attr->P_SUB1 = (attr1 && attr1->P_SUB1) ? attr1->P_SUB1 : (attr2 && attr2->P_SUB1) ? attr2->P_SUB1 : 0;
+	attr->P_SUB2 = (attr1 && attr1->P_SUB2) ? attr1->P_SUB2 : (attr2 && attr2->P_SUB2) ? attr2->P_SUB2 : 0;
+	attr->P_SUB3 = (attr1 && attr1->P_SUB3) ? attr1->P_SUB3 : (attr2 && attr2->P_SUB3) ? attr2->P_SUB3 : 0;
+	attr->P_SUB4 = (attr1 && attr1->P_SUB4) ? attr1->P_SUB4 : (attr2 && attr2->P_SUB4) ? attr2->P_SUB4 : 0;
+	attr->PAR_WIDTH = (attr1 && attr1->PAR_WIDTH) ? attr1->PAR_WIDTH : (attr2 && attr2->PAR_WIDTH) ? attr2->PAR_WIDTH : 0;
+	attr->PAR_HEIGHT = (attr1 && attr1->PAR_HEIGHT) ? attr1->PAR_HEIGHT : (attr2 && attr2->PAR_HEIGHT) ? attr2->PAR_HEIGHT : 0;
+	attr->BPP = (attr1 && attr1->BPP) ? attr1->BPP : (attr2 && attr2->BPP) ? attr2->BPP : 0;
+	attr->HRD = (attr1 && attr1->HRD) ? attr1->HRD : (attr2 && attr2->HRD) ? attr2->HRD : 0;
+
+	return cloned;
 }
 
 static struct ast_format *h263_sdp_parse(const struct ast_format *format, const char *attributes)




More information about the asterisk-commits mailing list