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
3e99e7af
authored
Jul 31, 2019
by
olly
Committed by
Oliver Woodman
Aug 01, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Clean up some Ogg comments & document granulePosition
PiperOrigin-RevId: 260947018
parent
b5ca187e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
18 deletions
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/OggPageHeader.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java
View file @
3e99e7af
...
...
@@ -147,12 +147,12 @@ import java.io.IOException;
* which it is sensible to just skip pages to the target granule and pre-roll instead of doing
* another seek request.
*
* @param targetGranule
t
he target granule position to seek to.
* @param input
t
he {@link ExtractorInput} to read from.
* @return
t
he position to seek the {@link ExtractorInput} to for a next call or -(currentGranule
* @param targetGranule
T
he target granule position to seek to.
* @param input
T
he {@link ExtractorInput} to read from.
* @return
T
he position to seek the {@link ExtractorInput} to for a next call or -(currentGranule
* + 2) if it's close enough to skip to the target page.
* @throws IOException
thrown i
f reading from the input fails.
* @throws InterruptedException
thrown i
f interrupted while reading from the input.
* @throws IOException
I
f reading from the input fails.
* @throws InterruptedException
I
f interrupted while reading from the input.
*/
@VisibleForTesting
public
long
getNextSeekPosition
(
long
targetGranule
,
ExtractorInput
input
)
...
...
@@ -263,8 +263,8 @@ import java.io.IOException;
* @param input The {@code ExtractorInput} to skip to the next page.
* @param limit The limit up to which the search should take place.
* @return Whether the next page was found.
* @throws IOException
thrown i
f peeking/reading from the input fails.
* @throws InterruptedException
thrown i
f interrupted while peeking/reading from the input.
* @throws IOException
I
f peeking/reading from the input fails.
* @throws InterruptedException
I
f interrupted while peeking/reading from the input.
*/
@VisibleForTesting
boolean
skipToNextPage
(
ExtractorInput
input
,
long
limit
)
...
...
@@ -321,14 +321,14 @@ import java.io.IOException;
* Skips to the position of the start of the page containing the {@code targetGranule} and returns
* the granule of the page previous to the target page.
*
* @param input
t
he {@link ExtractorInput} to read from.
* @param targetGranule
t
he target granule.
* @param currentGranule
t
he current granule or -1 if it's unknown.
* @return
t
he granule of the prior page or the {@code currentGranule} if there isn't a prior
* @param input
T
he {@link ExtractorInput} to read from.
* @param targetGranule
T
he target granule.
* @param currentGranule
T
he current granule or -1 if it's unknown.
* @return
T
he granule of the prior page or the {@code currentGranule} if there isn't a prior
* page.
* @throws ParserException
thrown i
f populating the page header fails.
* @throws IOException
thrown i
f reading from the input fails.
* @throws InterruptedException
thrown i
f interrupted while reading from the input.
* @throws ParserException
I
f populating the page header fails.
* @throws IOException
I
f reading from the input fails.
* @throws InterruptedException
I
f interrupted while reading from the input.
*/
@VisibleForTesting
long
skipToPageOfGranule
(
ExtractorInput
input
,
long
targetGranule
,
long
currentGranule
)
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/OggPageHeader.java
View file @
3e99e7af
...
...
@@ -38,7 +38,13 @@ import java.io.IOException;
public
int
revision
;
public
int
type
;
/**
* The absolute granule position of the page. This is the total number of samples from the start
* of the file up to the <em>end</em> of the page. Samples partially in the page that continue on
* the next page do not count.
*/
public
long
granulePosition
;
public
long
streamSerialNumber
;
public
long
pageSequenceNumber
;
public
long
pageChecksum
;
...
...
@@ -72,10 +78,10 @@ import java.io.IOException;
* Peeks an Ogg page header and updates this {@link OggPageHeader}.
*
* @param input The {@link ExtractorInput} to read from.
* @param quiet
If {@code true}, no exceptions are thrown but {@code false} is returned if
*
something goes wrong
.
* @return
{@code true} if the read was successful. The read fails if the end of the input is
*
encountered
without reading data.
* @param quiet
Whether to return {@code false} rather than throwing an exception if the header
*
cannot be populated
.
* @return
Whether the read was successful. The read fails if the end of the input is encountered
* without reading data.
* @throws IOException If reading data fails or the stream is invalid.
* @throws InterruptedException If the thread is interrupted.
*/
...
...
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