gpt4 book ai didi

javax.media.format.YUVFormat类的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 14:51:31 24 4
gpt4 key购买 nike

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

YUVFormat介绍

暂无

代码示例

代码示例来源:origin: jitsi/libjitsi

public static YUVFormat specialize(YUVFormat yuvFormat, Class<?> dataType)
  Dimension size = yuvFormat.getSize();
  int strideY = yuvFormat.getStrideY();
  int strideUV = yuvFormat.getStrideUV();
    strideUV = (strideY + 1) / 2;
  int offsetY = yuvFormat.getOffsetY();
  int offsetU = yuvFormat.getOffsetU();
    offsetU = offsetY + strideY * size.height;
  int offsetV = yuvFormat.getOffsetV();
    new YUVFormat(
        size,
        maxDataLength,
        (dataType == null) ? yuvFormat.getDataType() : dataType,
        yuvFormat.getFrameRate(),
        YUVFormat.YUV_420,
        strideY, strideUV,

代码示例来源:origin: jitsi/libjitsi

/**
 * Sets the <tt>Format</tt> of the media data to be input to this
 * <tt>Codec</tt>.
 *
 * @param format the <tt>Format</tt> of media data to set on this
 * <tt>Codec</tt>
 * @return the <tt>Format</tt> of media data set on this <tt>Codec</tt> or
 * <tt>null</tt> if the specified <tt>format</tt> is not supported by this
 * <tt>Codec</tt>
 */
@Override
public Format setInputFormat(Format format)
{
  // mismatch input format
  if (!(format instanceof VideoFormat)
      || (null == AbstractCodec2.matches(format, inputFormats)))
    return null;
  YUVFormat yuvFormat = (YUVFormat) format;
  if (yuvFormat.getOffsetU() > yuvFormat.getOffsetV())
    return null;
  inputFormat = AbstractCodec2.specialize(yuvFormat, Format.byteArray);
  // Return the selected inputFormat
  return inputFormat;
}

代码示例来源:origin: jitsi/libjitsi

if (YUVFormat.YUV_420 == yuvFormat.getYuvType())
  Dimension size = yuvFormat.getSize();
        = new YUVFormat(
            new Dimension(width, height),
            yuvFormat.getDataType(),
            yuvFormat.getFrameRate(),
            yuvFormat.getYuvType(),

代码示例来源:origin: jitsi/libjitsi

Dimension formatSize = format.getSize();
int width = formatSize.width;
int height = formatSize.height;
int strideY = format.getStrideY();
if (strideY == Format.NOT_SPECIFIED)
  strideY = width;
int strideUV = format.getStrideUV();
if (strideUV == Format.NOT_SPECIFIED)
  strideUV = width/2;
VPX.img_set_stride3(img, 0);
int offsetY = format.getOffsetY();
if (offsetY == Format.NOT_SPECIFIED)
  offsetY = 0;
int offsetU = format.getOffsetU();
if (offsetU == Format.NOT_SPECIFIED)
  offsetU = offsetY + width * height;
int offsetV = format.getOffsetV();
if (offsetV == Format.NOT_SPECIFIED)
  offsetV = offsetU + (width * height) / 4;

代码示例来源:origin: stackoverflow.com

CaptureDeviceManager.getDeviceList(new YUVFormat());

代码示例来源:origin: jitsi/libjitsi

= new YUVFormat(
    size,
    yuvFormat.getYuvType(),

代码示例来源:origin: jitsi/libjitsi

/**
 * Initializes a new <tt>JNIEncoder</tt> instance.
 */
public JNIEncoder()
{
  inputFormats
    = new Format[]
    {
      new YUVFormat(
          /* size */ null,
          /* maxDataLength */ Format.NOT_SPECIFIED,
          Format.byteArray,
          /* frameRate */ Format.NOT_SPECIFIED,
          YUVFormat.YUV_420,
          /* strideY */ Format.NOT_SPECIFIED,
          /* strideUV */ Format.NOT_SPECIFIED,
          /* offsetY */ Format.NOT_SPECIFIED,
          /* offsetU */ Format.NOT_SPECIFIED,
          /* offsetV */ Format.NOT_SPECIFIED)
    };
  inputFormat = null;
  outputFormat = null;
}

代码示例来源:origin: jitsi/libjitsi

/**
 * Sets the input format.
 *
 * @param format format to set
 * @return format
 */
@Override
public Format setInputFormat(Format format)
{
  if(!(format instanceof VideoFormat)
      || (matches(format, inputFormats) == null))
    return null;
  YUVFormat yuvFormat = (YUVFormat) format;
  if (yuvFormat.getOffsetU() > yuvFormat.getOffsetV())
    return null;
  inputFormat = specialize(yuvFormat, Format.byteArray);
  // Return the selected inputFormat
  return inputFormat;
}

代码示例来源:origin: jitsi/libjitsi

/**
 * Initializes a new <tt>JNIEncoder</tt> instance.
 */
public JNIEncoder()
{
  inputFormats
    = new Format[]
    {
      new YUVFormat(
          /* size */ null,
          /* maxDataLength */ Format.NOT_SPECIFIED,
          Format.byteArray,
          /* frameRate */ Format.NOT_SPECIFIED,
          YUVFormat.YUV_420,
          /* strideY */ Format.NOT_SPECIFIED,
          /* strideUV */ Format.NOT_SPECIFIED,
          /* offsetY */ Format.NOT_SPECIFIED,
          /* offsetU */ Format.NOT_SPECIFIED,
          /* offsetV */ Format.NOT_SPECIFIED)
    };
  inputFormat = null;
  outputFormat = null;
}

代码示例来源:origin: jitsi/libjitsi

/**
 * Sets the <tt>Format</tt> of the media data to be input to this
 * <tt>Codec</tt>.
 *
 * @param format the <tt>Format</tt> of media data to set on this
 * <tt>Codec</tt>
 * @return the <tt>Format</tt> of media data set on this <tt>Codec</tt> or
 * <tt>null</tt> if the specified <tt>format</tt> is not supported by this
 * <tt>Codec</tt>
 */
@Override
public Format setInputFormat(Format format)
{
  // mismatch input format
  if (!(format instanceof VideoFormat)
      || (null == AbstractCodec2.matches(format, inputFormats)))
    return null;
  YUVFormat yuvFormat = (YUVFormat) format;
  if (yuvFormat.getOffsetU() > yuvFormat.getOffsetV())
    return null;
  inputFormat = AbstractCodec2.specialize(yuvFormat, Format.byteArray);
  // Return the selected inputFormat
  return inputFormat;
}

代码示例来源:origin: jitsi/libjitsi

/**
 * Initializes a new <tt>VPXEncoder</tt> instance.
 */
public VPXEncoder()
{
  super("VP8 Encoder", VideoFormat.class, SUPPORTED_OUTPUT_FORMATS);
  inputFormats
    = new VideoFormat[]
    {
      new YUVFormat(
          /* size */ null,
          /* maxDataLength */ Format.NOT_SPECIFIED,
          Format.byteArray,
          /* frameRate */ Format.NOT_SPECIFIED,
          YUVFormat.YUV_420,
          /* strideY */ Format.NOT_SPECIFIED,
          /* strideUV */ Format.NOT_SPECIFIED,
          /* offsetY */ Format.NOT_SPECIFIED,
          /* offsetU */ Format.NOT_SPECIFIED,
          /* offsetV */ Format.NOT_SPECIFIED)
    };
  inputFormat = null;
  outputFormat = null;
}

代码示例来源:origin: jitsi/libjitsi

/**
 * Initializes a new <tt>SwScale</tt> instance which can optionally attempt
 * to keep the width and height of YUV 420 output even and to preserve the
 * aspect ratio of the video frames provided to the instance as input to be
 * processed.
 *
 * @param fixOddYuv420Size <tt>true</tt> to have the new instance keep the
 * width and height of YUV 420 output even; otherwise, <tt>false</tt>
 * @param preserveAspectRatio <tt>true</tt> to have the new instance
 * preserve the aspect ratio of the video frames provided to it as input to
 * be processed; otherwise, <tt>false</tt>
 */
public SwScale(boolean fixOddYuv420Size, boolean preserveAspectRatio)
{
  this.fixOddYuv420Size = fixOddYuv420Size;
  this.preserveAspectRatio = preserveAspectRatio;
  inputFormats
    = new Format[]
        {
          new AVFrameFormat(),
          new RGBFormat(),
          new YUVFormat(YUVFormat.YUV_420)
        };
  addControl(frameProcessingControl);
}

代码示例来源:origin: jitsi/libjitsi

return new YUVFormat(YUVFormat.YUV_420);
new YUVFormat(
    new Dimension(width, height),

代码示例来源:origin: stackoverflow.com

VideoFormat[] desiredFormats = new VideoFormat[] {new H263Format(), new JPEGFormat(), new RGBFormat(), new YUVFormat()};
for (VideoFormat checkFormat : desiredFormats) {

代码示例来源:origin: jitsi/libjitsi

? new YUVFormat(

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com