Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
ad0bdd2f
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ad0bdd2f
编写于
11月 02, 2011
作者:
K
KO Myung-Hun
提交者:
Michael Niedermayer
11月 13, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lavc: add supports of OS/2 threads
Signed-off-by:
N
Michael Niedermayer
<
michaelni@gmx.at
>
上级
88166fc5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
169 addition
and
1 deletion
+169
-1
configure
configure
+4
-1
libavcodec/Makefile
libavcodec/Makefile
+1
-0
libavcodec/os2threads.h
libavcodec/os2threads.h
+162
-0
libavcodec/pthread.c
libavcodec/pthread.c
+2
-0
未找到文件。
configure
浏览文件 @
ad0bdd2f
...
...
@@ -94,6 +94,7 @@ Configuration options:
--disable-avfilter disable video filter support [no]
--disable-pthreads disable pthreads [auto]
--disable-w32threads disable Win32 threads [auto]
--disable-os2threads disable OS/2 threads [auto]
--enable-x11grab enable X11 grabbing [no]
--disable-network disable network support [no]
--enable-gray enable full grayscale support (slower color)
...
...
@@ -1069,6 +1070,7 @@ CONFIG_LIST="
THREADS_LIST
=
'
pthreads
w32threads
os2threads
'
ARCH_LIST
=
'
...
...
@@ -2656,6 +2658,7 @@ case $target_os in
emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
SLIB_INSTALL_EXTRA_LIB
=
'$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
enable
dos_paths
enable_weak os2threads
;;
gnu/kfreebsd
)
add_cppflags
-D_POSIX_C_SOURCE
=
200112
-D_XOPEN_SOURCE
=
600
-D_BSD_SOURCE
...
...
@@ -2995,7 +2998,7 @@ fi
# check for some common methods of building with pthread support
# do this before the optional library checks as some of them require pthreads
if
!
disabled pthreads
&&
!
enabled w32threads
;
then
if
!
disabled pthreads
&&
!
enabled w32threads
&&
!
enabled os2threads
;
then
enable
pthreads
if
check_func pthread_create
;
then
:
...
...
libavcodec/Makefile
浏览文件 @
ad0bdd2f
...
...
@@ -688,6 +688,7 @@ OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
# thread libraries
OBJS-$(HAVE_PTHREADS)
+=
pthread.o
OBJS-$(HAVE_W32THREADS)
+=
pthread.o
OBJS-$(HAVE_OS2THREADS)
+=
pthread.o
OBJS-$(CONFIG_MLIB)
+=
mlib/dsputil_mlib.o
\
...
...
libavcodec/os2threads.h
0 → 100644
浏览文件 @
ad0bdd2f
/*
* Copyright (c) 2011 KO Myung-Hun <komh@chollian.net>
*
* 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
*/
/**
* @file
* os2threads to pthreads wrapper
*/
#ifndef AVCODEC_OS2PTHREADS_H
#define AVCODEC_OS2PTHREADS_H
#define INCL_DOS
#include <os2.h>
#undef __STRICT_ANSI__
/* for _beginthread() */
#include <stdlib.h>
typedef
TID
pthread_t
;
typedef
void
pthread_attr_t
;
typedef
HMTX
pthread_mutex_t
;
typedef
void
pthread_mutexattr_t
;
typedef
struct
{
HEV
event_sem
;
int
wait_count
;
}
pthread_cond_t
;
typedef
void
pthread_condattr_t
;
struct
thread_arg
{
void
*
(
*
start_routine
)(
void
*
);
void
*
arg
;
};
static
void
thread_entry
(
void
*
arg
)
{
struct
thread_arg
*
thread_arg
=
arg
;
thread_arg
->
start_routine
(
thread_arg
->
arg
);
av_free
(
thread_arg
);
}
static
av_always_inline
int
pthread_create
(
pthread_t
*
thread
,
const
pthread_attr_t
*
attr
,
void
*
(
*
start_routine
)(
void
*
),
void
*
arg
)
{
struct
thread_arg
*
thread_arg
;
thread_arg
=
av_mallocz
(
sizeof
(
struct
thread_arg
));
thread_arg
->
start_routine
=
start_routine
;
thread_arg
->
arg
=
arg
;
*
thread
=
_beginthread
(
thread_entry
,
NULL
,
256
*
1024
,
thread_arg
);
return
0
;
}
static
av_always_inline
int
pthread_join
(
pthread_t
thread
,
void
**
value_ptr
)
{
DosWaitThread
((
PTID
)
&
thread
,
DCWW_WAIT
);
return
0
;
}
static
av_always_inline
int
pthread_mutex_init
(
pthread_mutex_t
*
mutex
,
const
pthread_mutexattr_t
*
attr
)
{
DosCreateMutexSem
(
NULL
,
(
PHMTX
)
mutex
,
0
,
FALSE
);
return
0
;
}
static
av_always_inline
int
pthread_mutex_destroy
(
pthread_mutex_t
*
mutex
)
{
DosCloseMutexSem
(
*
(
PHMTX
)
mutex
);
return
0
;
}
static
av_always_inline
int
pthread_mutex_lock
(
pthread_mutex_t
*
mutex
)
{
DosRequestMutexSem
(
*
(
PHMTX
)
mutex
,
SEM_INDEFINITE_WAIT
);
return
0
;
}
static
av_always_inline
int
pthread_mutex_unlock
(
pthread_mutex_t
*
mutex
)
{
DosReleaseMutexSem
(
*
(
PHMTX
)
mutex
);
return
0
;
}
static
av_always_inline
int
pthread_cond_init
(
pthread_cond_t
*
cond
,
const
pthread_condattr_t
*
attr
)
{
DosCreateEventSem
(
NULL
,
&
cond
->
event_sem
,
DCE_POSTONE
,
FALSE
);
cond
->
wait_count
=
0
;
return
0
;
}
static
av_always_inline
int
pthread_cond_destroy
(
pthread_cond_t
*
cond
)
{
DosCloseEventSem
(
cond
->
event_sem
);
return
0
;
}
static
av_always_inline
int
pthread_cond_signal
(
pthread_cond_t
*
cond
)
{
if
(
cond
->
wait_count
>
0
)
{
DosPostEventSem
(
cond
->
event_sem
);
cond
->
wait_count
--
;
}
return
0
;
}
static
av_always_inline
int
pthread_cond_broadcast
(
pthread_cond_t
*
cond
)
{
while
(
cond
->
wait_count
>
0
)
{
DosPostEventSem
(
cond
->
event_sem
);
cond
->
wait_count
--
;
}
return
0
;
}
static
av_always_inline
int
pthread_cond_wait
(
pthread_cond_t
*
cond
,
pthread_mutex_t
*
mutex
)
{
cond
->
wait_count
++
;
pthread_mutex_unlock
(
mutex
);
DosWaitEventSem
(
cond
->
event_sem
,
SEM_INDEFINITE_WAIT
);
pthread_mutex_lock
(
mutex
);
return
0
;
}
#endif
/* AVCODEC_OS2PTHREADS_H */
libavcodec/pthread.c
浏览文件 @
ad0bdd2f
...
...
@@ -38,6 +38,8 @@
#include <pthread.h>
#elif HAVE_W32THREADS
#include "w32pthreads.h"
#elif HAVE_OS2THREADS
#include "os2threads.h"
#endif
typedef
int
(
action_func
)(
AVCodecContext
*
c
,
void
*
arg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录