Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libjitsi
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZRTP
libjitsi
Commits
9bac3ea9
Commit
9bac3ea9
authored
11 years ago
by
Lyubomir Marinov
Browse files
Options
Downloads
Patches
Plain Diff
Fixes formatting.
parent
3f0c269e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/org/jitsi/impl/neomedia/codec/video/vp8/DePacketizer.java
+45
-43
45 additions, 43 deletions
...org/jitsi/impl/neomedia/codec/video/vp8/DePacketizer.java
with
45 additions
and
43 deletions
src/org/jitsi/impl/neomedia/codec/video/vp8/DePacketizer.java
+
45
−
43
View file @
9bac3ea9
...
...
@@ -18,9 +18,9 @@
*
* It is not yet fully compliant with the draft above, it can't successfully
* process all valid streams.
* It works by concatenating packets' payload (stripping the payload
descriptor),
* until it encounters a packet with it's Start of Partition bit
set, at which
* point it outputs the concatenated data and starts again.
* It works by concatenating packets' payload (stripping the payload
*
descriptor),
until it encounters a packet with it's Start of Partition bit
*
set, at which
point it outputs the concatenated data and starts again.
*
* @author Boris Grozev
*/
...
...
@@ -41,7 +41,7 @@ public class DePacketizer
/**
* Certain output will only be logged if this is set to true in addition to
* 'trace' being enable in the logger. This is because the output is long
* and would be rarely used and to let compiler optimi
s
e the conditionals.
* and would be rarely used and to let compiler optimi
z
e the conditionals.
*/
private
static
final
boolean
TRACE
=
false
;
...
...
@@ -102,12 +102,12 @@ protected void doOpen() throws ResourceUnavailableException
* {@inheritDoc}
*/
@Override
protected
int
doProcess
(
Buffer
in
put
Buffer
,
Buffer
out
put
Buffer
)
protected
int
doProcess
(
Buffer
inBuffer
,
Buffer
outBuffer
)
{
int
ret
;
byte
[]
in
put
=
(
byte
[])
in
put
Buffer
.
getData
();
boolean
start
=
VP8PayloadDescriptor
.
isStartOfPartition
(
in
put
,
in
put
Buffer
.
getOffset
());
byte
[]
in
=
(
byte
[])
inBuffer
.
getData
();
boolean
start
=
VP8PayloadDescriptor
.
isStartOfPartition
(
in
,
inBuffer
.
getOffset
());
if
(
waitForNewStart
)
{
if
(
start
)
...
...
@@ -116,7 +116,7 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer)
}
else
{
out
put
Buffer
.
setDiscard
(
true
);
outBuffer
.
setDiscard
(
true
);
return
BUFFER_PROCESSED_OK
;
}
}
...
...
@@ -124,34 +124,34 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer)
int
pdSize
;
try
{
pdSize
=
VP8PayloadDescriptor
.
getSize
(
in
put
,
in
put
Buffer
.
getOffset
());
pdSize
=
VP8PayloadDescriptor
.
getSize
(
in
,
inBuffer
.
getOffset
());
}
catch
(
Exception
e
)
{
out
put
Buffer
.
setDiscard
(
true
);
outBuffer
.
setDiscard
(
true
);
return
BUFFER_PROCESSED_FAILED
;
}
if
(
logger
.
isTraceEnabled
()
&&
TRACE
)
if
(
TRACE
&&
logger
.
isTraceEnabled
())
{
logger
.
trace
(
"Packet: "
+
inputBuffer
.
getSequenceNumber
()
+
", length="
+
inputBuffer
.
getLength
()
+
", pdSize="
+
pdSize
+
", start="
+
start
+
"\nPayload descriptor:"
);
for
(
int
i
=
inputBuffer
.
getOffset
();
i
<
inputBuffer
.
getOffset
()
+
pdSize
+
1
;
i
++)
logger
.
trace
(
"Packet: "
+
inBuffer
.
getSequenceNumber
()
+
", length="
+
inBuffer
.
getLength
()
+
", pdSize="
+
pdSize
+
", start="
+
start
+
"\nPayload descriptor:"
);
for
(
int
i
=
inBuffer
.
getOffset
();
i
<
inBuffer
.
getOffset
()
+
pdSize
+
1
;
i
++)
{
logger
.
trace
(
"\t\t"
+
((
input
[
i
]&
0x80
)==
0
?
"0"
:
"1"
)
+
((
input
[
i
]&
0x40
)==
0
?
"0"
:
"1"
)
+
((
input
[
i
]&
0x20
)==
0
?
"0"
:
"1"
)
+
((
input
[
i
]&
0x10
)==
0
?
"0"
:
"1"
)
+
((
input
[
i
]&
0x08
)==
0
?
"0"
:
"1"
)
+
((
input
[
i
]&
0x04
)==
0
?
"0"
:
"1"
)
+
((
input
[
i
]&
0x02
)==
0
?
"0"
:
"1"
)
+
((
input
[
i
]&
0x01
)==
0
?
"0"
:
"1"
));
logger
.
trace
(
"\t\t"
+
((
in
[
i
]&
0x80
)==
0
?
"0"
:
"1"
)
+
((
in
[
i
]&
0x40
)==
0
?
"0"
:
"1"
)
+
((
in
[
i
]&
0x20
)==
0
?
"0"
:
"1"
)
+
((
in
[
i
]&
0x10
)==
0
?
"0"
:
"1"
)
+
((
in
[
i
]&
0x08
)==
0
?
"0"
:
"1"
)
+
((
in
[
i
]&
0x04
)==
0
?
"0"
:
"1"
)
+
((
in
[
i
]&
0x02
)==
0
?
"0"
:
"1"
)
+
((
in
[
i
]&
0x01
)==
0
?
"0"
:
"1"
));
}
}
...
...
@@ -161,13 +161,12 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer)
if
(
logger
.
isTraceEnabled
())
logger
.
trace
(
"Sending a frame, size="
+
bufferPointer
);
byte
[]
output
=
validateByteArraySize
(
outputBuffer
,
bufferPointer
,
false
);
byte
[]
out
=
validateByteArraySize
(
outBuffer
,
bufferPointer
,
false
);
System
.
arraycopy
(
buffer
,
0
,
out
put
,
0
,
bufferPointer
);
out
put
Buffer
.
setFormat
(
new
VideoFormat
(
Constants
.
VP8
));
out
put
Buffer
.
setLength
(
bufferPointer
);
out
put
Buffer
.
setOffset
(
0
);
System
.
arraycopy
(
buffer
,
0
,
out
,
0
,
bufferPointer
);
outBuffer
.
setFormat
(
new
VideoFormat
(
Constants
.
VP8
));
outBuffer
.
setLength
(
bufferPointer
);
outBuffer
.
setOffset
(
0
);
bufferPointer
=
0
;
ret
=
BUFFER_PROCESSED_OK
;
...
...
@@ -177,27 +176,30 @@ protected int doProcess(Buffer inputBuffer, Buffer outputBuffer)
ret
=
OUTPUT_BUFFER_NOT_FILLED
;
}
int
len
=
in
put
Buffer
.
getLength
();
int
len
=
inBuffer
.
getLength
();
if
(
bufferPointer
+
len
-
pdSize
>=
BUFFER_SIZE
)
{
//our buffer is not big enough
bufferPointer
=
0
;
out
put
Buffer
.
setDiscard
(
true
);
outBuffer
.
setDiscard
(
true
);
waitForNewStart
=
true
;
return
BUFFER_PROCESSED_FAILED
;
}
System
.
arraycopy
(
in
put
,
in
put
Buffer
.
getOffset
()
+
pdSize
,
System
.
arraycopy
(
in
,
inBuffer
.
getOffset
()
+
pdSize
,
buffer
,
bufferPointer
,
len
-
pdSize
);
bufferPointer
+=
len
-
pdSize
;
if
(
logger
.
isTraceEnabled
()
&&
TRACE
)
logger
.
trace
(
"Saving payload to buffer, seq num:"
+
inputBuffer
.
getSequenceNumber
()
+
", bufferPointer="
+
bufferPointer
);
if
(
TRACE
&&
logger
.
isTraceEnabled
())
{
logger
.
trace
(
"Saving payload to buffer, seq num:"
+
inBuffer
.
getSequenceNumber
()
+
", bufferPointer="
+
bufferPointer
);
}
haveSent
=
true
;
return
ret
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment