Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈小冬
ijkplayer
提交
e1862af2
I
ijkplayer
项目概览
陈小冬
/
ijkplayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
ijkplayer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e1862af2
编写于
9月 09, 2020
作者:
Y
yangdan07
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(utility.h): delete the utility.h
上级
1d29db83
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
208 deletion
+0
-208
ijkmedia/ijkplayer/utility.h
ijkmedia/ijkplayer/utility.h
+0
-207
ios/IJKMediaDemo/IJKMediaDemo/IJKMoviePlayerViewController.h
ios/IJKMediaDemo/IJKMediaDemo/IJKMoviePlayerViewController.h
+0
-1
未找到文件。
ijkmedia/ijkplayer/utility.h
已删除
100644 → 0
浏览文件 @
1d29db83
#pragma once
#include <stdint.h>
#ifdef _WIN32
#include <winsock2.h>
#pragma comment(lib,"ws2_32.lib")
#else
#include <arpa/inet.h>
#endif
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <chrono>
#include <random>
#include <functional>
#include <unordered_map>
using
namespace
std
;
namespace
kuaishou
{
namespace
kpbase
{
class
NonCopyable
{
protected:
NonCopyable
()
{}
virtual
~
NonCopyable
()
{}
private:
NonCopyable
(
NonCopyable
const
&
)
=
delete
;
NonCopyable
&
operator
=
(
NonCopyable
const
&
)
=
delete
;
NonCopyable
(
NonCopyable
&&
)
=
delete
;
NonCopyable
&
operator
=
(
NonCopyable
&&
)
=
delete
;
};
template
<
typename
T
>
class
Nullable
{
public:
Nullable
()
:
is_null_
(
true
)
{}
Nullable
(
const
T
&
v
)
:
value_
(
v
),
is_null_
(
false
)
{}
Nullable
(
const
Nullable
&
o
)
:
value_
(
o
.
value_
),
is_null_
(
o
.
is_null_
)
{}
bool
IsNull
()
{
return
is_null_
;
}
const
T
&
Value
()
const
{
return
value_
;
}
operator
T
()
const
{
return
value_
;
}
private:
T
value_
;
bool
is_null_
;
};
class
SystemUtil
{
public:
static
uint64_t
GetCPUTime
();
static
uint64_t
GetEpochTime
();
static
unordered_map
<
string
,
string
>
GetLocalIPs
();
static
string
GetDocumentPath
();
static
string
GetExecFilePath
();
static
string
GetTimeString
(
uint64_t
ms_epoch
,
int
timezone
,
bool
with_delimiter
=
true
);
static
string
GetDayString
(
uint64_t
ms_epoch
,
int
timezone
);
static
string
GetHourString
(
uint64_t
ms_epoch
,
int
timezone
);
static
string
GetSystemOSVersion
();
static
string
GetDeviceModel
();
//static bool EnableCrashDump(void(*log_func)(const char*));
private:
SystemUtil
();
};
class
StringUtil
{
public:
static
string
Int2Str
(
long
long
val
);
static
string
Uint2Str
(
unsigned
long
long
val
);
static
Nullable
<
long
long
>
Str2Int
(
string
str
);
static
Nullable
<
unsigned
long
long
>
Str2Uint
(
string
str
);
static
string
GetHumanReadableString
(
int64_t
val
);
static
string
ConcealStr
(
const
string
&
src
);
static
string
UnConcealStr
(
const
string
&
src
);
static
string
Trim
(
const
string
&
src
);
static
bool
EndWith
(
const
string
&
origin
,
const
string
&
substr
);
static
bool
StartWith
(
const
string
&
origin
,
const
string
&
substr
);
static
vector
<
string
>
Split
(
const
string
&
str
,
const
string
&
pattern
);
static
string
UrlEncode
(
const
string
&
str
);
static
string
HmacSha1
(
const
void
*
data
,
size_t
data_len
,
const
void
*
key
,
size_t
key_len
);
static
string
Replace
(
string
&
str
,
const
string
&
old_value
,
const
string
&
new_value
);
private:
StringUtil
();
};
class
SocketUtil
{
public:
SocketUtil
()
=
delete
;
SocketUtil
(
const
SocketUtil
&
)
=
delete
;
static
bool
FillInSockaddr
(
const
char
*
ip
,
uint16_t
port
,
void
*
sockaddr
,
size_t
*
addrlen
);
static
pair
<
string
,
uint16_t
>
GetAddress
(
const
struct
sockaddr
*
addr
);
};
template
<
class
T
>
class
Singleton
{
public:
static
T
&
GetInstance
()
{
static
T
instance
;
return
instance
;
}
};
template
<
class
TimeUnit
>
class
Profiler
{
public:
Profiler
(
uint64_t
*
val
=
nullptr
,
function
<
void
(
uint64_t
)
>
finish_func
=
nullptr
)
:
val_
(
val
),
finish_func_
(
finish_func
),
start_
(
chrono
::
steady_clock
::
now
())
{}
~
Profiler
()
{
chrono
::
steady_clock
::
duration
delta
=
chrono
::
steady_clock
::
now
()
-
start_
;
uint64_t
diff
=
chrono
::
duration_cast
<
TimeUnit
>
(
delta
).
count
();
if
(
val_
)
*
val_
=
diff
;
if
(
finish_func_
)
finish_func_
(
diff
);
}
uint64_t
GetTime
()
{
chrono
::
steady_clock
::
duration
delta
=
chrono
::
steady_clock
::
now
()
-
start_
;
uint64_t
diff
=
chrono
::
duration_cast
<
TimeUnit
>
(
delta
).
count
();
return
diff
;
}
private:
uint64_t
*
val_
;
function
<
void
(
uint64_t
)
>
finish_func_
;
chrono
::
steady_clock
::
time_point
start_
;
};
template
<
typename
T
>
class
ArrayUtil
{
public:
static
void
EnsureArraySize
(
T
*&
array
,
size_t
&
array_size
,
size_t
new_size
)
{
if
(
array_size
<
new_size
)
{
T
*
new_array
=
new
T
[
new_size
];
if
(
array
)
{
memcpy
(
new_array
,
array
,
sizeof
(
T
)
*
array_size
);
delete
[]
array
;
}
array
=
new_array
;
array_size
=
new_size
;
}
}
};
template
<
class
T1
,
class
T2
,
class
T3
>
struct
Trituple
{
T1
first
;
T2
second
;
T3
third
;
};
// lack of support for range > int32
template
<
class
IntType
=
int
>
class
UniformRandomIntGenerator
{
public:
explicit
UniformRandomIntGenerator
(
IntType
a
=
0
,
IntType
b
=
std
::
numeric_limits
<
IntType
>::
max
())
:
dis_
(
a
,
b
)
{
std
::
random_device
rd
;
gen_
.
seed
(
rd
());
}
~
UniformRandomIntGenerator
()
{}
IntType
Next
()
{
return
dis_
(
gen_
);
}
private:
std
::
mt19937
gen_
;
std
::
uniform_int_distribution
<
IntType
>
dis_
;
};
template
<
class
RealType
=
double
>
class
UniformRandomRealGenerator
{
public:
explicit
UniformRandomRealGenerator
(
RealType
a
=
0
,
RealType
b
=
std
::
numeric_limits
<
RealType
>::
max
())
:
dis_
(
a
,
b
)
{
std
::
random_device
rd
;
gen_
.
seed
(
rd
());
}
~
UniformRandomRealGenerator
()
{}
RealType
Next
()
{
return
dis_
(
gen_
);
}
private:
std
::
mt19937
gen_
;
std
::
uniform_real_distribution
<
RealType
>
dis_
;
};
}
}
ios/IJKMediaDemo/IJKMediaDemo/IJKMoviePlayerViewController.h
浏览文件 @
e1862af2
...
...
@@ -23,7 +23,6 @@
@property
(
atomic
,
strong
)
NSURL
*
url
;
@property
(
strong
,
nonatomic
)
NSDictionary
*
headers
;
@property
(
strong
,
nonatomic
)
NSString
*
manifest
;
@property
(
atomic
,
retain
)
id
<
IJKMediaPlayback
>
player
;
-
(
id
)
initWithURL
:(
NSURL
*
)
url
manifest_string
:(
NSString
*
)
manifest_string
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录