本文整理汇总了C++中GstVdpDevice::vdp_output_surface_get_bits_native方法的典型用法代码示例。如果您正苦于以下问题:C++ GstVdpDevice::vdp_output_surface_get_bits_native方法的具体用法?C++ GstVdpDevice::vdp_output_surface_get_bits_native怎么用?C++ GstVdpDevice::vdp_output_surface_get_bits_native使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GstVdpDevice
的用法示例。
在下文中一共展示了GstVdpDevice::vdp_output_surface_get_bits_native方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
gboolean
gst_vdp_output_buffer_download (GstVdpOutputBuffer * output_buf,
GstBuffer * outbuf, GError ** error)
{
guint8 *data[1];
guint32 stride[1];
GstVdpDevice *device;
VdpOutputSurface surface;
VdpStatus status;
g_return_val_if_fail (GST_IS_VDP_OUTPUT_BUFFER (output_buf), FALSE);
switch (output_buf->rgba_format) {
case VDP_RGBA_FORMAT_A8:
{
stride[0] = output_buf->width;
break;
}
case VDP_RGBA_FORMAT_B10G10R10A2:
case VDP_RGBA_FORMAT_B8G8R8A8:
case VDP_RGBA_FORMAT_R10G10B10A2:
case VDP_RGBA_FORMAT_R8G8B8A8:
{
stride[0] = output_buf->width * 4;
break;
}
default:
return FALSE;
}
device = output_buf->device;
surface = output_buf->surface;
data[0] = GST_BUFFER_DATA (outbuf);
GST_LOG_OBJECT (output_buf, "Entering vdp_output_surface_get_bits_native");
status =
device->vdp_output_surface_get_bits_native (surface, NULL, (void *) data,
stride);
GST_LOG_OBJECT (output_buf,
"Got status %d from vdp_output_get_bits_native", status);
if (G_UNLIKELY (status != VDP_STATUS_OK)) {
g_set_error (error, GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_READ,
"Couldn't get data from vdpau, error returned from vdpau was: %s",
device->vdp_get_error_string (status));
return FALSE;
}
return TRUE;
}