void VideoEngine::CreateVideoCapture(int32_t& id, const char* deviceUniqueIdUTF8) { LOG((__PRETTY_FUNCTION__)); MOZ_ASSERT(deviceUniqueIdUTF8); id = GenerateId(); LOG(("CaptureDeviceInfo.type=%s id=%d",mCaptureDevInfo.TypeName(),id)); for (auto &it : mCaps) { if (it.second.VideoCapture() && it.second.VideoCapture()->CurrentDeviceName() && strcmp(it.second.VideoCapture()->CurrentDeviceName(), deviceUniqueIdUTF8) == 0) { mIdMap.emplace(id, it.first); return; } } CaptureEntry entry = {-1, nullptr}; if (mCaptureDevInfo.type == webrtc::CaptureDeviceType::Camera) { entry = CaptureEntry(id, webrtc::VideoCaptureFactory::Create(deviceUniqueIdUTF8)); } else { #ifndef WEBRTC_ANDROID entry = CaptureEntry( id, webrtc::DesktopCaptureImpl::Create(id, deviceUniqueIdUTF8, mCaptureDevInfo.type)); #else MOZ_ASSERT("CreateVideoCapture NO DESKTOP CAPTURE IMPL ON ANDROID" == nullptr); #endif } mCaps.emplace(id, std::move(entry)); mIdMap.emplace(id, id); }
std::string ID::Get() { std::string id= GenerateId(); //std::string key=GenerateKey(id); //LicenseKeyCorrect(id, key); return id; }
/*! @brief Default time constructor This constructor requires a creation time. */ WeightedModel::WeightedModel(float time) { const unsigned int history_depth = 5; m_id = GenerateId(); // calculate unique id. m_creation_time = time; m_alpha = 1.0f; m_parent_history_buffer = boost::circular_buffer<unsigned int>(history_depth); return; }
void VideoEngine::CreateVideoCapture(int32_t& id, const char* deviceUniqueIdUTF8) { LOG((__PRETTY_FUNCTION__)); MOZ_ASSERT(deviceUniqueIdUTF8); id = GenerateId(); LOG(("CaptureDeviceInfo.type=%s id=%d", mCaptureDevInfo.TypeName(), id)); for (auto& it : mCaps) { if (it.second.VideoCapture() && it.second.VideoCapture()->CurrentDeviceName() && strcmp(it.second.VideoCapture()->CurrentDeviceName(), deviceUniqueIdUTF8) == 0) { mIdMap.emplace(id, it.first); return; } } CaptureEntry entry = {-1, nullptr}; if (mCaptureDevInfo.type == webrtc::CaptureDeviceType::Camera) { entry = CaptureEntry( id, webrtc::VideoCaptureFactory::Create(deviceUniqueIdUTF8)); if (entry.VideoCapture()) { entry.VideoCapture()->SetApplyRotation(true); } } else { #ifndef WEBRTC_ANDROID # ifdef MOZ_X11 webrtc::VideoCaptureModule* captureModule; auto type = mCaptureDevInfo.type; nsresult result = NS_DispatchToMainThread( media::NewRunnableFrom([&captureModule, id, deviceUniqueIdUTF8, type]() -> nsresult { captureModule = webrtc::DesktopCaptureImpl::Create(id, deviceUniqueIdUTF8, type); return NS_OK; }), nsIEventTarget::DISPATCH_SYNC); if (result == NS_OK) { entry = CaptureEntry(id, captureModule); } else { return; } # else entry = CaptureEntry(id, webrtc::DesktopCaptureImpl::Create( id, deviceUniqueIdUTF8, mCaptureDevInfo.type)); # endif #else MOZ_ASSERT("CreateVideoCapture NO DESKTOP CAPTURE IMPL ON ANDROID" == nullptr); #endif } mCaps.emplace(id, std::move(entry)); mIdMap.emplace(id, id); }
/*! @brief Child constructor. Creates a child model from the given parent. @param parent The parent model. @param time Creation time (current time). */ WeightedModel::WeightedModel(const WeightedModel& parent, float time) { m_active = false; m_alpha = parent.alpha(); m_id = GenerateId(); m_parent_id = parent.id(); m_creation_time = time; m_parent_history_buffer = parent.m_parent_history_buffer; // Get parents history. m_parent_history_buffer.push_back(m_parent_id); // Add parent to the history. }
// main function. Obufuscator will call this function void ONWhile::Action(Node *node) { if ( !JudgeType(node) ) { return; } // before Obfuscated /* WHILE '(' expression ')' statement */ // after Obfuscated /* l_continue: if (!(expression)) goto l_break; statement; goto l_continue; l_break:; */ string l_continue = GenerateId(); string l_break = GenerateId(); Node *expression = node->getChild(2); Node *statement = node->getChild(4); stringstream ss; ss << l_continue << ":"; ss << "if(!(" << expression->ToSourceCode(isRemoveTypeset) << "))"; ss << "goto " << l_break << ";"; ss << statement->ToSourceCode(isRemoveTypeset) ; ss << "goto " << l_continue << ";"; ss << l_break << ":;"; string code = ss.str(); node->isObfuscated = true; node->obfuscatedTokenString = code; }
UIBase::UIBase(){ mother = nullptr; Show(); SetFocused(false); close = false; alpha = 255; Color[0] = 100; Color[1] = 100; Color[2] = 110; Color[3] = 255; style = UIStyle::BaseStyle; MouseInside = false; GenerateId(); UiName = utils::format("uiobj%.4d",ID); }
bool GetSubmitterId(const char *name, uint64_t &id) { uint32_t mgmtId; if (GetAttributeInt(HEADER_CLUSTER, HEADER_PROC, name, (int *) &mgmtId) < 0) { if (!GenerateId(mgmtId)) { // Failed to generate a new id, this seems fatal return false; } if (SetAttributeInt(HEADER_CLUSTER, HEADER_PROC, name, (int) mgmtId)) { // Failed to record the new id, this seems fatal return false; } } // The ((uint64_t) 0) << 32 id space is reserved for us id = (uint64_t) mgmtId; return true; }
//------------------------------------- // //------------------------------------- unsigned long int IdFactory::GetId() { return GenerateId(); }
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> QCLog* QCLog::Create() { QCLog* object = new QCLog(); return static_cast<QCLog*>(GenerateId(object)); }
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SensorLocation* SensorLocation::Create() { SensorLocation* object = new SensorLocation(); return static_cast<SensorLocation*>(GenerateId(object)); }
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Network* Network::Create() { Network* object = new Network(); return static_cast<Network*>(GenerateId(object)); }
static const int TypeId() { static const int typeId = GenerateId(); return typeId; }
void Channel::UnsubscribeFromNotification(std::string notification) { Json::Value params; params["propertyName"] = notification; sendRequest(GenerateId(),"MB.unsubscribeTo",params); }
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ArclinkRequest* ArclinkRequest::Create() { ArclinkRequest* object = new ArclinkRequest(); return static_cast<ArclinkRequest*>(GenerateId(object)); }
CRenderBuffer::CRenderBuffer() :m_uID(GenerateId()),m_iSaveID(0) { }
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Route* Route::Create() { Route* object = new Route(); return static_cast<Route*>(GenerateId(object)); }
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ConfigStation* ConfigStation::Create() { ConfigStation* object = new ConfigStation(); return static_cast<ConfigStation*>(GenerateId(object)); }