unsigned H265BufferedPacket ::nextEnclosedFrameSize(unsigned char*& framePtr, unsigned dataSize) { unsigned resultNALUSize = 0; // if an error occurs switch (fOurSource.fCurPacketNALUnitType) { case 48: { // Aggregation Packet (AP) if (useCount() > 0) { // We're other than the first NAL unit inside this Aggregation Packet. // Update our 'decoding order number': u_int16_t DONL = 0; if (fOurSource.fExpectDONFields) { // There's a 1-byte DOND field next: if (dataSize < 1) break; u_int8_t DOND = framePtr[0]; DONL = fOurSource.fPreviousNALUnitDON + (u_int16_t)(DOND + 1); ++framePtr; --dataSize; } fOurSource.computeAbsDonFromDON(DONL); } // The next 2 bytes are the NAL unit size: if (dataSize < 2) break; resultNALUSize = (framePtr[0]<<8)|framePtr[1]; framePtr += 2; break; } default: { // Common case: We use the entire packet data: return dataSize; } } return (resultNALUSize <= dataSize) ? resultNALUSize : dataSize; }
int ONVIF::VideoSourceConfiguration::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 5) qt_static_metacall(this, _c, _id, _a); _id -= 5; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 5) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 5; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = token(); break; case 1: *reinterpret_cast< QString*>(_v) = name(); break; case 2: *reinterpret_cast< int*>(_v) = useCount(); break; case 3: *reinterpret_cast< QString*>(_v) = sourceToken(); break; case 4: *reinterpret_cast< QRect*>(_v) = bounds(); break; default: break; } _id -= 5; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setToken(*reinterpret_cast< QString*>(_v)); break; case 1: setName(*reinterpret_cast< QString*>(_v)); break; case 2: setUseCount(*reinterpret_cast< int*>(_v)); break; case 3: setSourceToken(*reinterpret_cast< QString*>(_v)); break; case 4: setBounds(*reinterpret_cast< QRect*>(_v)); break; default: break; } _id -= 5; } else if (_c == QMetaObject::ResetProperty) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 5; } else if (_c == QMetaObject::RegisterPropertyMetaType) { if (_id < 5) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 5; } #endif // QT_NO_PROPERTIES return _id; }
int ONVIF::Configuration::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 24) qt_static_metacall(this, _c, _id, _a); _id -= 24; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 24) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 24; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = ptzConfigurationToken(); break; case 1: *reinterpret_cast< QString*>(_v) = name(); break; case 2: *reinterpret_cast< int*>(_v) = useCount(); break; case 3: *reinterpret_cast< QString*>(_v) = nodeToken(); break; case 4: *reinterpret_cast< QString*>(_v) = defaultAbsoluteZoomPositionSpace(); break; case 5: *reinterpret_cast< QString*>(_v) = defaultRelativePanTiltTranslationSpace(); break; case 6: *reinterpret_cast< QString*>(_v) = defaultRelativeZoomTranslationSpace(); break; case 7: *reinterpret_cast< QString*>(_v) = defaultContinuousPanTiltVelocitySpace(); break; case 8: *reinterpret_cast< QString*>(_v) = defaultContinuousZoomVelocitySpace(); break; case 9: *reinterpret_cast< QString*>(_v) = panTiltSpace(); break; case 10: *reinterpret_cast< float*>(_v) = panTiltX(); break; case 11: *reinterpret_cast< float*>(_v) = panTiltY(); break; case 12: *reinterpret_cast< QString*>(_v) = zoomSpace(); break; case 13: *reinterpret_cast< float*>(_v) = zoomX(); break; case 14: *reinterpret_cast< QString*>(_v) = defaultPTZTimeout(); break; case 15: *reinterpret_cast< QString*>(_v) = panTiltUri(); break; case 16: *reinterpret_cast< float*>(_v) = panTiltXRangeMin(); break; case 17: *reinterpret_cast< float*>(_v) = panTiltXRangeMax(); break; case 18: *reinterpret_cast< float*>(_v) = panTiltYRangeMin(); break; case 19: *reinterpret_cast< float*>(_v) = panTiltYRangeMax(); break; case 20: *reinterpret_cast< QString*>(_v) = zoomUri(); break; case 21: *reinterpret_cast< float*>(_v) = zoomXRangeMin(); break; case 22: *reinterpret_cast< float*>(_v) = zoomXRangeMax(); break; default: break; } _id -= 23; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setPtzConfigurationToken(*reinterpret_cast< QString*>(_v)); break; case 1: setName(*reinterpret_cast< QString*>(_v)); break; case 2: setUseCount(*reinterpret_cast< int*>(_v)); break; case 3: setNodeToken(*reinterpret_cast< QString*>(_v)); break; case 4: setDefaultAbsoluteZoomPositionSpace(*reinterpret_cast< QString*>(_v)); break; case 5: setDefaultRelativePanTiltTranslationSpace(*reinterpret_cast< QString*>(_v)); break; case 6: setDefaultRelativeZoomTranslationSpace(*reinterpret_cast< QString*>(_v)); break; case 7: setDefaultContinuousPanTiltVelocitySpace(*reinterpret_cast< QString*>(_v)); break; case 8: setDefaultContinuousZoomVelocitySpace(*reinterpret_cast< QString*>(_v)); break; case 9: setPanTiltSpace(*reinterpret_cast< QString*>(_v)); break; case 10: setPanTiltX(*reinterpret_cast< float*>(_v)); break; case 11: setPanTiltY(*reinterpret_cast< float*>(_v)); break; case 12: setZoomSpace(*reinterpret_cast< QString*>(_v)); break; case 13: setZoomX(*reinterpret_cast< float*>(_v)); break; case 14: setDefaultPTZTimeout(*reinterpret_cast< QString*>(_v)); break; case 15: setPanTiltUri(*reinterpret_cast< QString*>(_v)); break; case 16: setPanTiltXRangeMin(*reinterpret_cast< float*>(_v)); break; case 17: setPanTiltXRangeMax(*reinterpret_cast< float*>(_v)); break; case 18: setPanTiltYRangeMin(*reinterpret_cast< float*>(_v)); break; case 19: setPanTiltYRangeMax(*reinterpret_cast< float*>(_v)); break; case 20: setZoomUri(*reinterpret_cast< QString*>(_v)); break; case 21: setZoomXRangeMin(*reinterpret_cast< float*>(_v)); break; case 22: setZoomXRangeMax(*reinterpret_cast< float*>(_v)); break; default: break; } _id -= 23; } else if (_c == QMetaObject::ResetProperty) { _id -= 23; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 23; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 23; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 23; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 23; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 23; } else if (_c == QMetaObject::RegisterPropertyMetaType) { if (_id < 23) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 23; } #endif // QT_NO_PROPERTIES return _id; }
int main(void) { struct HashMapNoCount* A = HashMapNoCountCreate(MAXHASHVALUE, HashNoCountA); struct HashMapNoCount* B = HashMapNoCountCreate(MAXHASHVALUE, HashNoCountB); int N; scanf("%d\n", &N); int i; char* buffer = (char*)malloc(sizeof(char) * 100); char mode; int x, y; for(i = 0; i < N; i++) { scanf("%s ", buffer); if(strcmp(buffer, "ADD\0") == 0) { scanf("%d %d", &x, &y); if( i == 0 && x+y == 0) { useCount(buffer, N, x, y); free(buffer); HashMapNoCountDestroy(A); HashMapNoCountDestroy(B); return 0; } DataNoCount NewData; NewData.a = x; NewData.b = y; HashMapNoCountAdd(A, NewData); HashMapNoCountAdd(B, NewData); int count = HashMapNoCountCount(A, NewData, cmpData); printf("%d\n", count); } else if(strcmp(buffer, "DELETE\0") == 0) { scanf("%c", &mode); if(mode == 'A') { scanf("%d", &x); DataNoCount NewData; NewData.a = x; int count = HashMapNoCountCount(A, NewData, cmpDataA); printf("%d\n", count); while(1) { DataNoCount* Del = HashMapNoCountDeleteOne(A, NewData, cmpDataA); if(Del != NULL) { HashMapNoCountDeleteOne(B, *Del, cmpData); } else break; } } if(mode == 'B') { scanf("%d", &y); DataNoCount NewData; NewData.b = y; int count = HashMapNoCountCount(B, NewData, cmpDataB); printf("%d\n", count); while(1) { DataNoCount* Del = HashMapNoCountDeleteOne(B, NewData, cmpDataB); if(Del != NULL) { HashMapNoCountDeleteOne(A, *Del, cmpData); } else break; } } } else if(strcmp(buffer, "COUNT\0") == 0) { scanf("%c", &mode); if(mode == 'A') { scanf("%d", &x); DataNoCount NewData; NewData.a = x; int count = HashMapNoCountCount(A, NewData, cmpDataA); printf("%d\n", count); } if(mode == 'B') { scanf("%d", &y); DataNoCount NewData; NewData.b = y; int count = HashMapNoCountCount(B, NewData, cmpDataB); printf("%d\n", count); } } else { printf("ERR\n"); } } free(buffer); HashMapNoCountDestroy(A); HashMapNoCountDestroy(B); return 0; }
inline void* allocate(size_t size) { if (!_isEnabled || (size > BLOCK_SIZE) || (freeCount() < MAX_CPU)) return ::operator new(size); if (useCount() > _debugMaxUsage) _debugMaxUsage = useCount(); return _queue[++_newCount & MASK]; }
inline Type::int32 freeCount() { return SIZE - useCount(); }
int ONVIF::AudioEncoderConfiguration::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 13) qt_static_metacall(this, _c, _id, _a); _id -= 13; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 13) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 13; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = token(); break; case 1: *reinterpret_cast< QString*>(_v) = name(); break; case 2: *reinterpret_cast< int*>(_v) = useCount(); break; case 3: *reinterpret_cast< QString*>(_v) = encoding(); break; case 4: *reinterpret_cast< int*>(_v) = bitrate(); break; case 5: *reinterpret_cast< int*>(_v) = sampleRate(); break; case 6: *reinterpret_cast< QString*>(_v) = type(); break; case 7: *reinterpret_cast< QString*>(_v) = ipv4Address(); break; case 8: *reinterpret_cast< QString*>(_v) = ipv6Address(); break; case 9: *reinterpret_cast< int*>(_v) = port(); break; case 10: *reinterpret_cast< int*>(_v) = ttl(); break; case 11: *reinterpret_cast< bool*>(_v) = autoStart(); break; case 12: *reinterpret_cast< QString*>(_v) = sessionTimeout(); break; } _id -= 13; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setToken(*reinterpret_cast< QString*>(_v)); break; case 1: setName(*reinterpret_cast< QString*>(_v)); break; case 2: setUseCount(*reinterpret_cast< int*>(_v)); break; case 3: setEncoding(*reinterpret_cast< QString*>(_v)); break; case 4: setBitrate(*reinterpret_cast< int*>(_v)); break; case 5: setSampleRate(*reinterpret_cast< int*>(_v)); break; case 6: setType(*reinterpret_cast< QString*>(_v)); break; case 7: setIpv4Address(*reinterpret_cast< QString*>(_v)); break; case 8: setIpv6Address(*reinterpret_cast< QString*>(_v)); break; case 9: setPort(*reinterpret_cast< int*>(_v)); break; case 10: setTtl(*reinterpret_cast< int*>(_v)); break; case 11: setAutoStart(*reinterpret_cast< bool*>(_v)); break; case 12: setSessionTimeout(*reinterpret_cast< QString*>(_v)); break; } _id -= 13; } else if (_c == QMetaObject::ResetProperty) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 13; } else if (_c == QMetaObject::RegisterPropertyMetaType) { if (_id < 13) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 13; } #endif // QT_NO_PROPERTIES return _id; }
int ONVIF::VideoEncoderConfiguration::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 19) qt_static_metacall(this, _c, _id, _a); _id -= 19; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 19) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 19; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = token(); break; case 1: *reinterpret_cast< QString*>(_v) = name(); break; case 2: *reinterpret_cast< int*>(_v) = useCount(); break; case 3: *reinterpret_cast< QString*>(_v) = encoding(); break; case 4: *reinterpret_cast< int*>(_v) = width(); break; case 5: *reinterpret_cast< int*>(_v) = height(); break; case 6: *reinterpret_cast< int*>(_v) = quality(); break; case 7: *reinterpret_cast< int*>(_v) = frameRateLimit(); break; case 8: *reinterpret_cast< int*>(_v) = encodingInterval(); break; case 9: *reinterpret_cast< int*>(_v) = bitrateLimit(); break; case 10: *reinterpret_cast< int*>(_v) = govLength(); break; case 11: *reinterpret_cast< QString*>(_v) = h264Profile(); break; case 12: *reinterpret_cast< QString*>(_v) = type(); break; case 13: *reinterpret_cast< QString*>(_v) = ipv4Address(); break; case 14: *reinterpret_cast< QString*>(_v) = ipv6Address(); break; case 15: *reinterpret_cast< int*>(_v) = port(); break; case 16: *reinterpret_cast< int*>(_v) = ttl(); break; case 17: *reinterpret_cast< bool*>(_v) = autoStart(); break; case 18: *reinterpret_cast< QString*>(_v) = sessionTimeout(); break; default: break; } _id -= 19; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setToken(*reinterpret_cast< QString*>(_v)); break; case 1: setName(*reinterpret_cast< QString*>(_v)); break; case 2: setUseCount(*reinterpret_cast< int*>(_v)); break; case 3: setEncoding(*reinterpret_cast< QString*>(_v)); break; case 4: setWidth(*reinterpret_cast< int*>(_v)); break; case 5: setHeight(*reinterpret_cast< int*>(_v)); break; case 6: setQuality(*reinterpret_cast< int*>(_v)); break; case 7: setFrameRateLimit(*reinterpret_cast< int*>(_v)); break; case 8: setEncodingInterval(*reinterpret_cast< int*>(_v)); break; case 9: setBitrateLimit(*reinterpret_cast< int*>(_v)); break; case 10: setGovLength(*reinterpret_cast< int*>(_v)); break; case 11: setH264Profile(*reinterpret_cast< QString*>(_v)); break; case 12: setType(*reinterpret_cast< QString*>(_v)); break; case 13: setIpv4Address(*reinterpret_cast< QString*>(_v)); break; case 14: setIpv6Address(*reinterpret_cast< QString*>(_v)); break; case 15: setPort(*reinterpret_cast< int*>(_v)); break; case 16: setTtl(*reinterpret_cast< int*>(_v)); break; case 17: setAutoStart(*reinterpret_cast< bool*>(_v)); break; case 18: setSessionTimeout(*reinterpret_cast< QString*>(_v)); break; default: break; } _id -= 19; } else if (_c == QMetaObject::ResetProperty) { _id -= 19; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 19; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 19; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 19; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 19; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 19; } else if (_c == QMetaObject::RegisterPropertyMetaType) { if (_id < 19) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 19; } #endif // QT_NO_PROPERTIES return _id; }