Exemplo n.º 1
0
int dvr_thmb_dispPage(cdvr_thmb_t *pdvr, int page, char *disp_pData)
{
	int s_idx = -1;
	int ret = -1;
	int i;
	SINT64 stime, etime;
	disp_thmb_t *pthmb = NULL;
	if(!pdvr) {
		return -1;
	}

	dvr_thmb_setDispThmbMode(pdvr);

	photo_uninit(pdvr->pPhotoInfo); //for jpeg->thmb->jpeg
	pdvr->pPhotoInfo = NULL;

	//pdvr->cur_page = page;
	s_idx = pdvr->disp_number*pdvr->cur_page;
	//pdvr->cur_idx = 0;

	for(i=0; i<pdvr->disp_number; i++) {
		pthmb = &pdvr->disp_thmb[i];
		pdvr->pUrl = pthmb->url = FilelistGetFilePath(pdvr->pFile, s_idx);
		//printf("get thmb:%s\n", pdvr->pUrl);
		if(pthmb->url) {
			pdvr->fileType = pthmb->type = checkFileType(pthmb->url);
			pthmb->lock = FilelistGetLock(pdvr->pFile, s_idx);
			//printf("get lock %d\n", pthmb->lock);
			//printf("get %d %s type: %d thumbnail:\n", s_idx, pthmb->url, pthmb->type);
			stime = sysGetCurTime(); 
			ret = -1;

			if(pthmb->type == GP_FILE_TYPE_VIDEO) {
				pthmb->bitmap.pData = disp_pData;
				ret = mcpQtffGetThumbnail(&pthmb->bitmap, pthmb->url);
				if(ret == -1) {
					printf("WARNNING: USING parse video thumbnail !\n");
					ret = mcpGetThumbnail(&pthmb->bitmap, pthmb->url, 0);
					if(ret == -1) {
						printf("WARNNING: get video thumbnail error!!!!!!!\n");
					}
				}
			}
			else if(pthmb->type == GP_FILE_TYPE_JPEG) {
				ret = load_imageThumbnail(pthmb->url, pdvr, pthmb, (UINT8 *)disp_pData);
			}
			etime = sysGetCurTime();
			printf("thumbnail used time %lld - %lld = %lldms ret %d\n", etime, stime, etime - stime, ret);
		}
		s_idx++;
		if(s_idx == pdvr->file_number) {
			break;
		}
	}

	return 0;
}
Exemplo n.º 2
0
int dvr_thmb_dispPage(cdvr_thmb_t *pdvr)
{
	int ret;
	if(!pdvr) {
		return -1;
	}
    printf("%s:%d\n", __FUNCTION__, __LINE__);
	if(pdvr->dispMode == DISP_NO_FILE) {
		return -1;
	}

	dvr_thmb_setDispThmbMode(pdvr);
	ret = playback_Set_PIPE_With_CMD(CMD_SET_THMBSCREEN, 1);
	dvr_thmb_get_info();
	pdvr->pUrl = FilelistGetFileName(0);
	ret = playback_Set_PIPE_With_CMD(CMD_GET_FILE_ALL_TYPE, 1);
	FilelistGetPageLock();

	return ret;
}