Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
28166d8c
authored
Feb 13, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Rename ParsableByteArray.length() to limit(). Add capacity().
parent
321005e4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
8 deletions
library/src/main/java/com/google/android/exoplayer/chunk/parser/mp4/FragmentedMp4Extractor.java
library/src/main/java/com/google/android/exoplayer/chunk/parser/mp4/TrackFragment.java
library/src/main/java/com/google/android/exoplayer/hls/parser/AdtsReader.java
library/src/main/java/com/google/android/exoplayer/hls/parser/H264Reader.java
library/src/main/java/com/google/android/exoplayer/util/ParsableByteArray.java
library/src/main/java/com/google/android/exoplayer/chunk/parser/mp4/FragmentedMp4Extractor.java
View file @
28166d8c
...
@@ -638,7 +638,7 @@ public final class FragmentedMp4Extractor implements Extractor {
...
@@ -638,7 +638,7 @@ public final class FragmentedMp4Extractor implements Extractor {
}
}
Arrays
.
fill
(
out
.
sampleHasSubsampleEncryptionTable
,
0
,
sampleCount
,
subsampleEncryption
);
Arrays
.
fill
(
out
.
sampleHasSubsampleEncryptionTable
,
0
,
sampleCount
,
subsampleEncryption
);
out
.
initEncryptionData
(
senc
.
length
()
-
senc
.
getPosition
());
out
.
initEncryptionData
(
senc
.
bytesLeft
());
out
.
fillEncryptionData
(
senc
);
out
.
fillEncryptionData
(
senc
);
}
}
...
@@ -696,7 +696,7 @@ public final class FragmentedMp4Extractor implements Extractor {
...
@@ -696,7 +696,7 @@ public final class FragmentedMp4Extractor implements Extractor {
offset
+=
sizes
[
i
];
offset
+=
sizes
[
i
];
}
}
return
new
SegmentIndex
(
atom
.
l
ength
(),
sizes
,
offsets
,
durationsUs
,
timesUs
);
return
new
SegmentIndex
(
atom
.
l
imit
(),
sizes
,
offsets
,
durationsUs
,
timesUs
);
}
}
private
int
readEncryptionData
(
NonBlockingInputStream
inputStream
)
{
private
int
readEncryptionData
(
NonBlockingInputStream
inputStream
)
{
...
...
library/src/main/java/com/google/android/exoplayer/chunk/parser/mp4/TrackFragment.java
View file @
28166d8c
...
@@ -113,7 +113,7 @@ import com.google.android.exoplayer.util.ParsableByteArray;
...
@@ -113,7 +113,7 @@ import com.google.android.exoplayer.util.ParsableByteArray;
* @param length The length in bytes of the encryption data.
* @param length The length in bytes of the encryption data.
*/
*/
public
void
initEncryptionData
(
int
length
)
{
public
void
initEncryptionData
(
int
length
)
{
if
(
sampleEncryptionData
==
null
||
sampleEncryptionData
.
l
ength
()
<
length
)
{
if
(
sampleEncryptionData
==
null
||
sampleEncryptionData
.
l
imit
()
<
length
)
{
sampleEncryptionData
=
new
ParsableByteArray
(
length
);
sampleEncryptionData
=
new
ParsableByteArray
(
length
);
}
}
sampleEncryptionDataLength
=
length
;
sampleEncryptionDataLength
=
length
;
...
...
library/src/main/java/com/google/android/exoplayer/hls/parser/AdtsReader.java
View file @
28166d8c
...
@@ -128,7 +128,7 @@ import java.util.Collections;
...
@@ -128,7 +128,7 @@ import java.util.Collections;
private
boolean
skipToNextSync
(
ParsableByteArray
pesBuffer
)
{
private
boolean
skipToNextSync
(
ParsableByteArray
pesBuffer
)
{
byte
[]
adtsData
=
pesBuffer
.
data
;
byte
[]
adtsData
=
pesBuffer
.
data
;
int
startOffset
=
pesBuffer
.
getPosition
();
int
startOffset
=
pesBuffer
.
getPosition
();
int
endOffset
=
pesBuffer
.
l
ength
();
int
endOffset
=
pesBuffer
.
l
imit
();
for
(
int
i
=
startOffset
;
i
<
endOffset
;
i
++)
{
for
(
int
i
=
startOffset
;
i
<
endOffset
;
i
++)
{
boolean
byteIsOxFF
=
(
adtsData
[
i
]
&
0xFF
)
==
0xFF
;
boolean
byteIsOxFF
=
(
adtsData
[
i
]
&
0xFF
)
==
0xFF
;
boolean
found
=
lastByteWasOxFF
&&
!
byteIsOxFF
&&
(
adtsData
[
i
]
&
0xF0
)
==
0xF0
;
boolean
found
=
lastByteWasOxFF
&&
!
byteIsOxFF
&&
(
adtsData
[
i
]
&
0xF0
)
==
0xF0
;
...
...
library/src/main/java/com/google/android/exoplayer/hls/parser/H264Reader.java
View file @
28166d8c
...
@@ -90,7 +90,7 @@ import java.util.List;
...
@@ -90,7 +90,7 @@ import java.util.List;
*/
*/
private
boolean
readToNextAudUnit
(
ParsableByteArray
data
,
long
pesTimeUs
)
{
private
boolean
readToNextAudUnit
(
ParsableByteArray
data
,
long
pesTimeUs
)
{
int
pesOffset
=
data
.
getPosition
();
int
pesOffset
=
data
.
getPosition
();
int
pesLimit
=
data
.
l
ength
();
int
pesLimit
=
data
.
l
imit
();
// TODO: We probably need to handle the case where the AUD start code was split across the
// TODO: We probably need to handle the case where the AUD start code was split across the
// previous and current data buffers.
// previous and current data buffers.
...
...
library/src/main/java/com/google/android/exoplayer/util/ParsableByteArray.java
View file @
28166d8c
...
@@ -73,9 +73,8 @@ public final class ParsableByteArray {
...
@@ -73,9 +73,8 @@ public final class ParsableByteArray {
return
limit
-
position
;
return
limit
-
position
;
}
}
/** Returns the number of bytes in the array. */
/** Returns the limit. */
// TODO: Rename to limit.
public
int
limit
()
{
public
int
length
()
{
return
limit
;
return
limit
;
}
}
...
@@ -94,6 +93,11 @@ public final class ParsableByteArray {
...
@@ -94,6 +93,11 @@ public final class ParsableByteArray {
return
position
;
return
position
;
}
}
/** Returns the capacity of the array, which may be larger than the limit. */
public
int
capacity
()
{
return
data
==
null
?
0
:
data
.
length
;
}
/**
/**
* Sets the reading offset in the array.
* Sets the reading offset in the array.
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment