From 059e8ff44a3ca479d21ed1046ebf7b4a4e1e224a Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 23 Jun 2020 10:03:04 -0400 Subject: [PATCH] docs: Document basecamerabinsrc --- docs/libs/basecamerabinsrc/index.md | 7 + docs/libs/basecamerabinsrc/sitemap.txt | 1 + docs/meson.build | 1 + docs/plugins/gst_plugins_cache.json | 258 --------------------- gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c | 14 +- .../gst/basecamerabinsrc/gstcamerabinpreview.c | 3 +- gst-libs/gst/basecamerabinsrc/meson.build | 18 ++ gst/camerabin2/gstcamerabin2.c | 3 +- 8 files changed, 39 insertions(+), 266 deletions(-) create mode 100644 docs/libs/basecamerabinsrc/index.md create mode 100644 docs/libs/basecamerabinsrc/sitemap.txt diff --git a/docs/libs/basecamerabinsrc/index.md b/docs/libs/basecamerabinsrc/index.md new file mode 100644 index 0000000..16093b7 --- /dev/null +++ b/docs/libs/basecamerabinsrc/index.md @@ -0,0 +1,7 @@ +# BaseCamerabinSrc Library + +This library should be linked to by getting cflags and libs from +gstreamer-plugins-bad-{{ gst_api_version.md }}.pc and adding +-lgstbasecamerabinsrc-{{ gst_api_version.md }} to the library flags. + +> NOTE: This library API is considered *unstable* diff --git a/docs/libs/basecamerabinsrc/sitemap.txt b/docs/libs/basecamerabinsrc/sitemap.txt new file mode 100644 index 0000000..4f91fcd --- /dev/null +++ b/docs/libs/basecamerabinsrc/sitemap.txt @@ -0,0 +1 @@ +gi-index diff --git a/docs/meson.build b/docs/meson.build index d06cce1..1192e26 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -114,6 +114,7 @@ if build_gir {'name': 'codecparsers', 'lib': gstcodecparsers_dep}, {'name': 'opencv', 'lib': gstopencv_dep, 'c_source_patterns': ['*.h', '*.cpp'], 'extra_c_flags': ['-x c++']}, {'name': 'adaptivedemux', 'lib': gstadaptivedemux_dep}, + {'name': 'basecamerabinsrc', 'gir': basecamerabin_gir, 'lib': gstbasecamerabin_dep}, {'name': 'webrtc', 'gir': webrtc_gir, 'lib': gstwebrtc_dep, 'suffix': 'lib'}, {'name': 'audio', 'gir': audio_gir, 'lib': gstbadaudio_dep, 'prefix': 'bad-'}, {'name': 'transcoder', 'gir': transcoder_gir, 'lib': gst_transcoder_dep}, diff --git a/docs/plugins/gst_plugins_cache.json b/docs/plugins/gst_plugins_cache.json index e191e98..38e6eb5 100644 --- a/docs/plugins/gst_plugins_cache.json +++ b/docs/plugins/gst_plugins_cache.json @@ -2586,135 +2586,6 @@ "filename": "gstcamerabin", "license": "LGPL", "other-types": { - "GstBaseCameraSrc": { - "hierarchy": [ - "GstBaseCameraSrc", - "GstBin", - "GstElement", - "GstObject", - "GInitiallyUnowned", - "GObject" - ], - "interfaces": [ - "GstChildProxy" - ], - "kind": "object", - "properties": { - "auto-start": { - "blurb": "Automatically starts capture when going to the PAUSED state", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "false", - "mutable": "null", - "readable": true, - "type": "gboolean", - "writable": true - }, - "max-zoom": { - "blurb": "Digital zoom factor (e.g. 1.5 means 1.5x)", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "10", - "max": "3.40282e+38", - "min": "1", - "mutable": "null", - "readable": true, - "type": "gfloat", - "writable": false - }, - "mode": { - "blurb": "The capture mode (still image capture or video recording)", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "mode-image (1)", - "mutable": "null", - "readable": true, - "type": "GstCameraBin2Mode", - "writable": true - }, - "post-previews": { - "blurb": "If capture preview images should be posted to the bus", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "true", - "mutable": "null", - "readable": true, - "type": "gboolean", - "writable": true - }, - "preview-caps": { - "blurb": "The caps of the preview image to be posted (NULL means ANY)", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "ANY", - "mutable": "null", - "readable": true, - "type": "GstCaps", - "writable": true - }, - "preview-filter": { - "blurb": "A custom preview filter to process preview image data", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "mutable": "null", - "readable": true, - "type": "GstElement", - "writable": true - }, - "ready-for-capture": { - "blurb": "Informs this element is ready for starting another capture", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "true", - "mutable": "null", - "readable": true, - "type": "gboolean", - "writable": false - }, - "zoom": { - "blurb": "Digital zoom factor (e.g. 1.5 means 1.5x)", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "1", - "max": "3.40282e+38", - "min": "1", - "mutable": "null", - "readable": true, - "type": "gfloat", - "writable": true - } - }, - "signals": { - "start-capture": { - "action": true, - "args": [], - "return-type": "void", - "when": "last" - }, - "stop-capture": { - "action": true, - "args": [], - "return-type": "void", - "when": "last" - } - } - }, "GstCamFlags": { "kind": "flags", "values": [ @@ -218949,135 +218820,6 @@ "filename": "gstuvch264", "license": "LGPL", "other-types": { - "GstBaseCameraSrc": { - "hierarchy": [ - "GstBaseCameraSrc", - "GstBin", - "GstElement", - "GstObject", - "GInitiallyUnowned", - "GObject" - ], - "interfaces": [ - "GstChildProxy" - ], - "kind": "object", - "properties": { - "auto-start": { - "blurb": "Automatically starts capture when going to the PAUSED state", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "false", - "mutable": "null", - "readable": true, - "type": "gboolean", - "writable": true - }, - "max-zoom": { - "blurb": "Digital zoom factor (e.g. 1.5 means 1.5x)", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "10", - "max": "3.40282e+38", - "min": "1", - "mutable": "null", - "readable": true, - "type": "gfloat", - "writable": false - }, - "mode": { - "blurb": "The capture mode (still image capture or video recording)", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "mode-video (2)", - "mutable": "null", - "readable": true, - "type": "GstCameraBin2Mode", - "writable": true - }, - "post-previews": { - "blurb": "If capture preview images should be posted to the bus", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "true", - "mutable": "null", - "readable": true, - "type": "gboolean", - "writable": true - }, - "preview-caps": { - "blurb": "The caps of the preview image to be posted (NULL means ANY)", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "ANY", - "mutable": "null", - "readable": true, - "type": "GstCaps", - "writable": true - }, - "preview-filter": { - "blurb": "A custom preview filter to process preview image data", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "mutable": "null", - "readable": true, - "type": "GstElement", - "writable": true - }, - "ready-for-capture": { - "blurb": "Informs this element is ready for starting another capture", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "true", - "mutable": "null", - "readable": true, - "type": "gboolean", - "writable": false - }, - "zoom": { - "blurb": "Digital zoom factor (e.g. 1.5 means 1.5x)", - "conditionally-available": false, - "construct": false, - "construct-only": false, - "controllable": false, - "default": "1", - "max": "3.40282e+38", - "min": "1", - "mutable": "null", - "readable": true, - "type": "gfloat", - "writable": true - } - }, - "signals": { - "start-capture": { - "action": true, - "args": [], - "return-type": "void", - "when": "last" - }, - "stop-capture": { - "action": true, - "args": [], - "return-type": "void", - "when": "last" - } - } - }, "GstCameraBin2Mode": { "kind": "enum", "values": [ diff --git a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c index c1a2b2e..59d5e8b 100644 --- a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c +++ b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c @@ -32,7 +32,7 @@ * * * 3 pads: viewfinder, image capture, video capture * - * During construct_pipeline() vmethod a subclass can add several elements into + * 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 @@ -60,7 +60,7 @@ * 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 + * The src will receive the capture mode from `GstCameraBin2` on the * #GstBaseCameraSrc:mode property. Possible capture modes are defined in * #GstCameraBinMode. */ @@ -73,6 +73,14 @@ #include #include "gstbasecamerasrc.h" +#define DEFAULT_WIDTH 640 +#define DEFAULT_HEIGHT 480 +#define DEFAULT_CAPTURE_WIDTH 800 +#define DEFAULT_CAPTURE_HEIGHT 600 +#define DEFAULT_FPS_N 0 /* makes it use the default */ +#define DEFAULT_FPS_D 1 +#define DEFAULT_ZOOM MIN_ZOOM + enum { PROP_0, @@ -546,8 +554,6 @@ gst_base_camera_src_class_init (GstBaseCameraSrcClass * klass) gst_element_class_set_static_metadata (gstelement_class, "Base class for camerabin src bin", "Source/Video", "Abstracts capture device for camerabin2", "Rob Clark "); - - gst_type_mark_as_plugin_api (GST_TYPE_BASE_CAMERA_SRC, 0); } static void diff --git a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c index e29a7b2..60c38f0 100644 --- a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c +++ b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c @@ -22,8 +22,7 @@ * SECTION:camerabingeneral * @short_description: helper functions for #GstCameraBin and it's modules * - * Common helper functions for #GstCameraBin, #GstCameraBinImage and - * #GstCameraBinVideo. + * Common helper functions for #GstCameraBin. * */ #ifdef HAVE_CONFIG_H diff --git a/gst-libs/gst/basecamerabinsrc/meson.build b/gst-libs/gst/basecamerabinsrc/meson.build index 830e915..ba6771e 100644 --- a/gst-libs/gst/basecamerabinsrc/meson.build +++ b/gst-libs/gst/basecamerabinsrc/meson.build @@ -22,6 +22,24 @@ gstbasecamerabin = library('gstbasecamerabinsrc-' + api_version, dependencies : [gstapp_dep], ) +_sources = [] +if build_gir + basecamerabin_gir = gnome.generate_gir(gstbasecamerabin, + sources : camerabin_sources + camerabin_headers, + namespace : 'GstBadBaseCameraBin', + nsversion : api_version, + identifier_prefix : 'Gst', + symbol_prefix : 'gst', + export_packages : 'gstreamer-bad-base-camerabinsrc-1.0', + includes : ['Gst-1.0', 'GstApp-1.0'], + install : false, # Only for the documentation + extra_args : gir_init_section + ['-DGST_USE_UNSTABLE_API'], + dependencies : [gstapp_dep], + build_by_default : true, + ) + _sources += [basecamerabin_gir] +endif + gstbasecamerabin_dep = declare_dependency(link_with : gstbasecamerabin, include_directories : [libsinc], dependencies : [gstapp_dep]) diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 9fd03e0..584e3e3 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -847,7 +847,6 @@ gst_camera_bin_class_init (GstCameraBin2Class * klass) NULL, NULL, NULL, G_TYPE_NONE, 0); gst_type_mark_as_plugin_api (GST_TYPE_CAM_FLAGS, 0); - gst_type_mark_as_plugin_api (GST_TYPE_CAMERABIN_MODE, 0); } static void @@ -866,7 +865,7 @@ gst_camera_bin_init (GstCameraBin2 * camera) g_cond_init (&camera->video_state_cond); /* capsfilters are created here as we proxy their caps properties and - * this way we avoid having to store the caps while on NULL state to + * this way we avoid having to store the caps while on NULL state to * set them later */ camera->videobin_capsfilter = gst_element_factory_make ("capsfilter", "videobin-capsfilter"); -- 2.7.4