mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
Plug some leaks; try to make build bot happy again.
Original commit message from CVS: * gst/y4m/gsty4mencode.c: (gst_y4m_encode_init), (gst_y4m_encode_setcaps): * tests/check/elements/y4menc.c: (GST_START_TEST): Plug some leaks; try to make build bot happy again.
This commit is contained in:
parent
61a68fdaf3
commit
203ed49721
4 changed files with 20 additions and 12 deletions
|
@ -1,3 +1,10 @@
|
|||
2007-04-24 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst/y4m/gsty4mencode.c: (gst_y4m_encode_init),
|
||||
(gst_y4m_encode_setcaps):
|
||||
* tests/check/elements/y4menc.c: (GST_START_TEST):
|
||||
Plug some leaks; try to make build bot happy again.
|
||||
|
||||
2007-04-21 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst/Makefile.am:
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit 765d03a88492fb4ac81d70457f671f3a109e93de
|
||||
Subproject commit a19d235c89d99ca7849078d501129f521e30d98d
|
|
@ -109,8 +109,7 @@ static void
|
|||
gst_y4m_encode_init (GstY4mEncode * filter, GstY4mEncodeClass * klass)
|
||||
{
|
||||
filter->sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get
|
||||
(&y4mencode_sink_factory), "sink");
|
||||
gst_pad_new_from_static_template (&y4mencode_sink_factory, "sink");
|
||||
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
|
||||
gst_pad_set_chain_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_y4m_encode_chain));
|
||||
|
@ -118,8 +117,7 @@ gst_y4m_encode_init (GstY4mEncode * filter, GstY4mEncodeClass * klass)
|
|||
GST_DEBUG_FUNCPTR (gst_y4m_encode_setcaps));
|
||||
|
||||
filter->srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get
|
||||
(&y4mencode_src_factory), "src");
|
||||
gst_pad_new_from_static_template (&y4mencode_src_factory, "src");
|
||||
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
|
||||
gst_pad_use_fixed_caps (filter->srcpad);
|
||||
|
||||
|
@ -140,6 +138,7 @@ gst_y4m_encode_setcaps (GstPad * pad, GstCaps * vscaps)
|
|||
{
|
||||
GstY4mEncode *filter;
|
||||
GstStructure *structure;
|
||||
gboolean res;
|
||||
gint w, h;
|
||||
const GValue *fps, *par;
|
||||
|
||||
|
@ -147,11 +146,13 @@ gst_y4m_encode_setcaps (GstPad * pad, GstCaps * vscaps)
|
|||
|
||||
structure = gst_caps_get_structure (vscaps, 0);
|
||||
|
||||
g_return_val_if_fail (gst_structure_get_int (structure, "width", &w), FALSE);
|
||||
g_return_val_if_fail (gst_structure_get_int (structure, "height", &h), FALSE);
|
||||
fps = gst_structure_get_value (structure, "framerate");
|
||||
g_return_val_if_fail (w > 0 && h > 0
|
||||
&& fps != NULL && GST_VALUE_HOLDS_FRACTION (fps), FALSE);
|
||||
res = gst_structure_get_int (structure, "width", &w);
|
||||
res &= gst_structure_get_int (structure, "height", &h);
|
||||
res &= ((fps = gst_structure_get_value (structure, "framerate")) != NULL);
|
||||
|
||||
if (!res || w <= 0 || h <= 0 || !GST_VALUE_HOLDS_FRACTION (fps))
|
||||
return FALSE;
|
||||
|
||||
/* optional par info */
|
||||
par = gst_structure_get_value (structure, "pixel-aspect-ratio");
|
||||
|
||||
|
@ -169,7 +170,7 @@ gst_y4m_encode_setcaps (GstPad * pad, GstCaps * vscaps)
|
|||
|
||||
/* the template caps will do for the src pad, should always accept */
|
||||
return gst_pad_set_caps (filter->srcpad,
|
||||
gst_caps_copy (gst_pad_get_pad_template_caps (filter->srcpad)));
|
||||
gst_static_pad_template_get_caps (&y4mencode_src_factory));
|
||||
}
|
||||
|
||||
static inline GstBuffer *
|
||||
|
|
|
@ -115,7 +115,7 @@ GST_START_TEST (test_y4m)
|
|||
case 0:
|
||||
fail_unless (strlen (data0) == 40);
|
||||
fail_unless (GST_BUFFER_SIZE (outbuffer) == size + 40);
|
||||
fail_unless (strncmp (data0, GST_BUFFER_DATA (outbuffer),
|
||||
fail_unless (memcmp (data0, GST_BUFFER_DATA (outbuffer),
|
||||
strlen (data0)) == 0);
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue