Java Code Examples for com.google.android.exoplayer2.C#DEFAULT_BUFFER_SEGMENT_SIZE

The following examples show how to use com.google.android.exoplayer2.C#DEFAULT_BUFFER_SEGMENT_SIZE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DownloadHelper.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
public MediaPreparer(MediaSource mediaSource, DownloadHelper downloadHelper) {
  this.mediaSource = mediaSource;
  this.downloadHelper = downloadHelper;
  allocator = new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE);
  pendingMediaPeriods = new ArrayList<>();
  @SuppressWarnings("methodref.receiver.bound.invalid")
  Handler downloadThreadHandler = Util.createHandler(this::handleDownloadHelperCallbackMessage);
  this.downloadHelperHandler = downloadThreadHandler;
  mediaSourceThread = new HandlerThread("DownloadHelper");
  mediaSourceThread.start();
  mediaSourceHandler = Util.createHandler(mediaSourceThread.getLooper(), /* callback= */ this);
  mediaSourceHandler.sendEmptyMessage(MESSAGE_PREPARE_SOURCE);
}
 
Example 2
Source File: DownloadHelper.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public MediaPreparer(MediaSource mediaSource, DownloadHelper downloadHelper) {
  this.mediaSource = mediaSource;
  this.downloadHelper = downloadHelper;
  allocator = new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE);
  pendingMediaPeriods = new ArrayList<>();
  @SuppressWarnings("methodref.receiver.bound.invalid")
  Handler downloadThreadHandler = Util.createHandler(this::handleDownloadHelperCallbackMessage);
  this.downloadHelperHandler = downloadThreadHandler;
  mediaSourceThread = new HandlerThread("DownloadHelper");
  mediaSourceThread.start();
  mediaSourceHandler = Util.createHandler(mediaSourceThread.getLooper(), /* callback= */ this);
  mediaSourceHandler.sendEmptyMessage(MESSAGE_PREPARE_SOURCE);
}
 
Example 3
Source File: DownloadHelper.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public MediaPreparer(MediaSource mediaSource, DownloadHelper downloadHelper) {
  this.mediaSource = mediaSource;
  this.downloadHelper = downloadHelper;
  allocator = new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE);
  pendingMediaPeriods = new ArrayList<>();
  @SuppressWarnings("methodref.receiver.bound.invalid")
  Handler downloadThreadHandler = Util.createHandler(this::handleDownloadHelperCallbackMessage);
  this.downloadHelperHandler = downloadThreadHandler;
  mediaSourceThread = new HandlerThread("DownloadHelper");
  mediaSourceThread.start();
  mediaSourceHandler = Util.createHandler(mediaSourceThread.getLooper(), /* callback= */ this);
  mediaSourceHandler.sendEmptyMessage(MESSAGE_PREPARE_SOURCE);
}