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

	if(pdvr->dispMode == DISP_NO_FILE) {
		return -1;
	}

	dvr_thmb_setDispFullMode(pdvr);
	ret = playback_Set_PIPE_With_CMD(CMD_SET_FULLSCREEN, 1);
	if(g_cmd_ret == -1) {
		g_cmd_ret = dvr_thmb_setMovRecover(pdvr);
		ret = playback_Set_PIPE_With_CMD(CMD_SET_FULLSCREEN, 1);
	}
	dvr_thmb_get_info();
	pdvr->pUrl = FilelistGetFileName(0);
#if CVR_DUAL
	playback_Set_PIPE_With_CMD(CMD_GET_FILE_DUAL_IDX, 1);
#endif

	return ret;
}
Exemplo n.º 2
0
/**
 * to get file info to show in screen.
 **/
int dvr_thmb_getFileInfo(cdvr_thmb_t *pdvr, char *buf)
{
	struct stat info;
	struct tm *p;
	char file[512];
	sprintf(file, "%s", FilelistGetFilePath(0));
	strcat(file, FilelistGetFileName(0));
	if(access(file, F_OK) == 0) {
		stat((char *)file, &info);
		localtime_r(&(info.st_mtime), &pdvr->FileTime);
	}

	p = &pdvr->FileTime;

	sprintf(buf, "%d/%d%d/%d%d %d%d:%d%d", p->tm_year+1900, (p->tm_mon+1)/10, (p->tm_mon+1)%10, p->tm_mday/10, p->tm_mday%10, p->tm_hour/10, p->tm_hour%10, p->tm_min/10, p->tm_min%10);
	return 0;
}
Exemplo n.º 3
0
int dvr_thmb_nextPage(cdvr_thmb_t *pdvr)
{
	int ret;
	if(!pdvr) {
		return -1;
	}
    printf("%s:%d\n", __FUNCTION__, __LINE__);

	pdvr->pUrl = NULL;
	pdvr->pPath = NULL;
	ret = playback_Set_PIPE_With_CMD(CMD_SET_NEXT_PAGE, 1);
	dvr_thmb_get_info();
	FilelistGetPageLock();
	pdvr->pUrl = FilelistGetFileName(0);

	return ret;
}
Exemplo n.º 4
0
int dvr_thmb_UpdateAllInfo(cdvr_thmb_t *pdvr)
{
	if(!pdvr) {
		pdvr = g_cdvr;
		if(!pdvr) {
			return -1;
		}
	}
	dvr_thmb_get_info();
	pdvr->pUrl = NULL;
	pdvr->pPath= NULL;
	FilelistGetPageLock();
	FilelistGetFilePath(0);
	FilelistGetFileName(0);
	playback_Set_PIPE_With_CMD(CMD_GET_FILE_ALL_TYPE, 1);
	dvr_thmb_dispFullScreen(pdvr);
	return 0;

}
Exemplo n.º 5
0
int dvr_thmb_dispFullScreen_Replace(cdvr_thmb_t *pdvr)
{
	int ret;
	if(!pdvr) {
		pdvr = g_cdvr;
		if(!pdvr)
			return -1;
	}

	if(pdvr->dispMode == DISP_NO_FILE) {
		return -1;
	}

	dvr_thmb_setDispFullMode(pdvr);
	ret = playback_Set_PIPE_With_CMD(CMD_SET_FULLSCREEN_REPLACE, 1);
	dvr_thmb_get_info();
	pdvr->pUrl = FilelistGetFileName(0);

	return ret;
}
Exemplo n.º 6
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;
}
Exemplo n.º 7
0
/**
 * return cur index file name. using for show name in screen.
 **/
char *dvr_thmb_getFileName(cdvr_thmb_t *pdvr, gp_file_t *pFile)
{
	return FilelistGetFileName(pFile, dvr_thmb_getCurIdxOfFile(pdvr));
}
Exemplo n.º 8
0
void playback_reboot(int w, int h)
{

	int i, idx=0;
	int disp = 0;
	pid_t cam_pid;
	char *argv[32];
	cdvr_thmb_t *pdvr = NULL;

	argv[idx++] = strdup("/system/app/cvrplayer");
	//argv[idx++] = strdup("/media/sdcardc1/cvrplayer");
	argv[idx++] = strdup("cvrplayer");
	
	argv[idx++] = strdup("-p");
	argv[idx++] = strdup(Memory_path);
	argv[idx++] = strdup("-d");
	argv[idx++] = (char *)malloc(32);
	/*if(HDMI_Check() == 1) { // for hdmi and tv check.
		disp = 6;
	}
	else if(TV_Check() == 1) {
		disp = 4;
	}
	else */{
		disp = 0;
	}
	sprintf(argv[idx-1], "%d", disp);
	
	argv[idx++] = (char *)0;
	pipeDelete();
	public_pipeinit(playback_receive_cmd_callback);

	signal(SIGCHLD, SIG_IGN);
	if((cam_pid = fork()) <0)
	{
		perror("creat pid fail\n");
		return ;
	}
	else if(cam_pid==0)
	{
		for(i=0; i<idx-1; i++) {
			printf("%s\n", argv[i]);
		}
		execv(argv[0], &argv[1]);
	}
	else {
		for(i=0; i<idx-1; i++) {
			free(argv[i]);
		}

		pdvr = g_cdvr;
		if (pdvr->dispMode == DISP_NO_FILE) {
			pdvr->pid = cam_pid;
    		printf("%s:%d no file mode\n", __FUNCTION__, __LINE__);
		}
		usleep(500*1000);

		dvr_thmb_set_info(pdvr);
		pdvr->pUrl = NULL;
		pdvr->pPath = NULL;
		pdvr->pVideoInfo->speed = 0;
		pdvr->sclIdx = 0;
		pdvr->pVideoInfo->volume = ExtGpVideoEngineGetVolume();
		if(pdvr->pVideoInfo->volume > 8) {
			pdvr->pVideoInfo->volume = 8;
		}
		pdvr->pVideoInfo->videoMode = VIDEO_OPEN;

		pdvr->pUrl = FilelistGetFileName(0);
		pdvr->pPath = FilelistGetFilePath(0);
		FilelistGetPageLock();

		if(pdvr->dispMode == DISP_THMB_SCREEN) {
			dvr_thmb_dispPage(g_cdvr);
		}
		else {
    		printf("%s:%d init cvrplayer to FullScreen mode\n", __FUNCTION__, __LINE__);
			dvr_thmb_dispFullScreen(g_cdvr);
		}

		pdvr->pid = cam_pid;
	}
	return ;
}