コード例 #1
0
 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;
 }
コード例 #2
0
    public byte[] ConvertFrame(ref AVFrame frame)
    {
      if (_initialized == false)
        Initialize(frame.width, frame.height, (AVPixelFormat)frame.format);

      fixed (AVFrame* pFrame = &frame)
      fixed (byte* pOutputData = &_outputData[0])
      {
        byte** pSrcData = &(pFrame)->data_0;
        byte** pDstData = &(_pCurrentFrame)->data_0;
        _pCurrentFrame->data_0 = pOutputData;
        FFmpegInvoke.sws_scale(_pContext, pSrcData, pFrame->linesize, 0, frame.height, pDstData, _pCurrentFrame->linesize);
      }
      return _outputData;
    }
コード例 #3
0
 public static extern int avcodec_fill_audio_frame(AVFrame* frame, int nb_channels, AVSampleFormat sample_fmt, byte* buf, int buf_size, int align);
コード例 #4
0
 public static extern int avcodec_encode_video(AVCodecContext* avctx, byte* buf, int buf_size, AVFrame* pict);
コード例 #5
0
 public static extern int avcodec_decode_audio4(AVCodecContext* avctx, AVFrame* frame, int* got_frame_ptr, AVPacket* avpkt);
コード例 #6
0
 public static extern void avcodec_default_release_buffer(AVCodecContext* s, AVFrame* pic);
コード例 #7
0
 public static extern void avcodec_get_frame_defaults(AVFrame* frame);
コード例 #8
0
 public static extern int av_frame_get_pkt_size(AVFrame* frame);
コード例 #9
0
 public static extern long av_frame_get_channel_layout(AVFrame* frame);
コード例 #10
0
 public static extern void av_frame_set_pkt_pos(AVFrame* frame, long val);
コード例 #11
0
 public static extern long av_frame_get_pkt_pos(AVFrame* frame);
コード例 #12
0
 public static extern long av_frame_get_pkt_duration(AVFrame* frame);
コード例 #13
0
 public static extern void av_frame_set_best_effort_timestamp(AVFrame* frame, long val);
コード例 #14
0
 public static extern long av_frame_get_best_effort_timestamp(AVFrame* frame);
コード例 #15
0
 public static extern int av_frame_get_decode_error_flags(AVFrame* frame);
コード例 #16
0
 public static extern void av_frame_set_channel_layout(AVFrame* frame, long val);
コード例 #17
0
 public static extern void av_frame_set_decode_error_flags(AVFrame* frame, int val);
コード例 #18
0
 public static extern int av_frame_get_channels(AVFrame* frame);
コード例 #19
0
 public static extern void av_frame_set_pkt_size(AVFrame* frame, int val);
コード例 #20
0
 public static extern void av_frame_set_channels(AVFrame* frame, int val);
コード例 #21
0
 public static extern void avcodec_free_frame(AVFrame** frame);
コード例 #22
0
 public static extern int av_frame_get_sample_rate(AVFrame* frame);
コード例 #23
0
 public static extern int avcodec_default_reget_buffer(AVCodecContext* s, AVFrame* pic);
コード例 #24
0
 public static extern void av_frame_set_sample_rate(AVFrame* frame, int val);
コード例 #25
0
 public static extern int avcodec_decode_video2(AVCodecContext* avctx, AVFrame* picture, int* got_picture_ptr, AVPacket* avpkt);
コード例 #26
0
 public static extern AVDictionary* av_frame_get_metadata(AVFrame* frame);
コード例 #27
0
 public static extern int avcodec_encode_video2(AVCodecContext* avctx, AVPacket* avpkt, AVFrame* frame, int* got_packet_ptr);
コード例 #28
0
 public static extern void av_frame_set_metadata(AVFrame* frame, AVDictionary* val);
コード例 #29
0
 public static extern AVRational av_guess_sample_aspect_ratio(AVFormatContext* format, AVStream* stream, AVFrame* frame);
コード例 #30
0
 public VideoPacketDecoder(PixelFormat pixelFormat)
 {
   _pixelFormat = pixelFormat;
   _avFrame = new AVFrame();
   _avPacket = new AVPacket();
 }