|
|
|
@ -111,25 +111,6 @@ gboolean videoctrl_update(gpointer data) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void videoframe_to_pixbuf(GdkPixbuf* dest, VideoFrame *src) {
|
|
|
|
|
int destw, desth;
|
|
|
|
|
unsigned char *destpixel;
|
|
|
|
|
|
|
|
|
|
if (dest == NULL || src == NULL) return;
|
|
|
|
|
|
|
|
|
|
desth = gdk_pixbuf_get_height(dest);
|
|
|
|
|
destw = gdk_pixbuf_get_width(dest);
|
|
|
|
|
destpixel = gdk_pixbuf_get_pixels(dest);
|
|
|
|
|
|
|
|
|
|
if (destw * desth < src->h * src->w) {
|
|
|
|
|
destw = src->w;
|
|
|
|
|
desth = src->h;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
memcpy (destpixel, src->data, 3*destw*desth);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define S_X(_x_) (((_x_) * clientw / pixbufw))
|
|
|
|
|
#define S_Y(_y_) (((_y_) * clienth / pixbufh))
|
|
|
|
|
void cb_videoda_draw(GtkWidget *area, cairo_t *cr, int w, int h, gpointer data) {
|
|
|
|
@ -545,7 +526,7 @@ gboolean cb_thread_video (gpointer data) {
|
|
|
|
|
pix_w = vf->w;
|
|
|
|
|
pix_h = vf->h;
|
|
|
|
|
}
|
|
|
|
|
videoframe_to_pixbuf(video_pixbuf, vf);
|
|
|
|
|
vf->ToPixbuf(video_pixbuf);
|
|
|
|
|
detect.NewFrame(vf);
|
|
|
|
|
videodev->UnLockMutex();
|
|
|
|
|
gdk_window_invalidate_rect(gtk_widget_get_window(video_da), NULL, true);
|
|
|
|
|