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
195d1818
Commit
195d1818
authored
Jun 06, 2016
by
Stian Selnes
Committed by
Olivier Crête
Aug 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vp9enc: Fix leak of vpx_image_t
parent
5f3b570d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
1 deletion
+85
-1
ext/vpx/gstvp9enc.c
ext/vpx/gstvp9enc.c
+8
-0
tests/check/Makefile.am
tests/check/Makefile.am
+1
-1
tests/check/elements/vp9enc.c
tests/check/elements/vp9enc.c
+76
-0
No files found.
ext/vpx/gstvp9enc.c
View file @
195d1818
...
...
@@ -234,10 +234,18 @@ gst_vp9_enc_handle_invisible_frame_buffer (GstVPXEnc * enc, void *user_data,
return
ret
;
}
static
void
gst_vp9_enc_user_data_free
(
vpx_image_t
*
image
)
{
g_slice_free
(
vpx_image_t
,
image
);
}
static
void
gst_vp9_enc_set_frame_user_data
(
GstVPXEnc
*
enc
,
GstVideoCodecFrame
*
frame
,
vpx_image_t
*
image
)
{
gst_video_codec_frame_set_user_data
(
frame
,
image
,
(
GDestroyNotify
)
gst_vp9_enc_user_data_free
);
return
;
}
...
...
tests/check/Makefile.am
View file @
195d1818
...
...
@@ -308,7 +308,7 @@ check_videomixer =
endif
if
USE_VPX
check_vpx
=
elements/vp8enc elements/vp8dec
check_vpx
=
elements/vp8enc elements/vp8dec
elements/vp9enc
else
check_vpx
=
endif
...
...
tests/check/elements/vp9enc.c
0 → 100644
View file @
195d1818
/* GStreamer
*
* Copyright (c) 2016 Stian Selnes <stian@pexip.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <gst/check/gstharness.h>
#include <gst/check/gstcheck.h>
#include <gst/video/video.h>
GST_START_TEST
(
test_encode_lag_in_frames
)
{
GstHarness
*
h
=
gst_harness_new_parse
(
"vp9enc lag-in-frames=5 cpu-used=8 "
"deadline=1"
);
gst_harness_add_src_parse
(
h
,
"videotestsrc is-live=true pattern=black ! "
"capsfilter caps=
\"
video/x-raw,width=320,height=240,framerate=25/1
\"
"
,
TRUE
);
/* Push 20 buffers into the encoder */
fail_unless_equals_int
(
GST_FLOW_OK
,
gst_harness_src_crank_and_push_many
(
h
,
20
,
20
));
/* Only 5 buffers are allowed to be queued now */
fail_unless
(
gst_harness_buffers_received
(
h
)
>
15
);
/* EOS will cause the remaining buffers to be drained */
fail_unless
(
gst_harness_push_event
(
h
,
gst_event_new_eos
()));
fail_unless_equals_int
(
gst_harness_buffers_received
(
h
),
20
);
for
(
gint
i
=
0
;
i
<
20
;
i
++
)
{
GstBuffer
*
buffer
=
gst_harness_pull
(
h
);
if
(
i
==
0
)
fail_if
(
GST_BUFFER_FLAG_IS_SET
(
buffer
,
GST_BUFFER_FLAG_DELTA_UNIT
));
fail_unless_equals_uint64
(
GST_BUFFER_TIMESTAMP
(
buffer
),
gst_util_uint64_scale
(
i
,
GST_SECOND
,
25
));
fail_unless_equals_uint64
(
GST_BUFFER_DURATION
(
buffer
),
gst_util_uint64_scale
(
1
,
GST_SECOND
,
25
));
gst_buffer_unref
(
buffer
);
}
gst_harness_teardown
(
h
);
}
GST_END_TEST
;
static
Suite
*
vp9enc_suite
(
void
)
{
Suite
*
s
=
suite_create
(
"vp9enc"
);
TCase
*
tc_chain
=
tcase_create
(
"general"
);
suite_add_tcase
(
s
,
tc_chain
);
tcase_add_test
(
tc_chain
,
test_encode_lag_in_frames
);
return
s
;
}
GST_CHECK_MAIN
(
vp9enc
);
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