Ejemplo n.º 1
1
 public static extern AVRational av_guess_frame_rate(AVFormatContext* ctx, AVStream* stream, AVFrame* frame);
Ejemplo n.º 2
0
 public static unsafe void UpdateFrame(AVFrame* avFrame, Bitmap bitmap)
 {
     Rectangle rect = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
     BitmapData bmpData = bitmap.LockBits(rect, ImageLockMode.ReadWrite, bitmap.PixelFormat);
     FFmpegInvoke.avpicture_fill((AVPicture*)avFrame, (byte*)bmpData.Scan0, (AVPixelFormat)avFrame->format, bitmap.Width, bitmap.Height);
     bitmap.UnlockBits(bmpData);
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
        public byte[] ConvertFrame(AVFrame* pFrame)
        {
            if (_initialized == false)
                Initialize(pFrame->width, pFrame->height, (AVPixelFormat)pFrame->format);

            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, pFrame->height, pDstData, _pCurrentFrame->linesize);
            }
            return _outputData;
        }
Ejemplo n.º 7
0
 public static extern int avcodec_decode_video2(AVCodecContext* avctx, AVFrame* picture, int* got_picture_ptr, AVPacket* avpkt);
Ejemplo n.º 8
0
 public static extern int avcodec_decode_audio4(AVCodecContext* avctx, AVFrame* frame, int* got_frame_ptr, AVPacket* avpkt);
Ejemplo n.º 9
0
 public static extern int swr_convert_frame(SwrContext* swr, AVFrame* output, AVFrame* input);
Ejemplo n.º 10
0
 public static extern AVRational av_guess_sample_aspect_ratio(AVFormatContext* format, AVStream* stream, AVFrame* frame);
Ejemplo n.º 11
0
 public static extern int avcodec_fill_audio_frame(AVFrame* frame, int nb_channels, AVSampleFormat sample_fmt, byte* buf, int buf_size, int align);
Ejemplo n.º 12
0
 public static extern void av_frame_remove_side_data(AVFrame* frame, AVFrameSideDataType type);
Ejemplo n.º 13
0
 public static extern AVFrameSideData* av_frame_get_side_data(AVFrame* frame, AVFrameSideDataType type);
Ejemplo n.º 14
0
 public static extern AVFrameSideData* av_frame_new_side_data(AVFrame* frame, AVFrameSideDataType type, int size);
Ejemplo n.º 15
0
 public static extern AVBufferRef* av_frame_get_plane_buffer(AVFrame* frame, int plane);
Ejemplo n.º 16
0
 public static extern int av_frame_copy_props(AVFrame* dst, AVFrame* src);
Ejemplo n.º 17
0
 public static extern int av_frame_make_writable(AVFrame* frame);
Ejemplo n.º 18
0
 public static extern int avcodec_encode_video(AVCodecContext* avctx, byte* buf, int buf_size, AVFrame* pict);
Ejemplo n.º 19
0
 public static extern int avcodec_encode_video2(AVCodecContext* avctx, AVPacket* avpkt, AVFrame* frame, int* got_packet_ptr);
Ejemplo n.º 20
0
 public static extern void avcodec_get_frame_defaults(AVFrame* frame);
Ejemplo n.º 21
0
 public static extern int av_interleaved_write_uncoded_frame(AVFormatContext* s, int stream_index, AVFrame* frame);
Ejemplo n.º 22
0
 public static extern int avfilter_copy_buf_props(AVFrame* dst, AVFilterBufferRef* src);
Ejemplo n.º 23
0
 public static extern void avcodec_free_frame(AVFrame** frame);
Ejemplo n.º 24
0
 public static extern int av_buffersink_get_frame(AVFilterContext* ctx, AVFrame* frame);
Ejemplo n.º 25
0
 public static extern int av_buffersink_get_frame_flags(AVFilterContext* ctx, AVFrame* frame, int flags);
Ejemplo n.º 26
0
 public static extern void avcodec_default_release_buffer(AVCodecContext* s, AVFrame* pic);
Ejemplo n.º 27
0
 public static extern int av_buffersink_get_samples(AVFilterContext* ctx, AVFrame* frame, int nb_samples);
Ejemplo n.º 28
0
 public static extern int avcodec_default_reget_buffer(AVCodecContext* s, AVFrame* pic);
Ejemplo n.º 29
0
 public static extern int swr_config_frame(SwrContext* swr, AVFrame* @out, AVFrame* @in);
Ejemplo n.º 30
0
 public static extern int avcodec_default_get_buffer2(AVCodecContext* s, AVFrame* frame, int flags);