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
G
gst-plugins-base
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
Sebastian Dröge
gst-plugins-base
Commits
8f33ad80
Commit
8f33ad80
authored
Aug 06, 2012
by
LRN
Committed by
Sebastian Dröge
Aug 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
discoverer: Add source-setup signal for GstDiscoverer
https://bugzilla.gnome.org/show_bug.cgi?id=681260
parent
880b9a20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
gst-libs/gst/pbutils/gstdiscoverer.c
gst-libs/gst/pbutils/gstdiscoverer.c
+41
-0
gst-libs/gst/pbutils/gstdiscoverer.h
gst-libs/gst/pbutils/gstdiscoverer.h
+2
-0
No files found.
gst-libs/gst/pbutils/gstdiscoverer.c
View file @
8f33ad80
...
...
@@ -120,6 +120,7 @@ struct _GstDiscovererPrivate
/* Handler ids for various callbacks */
gulong
pad_added_id
;
gulong
pad_remove_id
;
gulong
source_chg_id
;
gulong
element_added_id
;
gulong
bus_cb_id
;
};
...
...
@@ -148,6 +149,7 @@ enum
SIGNAL_FINISHED
,
SIGNAL_STARTING
,
SIGNAL_DISCOVERED
,
SIGNAL_SOURCE_SETUP
,
LAST_SIGNAL
};
...
...
@@ -171,6 +173,8 @@ static void uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
GstDiscoverer
*
dc
);
static
void
uridecodebin_pad_removed_cb
(
GstElement
*
uridecodebin
,
GstPad
*
pad
,
GstDiscoverer
*
dc
);
static
void
uridecodebin_source_changed_cb
(
GstElement
*
uridecodebin
,
GParamSpec
*
pspec
,
GstDiscoverer
*
dc
);
static
void
gst_discoverer_dispose
(
GObject
*
dc
);
static
void
gst_discoverer_set_property
(
GObject
*
object
,
guint
prop_id
,
...
...
@@ -243,6 +247,25 @@ gst_discoverer_class_init (GstDiscovererClass * klass)
NULL
,
NULL
,
g_cclosure_marshal_generic
,
G_TYPE_NONE
,
2
,
GST_TYPE_DISCOVERER_INFO
,
G_TYPE_ERROR
|
G_SIGNAL_TYPE_STATIC_SCOPE
);
/**
* GstDiscoverer::source-setup:
* @discoverer: the #GstDiscoverer
* @source: source element
*
* This signal is emitted after the source element has been created for, so
* the URI being discovered, so it can be configured by setting additional
* properties (e.g. set a proxy server for an http source, or set the device
* and read speed for an audio cd source).
*
* This signal is usually emitted from the context of a GStreamer streaming
* thread.
*/
gst_discoverer_signals
[
SIGNAL_SOURCE_SETUP
]
=
g_signal_new
(
"source-setup"
,
G_TYPE_FROM_CLASS
(
klass
),
G_SIGNAL_RUN_LAST
,
G_STRUCT_OFFSET
(
GstDiscovererClass
,
source_setup
),
NULL
,
NULL
,
g_cclosure_marshal_generic
,
G_TYPE_NONE
,
1
,
GST_TYPE_ELEMENT
);
}
static
void
...
...
@@ -292,6 +315,9 @@ gst_discoverer_init (GstDiscoverer * dc)
dc
->
priv
->
pad_remove_id
=
g_signal_connect_object
(
dc
->
priv
->
uridecodebin
,
"pad-removed"
,
G_CALLBACK
(
uridecodebin_pad_removed_cb
),
dc
,
0
);
dc
->
priv
->
source_chg_id
=
g_signal_connect_object
(
dc
->
priv
->
uridecodebin
,
"notify::source"
,
G_CALLBACK
(
uridecodebin_source_changed_cb
),
dc
,
0
);
GST_LOG_OBJECT
(
dc
,
"Getting pipeline bus"
);
dc
->
priv
->
bus
=
gst_pipeline_get_bus
((
GstPipeline
*
)
dc
->
priv
->
pipeline
);
...
...
@@ -350,6 +376,7 @@ gst_discoverer_dispose (GObject * obj)
/* Workaround for bug #118536 */
DISCONNECT_SIGNAL
(
dc
->
priv
->
uridecodebin
,
dc
->
priv
->
pad_added_id
);
DISCONNECT_SIGNAL
(
dc
->
priv
->
uridecodebin
,
dc
->
priv
->
pad_remove_id
);
DISCONNECT_SIGNAL
(
dc
->
priv
->
uridecodebin
,
dc
->
priv
->
source_chg_id
);
DISCONNECT_SIGNAL
(
dc
->
priv
->
uridecodebin
,
dc
->
priv
->
element_added_id
);
DISCONNECT_SIGNAL
(
dc
->
priv
->
bus
,
dc
->
priv
->
bus_cb_id
);
...
...
@@ -508,6 +535,20 @@ got_subtitle_data (GstPad * pad, GstPadProbeInfo * info, GstDiscoverer * dc)
}
static
void
uridecodebin_source_changed_cb
(
GstElement
*
uridecodebin
,
GParamSpec
*
pspec
,
GstDiscoverer
*
dc
)
{
GstElement
*
src
;
/* get a handle to the source */
g_object_get
(
uridecodebin
,
pspec
->
name
,
&
src
,
NULL
);
GST_DEBUG_OBJECT
(
dc
,
"got a new source %p"
,
src
);
g_signal_emit
(
dc
,
gst_discoverer_signals
[
SIGNAL_SOURCE_SETUP
],
0
,
src
);
gst_object_unref
(
src
);
}
static
void
uridecodebin_pad_added_cb
(
GstElement
*
uridecodebin
,
GstPad
*
pad
,
GstDiscoverer
*
dc
)
...
...
gst-libs/gst/pbutils/gstdiscoverer.h
View file @
8f33ad80
...
...
@@ -251,6 +251,8 @@ struct _GstDiscovererClass {
void
(
*
discovered
)
(
GstDiscoverer
*
discoverer
,
GstDiscovererInfo
*
info
,
const
GError
*
err
);
void
(
*
source_setup
)
(
GstDiscoverer
*
discoverer
,
GstElement
*
source
);
gpointer
_reserved
[
GST_PADDING
];
};
...
...
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