Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Seungha Yang
gst-plugins-bad
Commits
002c8405
Commit
002c8405
authored
Dec 05, 2018
by
Seungha Yang
🐑
Browse files
nvenc: Do not access user_data of GstVideoCodecFrame directly
Use gst_video_codec_frame_set_user_data() instead
parent
f61bbccb
Changes
1
Hide whitespace changes
Inline
Side-by-side
sys/nvcodec/gstnvbaseenc.c
View file @
002c8405
...
...
@@ -695,7 +695,7 @@ _find_frame_with_output_buffer (GstNvBaseEnc * nvenc, NV_ENC_OUTPUT_PTR out_buf)
for
(
l
=
walk
;
l
;
l
=
l
->
next
)
{
GstVideoCodecFrame
*
frame
=
(
GstVideoCodecFrame
*
)
l
->
data
;
NvBaseEncFrameState
*
state
=
frame
->
user_data
;
NvBaseEncFrameState
*
state
=
gst_video_codec_frame_get_
user_data
(
frame
)
;
if
(
!
state
)
continue
;
...
...
@@ -789,7 +789,7 @@ gst_nv_base_enc_bitstream_thread (gpointer user_data)
g_assert
(
frame
==
tmp_frame
);
frame
=
tmp_frame
;
state
=
frame
->
user_data
;
state
=
gst_video_codec_frame_get_
user_data
(
frame
)
;
g_assert
(
state
->
out_bufs
[
i
]
==
out_buf
);
/* copy into output buffer */
...
...
@@ -1720,9 +1720,7 @@ gst_nv_base_enc_handle_frame (GstVideoEncoder * enc, GstVideoCodecFrame * frame)
if
(
input_buffer
==
NULL
)
goto
error
;
state
=
frame
->
user_data
;
if
(
!
state
)
state
=
g_new0
(
NvBaseEncFrameState
,
1
);
state
=
g_new0
(
NvBaseEncFrameState
,
1
);
state
->
n_buffers
=
1
;
#if HAVE_NVENC_GST_GL
...
...
@@ -1768,8 +1766,7 @@ gst_nv_base_enc_handle_frame (GstVideoEncoder * enc, GstVideoCodecFrame * frame)
state
->
in_bufs
[
frame_n
]
=
in_gl_resource
;
state
->
out_bufs
[
frame_n
++
]
=
out_buf
;
frame
->
user_data
=
state
;
frame
->
user_data_destroy_notify
=
(
GDestroyNotify
)
g_free
;
gst_video_codec_frame_set_user_data
(
frame
,
state
,
(
GDestroyNotify
)
g_free
);
flow
=
_submit_input_buffer
(
nvenc
,
frame
,
&
vframe
,
in_gl_resource
,
...
...
@@ -1878,8 +1875,7 @@ gst_nv_base_enc_handle_frame (GstVideoEncoder * enc, GstVideoCodecFrame * frame)
state
->
in_bufs
[
frame_n
]
=
in_buf
;
state
->
out_bufs
[
frame_n
++
]
=
out_buf
;
frame
->
user_data
=
state
;
frame
->
user_data_destroy_notify
=
(
GDestroyNotify
)
g_free
;
gst_video_codec_frame_set_user_data
(
frame
,
state
,
(
GDestroyNotify
)
g_free
);
flow
=
_submit_input_buffer
(
nvenc
,
frame
,
&
vframe
,
in_buf
,
in_buf
,
...
...
Write
Preview
Supports
Markdown
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