euresyssrc: open and close driver in init/dispose rather than start/stop
McOpenDriver was taking 1.5 seconds or so, so for some use cases this should speed up captures.
This commit is contained in:
parent
86ba1a114d
commit
b3c4c79dea
@ -340,6 +340,12 @@ gst_euresys_init (GstEuresys * euresys)
|
||||
|
||||
euresys->last_time_code = -1;
|
||||
euresys->dropped_frame_count = 0;
|
||||
|
||||
GST_INFO_OBJECT (euresys, "About to open driver");
|
||||
if (McOpenDriver (NULL) != MC_OK) {
|
||||
GST_ELEMENT_ERROR (euresys, LIBRARY, INIT, (NULL), (NULL));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -408,6 +414,9 @@ gst_euresys_dispose (GObject * object)
|
||||
|
||||
/* clean up as possible. may be called multiple times */
|
||||
|
||||
/* Close the MultiCam driver */
|
||||
McCloseDriver ();
|
||||
|
||||
G_OBJECT_CLASS (gst_euresys_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
@ -419,13 +428,6 @@ gst_euresys_start (GstBaseSrc * bsrc)
|
||||
|
||||
GST_DEBUG_OBJECT (euresys, "start");
|
||||
|
||||
/* Open MultiCam driver */
|
||||
status = McOpenDriver (NULL);
|
||||
if (status != MC_OK) {
|
||||
GST_ELEMENT_ERROR (euresys, LIBRARY, INIT, (NULL), (NULL));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
status =
|
||||
McGetParamInt (MC_BOARD + euresys->boardIdx, MC_BoardType,
|
||||
&euresys->boardType);
|
||||
@ -529,9 +531,6 @@ gst_euresys_stop (GstBaseSrc * src)
|
||||
/* Stop the acquisition */
|
||||
McSetParamInt (euresys->hChannel, MC_ChannelState, MC_ChannelState_IDLE);
|
||||
|
||||
/* Close the MultiCam driver */
|
||||
McCloseDriver ();
|
||||
|
||||
/* Delete the channel */
|
||||
if (euresys->hChannel)
|
||||
McDelete (euresys->hChannel);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user