Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-08-28 18:00:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1b1a2a1e638720d4c79432175531bb902e864045
1b1a2a1e
1 parent
04bea781
fix #471, api response the width and height. 3.0.2
隐藏空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
33 行增加
和
9 行删除
README.md
trunk/src/app/srs_app_http_api.cpp
trunk/src/app/srs_app_source.cpp
trunk/src/app/srs_app_statistic.cpp
trunk/src/app/srs_app_statistic.hpp
trunk/src/core/srs_core.hpp
trunk/src/kernel/srs_kernel_error.hpp
README.md
查看文件 @
1b1a2a1
...
...
@@ -345,6 +345,7 @@ Remark:
## History
*
v3.0, 2015-08-28, fix
[
#471
][
bug #471
]
, api response the width and height. 3.0.2
*
v3.0, 2015-08-25, fix
[
#367
](
https://github.com/simple-rtmp-server/srs/issues/367
)
, support nginx-rtmp exec. 3.0.1
*
<strong>
v2.0, 2015-08-23,
[
2.0 alpha(2.0.185)
](
https://github.com/simple-rtmp-server/srs/releases/tag/2.0a0
)
released. 89022 lines.
</strong>
*
v2.0, 2015-08-22, HTTP API support JSONP by specifies the query string callback=xxx.
...
...
@@ -1001,6 +1002,7 @@ Winlin
[
bug #133
]:
https://github.com/simple-rtmp-server/srs/issues/133
[
bug #92
]:
https://github.com/simple-rtmp-server/srs/issues/92
[
bug #367
]:
https://github.com/simple-rtmp-server/srs/issues/367
[
bug #471
]:
https://github.com/simple-rtmp-server/srs/issues/471
[
contact
]:
https://github.com/simple-rtmp-server/srs/wiki/v1_CN_Contact
...
...
trunk/src/app/srs_app_http_api.cpp
查看文件 @
1b1a2a1
...
...
@@ -695,7 +695,7 @@ int SrsGoApiVhosts::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
SrsStatisticVhost
*
vhost
=
NULL
;
if
(
vid
>
0
&&
(
vhost
=
stat
->
find_vhost
(
vid
))
==
NULL
)
{
ret
=
ERROR_RTMP_
STREAM
_NOT_FOUND
;
ret
=
ERROR_RTMP_
VHOST
_NOT_FOUND
;
srs_error
(
"vhost id=%d not found. ret=%d"
,
vid
,
ret
);
return
srs_api_response_code
(
w
,
r
,
ret
);
}
...
...
@@ -750,7 +750,7 @@ int SrsGoApiStreams::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
SrsStatisticStream
*
stream
=
NULL
;
if
(
sid
>=
0
&&
(
stream
=
stat
->
find_stream
(
sid
))
==
NULL
)
{
ret
=
ERROR_RTMP_STREAM_NOT_FOUND
;
srs_error
(
"stream
stream_
id=%d not found. ret=%d"
,
sid
,
ret
);
srs_error
(
"stream id=%d not found. ret=%d"
,
sid
,
ret
);
return
srs_api_response_code
(
w
,
r
,
ret
);
}
...
...
@@ -803,8 +803,8 @@ int SrsGoApiClients::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
SrsStatisticClient
*
client
=
NULL
;
if
(
cid
>=
0
&&
(
client
=
stat
->
find_client
(
cid
))
==
NULL
)
{
ret
=
ERROR_RTMP_STREAM_NOT_FOUND
;
srs_error
(
"stream client_id=%d not found. ret=%d"
,
cid
,
ret
);
ret
=
ERROR_RTMP_CLIENT_NOT_FOUND
;
srs_error
(
"client id=%d not found. ret=%d"
,
cid
,
ret
);
return
srs_api_response_code
(
w
,
r
,
ret
);
}
...
...
@@ -830,6 +830,15 @@ int SrsGoApiClients::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
return
srs_api_response_code
(
w
,
r
,
ret
);
}
}
}
else
if
(
r
->
is_http_delete
())
{
if
(
!
client
)
{
ret
=
ERROR_RTMP_CLIENT_NOT_FOUND
;
srs_error
(
"client id=%d not found. ret=%d"
,
cid
,
ret
);
return
srs_api_response_code
(
w
,
r
,
ret
);
}
client
->
conn
->
expire
();
srs_warn
(
"kickoff client id=%d"
,
cid
);
}
else
{
return
srs_go_http_error
(
w
,
SRS_CONSTS_HTTP_MethodNotAllowed
);
}
...
...
trunk/src/app/srs_app_source.cpp
查看文件 @
1b1a2a1
...
...
@@ -1893,7 +1893,7 @@ int SrsSource::on_video_imp(SrsSharedPtrMessage* msg)
// when got video stream info.
SrsStatistic
*
stat
=
SrsStatistic
::
instance
();
if
((
ret
=
stat
->
on_video_info
(
_req
,
SrsCodecVideoAVC
,
codec
.
avc_profile
,
codec
.
avc_level
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
stat
->
on_video_info
(
_req
,
SrsCodecVideoAVC
,
codec
.
avc_profile
,
codec
.
avc_level
,
codec
.
width
,
codec
.
height
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
trunk/src/app/srs_app_statistic.cpp
查看文件 @
1b1a2a1
...
...
@@ -108,6 +108,8 @@ SrsStatisticStream::SrsStatisticStream()
asample_rate
=
SrsCodecAudioSampleRateReserved
;
asound_type
=
SrsCodecAudioSoundTypeReserved
;
aac_object
=
SrsAacObjectTypeReserved
;
width
=
0
;
height
=
0
;
kbps
=
new
SrsKbps
();
kbps
->
set_io
(
NULL
,
NULL
);
...
...
@@ -154,6 +156,8 @@ int SrsStatisticStream::dumps(SrsAmf0Object* obj)
video
->
set
(
"codec"
,
SrsAmf0Any
::
str
(
srs_codec_video2str
(
vcodec
).
c_str
()));
video
->
set
(
"profile"
,
SrsAmf0Any
::
str
(
srs_codec_avc_profile2str
(
avc_profile
).
c_str
()));
video
->
set
(
"level"
,
SrsAmf0Any
::
str
(
srs_codec_avc_level2str
(
avc_level
).
c_str
()));
video
->
set
(
"width"
,
SrsAmf0Any
::
number
(
width
));
video
->
set
(
"height"
,
SrsAmf0Any
::
number
(
height
));
}
if
(
!
has_audio
)
{
...
...
@@ -216,7 +220,7 @@ int SrsStatisticClient::dumps(SrsAmf0Object* obj)
obj
->
set
(
"url"
,
SrsAmf0Any
::
str
(
req
->
get_stream_url
().
c_str
()));
obj
->
set
(
"type"
,
SrsAmf0Any
::
str
(
srs_client_type_string
(
type
).
c_str
()));
obj
->
set
(
"publish"
,
SrsAmf0Any
::
boolean
(
srs_client_type_is_publish
(
type
)));
obj
->
set
(
"alive"
,
SrsAmf0Any
::
number
(
srs_get_system_time_ms
()
-
create
));
obj
->
set
(
"alive"
,
SrsAmf0Any
::
number
(
(
srs_get_system_time_ms
()
-
create
)
/
1000.0
));
return
ret
;
}
...
...
@@ -305,7 +309,8 @@ SrsStatisticClient* SrsStatistic::find_client(int cid)
}
int
SrsStatistic
::
on_video_info
(
SrsRequest
*
req
,
SrsCodecVideo
vcodec
,
SrsAvcProfile
avc_profile
,
SrsAvcLevel
avc_level
SrsCodecVideo
vcodec
,
SrsAvcProfile
avc_profile
,
SrsAvcLevel
avc_level
,
int
width
,
int
height
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -317,6 +322,9 @@ int SrsStatistic::on_video_info(SrsRequest* req,
stream
->
avc_profile
=
avc_profile
;
stream
->
avc_level
=
avc_level
;
stream
->
width
=
width
;
stream
->
height
=
height
;
return
ret
;
}
...
...
trunk/src/app/srs_app_statistic.hpp
查看文件 @
1b1a2a1
...
...
@@ -84,6 +84,9 @@ public:
SrsAvcProfile
avc_profile
;
// level_idc, H.264-AVC-ISO_IEC_14496-10.pdf, page 45.
SrsAvcLevel
avc_level
;
// the width and height in codec info.
int
width
;
int
height
;
public
:
bool
has_audio
;
SrsCodecAudio
acodec
;
...
...
@@ -166,7 +169,8 @@ public:
* when got video info for stream.
*/
virtual
int
on_video_info
(
SrsRequest
*
req
,
SrsCodecVideo
vcodec
,
SrsAvcProfile
avc_profile
,
SrsAvcLevel
avc_level
SrsCodecVideo
vcodec
,
SrsAvcProfile
avc_profile
,
SrsAvcLevel
avc_level
,
int
width
,
int
height
);
/**
* when got audio info for stream.
...
...
trunk/src/core/srs_core.hpp
查看文件 @
1b1a2a1
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
#define VERSION_REVISION
1
#define VERSION_REVISION
2
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
trunk/src/kernel/srs_kernel_error.hpp
查看文件 @
1b1a2a1
...
...
@@ -154,6 +154,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define ERROR_RTP_TYPE97_CORRUPT 2046
#define ERROR_RTSP_AUDIO_CONFIG 2047
#define ERROR_RTMP_STREAM_NOT_FOUND 2048
#define ERROR_RTMP_CLIENT_NOT_FOUND 2049
//
// system control message,
// not an error, but special control logic.
...
...
请
注册
或
登录
后发表评论