Lines Matching refs:gdigrab

41 struct gdigrab {
118 * @param gdigrab gdigrab context.
122 gdigrab_region_wnd_init(AVFormatContext *s1, struct gdigrab *gdigrab)
125 RECT rect = gdigrab->clip_rect;
167 gdigrab->region_hwnd = hwnd;
185 * @param gdigrab gdigrab context.
188 gdigrab_region_wnd_destroy(AVFormatContext *s1, struct gdigrab *gdigrab)
190 if (gdigrab->region_hwnd)
191 DestroyWindow(gdigrab->region_hwnd);
192 gdigrab->region_hwnd = NULL;
203 * @param gdigrab gdigrab context.
206 gdigrab_region_wnd_update(AVFormatContext *s1, struct gdigrab *gdigrab)
208 HWND hwnd = gdigrab->region_hwnd;
225 struct gdigrab *gdigrab = s1->priv_data;
269 if (gdigrab->show_region) {
272 gdigrab->show_region = 0;
314 if (!gdigrab->width || !gdigrab->height) {
320 clip_rect.left = gdigrab->offset_x;
321 clip_rect.top = gdigrab->offset_y;
322 clip_rect.right = gdigrab->width + gdigrab->offset_x;
323 clip_rect.bottom = gdigrab->height + gdigrab->offset_y;
406 gdigrab->frame_size = bmp.bmWidthBytes * bmp.bmHeight * bmp.bmPlanes;
407 gdigrab->header_size = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) +
409 gdigrab->time_base = av_inv_q(gdigrab->framerate);
410 gdigrab->time_frame = av_gettime_relative() / av_q2d(gdigrab->time_base);
412 gdigrab->hwnd = hwnd;
413 gdigrab->source_hdc = source_hdc;
414 gdigrab->dest_hdc = dest_hdc;
415 gdigrab->hbmp = hbmp;
416 gdigrab->bmi = bmi;
417 gdigrab->buffer = buffer;
418 gdigrab->clip_rect = clip_rect;
420 gdigrab->cursor_error_printed = 0;
422 if (gdigrab->show_region) {
423 if (gdigrab_region_wnd_init(s1, gdigrab)) {
429 st->avg_frame_rate = av_inv_q(gdigrab->time_base);
433 st->codecpar->bit_rate = (gdigrab->header_size + gdigrab->frame_size) * 1/av_q2d(gdigrab->time_base) * 8;
455 static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab)
460 if (!gdigrab->cursor_error_printed) { \
462 gdigrab->cursor_error_printed = 1; \
471 RECT clip_rect = gdigrab->clip_rect;
472 HWND hwnd = gdigrab->hwnd;
473 int horzres = GetDeviceCaps(gdigrab->source_hdc, HORZRES);
474 int vertres = GetDeviceCaps(gdigrab->source_hdc, VERTRES);
475 int desktophorzres = GetDeviceCaps(gdigrab->source_hdc, DESKTOPHORZRES);
476 int desktopvertres = GetDeviceCaps(gdigrab->source_hdc, DESKTOPVERTRES);
520 if (!DrawIcon(gdigrab->dest_hdc, pos.x, pos.y, icon))
545 struct gdigrab *gdigrab = s1->priv_data;
547 HDC dest_hdc = gdigrab->dest_hdc;
548 HDC source_hdc = gdigrab->source_hdc;
549 RECT clip_rect = gdigrab->clip_rect;
550 AVRational time_base = gdigrab->time_base;
551 int64_t time_frame = gdigrab->time_frame;
554 int file_size = gdigrab->header_size + gdigrab->frame_size;
562 if (gdigrab->show_region)
563 gdigrab_region_wnd_update(s1, gdigrab);
595 if (gdigrab->draw_mouse)
596 paint_mouse_pointer(s1, gdigrab);
604 bfh.bfOffBits = gdigrab->header_size;
608 memcpy(pkt->data + sizeof(bfh), &gdigrab->bmi.bmiHeader, sizeof(gdigrab->bmi.bmiHeader));
610 if (gdigrab->bmi.bmiHeader.biBitCount <= 8)
611 GetDIBColorTable(dest_hdc, 0, 1 << gdigrab->bmi.bmiHeader.biBitCount,
612 (RGBQUAD *) (pkt->data + sizeof(bfh) + sizeof(gdigrab->bmi.bmiHeader)));
614 memcpy(pkt->data + gdigrab->header_size, gdigrab->buffer, gdigrab->frame_size);
616 gdigrab->time_frame = time_frame;
618 return gdigrab->header_size + gdigrab->frame_size;
629 struct gdigrab *s = s1->priv_data;
646 #define OFFSET(x) offsetof(struct gdigrab, x)
668 .name = "gdigrab",
670 .priv_data_size = sizeof(struct gdigrab),