com.google.android.exoplayer2.Format.createVideoSampleFormat()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中com.google.android.exoplayer2.Format.createVideoSampleFormat()方法的一些代码示例,展示了Format.createVideoSampleFormat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Format.createVideoSampleFormat()方法的具体详情如下:
包路径:com.google.android.exoplayer2.Format
类名称:Format
方法名:createVideoSampleFormat

Format.createVideoSampleFormat介绍

暂无

代码示例

代码示例来源:origin: google/ExoPlayer

private static Format buildVideoFormat(String id) {
 return Format.createVideoSampleFormat(
   id,
   MimeTypes.VIDEO_H264,
   null,
   Format.NO_VALUE,
   Format.NO_VALUE,
   1024,
   768,
   Format.NO_VALUE,
   null,
   null);
}

代码示例来源:origin: google/ExoPlayer

private static Format videoFormat(int bitrate, int width, int height) {
 return Format.createVideoSampleFormat(
   /* id= */ null,
   /* sampleMimeType= */ MimeTypes.VIDEO_H264,
   /* codecs= */ null,
   /* bitrate= */ bitrate,
   /* maxInputSize= */ Format.NO_VALUE,
   /* width= */ width,
   /* height= */ height,
   /* frameRate= */ Format.NO_VALUE,
   /* initializationData= */ null,
   /* drmInitData= */ null);
}

代码示例来源:origin: google/ExoPlayer

Format format = Format.createVideoSampleFormat(formatId, MimeTypes.VIDEO_MPEG2, null,
  Format.NO_VALUE, Format.NO_VALUE, width, height, Format.NO_VALUE,
  Collections.singletonList(csdData), Format.NO_VALUE, pixelWidthHeightRatio, null);

代码示例来源:origin: google/ExoPlayer

public static final Format VIDEO_FORMAT = Format.createVideoSampleFormat(null,
  MimeTypes.VIDEO_H264, null, Format.NO_VALUE, Format.NO_VALUE, 1280, 720, Format.NO_VALUE,
  null, null);

代码示例来源:origin: google/ExoPlayer

Format.createVideoSampleFormat(
  Integer.toString(trackId),
  mimeType,

代码示例来源:origin: google/ExoPlayer

public static final Format VIDEO_FORMAT = Format.createVideoSampleFormat(null,
  MimeTypes.VIDEO_H264, null, Format.NO_VALUE, Format.NO_VALUE, 1280, 720, Format.NO_VALUE,
  null, null);

代码示例来源:origin: google/ExoPlayer

NalUnitUtil.PpsData ppsData = NalUnitUtil.parsePpsNalUnit(pps.nalData, 3, pps.nalLength);
output.format(
  Format.createVideoSampleFormat(
    formatId,
    MimeTypes.VIDEO_H264,

代码示例来源:origin: google/ExoPlayer

@Nullable List<byte[]> initializationData,
 @Nullable DrmInitData drmInitData) {
return createVideoSampleFormat(
  id,
  sampleMimeType,
 float pixelWidthHeightRatio,
 @Nullable DrmInitData drmInitData) {
return createVideoSampleFormat(
  id,
  sampleMimeType,

代码示例来源:origin: google/ExoPlayer

nalUnitLengthFieldLength = avcConfig.nalUnitLengthFieldLength;
Format format = Format.createVideoSampleFormat(null, MimeTypes.VIDEO_H264, null,
  Format.NO_VALUE, Format.NO_VALUE, avcConfig.width, avcConfig.height, Format.NO_VALUE,
  avcConfig.initializationData, Format.NO_VALUE, avcConfig.pixelWidthAspectRatio, null);

代码示例来源:origin: google/ExoPlayer

out.format = Format.createVideoSampleFormat(Integer.toString(trackId), mimeType, null,
  Format.NO_VALUE, Format.NO_VALUE, width, height, Format.NO_VALUE, initializationData,
  rotationDegrees, pixelWidthHeightRatio, projectionData, stereoMode, null, drmInitData);

代码示例来源:origin: google/ExoPlayer

return Format.createVideoSampleFormat(formatId, MimeTypes.VIDEO_H265, null, Format.NO_VALUE,
  Format.NO_VALUE, picWidthInLumaSamples, picHeightInLumaSamples, Format.NO_VALUE,
  Collections.singletonList(csd), Format.NO_VALUE, pixelWidthHeightRatio, null);

代码示例来源:origin: novoda/no-player

public Format build() {
    return Format.createVideoSampleFormat(
        id,
        sampleMimeType,
        codecs,
        bitrate,
        maxInputSize,
        width,
        height,
        frameRate,
        initializationData,
        drmInitData
    );
  }
}

代码示例来源:origin: rsiebert/TVHClient

@NonNull
@Override
protected Format buildFormat(int streamIndex, @NonNull HtspMessage stream) {
  return Format.createVideoSampleFormat(
      Integer.toString(streamIndex),
      MimeTypes.VIDEO_MPEG2,
      null,
      Format.NO_VALUE,
      Format.NO_VALUE,
      stream.getInteger("width"),
      stream.getInteger("height"),
      StreamReaderUtils.frameDurationToFrameRate(stream.getInteger("duration", Format.NO_VALUE)),
      null,
      null);
}

代码示例来源:origin: rsiebert/TVHClient

@NonNull
@Override
protected Format buildFormat(int streamIndex, @NonNull HtspMessage stream) {
  List<byte[]> initializationData = null;
  if (stream.containsKey("meta")) {
    try {
      AvcConfig avcConfig = AvcConfig.parse(new ParsableByteArray(stream.getByteArray("meta")));
      initializationData = avcConfig.initializationData;
    } catch (ParserException e) {
      Timber.e("Failed to parse H264 meta, discarding");
    }
  }
  return Format.createVideoSampleFormat(
      Integer.toString(streamIndex),
      MimeTypes.VIDEO_H264,
      null,
      Format.NO_VALUE,
      Format.NO_VALUE,
      stream.getInteger("width"),
      stream.getInteger("height"),
      StreamReaderUtils.frameDurationToFrameRate(stream.getInteger("duration", Format.NO_VALUE)),
      initializationData,
      null);
}

代码示例来源:origin: rsiebert/TVHClient

@NonNull
@Override
protected Format buildFormat(int streamIndex, @NonNull HtspMessage stream) {
  List<byte[]> initializationData = null;
  if (stream.containsKey("meta")) {
    try {
      HevcConfig hevcConfig = HevcConfig.parse(new ParsableByteArray(stream.getByteArray("meta")));
      initializationData = hevcConfig.initializationData;
    } catch (ParserException e) {
      Timber.e("Failed to parse H265 meta, discarding");
    }
  }
  return Format.createVideoSampleFormat(
      Integer.toString(streamIndex),
      MimeTypes.VIDEO_H265,
      null,
      Format.NO_VALUE,
      Format.NO_VALUE,
      stream.getInteger("width"),
      stream.getInteger("height"),
      StreamReaderUtils.frameDurationToFrameRate(stream.getInteger("duration", Format.NO_VALUE)),
      initializationData,
      null);
}

相关文章