Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gstreamer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luzpaz
gstreamer
Commits
67440ce0
Commit
67440ce0
authored
Jun 26, 2014
by
Olivier Crête
👻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devicemonitor: Improve documentation
parent
6d12b339
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
8 deletions
+60
-8
gst/gstdevicemonitor.c
gst/gstdevicemonitor.c
+51
-0
gst/gstdeviceprovider.c
gst/gstdeviceprovider.c
+2
-2
gst/gstdeviceproviderfactory.c
gst/gstdeviceproviderfactory.c
+3
-2
gst/gstmessage.c
gst/gstmessage.c
+4
-4
No files found.
gst/gstdevicemonitor.c
View file @
67440ce0
...
...
@@ -34,6 +34,57 @@
* The device monitor will monitor all devices matching the filters that
* the application has set.
*
*
* The basic use pattern of an iterator is as follows:
* |[
* static gboolean
* my_bus_func (GstBus * bus, GstMessage * message, gpointer user_data)
* {
* GstDevice *device;
* gchar name;
*
* switch (GST_MESSAGE_TYPE (message)) {
* case GST_MESSAGE_DEVICE_ADDED:
* gst_message_parse_device_added (message, &device);
* name = gst_device_get_display_name (device);
* g_print("Device added: %s\n", name);
* g_free (name);
* break;
* case GST_MESSAGE_DEVICE_REMOVED:
* gst_message_parse_device_removed (message, &device);
* name = gst_device_get_display_name (device);
* g_print("Device removed: %s\n", name);
* g_free (name);
* break;
* default:
* break;
* }
*
* return G_SOURCE_CONTINUE;
* }
*
* GstDeviceMonitor *
* setup_raw_video_source_device_monitor (void) {
* GstDeviceMonitor *monitor;
* GstBus *bus;
* GstCaps *caps;
*
* monitor = gst_device_monitor_new ();
*
* bus = gst_device_monitor_get_bus (monitor);
* gst_bus_add_watch (bus, my_bus_func, NULL);
* gst_object_unref (bus);
*
* caps = gst_caps_new_simple_empty ("video/x-raw");
* gst_device_monitor_add_filter (monitor, "Video/Source", caps);
* gst_caps_unref (caps);
*
* gst_device_monitor_start (monitor);
*
* return monitor;
* }
* ]|
*
* Since: 1.4
*/
...
...
gst/gstdeviceprovider.c
View file @
67440ce0
...
...
@@ -22,7 +22,7 @@
/**
* SECTION:gstdeviceprovider
* @short_description: A device provider
* @see_also: #GstDevice, #Gst
Global
DeviceMonitor
* @see_also: #GstDevice, #GstDeviceMonitor
*
* A #GstDeviceProvider subclass is provided by a plugin that handles devices
* if there is a way to programatically list connected devices. It can also
...
...
@@ -31,7 +31,7 @@
* Each #GstDeviceProvider subclass is a singleton, a plugin should
* normally provide a single subclass for all devices.
*
* Applications would normally use a #Gst
Global
DeviceMonitor to monitor devices
* Applications would normally use a #GstDeviceMonitor to monitor devices
* from all relevant providers.
*
* Since: 1.4
...
...
gst/gstdeviceproviderfactory.c
View file @
67440ce0
...
...
@@ -30,8 +30,9 @@
* GstDeviceProviderfactory can be added to a #GstPlugin as it is also a
* #GstPluginFeature.
*
* Use the gst_device_provider_factory_find() and gst_device_provider_factory_create()
* functions to create device provider instances or use gst_device_provider_factory_make() as a
* Use the gst_device_provider_factory_find() and
* gst_device_provider_factory_create() functions to create device
* provider instances or use gst_device_provider_factory_make() as a
* convenient shortcut.
*
* Since: 1.4
...
...
gst/gstmessage.c
View file @
67440ce0
...
...
@@ -2340,7 +2340,7 @@ gst_message_parse_have_context (GstMessage * message, GstContext ** context)
* @device: (transfer none): The new #GstDevice
*
* Creates a new device-added message. The device-added message is produced by
* #GstDeviceProvider or a #Gst
Globa
lDeviceMonitor. They announce the appearance
* #GstDeviceProvider or a #GstlDeviceMonitor. They announce the appearance
* of monitored devices.
*
* Returns: a newly allocated #GstMessage
...
...
@@ -2370,7 +2370,7 @@ gst_message_new_device_added (GstObject * src, GstDevice * device)
* pointer to the new #GstDevice, or %NULL
*
* Parses a device-added message. The device-added message is produced by
* #GstDeviceProvider or a #Gst
Global
DeviceMonitor. It announces the appearance
* #GstDeviceProvider or a #GstDeviceMonitor. It announces the appearance
* of monitored devices.
*
* Since: 1.4
...
...
@@ -2392,7 +2392,7 @@ gst_message_parse_device_added (GstMessage * message, GstDevice ** device)
* @device: (transfer none): The removed #GstDevice
*
* Creates a new device-removed message. The device-removed message is produced
* by #GstDeviceProvider or a #Gst
Global
DeviceMonitor. They announce the
* by #GstDeviceProvider or a #GstDeviceMonitor. They announce the
* disappearance of monitored devices.
*
* Returns: a newly allocated #GstMessage
...
...
@@ -2422,7 +2422,7 @@ gst_message_new_device_removed (GstObject * src, GstDevice * device)
* pointer to the removed #GstDevice, or %NULL
*
* Parses a device-removed message. The device-removed message is produced by
* #GstDeviceProvider or a #Gst
Global
DeviceMonitor. It announces the
* #GstDeviceProvider or a #GstDeviceMonitor. It announces the
* disappearance of monitored devices.
*
* Since: 1.4
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment