예제 #1
0
static void *obs_x264_create(obs_data_t *settings, obs_encoder_t *encoder)
{
	struct obs_x264 *obsx264 = bzalloc(sizeof(struct obs_x264));
	obsx264->encoder = encoder;

	if (update_settings(obsx264, settings)) {
		obsx264->context = x264_encoder_open(&obsx264->params);

		if (obsx264->context == NULL)
			warn("x264 failed to load");
		else
			load_headers(obsx264);
	} else {
		warn("bad settings specified");
	}

	if (!obsx264->context) {
		bfree(obsx264);
		return NULL;
	}

	obsx264->performance_token =
		os_request_high_performance("x264 encoding");

	return obsx264;
}
예제 #2
0
reporte::reporte()
{
    report = new NCReport();
    //report->
    load_headers();
    load_file_set();
}
예제 #3
0
static void *obs_qsv_create(obs_data_t *settings, obs_encoder_t *encoder)
{
	InitializeCriticalSection(&g_QsvCs);

	struct obs_qsv *obsqsv = bzalloc(sizeof(struct obs_qsv));
	obsqsv->encoder = encoder;

	if (update_settings(obsqsv, settings)) {
		EnterCriticalSection(&g_QsvCs);
		obsqsv->context = qsv_encoder_open(&obsqsv->params);
		LeaveCriticalSection(&g_QsvCs);

		if (obsqsv->context == NULL)
			warn("qsv failed to load");
		else
			load_headers(obsqsv);
	} else {
		warn("bad settings specified");
	}

	qsv_encoder_version(&g_verMajor, &g_verMinor);

	blog(LOG_INFO, "\tmajor:          %d\n"
	               "\tminor:          %d",
	               g_verMajor, g_verMinor);

	// MSDK 1.6 or less doesn't have automatic DTS calculation
	// including early SandyBridge.
	// Need to add manual DTS from PTS.
	if (g_verMajor == 1 && g_verMinor < 7) {
		int64_t interval = obsqsv->params.nbFrames + 1;
		int64_t GopPicSize = (int64_t)(obsqsv->params.nKeyIntSec *
				obsqsv->params.nFpsNum /
				(float)obsqsv->params.nFpsDen);
		g_pts2dtsShift = GopPicSize - (GopPicSize / interval) *
			interval;

		blog(LOG_INFO, "\tinterval:       %d\n"
		               "\tGopPictSize:    %d\n"
		               "\tg_pts2dtsShift: %d",
		               interval, GopPicSize, g_pts2dtsShift);
	}
	else
		g_pts2dtsShift = -1;

	if (!obsqsv->context) {
		bfree(obsqsv);
		return NULL;
	}

	obsqsv->performance_token =
		os_request_high_performance("qsv encoding");

	g_bFirst = true;

	return obsqsv;
}
예제 #4
0
파일: WIZBOOK.C 프로젝트: arpruss/ozdev
void view(void)
{
	static byte mod;
	static unsigned k;
    static unsigned long delta;
    static byte i;
	load_headers();
    in_buf=0;
    ateof=0;
    atstart=1;
    scrollbar_pos=0xa000+29;
    if(last==0) last=header_length;
    goto_pos(last);
	mod=1;
    ozcls();
	while(1)
	{
        if(mod)
        {
            if(!backandforth)position_save();
            show();
            unbar();
            scrollbar();
            backandforth=mod=0;
        }
        switch(k=ozgetchblank())
		{
            case KEY_LEFT:
            case KEY_BACKSPACE:
#ifdef DEBUG
                putformatted(0,0,"positionptr=| numpositions=|  ",
                positionptr,numpositions);
                ozgetch();
#endif
                if(positionptr<=1) break;
                goto_pos(positions[(--positionptr)-1]);
                if(!positionptr) positionptr=1;
                backandforth=mod=1;
#ifdef DEBUG
                putformatted(0,0,"positionptr=| numpositions=|  ",
                positionptr,numpositions);
                ozgetch();
#endif
                break;
            case KEY_RIGHT:
#ifdef DEBUG
                putformatted(0,0,"positionptr=| numpositions=|  ",
                positionptr,numpositions);
                ozgetch();
#endif
                if(positionptr>=numpositions) break;
                goto_pos(positions[positionptr]);
                positionptr++;
                backandforth=mod=1;
#ifdef DEBUG
                putformatted(0,0,"positionptr=| numpositions=|  ",
                positionptr,numpositions);
                ozgetch();
#endif
                break;
            case 'm':
                /* mark position */
                if(numbookmarks>=MAX_BOOKMARKS)
                {
                    for(i=0;i<MAX_BOOKMARKS-1;i++)
                    {
                        bookmarks[i]=bookmarks[i+1];
                    }
                    numbookmarks--;
                }
                bookmarkptr=numbookmarks;
                bookmarks[numbookmarks++]=screen_offset+buffer_offset;
                bookmarksmod=1;
                break;
            case 'b':
                if(numbookmarks)
                {
                    goto_pos(bookmarks[bookmarkptr]);
                    if(bookmarkptr) bookmarkptr--;
                     else bookmarkptr=numbookmarks-1;
                    mod=1;
                }
                break;
            case 'r':
                show_bar=!show_bar;
                bookmarksmod=1;
                unbar();
                scrollbar();
                break;
            case 'h':
            case KEY_UPPER_MENU:
            case KEY_LOWER_MENU:
                dohelp();
                ozcls();
                mod=1;
                break;
            case 'i':
                _ozfilledbox(0,0,WIDTH,line_height,0);
                delta=screen_offset+buffer_offset-header_length;
                putformatted(0,0,"$ : ^/^=|%",filename,
                    delta,length-header_length,
                    (unsigned int)(delta*100/(length-header_length)) );
                _ozfilledbox(0,0,WIDTH,line_height,XOR);
                ozgetchblank();
                mod=1;
                ozcls();
                break;
            case 'c':
                if(numbookmarks && ozwarn("Delete all bookmarks?",yn)==KEY_LOWER_ENTER
                    )
                    {
                        bookmarksmod=1;
                        numbookmarks=0;
                    }
                mod=1;
                ozcls();
                break;
            case '-':
			case KEY_PAGEUP:
                for(i=0;i<num_lines-1;i++)
				{
					checkshiftup();
					backline();
				}
				mod=1;
				break;
            case 's':
                if(myfont) break;
                line_height++;
                if(line_height==11) line_height=8;
                if(line_height!=9) num_lines=80/line_height;
                    else num_lines=9;
                bookmarksmod=1;
                mod=1;
                ozcls();
                break;
			case KEY_PAGEDOWN:
            case KEY_LOWER_ENTER:
            case KEY_UPPER_ENTER:
            case KEY_RETURN:
            case ' ':
                for(i=0;i<num_lines-1;i++)
				{
					checkshiftdown();
					forwardline();
				}
				mod=1;
				break;
            case KEY_UP:
                checkshiftup();
                if(!backline()) break;
                unbar();
                ozscrolldown(line_height*30);
                dcompline(filebuf+screen_offset);
                puttextline(0);
                position_save();
                scrollbar();
                break;
            case KEY_DOWN:
                checkshiftdown();
                if(forwardline())
                {
                    mod=1;
                    showbot=1;
                    unbar();
                    ozscroll(line_height*30);
                }
                break;
            case KEY_LEFT_SHIFT | MASKSHIFT:
            case KEY_RIGHT_SHIFT | MASKSHIFT:
                switch(ozgetch() & 0xF0FF)
                {
                    case '-':
                        ozclick(!ozgetclick());
                        ozsavekeysettings();
                        break;
                    case KEY_PAGEUP:
                    case KEY_UP:
                        tenpercent(-1);
                        mod=1;
                        break;
                    case KEY_PAGEDOWN:
                    case KEY_DOWN:
                        tenpercent(1);
                        mod=1;
                        break;
                }
                break;
            case KEY_UP | MASKSHIFT:
            case KEY_PAGEUP | MASKSHIFT:
                tenpercent(-1);
                mod=1;
                break;
            case KEY_PAGEDOWN | MASKSHIFT:
            case KEY_DOWN | MASKSHIFT:
                tenpercent(1);
                mod=1;
                break;
			case KEY_2ND:
                switch(ozgetch() & 0xF0FF )
				{
                    case '-':
                        ozclick(!ozgetclick());
                        ozsavekeysettings();
                        break;
                    case KEY_PAGEUP:
					case KEY_UP:
                        goto_pos(header_length);
						mod=1;
						break;
					case KEY_PAGEDOWN:
					case KEY_DOWN:
                        goto_pos(length);
						mod=1;
						break;
				}
				break;
			case KEY_LOWER_ESC:
			case KEY_UPPER_ESC:
			case KEY_MYPROGRAMS:
				exit(0);
			case KEY_MAIN:
			case KEY_CALENDAR:
			case KEY_TELEPHONE:
			case KEY_MEMO:
				ozexitto(k);
			case KEY_BACKLIGHT:
                oztogglelight();
				break;
		}
	}
}