docs: Document basecamerabinsrc
authorThibault Saunier <tsaunier@igalia.com>
Tue, 23 Jun 2020 14:03:04 +0000 (10:03 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 23 Jun 2020 17:02:57 +0000 (13:02 -0400)
docs/libs/basecamerabinsrc/index.md [new file with mode: 0644]
docs/libs/basecamerabinsrc/sitemap.txt [new file with mode: 0644]
docs/meson.build
docs/plugins/gst_plugins_cache.json
gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c
gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c
gst-libs/gst/basecamerabinsrc/meson.build
gst/camerabin2/gstcamerabin2.c

diff --git a/docs/libs/basecamerabinsrc/index.md b/docs/libs/basecamerabinsrc/index.md
new file mode 100644 (file)
index 0000000..16093b7
--- /dev/null
@@ -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 (file)
index 0000000..4f91fcd
--- /dev/null
@@ -0,0 +1 @@
+gi-index
index d06cce1..1192e26 100644 (file)
@@ -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},
index e191e98..38e6eb5 100644 (file)
         "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": [
         "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": [
index c1a2b2e..59d5e8b 100644 (file)
@@ -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.
  */
 #include <gst/glib-compat-private.h>
 #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 <rob@ti.com>");
-
-  gst_type_mark_as_plugin_api (GST_TYPE_BASE_CAMERA_SRC, 0);
 }
 
 static void
index e29a7b2..60c38f0 100644 (file)
@@ -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
index 830e915..ba6771e 100644 (file)
@@ -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])
index 9fd03e0..584e3e3 100644 (file)
@@ -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");