Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
luzpaz
gstreamer
Commits
7992174a
Commit
7992174a
authored
Jun 26, 2014
by
Olivier Crête
👻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DeviceProvider: Rename from DeviceMonitor
parent
4720e6d0
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1048 additions
and
365 deletions
+1048
-365
docs/gst/gstreamer-docs.sgml
docs/gst/gstreamer-docs.sgml
+3
-3
docs/gst/gstreamer-sections.txt
docs/gst/gstreamer-sections.txt
+47
-47
docs/plugins/gstreamer-plugins.hierarchy
docs/plugins/gstreamer-plugins.hierarchy
+1
-1
gst/Makefile.am
gst/Makefile.am
+4
-4
gst/gst.h
gst/gst.h
+1
-1
gst/gst_private.h
gst/gst_private.h
+5
-5
gst/gstdevice.c
gst/gstdevice.c
+3
-3
gst/gstdeviceprovider.c
gst/gstdeviceprovider.c
+591
-0
gst/gstdeviceprovider.h
gst/gstdeviceprovider.h
+43
-43
gst/gstdeviceproviderfactory.c
gst/gstdeviceproviderfactory.c
+143
-142
gst/gstdeviceproviderfactory.h
gst/gstdeviceproviderfactory.h
+90
-0
gst/gstglobaldevicemonitor.c
gst/gstglobaldevicemonitor.c
+49
-48
gst/gstglobaldevicemonitor.h
gst/gstglobaldevicemonitor.h
+2
-2
gst/gstmessage.c
gst/gstmessage.c
+4
-4
gst/gstmessage.h
gst/gstmessage.h
+2
-2
gst/gstregistry.c
gst/gstregistry.c
+11
-11
gst/gstregistrybinary.c
gst/gstregistrybinary.c
+2
-2
gst/gstregistrychunks.c
gst/gstregistrychunks.c
+10
-10
gst/gstregistrychunks.h
gst/gstregistrychunks.h
+4
-4
tools/gst-inspect.c
tools/gst-inspect.c
+8
-8
win32/common/libgstreamer.def
win32/common/libgstreamer.def
+25
-25
No files found.
docs/gst/gstreamer-docs.sgml
View file @
7992174a
...
...
@@ -117,10 +117,10 @@ Windows. It is released under the GNU Library General Public License
<chapter
id=
"gstreamer-device-probing"
>
<title>
GStreamer Device Discovery and Device Probing
</title>
<xi:include
href=
"xml/gstdevice.xml"
/>
<xi:include
href=
"xml/gstdevicemonitor.xml"
/>
<xi:include
href=
"xml/gstdevicemonitorfactory.xml"
/>
<xi:include
href=
"xml/gstglobaldevicemonitor.xml"
/>
<xi:include
href=
"xml/gstdevice.xml"
/>
<xi:include
href=
"xml/gstdeviceprovider.xml"
/>
<xi:include
href=
"xml/gstdeviceproviderfactory.xml"
/>
</chapter>
<chapter
id=
"gstreamer-support"
>
...
...
docs/gst/gstreamer-sections.txt
View file @
7992174a
...
...
@@ -3353,61 +3353,61 @@ gst_device_get_type
</SECTION>
<SECTION>
<FILE>gstdevice
monito
r</FILE>
<TITLE>GstDevice
Monito
r</TITLE>
GstDevice
Monito
r
GstDevice
Monito
rClass
gst_device_
monito
r_can_monitor
gst_device_
monito
r_class_add_metadata
gst_device_
monito
r_class_add_static_metadata
gst_device_
monito
r_class_get_metadata
gst_device_
monito
r_class_set_metadata
gst_device_
monito
r_class_set_static_metadata
gst_device_
monito
r_device_add
gst_device_
monito
r_device_remove
gst_device_
monito
r_get_bus
gst_device_
monito
r_get_devices
gst_device_
monito
r_get_factory
gst_device_
monito
r_register
gst_device_
monito
r_start
gst_device_
monito
r_stop
<FILE>gstdevice
provide
r</FILE>
<TITLE>GstDevice
Provide
r</TITLE>
GstDevice
Provide
r
GstDevice
Provide
rClass
gst_device_
provide
r_can_monitor
gst_device_
provide
r_class_add_metadata
gst_device_
provide
r_class_add_static_metadata
gst_device_
provide
r_class_get_metadata
gst_device_
provide
r_class_set_metadata
gst_device_
provide
r_class_set_static_metadata
gst_device_
provide
r_device_add
gst_device_
provide
r_device_remove
gst_device_
provide
r_get_bus
gst_device_
provide
r_get_devices
gst_device_
provide
r_get_factory
gst_device_
provide
r_register
gst_device_
provide
r_start
gst_device_
provide
r_stop
<SUBSECTION Standard>
GstDevicePrivate
GST_DEVICE_
MONITO
R
GST_DEVICE_
MONITO
R_CAST
GST_DEVICE_
MONITO
R_CLASS
GST_DEVICE_
MONITO
R_GET_CLASS
GST_IS_DEVICE_
MONITO
R
GST_IS_DEVICE_
MONITO
R_CLASS
GST_TYPE_DEVICE_
MONITO
R
gst_device_
monito
r_get_type
GST_DEVICE_
PROVIDE
R
GST_DEVICE_
PROVIDE
R_CAST
GST_DEVICE_
PROVIDE
R_CLASS
GST_DEVICE_
PROVIDE
R_GET_CLASS
GST_IS_DEVICE_
PROVIDE
R
GST_IS_DEVICE_
PROVIDE
R_CLASS
GST_TYPE_DEVICE_
PROVIDE
R
gst_device_
provide
r_get_type
</SECTION>
<SECTION>
<FILE>gstdevice
monito
rfactory</FILE>
<TITLE>GstDevice
Monito
rFactory</TITLE>
GstDevice
Monito
rFactory
GstDevice
Monito
rFactoryClass
gst_device_
monito
r_factory_find
gst_device_
monito
r_factory_get
gst_device_
monito
r_factory_get_by_name
gst_device_
monito
r_factory_get_device_
monito
r_type
gst_device_
monito
r_factory_get_metadata
gst_device_
monito
r_factory_get_metadata_keys
gst_device_
monito
r_factory_has_classes
gst_device_
monito
r_factory_has_classesv
gst_device_
monito
r_factory_list_get_device_
monito
rs
<FILE>gstdevice
provide
rfactory</FILE>
<TITLE>GstDevice
Provide
rFactory</TITLE>
GstDevice
Provide
rFactory
GstDevice
Provide
rFactoryClass
gst_device_
provide
r_factory_find
gst_device_
provide
r_factory_get
gst_device_
provide
r_factory_get_by_name
gst_device_
provide
r_factory_get_device_
provide
r_type
gst_device_
provide
r_factory_get_metadata
gst_device_
provide
r_factory_get_metadata_keys
gst_device_
provide
r_factory_has_classes
gst_device_
provide
r_factory_has_classesv
gst_device_
provide
r_factory_list_get_device_
provide
rs
<SUBSECTION Standard>
GstDevice
Monito
rPrivate
GST_DEVICE_
MONITO
R_FACTORY
GST_DEVICE_
MONITO
R_FACTORY_CAST
GST_DEVICE_
MONITO
R_FACTORY_CLASS
GST_TYPE_DEVICE_
MONITO
R_FACTORY
GST_IS_DEVICE_
MONITO
R_FACTORY
GST_IS_DEVICE_
MONITO
R_FACTORY_CLASS
gst_device_
monito
r_factory_get_type
GstDevice
Provide
rPrivate
GST_DEVICE_
PROVIDE
R_FACTORY
GST_DEVICE_
PROVIDE
R_FACTORY_CAST
GST_DEVICE_
PROVIDE
R_FACTORY_CLASS
GST_TYPE_DEVICE_
PROVIDE
R_FACTORY
GST_IS_DEVICE_
PROVIDE
R_FACTORY
GST_IS_DEVICE_
PROVIDE
R_FACTORY_CLASS
gst_device_
provide
r_factory_get_type
</SECTION>
<SECTION>
...
...
docs/plugins/gstreamer-plugins.hierarchy
View file @
7992174a
...
...
@@ -36,7 +36,7 @@ GObject
GstPadTemplate
GstPlugin
GstPluginFeature
GstDevice
Monito
rFactory
GstDevice
Provide
rFactory
GstElementFactory
GstTypeFindFactory
GstRegistry
...
...
gst/Makefile.am
View file @
7992174a
...
...
@@ -72,8 +72,8 @@ libgstreamer_@GST_API_VERSION@_la_SOURCES = \
gstdatetime.c
\
gstdebugutils.c
\
gstdevice.c
\
gstdevice
monito
r.c
\
gstdevice
monito
rfactory.c
\
gstdevice
provide
r.c
\
gstdevice
provide
rfactory.c
\
gstelement.c
\
gstelementfactory.c
\
gsterror.c
\
...
...
@@ -177,8 +177,8 @@ gst_headers = \
gstelement.h
\
gstelementmetadata.h
\
gstdevice.h
\
gstdevice
monito
r.h
\
gstdevice
monito
rfactory.h
\
gstdevice
provide
r.h
\
gstdevice
provide
rfactory.h
\
gstelementfactory.h
\
gsterror.h
\
gstevent.h
\
...
...
gst/gst.h
View file @
7992174a
...
...
@@ -43,7 +43,7 @@
#include <gst/gstdatetime.h>
#include <gst/gstdebugutils.h>
#include <gst/gstdevice.h>
#include <gst/gstdevice
monito
r.h>
#include <gst/gstdevice
provide
r.h>
#include <gst/gstelement.h>
#include <gst/gstelementmetadata.h>
#include <gst/gsterror.h>
...
...
gst/gst_private.h
View file @
7992174a
...
...
@@ -54,8 +54,8 @@ extern const char g_log_domain_gstreamer[];
/* for GstElement */
#include "gstelement.h"
/* for GstDevice
Monito
r */
#include "gstdevice
monito
r.h"
/* for GstDevice
Provide
r */
#include "gstdevice
provide
r.h"
/* for GstToc */
#include "gsttoc.h"
...
...
@@ -399,19 +399,19 @@ struct _GstElementFactoryClass {
gpointer
_gst_reserved
[
GST_PADDING
];
};
struct
_GstDevice
Monito
rFactory
{
struct
_GstDevice
Provide
rFactory
{
GstPluginFeature
feature
;
/* <private> */
GType
type
;
/* unique GType the device factory or 0 if not loaded */
volatile
GstDevice
Monitor
*
monito
r
;
volatile
GstDevice
Provider
*
provide
r
;
gpointer
metadata
;
gpointer
_gst_reserved
[
GST_PADDING
];
};
struct
_GstDevice
Monito
rFactoryClass
{
struct
_GstDevice
Provide
rFactoryClass
{
GstPluginFeatureClass
parent
;
/* <private> */
...
...
gst/gstdevice.c
View file @
7992174a
...
...
@@ -22,13 +22,13 @@
/**
* SECTION:gstdevice
* @short_description: Object representing a device
* @see_also: #GstDevice
Monito
r
* @see_also: #GstDevice
Provide
r
*
* #GstDevice are objects representing a device, they contain
* relevant metadata about the device, such as its class and the #GstCaps
* representing the media types it can produce or handle.
*
* #GstDevice are created by #GstDevice
Monito
r objects which can be
* #GstDevice are created by #GstDevice
Provide
r objects which can be
* aggregated by #GstGlobalDeviceMonitor objects.
*
* Since: 1.4
...
...
@@ -239,7 +239,7 @@ gst_device_get_display_name (GstDevice * device)
*
* Gets the "class" of a device. This is a "/" separated list of
* classes that represent this device. They are a subset of the
* classes of the #GstDevice
Monito
r that produced this device.
* classes of the #GstDevice
Provide
r that produced this device.
*
* Returns: The device class. Free with g_free() after use.
*
...
...
gst/gstdevice
monito
r.c
→
gst/gstdevice
provide
r.c
View file @
7992174a
This diff is collapsed.
Click to expand it.
gst/gstdevice
monito
r.h
→
gst/gstdevice
provide
r.h
View file @
7992174a
/* GStreamer
* Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
*
* gstdevice
monito
r.h: Device probing and monitoring
* gstdevice
provide
r.h: Device probing and monitoring
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
...
...
@@ -19,39 +19,39 @@
* Boston, MA 02111-1307, USA.
*/
#include <gst/gstdevice
monito
rfactory.h>
#include <gst/gstdevice
provide
rfactory.h>
#ifndef __GST_DEVICE_
MONITO
R_H__
#define __GST_DEVICE_
MONITO
R_H__
#ifndef __GST_DEVICE_
PROVIDE
R_H__
#define __GST_DEVICE_
PROVIDE
R_H__
#include <gst/gstelement.h>
G_BEGIN_DECLS
typedef
struct
_GstDevice
Monito
r
GstDevice
Monito
r
;
typedef
struct
_GstDevice
Monito
rClass
GstDevice
Monito
rClass
;
typedef
struct
_GstDevice
Monito
rPrivate
GstDevice
Monito
rPrivate
;
typedef
struct
_GstDevice
Provide
r
GstDevice
Provide
r
;
typedef
struct
_GstDevice
Provide
rClass
GstDevice
Provide
rClass
;
typedef
struct
_GstDevice
Provide
rPrivate
GstDevice
Provide
rPrivate
;
#define GST_TYPE_DEVICE_
MONITO
R (gst_device_
monito
r_get_type())
#define GST_IS_DEVICE_
MONITO
R(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEVICE_
MONITO
R))
#define GST_IS_DEVICE_
MONITO
R_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DEVICE_
MONITO
R))
#define GST_DEVICE_
MONITO
R_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DEVICE_
MONITO
R, GstDevice
Monito
rClass))
#define GST_DEVICE_
MONITO
R(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DEVICE_
MONITO
R, GstDevice
Monito
r))
#define GST_DEVICE_
MONITO
R_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_
MONITO
R, GstDevice
Monito
rClass))
#define GST_DEVICE_
MONITO
R_CAST(obj) ((GstDevice
Monito
r *)(obj))
#define GST_TYPE_DEVICE_
PROVIDE
R (gst_device_
provide
r_get_type())
#define GST_IS_DEVICE_
PROVIDE
R(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEVICE_
PROVIDE
R))
#define GST_IS_DEVICE_
PROVIDE
R_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DEVICE_
PROVIDE
R))
#define GST_DEVICE_
PROVIDE
R_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DEVICE_
PROVIDE
R, GstDevice
Provide
rClass))
#define GST_DEVICE_
PROVIDE
R(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DEVICE_
PROVIDE
R, GstDevice
Provide
r))
#define GST_DEVICE_
PROVIDE
R_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_
PROVIDE
R, GstDevice
Provide
rClass))
#define GST_DEVICE_
PROVIDE
R_CAST(obj) ((GstDevice
Provide
r *)(obj))
/**
* GstDevice
Monito
r:
* GstDevice
Provide
r:
* @parent: The parent #GstObject
* @devices: a #GList of the #GstDevice objects
*
* The structure of the base #GstDevice
Monito
r
* The structure of the base #GstDevice
Provide
r
*
* Since: 1.4
*/
struct
_GstDevice
Monito
r
{
struct
_GstDevice
Provide
r
{
GstObject
parent
;
/* Protected by the Object lock */
...
...
@@ -59,16 +59,16 @@ struct _GstDeviceMonitor {
/*< private >*/
GstDevice
Monito
rPrivate
*
priv
;
GstDevice
Provide
rPrivate
*
priv
;
gpointer
_gst_reserved
[
GST_PADDING
];
};
/**
* GstDevice
Monito
rClass:
* GstDevice
Provide
rClass:
* @parent_class: the parent #GstObjectClass structure
* @factory: a pointer to the #GstDevice
Monito
rFactory that creates this
*
monito
r
* @factory: a pointer to the #GstDevice
Provide
rFactory that creates this
*
provide
r
* @probe: Returns a list of devices that are currently available.
* This should never block.
* @start: Starts monitoring for new devices. Only subclasses that can know
...
...
@@ -76,20 +76,20 @@ struct _GstDeviceMonitor {
* @stop: Stops monitoring for new devices. Only subclasses that implement
* the start() method need to implement this method.
*
* The structure of the base #GstDevice
Monito
rClass
* The structure of the base #GstDevice
Provide
rClass
*
* Since: 1.4
*/
struct
_GstDevice
Monito
rClass
{
struct
_GstDevice
Provide
rClass
{
GstObjectClass
parent_class
;
GstDevice
Monito
rFactory
*
factory
;
GstDevice
Provide
rFactory
*
factory
;
GList
*
(
*
probe
)
(
GstDevice
Monitor
*
monito
r
);
GList
*
(
*
probe
)
(
GstDevice
Provider
*
provide
r
);
gboolean
(
*
start
)
(
GstDevice
Monitor
*
monito
r
);
void
(
*
stop
)
(
GstDevice
Monitor
*
monito
r
);
gboolean
(
*
start
)
(
GstDevice
Provider
*
provide
r
);
void
(
*
stop
)
(
GstDevice
Provider
*
provide
r
);
/*< private >*/
gpointer
metadata
;
...
...
@@ -98,45 +98,45 @@ struct _GstDeviceMonitorClass {
gpointer
_gst_reserved
[
GST_PADDING
];
};
GType
gst_device_
monito
r_get_type
(
void
);
GType
gst_device_
provide
r_get_type
(
void
);
GList
*
gst_device_
monito
r_get_devices
(
GstDevice
Monitor
*
monito
r
);
GList
*
gst_device_
provide
r_get_devices
(
GstDevice
Provider
*
provide
r
);
gboolean
gst_device_
monito
r_start
(
GstDevice
Monitor
*
monito
r
);
void
gst_device_
monito
r_stop
(
GstDevice
Monitor
*
monito
r
);
gboolean
gst_device_
provide
r_start
(
GstDevice
Provider
*
provide
r
);
void
gst_device_
provide
r_stop
(
GstDevice
Provider
*
provide
r
);
gboolean
gst_device_
monito
r_can_monitor
(
GstDevice
Monitor
*
monito
r
);
gboolean
gst_device_
provide
r_can_monitor
(
GstDevice
Provider
*
provide
r
);
GstBus
*
gst_device_
monito
r_get_bus
(
GstDevice
Monitor
*
monito
r
);
GstBus
*
gst_device_
provide
r_get_bus
(
GstDevice
Provider
*
provide
r
);
void
gst_device_
monito
r_device_add
(
GstDevice
Monitor
*
monito
r
,
void
gst_device_
provide
r_device_add
(
GstDevice
Provider
*
provide
r
,
GstDevice
*
device
);
void
gst_device_
monito
r_device_remove
(
GstDevice
Monitor
*
monito
r
,
void
gst_device_
provide
r_device_remove
(
GstDevice
Provider
*
provide
r
,
GstDevice
*
device
);
/* device
monito
r class meta data */
void
gst_device_
monito
r_class_set_metadata
(
GstDevice
Monito
rClass
*
klass
,
/* device
provide
r class meta data */
void
gst_device_
provide
r_class_set_metadata
(
GstDevice
Provide
rClass
*
klass
,
const
gchar
*
longname
,
const
gchar
*
classification
,
const
gchar
*
description
,
const
gchar
*
author
);
void
gst_device_
monito
r_class_set_static_metadata
(
GstDevice
Monito
rClass
*
klass
,
void
gst_device_
provide
r_class_set_static_metadata
(
GstDevice
Provide
rClass
*
klass
,
const
gchar
*
longname
,
const
gchar
*
classification
,
const
gchar
*
description
,
const
gchar
*
author
);
void
gst_device_
monito
r_class_add_metadata
(
GstDevice
Monito
rClass
*
klass
,
void
gst_device_
provide
r_class_add_metadata
(
GstDevice
Provide
rClass
*
klass
,
const
gchar
*
key
,
const
gchar
*
value
);
void
gst_device_
monito
r_class_add_static_metadata
(
GstDevice
Monito
rClass
*
klass
,
void
gst_device_
provide
r_class_add_static_metadata
(
GstDevice
Provide
rClass
*
klass
,
const
gchar
*
key
,
const
gchar
*
value
);
const
gchar
*
gst_device_
monito
r_class_get_metadata
(
GstDevice
Monito
rClass
*
klass
,
const
gchar
*
gst_device_
provide
r_class_get_metadata
(
GstDevice
Provide
rClass
*
klass
,
const
gchar
*
key
);
/* factory management */
GstDevice
Monito
rFactory
*
gst_device_
monito
r_get_factory
(
GstDevice
Monitor
*
monito
r
);
GstDevice
Provide
rFactory
*
gst_device_
provide
r_get_factory
(
GstDevice
Provider
*
provide
r
);
G_END_DECLS
#endif
/* __GST_DEVICE_
MONITO
R_H__ */
#endif
/* __GST_DEVICE_
PROVIDE
R_H__ */
gst/gstdevice
monito
rfactory.c
→
gst/gstdevice
provide
rfactory.c
View file @
7992174a
This diff is collapsed.
Click to expand it.
gst/gstdevice
monito
rfactory.h
→
gst/gstdevice
provide
rfactory.h
View file @
7992174a
...
...
@@ -3,7 +3,7 @@
* 2000,2004 Wim Taymans <wim@fluendo.com>
* 2012 Olivier Crete <olivier.crete@collabora.com>
*
* gstdevice
monito
rfactory.h: Header for GstDevice
Monito
rFactory
* gstdevice
provide
rfactory.h: Header for GstDevice
Provide
rFactory
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
...
...
@@ -23,68 +23,68 @@
#ifndef __GST_DEVICE_
MONITO
R_FACTORY_H__
#define __GST_DEVICE_
MONITO
R_FACTORY_H__
#ifndef __GST_DEVICE_
PROVIDE
R_FACTORY_H__
#define __GST_DEVICE_
PROVIDE
R_FACTORY_H__
/**
* GstDevice
Monito
rFactory:
* GstDevice
Provide
rFactory:
*
* The opaque #GstDevice
Monito
rFactory data structure.
* The opaque #GstDevice
Provide
rFactory data structure.
*
* Since: 1.4
*/
/**
* GstDevice
Monito
rFactoryClass:
* GstDevice
Provide
rFactoryClass:
*
* The opaque #GstDevice
Monito
rFactoryClass data structure.
* The opaque #GstDevice
Provide
rFactoryClass data structure.
*
* Since: 1.4
*/
typedef
struct
_GstDevice
Monito
rFactory
GstDevice
Monito
rFactory
;
typedef
struct
_GstDevice
Monito
rFactoryClass
GstDevice
Monito
rFactoryClass
;
typedef
struct
_GstDevice
Provide
rFactory
GstDevice
Provide
rFactory
;
typedef
struct
_GstDevice
Provide
rFactoryClass
GstDevice
Provide
rFactoryClass
;
#include <gst/gstconfig.h>
#include <gst/gstplugin.h>
#include <gst/gstpluginfeature.h>
#include <gst/gstdevice
monito
r.h>
#include <gst/gstdevice
provide
r.h>
G_BEGIN_DECLS
#define GST_TYPE_DEVICE_
MONITO
R_FACTORY (gst_device_
monito
r_factory_get_type())
#define GST_DEVICE_
MONITO
R_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DEVICE_
MONITO
R_FACTORY,\
GstDevice
Monito
rFactory))
#define GST_DEVICE_
MONITO
R_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DEVICE_
MONITO
R_FACTORY,\
GstDevice
Monito
rFactoryClass))
#define GST_IS_DEVICE_
MONITO
R_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DEVICE_
MONITO
R_FACTORY))
#define GST_IS_DEVICE_
MONITO
R_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DEVICE_
MONITO
R_FACTORY))
#define GST_DEVICE_
MONITO
R_FACTORY_CAST(obj) ((GstDevice
Monito
rFactory *)(obj))
#define GST_TYPE_DEVICE_
PROVIDE
R_FACTORY (gst_device_
provide
r_factory_get_type())
#define GST_DEVICE_
PROVIDE
R_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DEVICE_
PROVIDE
R_FACTORY,\
GstDevice
Provide
rFactory))
#define GST_DEVICE_
PROVIDE
R_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DEVICE_
PROVIDE
R_FACTORY,\
GstDevice
Provide
rFactoryClass))
#define GST_IS_DEVICE_
PROVIDE
R_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DEVICE_
PROVIDE
R_FACTORY))
#define GST_IS_DEVICE_
PROVIDE
R_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DEVICE_
PROVIDE
R_FACTORY))
#define GST_DEVICE_
PROVIDE
R_FACTORY_CAST(obj) ((GstDevice
Provide
rFactory *)(obj))
GType
gst_device_
monito
r_factory_get_type
(
void
);
GType
gst_device_
provide
r_factory_get_type
(
void
);
GstDevice
Monito
rFactory
*
gst_device_
monito
r_factory_find
(
const
gchar
*
name
);
GstDevice
Provide
rFactory
*
gst_device_
provide
r_factory_find
(
const
gchar
*
name
);
GType
gst_device_
monito
r_factory_get_device_
monito
r_type
(
GstDevice
Monito
rFactory
*
factory
);
GType
gst_device_
provide
r_factory_get_device_
provide
r_type
(
GstDevice
Provide
rFactory
*
factory
);
const
gchar
*
gst_device_
monito
r_factory_get_metadata
(
GstDevice
Monito
rFactory
*
factory
,
const
gchar
*
key
);
gchar
**
gst_device_
monito
r_factory_get_metadata_keys
(
GstDevice
Monito
rFactory
*
factory
);
const
gchar
*
gst_device_
provide
r_factory_get_metadata
(
GstDevice
Provide
rFactory
*
factory
,
const
gchar
*
key
);
gchar
**
gst_device_
provide
r_factory_get_metadata_keys
(
GstDevice
Provide
rFactory
*
factory
);
GstDevice
Monito
r
*
gst_device_
monito
r_factory_get
(
GstDevice
Monito
rFactory
*
factory
)
G_GNUC_MALLOC
;
GstDevice
Monito
r
*
gst_device_
monito
r_factory_get_by_name
(
const
gchar
*
factoryname
)
G_GNUC_MALLOC
;
GstDevice
Provide
r
*
gst_device_
provide
r_factory_get
(
GstDevice
Provide
rFactory
*
factory
)
G_GNUC_MALLOC
;
GstDevice
Provide
r
*
gst_device_
provide
r_factory_get_by_name
(
const
gchar
*
factoryname
)
G_GNUC_MALLOC
;
gboolean
gst_device_
monito
r_register
(
GstPlugin
*
plugin
,
const
gchar
*
name
,
gboolean
gst_device_
provide
r_register
(
GstPlugin
*
plugin
,
const
gchar
*
name
,
guint
rank
,
GType
type
);
gboolean
gst_device_
monito
r_factory_has_classesv
(
GstDevice
Monito
rFactory
*
factory
,
gboolean
gst_device_
provide
r_factory_has_classesv
(
GstDevice
Provide
rFactory
*
factory
,
gchar
**
classes
);
gboolean
gst_device_
monito
r_factory_has_classes
(
GstDevice
Monito
rFactory
*
factory
,
gboolean
gst_device_
provide
r_factory_has_classes
(
GstDevice
Provide
rFactory
*
factory
,
const
gchar
*
classes
);
GList
*
gst_device_
monito
r_factory_list_get_device_
monito
rs
(
const
gchar
*
classes
,
GList
*
gst_device_
provide
r_factory_list_get_device_
provide
rs
(
const
gchar
*
classes
,
GstRank
minrank
)
G_GNUC_MALLOC
;
G_END_DECLS
#endif
/* __GST_DEVICE_
MONITO
R_FACTORY_H__ */
#endif
/* __GST_DEVICE_
PROVIDE
R_FACTORY_H__ */
gst/gstglobaldevicemonitor.c
View file @
7992174a
...
...
@@ -22,12 +22,12 @@
/**
* SECTION:gstglobaldevicemonitor
* @short_description: A global device monitor and prober
* @see_also: #GstDevice, #GstDevice
Monito
r
* @see_also: #GstDevice, #GstDevice
Provide
r
*
* Applications should create a #GstGlobalDeviceMonitor when they want
* to probe, list and monitor devices of a specific type. The
* #GstGlobalDeviceMonitor will create the appropriate
* #GstDevice
Monito
r objects and manage them. It will then post
* #GstDevice
Provide
r objects and manage them. It will then post
* messages on its #GstBus for devices that have been added and
* removed.
*
...
...
@@ -48,7 +48,7 @@ struct _GstGlobalDeviceMonitorPrivate
GstBus
*
bus
;
GPtrArray
*
monito
rs
;
GPtrArray
*
provide
rs
;
guint
cookie
;
GstCaps
*
caps
;
...
...
@@ -111,28 +111,28 @@ gst_global_device_monitor_init (GstGlobalDeviceMonitor * self)
self
->
priv
->
bus
=
gst_bus_new
();
gst_bus_set_flushing
(
self
->
priv
->
bus
,
TRUE
);
self
->
priv
->
monito
rs
=
g_ptr_array_new
();
self
->
priv
->
provide
rs
=
g_ptr_array_new
();
self
->
priv
->
caps
=
gst_caps_new_any
();
self
->
priv
->
classes
=
g_strdup
(
""
);
factories
=
gst_device_
monito
r_factory_list_get_device_
monito
rs
(
self
->
priv
->
classes
,
1
);
gst_device_
provide
r_factory_list_get_device_
provide
rs
(
self
->
priv
->
classes
,
1
);
while
(
factories
)
{
GstDevice
Monito
rFactory
*
factory
=
factories
->
data
;
GstDevice
Monitor
*
monito
r
;
GstDevice
Provide
rFactory
*
factory
=
factories
->
data
;
GstDevice
Provider
*
provide
r
;
factories
=
g_list_remove
(
factories
,
factory
);
monito
r
=
gst_device_
monito
r_factory_get
(
factory
);
if
(
monito
r
)
{
GstBus
*
bus
=
gst_device_
monito
r_get_bus
(
monito
r
);
provide
r
=
gst_device_
provide
r_factory_get
(
factory
);
if
(
provide
r
)
{
GstBus
*
bus
=
gst_device_
provide
r_get_bus
(
provide
r
);
gst_bus_enable_sync_message_emission
(
bus
);
g_signal_connect
(
bus
,
"sync-message"
,
G_CALLBACK
(
bus_sync_message
),
self
);
g_ptr_array_add
(
self
->
priv
->
monitors
,
monito
r
);
g_ptr_array_add
(
self
->
priv
->
providers
,
provide
r
);
}
gst_object_unref
(
factory
);
...
...
@@ -143,16 +143,16 @@ gst_global_device_monitor_init (GstGlobalDeviceMonitor * self)
static
void
gst_global_device_monitor_remove
(
GstGlobalDeviceMonitor
*
self
,
guint
i
)
{
GstDevice
Monitor
*
monito
r
=
g_ptr_array_index
(
self
->
priv
->
monito
rs
,
i
);
GstDevice
Provider
*
provide
r
=
g_ptr_array_index
(
self
->
priv
->
provide
rs
,
i
);
GstBus
*
bus
;
g_ptr_array_remove_index_fast
(
self
->
priv
->
monito
rs
,
i
);
g_ptr_array_remove_index_fast
(
self
->
priv
->
provide
rs
,
i
);
bus
=
gst_device_
monito
r_get_bus
(
monito
r
);
bus
=
gst_device_
provide
r_get_bus
(
provide
r
);
g_signal_handlers_disconnect_by_func
(
bus
,
bus_sync_message
,
self
);
gst_object_unref
(
bus
);
gst_object_unref
(
monito
r
);
gst_object_unref
(
provide
r
);
}
static
void
...
...
@@ -162,11 +162,11 @@ gst_global_device_monitor_dispose (GObject * object)
g_return_if_fail
(
self
->
priv
->
started
==
FALSE
);
if
(
self
->
priv
->
monito
rs
)
{
while
(
self
->
priv
->
monito
rs
->
len
)
gst_global_device_monitor_remove
(
self
,
self
->
priv
->
monito
rs
->
len
-
1
);
g_ptr_array_unref
(
self
->
priv
->
monito
rs
);
self
->
priv
->
monito
rs
=
NULL
;
if
(
self
->
priv
->
provide
rs
)
{
while
(
self
->
priv
->
provide
rs
->
len
)
gst_global_device_monitor_remove
(
self
,
self
->
priv
->
provide
rs
->
len
-
1
);
g_ptr_array_unref
(
self
->
priv
->
provide
rs
);
self
->
priv
->
provide
rs
=
NULL
;
}
gst_caps_replace
(
&
self
->
priv
->
caps
,
NULL
);
...
...
@@ -178,7 +178,7 @@ gst_global_device_monitor_dispose (GObject * object)
/**
* gst_global_device_monitor_get_devices:
* @monitor: A #GstDevice
Monito
r
* @monitor: A #GstDevice
Provide
r
*
* Gets a list of devices from all of the relevant monitors. This may actually
* probe the hardware if the global monitor is not currently started.
...
...
@@ -207,15 +207,15 @@ again:
cookie
=
monitor
->
priv
->
cookie
;