Exemplo n.º 1
0
        internal static unsafe void AvformatOpenInput(AVFormatContext **formatContext, AvioContext avioContext)
        {
            (*formatContext)->pb = (AVIOContext *)avioContext.ContextPtr;
            int result = ffmpeg.avformat_open_input(formatContext, "DUMMY-FILENAME", null, null);

            FfmpegException.Try(result, "avformat_open_input");
        }
Exemplo n.º 2
0
        internal static unsafe int AvSamplesGetBufferSize(AVFrame *frame)
        {
            int result = ffmpeg.av_samples_get_buffer_size(null, frame->channels, frame->nb_samples,
                                                           (AVSampleFormat)frame->format, 1);

            FfmpegException.Try(result, "av_samples_get_buffer_size");
            return(result);
        }
Exemplo n.º 3
0
        internal static unsafe bool AvCodecDecodeAudio4(AVCodecContext *codecContext, AVFrame *frame, AVPacket *packet,
                                                        out int bytesConsumed)
        {
            int gotFrame;
            int result = ffmpeg.avcodec_decode_audio4(codecContext, frame, &gotFrame, packet);

            FfmpegException.Try(result, "avcodec_decode_audio4");
            bytesConsumed = result;
            return(gotFrame != 0);
        }
Exemplo n.º 4
0
        internal static unsafe int AvFindBestStreamInfo(AVFormatContext *formatContext)
        {
            int result = ffmpeg.av_find_best_stream(
                formatContext,
                AVMediaType.AVMEDIA_TYPE_AUDIO,
                -1, -1, null, 0);

            FfmpegException.Try(result, "av_find_best_stream");

            return(result); //stream index
        }
Exemplo n.º 5
0
        internal static unsafe void AvCodecOpen(AVCodecContext *codecContext, AVCodec *codec)
        {
            int result = ffmpeg.avcodec_open2(codecContext, codec, null);

            FfmpegException.Try(result, "avcodec_open2");
        }
Exemplo n.º 6
0
        internal static unsafe void AvFormatFindStreamInfo(AVFormatContext *formatContext)
        {
            int result = ffmpeg.avformat_find_stream_info(formatContext, null);

            FfmpegException.Try(result, "avformat_find_stream_info");
        }
Exemplo n.º 7
0
        internal static unsafe void AvformatOpenInput(AVFormatContext **formatContext, string url)
        {
            int result = ffmpeg.avformat_open_input(formatContext, url, null, null);

            FfmpegException.Try(result, "avformat_open_input");
        }