[vlc-commits] input: move decoder functions into vlc_decoder.h
Thomas Guillem
git at videolan.org
Mon Jun 3 16:16:23 CEST 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May 31 12:32:30 2019 +0200| [acf56840270667ee30237f538f328cb5b32f3e3d] | committer: Thomas Guillem
input: move decoder functions into vlc_decoder.h
TODO: needs to be documented.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=acf56840270667ee30237f538f328cb5b32f3e3d
---
include/vlc_decoder.h | 94 ++++++++++++++++++++++++++++++++++++++++++++
include/vlc_input.h | 59 +--------------------------
modules/stream_out/display.c | 2 +-
src/Makefile.am | 1 +
src/input/decoder.c | 1 +
src/input/es_out.c | 1 +
src/input/input.c | 1 +
src/input/player.c | 1 +
src/input/resource.c | 1 +
9 files changed, 103 insertions(+), 58 deletions(-)
diff --git a/include/vlc_decoder.h b/include/vlc_decoder.h
new file mode 100644
index 0000000000..8095fcc760
--- /dev/null
+++ b/include/vlc_decoder.h
@@ -0,0 +1,94 @@
+/*****************************************************************************
+ * vlc_decoder.h: decoder API
+ *****************************************************************************
+ * Copyright (C) 1999-2015 VLC authors and VideoLAN
+ *
+ * Authors: Christophe Massiot <massiot at via.ecp.fr>
+ * 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 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.
+ *****************************************************************************/
+
+#ifndef VLC_DECODER_H
+#define VLC_DECODER_H 1
+
+/**
+ * \defgroup input Decoder
+ * \ingroup vlc
+ * Decoder
+ * @{
+ */
+
+#include <vlc_subpicture.h>
+
+/**
+ * This defines an opaque input resource handler.
+ */
+typedef struct input_resource_t input_resource_t;
+
+/* */
+VLC_API decoder_t * input_DecoderCreate( vlc_object_t *, const es_format_t *, input_resource_t * ) VLC_USED;
+VLC_API void input_DecoderDelete( decoder_t * );
+VLC_API void input_DecoderDecode( decoder_t *, block_t *, bool b_do_pace );
+VLC_API void input_DecoderDrain( decoder_t * );
+VLC_API void input_DecoderFlush( decoder_t * );
+VLC_API int input_DecoderSetSpuHighlight( decoder_t *, const vlc_spu_highlight_t * );
+
+/**
+ * It creates an empty input resource handler.
+ *
+ * The given object MUST stay alive as long as the input_resource_t is
+ * not deleted.
+ */
+VLC_API input_resource_t * input_resource_New( vlc_object_t * ) VLC_USED;
+
+/**
+ * It releases an input resource.
+ */
+VLC_API void input_resource_Release( input_resource_t * );
+
+/**
+ * Forcefully destroys the video output (e.g. when the playlist is stopped).
+ */
+VLC_API void input_resource_TerminateVout( input_resource_t * );
+
+/**
+ * This function releases all resources (object).
+ */
+VLC_API void input_resource_Terminate( input_resource_t * );
+
+/**
+ * \return the current audio output if any.
+ * Use aout_Release() to drop the reference.
+ */
+VLC_API audio_output_t *input_resource_HoldAout( input_resource_t * );
+
+/**
+ * This function creates or recycles an audio output.
+ */
+VLC_API audio_output_t *input_resource_GetAout( input_resource_t * );
+
+/**
+ * This function retains or destroys an audio output.
+ */
+VLC_API void input_resource_PutAout( input_resource_t *, audio_output_t * );
+
+/**
+ * Prevents the existing audio output (if any) from being recycled.
+ */
+VLC_API void input_resource_ResetAout( input_resource_t * );
+
+/** @} */
+#endif
diff --git a/include/vlc_input.h b/include/vlc_input.h
index a2cb35c478..7a9db09fdb 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -43,6 +43,8 @@
#include <string.h>
+typedef struct input_resource_t input_resource_t;
+
/*****************************************************************************
* Seek point: (generalisation of chapters)
*****************************************************************************/
@@ -214,11 +216,6 @@ static inline input_attachment_t *vlc_input_attachment_Duplicate( const input_at
*****************************************************************************/
/**
- * This defines an opaque input resource handler.
- */
-typedef struct input_resource_t input_resource_t;
-
-/**
* Main structure representing an input thread. This structure is mostly
* private. The only public fields are read-only and constant.
*/
@@ -587,14 +584,6 @@ VLC_API void input_SetPosition( input_thread_t *, float f_position, bool b_fast
*/
VLC_API input_item_t* input_GetItem( input_thread_t * ) VLC_USED;
-/* */
-VLC_API decoder_t * input_DecoderCreate( vlc_object_t *, const es_format_t *, input_resource_t * ) VLC_USED;
-VLC_API void input_DecoderDelete( decoder_t * );
-VLC_API void input_DecoderDecode( decoder_t *, block_t *, bool b_do_pace );
-VLC_API void input_DecoderDrain( decoder_t * );
-VLC_API void input_DecoderFlush( decoder_t * );
-VLC_API int input_DecoderSetSpuHighlight( decoder_t *, const vlc_spu_highlight_t * );
-
/**
* This function creates a sane filename path.
*/
@@ -602,49 +591,5 @@ VLC_API char * input_CreateFilename( input_thread_t *, input_item_t *,
const char *psz_path, const char *psz_prefix,
const char *psz_extension ) VLC_USED;
-/**
- * It creates an empty input resource handler.
- *
- * The given object MUST stay alive as long as the input_resource_t is
- * not deleted.
- */
-VLC_API input_resource_t * input_resource_New( vlc_object_t * ) VLC_USED;
-
-/**
- * It releases an input resource.
- */
-VLC_API void input_resource_Release( input_resource_t * );
-
-/**
- * Forcefully destroys the video output (e.g. when the playlist is stopped).
- */
-VLC_API void input_resource_TerminateVout( input_resource_t * );
-
-/**
- * This function releases all resources (object).
- */
-VLC_API void input_resource_Terminate( input_resource_t * );
-
-/**
- * \return the current audio output if any.
- * Use aout_Release() to drop the reference.
- */
-VLC_API audio_output_t *input_resource_HoldAout( input_resource_t * );
-
-/**
- * This function creates or recycles an audio output.
- */
-VLC_API audio_output_t *input_resource_GetAout( input_resource_t * );
-
-/**
- * This function retains or destroys an audio output.
- */
-VLC_API void input_resource_PutAout( input_resource_t *, audio_output_t * );
-
-/**
- * Prevents the existing audio output (if any) from being recycled.
- */
-VLC_API void input_resource_ResetAout( input_resource_t * );
-
/** @} */
#endif
diff --git a/modules/stream_out/display.c b/modules/stream_out/display.c
index 2d46cfb601..0402a4bcc7 100644
--- a/modules/stream_out/display.c
+++ b/modules/stream_out/display.c
@@ -30,7 +30,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_input.h>
+#include <vlc_decoder.h>
#include <vlc_sout.h>
#include <vlc_block.h>
diff --git a/src/Makefile.am b/src/Makefile.am
index 663bbd4eb5..3f73999fdb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,6 +42,7 @@ pluginsinclude_HEADERS = \
../include/vlc_configuration.h \
../include/vlc_cpu.h \
../include/vlc_cxx_helpers.hpp \
+ ../include/vlc_decoder.h \
../include/vlc_dialog.h \
../include/vlc_demux.h \
../include/vlc_epg.h \
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 3fb554a0c1..45cf9844b1 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -41,6 +41,7 @@
#include <vlc_meta.h>
#include <vlc_dialog.h>
#include <vlc_modules.h>
+#include <vlc_decoder.h>
#include "audio_output/aout_internal.h"
#include "stream_output/stream_output.h"
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 3c512d2252..d106926a26 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -38,6 +38,7 @@
#include <vlc_fourcc.h>
#include <vlc_meta.h>
#include <vlc_list.h>
+#include <vlc_decoder.h>
#include "input_internal.h"
#include "../clock/input_clock.h"
diff --git a/src/input/input.c b/src/input/input.c
index 4aa89c8091..d7cde9f8c5 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -29,6 +29,7 @@
#endif
#include <vlc_common.h>
+#include <vlc_decoder.h>
#include <limits.h>
#include <assert.h>
diff --git a/src/input/player.c b/src/input/player.c
index 3162b042ee..d7d70f2ed6 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -31,6 +31,7 @@
#include <vlc_vector.h>
#include <vlc_atomic.h>
#include <vlc_tick.h>
+#include <vlc_decoder.h>
#include "libvlc.h"
#include "input_internal.h"
diff --git a/src/input/resource.c b/src/input/resource.c
index dd55556041..bc9f4603f1 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -31,6 +31,7 @@
#include <vlc_common.h>
#include <vlc_atomic.h>
+#include <vlc_decoder.h>
#include <vlc_vout.h>
#include <vlc_spu.h>
#include <vlc_aout.h>
More information about the vlc-commits
mailing list