/* * Class: com_sun_media_protocol_sunvideo_XILCapture * Method: xilSetSkip * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_com_sun_media_protocol_sunvideo_XILCapture_xilSetSkip(JNIEnv *env, jobject jxil, jint jskip) { InstanceState *inst = (InstanceState *) GetLongField(env, jxil, "peer"); if (inst == NULL) return; /* Debug Message*/ PRINT("In xilSetSkip\n"); /* TODO - may want to do a sanity check */ inst->skip = (int)jskip; xil_set_device_attribute(inst->rtvc_image, "IMAGE_SKIP", (void *)inst->skip); }
void XILWindowAssistor::cell_install_cmap( Colormap x_cmap, XilLookup cmap, XilIndexList *ilist ) { int i, j, t; XColor cdefs[256]; unsigned char cmap_data[3 * 256]; unsigned short cmapsize; int cmapoffset; XilColorList clist; //fprintf(stderr,"XILWindowAssistor::"__FUNCTION__"\n"); cmapsize = xil_lookup_get_num_entries(cmap); cmapoffset = xil_lookup_get_offset(cmap); xil_lookup_get_values(cmap, cmapoffset, cmapsize, cmap_data); for (i = 0, j = 0; i < (int) ilist->ncolors; i++, j += 3) { t = (ilist->pixels[i] - cmapoffset) * 3; cdefs[i].pixel = ilist->pixels[i]; cdefs[i].flags = DoRed | DoGreen | DoBlue; cdefs[i].blue = cmap_data[t] << 8; cdefs[i].green = cmap_data[t + 1] << 8; cdefs[i].red = cmap_data[t + 2] << 8; } clist.ncolors = ilist->ncolors; clist.colors = cdefs; clist.cmap = x_cmap; /* Setting XCOLORMAP accomplishes the same thing as: * XStoreColors(display, x_cmap, cdefs, ilist->ncolors); * XFlush( display ); * but goes through DGA (Direct Graphics Access). This is * much faster. */ xil_set_device_attribute(displayimage_, "XCOLORMAP", &clist ); }
static int tryPort(JNIEnv *env, jobject jxil, InstanceState *inst) { XilDataType datatype; int i; inst->signal = 0; inst->inWidth = 0; inst->inHeight = 0; xil_set_device_attribute(inst->rtvc_image, "PORT_V", (void *)inst->port); /* Debug Message */ PRINT("XILCapture xil_set_device_attribute() completed \n"); /* * On a busy system attempts to get the signal format fail so try * multiple times. In addition, some video sources (like VCRs) * have a poor signal unless actively transmitting so signal format * may report unknown (0). */ for (i = 0; i < 10; i++) { if (xil_get_device_attribute(inst->rtvc_image, "FORMAT_V", (void **) &inst->signal) == XIL_SUCCESS) break; } /* Debug Message */ if (inst->signal == 0) { /* signal format unknown, may not be a camera or video source */ PRINT("XILCapture xil_get_device_attribute() == unknown signal \n"); } xil_get_info(inst->rtvc_image, &inst->inWidth, &inst->inHeight, &inst->inBands, &datatype); /* Debug Message */ PRINT("XILCapture xil_get_info() completed \n"); return 1; }