当前位置: 首页>>代码示例>>Java>>正文


Java Util.getRemainderDataSpec方法代码示例

本文整理汇总了Java中com.google.android.exoplayer.util.Util.getRemainderDataSpec方法的典型用法代码示例。如果您正苦于以下问题:Java Util.getRemainderDataSpec方法的具体用法?Java Util.getRemainderDataSpec怎么用?Java Util.getRemainderDataSpec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.exoplayer.util.Util的用法示例。


在下文中一共展示了Util.getRemainderDataSpec方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: load

import com.google.android.exoplayer.util.Util; //导入方法依赖的package包/类
@SuppressWarnings("NonAtomicVolatileUpdate")
@Override
public void load() throws IOException, InterruptedException {
  DataSpec loadDataSpec = Util.getRemainderDataSpec(dataSpec, bytesLoaded);
  try {
    // Create and open the input.
    ExtractorInput input = new DefaultExtractorInput(dataSource,
        loadDataSpec.absoluteStreamPosition, dataSource.open(loadDataSpec));
    if (bytesLoaded == 0) {
      // Set the target to ourselves.
      extractorWrapper.init(this);
    }
    // Load and parse the initialization data.
    try {
      int result = Extractor.RESULT_CONTINUE;
      while (result == Extractor.RESULT_CONTINUE && !loadCanceled) {
        result = extractorWrapper.read(input);
      }
    } finally {
      bytesLoaded = (int) (input.getPosition() - dataSpec.absoluteStreamPosition);
    }
  } finally {
    dataSource.close();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:26,代码来源:InitializationChunk.java

示例2: load

import com.google.android.exoplayer.util.Util; //导入方法依赖的package包/类
@SuppressWarnings("NonAtomicVolatileUpdate")
@Override
public final void load() throws IOException, InterruptedException {
  DataSpec loadDataSpec = Util.getRemainderDataSpec(dataSpec, bytesLoaded);
  try {
    // Create and open the input.
    ExtractorInput input = new DefaultExtractorInput(dataSource,
        loadDataSpec.absoluteStreamPosition, dataSource.open(loadDataSpec));
    if (bytesLoaded == 0) {
      // Set the target to ourselves.
      extractorWrapper.init(this);
    }
    // Load and parse the initialization data.
    try {
      int result = Extractor.RESULT_CONTINUE;
      while (result == Extractor.RESULT_CONTINUE && !loadCanceled) {
        result = extractorWrapper.read(input);
      }
    } finally {
      bytesLoaded = (int) (input.getPosition() - dataSpec.absoluteStreamPosition);
    }
  } finally {
    dataSource.close();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:26,代码来源:ContainerMediaChunk.java

示例3: load

import com.google.android.exoplayer.util.Util; //导入方法依赖的package包/类
@SuppressWarnings("NonAtomicVolatileUpdate")
@Override
public void load() throws IOException, InterruptedException {
  DataSpec loadDataSpec = Util.getRemainderDataSpec(dataSpec, bytesLoaded);
  try {
    // Create and open the input.
    dataSource.open(loadDataSpec);
    // Load the sample data.
    int result = 0;
    while (result != C.RESULT_END_OF_INPUT) {
      bytesLoaded += result;
      result = getOutput().sampleData(dataSource, Integer.MAX_VALUE, true);
    }
    int sampleSize = bytesLoaded;
    getOutput().sampleMetadata(startTimeUs, C.SAMPLE_FLAG_SYNC, sampleSize, 0, null);
  } finally {
    dataSource.close();
  }
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:20,代码来源:SingleSampleMediaChunk.java

示例4: load

import com.google.android.exoplayer.util.Util; //导入方法依赖的package包/类
@SuppressWarnings("NonAtomicVolatileUpdate")
@Override
public final void load() throws IOException, InterruptedException {
  DataSpec loadDataSpec = Util.getRemainderDataSpec(dataSpec, bytesLoaded);
  try {
    // Create and open the input.
    ExtractorInput input = new DefaultExtractorInput(dataSource,
        loadDataSpec.absoluteStreamPosition, dataSource.open(loadDataSpec));
    if (bytesLoaded == 0) {
      // Set the target to ourselves.
      extractorWrapper.init(this);
    }
    // Load and parse the sample data.
    try {
      int result = Extractor.RESULT_CONTINUE;
      while (result == Extractor.RESULT_CONTINUE && !loadCanceled) {
        result = extractorWrapper.read(input);
      }
    } finally {
      bytesLoaded = (int) (input.getPosition() - dataSpec.absoluteStreamPosition);
    }
  } finally {
    dataSource.close();
  }
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:26,代码来源:ContainerMediaChunk.java

示例5: load

import com.google.android.exoplayer.util.Util; //导入方法依赖的package包/类
@Override
public void load() throws IOException, InterruptedException {
  // If we previously fed part of this chunk to the extractor, we need to skip it this time. For
  // encrypted content we need to skip the data by reading it through the source, so as to ensure
  // correct decryption of the remainder of the chunk. For clear content, we can request the
  // remainder of the chunk directly.
  DataSpec loadDataSpec;
  boolean skipLoadedBytes;
  if (isEncrypted) {
    loadDataSpec = dataSpec;
    skipLoadedBytes = bytesLoaded != 0;
  } else {
    loadDataSpec = Util.getRemainderDataSpec(dataSpec, bytesLoaded);
    skipLoadedBytes = false;
  }

  try {
    ExtractorInput input = new DefaultExtractorInput(dataSource,
        loadDataSpec.absoluteStreamPosition, dataSource.open(loadDataSpec));
    if (skipLoadedBytes) {
      input.skipFully(bytesLoaded);
    }
    try {
      int result = Extractor.RESULT_CONTINUE;
      while (result == Extractor.RESULT_CONTINUE && !loadCanceled) {
        result = extractorWrapper.read(input);
      }
    } finally {
      bytesLoaded = (int) (input.getPosition() - dataSpec.absoluteStreamPosition);
    }
  } finally {
    dataSource.close();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:35,代码来源:TsChunk.java

示例6: load

import com.google.android.exoplayer.util.Util; //导入方法依赖的package包/类
@SuppressWarnings("NonAtomicVolatileUpdate")
@Override
public void load() throws IOException, InterruptedException {
  if (!writtenHeader) {
    if (headerData != null) {
      getOutput().sampleData(new ParsableByteArray(headerData), headerData.length);
    }
    writtenHeader = true;
  }

  DataSpec loadDataSpec = Util.getRemainderDataSpec(dataSpec, bytesLoaded);
  try {
    // Create and open the input.
    dataSource.open(loadDataSpec);
    // Load the sample data.
    int result = 0;
    while (result != C.RESULT_END_OF_INPUT) {
      bytesLoaded += result;
      result = getOutput().sampleData(dataSource, Integer.MAX_VALUE, true);
    }
    int sampleSize = bytesLoaded;
    if (headerData != null) {
      sampleSize += headerData.length;
    }
    getOutput().sampleMetadata(startTimeUs, C.SAMPLE_FLAG_SYNC, sampleSize, 0, null);
  } finally {
    dataSource.close();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:30,代码来源:SingleSampleMediaChunk.java


注:本文中的com.google.android.exoplayer.util.Util.getRemainderDataSpec方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。