Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
d7dc1dec
Commit
d7dc1dec
authored
May 18, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted transcode to vlc_clone().
parent
f2dda725
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
19 deletions
+15
-19
modules/stream_out/transcode/transcode.c
modules/stream_out/transcode/transcode.c
+2
-5
modules/stream_out/transcode/transcode.h
modules/stream_out/transcode/transcode.h
+2
-2
modules/stream_out/transcode/video.c
modules/stream_out/transcode/video.c
+11
-12
No files found.
modules/stream_out/transcode/transcode.c
View file @
d7dc1dec
...
...
@@ -253,15 +253,12 @@ static int Open( vlc_object_t *p_this )
sout_stream_sys_t
*
p_sys
;
char
*
psz_string
;
p_sys
=
vlc_object_create
(
p_this
,
sizeof
(
sout_stream_sys_t
)
);
if
(
!
p_stream
->
p_next
)
{
msg_Err
(
p_stream
,
"cannot create chain"
);
vlc_object_release
(
p_sys
);
return
VLC_EGENERIC
;
}
p_sys
=
calloc
(
1
,
sizeof
(
*
p_sys
)
);
p_sys
->
i_master_drift
=
0
;
config_ChainParse
(
p_stream
,
SOUT_CFG_PREFIX
,
ppsz_sout_options
,
...
...
@@ -507,7 +504,7 @@ static void Close( vlc_object_t * p_this )
config_ChainDestroy
(
p_sys
->
p_osd_cfg
);
free
(
p_sys
->
psz_osdenc
);
vlc_object_releas
e
(
p_sys
);
fre
e
(
p_sys
);
}
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es_format_t
*
p_fmt
)
...
...
modules/stream_out/transcode/transcode.h
View file @
d7dc1dec
...
...
@@ -17,14 +17,14 @@
struct
sout_stream_sys_t
{
VLC_COMMON_MEMBERS
sout_stream_id_t
*
id_video
;
block_t
*
p_buffers
;
vlc_mutex_t
lock_out
;
vlc_cond_t
cond
;
bool
b_abort
;
picture_t
*
pp_pics
[
PICTURE_RING_SIZE
];
int
i_first_pic
,
i_last_pic
;
vlc_thread_t
thread
;
/* Audio */
vlc_fourcc_t
i_acodec
;
/* codec audio (0 if not transcode) */
...
...
modules/stream_out/transcode/video.c
View file @
d7dc1dec
...
...
@@ -125,24 +125,22 @@ static void transcode_video_filter_allocation_clear( filter_t *p_filter )
VLC_UNUSED
(
p_filter
);
}
static
void
*
EncoderThread
(
v
lc_object_t
*
p_this
)
static
void
*
EncoderThread
(
v
oid
*
obj
)
{
sout_stream_sys_t
*
p_sys
=
(
sout_stream_sys_t
*
)
p_this
;
sout_stream_sys_t
*
p_sys
=
(
sout_stream_sys_t
*
)
obj
;
sout_stream_id_t
*
id
=
p_sys
->
id_video
;
picture_t
*
p_pic
;
int
canc
=
vlc_savecancel
();
while
(
vlc_object_alive
(
p_sys
)
)
for
(
;;
)
{
block_t
*
p_block
;
vlc_mutex_lock
(
&
p_sys
->
lock_out
);
while
(
p_sys
->
i_last_pic
==
p_sys
->
i_first_pic
)
{
while
(
!
p_sys
->
b_abort
&&
p_sys
->
i_last_pic
==
p_sys
->
i_first_pic
)
vlc_cond_wait
(
&
p_sys
->
cond
,
&
p_sys
->
lock_out
);
if
(
!
vlc_object_alive
(
p_sys
)
)
break
;
}
if
(
!
vlc_object_alive
(
p_sys
)
)
if
(
p_sys
->
b_abort
)
{
vlc_mutex_unlock
(
&
p_sys
->
lock_out
);
break
;
...
...
@@ -274,8 +272,8 @@ int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_t *id )
p_sys
->
i_first_pic
=
0
;
p_sys
->
i_last_pic
=
0
;
p_sys
->
p_buffers
=
NULL
;
p_sys
->
b_
die
=
0
;
if
(
vlc_
thread_create
(
p_sys
,
EncoderThread
,
i_priority
)
)
p_sys
->
b_
abort
=
0
;
if
(
vlc_
clone
(
&
p_sys
->
thread
,
EncoderThread
,
p_sys
,
i_priority
)
)
{
msg_Err
(
p_stream
,
"cannot spawn encoder thread"
);
module_unneed
(
id
->
p_decoder
,
id
->
p_decoder
->
p_module
);
...
...
@@ -564,10 +562,11 @@ void transcode_video_close( sout_stream_t *p_stream,
if
(
p_stream
->
p_sys
->
i_threads
>=
1
)
{
vlc_mutex_lock
(
&
p_stream
->
p_sys
->
lock_out
);
vlc_object_kill
(
p_stream
->
p_sys
)
;
p_stream
->
p_sys
->
b_abort
=
true
;
vlc_cond_signal
(
&
p_stream
->
p_sys
->
cond
);
vlc_mutex_unlock
(
&
p_stream
->
p_sys
->
lock_out
);
vlc_thread_join
(
p_stream
->
p_sys
);
vlc_join
(
p_stream
->
p_sys
->
thread
,
NULL
);
vlc_mutex_destroy
(
&
p_stream
->
p_sys
->
lock_out
);
vlc_cond_destroy
(
&
p_stream
->
p_sys
->
cond
);
}
...
...
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