本文整理汇总了C++中GstVdpDevice::vdp_presentation_queue_create方法的典型用法代码示例。如果您正苦于以下问题:C++ GstVdpDevice::vdp_presentation_queue_create方法的具体用法?C++ GstVdpDevice::vdp_presentation_queue_create怎么用?C++ GstVdpDevice::vdp_presentation_queue_create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GstVdpDevice
的用法示例。
在下文中一共展示了GstVdpDevice::vdp_presentation_queue_create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void
gst_vdp_sink_window_setup_vdpau (VdpSink * vdp_sink, GstVdpWindow * window)
{
GstVdpDevice *device = vdp_sink->device;
VdpStatus status;
VdpColor color = { 0, };
status = device->vdp_presentation_queue_target_create_x11 (device->device,
window->win, &window->target);
if (status != VDP_STATUS_OK) {
GST_ELEMENT_ERROR (vdp_sink, RESOURCE, READ,
("Could not create presentation target"),
("Error returned from vdpau was: %s",
device->vdp_get_error_string (status)));
}
status =
device->vdp_presentation_queue_create (device->device, window->target,
&window->queue);
if (status != VDP_STATUS_OK) {
GST_ELEMENT_ERROR (vdp_sink, RESOURCE, READ,
("Could not create presentation queue"),
("Error returned from vdpau was: %s",
device->vdp_get_error_string (status)));
}
status =
device->vdp_presentation_queue_set_background_color (window->queue,
&color);
if (status != VDP_STATUS_OK) {
GST_ELEMENT_ERROR (vdp_sink, RESOURCE, READ,
("Could not set background color"),
("Error returned from vdpau was: %s",
device->vdp_get_error_string (status)));
}
}
示例2: DefaultScreen
/* This function handles a GstVdpWindow creation */
static GstVdpWindow *
gst_vdp_sink_window_new (VdpSink * vdp_sink, gint width, gint height)
{
GstVdpWindow *window = NULL;
GstVdpDevice *device = vdp_sink->device;
Window root;
gint screen_num;
gulong black;
VdpStatus status;
VdpColor color = { 0, };
g_return_val_if_fail (GST_IS_VDP_SINK (vdp_sink), NULL);
window = g_new0 (GstVdpWindow, 1);
window->width = width;
window->height = height;
window->internal = TRUE;
g_mutex_lock (vdp_sink->x_lock);
screen_num = DefaultScreen (device->display);
root = DefaultRootWindow (device->display);
black = XBlackPixel (device->display, screen_num);
window->win = XCreateSimpleWindow (vdp_sink->device->display,
root, 0, 0, window->width, window->height, 0, 0, black);
/* We have to do that to prevent X from redrawing the background on
ConfigureNotify. This takes away flickering of video when resizing. */
XSetWindowBackgroundPixmap (vdp_sink->device->display, window->win, None);
/* set application name as a title */
gst_vdp_sink_window_set_title (vdp_sink, window, NULL);
if (vdp_sink->handle_events) {
Atom wm_delete;
XSelectInput (vdp_sink->device->display, window->win, ExposureMask |
StructureNotifyMask | PointerMotionMask | KeyPressMask |
KeyReleaseMask | ButtonPressMask | ButtonReleaseMask);
/* Tell the window manager we'd like delete client messages instead of
* being killed */
wm_delete =
XInternAtom (vdp_sink->device->display, "WM_DELETE_WINDOW", False);
(void) XSetWMProtocols (vdp_sink->device->display, window->win, &wm_delete,
1);
}
XMapRaised (vdp_sink->device->display, window->win);
XSync (vdp_sink->device->display, FALSE);
g_mutex_unlock (vdp_sink->x_lock);
gst_vdp_sink_window_decorate (vdp_sink, window);
status = device->vdp_presentation_queue_target_create_x11 (device->device,
window->win, &window->target);
if (status != VDP_STATUS_OK) {
GST_ELEMENT_ERROR (vdp_sink, RESOURCE, READ,
("Could not create presentation target"),
("Error returned from vdpau was: %s",
device->vdp_get_error_string (status)));
}
status =
device->vdp_presentation_queue_create (device->device, window->target,
&window->queue);
if (status != VDP_STATUS_OK) {
GST_ELEMENT_ERROR (vdp_sink, RESOURCE, READ,
("Could not create presentation queue"),
("Error returned from vdpau was: %s",
device->vdp_get_error_string (status)));
}
status =
device->vdp_presentation_queue_set_background_color (window->queue,
&color);
if (status != VDP_STATUS_OK) {
GST_ELEMENT_ERROR (vdp_sink, RESOURCE, READ,
("Could not set background color"),
("Error returned from vdpau was: %s",
device->vdp_get_error_string (status)));
}
gst_x_overlay_got_xwindow_id (GST_X_OVERLAY (vdp_sink), window->win);
return window;
}