コード例 #1
0
 //==============================================================================
 void checkThreadIsAttached()
 {
    #if JUCE_MAC
     if (Thread::getCurrentThreadId() != lastThreadId)
         EnterMoviesOnThread (0);
     AttachMovieToCurrentThread (movie);
    #endif
 }
コード例 #2
0
ファイル: quicktimedrv.c プロジェクト: BigBoss21X/vice-emu
void gfxoutput_init_quicktime(void)
{
    /* init quicktime */
    OSErr error = EnterMoviesOnThread(0);
    if (error != noErr) {
        log_debug("quicktime: error initializing!");
        return;
    }
  
    gfxoutput_register(&quicktime_drv);
}
コード例 #3
0
ファイル: fsp_quicktime.cpp プロジェクト: Angeldude/pd
    QTThread(Movie m = NULL):
        movie(m)
    {
#ifdef VIBREZ
#ifdef _WIN32
        WaitForSingleObject(qtmutex,INFINITE);
#else

        EnterMoviesOnThread(0); 
        if(movie)
            AttachMovieToCurrentThread(movie);
#endif
#endif
    }
コード例 #4
0
ファイル: qtsplitter.c プロジェクト: AmesianX/wine
IUnknown * CALLBACK QTSplitter_create(IUnknown *punkout, HRESULT *phr)
{
    IUnknown *obj = NULL;
    PIN_INFO *piInput;
    QTSplitter *This;
    static const WCHAR wcsInputPinName[] = {'I','n','p','u','t',' ','P','i','n',0};

    EnterMoviesOnThread(0);

    RegisterWineDataHandler();

    This = CoTaskMemAlloc(sizeof(*This));
    obj = (IUnknown*)This;
    if (!This)
    {
        *phr = E_OUTOFMEMORY;
        return NULL;
    }
    ZeroMemory(This,sizeof(*This));

    BaseFilter_Init(&This->filter, &QT_Vtbl, &CLSID_QTSplitter, (DWORD_PTR)(__FILE__ ": QTSplitter.csFilter"), &BaseFuncTable);

    InitializeCriticalSection(&This->csReceive);
    This->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": QTSplitter.csReceive");

    This->pVideo_Pin = NULL;
    This->pAudio_Pin = NULL;
    This->state = State_Stopped;
    This->aSession = NULL;
    This->runEvent = CreateEventW(NULL, 0, 0, NULL);

    piInput = &This->pInputPin.pin.pinInfo;
    piInput->dir = PINDIR_INPUT;
    piInput->pFilter = &This->filter.IBaseFilter_iface;
    lstrcpynW(piInput->achName, wcsInputPinName, sizeof(piInput->achName) / sizeof(piInput->achName[0]));
    This->pInputPin.pin.IPin_iface.lpVtbl = &QT_InputPin_Vtbl;
    This->pInputPin.pin.refCount = 1;
    This->pInputPin.pin.pConnectedTo = NULL;
    This->pInputPin.pin.pCritSec = &This->filter.csFilter;

    SourceSeeking_Init(&This->sourceSeeking, &QT_Seeking_Vtbl, QTSplitter_ChangeStop, QTSplitter_ChangeStart, QTSplitter_ChangeRate,  &This->filter.csFilter);

    *phr = S_OK;
    return obj;
}
コード例 #5
0
void UBQuickTimeFile::run()
{
    EnterMoviesOnThread(kCSAcceptThreadSafeComponentsOnlyMode);

    mSouldStopCompression = false;
    mPendingFrames = 0;

    createCompressionSession();

    mCompressionSessionRunning = true;
    emit compressionSessionStarted();

    while(!mSouldStopCompression)
    {
        frameQueueMutex.lock();
        //qDebug() << "run .... wait" << QTime::currentTime();

        frameBufferNotEmpty.wait(&UBQuickTimeFile::frameQueueMutex);

        //qDebug() << "awakend ..." << QTime::currentTime();
        if (!frameQueue.isEmpty())
        {
            QQueue<VideoFrame> localQueue = frameQueue;
            frameQueue.clear();

            frameQueueMutex.unlock();

            while (!localQueue.isEmpty())
            {
                VideoFrame frame = localQueue.dequeue();
                appendVideoFrame(frame.buffer, frame.timestamp);
            }
        }
        else
        {
            frameQueueMutex.unlock();
        }
    }

    flushPendingFrames();
}
コード例 #6
0
ファイル: fsp_quicktime.cpp プロジェクト: Angeldude/pd
 virtual void ThreadBegin() 
 {
     EnterMoviesOnThread(0);
     AttachMovieToCurrentThread(movie);
 }
コード例 #7
0
int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, ReportList *reports) {
	OSErr err = noErr;

	char name[2048];
	char theFullPath[255];

#ifdef __APPLE__
	int		myFile;
	FSRef	myRef;
#else
	char	*qtname;
#endif
	int success= 1;

	if(qtexport == NULL) qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport");

	if(qtdata) {
		if(qtdata->theComponent) CloseComponent(qtdata->theComponent);
		free_qtcomponentdata();
	}

	qtdata = MEM_callocN(sizeof(QuicktimeComponentData), "QuicktimeCodecDataExt");

	if(rd->qtcodecdata == NULL || rd->qtcodecdata->cdParms == NULL) {
		get_qtcodec_settings(rd, reports);
	} else {
		qtdata->theComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType);

		QT_GetCodecSettingsFromScene(rd, reports);
		check_renderbutton_framerate(rd, reports);
	}
	
	sframe = (rd->sfra);

	filepath_qt(name, rd);

#ifdef __APPLE__
	EnterMoviesOnThread(0);
	sprintf(theFullPath, "%s", name);

	/* hack: create an empty file to make FSPathMakeRef() happy */
	myFile = open(theFullPath, O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRUSR|S_IWUSR);
	if (myFile < 0) {
		BKE_reportf(reports, RPT_ERROR, "error while creating movie file!\n");
		/* do something? */
	}
	close(myFile);
	err = FSPathMakeRef((const UInt8 *)theFullPath, &myRef, 0);
	CheckError(err, "FsPathMakeRef error", reports);
	err = FSGetCatalogInfo(&myRef, kFSCatInfoNone, NULL, NULL, &qtexport->theSpec, NULL);
	CheckError(err, "FsGetCatalogInfoRef error", reports);
#endif
#ifdef _WIN32
	qtname = get_valid_qtname(name);
	sprintf(theFullPath, "%s", qtname);
	strcpy(name, qtname);
	MEM_freeN(qtname);
	
	CopyCStringToPascal(theFullPath, qtexport->qtfilename);
	err = FSMakeFSSpec(0, 0L, qtexport->qtfilename, &qtexport->theSpec);
#endif

	err = CreateMovieFile (&qtexport->theSpec, 
						kMyCreatorType,
						smCurrentScript, 
						createMovieFileDeleteCurFile | createMovieFileDontCreateResFile,
						&qtexport->resRefNum, 
						&qtexport->theMovie );
	CheckError(err, "CreateMovieFile error", reports);

	if(err != noErr) {
		BKE_reportf(reports, RPT_ERROR, "Unable to create Quicktime movie: %s", name);
		success= 0;
#ifdef __APPLE__
		ExitMoviesOnThread();
#endif
	} else {
		//printf("Created QuickTime movie: %s\n", name);

		QT_CreateMyVideoTrack(rectx, recty, reports);
	}

	return success;
}