[vlc-commits] sout: transcode: remove dead osdmenu transcoding
Francois Cartegnie
git at videolan.org
Fri Jul 7 14:34:00 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jul 7 14:29:18 2017 +0200| [901691da4ae8bb694979bfbee927e670f4d6843e] | committer: Francois Cartegnie
sout: transcode: remove dead osdmenu transcoding
osdmenu module was removed a long time ago
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=901691da4ae8bb694979bfbee927e670f4d6843e
---
modules/stream_out/Makefile.am | 2 +-
modules/stream_out/transcode/osd.c | 176 -------------------------------
modules/stream_out/transcode/transcode.c | 64 +----------
modules/stream_out/transcode/transcode.h | 6 --
4 files changed, 4 insertions(+), 244 deletions(-)
diff --git a/modules/stream_out/Makefile.am b/modules/stream_out/Makefile.am
index f30069e2aa..ba84a3ceae 100644
--- a/modules/stream_out/Makefile.am
+++ b/modules/stream_out/Makefile.am
@@ -19,7 +19,7 @@ libstream_out_smem_plugin_la_SOURCES = stream_out/smem.c
libstream_out_setid_plugin_la_SOURCES = stream_out/setid.c
libstream_out_transcode_plugin_la_SOURCES = \
stream_out/transcode/transcode.c stream_out/transcode/transcode.h \
- stream_out/transcode/osd.c stream_out/transcode/spu.c \
+ stream_out/transcode/spu.c \
stream_out/transcode/audio.c stream_out/transcode/video.c
libstream_out_transcode_plugin_la_CFLAGS = $(AM_CFLAGS)
libstream_out_transcode_plugin_la_LIBADD = $(LIBM)
diff --git a/modules/stream_out/transcode/osd.c b/modules/stream_out/transcode/osd.c
deleted file mode 100644
index 19e974b04d..0000000000
--- a/modules/stream_out/transcode/osd.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*****************************************************************************
- * osd.c: transcoding stream output module (osd)
- *****************************************************************************
- * Copyright (C) 2003-2009 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Laurent Aimar <fenrir at via.ecp.fr>
- * Gildas Bazin <gbazin at videolan.org>
- * Jean-Paul Saman <jpsaman #_at_# m2x dot nl>
- * Antoine Cellerier <dionoea at videolan dot org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-
-#include "transcode.h"
-
-#include <vlc_spu.h>
-#include <vlc_modules.h>
-
-/*
- * OSD menu
- */
-int transcode_osd_new( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
-{
- sout_stream_sys_t *p_sys = p_stream->p_sys;
-
- id->p_decoder->fmt_in.i_cat = SPU_ES;
- id->p_encoder->fmt_out.psz_language = strdup( "osd" );
-
- if( p_sys->i_osdcodec != 0 || p_sys->psz_osdenc )
- {
- msg_Dbg( p_stream, "creating osdmenu transcoding from fcc=`%4.4s' "
- "to fcc=`%4.4s'", (char*)&id->p_encoder->fmt_out.i_codec,
- (char*)&p_sys->i_osdcodec );
-
- /* Complete destination format */
- id->p_encoder->fmt_out.i_codec = p_sys->i_osdcodec;
-
- /* Open encoder */
- es_format_Init( &id->p_encoder->fmt_in, id->p_decoder->fmt_in.i_cat,
- VLC_CODEC_YUVA );
- id->p_encoder->fmt_in.psz_language = strdup( "osd" );
-
- id->p_encoder->p_cfg = p_sys->p_osd_cfg;
-
- id->p_encoder->p_module =
- module_need( id->p_encoder, "encoder", p_sys->psz_osdenc, true );
-
- if( !id->p_encoder->p_module )
- {
- msg_Err( p_stream, "cannot find spu encoder (%s)", p_sys->psz_osdenc );
- goto error;
- }
-
- /* open output stream */
- id->id = sout_StreamIdAdd( p_stream->p_next, &id->p_encoder->fmt_out );
- id->b_transcode = true;
-
- if( !id->id ) goto error;
- }
- else
- {
- msg_Dbg( p_stream, "not transcoding a stream (fcc=`%4.4s')",
- (char*)&id->p_decoder->fmt_out.i_codec );
- id->id = sout_StreamIdAdd( p_stream->p_next, &id->p_decoder->fmt_out );
- id->b_transcode = false;
-
- if( !id->id ) goto error;
- }
-
- if( !p_sys->p_spu )
- p_sys->p_spu = spu_Create( p_stream, NULL );
-
- return VLC_SUCCESS;
-
- error:
- msg_Err( p_stream, "starting osd encoding thread failed" );
- if( id->p_encoder->p_module )
- module_unneed( id->p_encoder, id->p_encoder->p_module );
- p_sys->b_osd = false;
- return VLC_EGENERIC;
-}
-
-void transcode_osd_close( sout_stream_t *p_stream, sout_stream_id_sys_t *id)
-{
- sout_stream_sys_t *p_sys = p_stream->p_sys;
-
- /* Close encoder */
- if( id )
- {
- if( id->p_encoder->p_module )
- module_unneed( id->p_encoder, id->p_encoder->p_module );
- }
- p_sys->b_osd = false;
-}
-
-int transcode_osd_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
- block_t *in, block_t **out )
-{
- sout_stream_sys_t *p_sys = p_stream->p_sys;
- subpicture_t *p_subpic = NULL;
-
- /* Check if we have a subpicture to send */
- if( p_sys->p_spu && in->i_dts > VLC_TS_INVALID )
- {
- video_format_t fmt;
- video_format_Init( &fmt, 0 );
- video_format_Setup( &fmt, 0, 720, 576, 720, 576, 1, 1 );
- p_subpic = spu_Render( p_sys->p_spu, NULL, &fmt, &fmt, in->i_dts, in->i_dts, false );
- }
- else
- {
- msg_Warn( p_stream, "spu channel not initialized, doing it now" );
- if( !p_sys->p_spu )
- p_sys->p_spu = spu_Create( p_stream, NULL );
- }
-
- if( p_subpic )
- {
- block_t *p_block = NULL;
-
- if( p_sys->b_master_sync && p_sys->i_master_drift )
- {
- p_subpic->i_start -= p_sys->i_master_drift;
- if( p_subpic->i_stop ) p_subpic->i_stop -= p_sys->i_master_drift;
- }
-
- p_block = id->p_encoder->pf_encode_sub( id->p_encoder, p_subpic );
- subpicture_Delete( p_subpic );
- if( p_block )
- {
- p_block->i_dts = p_block->i_pts = in->i_dts;
- block_ChainAppend( out, p_block );
- return VLC_SUCCESS;
- }
- }
- return VLC_EGENERIC;
-}
-
-bool transcode_osd_add( sout_stream_t *p_stream, const es_format_t *p_fmt,
- sout_stream_id_sys_t *id)
-{
- sout_stream_sys_t *p_sys = p_stream->p_sys;
-
- msg_Dbg( p_stream, "creating osd transcoding from fcc=`%4.4s' "
- "to fcc=`%4.4s'", (char*)&p_fmt->i_codec,
- (char*)&p_sys->i_scodec );
-
- id->b_transcode = true;
-
- /* Create a fake OSD menu elementary stream */
- if( transcode_osd_new( p_stream, id ) )
- {
- msg_Err( p_stream, "cannot create osd chain" );
- return false;
- }
- p_sys->b_osd = true;
-
- return true;
-}
diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index ec6854ed96..25ac5ae71f 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -120,10 +120,6 @@
"be overlayed directly onto the video. You can specify a colon-separated "\
"list of subpicture modules" )
-#define OSD_TEXT N_("OSD menu")
-#define OSD_LONGTEXT N_(\
- "Stream the On Screen Display menu (using the osdmenu subpicture module)." )
-
#define THREADS_TEXT N_("Number of threads")
#define THREADS_LONGTEXT N_( \
"Number of threads used for the transcoding." )
@@ -212,10 +208,6 @@ vlc_module_begin ()
add_module_list( SOUT_CFG_PREFIX "sfilter", "spu source",
NULL, SFILTER_TEXT, SFILTER_LONGTEXT, false )
- set_section( N_("On Screen Display"), NULL )
- add_bool( SOUT_CFG_PREFIX "osd", false, OSD_TEXT,
- OSD_LONGTEXT, false )
-
set_section( N_("Miscellaneous"), NULL )
add_integer( SOUT_CFG_PREFIX "threads", 0, THREADS_TEXT,
THREADS_LONGTEXT, true )
@@ -231,7 +223,7 @@ static const char *const ppsz_sout_options[] = {
"scale", "fps", "width", "height", "vfilter", "deinterlace",
"deinterlace-module", "threads", "aenc", "acodec", "ab", "alang",
"afilter", "samplerate", "channels", "senc", "scodec", "soverlay",
- "sfilter", "osd", "high-priority", "maxwidth", "maxheight", "pool-size",
+ "sfilter", "high-priority", "maxwidth", "maxheight", "pool-size",
NULL
};
@@ -427,36 +419,6 @@ static int Open( vlc_object_t *p_this )
}
free( psz_string );
- /* OSD menu transcoding parameters */
- p_sys->psz_osdenc = NULL;
- p_sys->p_osd_cfg = NULL;
- p_sys->i_osdcodec = 0;
- p_sys->b_osd = var_GetBool( p_stream, SOUT_CFG_PREFIX "osd" );
-
- if( p_sys->b_osd )
- {
- char *psz_next;
-
- psz_next = config_ChainCreate( &p_sys->psz_osdenc,
- &p_sys->p_osd_cfg, "dvbsub" );
- free( psz_next );
-
- p_sys->i_osdcodec = VLC_CODEC_YUVP;
-
- msg_Dbg( p_stream, "codec osd=%4.4s", (char *)&p_sys->i_osdcodec );
-
- if( !p_sys->p_spu )
- {
- p_sys->p_spu = spu_Create( p_stream, NULL );
- if( p_sys->p_spu )
- spu_ChangeSources( p_sys->p_spu, "osdmenu" );
- }
- else
- {
- spu_ChangeSources( p_sys->p_spu, "osdmenu" );
- }
- }
-
p_stream->pf_add = Add;
p_stream->pf_del = Del;
p_stream->pf_send = Send;
@@ -493,9 +455,6 @@ static void Close( vlc_object_t * p_this )
if( p_sys->p_spu ) spu_Destroy( p_sys->p_spu );
if( p_sys->p_spu_blend ) filter_DeleteBlend( p_sys->p_spu_blend );
- config_ChainDestroy( p_sys->p_osd_cfg );
- free( p_sys->psz_osdenc );
-
free( p_sys );
}
@@ -547,8 +506,6 @@ static sout_stream_id_sys_t *Add( sout_stream_t *p_stream,
else if( ( p_fmt->i_cat == SPU_ES ) &&
( p_sys->i_scodec || p_sys->b_soverlay ) )
success = transcode_spu_add(p_stream, p_fmt, id);
- else if( !p_sys->b_osd && (p_sys->i_osdcodec != 0 || p_sys->psz_osdenc) )
- success = transcode_osd_add(p_stream, p_fmt, id);
else
{
msg_Dbg( p_stream, "not transcoding a stream (fcc=`%4.4s')",
@@ -588,8 +545,6 @@ error:
static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
{
- sout_stream_sys_t *p_sys = p_stream->p_sys;
-
if( id->b_transcode )
{
switch( id->p_decoder->fmt_in.i_cat )
@@ -603,10 +558,7 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
transcode_video_close( p_stream, id );
break;
case SPU_ES:
- if( p_sys->b_osd )
- transcode_osd_close( p_stream, id );
- else
- transcode_spu_close( p_stream, id );
+ transcode_spu_close( p_stream, id );
break;
}
}
@@ -632,7 +584,6 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
{
- sout_stream_sys_t *p_sys = p_stream->p_sys;
block_t *p_out = NULL;
if( !id->b_transcode )
@@ -663,16 +614,7 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
break;
case SPU_ES:
- /* Transcode OSD menu pictures. */
- if( p_sys->b_osd )
- {
- if( transcode_osd_process( p_stream, id, p_buffer, &p_out ) !=
- VLC_SUCCESS )
- {
- return VLC_EGENERIC;
- }
- }
- else if ( transcode_spu_process( p_stream, id, p_buffer, &p_out ) !=
+ if ( transcode_spu_process( p_stream, id, p_buffer, &p_out ) !=
VLC_SUCCESS )
{
return VLC_EGENERIC;
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index 7a1a3918dc..20d8f73cdc 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -62,12 +62,6 @@ struct sout_stream_sys_t
spu_t *p_spu;
filter_t *p_spu_blend;
- /* OSD Menu */
- vlc_fourcc_t i_osdcodec; /* codec osd menu (0 if not transcode) */
- char *psz_osdenc;
- config_chain_t *p_osd_cfg;
- bool b_osd; /* true when osd es is registered */
-
/* Sync */
bool b_master_sync;
/* i_master drift is how much audio buffer is ahead of calculated pts */
More information about the vlc-commits
mailing list