static gboolean gst_vdp_vpp_start (GstVdpVideoPostProcess * vpp) { gint i; GError *err; vpp->interlaced = FALSE; vpp->field_duration = GST_CLOCK_TIME_NONE; vpp->earliest_time = GST_CLOCK_TIME_NONE; vpp->discont = FALSE; vpp->mixer = VDP_INVALID_HANDLE; vpp->vpool = NULL; for (i = 0; i < MAX_PICTURES; i++) { vpp->future_pictures[i].buf = NULL; vpp->past_pictures[i].buf = NULL; } vpp->n_future_pictures = 0; vpp->n_past_pictures = 0; err = NULL; vpp->device = gst_vdp_get_device (vpp->display, &err); if (G_UNLIKELY (!vpp->device)) goto device_error; g_object_set (G_OBJECT (vpp->srcpad), "device", vpp->device, NULL); return TRUE; device_error: gst_vdp_vpp_post_error (vpp, err); return FALSE; }
static gboolean gst_vdp_video_yuv_start (GstBaseTransform * trans) { GstVdpVideoYUV *video_yuv = GST_VDP_VIDEO_YUV (trans); video_yuv->device = gst_vdp_get_device (video_yuv->display); if (!video_yuv->device) return FALSE; return TRUE; }
static gboolean gst_vdp_sink_open_device (VdpSink * vdp_sink) { gboolean res; GstVdpDevice *device; GError *err; g_mutex_lock (vdp_sink->device_lock); if (vdp_sink->device) { res = TRUE; goto done; } err = NULL; vdp_sink->device = device = gst_vdp_get_device (vdp_sink->display_name, &err); if (!device) goto device_error; vdp_sink->bpool = gst_vdp_output_buffer_pool_new (device); vdp_sink->caps = gst_vdp_sink_get_allowed_caps (device, vdp_sink->par); GST_DEBUG ("runtime calculated caps: %" GST_PTR_FORMAT, vdp_sink->caps); /* call XSynchronize with the current value of synchronous */ GST_DEBUG_OBJECT (vdp_sink, "XSynchronize called with %s", vdp_sink->synchronous ? "TRUE" : "FALSE"); XSynchronize (device->display, vdp_sink->synchronous); /* Setup our event listening thread */ vdp_sink->running = TRUE; vdp_sink->event_thread = g_thread_create ( (GThreadFunc) gst_vdp_sink_event_thread, vdp_sink, TRUE, NULL); res = TRUE; done: g_mutex_unlock (vdp_sink->device_lock); return res; device_error: gst_vdp_sink_post_error (vdp_sink, err); res = FALSE; goto done; }
static GstVdpDevice * gst_vdp_sink_setup_device (VdpSink * vdp_sink) { GstVdpDevice *device; device = gst_vdp_get_device (vdp_sink->display_name); if (!device) return NULL; vdp_sink->caps = gst_vdp_sink_get_allowed_caps (device, vdp_sink->par); GST_DEBUG ("runtime calculated caps: %" GST_PTR_FORMAT, vdp_sink->caps); /* call XSynchronize with the current value of synchronous */ GST_DEBUG_OBJECT (vdp_sink, "XSynchronize called with %s", vdp_sink->synchronous ? "TRUE" : "FALSE"); XSynchronize (device->display, vdp_sink->synchronous); /* Setup our event listening thread */ vdp_sink->running = TRUE; vdp_sink->event_thread = g_thread_create ( (GThreadFunc) gst_vdp_sink_event_thread, vdp_sink, TRUE, NULL); return device; }