Java Code Examples for org.bytedeco.javacpp.avcodec.AVCodec#isNull()

The following examples show how to use org.bytedeco.javacpp.avcodec.AVCodec#isNull() . 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: Codec.java    From JavaAV with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new encoder with specified codec id.
 *
 * @param codecId the codec id.
 *
 * @return a new encoder.
 *
 * @throws JavaAVException if encoder could not be created.
 */
public static Codec getEncoderById(CodecID codecId) throws JavaAVException {
	if (codecId == null)
		throw new NullPointerException("CodecID is null.");

	AVCodec avCodec = avcodec_find_encoder(codecId.value());

	if (avCodec == null || avCodec.isNull())
		throw new JavaAVException("Encoder not found: " + codecId.toString());

	Codec codec = new Codec();
	codec.avCodec = avCodec;

	return codec;
}
 
Example 2
Source File: Codec.java    From JavaAV with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new decoder with specified codec id.
 *
 * @param codecId the codec id.
 *
 * @return a new decoder.
 *
 * @throws JavaAVException if decoder could not be created.
 */
public static Codec getDecoderById(CodecID codecId) throws JavaAVException {
	if (codecId == null)
		throw new NullPointerException("CodecID is null.");

	AVCodec avCodec = avcodec_find_decoder(codecId.value());

	if (avCodec == null || avCodec.isNull())
		throw new JavaAVException("Decoder not found: " + codecId.toString());

	Codec codec = new Codec();
	codec.avCodec = avCodec;

	return codec;
}
 
Example 3
Source File: Codec.java    From JavaAV with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new encoder with specified codec name.
 *
 * @param avCodecName the codec name.
 *
 * @return a new encoder.
 *
 * @throws JavaAVException if encoder could not be created.
 */
public static Codec getEncoderByName(String avCodecName) throws JavaAVException {
	if (avCodecName == null || avCodecName.isEmpty())
		throw new NullPointerException("Codec name is null or empty.");

	AVCodec avCodec = avcodec_find_encoder_by_name(avCodecName);

	if (avCodec == null || avCodec.isNull())
		throw new JavaAVException("Encoder not found: " + avCodecName);

	Codec codec = new Codec();
	codec.avCodec = avCodec;

	return codec;
}
 
Example 4
Source File: Codec.java    From JavaAV with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new decoder with specified codec name.
 *
 * @param avCodecName the codec name.
 *
 * @return a new decoder.
 *
 * @throws JavaAVException if decoder could not be created.
 */
public static Codec getDecoderByName(String avCodecName) throws JavaAVException {
	if (avCodecName == null || avCodecName.isEmpty())
		throw new NullPointerException("Codec name is null or empty.");

	AVCodec avCodec = avcodec_find_decoder_by_name(avCodecName);

	if (avCodec == null || avCodec.isNull())
		throw new JavaAVException("Decoder not found: " + avCodecName);

	Codec codec = new Codec();
	codec.avCodec = avCodec;

	return codec;
}