public static DataSource toDataSource(FileDescriptor fd) { return toDataSource(fd, 0, 0); }
public static DataSource toDataSource(String path) { return new DataSource(path); }
public static DataSource toDataSource(String uri, Map<String, String> headers) { return toDataSource(uri); }
public static DataSource toDataSource(String path) { return new DataSource(path); }
public static DataSource toDataSource(Context context, Uri uri, Map<String, String> headers) { return toDataSource(context, uri); }
public static DataSource toDataSource(String path) { return new DataSource(path); }
@SuppressWarnings("ObjectToString") public static DataSource toDataSource(FileDescriptor fd, long offset, long length) { return toDataSource(fd.toString() + offset); }
public static DataSource toDataSource(Context context, Uri uri) { return toDataSource(uri.toString()); }
/** * Adds the given bitmap at the given time for the given data source. * Uses <tt>path</tt> to call {@link org.robolectric.shadows.util.DataSource#toDataSource(FileDescriptor)} and * then calls {@link #addFrame(DataSource, long, Bitmap)}. This * method is retained mostly for backwards compatibility; * you can call {@link #addFrame(DataSource, long, Bitmap)} directly. * * @param fd file descriptor of the data source. * @param time the playback time at which the specified bitmap * should be retrieved. * @param bitmap the bitmap to retrieve. */ public static void addFrame(FileDescriptor fd, long time, Bitmap bitmap) { addFrame(toDataSource(fd), time, bitmap); }
/** * Adds the given keyCode/value pair for the given data source. * Uses <tt>path</tt> to call {@link org.robolectric.shadows.util.DataSource#toDataSource(String)} and * then calls {@link #addMetadata(DataSource, int, String)}. This * method is retained mostly for backwards compatibility; * you can call {@link #addMetadata(DataSource, int, String)} directly. * * @param path the path to the data source whose metadata is being set. * @param keyCode the keyCode for the metadata being set, as used by {@link MediaMetadataRetriever#extractMetadata(int)}. * @param value the value for the specified metadata. */ public static void addMetadata(String path, int keyCode, String value) { addMetadata(toDataSource(path), keyCode, value); }
/** * Adds the given bitmap at the given time for the given data source. * Uses <tt>path</tt> to call {@link org.robolectric.shadows.util.DataSource#toDataSource(String)} and * then calls {@link #addFrame(DataSource, long, Bitmap)}. This * method is retained mostly for backwards compatibility; * you can call {@link #addFrame(DataSource, long, Bitmap)} directly. * * @param path the path to the data source. * @param time the playback time at which the specified bitmap * should be retrieved. * @param bitmap the bitmap to retrieve. */ public static void addFrame(String path, long time, Bitmap bitmap) { addFrame(toDataSource(path), time, bitmap); }
/** * Adds the given bitmap at the given time for the given data source. * Uses <tt>path</tt> to call {@link org.robolectric.shadows.util.DataSource#toDataSource(Context, Uri)} and * then calls {@link #addFrame(DataSource, long, Bitmap)}. This * method is retained mostly for backwards compatibility; * you can call {@link #addFrame(DataSource, long, Bitmap)} directly. * * @param context the Context object to match on the data source. * @param uri the Uri of the data source. * @param time the playback time at which the specified bitmap * should be retrieved. * @param bitmap the bitmap to retrieve. */ public static void addFrame(Context context, Uri uri, long time, Bitmap bitmap) { addFrame(toDataSource(context, uri), time, bitmap); }
/** * Adds the given bitmap at the given time for the given data source. * Uses <tt>path</tt> to call {@link org.robolectric.shadows.util.DataSource#toDataSource(String, Map)} and * then calls {@link #addFrame(DataSource, long, Bitmap)}. This * method is retained mostly for backwards compatibility; * you can call {@link #addFrame(DataSource, long, Bitmap)} directly. * * @param uri the Uri of the data source. * @param headers the headers to use when requesting the specified uri. * @param time the playback time at which the specified bitmap * should be retrieved. * @param bitmap the bitmap to retrieve. */ public static void addFrame(String uri, Map<String, String> headers, long time, Bitmap bitmap) { addFrame(toDataSource(uri, headers), time, bitmap); }
/** * Adds the given bitmap at the given time for the given data source. * Uses <tt>path</tt> to call {@link org.robolectric.shadows.util.DataSource#toDataSource(FileDescriptor, long, long)} and * then calls {@link #addFrame(DataSource, long, Bitmap)}. This * method is retained mostly for backwards compatibility; * you can call {@link #addFrame(DataSource, long, Bitmap)} directly. * * @param fd file descriptor of the data source. * @param offset the byte offset within the specified file from which to start reading the data. * @param length the number of bytes to read from the file. * @param time the playback time at which the specified bitmap * should be retrieved. * @param bitmap the bitmap to retrieve. */ public static void addFrame(FileDescriptor fd, long offset, long length, long time, Bitmap bitmap) { addFrame(toDataSource(fd, offset, length), time, bitmap); }
@Implementation protected void setDataSource(Context context, Uri uri, Map<String, String> headers) throws IOException { setDataSource(toDataSource(context, uri, headers)); sourceUri = uri; }
@Implementation protected void setDataSource(FileDescriptor fd, long offset, long length) { setDataSource(toDataSource(fd, offset, length)); }
@Implementation protected void setDataSource(String path) throws IOException { setDataSource(toDataSource(path)); }
@Implementation protected void setDataSource(String uri, Map<String, String> headers) { setDataSource(toDataSource(uri, headers)); }
@Implementation protected void setDataSource(String path) { setDataSource(toDataSource(path)); }
@Implementation protected void setDataSource(String uri, Map<String, String> headers) throws IOException { setDataSource(toDataSource(uri, headers)); }