[FFmpeg-devel] [PATCH 1/2] lavu: add thread message API.

Michael Niedermayer michaelni at gmx.at
Fri Apr 18 18:42:05 CEST 2014


On Thu, Apr 17, 2014 at 04:55:21PM +0200, Nicolas George wrote:
> Le sextidi 6 ventôse, an CCXXII, Clément Bœsch a écrit :
> > double include it seems.
> 
> Fixed.
> 
> > Also, I think pthread.h include should be conditional.
> 
> Fixed.
> 
> > This might not compile without pthread
> 
> Fixed.
> 
> > Code in ffmpeg.c seems to rely on HAVE_PTHREADS; is this fine?
> 
> I assume the w32-pthread compat code will take care of that. If someone
> could test on windows, that would be nice.
> 
> > so without thread, this will return ENOSYS; won't that cause problems with
> > your new loop in ffmpeg.c?
> 
> You mean if a ffmpeg compiled with threads is used with a lavu compiled
> without? Do we support that setup?
> 
> > You should not have this include here since the prototypes do not depend
> > on pthread specific code; if you did, it would have mean that the code can
> > not compile without threading.
> 
> Fixed.
> 
> New patch attached, no change on the second one except rebasing. FATE passes
> on Debian both with and without threads.
> 
> Regards,
> 
> -- 
>   Nicolas George

>  Makefile        |    2 
>  threadmessage.c |  174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  threadmessage.h |   89 ++++++++++++++++++++++++++++
>  3 files changed, 265 insertions(+)
> 4064f9e984a05443d17d8ba22d925becad01820e  0001-lavu-add-thread-message-API.patch
> From eb1230be20ba6765f7c44165742443ca02245089 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Thu, 20 Feb 2014 14:14:34 +0100
> Subject: [PATCH 1/2] lavu: add thread message API.
> 
> TODO minor bump and APIchanges entry.
> 
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavutil/Makefile        |    2 +
>  libavutil/threadmessage.c |  174 +++++++++++++++++++++++++++++++++++++++++++++
>  libavutil/threadmessage.h |   89 +++++++++++++++++++++++
>  3 files changed, 265 insertions(+)
>  create mode 100644 libavutil/threadmessage.c
>  create mode 100644 libavutil/threadmessage.h
> 
> diff --git a/libavutil/Makefile b/libavutil/Makefile
> index d2ebebc..5082e92 100644
> --- a/libavutil/Makefile
> +++ b/libavutil/Makefile
> @@ -51,6 +51,7 @@ HEADERS = adler32.h                                                     \
>            sha.h                                                         \
>            sha512.h                                                      \
>            stereo3d.h                                                    \
> +          threadmessage.h                                               \
>            time.h                                                        \
>            timecode.h                                                    \
>            timestamp.h                                                   \
> @@ -117,6 +118,7 @@ OBJS = adler32.o                                                        \
>         sha.o                                                            \
>         sha512.o                                                         \
>         stereo3d.o                                                       \
> +       threadmessage.o                                                  \
>         time.o                                                           \
>         timecode.o                                                       \
>         tree.o                                                           \
> diff --git a/libavutil/threadmessage.c b/libavutil/threadmessage.c
> new file mode 100644
> index 0000000..effbb48
> --- /dev/null
> +++ b/libavutil/threadmessage.c
> @@ -0,0 +1,174 @@
> +/*
> + * Copyright (c) 2014 Nicolas George
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg 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.
> + *
> + * FFmpeg 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 FFmpeg; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#include "fifo.h"
> +#include "threadmessage.h"

> +#if HAVE_THREADS
> +#include <pthread.h>
> +#endif

this will fail if there are no pthreads

no more comments from me

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140418/0e0ce510/attachment.asc>


More information about the ffmpeg-devel mailing list