[vlc-devel] commit: Moved input decoder declaration to input/input_decoder.h ( Laurent Aimar )
git version control
git at videolan.org
Sun Sep 28 13:36:04 CEST 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Sep 28 00:52:59 2008 +0200| [e1c50ab464f10c578daafcc9545d49008070a633] | committer: Laurent Aimar
Moved input decoder declaration to input/input_decoder.h
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e1c50ab464f10c578daafcc9545d49008070a633
---
src/Makefile.am | 1 +
src/input/decoder.c | 19 +++++++-----
src/input/es_out.c | 1 +
src/input/input_decoder.h | 64 +++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 77 insertions(+), 8 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 44f45a7..ac8b134 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -307,6 +307,7 @@ SOURCES_libvlc_common = \
input/input.c \
input/meta.c \
input/input_clock.h \
+ input/input_decoder.h \
input/input_internal.h \
input/vlm_internal.h \
input/stream.c \
diff --git a/src/input/decoder.c b/src/input/decoder.c
index d8beb4f..63a219b 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -44,12 +44,13 @@
#include "audio_output/aout_internal.h"
#include "stream_output/stream_output.h"
#include "input_internal.h"
+#include "input_decoder.h"
-static decoder_t * CreateDecoder( input_thread_t *, es_format_t *, int, sout_instance_t *p_sout );
-static void DeleteDecoder( decoder_t * );
+static decoder_t *CreateDecoder( input_thread_t *, es_format_t *, int, sout_instance_t *p_sout );
+static void DeleteDecoder( decoder_t * );
-static void* DecoderThread( vlc_object_t * );
-static int DecoderDecode( decoder_t * p_dec, block_t *p_block );
+static void *DecoderThread( vlc_object_t * );
+static int DecoderDecode( decoder_t * p_dec, block_t *p_block );
/* Buffers allocation callbacks for the decoders */
static aout_buffer_t *aout_new_buffer( decoder_t *, int );
@@ -1204,7 +1205,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
p_vout = vlc_object_find( p_dec, VLC_OBJECT_VOUT, FIND_ANYWHERE );
if( p_vout && p_owner->p_spu_vout == p_vout )
{
- /* Prerool does not work very well with subtitle */
+ /* Preroll does not work very well with subtitle */
if( p_spu->i_start < p_owner->i_preroll_end &&
( p_spu->i_stop <= 0 || p_spu->i_stop < p_owner->i_preroll_end ) )
{
@@ -1293,7 +1294,7 @@ static void DeleteDecoder( decoder_t * p_dec )
vout_thread_t *p_vout;
p_vout = vlc_object_find( p_dec, VLC_OBJECT_VOUT, FIND_ANYWHERE );
- if( p_vout )
+ if( p_vout && p_owner->p_spu_vout == p_vout )
{
spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR,
p_owner->i_spu_channel );
@@ -1568,10 +1569,12 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec )
while( i_attempts-- )
{
- if( p_dec->b_die || p_dec->b_error ) break;
+ if( p_dec->b_die || p_dec->b_error )
+ break;
p_vout = vlc_object_find( p_dec, VLC_OBJECT_VOUT, FIND_ANYWHERE );
- if( p_vout ) break;
+ if( p_vout )
+ break;
msleep( VOUT_DISPLAY_DELAY );
}
diff --git a/src/input/es_out.c b/src/input/es_out.c
index be12d3c..d936458 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -39,6 +39,7 @@
#include <vlc_aout.h>
#include "input_internal.h"
+#include "input_decoder.h"
#include "../stream_output/stream_output.h"
diff --git a/src/input/input_decoder.h b/src/input/input_decoder.h
new file mode 100644
index 0000000..76782ac
--- /dev/null
+++ b/src/input/input_decoder.h
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * input_decoder.h: Input decoder functions
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ * Copyright (C) 2008 Laurent Aimar
+ * $Id$
+ *
+ * Authors: Laurent Aimar <fenrir at via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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.
+ *****************************************************************************/
+
+#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
+# error This header file can only be included from LibVLC.
+#endif
+
+#ifndef _INPUT_DECODER_H
+#define _INPUT_DECODER_H 1
+
+#include <vlc_common.h>
+#include <vlc_codec.h>
+
+#define BLOCK_FLAG_CORE_FLUSH (1 <<BLOCK_FLAG_CORE_PRIVATE_SHIFT)
+
+/**
+ * This functions warn the decoder about a discontinuity and allow flushing
+ * if requested.
+ */
+void input_DecoderDiscontinuity( decoder_t * p_dec, bool b_flush );
+
+/**
+ * This function returns true if the decoder fifo is empty and false otherwise.
+ */
+bool input_DecoderEmpty( decoder_t * p_dec );
+
+/**
+ * This function activates the request closed caption channel.
+ */
+int input_DecoderSetCcState( decoder_t *, bool b_decode, int i_channel );
+/**
+ * This function returns an error if the requested channel does not exist and
+ * set pb_decode to the channel status(active or not) otherwise.
+ */
+int input_DecoderGetCcState( decoder_t *, bool *pb_decode, int i_channel );
+
+/**
+ * This function set each pb_present entry to true if the corresponding channel
+ * exists or false otherwise.
+ */
+void input_DecoderIsCcPresent( decoder_t *, bool pb_present[4] );
+
+#endif
More information about the vlc-devel
mailing list