element basecamerasrc
Base class for the camera source bin used by camerabin for capture. Sophisticated camera hardware can derive from this baseclass and map the features to this interface.
The design mandates that the subclasses implement the following features and behaviour:
- 3 pads: viewfinder, image capture, video capture
During construct_pipeline()
vmethod a subclass can add several elements into
the bin and expose 3 srcs pads as ghostpads implementing the 3 pad templates.
However the subclass is responsible for adding the pad templates for the source pads and they must be named "vidsrc", "imgsrc" and "vfsrc". The pad templates should be installed in the subclass' class_init function, like so:
static void
my_element_class_init (GstMyElementClass *klass)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
// pad templates should be a #GstStaticPadTemplate with direction
// #GST_PAD_SRC and name "vidsrc", "imgsrc" and "vfsrc"
gst_element_class_add_static_pad_template (gstelement_class,
&vidsrc_template);
gst_element_class_add_static_pad_template (gstelement_class,
&imgsrc_template);
gst_element_class_add_static_pad_template (gstelement_class,
&vfsrc_template);
// see #GstElementDetails
gst_element_class_set_details (gstelement_class, &details);
}
It is also possible to add regular pads from the subclass and implement the dataflow methods on these pads. This way all functionality can be implemented directly in the subclass without extra elements.
The src will receive the capture mode from GstCameraBin2
on the
mode property. Possible capture modes are defined in
GstCameraBinMode.
GstBaseCameraSrc
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBin ╰──GstBaseCameraSrc
Members
parent
(GstBin)
–
mode
(GstCameraBinMode)
–
auto_start
(gboolean)
–
capturing
(gboolean)
–
capturing_mutex
(GMutex)
–
preview_caps
(GstCaps *)
–
post_preview
(gboolean)
–
preview_filter
(GstElement *)
–
preview_pipeline
(GstCameraBinPreviewPipelineData *)
–
width
(gint)
–
height
(gint)
–
zoom
(gfloat)
–
max_zoom
(gfloat)
–
_gst_reserved
(gpointer *)
–
Class structure
GstBaseCameraSrcClass
Fields
parent
(GstBinClass)
–
_gst_reserved
(gpointer *)
–
GstBadBaseCameraBin.BaseCameraSrcClass
Attributes
parent
(Gst.BinClass)
–
_gst_reserved
([ Object ])
–
GstBadBaseCameraBin.BaseCameraSrcClass
Attributes
parent
(Gst.BinClass)
–
_gst_reserved
([ object ])
–
GstBadBaseCameraBin.BaseCameraSrc
GObject.Object ╰──GObject.InitiallyUnowned ╰──Gst.Object ╰──Gst.Element ╰──Gst.Bin ╰──GstBadBaseCameraBin.BaseCameraSrc
Members
parent
(Gst.Bin)
–
mode
(GstBadBaseCameraBin.CameraBinMode)
–
auto_start
(Number)
–
capturing
(Number)
–
capturing_mutex
(GLib.Mutex)
–
preview_caps
(Gst.Caps)
–
post_preview
(Number)
–
preview_filter
(Gst.Element)
–
preview_pipeline (not introspectable)
(GstCameraBinPreviewPipelineData (not introspectable))
–
width
(Number)
–
height
(Number)
–
zoom
(Number)
–
max_zoom
(Number)
–
_gst_reserved
([ Object ])
–
GstBadBaseCameraBin.BaseCameraSrc
GObject.Object ╰──GObject.InitiallyUnowned ╰──Gst.Object ╰──Gst.Element ╰──Gst.Bin ╰──GstBadBaseCameraBin.BaseCameraSrc
Members
parent
(Gst.Bin)
–
mode
(GstBadBaseCameraBin.CameraBinMode)
–
auto_start
(bool)
–
capturing
(bool)
–
capturing_mutex
(GLib.Mutex)
–
preview_caps
(Gst.Caps)
–
post_preview
(bool)
–
preview_filter
(Gst.Element)
–
preview_pipeline (not introspectable)
(GstCameraBinPreviewPipelineData (not introspectable))
–
width
(int)
–
height
(int)
–
zoom
(float)
–
max_zoom
(float)
–
_gst_reserved
([ object ])
–
Methods
gst_base_camera_src_finish_capture
gst_base_camera_src_finish_capture (GstBaseCameraSrc * self)
Parameters:
self
–
GstBadBaseCameraBin.BaseCameraSrc.prototype.finish_capture
function GstBadBaseCameraBin.BaseCameraSrc.prototype.finish_capture(): {
// javascript wrapper for 'gst_base_camera_src_finish_capture'
}
Parameters:
GstBadBaseCameraBin.BaseCameraSrc.finish_capture
def GstBadBaseCameraBin.BaseCameraSrc.finish_capture (self):
#python wrapper for 'gst_base_camera_src_finish_capture'
Parameters:
gst_base_camera_src_post_preview
gst_base_camera_src_post_preview (GstBaseCameraSrc * self, GstSample * sample)
Parameters:
self
–
sample
–
GstBadBaseCameraBin.BaseCameraSrc.prototype.post_preview
function GstBadBaseCameraBin.BaseCameraSrc.prototype.post_preview(sample: Gst.Sample): {
// javascript wrapper for 'gst_base_camera_src_post_preview'
}
Parameters:
GstBadBaseCameraBin.BaseCameraSrc.post_preview
def GstBadBaseCameraBin.BaseCameraSrc.post_preview (self, sample):
#python wrapper for 'gst_base_camera_src_post_preview'
Parameters:
gst_base_camera_src_set_mode
gboolean gst_base_camera_src_set_mode (GstBaseCameraSrc * self, GstCameraBinMode mode)
Set the chosen GstCameraBinMode capture mode.
Parameters:
self
–
the camerasrc bin
mode
–
the mode
GstBadBaseCameraBin.BaseCameraSrc.prototype.set_mode
function GstBadBaseCameraBin.BaseCameraSrc.prototype.set_mode(mode: GstBadBaseCameraBin.CameraBinMode): {
// javascript wrapper for 'gst_base_camera_src_set_mode'
}
Set the chosen GstBadBaseCameraBin.CameraBinMode capture mode.
Parameters:
the camerasrc bin
the mode
GstBadBaseCameraBin.BaseCameraSrc.set_mode
def GstBadBaseCameraBin.BaseCameraSrc.set_mode (self, mode):
#python wrapper for 'gst_base_camera_src_set_mode'
Set the chosen GstBadBaseCameraBin.CameraBinMode capture mode.
Parameters:
the camerasrc bin
the mode
gst_base_camera_src_setup_preview
gst_base_camera_src_setup_preview (GstBaseCameraSrc * self, GstCaps * preview_caps)
Apply preview caps to preview pipeline and to video source.
Parameters:
self
–
camerasrc bin
preview_caps
–
preview caps to set
GstBadBaseCameraBin.BaseCameraSrc.prototype.setup_preview
function GstBadBaseCameraBin.BaseCameraSrc.prototype.setup_preview(preview_caps: Gst.Caps): {
// javascript wrapper for 'gst_base_camera_src_setup_preview'
}
Apply preview caps to preview pipeline and to video source.
Parameters:
camerasrc bin
preview caps to set
GstBadBaseCameraBin.BaseCameraSrc.setup_preview
def GstBadBaseCameraBin.BaseCameraSrc.setup_preview (self, preview_caps):
#python wrapper for 'gst_base_camera_src_setup_preview'
Apply preview caps to preview pipeline and to video source.
Parameters:
camerasrc bin
preview caps to set
gst_base_camera_src_setup_zoom
gst_base_camera_src_setup_zoom (GstBaseCameraSrc * self)
Apply zoom configured to camerabin to capture.
Parameters:
self
–
camerasrc object
GstBadBaseCameraBin.BaseCameraSrc.prototype.setup_zoom
function GstBadBaseCameraBin.BaseCameraSrc.prototype.setup_zoom(): {
// javascript wrapper for 'gst_base_camera_src_setup_zoom'
}
Apply zoom configured to camerabin to capture.
Parameters:
camerasrc object
GstBadBaseCameraBin.BaseCameraSrc.setup_zoom
def GstBadBaseCameraBin.BaseCameraSrc.setup_zoom (self):
#python wrapper for 'gst_base_camera_src_setup_zoom'
Apply zoom configured to camerabin to capture.
Parameters:
camerasrc object
Action Signals
start-capture
g_signal_emit_by_name (self, "start-capture", user_data);
Parameters:
start-capture
let ret = self.emit ("start-capture", user_data);
Parameters:
start-capture
ret = self.emit ("start-capture", user_data)
Parameters:
stop-capture
g_signal_emit_by_name (self, "stop-capture", user_data);
Parameters:
stop-capture
let ret = self.emit ("stop-capture", user_data);
Parameters:
stop-capture
ret = self.emit ("stop-capture", user_data)
Parameters:
Properties
post-previews
“post-previews” gboolean
When TRUE, preview images should be posted to the bus when captures are made
Flags : Read / Write
ready-for-capture
“ready-for-capture” gboolean
When TRUE new capture can be prepared. If FALSE capturing is ongoing and starting a new capture immediately is not possible.
Note that calling start-capture from the notify callback of this property will cause a deadlock. If you need to react like this on the notify function, please schedule a new thread to do it. If you're using glib's mainloop you can use g_idle_add for example.
Flags : Read
ready-for-capture
“ready-for-capture” Number
When TRUE new capture can be prepared. If FALSE capturing is ongoing and starting a new capture immediately is not possible.
Note that calling start-capture from the notify callback of this property will cause a deadlock. If you need to react like this on the notify function, please schedule a new thread to do it. If you're using glib's mainloop you can use g_idle_add (not introspectable) for example.
Flags : Read
ready_for_capture
“self.props.ready_for_capture” bool
When TRUE new capture can be prepared. If FALSE capturing is ongoing and starting a new capture immediately is not possible.
Note that calling start-capture from the notify callback of this property will cause a deadlock. If you need to react like this on the notify function, please schedule a new thread to do it. If you're using glib's mainloop you can use g_idle_add (not introspectable) for example.
Flags : Read
Virtual Methods
construct_pipeline
gboolean construct_pipeline (GstBaseCameraSrc * self)
construct pipeline
Parameters:
self
–
vfunc_construct_pipeline
function vfunc_construct_pipeline(self: GstBadBaseCameraBin.BaseCameraSrc): {
// javascript implementation of the 'construct_pipeline' virtual method
}
construct pipeline
Parameters:
do_construct_pipeline
def do_construct_pipeline (self):
#python implementation of the 'construct_pipeline' virtual method
construct pipeline
Parameters:
set_mode
gboolean set_mode (GstBaseCameraSrc * self, GstCameraBinMode mode)
set the mode
Parameters:
self
–
mode
–
vfunc_set_mode
function vfunc_set_mode(self: GstBadBaseCameraBin.BaseCameraSrc, mode: GstBadBaseCameraBin.CameraBinMode): {
// javascript implementation of the 'set_mode' virtual method
}
set the mode
Parameters:
do_set_mode
def do_set_mode (self, mode):
#python implementation of the 'set_mode' virtual method
set the mode
Parameters:
set_preview
gboolean set_preview (GstBaseCameraSrc * self, GstCaps * preview_caps)
Parameters:
self
–
preview_caps
–
vfunc_set_preview
function vfunc_set_preview(self: GstBadBaseCameraBin.BaseCameraSrc, preview_caps: Gst.Caps): {
// javascript implementation of the 'set_preview' virtual method
}
Parameters:
do_set_preview
def do_set_preview (self, preview_caps):
#python implementation of the 'set_preview' virtual method
Parameters:
set_zoom
set_zoom (GstBaseCameraSrc * self, gfloat zoom)
set the zoom
Parameters:
self
–
zoom
–
vfunc_set_zoom
function vfunc_set_zoom(self: GstBadBaseCameraBin.BaseCameraSrc, zoom: Number): {
// javascript implementation of the 'set_zoom' virtual method
}
set the zoom
Parameters:
do_set_zoom
def do_set_zoom (self, zoom):
#python implementation of the 'set_zoom' virtual method
set the zoom
Parameters:
setup_pipeline
gboolean setup_pipeline (GstBaseCameraSrc * self)
configure pipeline for the chosen settings
Parameters:
self
–
vfunc_setup_pipeline
function vfunc_setup_pipeline(self: GstBadBaseCameraBin.BaseCameraSrc): {
// javascript implementation of the 'setup_pipeline' virtual method
}
configure pipeline for the chosen settings
Parameters:
do_setup_pipeline
def do_setup_pipeline (self):
#python implementation of the 'setup_pipeline' virtual method
configure pipeline for the chosen settings
Parameters:
start_capture
gboolean start_capture (GstBaseCameraSrc * src)
Parameters:
src
–
vfunc_start_capture
function vfunc_start_capture(src: GstBadBaseCameraBin.BaseCameraSrc): {
// javascript implementation of the 'start_capture' virtual method
}
Parameters:
do_start_capture
def do_start_capture (src):
#python implementation of the 'start_capture' virtual method
Parameters:
vfunc_stop_capture
function vfunc_stop_capture(src: GstBadBaseCameraBin.BaseCameraSrc): {
// javascript implementation of the 'stop_capture' virtual method
}
Parameters:
do_stop_capture
def do_stop_capture (src):
#python implementation of the 'stop_capture' virtual method
Parameters:
Function Macros
GST_BASE_CAMERA_SRC_CAST
#define GST_BASE_CAMERA_SRC_CAST(obj) \ ((GstBaseCameraSrc *) (obj))
Constants
GST_BASE_CAMERA_SRC_IMAGE_PAD_NAME
#define GST_BASE_CAMERA_SRC_IMAGE_PAD_NAME "imgsrc"
GstBadBaseCameraBin.BASE_CAMERA_SRC_IMAGE_PAD_NAME
GstBadBaseCameraBin.BASE_CAMERA_SRC_IMAGE_PAD_NAME
GST_BASE_CAMERA_SRC_PREVIEW_MESSAGE_NAME
#define GST_BASE_CAMERA_SRC_PREVIEW_MESSAGE_NAME "preview-image"
GstBadBaseCameraBin.BASE_CAMERA_SRC_PREVIEW_MESSAGE_NAME
GstBadBaseCameraBin.BASE_CAMERA_SRC_PREVIEW_MESSAGE_NAME
GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME
#define GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME "vidsrc"
GstBadBaseCameraBin.BASE_CAMERA_SRC_VIDEO_PAD_NAME
GstBadBaseCameraBin.BASE_CAMERA_SRC_VIDEO_PAD_NAME
GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME
#define GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME "vfsrc"
GstBadBaseCameraBin.BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME
GstBadBaseCameraBin.BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME
GST_TYPE_BASE_CAMERA_SRC
#define GST_TYPE_BASE_CAMERA_SRC \ (gst_base_camera_src_get_type())
MAX_ZOOM
#define MAX_ZOOM 10.0f
MIN_ZOOM
#define MIN_ZOOM 1.0f
ZOOM_1X
#define ZOOM_1X MIN_ZOOM
The results of the search are