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-07-06 17:12:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
574cd15efbd44f012feddc0769f6f9d6cfbb12f7
574cd15e
1 parent
c31c607a
refine amf0, rename internal classes
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
134 行增加
和
104 行删除
trunk/src/rtmp/srs_protocol_amf0.cpp
trunk/src/rtmp/srs_protocol_amf0.hpp
trunk/src/rtmp/srs_protocol_amf0.cpp
查看文件 @
574cd15
...
...
@@ -116,28 +116,28 @@ bool SrsAmf0Any::is_complex_object()
string
SrsAmf0Any
::
to_str
()
{
__SrsAmf0String
*
p
=
dynamic_cast
<
__
SrsAmf0String
*>
(
this
);
SrsAmf0String
*
p
=
dynamic_cast
<
SrsAmf0String
*>
(
this
);
srs_assert
(
p
!=
NULL
);
return
p
->
value
;
}
const
char
*
SrsAmf0Any
::
to_str_raw
()
{
__SrsAmf0String
*
p
=
dynamic_cast
<
__
SrsAmf0String
*>
(
this
);
SrsAmf0String
*
p
=
dynamic_cast
<
SrsAmf0String
*>
(
this
);
srs_assert
(
p
!=
NULL
);
return
p
->
value
.
data
();
}
bool
SrsAmf0Any
::
to_boolean
()
{
__SrsAmf0Boolean
*
p
=
dynamic_cast
<
__
SrsAmf0Boolean
*>
(
this
);
SrsAmf0Boolean
*
p
=
dynamic_cast
<
SrsAmf0Boolean
*>
(
this
);
srs_assert
(
p
!=
NULL
);
return
p
->
value
;
}
double
SrsAmf0Any
::
to_number
()
{
__SrsAmf0Number
*
p
=
dynamic_cast
<
__
SrsAmf0Number
*>
(
this
);
SrsAmf0Number
*
p
=
dynamic_cast
<
SrsAmf0Number
*>
(
this
);
srs_assert
(
p
!=
NULL
);
return
p
->
value
;
}
...
...
@@ -165,7 +165,7 @@ SrsAmf0StrictArray* SrsAmf0Any::to_strict_array()
void
SrsAmf0Any
::
set_number
(
double
value
)
{
__SrsAmf0Number
*
p
=
dynamic_cast
<
__
SrsAmf0Number
*>
(
this
);
SrsAmf0Number
*
p
=
dynamic_cast
<
SrsAmf0Number
*>
(
this
);
srs_assert
(
p
!=
NULL
);
p
->
value
=
value
;
}
...
...
@@ -261,27 +261,27 @@ char* SrsAmf0Any::human_print(char** pdata, int* psize)
SrsAmf0Any
*
SrsAmf0Any
::
str
(
const
char
*
value
)
{
return
new
__
SrsAmf0String
(
value
);
return
new
SrsAmf0String
(
value
);
}
SrsAmf0Any
*
SrsAmf0Any
::
boolean
(
bool
value
)
{
return
new
__
SrsAmf0Boolean
(
value
);
return
new
SrsAmf0Boolean
(
value
);
}
SrsAmf0Any
*
SrsAmf0Any
::
number
(
double
value
)
{
return
new
__
SrsAmf0Number
(
value
);
return
new
SrsAmf0Number
(
value
);
}
SrsAmf0Any
*
SrsAmf0Any
::
null
()
{
return
new
__
SrsAmf0Null
();
return
new
SrsAmf0Null
();
}
SrsAmf0Any
*
SrsAmf0Any
::
undefined
()
{
return
new
__
SrsAmf0Undefined
();
return
new
SrsAmf0Undefined
();
}
SrsAmf0Object
*
SrsAmf0Any
::
object
()
...
...
@@ -291,7 +291,7 @@ SrsAmf0Object* SrsAmf0Any::object()
SrsAmf0Any
*
SrsAmf0Any
::
object_eof
()
{
return
new
__
SrsAmf0ObjectEOF
();
return
new
SrsAmf0ObjectEOF
();
}
SrsAmf0EcmaArray
*
SrsAmf0Any
::
ecma_array
()
...
...
@@ -310,7 +310,7 @@ int SrsAmf0Any::discovery(SrsStream* stream, SrsAmf0Any** ppvalue)
// detect the object-eof specially
if
(
srs_amf0_is_object_eof
(
stream
))
{
*
ppvalue
=
new
__
SrsAmf0ObjectEOF
();
*
ppvalue
=
new
SrsAmf0ObjectEOF
();
return
ret
;
}
...
...
@@ -371,21 +371,21 @@ int SrsAmf0Any::discovery(SrsStream* stream, SrsAmf0Any** ppvalue)
return
ret
;
}
__SrsUnSortedHashtable
::
__
SrsUnSortedHashtable
()
SrsUnSortedHashtable
::
SrsUnSortedHashtable
()
{
}
__SrsUnSortedHashtable
::~
__
SrsUnSortedHashtable
()
SrsUnSortedHashtable
::~
SrsUnSortedHashtable
()
{
clear
();
}
int
__
SrsUnSortedHashtable
::
count
()
int
SrsUnSortedHashtable
::
count
()
{
return
(
int
)
properties
.
size
();
}
void
__
SrsUnSortedHashtable
::
clear
()
void
SrsUnSortedHashtable
::
clear
()
{
std
::
vector
<
SrsAmf0ObjectPropertyType
>::
iterator
it
;
for
(
it
=
properties
.
begin
();
it
!=
properties
.
end
();
++
it
)
{
...
...
@@ -396,28 +396,28 @@ void __SrsUnSortedHashtable::clear()
properties
.
clear
();
}
string
__
SrsUnSortedHashtable
::
key_at
(
int
index
)
string
SrsUnSortedHashtable
::
key_at
(
int
index
)
{
srs_assert
(
index
<
count
());
SrsAmf0ObjectPropertyType
&
elem
=
properties
[
index
];
return
elem
.
first
;
}
const
char
*
__
SrsUnSortedHashtable
::
key_raw_at
(
int
index
)
const
char
*
SrsUnSortedHashtable
::
key_raw_at
(
int
index
)
{
srs_assert
(
index
<
count
());
SrsAmf0ObjectPropertyType
&
elem
=
properties
[
index
];
return
elem
.
first
.
data
();
}
SrsAmf0Any
*
__
SrsUnSortedHashtable
::
value_at
(
int
index
)
SrsAmf0Any
*
SrsUnSortedHashtable
::
value_at
(
int
index
)
{
srs_assert
(
index
<
count
());
SrsAmf0ObjectPropertyType
&
elem
=
properties
[
index
];
return
elem
.
second
;
}
void
__
SrsUnSortedHashtable
::
set
(
string
key
,
SrsAmf0Any
*
value
)
void
SrsUnSortedHashtable
::
set
(
string
key
,
SrsAmf0Any
*
value
)
{
if
(
!
value
)
{
srs_warn
(
"add a NULL propertity %s"
,
key
.
c_str
());
...
...
@@ -441,7 +441,7 @@ void __SrsUnSortedHashtable::set(string key, SrsAmf0Any* value)
properties
.
push_back
(
std
::
make_pair
(
key
,
value
));
}
SrsAmf0Any
*
__
SrsUnSortedHashtable
::
get_property
(
string
name
)
SrsAmf0Any
*
SrsUnSortedHashtable
::
get_property
(
string
name
)
{
std
::
vector
<
SrsAmf0ObjectPropertyType
>::
iterator
it
;
...
...
@@ -457,7 +457,7 @@ SrsAmf0Any* __SrsUnSortedHashtable::get_property(string name)
return
NULL
;
}
SrsAmf0Any
*
__
SrsUnSortedHashtable
::
ensure_property_string
(
string
name
)
SrsAmf0Any
*
SrsUnSortedHashtable
::
ensure_property_string
(
string
name
)
{
SrsAmf0Any
*
prop
=
get_property
(
name
);
...
...
@@ -472,7 +472,7 @@ SrsAmf0Any* __SrsUnSortedHashtable::ensure_property_string(string name)
return
prop
;
}
SrsAmf0Any
*
__
SrsUnSortedHashtable
::
ensure_property_number
(
string
name
)
SrsAmf0Any
*
SrsUnSortedHashtable
::
ensure_property_number
(
string
name
)
{
SrsAmf0Any
*
prop
=
get_property
(
name
);
...
...
@@ -487,7 +487,7 @@ SrsAmf0Any* __SrsUnSortedHashtable::ensure_property_number(string name)
return
prop
;
}
void
__SrsUnSortedHashtable
::
copy
(
__
SrsUnSortedHashtable
*
src
)
void
SrsUnSortedHashtable
::
copy
(
SrsUnSortedHashtable
*
src
)
{
std
::
vector
<
SrsAmf0ObjectPropertyType
>::
iterator
it
;
for
(
it
=
src
->
properties
.
begin
();
it
!=
src
->
properties
.
end
();
++
it
)
{
...
...
@@ -498,22 +498,22 @@ void __SrsUnSortedHashtable::copy(__SrsUnSortedHashtable* src)
}
}
__SrsAmf0ObjectEOF
::
__
SrsAmf0ObjectEOF
()
SrsAmf0ObjectEOF
::
SrsAmf0ObjectEOF
()
{
marker
=
RTMP_AMF0_ObjectEnd
;
utf8_empty
=
0x00
;
}
__SrsAmf0ObjectEOF
::~
__
SrsAmf0ObjectEOF
()
SrsAmf0ObjectEOF
::~
SrsAmf0ObjectEOF
()
{
}
int
__
SrsAmf0ObjectEOF
::
total_size
()
int
SrsAmf0ObjectEOF
::
total_size
()
{
return
SrsAmf0Size
::
object_eof
();
}
int
__
SrsAmf0ObjectEOF
::
read
(
SrsStream
*
stream
)
int
SrsAmf0ObjectEOF
::
read
(
SrsStream
*
stream
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -551,7 +551,7 @@ int __SrsAmf0ObjectEOF::read(SrsStream* stream)
return
ret
;
}
int
__
SrsAmf0ObjectEOF
::
write
(
SrsStream
*
stream
)
int
SrsAmf0ObjectEOF
::
write
(
SrsStream
*
stream
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -578,15 +578,15 @@ int __SrsAmf0ObjectEOF::write(SrsStream* stream)
return
ret
;
}
SrsAmf0Any
*
__
SrsAmf0ObjectEOF
::
copy
()
SrsAmf0Any
*
SrsAmf0ObjectEOF
::
copy
()
{
return
new
__
SrsAmf0ObjectEOF
();
return
new
SrsAmf0ObjectEOF
();
}
SrsAmf0Object
::
SrsAmf0Object
()
{
properties
=
new
__SrsUnSortedHashtable
();
eof
=
new
__SrsAmf0ObjectEOF
();
properties
=
new
SrsUnSortedHashtable
();
eof
=
new
SrsAmf0ObjectEOF
();
marker
=
RTMP_AMF0_Object
;
}
...
...
@@ -637,7 +637,7 @@ int SrsAmf0Object::read(SrsStream* stream)
while
(
!
stream
->
empty
())
{
// detect whether is eof.
if
(
srs_amf0_is_object_eof
(
stream
))
{
__
SrsAmf0ObjectEOF
pbj_eof
;
SrsAmf0ObjectEOF
pbj_eof
;
if
((
ret
=
pbj_eof
.
read
(
stream
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"amf0 object read eof failed. ret=%d"
,
ret
);
return
ret
;
...
...
@@ -765,8 +765,8 @@ SrsAmf0Any* SrsAmf0Object::ensure_property_number(string name)
SrsAmf0EcmaArray
::
SrsAmf0EcmaArray
()
{
_count
=
0
;
properties
=
new
__SrsUnSortedHashtable
();
eof
=
new
__SrsAmf0ObjectEOF
();
properties
=
new
SrsUnSortedHashtable
();
eof
=
new
SrsAmf0ObjectEOF
();
marker
=
RTMP_AMF0_EcmaArray
;
}
...
...
@@ -829,7 +829,7 @@ int SrsAmf0EcmaArray::read(SrsStream* stream)
while
(
!
stream
->
empty
())
{
// detect whether is eof.
if
(
srs_amf0_is_object_eof
(
stream
))
{
__
SrsAmf0ObjectEOF
pbj_eof
;
SrsAmf0ObjectEOF
pbj_eof
;
if
((
ret
=
pbj_eof
.
read
(
stream
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"amf0 ecma_array read eof failed. ret=%d"
,
ret
);
return
ret
;
...
...
@@ -1186,7 +1186,7 @@ int SrsAmf0Size::any(SrsAmf0Any* o)
return
o
->
total_size
();
}
__SrsAmf0String
::
__
SrsAmf0String
(
const
char
*
_value
)
SrsAmf0String
::
SrsAmf0String
(
const
char
*
_value
)
{
marker
=
RTMP_AMF0_String
;
if
(
_value
)
{
...
...
@@ -1194,150 +1194,150 @@ __SrsAmf0String::__SrsAmf0String(const char* _value)
}
}
__SrsAmf0String
::~
__
SrsAmf0String
()
SrsAmf0String
::~
SrsAmf0String
()
{
}
int
__
SrsAmf0String
::
total_size
()
int
SrsAmf0String
::
total_size
()
{
return
SrsAmf0Size
::
str
(
value
);
}
int
__
SrsAmf0String
::
read
(
SrsStream
*
stream
)
int
SrsAmf0String
::
read
(
SrsStream
*
stream
)
{
return
srs_amf0_read_string
(
stream
,
value
);
}
int
__
SrsAmf0String
::
write
(
SrsStream
*
stream
)
int
SrsAmf0String
::
write
(
SrsStream
*
stream
)
{
return
srs_amf0_write_string
(
stream
,
value
);
}
SrsAmf0Any
*
__
SrsAmf0String
::
copy
()
SrsAmf0Any
*
SrsAmf0String
::
copy
()
{
__SrsAmf0String
*
copy
=
new
__
SrsAmf0String
(
value
.
c_str
());
SrsAmf0String
*
copy
=
new
SrsAmf0String
(
value
.
c_str
());
return
copy
;
}
__SrsAmf0Boolean
::
__
SrsAmf0Boolean
(
bool
_value
)
SrsAmf0Boolean
::
SrsAmf0Boolean
(
bool
_value
)
{
marker
=
RTMP_AMF0_Boolean
;
value
=
_value
;
}
__SrsAmf0Boolean
::~
__
SrsAmf0Boolean
()
SrsAmf0Boolean
::~
SrsAmf0Boolean
()
{
}
int
__
SrsAmf0Boolean
::
total_size
()
int
SrsAmf0Boolean
::
total_size
()
{
return
SrsAmf0Size
::
boolean
();
}
int
__
SrsAmf0Boolean
::
read
(
SrsStream
*
stream
)
int
SrsAmf0Boolean
::
read
(
SrsStream
*
stream
)
{
return
srs_amf0_read_boolean
(
stream
,
value
);
}
int
__
SrsAmf0Boolean
::
write
(
SrsStream
*
stream
)
int
SrsAmf0Boolean
::
write
(
SrsStream
*
stream
)
{
return
srs_amf0_write_boolean
(
stream
,
value
);
}
SrsAmf0Any
*
__
SrsAmf0Boolean
::
copy
()
SrsAmf0Any
*
SrsAmf0Boolean
::
copy
()
{
__SrsAmf0Boolean
*
copy
=
new
__
SrsAmf0Boolean
(
value
);
SrsAmf0Boolean
*
copy
=
new
SrsAmf0Boolean
(
value
);
return
copy
;
}
__SrsAmf0Number
::
__
SrsAmf0Number
(
double
_value
)
SrsAmf0Number
::
SrsAmf0Number
(
double
_value
)
{
marker
=
RTMP_AMF0_Number
;
value
=
_value
;
}
__SrsAmf0Number
::~
__
SrsAmf0Number
()
SrsAmf0Number
::~
SrsAmf0Number
()
{
}
int
__
SrsAmf0Number
::
total_size
()
int
SrsAmf0Number
::
total_size
()
{
return
SrsAmf0Size
::
number
();
}
int
__
SrsAmf0Number
::
read
(
SrsStream
*
stream
)
int
SrsAmf0Number
::
read
(
SrsStream
*
stream
)
{
return
srs_amf0_read_number
(
stream
,
value
);
}
int
__
SrsAmf0Number
::
write
(
SrsStream
*
stream
)
int
SrsAmf0Number
::
write
(
SrsStream
*
stream
)
{
return
srs_amf0_write_number
(
stream
,
value
);
}
SrsAmf0Any
*
__
SrsAmf0Number
::
copy
()
SrsAmf0Any
*
SrsAmf0Number
::
copy
()
{
__SrsAmf0Number
*
copy
=
new
__
SrsAmf0Number
(
value
);
SrsAmf0Number
*
copy
=
new
SrsAmf0Number
(
value
);
return
copy
;
}
__SrsAmf0Null
::
__
SrsAmf0Null
()
SrsAmf0Null
::
SrsAmf0Null
()
{
marker
=
RTMP_AMF0_Null
;
}
__SrsAmf0Null
::~
__
SrsAmf0Null
()
SrsAmf0Null
::~
SrsAmf0Null
()
{
}
int
__
SrsAmf0Null
::
total_size
()
int
SrsAmf0Null
::
total_size
()
{
return
SrsAmf0Size
::
null
();
}
int
__
SrsAmf0Null
::
read
(
SrsStream
*
stream
)
int
SrsAmf0Null
::
read
(
SrsStream
*
stream
)
{
return
srs_amf0_read_null
(
stream
);
}
int
__
SrsAmf0Null
::
write
(
SrsStream
*
stream
)
int
SrsAmf0Null
::
write
(
SrsStream
*
stream
)
{
return
srs_amf0_write_null
(
stream
);
}
SrsAmf0Any
*
__
SrsAmf0Null
::
copy
()
SrsAmf0Any
*
SrsAmf0Null
::
copy
()
{
__SrsAmf0Null
*
copy
=
new
__
SrsAmf0Null
();
SrsAmf0Null
*
copy
=
new
SrsAmf0Null
();
return
copy
;
}
__SrsAmf0Undefined
::
__
SrsAmf0Undefined
()
SrsAmf0Undefined
::
SrsAmf0Undefined
()
{
marker
=
RTMP_AMF0_Undefined
;
}
__SrsAmf0Undefined
::~
__
SrsAmf0Undefined
()
SrsAmf0Undefined
::~
SrsAmf0Undefined
()
{
}
int
__
SrsAmf0Undefined
::
total_size
()
int
SrsAmf0Undefined
::
total_size
()
{
return
SrsAmf0Size
::
undefined
();
}
int
__
SrsAmf0Undefined
::
read
(
SrsStream
*
stream
)
int
SrsAmf0Undefined
::
read
(
SrsStream
*
stream
)
{
return
srs_amf0_read_undefined
(
stream
);
}
int
__
SrsAmf0Undefined
::
write
(
SrsStream
*
stream
)
int
SrsAmf0Undefined
::
write
(
SrsStream
*
stream
)
{
return
srs_amf0_write_undefined
(
stream
);
}
SrsAmf0Any
*
__
SrsAmf0Undefined
::
copy
()
SrsAmf0Any
*
SrsAmf0Undefined
::
copy
()
{
__SrsAmf0Undefined
*
copy
=
new
__
SrsAmf0Undefined
();
SrsAmf0Undefined
*
copy
=
new
SrsAmf0Undefined
();
return
copy
;
}
...
...
@@ -1703,7 +1703,7 @@ namespace _srs_internal
return
false
;
}
int
srs_amf0_write_object_eof
(
SrsStream
*
stream
,
__
SrsAmf0ObjectEOF
*
value
)
int
srs_amf0_write_object_eof
(
SrsStream
*
stream
,
SrsAmf0ObjectEOF
*
value
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/rtmp/srs_protocol_amf0.hpp
查看文件 @
574cd15
...
...
@@ -41,8 +41,8 @@ class SrsAmf0StrictArray;
// internal objects, user should never use it.
namespace
_srs_internal
{
class
__SrsUnSortedHashtable
;
class
__SrsAmf0ObjectEOF
;
class
SrsUnSortedHashtable
;
class
SrsAmf0ObjectEOF
;
}
/*
...
...
@@ -317,8 +317,8 @@ public:
class
SrsAmf0Object
:
public
SrsAmf0Any
{
private
:
_srs_internal
::
__SrsUnSortedHashtable
*
properties
;
_srs_internal
::
__SrsAmf0ObjectEOF
*
eof
;
_srs_internal
::
SrsUnSortedHashtable
*
properties
;
_srs_internal
::
SrsAmf0ObjectEOF
*
eof
;
private
:
friend
class
SrsAmf0Any
;
/**
...
...
@@ -399,8 +399,8 @@ public:
class
SrsAmf0EcmaArray
:
public
SrsAmf0Any
{
private
:
_srs_internal
::
__SrsUnSortedHashtable
*
properties
;
_srs_internal
::
__SrsAmf0ObjectEOF
*
eof
;
_srs_internal
::
SrsUnSortedHashtable
*
properties
;
_srs_internal
::
SrsAmf0ObjectEOF
*
eof
;
int32_t
_count
;
private
:
friend
class
SrsAmf0Any
;
...
...
@@ -600,13 +600,19 @@ namespace _srs_internal
* @return default value is empty string.
* @remark: use SrsAmf0Any::str() to create it.
*/
class
__
SrsAmf0String
:
public
SrsAmf0Any
class
SrsAmf0String
:
public
SrsAmf0Any
{
public
:
std
::
string
value
;
private
:
friend
class
SrsAmf0Any
;
/**
* make amf0 string to private,
* use should never declare it, use SrsAmf0Any::str() to create it.
*/
SrsAmf0String
(
const
char
*
_value
);
public
:
__SrsAmf0String
(
const
char
*
_value
);
virtual
~
__SrsAmf0String
();
virtual
~
SrsAmf0String
();
public
:
virtual
int
total_size
();
virtual
int
read
(
SrsStream
*
stream
);
...
...
@@ -621,13 +627,19 @@ namespace _srs_internal
* 0 is false, <> 0 is true
* @return default value is false.
*/
class
__
SrsAmf0Boolean
:
public
SrsAmf0Any
class
SrsAmf0Boolean
:
public
SrsAmf0Any
{
public
:
bool
value
;
private
:
friend
class
SrsAmf0Any
;
/**
* make amf0 boolean to private,
* use should never declare it, use SrsAmf0Any::boolean() to create it.
*/
SrsAmf0Boolean
(
bool
_value
);
public
:
__SrsAmf0Boolean
(
bool
_value
);
virtual
~
__SrsAmf0Boolean
();
virtual
~
SrsAmf0Boolean
();
public
:
virtual
int
total_size
();
virtual
int
read
(
SrsStream
*
stream
);
...
...
@@ -641,13 +653,19 @@ namespace _srs_internal
* number-type = number-marker DOUBLE
* @return default value is 0.
*/
class
__
SrsAmf0Number
:
public
SrsAmf0Any
class
SrsAmf0Number
:
public
SrsAmf0Any
{
public
:
double
value
;
private
:
friend
class
SrsAmf0Any
;
/**
* make amf0 number to private,
* use should never declare it, use SrsAmf0Any::number() to create it.
*/
SrsAmf0Number
(
double
_value
);
public
:
__SrsAmf0Number
(
double
_value
);
virtual
~
__SrsAmf0Number
();
virtual
~
SrsAmf0Number
();
public
:
virtual
int
total_size
();
virtual
int
read
(
SrsStream
*
stream
);
...
...
@@ -660,11 +678,17 @@ namespace _srs_internal
* 2.7 null Type
* null-type = null-marker
*/
class
__
SrsAmf0Null
:
public
SrsAmf0Any
class
SrsAmf0Null
:
public
SrsAmf0Any
{
private
:
friend
class
SrsAmf0Any
;
/**
* make amf0 null to private,
* use should never declare it, use SrsAmf0Any::null() to create it.
*/
SrsAmf0Null
();
public
:
__SrsAmf0Null
();
virtual
~
__SrsAmf0Null
();
virtual
~
SrsAmf0Null
();
public
:
virtual
int
total_size
();
virtual
int
read
(
SrsStream
*
stream
);
...
...
@@ -677,11 +701,17 @@ namespace _srs_internal
* 2.8 undefined Type
* undefined-type = undefined-marker
*/
class
__
SrsAmf0Undefined
:
public
SrsAmf0Any
class
SrsAmf0Undefined
:
public
SrsAmf0Any
{
private
:
friend
class
SrsAmf0Any
;
/**
* make amf0 undefined to private,
* use should never declare it, use SrsAmf0Any::undefined() to create it.
*/
SrsAmf0Undefined
();
public
:
__SrsAmf0Undefined
();
virtual
~
__SrsAmf0Undefined
();
virtual
~
SrsAmf0Undefined
();
public
:
virtual
int
total_size
();
virtual
int
read
(
SrsStream
*
stream
);
...
...
@@ -695,14 +725,14 @@ namespace _srs_internal
* if ordered in map, the string compare order, the FMLE will creash when
* get the response of connect app.
*/
class
__
SrsUnSortedHashtable
class
SrsUnSortedHashtable
{
private
:
typedef
std
::
pair
<
std
::
string
,
SrsAmf0Any
*>
SrsAmf0ObjectPropertyType
;
std
::
vector
<
SrsAmf0ObjectPropertyType
>
properties
;
public
:
__SrsUnSortedHashtable
();
virtual
~
__SrsUnSortedHashtable
();
SrsUnSortedHashtable
();
virtual
~
SrsUnSortedHashtable
();
public
:
virtual
int
count
();
virtual
void
clear
();
...
...
@@ -715,7 +745,7 @@ namespace _srs_internal
virtual
SrsAmf0Any
*
ensure_property_string
(
std
::
string
name
);
virtual
SrsAmf0Any
*
ensure_property_number
(
std
::
string
name
);
public
:
virtual
void
copy
(
__
SrsUnSortedHashtable
*
src
);
virtual
void
copy
(
SrsUnSortedHashtable
*
src
);
};
/**
...
...
@@ -723,14 +753,14 @@ namespace _srs_internal
* object-end-type = UTF-8-empty object-end-marker
* 0x00 0x00 0x09
*/
class
__
SrsAmf0ObjectEOF
:
public
SrsAmf0Any
class
SrsAmf0ObjectEOF
:
public
SrsAmf0Any
{
public
:
int16_t
utf8_empty
;
__SrsAmf0ObjectEOF
();
virtual
~
__SrsAmf0ObjectEOF
();
public
:
SrsAmf0ObjectEOF
();
virtual
~
SrsAmf0ObjectEOF
();
public
:
virtual
int
total_size
();
virtual
int
read
(
SrsStream
*
stream
);
virtual
int
write
(
SrsStream
*
stream
);
...
...
@@ -749,7 +779,7 @@ namespace _srs_internal
extern
int
srs_amf0_write_utf8
(
SrsStream
*
stream
,
std
::
string
value
);
extern
bool
srs_amf0_is_object_eof
(
SrsStream
*
stream
);
extern
int
srs_amf0_write_object_eof
(
SrsStream
*
stream
,
__
SrsAmf0ObjectEOF
*
value
);
extern
int
srs_amf0_write_object_eof
(
SrsStream
*
stream
,
SrsAmf0ObjectEOF
*
value
);
extern
int
srs_amf0_write_any
(
SrsStream
*
stream
,
SrsAmf0Any
*
value
);
};
...
...
请
注册
或
登录
后发表评论