GstVdpBufferPool * gst_vdp_output_buffer_pool_new (GstVdpDevice * device) { g_return_val_if_fail (GST_IS_VDP_DEVICE (device), NULL); return g_object_new (GST_TYPE_VDP_OUTPUT_BUFFER_POOL, "device", device, NULL); }
GstVdpVideoBuffer * gst_vdp_video_buffer_new (GstVdpDevice * device, VdpChromaType chroma_type, gint width, gint height, GError ** error) { GstVdpVideoBuffer *buffer; VdpStatus status; VdpVideoSurface surface; g_return_val_if_fail (GST_IS_VDP_DEVICE (device), NULL); status = device->vdp_video_surface_create (device->device, chroma_type, width, height, &surface); if (status != VDP_STATUS_OK) goto create_error; buffer = (GstVdpVideoBuffer *) gst_mini_object_new (GST_TYPE_VDP_VIDEO_BUFFER); buffer->device = g_object_ref (device); buffer->surface = surface; return buffer; create_error: g_set_error (error, GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_READ, "Couldn't create a VdpVideoSurface, error returned from vdpau was: %s", device->vdp_get_error_string (status)); return NULL; }
GstCaps * gst_vdp_output_buffer_get_allowed_caps (GstVdpDevice * device) { GstCaps *caps, *rgb_caps; gint i; g_return_val_if_fail (GST_IS_VDP_DEVICE (device), NULL); caps = gst_caps_new_empty (); rgb_caps = gst_caps_new_empty (); for (i = 0; i < G_N_ELEMENTS (rgba_formats); i++) { VdpStatus status; VdpBool is_supported; guint max_w, max_h; status = device->vdp_output_surface_query_capabilities (device->device, rgba_formats[i].format, &is_supported, &max_w, &max_h); if (status != VDP_STATUS_OK && status != VDP_STATUS_INVALID_RGBA_FORMAT) { GST_ERROR_OBJECT (device, "Could not get query VDPAU output surface capabilites, " "Error returned from vdpau was: %s", device->vdp_get_error_string (status)); goto error; } if (is_supported) { GstCaps *format_caps; format_caps = gst_caps_new_simple ("video/x-vdpau-output", "rgba-format", G_TYPE_INT, rgba_formats[i].format, "width", GST_TYPE_INT_RANGE, 1, max_w, "height", GST_TYPE_INT_RANGE, 1, max_h, NULL); gst_caps_append (caps, format_caps); format_caps = gst_static_caps_get (&rgba_formats[i].caps); format_caps = gst_caps_copy (format_caps); gst_caps_set_simple (format_caps, "width", GST_TYPE_INT_RANGE, 1, 8192, "height", GST_TYPE_INT_RANGE, 1, 8192, NULL); gst_caps_append (rgb_caps, format_caps); } } gst_caps_append (caps, rgb_caps); error: return caps; }
static void gst_vdp_device_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { GstVdpDevice *device; g_return_if_fail (GST_IS_VDP_DEVICE (object)); device = (GstVdpDevice *) object; switch (prop_id) { case PROP_DISPLAY: g_value_set_string (value, device->display_name); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }