public bool TryDecode(ref AVPacket packet, out AVFrame* pFrame) { int gotPicture; fixed (AVPacket* pPacket = &packet) { int decodedSize = FFmpegInvoke.avcodec_decode_video2(codec_context, avFrame, &gotPicture, pPacket); if (decodedSize < 0) { Console.WriteLine("Error while decoding frame."); } } pFrame = avFrame; return gotPicture == 1; }
public bool TryDecode(ref AVPacket packet, ref AVFrame frame) { int gotPicture; fixed (AVPacket* pPacket = &packet) fixed (AVFrame* pFrame = &frame) { int decodedSize = FFmpegInvoke.avcodec_decode_video2(_pDecodingContext, pFrame, &gotPicture, pPacket); if (decodedSize < 0) Trace.TraceWarning("Error while decoding frame."); } return gotPicture == 1; }
public bool TryDecode(ref byte[] data, out AVFrame frame) { int gotPicture; frame = new AVFrame(); fixed (byte* pData = &data[0]) fixed (AVFrame* pFrame = &frame) { var packet = new AVPacket {data = pData, size = data.Length}; int decodedSize = FFmpegInvoke.avcodec_decode_video2(_pDecodingContext, pFrame, &gotPicture, &packet); if (decodedSize < 0) Trace.TraceWarning("Error while decoding frame."); } return gotPicture == 1; }
public static extern void av_pkt_dump2(void* f, AVPacket* pkt, int dump_payload, AVStream* st);
public static extern int av_read_frame(AVFormatContext* s, AVPacket* pkt);
public static extern int avcodec_encode_video2(AVCodecContext* avctx, AVPacket* avpkt, AVFrame* frame, int* got_packet_ptr);
public static extern int avcodec_decode_video2(AVCodecContext* avctx, AVFrame* picture, int* got_picture_ptr, AVPacket* avpkt);
public static extern int avcodec_decode_audio3(AVCodecContext* avctx, short* samples, int* frame_size_ptr, AVPacket* avpkt);
public static extern int av_packet_copy_props(AVPacket* dst, AVPacket* src);
public static extern int av_copy_packet_side_data(AVPacket* dst, AVPacket* src);
public static extern int av_dup_packet(AVPacket* pkt);
public static extern int av_packet_from_data(AVPacket* pkt, byte* data, int size);
public static extern int av_grow_packet(AVPacket* pkt, int grow_by);
public static extern void av_shrink_packet(AVPacket* pkt, int size);
public static extern int av_new_packet(AVPacket* pkt, int size);
public static extern void av_packet_unref(AVPacket* pkt);
public static extern void av_packet_move_ref(AVPacket* dst, AVPacket* src);
public static extern void av_free_packet(AVPacket* pkt);
public static extern void av_packet_rescale_ts(AVPacket* pkt, AVRational tb_src, AVRational tb_dst);
public static extern int av_packet_shrink_side_data(AVPacket* pkt, AVPacketSideDataType type, int size);
public static extern int avcodec_decode_audio4(AVCodecContext* avctx, AVFrame* frame, int* got_frame_ptr, AVPacket* avpkt);
public static extern byte* av_packet_get_side_data(AVPacket* pkt, AVPacketSideDataType type, int* size);
public static extern int avcodec_decode_subtitle2(AVCodecContext* avctx, AVSubtitle* sub, int* got_sub_ptr, AVPacket* avpkt);
public static extern int av_packet_merge_side_data(AVPacket* pkt);
public static extern int av_append_packet(AVIOContext* s, AVPacket* pkt, int size);
public static extern int av_packet_split_side_data(AVPacket* pkt);
public static extern int av_interleaved_write_frame(AVFormatContext* s, AVPacket* pkt);
public static extern void av_packet_free_side_data(AVPacket* pkt);
public static extern void av_pkt_dump_log2(void* avcl, int level, AVPacket* pkt, int dump_payload, AVStream* st);
public static extern int av_packet_ref(AVPacket* dst, AVPacket* src);