[vlc-commits] [Git][videolan/vlc][master] 3 commits: transcode: fix draining logs
Steve Lhomme (@robUx4)
gitlab at videolan.org
Tue Aug 22 08:05:12 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
a6e13571 by Steve Lhomme at 2023-08-22T07:30:21+00:00
transcode: fix draining logs
- - - - -
b2acbeab by Steve Lhomme at 2023-08-22T07:30:21+00:00
transcode: flush video filters on Flush
- - - - -
af8f2e02 by Steve Lhomme at 2023-08-22T07:30:21+00:00
bridge: flush the video filter on flush
- - - - -
4 changed files:
- modules/stream_out/mosaic_bridge.c
- modules/stream_out/transcode/transcode.c
- modules/stream_out/transcode/transcode.h
- modules/stream_out/transcode/video.c
Changes:
=====================================
modules/stream_out/mosaic_bridge.c
=====================================
@@ -185,8 +185,19 @@ static int Control(sout_stream_t *stream, int query, va_list args)
return VLC_SUCCESS;
}
+static void Flush( sout_stream_t *stream, void *id)
+{
+ sout_stream_sys_t *p_sys = stream->p_sys;
+
+ if ( p_sys == (sout_stream_sys_t *)id )
+ {
+ if (p_sys->p_vf2 != NULL)
+ filter_chain_VideoFlush(p_sys->p_vf2);
+ }
+}
+
static const struct sout_stream_operations ops = {
- Add, Del, Send, Control, NULL, NULL,
+ Add, Del, Send, Control, Flush, NULL,
};
static const char *const ppsz_sout_options[] = {
=====================================
modules/stream_out/transcode/transcode.c
=====================================
@@ -378,8 +378,19 @@ static int Control( sout_stream_t *p_stream, int i_query, va_list args )
return VLC_EGENERIC;
}
+static void Flush( sout_stream_t *p_stream, void *_id)
+{
+ sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
+ enum es_format_category_e i_cat = id->b_transcode && id->p_decoder != NULL ?
+ id->p_decoder->fmt_in->i_cat : UNKNOWN_ES;
+ if( i_cat == VIDEO_ES )
+ {
+ transcode_video_flush(id);
+ }
+}
+
static const struct sout_stream_operations ops = {
- Add, Del, Send, Control, NULL, SetPCR,
+ Add, Del, Send, Control, Flush, SetPCR,
};
/*****************************************************************************
=====================================
modules/stream_out/transcode/transcode.h
=====================================
@@ -229,6 +229,7 @@ int transcode_audio_init ( sout_stream_t *, const es_format_t *,
void transcode_video_clean ( sout_stream_id_sys_t * );
int transcode_video_process( sout_stream_t *, sout_stream_id_sys_t *,
block_t *, block_t ** );
+void transcode_video_flush ( sout_stream_id_sys_t * );
int transcode_video_get_output_dimensions( sout_stream_id_sys_t *,
unsigned *w, unsigned *h );
void transcode_video_push_spu( sout_stream_t *, sout_stream_id_sys_t *, subpicture_t * );
=====================================
modules/stream_out/transcode/video.c
=====================================
@@ -395,6 +395,16 @@ static int transcode_video_filters_init( sout_stream_t *p_stream,
return VLC_SUCCESS;
}
+void transcode_video_flush( sout_stream_id_sys_t *id )
+{
+ if ( id->p_f_chain != NULL )
+ filter_chain_VideoFlush( id->p_f_chain );
+ if ( id->p_uf_chain != NULL )
+ filter_chain_VideoFlush( id->p_uf_chain );
+ if ( id->p_final_conv_static != NULL )
+ filter_chain_VideoFlush( id->p_final_conv_static );
+}
+
void transcode_video_clean( sout_stream_id_sys_t *id )
{
/* Close encoder, but only if one was opened. */
@@ -567,11 +577,11 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
vlc_fifo_Lock( id->output_fifo );
if( unlikely( !id->b_error && in == NULL ) && transcode_encoder_opened( id->encoder ) )
{
- msg_Dbg( p_stream, "Flushing thread and waiting that");
+ msg_Dbg( p_stream, "Draining thread and waiting for that");
if( transcode_encoder_drain( id->encoder, out ) == VLC_SUCCESS )
- msg_Dbg( p_stream, "Flushing done");
+ msg_Dbg( p_stream, "Draining done");
else
- msg_Warn( p_stream, "Flushing failed");
+ msg_Warn( p_stream, "Draining failed");
}
bool has_error = id->b_error;
if( !has_error )
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/40c3b3760a831a92b44c03d4688bea735975738a...af8f2e029aa4b652d19cec5a232e6f935fad4818
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/40c3b3760a831a92b44c03d4688bea735975738a...af8f2e029aa4b652d19cec5a232e6f935fad4818
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list