本文整理汇总了C#中FFmpeg.AutoGen.AVFrame类的典型用法代码示例。如果您正苦于以下问题:C# AVFrame类的具体用法?C# AVFrame怎么用?C# AVFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AVFrame类属于FFmpeg.AutoGen命名空间,在下文中一共展示了AVFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: av_guess_frame_rate
public static extern AVRational av_guess_frame_rate(AVFormatContext* ctx, AVStream* stream, AVFrame* frame);
示例2: UpdateFrame
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);
}
示例3: TryDecode
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;
}
示例4: TryDecode
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;
}
示例5: TryDecode
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;
}
示例6: ConvertFrame
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;
}
示例7: avcodec_decode_video2
public static extern int avcodec_decode_video2(AVCodecContext* avctx, AVFrame* picture, int* got_picture_ptr, AVPacket* avpkt);
示例8: avcodec_decode_audio4
public static extern int avcodec_decode_audio4(AVCodecContext* avctx, AVFrame* frame, int* got_frame_ptr, AVPacket* avpkt);
示例9: swr_convert_frame
public static extern int swr_convert_frame(SwrContext* swr, AVFrame* output, AVFrame* input);
示例10: av_guess_sample_aspect_ratio
public static extern AVRational av_guess_sample_aspect_ratio(AVFormatContext* format, AVStream* stream, AVFrame* frame);
示例11: avcodec_fill_audio_frame
public static extern int avcodec_fill_audio_frame(AVFrame* frame, int nb_channels, AVSampleFormat sample_fmt, byte* buf, int buf_size, int align);
示例12: av_frame_remove_side_data
public static extern void av_frame_remove_side_data(AVFrame* frame, AVFrameSideDataType type);
示例13: av_frame_get_side_data
public static extern AVFrameSideData* av_frame_get_side_data(AVFrame* frame, AVFrameSideDataType type);
示例14: av_frame_new_side_data
public static extern AVFrameSideData* av_frame_new_side_data(AVFrame* frame, AVFrameSideDataType type, int size);
示例15: av_frame_get_plane_buffer
public static extern AVBufferRef* av_frame_get_plane_buffer(AVFrame* frame, int plane);