package com.nativelibs4java.ffmpeg.avformat;
import com.nativelibs4java.ffmpeg.avcodec.AVCodecContext;
import com.nativelibs4java.ffmpeg.avcodec.AVCodecParserContext;
import com.nativelibs4java.ffmpeg.avcodec.AVPacket;
import com.nativelibs4java.ffmpeg.avcodec.AvcodecLibrary.AVDiscard;
import com.nativelibs4java.ffmpeg.avformat.AvformatLibrary.AVStreamParseType;
import com.nativelibs4java.ffmpeg.avutil.AVRational;
import org.bridj.Pointer;
import org.bridj.StructObject;
import org.bridj.ValuedEnum;
import org.bridj.ann.Array;
import org.bridj.ann.Field;
import org.bridj.ann.Library;
/**
 * <i>native declaration : libavformat/avformat.h</i><br>
 * This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
 * a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
 * For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> or <a href="http://bridj.googlecode.com/">BridJ</a> .
 */
@Library("avformat") 
public class AVStream extends StructObject {
	public AVStream() {
		super();
	}
	public AVStream(Pointer pointer) {
		super(pointer);
	}
	/// < stream index in AVFormatContext
	@Field(0) 
	public int index() {
		return this.io.getIntField(this, 0);
	}
	/// < stream index in AVFormatContext
	@Field(0) 
	public AVStream index(int index) {
		this.io.setIntField(this, 0, index);
		return this;
	}
	public final int index_$eq(int index) {
		index(index);
		return index;
	}
	/// < format-specific stream ID
	@Field(1) 
	public int id() {
		return this.io.getIntField(this, 1);
	}
	/// < format-specific stream ID
	@Field(1) 
	public AVStream id(int id) {
		this.io.setIntField(this, 1, id);
		return this;
	}
	public final int id_$eq(int id) {
		id(id);
		return id;
	}
	/**
	 * < codec context<br>
	 * C type : AVCodecContext*
	 */
	@Field(2) 
	public Pointer<AVCodecContext > codec() {
		return this.io.getPointerField(this, 2);
	}
	/**
	 * < codec context<br>
	 * C type : AVCodecContext*
	 */
	@Field(2) 
	public AVStream codec(Pointer<AVCodecContext > codec) {
		this.io.setPointerField(this, 2, codec);
		return this;
	}
	/// C type : AVCodecContext*
	public final Pointer<AVCodecContext > codec_$eq(Pointer<AVCodecContext > codec) {
		codec(codec);
		return codec;
	}
	/**
	 * Real base framerate of the stream.<br>
	 * This is the lowest framerate with which all timestamps can be<br>
	 * represented accurately (it is the least common multiple of all<br>
	 * framerates in the stream). Note, this value is just a guess!<br>
	 * For example, if the time base is 1/90000 and all frames have either<br>
	 * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.<br>
	 * C type : AVRational
	 */
	@Field(3) 
	public AVRational r_frame_rate() {
		return this.io.getNativeObjectField(this, 3);
	}
	/// C type : void*
	@Field(4) 
	public Pointer<? > priv_data() {
		return this.io.getPointerField(this, 4);
	}
	/// C type : void*
	@Field(4) 
	public AVStream priv_data(Pointer<? > priv_data) {
		this.io.setPointerField(this, 4, priv_data);
		return this;
	}
	/// C type : void*
	public final Pointer<? > priv_data_$eq(Pointer<? > priv_data) {
		priv_data(priv_data);
		return priv_data;
	}
	/// internal data used in av_find_stream_info()
	@Field(5) 
	public long first_dts() {
		return this.io.getLongField(this, 5);
	}
	/// internal data used in av_find_stream_info()
	@Field(5) 
	public AVStream first_dts(long first_dts) {
		this.io.setLongField(this, 5, first_dts);
		return this;
	}
	public final long first_dts_$eq(long first_dts) {
		first_dts(first_dts);
		return first_dts;
	}
	/**
	 * encoding: pts generation when outputting stream<br>
	 * C type : AVFrac
	 */
	@Field(6) 
	public AVFrac pts() {
		return this.io.getNativeObjectField(this, 6);
	}
	/**
	 * This is the fundamental unit of time (in seconds) in terms<br>
	 * of which frame timestamps are represented. For fixed-fps content,<br>
	 * time base should be 1/framerate and timestamp increments should be 1.<br>
	 * C type : AVRational
	 */
	@Field(7) 
	public AVRational time_base() {
		return this.io.getNativeObjectField(this, 7);
	}
	/// < number of bits in pts (used for wrapping control)
	@Field(8) 
	public int pts_wrap_bits() {
		return this.io.getIntField(this, 8);
	}
	/// < number of bits in pts (used for wrapping control)
	@Field(8) 
	public AVStream pts_wrap_bits(int pts_wrap_bits) {
		this.io.setIntField(this, 8, pts_wrap_bits);
		return this;
	}
	public final int pts_wrap_bits_$eq(int pts_wrap_bits) {
		pts_wrap_bits(pts_wrap_bits);
		return pts_wrap_bits;
	}
	/**
	 * ffmpeg.c private use<br>
	 * < If set, just copy stream.
	 */
	@Field(9) 
	public int stream_copy() {
		return this.io.getIntField(this, 9);
	}
	/**
	 * ffmpeg.c private use<br>
	 * < If set, just copy stream.
	 */
	@Field(9) 
	public AVStream stream_copy(int stream_copy) {
		this.io.setIntField(this, 9, stream_copy);
		return this;
	}
	public final int stream_copy_$eq(int stream_copy) {
		stream_copy(stream_copy);
		return stream_copy;
	}
	/**
	 * < Selects which packets can be discarded at will and do not need to be demuxed.<br>
	 * C type : AVDiscard
	 */
	@Field(10) 
	public ValuedEnum<AVDiscard > discard() {
		return this.io.getEnumField(this, 10);
	}
	/**
	 * < Selects which packets can be discarded at will and do not need to be demuxed.<br>
	 * C type : AVDiscard
	 */
	@Field(10) 
	public AVStream discard(ValuedEnum<AVDiscard > discard) {
		this.io.setEnumField(this, 10, discard);
		return this;
	}
	/// C type : AVDiscard
	public final ValuedEnum<AVDiscard > discard_$eq(ValuedEnum<AVDiscard > discard) {
		discard(discard);
		return discard;
	}
	/**
	 * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame.<br>
	 * MN: dunno if that is the right place for it
	 */
	@Field(11) 
	public float quality() {
		return this.io.getFloatField(this, 11);
	}
	/**
	 * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame.<br>
	 * MN: dunno if that is the right place for it
	 */
	@Field(11) 
	public AVStream quality(float quality) {
		this.io.setFloatField(this, 11, quality);
		return this;
	}
	public final float quality_$eq(float quality) {
		quality(quality);
		return quality;
	}
	/**
	 * Decoding: pts of the first frame of the stream, in stream time base.<br>
	 * Only set this if you are absolutely 100% sure that the value you set<br>
	 * it to really is the pts of the first frame.<br>
	 * This may be undefined (AV_NOPTS_VALUE).<br>
	 * @note The ASF header does NOT contain a correct start_time the ASF<br>
	 * demuxer must NOT set this.
	 */
	@Field(12) 
	public long start_time() {
		return this.io.getLongField(this, 12);
	}
	/**
	 * Decoding: pts of the first frame of the stream, in stream time base.<br>
	 * Only set this if you are absolutely 100% sure that the value you set<br>
	 * it to really is the pts of the first frame.<br>
	 * This may be undefined (AV_NOPTS_VALUE).<br>
	 * @note The ASF header does NOT contain a correct start_time the ASF<br>
	 * demuxer must NOT set this.
	 */
	@Field(12) 
	public AVStream start_time(long start_time) {
		this.io.setLongField(this, 12, start_time);
		return this;
	}
	public final long start_time_$eq(long start_time) {
		start_time(start_time);
		return start_time;
	}
	/**
	 * Decoding: duration of the stream, in stream time base.<br>
	 * If a source file does not specify a duration, but does specify<br>
	 * a bitrate, this value will be estimated from bitrate and file size.
	 */
	@Field(13) 
	public long duration() {
		return this.io.getLongField(this, 13);
	}
	/**
	 * Decoding: duration of the stream, in stream time base.<br>
	 * If a source file does not specify a duration, but does specify<br>
	 * a bitrate, this value will be estimated from bitrate and file size.
	 */
	@Field(13) 
	public AVStream duration(long duration) {
		this.io.setLongField(this, 13, duration);
		return this;
	}
	public final long duration_$eq(long duration) {
		duration(duration);
		return duration;
	}
	/**
	 * < ISO 639-2/B 3-letter language code (empty string if undefined)<br>
	 * C type : char[4]
	 */
	@Array({4}) 
	@Field(14) 
	public Pointer<Byte > language() {
		return this.io.getPointerField(this, 14);
	}
	/**
	 * av_read_frame() support<br>
	 * C type : AVStreamParseType
	 */
	@Field(15) 
	public ValuedEnum<AVStreamParseType > need_parsing() {
		return this.io.getEnumField(this, 15);
	}
	/**
	 * av_read_frame() support<br>
	 * C type : AVStreamParseType
	 */
	@Field(15) 
	public AVStream need_parsing(ValuedEnum<AVStreamParseType > need_parsing) {
		this.io.setEnumField(this, 15, need_parsing);
		return this;
	}
	/// C type : AVStreamParseType
	public final ValuedEnum<AVStreamParseType > need_parsing_$eq(ValuedEnum<AVStreamParseType > need_parsing) {
		need_parsing(need_parsing);
		return need_parsing;
	}
	/// C type : AVCodecParserContext*
	@Field(16) 
	public Pointer<AVCodecParserContext > parser() {
		return this.io.getPointerField(this, 16);
	}
	/// C type : AVCodecParserContext*
	@Field(16) 
	public AVStream parser(Pointer<AVCodecParserContext > parser) {
		this.io.setPointerField(this, 16, parser);
		return this;
	}
	/// C type : AVCodecParserContext*
	public final Pointer<AVCodecParserContext > parser_$eq(Pointer<AVCodecParserContext > parser) {
		parser(parser);
		return parser;
	}
	@Field(17) 
	public long cur_dts() {
		return this.io.getLongField(this, 17);
	}
	@Field(17) 
	public AVStream cur_dts(long cur_dts) {
		this.io.setLongField(this, 17, cur_dts);
		return this;
	}
	public final long cur_dts_$eq(long cur_dts) {
		cur_dts(cur_dts);
		return cur_dts;
	}
	@Field(18) 
	public int last_IP_duration() {
		return this.io.getIntField(this, 18);
	}
	@Field(18) 
	public AVStream last_IP_duration(int last_IP_duration) {
		this.io.setIntField(this, 18, last_IP_duration);
		return this;
	}
	public final int last_IP_duration_$eq(int last_IP_duration) {
		last_IP_duration(last_IP_duration);
		return last_IP_duration;
	}
	@Field(19) 
	public long last_IP_pts() {
		return this.io.getLongField(this, 19);
	}
	@Field(19) 
	public AVStream last_IP_pts(long last_IP_pts) {
		this.io.setLongField(this, 19, last_IP_pts);
		return this;
	}
	public final long last_IP_pts_$eq(long last_IP_pts) {
		last_IP_pts(last_IP_pts);
		return last_IP_pts;
	}
	/**
	 * av_seek_frame() support<br>
	 * < Only used if the format does not<br>
	 * support seeking natively.<br>
	 * C type : AVIndexEntry*
	 */
	@Field(20) 
	public Pointer<AVIndexEntry > index_entries() {
		return this.io.getPointerField(this, 20);
	}
	/**
	 * av_seek_frame() support<br>
	 * < Only used if the format does not<br>
	 * support seeking natively.<br>
	 * C type : AVIndexEntry*
	 */
	@Field(20) 
	public AVStream index_entries(Pointer<AVIndexEntry > index_entries) {
		this.io.setPointerField(this, 20, index_entries);
		return this;
	}
	/// C type : AVIndexEntry*
	public final Pointer<AVIndexEntry > index_entries_$eq(Pointer<AVIndexEntry > index_entries) {
		index_entries(index_entries);
		return index_entries;
	}
	@Field(21) 
	public int nb_index_entries() {
		return this.io.getIntField(this, 21);
	}
	@Field(21) 
	public AVStream nb_index_entries(int nb_index_entries) {
		this.io.setIntField(this, 21, nb_index_entries);
		return this;
	}
	public final int nb_index_entries_$eq(int nb_index_entries) {
		nb_index_entries(nb_index_entries);
		return nb_index_entries;
	}
	@Field(22) 
	public int index_entries_allocated_size() {
		return this.io.getIntField(this, 22);
	}
	@Field(22) 
	public AVStream index_entries_allocated_size(int index_entries_allocated_size) {
		this.io.setIntField(this, 22, index_entries_allocated_size);
		return this;
	}
	public final int index_entries_allocated_size_$eq(int index_entries_allocated_size) {
		index_entries_allocated_size(index_entries_allocated_size);
		return index_entries_allocated_size;
	}
	/// < number of frames in this stream if known or 0
	@Field(23) 
	public long nb_frames() {
		return this.io.getLongField(this, 23);
	}
	/// < number of frames in this stream if known or 0
	@Field(23) 
	public AVStream nb_frames(long nb_frames) {
		this.io.setLongField(this, 23, nb_frames);
		return this;
	}
	public final long nb_frames_$eq(long nb_frames) {
		nb_frames(nb_frames);
		return nb_frames;
	}
	/// C type : int64_t[4 + 1]
	@Array({4 + 1}) 
	@Field(24) 
	public Pointer<Long > unused() {
		return this.io.getPointerField(this, 24);
	}
	/**
	 * < source filename of the stream<br>
	 * C type : char*
	 */
	@Field(25) 
	public Pointer<Byte > filename() {
		return this.io.getPointerField(this, 25);
	}
	/**
	 * < source filename of the stream<br>
	 * C type : char*
	 */
	@Field(25) 
	public AVStream filename(Pointer<Byte > filename) {
		this.io.setPointerField(this, 25, filename);
		return this;
	}
	/// C type : char*
	public final Pointer<Byte > filename_$eq(Pointer<Byte > filename) {
		filename(filename);
		return filename;
	}
	/// < AV_DISPOSITION_* bit field
	@Field(26) 
	public int disposition() {
		return this.io.getIntField(this, 26);
	}
	/// < AV_DISPOSITION_* bit field
	@Field(26) 
	public AVStream disposition(int disposition) {
		this.io.setIntField(this, 26, disposition);
		return this;
	}
	public final int disposition_$eq(int disposition) {
		disposition(disposition);
		return disposition;
	}
	/// C type : AVProbeData
	@Field(27) 
	public AVProbeData probe_data() {
		return this.io.getNativeObjectField(this, 27);
	}
	/// C type : int64_t[16 + 1]
	@Array({16 + 1}) 
	@Field(28) 
	public Pointer<Long > pts_buffer() {
		return this.io.getPointerField(this, 28);
	}
	/**
	 * sample aspect ratio (0 if unknown)<br>
	 * - encoding: Set by user.<br>
	 * - decoding: Set by libavformat.<br>
	 * C type : AVRational
	 */
	@Field(29) 
	public AVRational sample_aspect_ratio() {
		return this.io.getNativeObjectField(this, 29);
	}
	/// C type : AVMetadata*
	@Field(30) 
	public Pointer<AVMetadata > metadata() {
		return this.io.getPointerField(this, 30);
	}
	/// C type : AVMetadata*
	@Field(30) 
	public AVStream metadata(Pointer<AVMetadata > metadata) {
		this.io.setPointerField(this, 30, metadata);
		return this;
	}
	/// C type : AVMetadata*
	public final Pointer<AVMetadata > metadata_$eq(Pointer<AVMetadata > metadata) {
		metadata(metadata);
		return metadata;
	}
	/**
	 * external applications; try to use something else if at all possible.<br>
	 * C type : const uint8_t*
	 */
	@Field(31) 
	public Pointer<Byte > cur_ptr() {
		return this.io.getPointerField(this, 31);
	}
	/**
	 * external applications; try to use something else if at all possible.<br>
	 * C type : const uint8_t*
	 */
	@Field(31) 
	public AVStream cur_ptr(Pointer<Byte > cur_ptr) {
		this.io.setPointerField(this, 31, cur_ptr);
		return this;
	}
	/// C type : const uint8_t*
	public final Pointer<Byte > cur_ptr_$eq(Pointer<Byte > cur_ptr) {
		cur_ptr(cur_ptr);
		return cur_ptr;
	}
	@Field(32) 
	public int cur_len() {
		return this.io.getIntField(this, 32);
	}
	@Field(32) 
	public AVStream cur_len(int cur_len) {
		this.io.setIntField(this, 32, cur_len);
		return this;
	}
	public final int cur_len_$eq(int cur_len) {
		cur_len(cur_len);
		return cur_len;
	}
	/// C type : AVPacket
	@Field(33) 
	public AVPacket cur_pkt() {
		return this.io.getNativeObjectField(this, 33);
	}
	/**
	 * Timestamp corresponding to the last dts sync point.<br>
	 * * Initialized when AVCodecParserContext.dts_sync_point >= 0 and<br>
	 * a DTS is received from the underlying container. Otherwise set to<br>
	 * AV_NOPTS_VALUE by default.
	 */
	@Field(34) 
	public long reference_dts() {
		return this.io.getLongField(this, 34);
	}
	/**
	 * Timestamp corresponding to the last dts sync point.<br>
	 * * Initialized when AVCodecParserContext.dts_sync_point >= 0 and<br>
	 * a DTS is received from the underlying container. Otherwise set to<br>
	 * AV_NOPTS_VALUE by default.
	 */
	@Field(34) 
	public AVStream reference_dts(long reference_dts) {
		this.io.setLongField(this, 34, reference_dts);
		return this;
	}
	public final long reference_dts_$eq(long reference_dts) {
		reference_dts(reference_dts);
		return reference_dts;
	}
	@Field(35) 
	public int probe_packets() {
		return this.io.getIntField(this, 35);
	}
	@Field(35) 
	public AVStream probe_packets(int probe_packets) {
		this.io.setIntField(this, 35, probe_packets);
		return this;
	}
	public final int probe_packets_$eq(int probe_packets) {
		probe_packets(probe_packets);
		return probe_packets;
	}
	/**
	 * last packet in packet_buffer for this stream when muxing.<br>
	 * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav*<br>
	 * C type : AVPacketList*
	 */
	@Field(36) 
	public Pointer<AVPacketList > last_in_packet_buffer() {
		return this.io.getPointerField(this, 36);
	}
	/**
	 * last packet in packet_buffer for this stream when muxing.<br>
	 * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav*<br>
	 * C type : AVPacketList*
	 */
	@Field(36) 
	public AVStream last_in_packet_buffer(Pointer<AVPacketList > last_in_packet_buffer) {
		this.io.setPointerField(this, 36, last_in_packet_buffer);
		return this;
	}
	/// C type : AVPacketList*
	public final Pointer<AVPacketList > last_in_packet_buffer_$eq(Pointer<AVPacketList > last_in_packet_buffer) {
		last_in_packet_buffer(last_in_packet_buffer);
		return last_in_packet_buffer;
	}
	/**
	 * Average framerate<br>
	 * C type : AVRational
	 */
	@Field(37) 
	public AVRational avg_frame_rate() {
		return this.io.getNativeObjectField(this, 37);
	}
	/// Number of frames that have been demuxed during av_find_stream_info()
	@Field(38) 
	public int codec_info_nb_frames() {
		return this.io.getIntField(this, 38);
	}
	/// Number of frames that have been demuxed during av_find_stream_info()
	@Field(38) 
	public AVStream codec_info_nb_frames(int codec_info_nb_frames) {
		this.io.setIntField(this, 38, codec_info_nb_frames);
		return this;
	}
	public final int codec_info_nb_frames_$eq(int codec_info_nb_frames) {
		codec_info_nb_frames(codec_info_nb_frames);
		return codec_info_nb_frames;
	}
	/// C type : info_struct*
	@Field(39) 
	public Pointer<AVStream.info_struct > info() {
		return this.io.getPointerField(this, 39);
	}
	/// C type : info_struct*
	@Field(39) 
	public AVStream info(Pointer<AVStream.info_struct > info) {
		this.io.setPointerField(this, 39, info);
		return this;
	}
	/// C type : info_struct*
	public final Pointer<AVStream.info_struct > info_$eq(Pointer<AVStream.info_struct > info) {
		info(info);
		return info;
	}
	/// <i>native declaration : libavformat/avformat.h</i>
	public static class info_struct extends StructObject {
		public info_struct() {
			super();
		}
		public info_struct(Pointer pointer) {
			super(pointer);
		}
		@Field(0) 
		public long last_dts() {
			return this.io.getLongField(this, 0);
		}
		@Field(0) 
		public info_struct last_dts(long last_dts) {
			this.io.setLongField(this, 0, last_dts);
			return this;
		}
		public final long last_dts_$eq(long last_dts) {
			last_dts(last_dts);
			return last_dts;
		}
		@Field(1) 
		public long duration_gcd() {
			return this.io.getLongField(this, 1);
		}
		@Field(1) 
		public info_struct duration_gcd(long duration_gcd) {
			this.io.setLongField(this, 1, duration_gcd);
			return this;
		}
		public final long duration_gcd_$eq(long duration_gcd) {
			duration_gcd(duration_gcd);
			return duration_gcd;
		}
		@Field(2) 
		public int duration_count() {
			return this.io.getIntField(this, 2);
		}
		@Field(2) 
		public info_struct duration_count(int duration_count) {
			this.io.setIntField(this, 2, duration_count);
			return this;
		}
		public final int duration_count_$eq(int duration_count) {
			duration_count(duration_count);
			return duration_count;
		}
		/// C type : double[(60 * 12 + 5)]
		@Array({60 * 12 + 5}) 
		@Field(3) 
		public Pointer<Double > duration_error() {
			return this.io.getPointerField(this, 3);
		}
		@Field(4) 
		public long codec_info_duration() {
			return this.io.getLongField(this, 4);
		}
		@Field(4) 
		public info_struct codec_info_duration(long codec_info_duration) {
			this.io.setLongField(this, 4, codec_info_duration);
			return this;
		}
		public final long codec_info_duration_$eq(long codec_info_duration) {
			codec_info_duration(codec_info_duration);
			return codec_info_duration;
		}
	};
}
