[FFmpeg-devel] [PATCH 3/3] avdevice/decklink: Allow compilation with native threads.

Michael Niedermayer michaelni at gmx.at
Sun Sep 27 00:06:32 CEST 2015


On Sat, Sep 26, 2015 at 08:45:13PM +1000, Matt Oliver wrote:
> On 26 September 2015 at 04:08, Michael Niedermayer <michaelni at gmx.at> wrote:
> 
> > On Fri, Sep 25, 2015 at 09:41:59PM +1000, Matt Oliver wrote:
> > > On 25 September 2015 at 17:58, Matt Oliver <protogonoi at gmail.com> wrote:
> > >
> > > > Allows the decklink device to be used with native win32/os2 threads
> > > > instead of just pthreads.
> > > >
> > > > Note: I dont have a decklink device to test this but It just allows the
> > > > use of the already tested win32/os2 pthread simulation functions so
> > there
> > > > shouldnt be any issues.
> > > >
> > >
> > > Actually added the patch this time :(
> >
> > >  configure                       |    4 ++--
> > >  libavdevice/decklink_common.cpp |    2 +-
> > >  libavdevice/decklink_dec.cpp    |    2 +-
> > >  libavdevice/decklink_enc.cpp    |    2 +-
> > >  4 files changed, 5 insertions(+), 5 deletions(-)
> > > 4aa7edd4948d914a5f8f580bda23c9edb931f860
> > 0003-avdevice-decklink-Allow-compilation-with-native-thre.patch
> > > From 13c98e75292284a8b9e17c3a459208c1c06c10cb Mon Sep 17 00:00:00 2001
> > > From: Matt Oliver <protogonoi at gmail.com>
> > > Date: Fri, 25 Sep 2015 17:52:57 +1000
> > > Subject: [PATCH 3/3] avdevice/decklink: Allow compilation with native
> > threads.
> > >
> > > ---
> > >  configure                       | 4 ++--
> > >  libavdevice/decklink_common.cpp | 2 +-
> > >  libavdevice/decklink_dec.cpp    | 2 +-
> > >  libavdevice/decklink_enc.cpp    | 2 +-
> > >  4 files changed, 5 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/configure b/configure
> > > index e21820a..58865d9 100755
> > > --- a/configure
> > > +++ b/configure
> > > @@ -2652,9 +2652,9 @@ avfoundation_indev_extralibs="-framework CoreVideo
> > -framework Foundation -framew
> > >  avfoundation_indev_select="avfoundation"
> > >  bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h
> > dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
> > >  caca_outdev_deps="libcaca"
> > > -decklink_outdev_deps="decklink pthreads"
> > > +decklink_outdev_deps="decklink threads"
> > >  decklink_outdev_extralibs="-lstdc++"
> > > -decklink_indev_deps="decklink pthreads"
> > > +decklink_indev_deps="decklink threads"
> > >  decklink_indev_extralibs="-lstdc++"
> > >  dshow_indev_deps="IBaseFilter"
> > >  dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32
> > -lshlwapi"
> > > diff --git a/libavdevice/decklink_common.cpp
> > b/libavdevice/decklink_common.cpp
> > > index ac7964c..476315f 100644
> > > --- a/libavdevice/decklink_common.cpp
> > > +++ b/libavdevice/decklink_common.cpp
> > > @@ -26,7 +26,7 @@
> > >  #include <DeckLinkAPIDispatch.cpp>
> > >  #endif
> > >
> > > -#include <pthread.h>
> > > +#include "libavutil/thread.h"
> > >  #include <semaphore.h>
> > >
> > >  extern "C" {
> > > diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
> > > index 747f47e..5c86d94 100644
> > > --- a/libavdevice/decklink_dec.cpp
> > > +++ b/libavdevice/decklink_dec.cpp
> > > @@ -21,7 +21,7 @@
> > >
> > >  #include <DeckLinkAPI.h>
> > >
> > > -#include <pthread.h>
> > > +#include "libavutil/thread.h"
> > >  #include <semaphore.h>
> > >
> > >  extern "C" {
> > > diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp
> > > index 6c5450f..1c9f728 100644
> > > --- a/libavdevice/decklink_enc.cpp
> > > +++ b/libavdevice/decklink_enc.cpp
> > > @@ -21,7 +21,7 @@
> > >
> > >  #include <DeckLinkAPI.h>
> > >
> > > -#include <pthread.h>
> > > +#include "libavutil/thread.h"
> > >  #include <semaphore.h>
> > >
> > >  extern "C" {
> >
> > i have no means to test either but
> > shouldnt libavutil/*.h be under extern "C" { ?
> >
> > [...]
> 
> 
> I didnt have any problems with that on my setup because thread.h when not
> using pthread just declares static inline functions and the pthread header
> adds its own extern "C". If there is some other pthread implementation
> somewhere that doesnt do this then that may be an issue in which case i can
> move it inside the extern "C"

libavutil/thread.h could potentially include any other header from
libavutil, and that is not guranteed to be C++ compatible
this could also change at any point in the future, i dont think
including libavutil headers in C++ withoutr proper "extern C"
is a good idea.

also thread.h includes compat/* stuff which contain more includes
each of them could cause failure

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150927/4c4d0536/attachment.sig>


More information about the ffmpeg-devel mailing list