already_AddRefed<MFTDecoder> WMFVideoMFTManager::Init() { RefPtr<MFTDecoder> decoder = InitInternal(/* aForceD3D9 = */ false); // If initialization failed with d3d11 DXVA then try falling back // to d3d9. if (!decoder && mDXVA2Manager && mDXVA2Manager->IsD3D11()) { mDXVA2Manager = nullptr; decoder = InitInternal(true); } return decoder.forget(); }
// straight pass-through, don't check args, let the TM do it. void tmIPCModule::HandleMsg(ipcClientHandle client, const nsID &target, const void *data, PRUint32 dataLen) { // make sure the trans mngr is there if (!tm && (InitInternal() < 0)) return; // create the transaction tmTransaction *trans = new tmTransaction(); // initialize it if (trans) { if(NS_SUCCEEDED(trans->Init(IPC_GetClientID(client), // who owns it TM_INVALID_ID, // in data TM_INVALID, // in data TM_INVALID, // in data (PRUint8 *)data, // raw message dataLen))) { // length of message // pass it on to the trans mngr tm->HandleTransaction(trans); } else delete trans; } }
CUICursor::CUICursor() { bVisible = false; vPos.set (0.f,0.f); InitInternal (); Device.seqRender.Add (this,2); }
BOOL CLocationList::InitListX(const char * pszFileList) { TString strA, strB; TFileRichList file; CLocation * loc = NULL; int notNullCountry = 0; // try to open if (file.Open(pszFileList, "r") == FALSE) { InitInternal(); m_bModified = TRUE; return FALSE; } // read file while(file.ReadLine()) { loc = new CLocation; if (loc != NULL) { loc->m_strCity = file.GetField(0); loc->m_strCountry = file.GetField(1); if (loc->m_strCountry.GetLength() > 0) notNullCountry ++; loc->m_fLongitude = atof(file.GetField(2)); loc->m_fLatitude = atof(file.GetField(3)); loc->m_fTimezone = atof(file.GetField(4)); loc->m_nDST = atoi(file.GetField(5)); AddTail(loc); loc = NULL; } } // zatvara subor file.Close(); if (list == NULL || notNullCountry == 0) { RemoveAll(); InitInternal(); m_bModified = TRUE; } return TRUE; }
bool WMFVideoMFTManager::Init() { bool success = InitInternal(/* aForceD3D9 = */ false); // If initialization failed with d3d11 DXVA then try falling back // to d3d9. if (!success && mDXVA2Manager && mDXVA2Manager->IsD3D11()) { mDXVA2Manager = nullptr; nsCString d3d11Failure = mDXVAFailureReason; success = InitInternal(true); mDXVAFailureReason.Append(NS_LITERAL_CSTRING("; ")); mDXVAFailureReason.Append(d3d11Failure); } return success; }
void AutoJSAPI::Init() { MOZ_ASSERT(!mCx, "An AutoJSAPI should only be initialised once"); InitInternal(/* aGlobalObject */ nullptr, /* aGlobal */ nullptr, danger::GetJSContext(), NS_IsMainThread()); }
void UWKRendererGL::UpdateTexture() { if (!valid_ && surfaceIDSet_) { InitInternal(); } renderToTexture(); }
Wiimote::Wiimote() : index() , m_last_input_report() , m_channel(0) , m_rumble_state() , m_need_prepare() { InitInternal(); }
ECode Chronometer::Init( /* [in] */ IContext* context, /* [in] */ IAttributeSet* attrs, /* [in] */ Int32 defStyle) { ASSERT_SUCCEEDED(TextView::Init(context, attrs, defStyle)); ASSERT_SUCCEEDED(InitInternal(context, attrs, defStyle)); return NOERROR; }
void AutoJSAPI::Init() { MOZ_ASSERT(!mCx, "An AutoJSAPI should only be initialised once"); InitInternal(/* aGlobal */ nullptr, nsContentUtils::GetDefaultJSContextForThread(), NS_IsMainThread()); }
NS_IMETHODIMP sbWatchFolderService::Notify(nsITimer *aTimer) { nsresult rv; // Handle startup delay (internally init) if (aTimer == mStartupDelayTimer) { LOG(("%s: startup delay timer [%08x] fired", __FUNCTION__, mStartupDelayTimer.get())); rv = InitInternal(); NS_ENSURE_SUCCESS(rv, rv); } // Handle flushing the old file system watcher with a new one else if (aTimer == mFlushFSWatcherTimer) { mFileSystemWatcher = nsnull; mShouldReinitWatcher = PR_FALSE; rv = StartWatchingFolder(); NS_ENSURE_SUCCESS(rv, rv); } // Standard processing of removed and non-queued changed paths. else if (aTimer == mEventPumpTimer) { if (mShouldProcessEvents) { // No events have been received since the event pump timer was armed. Go // ahead and process the event paths now. rv = ProcessEventPaths(); NS_ENSURE_SUCCESS(rv, rv); mEventPumpTimerIsSet = PR_FALSE; } else { // Some event has happened since the last time the event pump timer was // armed. Go ahead and wait another |EVENT_PUMP_TIMER_DELAY| milliseconds. LOG(("%s: arming event pump timer [%08x]", __FUNCTION__, mEventPumpTimer.get())); rv = mEventPumpTimer->InitWithCallback(this, EVENT_PUMP_TIMER_DELAY, nsITimer::TYPE_ONE_SHOT); NS_ENSURE_SUCCESS(rv, rv); mShouldProcessEvents = PR_TRUE; } } // Process queued changed event paths. else if (aTimer == mChangeDelayTimer) { rv = HandleEventPathList(mDelayedChangedPaths, eChanged); NS_ENSURE_SUCCESS(rv, rv); mChangeDelayTimerIsSet = PR_FALSE; } return NS_OK; }
nsresult nsPerformanceStatsService::Init() { nsresult rv = InitInternal(); if (NS_FAILED(rv)) { // Attempt to clean up. Dispose(); } return rv; }
// Initializes a decoder whose aImage and aObserver is already being used by a // parent decoder void Decoder::InitSharedDecoder() { // No re-initializing NS_ABORT_IF_FALSE(!mInitialized, "Can't re-initialize a decoder!"); // Implementation-specific initialization InitInternal(); mInitialized = true; }
// Initializes the Capture system remote server. // should be called before any other Capture call. bool InitForRemoteCapture(UInt32 flags, OnConnectFunc onConnect, OnDisconnectFunc onDisconnect) { if(!InitInternal(flags, onConnect, onDisconnect)) return false; g_server = RemoteServer::Create(); if(g_server) g_server->Start(); return true; }
nsresult MediaDecoderReader::Init() { if (mDecoder && mDecoder->DataArrivedEvent()) { mDataArrivedListener = mDecoder->DataArrivedEvent()->Connect( mTaskQueue, this, &MediaDecoderReader::NotifyDataArrived); } // Dispatch initialization that needs to happen on that task queue. mTaskQueue->Dispatch(NewRunnableMethod(this, &MediaDecoderReader::InitializationTask)); return InitInternal(); }
// Initializes the Capture system to store capture stream to disk, starting immediately. // should be called before any other Capture call. bool InitForLocalCapture(const char *outPath, UInt32 flags, OnConnectFunc onConnect, OnDisconnectFunc onDisconnect) { if(!InitInternal(flags, onConnect, onDisconnect)) return false; g_server = LocalServer::Create(outPath); if(g_server) g_server->Start(); return true; }
AutoJSAPI::AutoJSAPI(nsIGlobalObject* aGlobalObject, bool aIsMainThread, JSContext* aCx) { MOZ_ASSERT(aGlobalObject); MOZ_ASSERT(aGlobalObject->GetGlobalJSObject(), "Must have a JS global"); MOZ_ASSERT(aCx); MOZ_ASSERT_IF(aIsMainThread, NS_IsMainThread()); InitInternal(aGlobalObject->GetGlobalJSObject(), aCx, aIsMainThread); }
void CG3DApp::Init() { m_Graphics = m_System->Init(); m_Size = m_System->GetSize(); m_Viewport = new CG3DViewportSet(CG3DVector4(0, 0, m_Size.x, m_Size.y)); m_Graphics->SetGlobalSet(CG3DGlobalSet::VIEWPORT, m_Viewport.get()); InitInternal(); m_LastTime = m_System->GetTime(); }
AutoJSAPI::AutoJSAPI(nsIGlobalObject* aGlobalObject, bool aIsMainThread, JSContext* aCx) : mOwnErrorReporting(false) , mOldAutoJSAPIOwnsErrorReporting(false) { MOZ_ASSERT(aGlobalObject); MOZ_ASSERT(aGlobalObject->GetGlobalJSObject(), "Must have a JS global"); MOZ_ASSERT(aCx); MOZ_ASSERT_IF(aIsMainThread, NS_IsMainThread()); InitInternal(aGlobalObject->GetGlobalJSObject(), aCx, aIsMainThread); }
AutoJSAPI::AutoJSAPI(nsIGlobalObject* aGlobalObject, bool aIsMainThread, Type aType) : ScriptSettingsStackEntry(aGlobalObject, aType) , mIsMainThread(aIsMainThread) { MOZ_ASSERT(aGlobalObject); MOZ_ASSERT(aGlobalObject->GetGlobalJSObject(), "Must have a JS global"); MOZ_ASSERT(aIsMainThread == NS_IsMainThread()); InitInternal(aGlobalObject, aGlobalObject->GetGlobalJSObject(), danger::GetJSContext(), aIsMainThread); }
void Decoder::Init() { // No re-initializing NS_ABORT_IF_FALSE(!mInitialized, "Can't re-initialize a decoder!"); // Fire OnStartDecode at init time to support bug 512435 if (!IsSizeDecode() && mObserver) mObserver->OnStartDecode(nsnull); // Implementation-specific initialization InitInternal(); mInitialized = true; }
void Decoder::Init() { // No re-initializing MOZ_ASSERT(!mInitialized, "Can't re-initialize a decoder!"); // It doesn't make sense to decode anything but the first frame if we can't // store anything in the SurfaceCache, since only the last frame we decode // will be retrievable. MOZ_ASSERT(ShouldUseSurfaceCache() || IsFirstFrameDecode()); // Implementation-specific initialization InitInternal(); mInitialized = true; }
Chronometer::Chronometer( /* [in] */ IContext* context, /* [in] */ IAttributeSet* attrs, /* [in] */ Int32 defStyle) : TextView(context, attrs, defStyle) , mBase(0) , mVisible(FALSE) , mStarted(FALSE) , mRunning(FALSE) , mLogged(FALSE) , mRecycle(8) { mFormatterArgs = ArrayOf<IInterface*>::Alloc(1); mHandler = new MyHandler(this); ASSERT_SUCCEEDED(InitInternal(context, attrs, defStyle)); }
void Decoder::Init() { // No re-initializing NS_ABORT_IF_FALSE(!mInitialized, "Can't re-initialize a decoder!"); // Fire OnStartDecode at init time to support bug 512435. if (!IsSizeDecode()) { mProgress |= FLAG_DECODE_STARTED | FLAG_ONLOAD_BLOCKED; } // Implementation-specific initialization InitInternal(); mInitialized = true; }
// Initializes a decoder whose aImage and aObserver is already being used by a // parent decoder void Decoder::InitSharedDecoder(RasterImage* aImage, imgIDecoderObserver* aObserver) { // We should always have an image NS_ABORT_IF_FALSE(aImage, "Can't initialize decoder without an image!"); // No re-initializing NS_ABORT_IF_FALSE(mImage == nsnull, "Can't re-initialize a decoder!"); // Save our parameters mImage = aImage; mObserver = aObserver; // Implementation-specific initialization InitInternal(); mInitialized = true; }
bool WMFVideoMFTManager::Init() { bool success = InitInternal(/* aForceD3D9 = */ false); if (success && mDXVA2Manager) { // If we had some failures but eventually made it work, // make sure we preserve the messages. if (mDXVA2Manager->IsD3D11()) { mDXVAFailureReason.Append(NS_LITERAL_CSTRING("Using D3D11 API")); } else { mDXVAFailureReason.Append(NS_LITERAL_CSTRING("Using D3D9 API")); } } return success; }
bool AutoJSAPI::Init(nsIGlobalObject* aGlobalObject, JSContext* aCx) { MOZ_ASSERT(!mCx, "An AutoJSAPI should only be initialised once"); MOZ_ASSERT(aCx); if (NS_WARN_IF(!aGlobalObject)) { return false; } JSObject* global = aGlobalObject->GetGlobalJSObject(); if (NS_WARN_IF(!global)) { return false; } InitInternal(global, aCx, NS_IsMainThread()); return true; }
void Decoder::Init(RasterImage* aImage, imgIDecoderObserver* aObserver) { // We should always have an image NS_ABORT_IF_FALSE(aImage, "Can't initialize decoder without an image!"); // No re-initializing NS_ABORT_IF_FALSE(mImage == nsnull, "Can't re-initialize a decoder!"); // Save our paremeters mImage = aImage; mObserver = aObserver; // Fire OnStartDecode at init time to support bug 512435 if (!IsSizeDecode() && mObserver) mObserver->OnStartDecode(nsnull); // Implementation-specific initialization InitInternal(); mInitialized = true; }
// Initializes a decoder whose image and observer is already being used by a // parent decoder void Decoder::InitSharedDecoder(uint8_t* aImageData, uint32_t aImageDataLength, uint32_t* aColormap, uint32_t aColormapSize, RawAccessFrameRef&& aFrameRef) { // No re-initializing NS_ABORT_IF_FALSE(!mInitialized, "Can't re-initialize a decoder!"); mImageData = aImageData; mImageDataLength = aImageDataLength; mColormap = aColormap; mColormapSize = aColormapSize; mCurrentFrame = Move(aFrameRef); // We have all the frame data, so we've started the frame. if (!IsSizeDecode()) { PostFrameStart(); } // Implementation-specific initialization InitInternal(); mInitialized = true; }
// Initializes a decoder whose image and observer is already being used by a // parent decoder void Decoder::InitSharedDecoder(uint8_t* imageData, uint32_t imageDataLength, uint32_t* colormap, uint32_t colormapSize, imgFrame* currentFrame) { // No re-initializing NS_ABORT_IF_FALSE(!mInitialized, "Can't re-initialize a decoder!"); NS_ABORT_IF_FALSE(mObserver, "Need an observer!"); mImageData = imageData; mImageDataLength = imageDataLength; mColormap = colormap; mColormapSize = colormapSize; mCurrentFrame = currentFrame; // We have all the frame data, so we've started the frame. if (!IsSizeDecode()) { PostFrameStart(); } // Implementation-specific initialization InitInternal(); mInitialized = true; }