[vlc-commits] Add filter_chain_AppendConverter()
Rémi Denis-Courmont
git at videolan.org
Mon Dec 12 19:53:40 CET 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 12 20:01:17 2016 +0200| [e7eaa33c9c562b1906909d5de3898b5c7427dcbc] | committer: Rémi Denis-Courmont
Add filter_chain_AppendConverter()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e7eaa33c9c562b1906909d5de3898b5c7427dcbc
---
include/vlc_filter.h | 14 +++++++++++++-
src/libvlccore.sym | 1 +
src/misc/filter_chain.c | 12 +++++++++---
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index d5a8c8b..5743cac 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -310,7 +310,7 @@ VLC_API void filter_chain_Delete( filter_chain_t * );
VLC_API void filter_chain_Reset( filter_chain_t *, const es_format_t *, const es_format_t * );
/**
- * Append filter to the end of the chain.
+ * Append a filter to the chain.
*
* \param chain filter chain to append a filter to
* \param name filter name
@@ -323,6 +323,18 @@ VLC_API filter_t *filter_chain_AppendFilter(filter_chain_t *chain,
const es_format_t *fmt_out);
/**
+ * Append a conversion to the chain.
+ *
+ * \param chain filter chain to append a filter to
+ * \param fmt_in filter input format
+ * \param fmt_out filter output format
+ * \retval 0 on success
+ * \retval -1 on failure
+ */
+VLC_API int filter_chain_AppendConverter(filter_chain_t *chain,
+ const es_format_t *fmt_in, const es_format_t *fmt_out);
+
+/**
* Append new filter to filter chain from string.
*
* \param chain filter chain to append a filter to
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 5ffd413..7b9657a 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -108,6 +108,7 @@ es_format_Init
es_format_InitFromVideo
es_format_IsSimilar
filter_Blend
+filter_chain_AppendConverter
filter_chain_AppendFilter
filter_chain_AppendFromString
filter_chain_Delete
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index cff4593..41c6179 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -241,10 +241,9 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
error:
if( name != NULL )
- msg_Err( parent, "Failed to create %s '%s'", chain->filter_cap,
- name );
+ msg_Err( parent, "Failed to create %s '%s'", capability, name );
else
- msg_Err( parent, "Failed to create %s", chain->filter_cap );
+ msg_Err( parent, "Failed to create %s", capability );
es_format_Clean( &filter->fmt_out );
es_format_Clean( &filter->fmt_in );
vlc_object_release( filter );
@@ -259,6 +258,13 @@ filter_t *filter_chain_AppendFilter( filter_chain_t *chain,
fmt_in, fmt_out );
}
+int filter_chain_AppendConverter( filter_chain_t *chain,
+ const es_format_t *fmt_in, const es_format_t *fmt_out )
+{
+ return filter_chain_AppendInner( chain, NULL, chain->filter_cap, NULL,
+ fmt_in, fmt_out ) != NULL ? 0 : -1;
+}
+
void filter_chain_DeleteFilter( filter_chain_t *chain, filter_t *filter )
{
vlc_object_t *obj = chain->callbacks.sys;
More information about the vlc-commits
mailing list