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
gst-plugins-good
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
Marc-André Lureau
gst-plugins-good
Commits
e310ee82
Commit
e310ee82
authored
Mar 27, 2012
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caps: improve caps handling
Avoid caps copy and leaks
parent
8f52f8c5
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
71 additions
and
71 deletions
+71
-71
gst/avi/gstavimux.c
gst/avi/gstavimux.c
+1
-1
gst/imagefreeze/gstimagefreeze.c
gst/imagefreeze/gstimagefreeze.c
+0
-2
gst/law/alaw-encode.c
gst/law/alaw-encode.c
+2
-1
gst/law/mulaw-encode.c
gst/law/mulaw-encode.c
+2
-1
gst/matroska/matroska-demux.c
gst/matroska/matroska-demux.c
+4
-7
gst/rtp/gstasteriskh263.c
gst/rtp/gstasteriskh263.c
+1
-2
gst/rtp/gstrtpL16pay.c
gst/rtp/gstrtpL16pay.c
+3
-2
gst/rtp/gstrtpbvpay.c
gst/rtp/gstrtpbvpay.c
+3
-2
gst/rtp/gstrtpceltpay.c
gst/rtp/gstrtpceltpay.c
+9
-4
gst/rtp/gstrtpg722pay.c
gst/rtp/gstrtpg722pay.c
+2
-1
gst/rtp/gstrtph263ppay.c
gst/rtp/gstrtph263ppay.c
+5
-5
gst/rtp/gstrtpilbcpay.c
gst/rtp/gstrtpilbcpay.c
+2
-1
gst/rtp/gstrtpspeexpay.c
gst/rtp/gstrtpspeexpay.c
+7
-3
gst/shapewipe/gstshapewipe.c
gst/shapewipe/gstshapewipe.c
+17
-17
gst/smpte/gstsmpte.c
gst/smpte/gstsmpte.c
+2
-1
sys/oss/gstosssink.c
sys/oss/gstosssink.c
+3
-4
sys/v4l2/gstv4l2sink.c
sys/v4l2/gstv4l2sink.c
+1
-3
sys/v4l2/gstv4l2src.c
sys/v4l2/gstv4l2src.c
+1
-4
sys/ximage/gstximagesrc.c
sys/ximage/gstximagesrc.c
+2
-6
tests/check/elements/qtmux.c
tests/check/elements/qtmux.c
+4
-4
No files found.
gst/avi/gstavimux.c
View file @
e310ee82
...
...
@@ -1701,7 +1701,7 @@ gst_avi_mux_start_file (GstAviMux * avimux)
}
}
caps
=
gst_
caps_copy
(
gst_pad_get_pad_template_caps
(
avimux
->
srcpad
)
);
caps
=
gst_
pad_get_pad_template_caps
(
avimux
->
srcpad
);
gst_pad_set_caps
(
avimux
->
srcpad
,
caps
);
gst_caps_unref
(
caps
);
...
...
gst/imagefreeze/gstimagefreeze.c
View file @
e310ee82
...
...
@@ -273,8 +273,6 @@ gst_image_freeze_sink_getcaps (GstImageFreeze * self, GstCaps * filter)
pad
=
self
->
sinkpad
;
if
(
gst_pad_has_current_caps
(
pad
))
{
ret
=
gst_pad_get_current_caps
(
pad
);
gst_caps_replace
(
&
ret
,
gst_caps_copy
(
ret
));
gst_caps_unref
(
ret
);
goto
done
;
}
...
...
gst/law/alaw-encode.c
View file @
e310ee82
...
...
@@ -403,7 +403,8 @@ gst_alaw_enc_setcaps (GstALawEnc * alawenc, GstCaps * caps)
gst_structure_get_int
(
structure
,
"channels"
,
&
alawenc
->
channels
);
gst_structure_get_int
(
structure
,
"rate"
,
&
alawenc
->
rate
);
base_caps
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
alawenc
->
srcpad
));
base_caps
=
gst_pad_get_pad_template_caps
(
alawenc
->
srcpad
);
base_caps
=
gst_caps_make_writable
(
base_caps
);
structure
=
gst_caps_get_structure
(
base_caps
,
0
);
gst_structure_set
(
structure
,
"rate"
,
G_TYPE_INT
,
alawenc
->
rate
,
NULL
);
gst_structure_set
(
structure
,
"channels"
,
G_TYPE_INT
,
alawenc
->
channels
,
...
...
gst/law/mulaw-encode.c
View file @
e310ee82
...
...
@@ -159,7 +159,8 @@ mulawenc_setcaps (GstMuLawEnc * mulawenc, GstCaps * caps)
gst_structure_get_int
(
structure
,
"channels"
,
&
mulawenc
->
channels
);
gst_structure_get_int
(
structure
,
"rate"
,
&
mulawenc
->
rate
);
base_caps
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
mulawenc
->
srcpad
));
base_caps
=
gst_pad_get_pad_template_caps
(
mulawenc
->
srcpad
);
base_caps
=
gst_caps_make_writable
(
base_caps
);
structure
=
gst_caps_get_structure
(
base_caps
,
0
);
gst_structure_set
(
structure
,
"rate"
,
G_TYPE_INT
,
mulawenc
->
rate
,
NULL
);
...
...
gst/matroska/matroska-demux.c
View file @
e310ee82
...
...
@@ -3000,20 +3000,17 @@ gst_matroska_demux_check_aac (GstElement * element,
size
=
gst_buffer_get_size
(
*
buf
);
if
(
size
>
2
&&
data
[
0
]
==
0xff
&&
(
data
[
1
]
>>
4
==
0x0f
))
{
GstCaps
*
new_caps
;
GstStructure
*
s
;
/* tss, ADTS data, remove codec_data
* still assume it is at least parsed */
new_caps
=
gst_caps_copy
(
stream
->
caps
);
s
=
gst_caps_get_structure
(
new_
caps
,
0
);
stream
->
caps
=
gst_caps_make_writable
(
stream
->
caps
);
s
=
gst_caps_get_structure
(
stream
->
caps
,
0
);
g_assert
(
s
);
gst_structure_remove_field
(
s
,
"codec_data"
);
gst_caps_replace
(
&
stream
->
caps
,
new_caps
);
gst_pad_set_caps
(
stream
->
pad
,
new_caps
);
gst_pad_set_caps
(
stream
->
pad
,
stream
->
caps
);
GST_DEBUG_OBJECT
(
element
,
"ADTS AAC audio data; removing codec-data, "
"new caps: %"
GST_PTR_FORMAT
,
new_caps
);
gst_caps_unref
(
new_caps
);
"new caps: %"
GST_PTR_FORMAT
,
stream
->
caps
);
}
/* disable subsequent checking */
...
...
gst/rtp/gstasteriskh263.c
View file @
e310ee82
...
...
@@ -175,8 +175,7 @@ gst_asteriskh263_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
if
(
!
gst_pad_has_current_caps
(
asteriskh263
->
srcpad
))
{
GstCaps
*
caps
;
caps
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
asteriskh263
->
srcpad
));
caps
=
gst_pad_get_pad_template_caps
(
asteriskh263
->
srcpad
);
gst_pad_set_caps
(
asteriskh263
->
srcpad
,
caps
);
gst_caps_unref
(
caps
);
}
...
...
gst/rtp/gstrtpL16pay.c
View file @
e310ee82
...
...
@@ -176,9 +176,9 @@ gst_rtp_L16_pay_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad,
GstCaps
*
otherpadcaps
;
GstCaps
*
caps
;
otherpadcaps
=
gst_pad_get_allowed_caps
(
rtppayload
->
srcpad
);
caps
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
pad
));
caps
=
gst_pad_get_pad_template_caps
(
pad
);
otherpadcaps
=
gst_pad_get_allowed_caps
(
rtppayload
->
srcpad
);
if
(
otherpadcaps
)
{
if
(
!
gst_caps_is_empty
(
otherpadcaps
))
{
GstStructure
*
structure
;
...
...
@@ -187,6 +187,7 @@ gst_rtp_L16_pay_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad,
gint
rate
;
structure
=
gst_caps_get_structure
(
otherpadcaps
,
0
);
caps
=
gst_caps_make_writable
(
caps
);
if
(
gst_structure_get_int
(
structure
,
"channels"
,
&
channels
))
{
gst_caps_set_simple
(
caps
,
"channels"
,
G_TYPE_INT
,
channels
,
NULL
);
...
...
gst/rtp/gstrtpbvpay.c
View file @
e310ee82
...
...
@@ -179,9 +179,9 @@ gst_rtp_bv_pay_sink_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad,
GstCaps
*
otherpadcaps
;
GstCaps
*
caps
;
otherpadcaps
=
gst_pad_get_allowed_caps
(
rtppayload
->
srcpad
);
caps
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
pad
));
caps
=
gst_pad_get_pad_template_caps
(
pad
);
otherpadcaps
=
gst_pad_get_allowed_caps
(
rtppayload
->
srcpad
);
if
(
otherpadcaps
)
{
if
(
!
gst_caps_is_empty
(
otherpadcaps
))
{
GstStructure
*
structure
;
...
...
@@ -201,6 +201,7 @@ gst_rtp_bv_pay_sink_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad,
mode
=
-
1
;
if
(
mode
==
16
||
mode
==
32
)
{
caps
=
gst_caps_make_writable
(
caps
);
structure
=
gst_caps_get_structure
(
caps
,
0
);
gst_structure_set
(
structure
,
"mode"
,
G_TYPE_INT
,
mode
,
NULL
);
}
...
...
gst/rtp/gstrtpceltpay.c
View file @
e310ee82
...
...
@@ -164,15 +164,20 @@ gst_rtp_celt_pay_getcaps (GstRTPBasePayload * payload, GstPad * pad,
GstCaps
*
caps
;
const
gchar
*
params
;
otherpadcaps
=
gst_pad_get_allowed_caps
(
payload
->
srcpad
);
caps
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
pad
));
caps
=
gst_pad_get_pad_template_caps
(
pad
);
otherpadcaps
=
gst_pad_get_allowed_caps
(
payload
->
srcpad
);
if
(
otherpadcaps
)
{
if
(
!
gst_caps_is_empty
(
otherpadcaps
))
{
GstStructure
*
ps
=
gst_caps_get_structure
(
otherpadcaps
,
0
)
;
GstStructure
*
s
=
gst_caps_get_structure
(
caps
,
0
)
;
GstStructure
*
ps
;
GstStructure
*
s
;
gint
clock_rate
=
0
,
frame_size
=
0
,
channels
=
1
;
caps
=
gst_caps_make_writable
(
caps
);
ps
=
gst_caps_get_structure
(
otherpadcaps
,
0
);
s
=
gst_caps_get_structure
(
caps
,
0
);
if
(
gst_structure_get_int
(
ps
,
"clock-rate"
,
&
clock_rate
))
{
gst_structure_fixate_field_nearest_int
(
s
,
"rate"
,
clock_rate
);
}
...
...
gst/rtp/gstrtpg722pay.c
View file @
e310ee82
...
...
@@ -196,10 +196,11 @@ gst_rtp_g722_pay_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad,
GstCaps
*
caps
;
otherpadcaps
=
gst_pad_get_allowed_caps
(
rtppayload
->
srcpad
);
caps
=
gst_
caps_copy
(
gst_pad_get_pad_template_caps
(
pad
)
);
caps
=
gst_
pad_get_pad_template_caps
(
pad
);
if
(
otherpadcaps
)
{
if
(
!
gst_caps_is_empty
(
otherpadcaps
))
{
caps
=
gst_caps_make_writable
(
caps
);
gst_caps_set_simple
(
caps
,
"channels"
,
G_TYPE_INT
,
1
,
NULL
);
gst_caps_set_simple
(
caps
,
"rate"
,
G_TYPE_INT
,
16000
,
NULL
);
}
...
...
gst/rtp/gstrtph263ppay.c
View file @
e310ee82
...
...
@@ -235,7 +235,7 @@ gst_rtp_h263p_pay_sink_getcaps (GstRTPBasePayload * payload, GstPad * pad,
GstCaps
*
filter
)
{
GstRtpH263PPay
*
rtph263ppay
;
GstCaps
*
caps
=
NULL
;
GstCaps
*
caps
=
NULL
,
*
templ
;
GstCaps
*
peercaps
=
NULL
;
GstCaps
*
intersect
=
NULL
;
guint
i
;
...
...
@@ -246,12 +246,12 @@ gst_rtp_h263p_pay_sink_getcaps (GstRTPBasePayload * payload, GstPad * pad,
gst_pad_peer_query_caps
(
GST_RTP_BASE_PAYLOAD_SRCPAD
(
payload
),
filter
);
if
(
!
peercaps
)
return
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
GST_RTP_BASE_PAYLOAD_SINKPAD
(
payload
)));
gst_pad_get_pad_template_caps
(
GST_RTP_BASE_PAYLOAD_SINKPAD
(
payload
));
intersect
=
gst_caps_intersect
(
peercaps
,
gst_pad_get_pad_template_caps
(
GST_RTP_BASE_PAYLOAD_SRCPAD
(
payload
))
);
templ
=
gst_pad_get_pad_template_caps
(
GST_RTP_BASE_PAYLOAD_SRCPAD
(
payload
));
intersect
=
gst_caps_intersect
(
peercaps
,
templ
);
gst_caps_unref
(
peercaps
);
gst_caps_unref
(
templ
);
if
(
gst_caps_is_empty
(
intersect
))
return
intersect
;
...
...
gst/rtp/gstrtpilbcpay.c
View file @
e310ee82
...
...
@@ -183,7 +183,7 @@ gst_rtp_ilbc_pay_sink_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad,
GstCaps
*
caps
;
otherpadcaps
=
gst_pad_get_allowed_caps
(
rtppayload
->
srcpad
);
caps
=
gst_
caps_copy
(
gst_pad_get_pad_template_caps
(
pad
)
);
caps
=
gst_
pad_get_pad_template_caps
(
pad
);
if
(
otherpadcaps
)
{
if
(
!
gst_caps_is_empty
(
otherpadcaps
))
{
...
...
@@ -198,6 +198,7 @@ gst_rtp_ilbc_pay_sink_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad,
if
(
mode_str
)
{
mode
=
strtol
(
mode_str
,
NULL
,
10
);
if
(
mode
==
20
||
mode
==
30
)
{
caps
=
gst_caps_make_writable
(
caps
);
structure
=
gst_caps_get_structure
(
caps
,
0
);
gst_structure_set
(
structure
,
"mode"
,
G_TYPE_INT
,
mode
,
NULL
);
}
...
...
gst/rtp/gstrtpspeexpay.c
View file @
e310ee82
...
...
@@ -114,14 +114,18 @@ gst_rtp_speex_pay_getcaps (GstRTPBasePayload * payload, GstPad * pad,
GstCaps
*
caps
;
otherpadcaps
=
gst_pad_get_allowed_caps
(
payload
->
srcpad
);
caps
=
gst_
caps_copy
(
gst_pad_get_pad_template_caps
(
pad
)
);
caps
=
gst_
pad_get_pad_template_caps
(
pad
);
if
(
otherpadcaps
)
{
if
(
!
gst_caps_is_empty
(
otherpadcaps
))
{
GstStructure
*
ps
=
gst_caps_get_structure
(
otherpadcaps
,
0
)
;
GstStructure
*
s
=
gst_caps_get_structure
(
caps
,
0
)
;
GstStructure
*
ps
;
GstStructure
*
s
;
gint
clock_rate
;
ps
=
gst_caps_get_structure
(
otherpadcaps
,
0
);
caps
=
gst_caps_make_writable
(
caps
);
s
=
gst_caps_get_structure
(
caps
,
0
);
if
(
gst_structure_get_int
(
ps
,
"clock-rate"
,
&
clock_rate
))
{
gst_structure_fixate_field_nearest_int
(
s
,
"rate"
,
clock_rate
);
}
...
...
gst/shapewipe/gstshapewipe.c
View file @
e310ee82
...
...
@@ -327,17 +327,19 @@ static GstCaps *
gst_shape_wipe_video_sink_getcaps
(
GstPad
*
pad
,
GstCaps
*
filter
)
{
GstShapeWipe
*
self
=
GST_SHAPE_WIPE
(
gst_pad_get_parent
(
pad
));
GstCaps
*
ret
,
*
tmp
;
GstCaps
*
templ
,
*
ret
,
*
tmp
;
if
(
gst_pad_has_current_caps
(
pad
))
return
gst_pad_get_current_caps
(
pad
);
templ
=
gst_pad_get_pad_template_caps
(
pad
);
tmp
=
gst_pad_peer_query_caps
(
self
->
srcpad
,
NULL
);
if
(
tmp
)
{
ret
=
gst_caps_intersect
(
tmp
,
gst_pad_get_pad_template_caps
(
pad
));
ret
=
gst_caps_intersect
(
tmp
,
templ
);
gst_caps_unref
(
templ
);
gst_caps_unref
(
tmp
);
}
else
{
ret
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
pad
))
;
ret
=
templ
;
}
GST_LOG_OBJECT
(
pad
,
"srcpad accepted caps: %"
GST_PTR_FORMAT
,
ret
);
...
...
@@ -365,6 +367,7 @@ gst_shape_wipe_video_sink_getcaps (GstPad * pad, GstCaps * filter)
if
(
self
->
vinfo
.
height
&&
self
->
vinfo
.
width
)
{
guint
i
,
n
;
ret
=
gst_caps_make_writable
(
ret
);
n
=
gst_caps_get_size
(
ret
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
GstStructure
*
s
=
gst_caps_get_structure
(
ret
,
i
);
...
...
@@ -381,15 +384,13 @@ gst_shape_wipe_video_sink_getcaps (GstPad * pad, GstCaps * filter)
GstCaps
*
intersection
,
*
tmp2
;
guint
i
,
n
;
tmp
=
gst_caps_make_writable
(
tmp
);
tmp2
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
self
->
mask_sinkpad
));
tmp2
=
gst_pad_get_pad_template_caps
(
self
->
mask_sinkpad
);
intersection
=
gst_caps_intersect
(
tmp
,
tmp2
);
gst_caps_unref
(
tmp
);
gst_caps_unref
(
tmp2
);
tmp
=
intersection
;
tmp
=
gst_caps_make_writable
(
tmp
);
n
=
gst_caps_get_size
(
tmp
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
...
...
@@ -463,7 +464,7 @@ gst_shape_wipe_mask_sink_getcaps (GstPad * pad, GstCaps * filter)
gst_pad_get_pad_template_caps
(
self
->
video_sinkpad
));
gst_caps_unref
(
tmp
);
}
else
{
ret
=
gst_
caps_copy
(
gst_pad_get_pad_template_caps
(
self
->
video_sinkpad
)
);
ret
=
gst_
pad_get_pad_template_caps
(
self
->
video_sinkpad
);
}
GST_LOG_OBJECT
(
pad
,
"video sink accepted caps: %"
GST_PTR_FORMAT
,
ret
);
...
...
@@ -536,21 +537,21 @@ static GstCaps *
gst_shape_wipe_src_getcaps
(
GstPad
*
pad
,
GstCaps
*
filter
)
{
GstShapeWipe
*
self
=
GST_SHAPE_WIPE
(
gst_pad_get_parent
(
pad
));
GstCaps
*
ret
,
*
tmp
;
GstCaps
*
templ
,
*
ret
,
*
tmp
;
if
(
gst_pad_has_current_caps
(
pad
))
return
gst_pad_get_current_caps
(
pad
);
else
if
(
gst_pad_has_current_caps
(
self
->
video_sinkpad
))
return
gst_pad_get_current_caps
(
self
->
video_sinkpad
);
templ
=
gst_pad_get_pad_template_caps
(
self
->
video_sinkpad
);
tmp
=
gst_pad_peer_query_caps
(
self
->
video_sinkpad
,
NULL
);
if
(
tmp
)
{
ret
=
gst_caps_intersect
(
tmp
,
gst_pad_get_pad_template_caps
(
self
->
video_sinkpad
));
ret
=
gst_caps_intersect
(
tmp
,
templ
);
gst_caps_unref
(
templ
);
gst_caps_unref
(
tmp
);
}
else
{
ret
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
self
->
video_sinkpad
))
;
ret
=
templ
;
}
GST_LOG_OBJECT
(
pad
,
"video sink accepted caps: %"
GST_PTR_FORMAT
,
ret
);
...
...
@@ -577,6 +578,7 @@ gst_shape_wipe_src_getcaps (GstPad * pad, GstCaps * filter)
if
(
self
->
vinfo
.
height
&&
self
->
vinfo
.
width
)
{
guint
i
,
n
;
ret
=
gst_caps_make_writable
(
ret
);
n
=
gst_caps_get_size
(
ret
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
GstStructure
*
s
=
gst_caps_get_structure
(
ret
,
i
);
...
...
@@ -592,14 +594,12 @@ gst_shape_wipe_src_getcaps (GstPad * pad, GstCaps * filter)
GstCaps
*
intersection
,
*
tmp2
;
guint
i
,
n
;
tmp
=
gst_caps_make_writable
(
tmp
);
tmp2
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
self
->
mask_sinkpad
));
tmp2
=
gst_pad_get_pad_template_caps
(
self
->
mask_sinkpad
);
intersection
=
gst_caps_intersect
(
tmp
,
tmp2
);
gst_caps_unref
(
tmp
);
gst_caps_unref
(
tmp2
);
tmp
=
intersection
;
tmp
=
gst_caps_make_writable
(
intersection
)
;
n
=
gst_caps_get_size
(
tmp
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
...
...
gst/smpte/gstsmpte.c
View file @
e310ee82
...
...
@@ -545,13 +545,14 @@ gst_smpte_collected (GstCollectPads2 * pads, GstSMPTE * smpte)
GstSegment
segment
;
caps
=
gst_caps_
copy
(
gst_static_caps_get
gst_caps_
make_writable
(
gst_static_caps_get
(
&
gst_smpte_src_template
.
static_caps
));
gst_caps_set_simple
(
caps
,
"width"
,
G_TYPE_INT
,
smpte
->
width
,
"height"
,
G_TYPE_INT
,
smpte
->
height
,
"framerate"
,
GST_TYPE_FRACTION
,
smpte
->
fps_num
,
smpte
->
fps_denom
,
NULL
);
gst_pad_set_caps
(
smpte
->
srcpad
,
caps
);
gst_caps_unref
(
caps
);
gst_segment_init
(
&
segment
,
GST_FORMAT_TIME
);
gst_pad_push_event
(
smpte
->
srcpad
,
gst_event_new_segment
(
&
segment
));
...
...
sys/oss/gstosssink.c
View file @
e310ee82
...
...
@@ -294,14 +294,13 @@ gst_oss_sink_getcaps (GstBaseSink * bsink)
osssink
=
GST_OSSSINK
(
bsink
);
if
(
osssink
->
fd
==
-
1
)
{
caps
=
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
GST_BASE_SINK_PAD
(
bsink
)));
caps
=
gst_pad_get_pad_template_caps
(
GST_BASE_SINK_PAD
(
bsink
));
}
else
if
(
osssink
->
probed_caps
)
{
caps
=
gst_caps_
copy
(
osssink
->
probed_caps
);
caps
=
gst_caps_
ref
(
osssink
->
probed_caps
);
}
else
{
caps
=
gst_oss_helper_probe_caps
(
osssink
->
fd
);
if
(
caps
&&
!
gst_caps_is_empty
(
caps
))
{
osssink
->
probed_caps
=
gst_caps_
copy
(
caps
);
osssink
->
probed_caps
=
gst_caps_
ref
(
caps
);
}
}
...
...
sys/v4l2/gstv4l2sink.c
View file @
e310ee82
...
...
@@ -513,9 +513,7 @@ gst_v4l2sink_get_caps (GstBaseSink * bsink, GstCaps * filter)
if
(
!
GST_V4L2_IS_OPEN
(
v4l2sink
->
v4l2object
))
{
/* FIXME: copy? */
GST_DEBUG_OBJECT
(
v4l2sink
,
"device is not open"
);
return
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
GST_BASE_SINK_PAD
(
v4l2sink
)));
return
gst_pad_get_pad_template_caps
(
GST_BASE_SINK_PAD
(
v4l2sink
));
}
if
(
v4l2sink
->
probed_caps
==
NULL
)
{
...
...
sys/v4l2/gstv4l2src.c
View file @
e310ee82
...
...
@@ -442,10 +442,7 @@ gst_v4l2src_get_caps (GstBaseSrc * src, GstCaps * filter)
obj
=
v4l2src
->
v4l2object
;
if
(
!
GST_V4L2_IS_OPEN
(
obj
))
{
/* FIXME: copy? */
return
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
GST_BASE_SRC_PAD
(
v4l2src
)));
return
gst_pad_get_pad_template_caps
(
GST_BASE_SRC_PAD
(
v4l2src
));
}
if
(
v4l2src
->
probed_caps
)
...
...
sys/ximage/gstximagesrc.c
View file @
e310ee82
...
...
@@ -1022,14 +1022,10 @@ gst_ximage_src_get_caps (GstBaseSrc * bs, GstCaps * filter)
GstVideoFormat
format
;
if
((
!
s
->
xcontext
)
&&
(
!
gst_ximage_src_open_display
(
s
,
s
->
display_name
)))
return
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
GST_BASE_SRC
(
s
)
->
srcpad
));
return
gst_pad_get_pad_template_caps
(
GST_BASE_SRC
(
s
)
->
srcpad
);
if
(
!
gst_ximage_src_recalc
(
s
))
return
gst_caps_copy
(
gst_pad_get_pad_template_caps
(
GST_BASE_SRC
(
s
)
->
srcpad
));
return
gst_pad_get_pad_template_caps
(
GST_BASE_SRC
(
s
)
->
srcpad
);
xcontext
=
s
->
xcontext
;
width
=
s
->
xcontext
->
width
;
...
...
tests/check/elements/qtmux.c
View file @
e310ee82
...
...
@@ -208,7 +208,7 @@ check_qtmux_pad (GstStaticPadTemplate * srctemplate, const gchar * sinkname,
fail_unless
(
gst_pad_push_event
(
mysrcpad
,
gst_event_new_segment
(
&
segment
)));
inbuffer
=
gst_buffer_new_and_alloc
(
1
);
caps
=
gst_
caps_copy
(
gst_pad_get_pad_template_caps
(
mysrcpad
)
);
caps
=
gst_
pad_get_pad_template_caps
(
mysrcpad
);
gst_pad_set_caps
(
mysrcpad
,
caps
);
gst_caps_unref
(
caps
);
GST_BUFFER_TIMESTAMP
(
inbuffer
)
=
0
;
...
...
@@ -296,7 +296,7 @@ check_qtmux_pad_fragmented (GstStaticPadTemplate * srctemplate,
fail_unless
(
gst_pad_push_event
(
mysrcpad
,
gst_event_new_segment
(
&
segment
)));
inbuffer
=
gst_buffer_new_and_alloc
(
1
);
caps
=
gst_
caps_copy
(
gst_pad_get_pad_template_caps
(
mysrcpad
)
);
caps
=
gst_
pad_get_pad_template_caps
(
mysrcpad
);
gst_pad_set_caps
(
mysrcpad
,
caps
);
gst_caps_unref
(
caps
);
GST_BUFFER_TIMESTAMP
(
inbuffer
)
=
0
;
...
...
@@ -526,7 +526,7 @@ GST_START_TEST (test_reuse)
inbuffer
=
gst_buffer_new_and_alloc
(
1
);
fail_unless
(
inbuffer
!=
NULL
);
caps
=
gst_
caps_copy
(
gst_pad_get_pad_template_caps
(
mysrcpad
)
);
caps
=
gst_
pad_get_pad_template_caps
(
mysrcpad
);
gst_pad_set_caps
(
mysrcpad
,
caps
);
gst_caps_unref
(
caps
);
GST_BUFFER_TIMESTAMP
(
inbuffer
)
=
0
;
...
...
@@ -817,7 +817,7 @@ test_average_bitrate_custom (const gchar * elementname,
for
(
i
=
0
;
i
<
3
;
i
++
)
{
inbuffer
=
gst_buffer_new_and_alloc
(
bytes
[
i
]);
caps
=
gst_
caps_copy
(
gst_pad_get_pad_template_caps
(
mysrcpad
)
);
caps
=
gst_
pad_get_pad_template_caps
(
mysrcpad
);
gst_pad_set_caps
(
mysrcpad
,
caps
);
gst_caps_unref
(
caps
);
GST_BUFFER_TIMESTAMP
(
inbuffer
)
=
total_duration
;
...
...
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