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
2014-11-22 19:16:52 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
0c6282a0483cada5f0741c0100611a97b1a8583a
0c6282a0
2 parents
28ef4e12
3d97048c
Merge branch 'srs.master'
显示空白字符变更
内嵌
并排对比
正在显示
9 个修改的文件
包含
209 行增加
和
1 行删除
trunk/research/players/srs_reuse_conn/.actionScriptProperties
trunk/research/players/srs_reuse_conn/.project
trunk/research/players/srs_reuse_conn/.settings/org.eclipse.core.resources.prefs
trunk/research/players/srs_reuse_conn/FlashCS5UI.swc
trunk/research/players/srs_reuse_conn/release/srs_reuse_conn.swf
trunk/research/players/srs_reuse_conn/src/srs_reuse_conn.as
trunk/src/app/srs_app_recv_thread.cpp
trunk/src/app/srs_app_recv_thread.hpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/research/players/srs_reuse_conn/.actionScriptProperties
0 → 100755
查看文件 @
0c6282a
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<actionScriptProperties
analytics=
"false"
mainApplicationPath=
"srs_reuse_conn.as"
projectUUID=
"ccfd5c0a-9963-467a-8739-75ac79faaef5"
version=
"10"
>
<compiler
additionalCompilerArguments=
"-locale en_US"
autoRSLOrdering=
"true"
copyDependentFiles=
"true"
fteInMXComponents=
"false"
generateAccessible=
"true"
htmlExpressInstall=
"true"
htmlGenerate=
"false"
htmlHistoryManagement=
"true"
htmlPlayerVersionCheck=
"true"
includeNetmonSwc=
"false"
outputFolderPath=
"release"
removeUnusedRSL=
"true"
sourceFolderPath=
"src"
strict=
"true"
targetPlayerVersion=
"0.0.0"
useApolloConfig=
"false"
useDebugRSLSwfs=
"true"
verifyDigests=
"true"
warn=
"true"
>
<compilerSourcePath/>
<libraryPath
defaultLinkType=
"0"
>
<libraryPathEntry
kind=
"4"
path=
""
>
<excludedEntries>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/automation_charts.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"1"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/locale/{locale}"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/advancedgrids.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/qtp.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/automation_air.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/charts.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/framework.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/mx/mx.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/netmon.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/spark.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/sparkskins.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/rpc.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/videoPlayer.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/qtp_air.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/datavisualization.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/spark_dmv.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/automation.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/flash-integration.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc"
useDefaultLinkType=
"false"
/>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"${PROJECT_FRAMEWORKS}/libs/automation_agent.swc"
useDefaultLinkType=
"false"
/>
</excludedEntries>
</libraryPathEntry>
<libraryPathEntry
kind=
"3"
linkType=
"1"
path=
"FlashCS5UI.swc"
useDefaultLinkType=
"false"
/>
</libraryPath>
<sourceAttachmentPath/>
</compiler>
<applications>
<application
path=
"srs_reuse_conn.as"
/>
</applications>
<modules/>
<buildCSSFiles/>
<flashCatalyst
validateFlashCatalystCompatibility=
"false"
/>
</actionScriptProperties>
...
...
trunk/research/players/srs_reuse_conn/.project
0 → 100755
查看文件 @
0c6282a
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
srs_reuse_conn
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
com.adobe.flexbuilder.project.flexbuilder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
com.adobe.flexbuilder.project.actionscriptnature
</nature>
</natures>
</projectDescription>
...
...
trunk/research/players/srs_reuse_conn/.settings/org.eclipse.core.resources.prefs
0 → 100644
查看文件 @
0c6282a
#Sat Nov 22 18:40:22 CST 2014
eclipse.preferences.version=1
encoding/<project>=utf-8
...
...
trunk/research/players/srs_reuse_conn/FlashCS5UI.swc
0 → 100644
查看文件 @
0c6282a
不能预览此文件类型
trunk/research/players/srs_reuse_conn/release/srs_reuse_conn.swf
0 → 100644
查看文件 @
0c6282a
不能预览此文件类型
trunk/research/players/srs_reuse_conn/src/srs_reuse_conn.as
0 → 100644
查看文件 @
0c6282a
package
{
import
fl
.
controls
.
Button
;
import
fl
.
controls
.
TextInput
;
import
flash
.
display
.
Sprite
;
import
flash
.
display
.
StageAlign
;
import
flash
.
display
.
StageScaleMode
;
import
flash
.
events
.
Event
;
import
flash
.
events
.
MouseEvent
;
import
flash
.
events
.
NetStatusEvent
;
import
flash
.
media
.
Video
;
import
flash
.
net
.
NetConnection
;
import
flash
.
net
.
NetStream
;
[
SWF
(
backgroundColor
=
"0xEEEEEE"
,
frameRate
=
"30"
,
width
=
"1024"
,
height
=
"576"
)]
public
class
srs_reuse_conn
extends
Sprite
{
public
function
srs_reuse_conn
()
{
if
(
stage
)
{
onAddedToStage
(
null
)
;
}
else
{
addEventListener
(
Event
.
ADDED_TO_STAGE
,
onAddedToStage
)
;
}
}
private
function
onAddedToStage
(
evt
:
Event
)
:
void
{
stage
.
align
=
StageAlign
.
TOP_LEFT
;
stage
.
scaleMode
=
StageScaleMode
.
NO_SCALE
;
var
txtUrl
:
TextInput
=
new
TextInput
()
;
var
btnConn
:
Button
=
new
Button
()
;
var
btnPlay
:
Button
=
new
Button
()
;
txtUrl
.
x
=
10
;
txtUrl
.
y
=
10
;
txtUrl
.
width
=
400
;
txtUrl
.
text
=
"rtmp://dev/live/livestream"
;
addChild
(
txtUrl
)
;
btnConn
.
label
=
"Connect"
;
btnConn
.
x
=
txtUrl
.
x
+
txtUrl
.
width
+
10
;
btnConn
.
y
=
txtUrl
.
y
;
btnConn
.
width
=
100
;
addChild
(
btnConn
)
;
btnPlay
.
label
=
"Play"
;
btnPlay
.
x
=
btnConn
.
x
+
btnConn
.
width
+
10
;
btnPlay
.
y
=
btnConn
.
y
;
btnPlay
.
width
=
100
;
addChild
(
btnPlay
)
;
var
video
:
Video
=
new
Video
()
;
video
.
x
=
txtUrl
.
x
;
video
.
y
=
txtUrl
.
y
+
txtUrl
.
height
+
10
;
addChild
(
video
)
;
var
conn
:
NetConnection
=
null
;
var
stream
:
NetStream
=
null
;
var
tcUrl
:
Function
=
function
()
:
String
{
var
url
:
String
=
txtUrl
.
text
;
return
url
.
substr
(
0
,
url
.
lastIndexOf
(
"/"
))
;
}
var
streamName
:
Function
=
function
()
:
String
{
var
url
:
String
=
txtUrl
.
text
;
return
url
.
substr
(
tcUrl
().
length
+
1
)
;
}
var
closeConnection
:
Function
=
function
()
:
void
{
if
(
stream
)
{
stream
.
close
()
;
stream
=
null
;
}
if
(
conn
)
{
conn
.
close
()
;
conn
=
null
;
}
btnConn
.
label
=
"Connect"
;
btnPlay
.
visible
=
false
;
}
;
btnPlay
.
visible
=
false
;
btnConn
.
addEventListener
(
MouseEvent
.
CLICK
,
function
(
e
:
MouseEvent
)
:
void
{
if
(
btnConn
.
label
==
"Connect"
)
{
conn
=
new
NetConnection
()
;
conn
.
client
=
{
onBWDone
:
function
():
void
{}
}
;
conn
.
addEventListener
(
NetStatusEvent
.
NET_STATUS
,
function
(
ne
:
NetStatusEvent
):
void
{
if
(
ne
.
info
.
code
==
"NetConnection.Connect.Success"
)
{
btnPlay
.
visible
=
true
;
}
else
if
(
ne
.
info
.
code
==
"NetConnection.Connect.Closed"
)
{
closeConnection
()
;
}
trace
(
ne
.
info
.
code
)
;
})
;
conn
.
connect
(
tcUrl
())
;
btnConn
.
label
=
"Close"
;
}
else
{
closeConnection
()
;
}
})
;
btnPlay
.
addEventListener
(
MouseEvent
.
CLICK
,
function
(
e
:
MouseEvent
)
:
void
{
if
(
stream
)
{
stream
.
close
()
;
stream
=
null
;
}
stream
=
new
NetStream
(
conn
)
;
stream
.
client
=
{
onMetaData
:
function
(
metadata
:
Object
):
void
{
video
.
width
=
metadata
.
width
;
video
.
height
=
metadata
.
height
;
}
}
;
video
.
attachNetStream
(
stream
)
;
stream
.
play
(
streamName
())
;
})
;
}
}
}
\ No newline at end of file
...
...
trunk/src/app/srs_app_recv_thread.cpp
查看文件 @
0c6282a
...
...
@@ -54,6 +54,11 @@ bool SrsRecvThread::empty()
return
queue
.
empty
();
}
int
SrsRecvThread
::
size
()
{
return
(
int
)
queue
.
size
();
}
SrsMessage
*
SrsRecvThread
::
pump
()
{
srs_assert
(
!
queue
.
empty
());
...
...
@@ -79,6 +84,15 @@ int SrsRecvThread::cycle()
{
int
ret
=
ERROR_SUCCESS
;
// we only recv one message and then process it,
// for the message may cause the thread to stop,
// when stop, the thread is freed, so the messages
// are dropped.
if
(
!
queue
.
empty
())
{
st_usleep
(
SRS_CONSTS_RTMP_PULSE_TIMEOUT_US
);
return
ret
;
}
SrsMessage
*
msg
=
NULL
;
if
((
ret
=
rtmp
->
recv_message
(
&
msg
))
!=
ERROR_SUCCESS
)
{
...
...
@@ -93,6 +107,10 @@ int SrsRecvThread::cycle()
}
srs_verbose
(
"play loop recv message. ret=%d"
,
ret
);
// put into queue, the send thread will get and process it,
// @see SrsRtmpConn::process_play_control_msg
queue
.
push_back
(
msg
);
return
ret
;
}
...
...
trunk/src/app/srs_app_recv_thread.hpp
查看文件 @
0c6282a
...
...
@@ -54,6 +54,7 @@ public:
virtual
~
SrsRecvThread
();
public
:
virtual
bool
empty
();
virtual
int
size
();
virtual
SrsMessage
*
pump
();
public
:
virtual
int
start
();
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
0c6282a
...
...
@@ -514,6 +514,11 @@ int SrsRtmpConn::playing(SrsSource* source)
// stop isolate recv thread
trd
.
stop
();
// warn for the message is dropped.
if
(
!
trd
.
empty
())
{
srs_warn
(
"drop the received %d messages"
,
trd
.
size
());
}
return
ret
;
}
...
...
@@ -549,7 +554,7 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsRecvThread* trd)
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
while
(
!
trd
->
empty
())
{
SrsMessage
*
msg
=
trd
->
pump
();
srs_
warn
(
"pump client message to process."
);
srs_
verbose
(
"pump client message to process."
);
if
((
ret
=
process_play_control_msg
(
consumer
,
msg
))
!=
ERROR_SUCCESS
)
{
if
(
!
srs_is_system_control_error
(
ret
))
{
...
...
请
注册
或
登录
后发表评论