Lines Matching refs:prop
241 Prop *prop = &mProps[i]; in findPropIndex() local
242 if (prop->mNameLen != len) { in findPropIndex()
245 if (memcmp(name, prop->mName, len) == 0) { in findPropIndex()
276 Prop *prop; in allocateProp() local
279 prop = &mProps[i]; in allocateProp()
288 prop = &mProps[i]; in allocateProp()
289 prop->setName(name, len); in allocateProp()
292 return prop; in allocateProp()
300 Prop *prop = &mProps[i]; in removeProp() local
301 clearProp(prop); in removeProp()
304 copyProp(prop, &mProps[mPropCount-1]); in removeProp()
315 Prop *prop = allocateProp(name); in setInt32() local
316 if (prop != NULL) { in setInt32()
317 clearPropValue(prop); in setInt32()
318 prop->mType = kTypeInt32; in setInt32()
319 prop->u.int32Value = value; in setInt32()
324 Prop *prop = allocateProp(name); in setInt64() local
325 if (prop != NULL) { in setInt64()
326 clearPropValue(prop); in setInt64()
327 prop->mType = kTypeInt64; in setInt64()
328 prop->u.int64Value = value; in setInt64()
333 Prop *prop = allocateProp(name); in setDouble() local
334 if (prop != NULL) { in setDouble()
335 clearPropValue(prop); in setDouble()
336 prop->mType = kTypeDouble; in setDouble()
337 prop->u.doubleValue = value; in setDouble()
343 Prop *prop = allocateProp(name); in setCString() local
345 if (prop != NULL) { in setCString()
346 clearPropValue(prop); in setCString()
347 prop->mType = kTypeCString; in setCString()
348 prop->u.CStringValue = strdup(value); in setCString()
353 Prop *prop = allocateProp(name); in setRate() local
354 if (prop != NULL) { in setRate()
355 clearPropValue(prop); in setRate()
356 prop->mType = kTypeRate; in setRate()
357 prop->u.rate.count = count; in setRate()
358 prop->u.rate.duration = duration; in setRate()
365 Prop *prop = allocateProp(name); in addInt32() local
366 if (prop == NULL) { in addInt32()
369 switch (prop->mType) { in addInt32()
371 prop->u.int32Value += value; in addInt32()
374 clearPropValue(prop); in addInt32()
375 prop->mType = kTypeInt32; in addInt32()
376 prop->u.int32Value = value; in addInt32()
382 Prop *prop = allocateProp(name); in addInt64() local
383 if (prop == NULL) { in addInt64()
386 switch (prop->mType) { in addInt64()
388 prop->u.int64Value += value; in addInt64()
391 clearPropValue(prop); in addInt64()
392 prop->mType = kTypeInt64; in addInt64()
393 prop->u.int64Value = value; in addInt64()
399 Prop *prop = allocateProp(name); in addRate() local
400 if (prop == NULL) { in addRate()
403 switch (prop->mType) { in addRate()
405 prop->u.rate.count += count; in addRate()
406 prop->u.rate.duration += duration; in addRate()
409 clearPropValue(prop); in addRate()
410 prop->mType = kTypeRate; in addRate()
411 prop->u.rate.count = count; in addRate()
412 prop->u.rate.duration = duration; in addRate()
418 Prop *prop = allocateProp(name); in addDouble() local
419 if (prop == NULL) { in addDouble()
422 switch (prop->mType) { in addDouble()
424 prop->u.doubleValue += value; in addDouble()
427 clearPropValue(prop); in addDouble()
428 prop->mType = kTypeDouble; in addDouble()
429 prop->u.doubleValue = value; in addDouble()
436 Prop *prop = findProp(name); in getInt32() local
437 if (prop == NULL || prop->mType != kTypeInt32) { in getInt32()
441 *value = prop->u.int32Value; in getInt32()
447 Prop *prop = findProp(name); in getInt64() local
448 if (prop == NULL || prop->mType != kTypeInt64) { in getInt64()
452 *value = prop->u.int64Value; in getInt64()
458 Prop *prop = findProp(name); in getRate() local
459 if (prop == NULL || prop->mType != kTypeRate) { in getRate()
463 *count = prop->u.rate.count; in getRate()
466 *duration = prop->u.rate.duration; in getRate()
470 if (prop->u.rate.duration != 0) { in getRate()
471 r = prop->u.rate.count / (double) prop->u.rate.duration; in getRate()
479 Prop *prop = findProp(name); in getDouble() local
480 if (prop == NULL || prop->mType != kTypeDouble) { in getDouble()
484 *value = prop->u.doubleValue; in getDouble()
491 Prop *prop = findProp(name); in getCString() local
492 if (prop == NULL || prop->mType != kTypeCString) { in getCString()
496 *value = strdup(prop->u.CStringValue); in getCString()
502 Prop *prop = findProp(name); in getString() local
503 if (prop == NULL || prop->mType != kTypeCString) { in getString()
508 *value = prop->u.CStringValue; in getString()
551 Prop *prop = &mProps[i]; in filterNot() local
553 if (strcmp(prop->mName, attrs[j]) == 0) { in filterNot()
554 clearProp(prop); in filterNot()
557 *prop = mProps[mPropCount-1]; in filterNot()
577 void MediaAnalyticsItem::initProp(Prop *prop) { in initProp() argument
578 if (prop != NULL) { in initProp()
579 prop->mName = NULL; in initProp()
580 prop->mNameLen = 0; in initProp()
582 prop->mType = kTypeNone; in initProp()
586 void MediaAnalyticsItem::clearProp(Prop *prop) in clearProp() argument
588 if (prop != NULL) { in clearProp()
589 if (prop->mName != NULL) { in clearProp()
590 free((void *)prop->mName); in clearProp()
591 prop->mName = NULL; in clearProp()
592 prop->mNameLen = 0; in clearProp()
595 clearPropValue(prop); in clearProp()
599 void MediaAnalyticsItem::clearPropValue(Prop *prop) in clearPropValue() argument
601 if (prop != NULL) { in clearPropValue()
602 if (prop->mType == kTypeCString && prop->u.CStringValue != NULL) { in clearPropValue()
603 free(prop->u.CStringValue); in clearPropValue()
604 prop->u.CStringValue = NULL; in clearPropValue()
606 prop->mType = kTypeNone; in clearPropValue()
749 Prop *prop = &mProps[i]; in writeToParcel0() local
750 data->writeCString(prop->mName); in writeToParcel0()
751 data->writeInt32(prop->mType); in writeToParcel0()
752 switch (prop->mType) { in writeToParcel0()
754 data->writeInt32(prop->u.int32Value); in writeToParcel0()
757 data->writeInt64(prop->u.int64Value); in writeToParcel0()
760 data->writeDouble(prop->u.doubleValue); in writeToParcel0()
763 data->writeInt64(prop->u.rate.count); in writeToParcel0()
764 data->writeInt64(prop->u.rate.duration); in writeToParcel0()
767 data->writeCString(prop->u.CStringValue); in writeToParcel0()
771 prop->mType, i, prop->mName); in writeToParcel0()
849 Prop *prop = &mProps[i]; in toString() local
850 switch (prop->mType) { in toString()
853 "%s=%d:", prop->mName, prop->u.int32Value); in toString()
857 "%s=%" PRId64 ":", prop->mName, prop->u.int64Value); in toString()
861 "%s=%e:", prop->mName, prop->u.doubleValue); in toString()
865 "%s=%" PRId64 "/%" PRId64 ":", prop->mName, in toString()
866 prop->u.rate.count, prop->u.rate.duration); in toString()
869 snprintf(buffer,sizeof(buffer), "%s=", prop->mName); in toString()
872 result.append(prop->u.CStringValue); in toString()
878 prop->mType, prop->mName); in toString()
1109 Prop *prop = &mProps[i]; in dumpAttributes() local
1111 goal += strlen(prop->mName) + 1; // string + null in dumpAttributes()
1114 switch (prop->mType) { in dumpAttributes()
1129 goal += strlen(prop->u.CStringValue) + 1; in dumpAttributes()
1133 prop->mType, i, prop->mName); in dumpAttributes()
1157 Prop *prop = &mProps[i]; in dumpAttributes() local
1158 int16_t attrNameLen = strlen(prop->mName) + 1; in dumpAttributes()
1160 _INSERTSTRING(prop->mName, attrNameLen); // termination included in dumpAttributes()
1163 switch (prop->mType) { in dumpAttributes()
1171 _INSERT(prop->u.int32Value, sizeof(int32_t)); in dumpAttributes()
1181 _INSERT(prop->u.int64Value, sizeof(int64_t)); in dumpAttributes()
1191 _INSERT(prop->u.doubleValue, sizeof(double)); in dumpAttributes()
1201 _INSERT(prop->u.rate.count, sizeof(uint64_t)); in dumpAttributes()
1202 _INSERT(prop->u.rate.duration, sizeof(uint64_t)); in dumpAttributes()
1209 elemsize = strlen(prop->u.CStringValue) + 1; in dumpAttributes()
1212 _INSERTSTRING(prop->u.CStringValue, elemsize); in dumpAttributes()
1218 prop->mType, i, prop->mName); in dumpAttributes()