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 static extern int avcodec_decode_audio4(AVCodecContext* avctx, AVFrame* frame, int* got_frame_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_split_side_data(AVPacket* pkt);
 public static extern byte* av_packet_get_side_data(AVPacket* pkt, AVPacketSideDataType type, int* size);
 public static extern void av_free_packet(AVPacket* pkt);
 public static extern int av_packet_shrink_side_data(AVPacket* pkt, AVPacketSideDataType type, int size);
 public static extern int av_dup_packet(AVPacket* pkt);
 public static extern int av_copy_packet(AVPacket* dst, AVPacket* src);
 public static extern void av_shrink_packet(AVPacket* pkt, int size);
 public static extern int av_grow_packet(AVPacket* pkt, int grow_by);
 public static extern int av_new_packet(AVPacket* pkt, int size);
 public static extern void av_init_packet(AVPacket* pkt);
 public static extern void av_destruct_packet(AVPacket* pkt);
 public static extern int avcodec_decode_video2(AVCodecContext* avctx, AVFrame* picture, int* got_picture_ptr, AVPacket* avpkt);
 public static extern int av_packet_merge_side_data(AVPacket* pkt);
 public static extern void av_pkt_dump_log2(void* avcl, int level, AVPacket* pkt, int dump_payload, AVStream* st);
 public VideoPacketDecoder(PixelFormat pixelFormat)
 {
   _pixelFormat = pixelFormat;
   _avFrame = new AVFrame();
   _avPacket = new AVPacket();
 }
 public static extern int av_interleave_packet_per_dts(AVFormatContext* s, AVPacket* @out, AVPacket* pkt, int flush);
 public static extern void av_pkt_dump2(void* f, AVPacket* pkt, int dump_payload, AVStream* st);
 public static extern int av_interleaved_write_frame(AVFormatContext* s, AVPacket* pkt);
 public static extern int av_read_frame(AVFormatContext* s, AVPacket* pkt);
 public static extern int av_append_packet(AVIOContext* s, AVPacket* pkt, int size);
 public static extern int avcodec_encode_video2(AVCodecContext* avctx, AVPacket* avpkt, AVFrame* frame, int* got_packet_ptr);
 public static extern int avcodec_decode_subtitle2(AVCodecContext* avctx, AVSubtitle* sub, int* got_sub_ptr, AVPacket* avpkt);