XILOutputAssistor::XILOutputAssistor(int type,const char*fn,struct deviceattributes *devattr) : Renderer(type) { char *cisname; XilDevice device; filename_ = strdup(fn); memcpy(&deviceattributes_,devattr,sizeof(deviceattributes_)); cisname=NULL; switch (type) { case FT_JPEG|FT_HW: cisname = "Jpeg"; memcpy(jfif_header1,jfif_header1_,sizeof(jfif_header1_)); memcpy(jfif_header2,jfif_header2_,sizeof(jfif_header2_)); break; case FT_H261: cisname = "H261"; break; case FT_CELLB: cisname = "CellB"; break; default: fprintf(stderr," unknown cis %d???\n",type&~FT_HW); break; } type_ = type; imageYCC = NULL; xil_ = xil_open(); if (xil_ == 0) { fprintf(stderr,"couldn't open xil.\n"); return;//FIXME } device = xil_device_create(xil_,deviceattributes_.name); if (device == 0) { fprintf(stderr,"couldn't open %s\n",deviceattributes_.name); return; } xil_device_set_value(device,"DEVICE_NAME",(void*)filename_); //fprintf(stderr,"VIDEO_OUT\n"); xil_device_set_value(device,"VIDEO_OUT",(void*)TRUE); o1kimage = xil_create_from_device(xil_,deviceattributes_.name,device); int arg; xil_get_device_attribute(o1kimage,"VIDEO_OUT",(void**)&arg); //fprintf(stderr,"VIDEO_OUT-> %d\n",arg); cis_ = xil_cis_create(xil_ , cisname); if (cis_ == 0) { fprintf(stderr,"couldn't create CIS for %s\n",cisname); return; } xil_cis_set_keep_frames(cis_, 3); xil_cis_set_max_frames(cis_, 3); //fprintf(stderr,"HW_DECOMPRESS_CIS\n"); // use _THIS_ cis_ for HW decompression xil_set_attribute(o1kimage,"HW_DECOMPRESS_CIS",cis_); }
XILWindowAssistor::XILWindowAssistor(int type) : Renderer(type), inq_(20) { char *cisname; XilDevice device; window_ = NULL; //fprintf(stderr,"XILWindowAssistor::"__FUNCTION__"\n"); cisname=NULL; switch (type) { case FT_JPEG|FT_HW: cisname = "Jpeg"; memcpy(jfif_header1,jfif_header1_,sizeof(jfif_header1_)); memcpy(jfif_header2,jfif_header2_,sizeof(jfif_header2_)); decimation_ = 420; lastjpegtype_ = 0xff; // invalid, so we reset first.. break; case FT_CELLB: cisname = "CellB"; break; case FT_H261: cisname = "H261"; break; default: fprintf(stderr," unknown cis %d???\n",type&~FT_HW); break; } type_ = type; need_refresh_ = 1; imageYCC = NULL; ximage_ = NULL; xil_ = xil_open(); if (xil_ == 0) { fprintf(stderr,"couldn't open xil.\n"); return;//FIXME } /* device = xil_device_create(xil_,"MMACo1k"); if (device == 0) { fprintf(stderr,"couldn't open MMACo1k \n"); return; //FIXME } xil_device_set_value(device,"DEVICE_NAME",(void*)"/dev/o1k0"); //fprintf(stderr,"VIDEO_OUT\n"); xil_device_set_value(device,"VIDEO_OUT",(void*)FALSE); xil_device_destroy(device); */ cis_ = xil_cis_create(xil_ , cisname); if (cis_ == 0) { fprintf(stderr,"couldn't create CIS for %s \n",cisname); return; } // xil_cis_set_attribute(cis_,"DECOMPRESSION_QUALITY", (void*)100); }
static void updateXilCis(InstanceState *inst) { /* Debug Message */ PRINT("In updateXilCis\n"); if (inst) { xil_cis_destroy(inst->xil_cis); inst->xil_cis = NULL; inst->xil_cis = xil_cis_create(inst->xil_state, inst->cis_type); if (inst->do_cis == MPEG) { XilMpeg1Pattern mpattern; char *pattern = "IIII"; mpattern.pattern = pattern; mpattern.repeat_count = 0; xil_cis_set_keep_frames(inst->xil_cis, 6); xil_cis_set_max_frames(inst->xil_cis, 6); xil_cis_set_attribute(inst->xil_cis, "COMPRESSOR_PATTERN", (void *)&mpattern); xil_cis_set_attribute(inst->xil_cis, "COMPRESSOR_INSERT_VIDEO_SEQUENCE_END", (void *)TRUE); } else { xil_cis_set_keep_frames(inst->xil_cis, 1); xil_cis_set_max_frames(inst->xil_cis, 1); } if (inst->do_cis == JPEG) { xil_cis_set_attribute(inst->xil_cis, "ENCODE_411_INTERLEAVED", (void *) TRUE); xil_cis_set_attribute(inst->xil_cis, "IGNORE_HISTORY", (void *) TRUE); xil_cis_set_attribute(inst->xil_cis, "COMPRESSED_DATA_FORMAT", (void *) INTERCHANGE); if (inst->quality != 0) { xil_cis_set_attribute(inst->xil_cis, "COMPRESSION_QUALITY", (void *)inst->quality); } } } }