Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2de0771d authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "MediaExtractor.setDataSource(...) has always thrown IOExceptions from" into jb-mr2-dev

parents 5c5c3f3a a57da0dc
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -11817,10 +11817,10 @@ package android.media {
    method public void seekTo(long, int);
    method public void selectTrack(int);
    method public final void setDataSource(android.content.Context, android.net.Uri, java.util.Map<java.lang.String, java.lang.String>) throws java.io.IOException;
    method public final void setDataSource(java.lang.String, java.util.Map<java.lang.String, java.lang.String>);
    method public final void setDataSource(java.lang.String);
    method public final void setDataSource(java.io.FileDescriptor);
    method public final void setDataSource(java.io.FileDescriptor, long, long);
    method public final void setDataSource(java.lang.String, java.util.Map<java.lang.String, java.lang.String>) throws java.io.IOException;
    method public final void setDataSource(java.lang.String) throws java.io.IOException;
    method public final void setDataSource(java.io.FileDescriptor) throws java.io.IOException;
    method public final void setDataSource(java.io.FileDescriptor, long, long) throws java.io.IOException;
    method public void unselectTrack(int);
    field public static final int SAMPLE_FLAG_ENCRYPTED = 2; // 0x2
    field public static final int SAMPLE_FLAG_SYNC = 1; // 0x1
+7 −6
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ final public class MediaExtractor {
     * Sets the DataSource object to be used as the data source for this extractor
     * {@hide}
     */
    public native final void setDataSource(DataSource source);
    public native final void setDataSource(DataSource source) throws IOException;

    /**
     * Sets the data source as a content Uri.
@@ -121,7 +121,8 @@ final public class MediaExtractor {
     * @param path the path of the file, or the http URL
     * @param headers the headers associated with the http request for the stream you want to play
     */
    public final void setDataSource(String path, Map<String, String> headers) {
    public final void setDataSource(String path, Map<String, String> headers)
        throws IOException {
        String[] keys = null;
        String[] values = null;

@@ -140,7 +141,7 @@ final public class MediaExtractor {
    }

    private native final void setDataSource(
            String path, String[] keys, String[] values);
            String path, String[] keys, String[] values) throws IOException;

    /**
     * Sets the data source (file-path or http URL) to use.
@@ -154,7 +155,7 @@ final public class MediaExtractor {
     * As an alternative, the application could first open the file for reading,
     * and then use the file descriptor form {@link #setDataSource(FileDescriptor)}.
     */
    public final void setDataSource(String path) {
    public final void setDataSource(String path) throws IOException {
        setDataSource(path, null, null);
    }

@@ -164,7 +165,7 @@ final public class MediaExtractor {
     *
     * @param fd the FileDescriptor for the file you want to extract from.
     */
    public final void setDataSource(FileDescriptor fd) {
    public final void setDataSource(FileDescriptor fd) throws IOException {
        setDataSource(fd, 0, 0x7ffffffffffffffL);
    }

@@ -178,7 +179,7 @@ final public class MediaExtractor {
     * @param length the length in bytes of the data to be extracted
     */
    public native final void setDataSource(
            FileDescriptor fd, long offset, long length);
            FileDescriptor fd, long offset, long length) throws IOException;

    @Override
    protected void finalize() {