History

lavc, lavu: use avutil/thread.h instead of redundant conditional includes

Clément Bœsch committed 10 years ago

Commit a8bb81a1 parent a0050d96 files · +6 −52Browse files

Unified · Split

6 files
  1. libavcodec/frame_thread_encoder.c +1 −8
  2. libavcodec/pthread_frame.c +1 −8
  3. libavcodec/utils.c +1 −8
  4. libavcodec/vp8.h +1 −8
  5. libavutil/opencl.c +1 −9
  6. libavutil/threadmessage.c +1 −11
libavcodec/frame_thread_encoder.c+1−8
@@ -23,18 +23,11 @@ · 22 unmodified lines
2323 #include "libavutil/fifo.h"
2424 #include "libavutil/avassert.h"
2525 #include "libavutil/imgutils.h"
26+#include "libavutil/thread.h"
2627 #include "avcodec.h"
2728 #include "internal.h"
2829 #include "thread.h"
2930
30−#if HAVE_PTHREADS
31−#include <pthread.h>
32−#elif HAVE_W32THREADS
33−#include "compat/w32pthreads.h"
34−#elif HAVE_OS2THREADS
35−#include "compat/os2threads.h"
36−#endif
37−
3831 #define MAX_THREADS 64
3932 #define BUFFER_SIZE (2*MAX_THREADS)
4033
libavcodec/pthread_frame.c+1−8
@@ -26,14 +26,6 @@ · 25 unmodified lines
2626
2727 #include <stdint.h>
2828
29−#if HAVE_PTHREADS
30−#include <pthread.h>
31−#elif HAVE_W32THREADS
32−#include "compat/w32pthreads.h"
33−#elif HAVE_OS2THREADS
34−#include "compat/os2threads.h"
35−#endif
36−
3729 #include "avcodec.h"
3830 #include "internal.h"
3931 #include "pthread_internal.h"
@@ -49,6 +41,7 @@ · 9 unmodified lines
4941 #include "libavutil/log.h"
5042 #include "libavutil/mem.h"
5143 #include "libavutil/opt.h"
44+#include "libavutil/thread.h"
5245
5346 /**
5447 * Context used by codec threads and stored in their AVCodecInternal thread_ctx.
libavcodec/utils.c+1−8
@@ -41,6 +41,7 @@ · 40 unmodified lines
4141 #include "libavutil/imgutils.h"
4242 #include "libavutil/samplefmt.h"
4343 #include "libavutil/dict.h"
44+#include "libavutil/thread.h"
4445 #include "avcodec.h"
4546 #include "libavutil/opt.h"
4647 #include "me_cmp.h"
@@ -59,14 +60,6 @@ · 12 unmodified lines
5960 # include <iconv.h>
6061 #endif
6162
62−#if HAVE_PTHREADS
63−#include <pthread.h>
64−#elif HAVE_W32THREADS
65−#include "compat/w32pthreads.h"
66−#elif HAVE_OS2THREADS
67−#include "compat/os2threads.h"
68−#endif
69−
7063 #include "libavutil/ffversion.h"
7164 const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
7265
libavcodec/vp8.h+1−8
@@ -27,20 +27,13 @@ · 26 unmodified lines
2727 #define AVCODEC_VP8_H
2828
2929 #include "libavutil/buffer.h"
30+#include "libavutil/thread.h"
3031
3132 #include "h264pred.h"
3233 #include "thread.h"
3334 #include "vp56.h"
3435 #include "vp8dsp.h"
3536
36−#if HAVE_PTHREADS
37−# include <pthread.h>
38−#elif HAVE_OS2THREADS
39−# include "compat/os2threads.h"
40−#elif HAVE_W32THREADS
41−# include "compat/w32pthreads.h"
42−#endif
43−
4437 #define VP8_MAX_QUANT 127
4538
4639 enum dct_token {
libavutil/opencl.c+1−9
@@ -26,15 +26,7 @@ · 25 unmodified lines
2626 #include "log.h"
2727 #include "avassert.h"
2828 #include "opt.h"
29−
30−#if HAVE_THREADS
31−#if HAVE_PTHREADS
32−#include <pthread.h>
33−#elif HAVE_W32THREADS
34−#include "compat/w32pthreads.h"
35−#elif HAVE_OS2THREADS
36−#include "compat/os2threads.h"
37−#endif
29+#include "thread.h"
3830 #include "atomic.h"
3931
4032 static pthread_mutex_t * volatile atomic_opencl_lock = NULL;
libavutil/threadmessage.c+1−11
@@ -20,17 +20,7 @@ · 19 unmodified lines
2020
2121 #include "fifo.h"
2222 #include "threadmessage.h"
23−#if HAVE_THREADS
24−#if HAVE_PTHREADS
25−#include <pthread.h>
26−#elif HAVE_W32THREADS
27−#include "compat/w32pthreads.h"
28−#elif HAVE_OS2THREADS
29−#include "compat/os2threads.h"
30−#else
31−#error "Unknown threads implementation"
32−#endif
33−#endif
23+#include "thread.h"
3424
3525 struct AVThreadMessageQueue {
3626 #if HAVE_THREADS

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t