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 ])
–
GstBaseCameraSrc
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBin ╰──GstBaseCameraSrc
Members
parent
(GstBin)
–
mode
(GstCameraBinMode)
–
auto_start
(Number)
–
capturing
(Number)
–
capturing_mutex
(GMutex)
–
preview_caps
(GstCaps)
–
post_preview
(Number)
–
preview_filter
(GstElement)
–
preview_pipeline
(GstCameraBinPreviewPipelineData)
–
width
(Number)
–
height
(Number)
–
zoom
(Number)
–
max_zoom
(Number)
–
_gst_reserved
([ Object ])
–
GstBaseCameraSrc
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBin ╰──GstBaseCameraSrc
Members
parent
(GstBin)
–
mode
(GstCameraBinMode)
–
auto_start
(bool)
–
capturing
(bool)
–
capturing_mutex
(GMutex)
–
preview_caps
(GstCaps)
–
post_preview
(bool)
–
preview_filter
(GstElement)
–
preview_pipeline
(GstCameraBinPreviewPipelineData)
–
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:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
GstBadBaseCameraBin.BaseCameraSrc.finish_capture
def GstBadBaseCameraBin.BaseCameraSrc.finish_capture (self):
#python wrapper for 'gst_base_camera_src_finish_capture'
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
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:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
sample
(
Gst.Sample
)
–
GstBadBaseCameraBin.BaseCameraSrc.post_preview
def GstBadBaseCameraBin.BaseCameraSrc.post_preview (self, sample):
#python wrapper for 'gst_base_camera_src_post_preview'
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
sample
(
Gst.Sample
)
–
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:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
the camerasrc bin
mode
(
GstBadBaseCameraBin.CameraBinMode
)
–
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:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
the camerasrc bin
mode
(
GstBadBaseCameraBin.CameraBinMode
)
–
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:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
camerasrc bin
preview_caps
(
Gst.Caps
)
–
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:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
camerasrc bin
preview_caps
(
Gst.Caps
)
–
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:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
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:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
camerasrc object
Signals
start-capture
start_capture_callback (GstBaseCameraSrc * self, gpointer user_data)
Parameters:
self
–
user_data
–
start-capture
function start_capture_callback(self: GstBadBaseCameraBin.BaseCameraSrc, user_data: Object): {
// javascript callback for the 'start-capture' signal
}
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
user_data
(
Object
)
–
start-capture
def start_capture_callback (self, *user_data):
#python callback for the 'start-capture' signal
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
user_data
(
variadic
)
–
stop-capture
stop_capture_callback (GstBaseCameraSrc * self, gpointer user_data)
Parameters:
self
–
user_data
–
stop-capture
function stop_capture_callback(self: GstBadBaseCameraBin.BaseCameraSrc, user_data: Object): {
// javascript callback for the 'stop-capture' signal
}
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
user_data
(
Object
)
–
stop-capture
def stop_capture_callback (self, *user_data):
#python callback for the 'stop-capture' signal
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
user_data
(
variadic
)
–
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
–
construct_pipeline
function construct_pipeline(self: GstBadBaseCameraBin.BaseCameraSrc): {
// javascript implementation of the 'construct_pipeline' virtual method
}
construct pipeline
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
construct_pipeline
def construct_pipeline (self):
#python implementation of the 'construct_pipeline' virtual method
construct pipeline
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
set_mode
gboolean set_mode (GstBaseCameraSrc * self, GstCameraBinMode mode)
set the mode
Parameters:
self
–
mode
–
set_mode
function set_mode(self: GstBadBaseCameraBin.BaseCameraSrc, mode: GstBadBaseCameraBin.CameraBinMode): {
// javascript implementation of the 'set_mode' virtual method
}
set the mode
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
mode
(
GstBadBaseCameraBin.CameraBinMode
)
–
set_mode
def set_mode (self, mode):
#python implementation of the 'set_mode' virtual method
set the mode
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
mode
(
GstBadBaseCameraBin.CameraBinMode
)
–
set_preview
gboolean set_preview (GstBaseCameraSrc * self, GstCaps * preview_caps)
Parameters:
self
–
preview_caps
–
set_preview
function set_preview(self: GstBadBaseCameraBin.BaseCameraSrc, preview_caps: Gst.Caps): {
// javascript implementation of the 'set_preview' virtual method
}
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
preview_caps
(
Gst.Caps
)
–
set_preview
def set_preview (self, preview_caps):
#python implementation of the 'set_preview' virtual method
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
preview_caps
(
Gst.Caps
)
–
set_zoom
set_zoom (GstBaseCameraSrc * self, gfloat zoom)
set the zoom
Parameters:
self
–
zoom
–
set_zoom
function set_zoom(self: GstBadBaseCameraBin.BaseCameraSrc, zoom: Number): {
// javascript implementation of the 'set_zoom' virtual method
}
set the zoom
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
zoom
(
Number
)
–
set_zoom
def set_zoom (self, zoom):
#python implementation of the 'set_zoom' virtual method
set the zoom
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
zoom
(
float
)
–
setup_pipeline
gboolean setup_pipeline (GstBaseCameraSrc * self)
configure pipeline for the chosen settings
Parameters:
self
–
setup_pipeline
function setup_pipeline(self: GstBadBaseCameraBin.BaseCameraSrc): {
// javascript implementation of the 'setup_pipeline' virtual method
}
configure pipeline for the chosen settings
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
setup_pipeline
def setup_pipeline (self):
#python implementation of the 'setup_pipeline' virtual method
configure pipeline for the chosen settings
Parameters:
self
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
start_capture
gboolean start_capture (GstBaseCameraSrc * src)
Parameters:
src
–
start_capture
function start_capture(src: GstBadBaseCameraBin.BaseCameraSrc): {
// javascript implementation of the 'start_capture' virtual method
}
Parameters:
src
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
start_capture
def start_capture (src):
#python implementation of the 'start_capture' virtual method
Parameters:
src
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
stop_capture
function stop_capture(src: GstBadBaseCameraBin.BaseCameraSrc): {
// javascript implementation of the 'stop_capture' virtual method
}
Parameters:
src
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
stop_capture
def stop_capture (src):
#python implementation of the 'stop_capture' virtual method
Parameters:
src
(
GstBadBaseCameraBin.BaseCameraSrc
)
–
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