/** * 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; }
/** * 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; }
/** * 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; }
offsetY = 0; int offsetU = yuvFormat.getOffsetU();
if (offsetY == Format.NOT_SPECIFIED) offsetY = 0; int offsetU = format.getOffsetU(); if (offsetU == Format.NOT_SPECIFIED) offsetU = offsetY + width * height;