If videobin/imagebin was never set to READY state the ownership
of elements created and set by application were never taken by
bin and therefore gst_object_sink is called for these elements
before unreffing (they may still be in floating state and not
unreffed properly without sinking first)
This patch refactors imagebin element creation and linking into separate functions,
and adds re-using also for imagebin internally created elements.
So this refactoring allows creating imagebin elements already in NULL state when
application sets the image mode, and next state change from NULL to READY will be faster.
This reduces first capture latency.
Earlier the elements were both created and linked in NULL to READY state change.
Having GST_DEBUG_CATEGORY and GST_DEBUG_CATEGORY_EXTERN together
might lead to 'undefined symbol' problems. This commit moves
the _EXTERN to a separate new file.
If we don't reset the filename we cannot check if we still expect the filename
for a subsequent capture pass. The imagebin would good to paused and we set the
filename in that state. This trigers an error-message and would capture to the
old filename.
* decouple image capturing from image post-processing and encoding
* post image-captured message after image is captured
* post preview-image message with snapshot of captured image