Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-good
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-good
Commits
783417ee
Commit
783417ee
authored
Apr 15, 2014
by
Nicolas Dufresne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2transform: Implement open/close
parent
23e273ac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
13 deletions
+37
-13
sys/v4l2/gstv4l2transform.c
sys/v4l2/gstv4l2transform.c
+37
-13
No files found.
sys/v4l2/gstv4l2transform.c
View file @
783417ee
...
...
@@ -124,10 +124,8 @@ gst_v4l2_transform_get_property (GObject * object,
}
static
gboolean
gst_v4l2_transform_
start
(
GstBaseTransform
*
trans
)
gst_v4l2_transform_
open
(
GstV4l2Transform
*
self
)
{
GstV4l2Transform
*
self
=
GST_V4L2_TRANSFORM
(
trans
);
GST_DEBUG_OBJECT
(
self
,
"Opening"
);
if
(
!
gst_v4l2_object_open
(
self
->
v4l2output
))
...
...
@@ -176,19 +174,27 @@ failure:
return
FALSE
;
}
static
void
gst_v4l2_transform_close
(
GstV4l2Transform
*
self
)
{
GST_DEBUG_OBJECT
(
self
,
"Closing"
);
gst_v4l2_object_close
(
self
->
v4l2output
);
gst_v4l2_object_close
(
self
->
v4l2capture
);
gst_caps_replace
(
&
self
->
probed_srccaps
,
NULL
);
gst_caps_replace
(
&
self
->
probed_srccaps
,
NULL
);
}
static
gboolean
gst_v4l2_transform_stop
(
GstBaseTransform
*
trans
)
{
GstV4l2Transform
*
self
=
GST_V4L2_TRANSFORM
(
trans
);
GST_DEBUG_OBJECT
(
self
,
"
Closing
"
);
GST_DEBUG_OBJECT
(
self
,
"
Stop
"
);
gst_v4l2_object_stop
(
self
->
v4l2output
);
gst_v4l2_object_stop
(
self
->
v4l2capture
);
gst_v4l2_object_close
(
self
->
v4l2output
);
gst_v4l2_object_close
(
self
->
v4l2capture
);
gst_caps_replace
(
&
self
->
probed_srccaps
,
NULL
);
gst_caps_replace
(
&
self
->
probed_srccaps
,
NULL
);
gst_caps_replace
(
&
self
->
incaps
,
NULL
);
gst_caps_replace
(
&
self
->
outcaps
,
NULL
);
...
...
@@ -537,13 +543,32 @@ gst_v4l2_transform_change_state (GstElement * element,
GstStateChange
transition
)
{
GstV4l2Transform
*
self
=
GST_V4L2_TRANSFORM
(
element
);
GstStateChangeReturn
ret
;
if
(
transition
==
GST_STATE_CHANGE_PAUSED_TO_READY
)
{
switch
(
transition
)
{
case
GST_STATE_CHANGE_NULL_TO_READY
:
if
(
!
gst_v4l2_transform_open
(
self
))
return
GST_STATE_CHANGE_FAILURE
;
break
;
case
GST_STATE_CHANGE_PAUSED_TO_READY
:
gst_v4l2_object_unlock
(
self
->
v4l2output
);
gst_v4l2_object_unlock
(
self
->
v4l2capture
);
break
;
default:
break
;
}
return
GST_ELEMENT_CLASS
(
parent_class
)
->
change_state
(
element
,
transition
);
ret
=
GST_ELEMENT_CLASS
(
parent_class
)
->
change_state
(
element
,
transition
);
switch
(
transition
)
{
case
GST_STATE_CHANGE_READY_TO_NULL
:
gst_v4l2_transform_close
(
self
);
break
;
default:
break
;
}
return
ret
;
}
static
void
...
...
@@ -619,7 +644,6 @@ gst_v4l2_transform_class_init (GstV4l2TransformClass * klass)
gobject_class
->
get_property
=
GST_DEBUG_FUNCPTR
(
gst_v4l2_transform_get_property
);
base_transform_class
->
start
=
GST_DEBUG_FUNCPTR
(
gst_v4l2_transform_start
);
base_transform_class
->
stop
=
GST_DEBUG_FUNCPTR
(
gst_v4l2_transform_stop
);
base_transform_class
->
set_caps
=
GST_DEBUG_FUNCPTR
(
gst_v4l2_transform_set_caps
);
...
...
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