本文整理汇总了C++中GstVdpDevice::vdp_presentation_queue_query_surface_status方法的典型用法代码示例。如果您正苦于以下问题:C++ GstVdpDevice::vdp_presentation_queue_query_surface_status方法的具体用法?C++ GstVdpDevice::vdp_presentation_queue_query_surface_status怎么用?C++ GstVdpDevice::vdp_presentation_queue_query_surface_status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GstVdpDevice
的用法示例。
在下文中一共展示了GstVdpDevice::vdp_presentation_queue_query_surface_status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
static GstFlowReturn
gst_vdp_sink_show_frame (GstBaseSink * bsink, GstBuffer * outbuf)
{
VdpSink *vdp_sink = GST_VDP_SINK (bsink);
VdpStatus status;
GstVdpDevice *device;
g_return_val_if_fail (GST_IS_VDP_SINK (vdp_sink), FALSE);
/* We take the flow_lock. If expose is in there we don't want to run
concurrently from the data flow thread */
g_mutex_lock (vdp_sink->flow_lock);
if (G_UNLIKELY (vdp_sink->window == NULL)) {
g_mutex_unlock (vdp_sink->flow_lock);
return GST_FLOW_ERROR;
}
device = vdp_sink->device;
if (vdp_sink->cur_image) {
VdpOutputSurface surface =
GST_VDP_OUTPUT_BUFFER (vdp_sink->cur_image)->surface;
VdpPresentationQueueStatus queue_status;
VdpTime pres_time;
g_mutex_lock (vdp_sink->x_lock);
status =
device->vdp_presentation_queue_query_surface_status (vdp_sink->
window->queue, surface, &queue_status, &pres_time);
g_mutex_unlock (vdp_sink->x_lock);
if (queue_status == VDP_PRESENTATION_QUEUE_STATUS_QUEUED) {
g_mutex_unlock (vdp_sink->flow_lock);
return GST_FLOW_OK;
}
}
/* Expose sends a NULL image, we take the latest frame */
if (!outbuf) {
if (vdp_sink->cur_image) {
outbuf = vdp_sink->cur_image;
} else {
g_mutex_unlock (vdp_sink->flow_lock);
return GST_FLOW_OK;
}
}
gst_vdp_sink_window_update_geometry (vdp_sink, vdp_sink->window);
g_mutex_lock (vdp_sink->x_lock);
status = device->vdp_presentation_queue_display (vdp_sink->window->queue,
GST_VDP_OUTPUT_BUFFER (outbuf)->surface, 0, 0, 0);
if (status != VDP_STATUS_OK) {
GST_ELEMENT_ERROR (vdp_sink, RESOURCE, READ,
("Could not display frame"),
("Error returned from vdpau was: %s",
device->vdp_get_error_string (status)));
g_mutex_unlock (vdp_sink->x_lock);
g_mutex_unlock (vdp_sink->flow_lock);
return GST_FLOW_ERROR;
}
if (!vdp_sink->cur_image)
vdp_sink->cur_image = gst_buffer_ref (outbuf);
else if (vdp_sink->cur_image != outbuf) {
gst_buffer_unref (vdp_sink->cur_image);
vdp_sink->cur_image = gst_buffer_ref (outbuf);
}
XSync (vdp_sink->device->display, FALSE);
g_mutex_unlock (vdp_sink->x_lock);
g_mutex_unlock (vdp_sink->flow_lock);
return GST_FLOW_OK;
}