本文整理汇总了C++中GstVdpDevice::vdp_video_surface_put_bits_ycbcr方法的典型用法代码示例。如果您正苦于以下问题:C++ GstVdpDevice::vdp_video_surface_put_bits_ycbcr方法的具体用法?C++ GstVdpDevice::vdp_video_surface_put_bits_ycbcr怎么用?C++ GstVdpDevice::vdp_video_surface_put_bits_ycbcr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GstVdpDevice
的用法示例。
在下文中一共展示了GstVdpDevice::vdp_video_surface_put_bits_ycbcr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GST_MAKE_FOURCC
gboolean
gst_vdp_video_buffer_upload (GstVdpVideoBuffer * video_buf, GstBuffer * src_buf,
guint fourcc, gint width, gint height)
{
guint8 *data[3];
guint32 stride[3];
VdpYCbCrFormat format;
GstVdpDevice *device;
VdpStatus status;
g_return_val_if_fail (GST_IS_VDP_VIDEO_BUFFER (video_buf), FALSE);
g_return_val_if_fail (GST_IS_BUFFER (src_buf), FALSE);
switch (fourcc) {
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
{
data[0] = GST_BUFFER_DATA (src_buf) +
gst_video_format_get_component_offset (GST_VIDEO_FORMAT_YV12,
0, width, height);
data[1] = GST_BUFFER_DATA (src_buf) +
gst_video_format_get_component_offset (GST_VIDEO_FORMAT_YV12,
2, width, height);
data[2] = GST_BUFFER_DATA (src_buf) +
gst_video_format_get_component_offset (GST_VIDEO_FORMAT_YV12,
1, width, height);
stride[0] = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_YV12,
0, width);
stride[1] = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_YV12,
2, width);
stride[2] = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_YV12,
1, width);
format = VDP_YCBCR_FORMAT_YV12;
break;
}
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
{
data[0] = GST_BUFFER_DATA (src_buf) +
gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420,
0, width, height);
data[1] = GST_BUFFER_DATA (src_buf) +
gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420,
2, width, height);
data[2] = GST_BUFFER_DATA (src_buf) +
gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420,
1, width, height);
stride[0] = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420,
0, width);
stride[1] = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420,
2, width);
stride[2] = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420,
1, width);
format = VDP_YCBCR_FORMAT_YV12;
break;
}
case GST_MAKE_FOURCC ('N', 'V', '1', '2'):
{
data[0] = GST_BUFFER_DATA (src_buf);
data[1] = GST_BUFFER_DATA (src_buf) + width * height;
stride[0] = width;
stride[1] = width;
format = VDP_YCBCR_FORMAT_NV12;
break;
}
case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
{
data[0] = GST_BUFFER_DATA (src_buf);
stride[0] = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_UYVY,
0, width);
format = VDP_YCBCR_FORMAT_UYVY;
break;
}
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
{
data[0] = GST_BUFFER_DATA (src_buf);
stride[0] = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_YUY2,
0, width);
format = VDP_YCBCR_FORMAT_YUYV;
break;
}
default:
return FALSE;
}
device = video_buf->device;
status = device->vdp_video_surface_put_bits_ycbcr (video_buf->surface, format,
(void *) data, stride);
if (G_UNLIKELY (status != VDP_STATUS_OK)) {
GST_ERROR_OBJECT (video_buf, "Couldn't push YUV data to VDPAU, "
"Error returned from vdpau was: %s",
device->vdp_get_error_string (status));
//.........这里部分代码省略.........