// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // FFmpegGlue is an interface between FFmpeg and Chrome used to proxy FFmpeg's // read and seek requests to Chrome's internal data structures. The glue works // through the AVIO interface provided by FFmpeg. // // AVIO works through a special AVIOContext created through avio_alloc_context() // which is attached to the AVFormatContext used for demuxing. The AVIO context // is initialized with read and seek methods which FFmpeg calls when necessary. // // During OpenContext() FFmpegGlue will tell FFmpeg to use Chrome's AVIO context // by passing NULL in for the filename parameter to avformat_open_input(). All // FFmpeg operations using the configured AVFormatContext will then redirect // reads and seeks through the glue. // // The glue in turn processes those read and seek requests using the // FFmpegURLProtocol provided during construction. #ifndef MEDIA_FILTERS_FFMPEG_GLUE_H_ #define MEDIA_FILTERS_FFMPEG_GLUE_H_ #include <stdint.h> #include <memory> #include "base/check.h" #include "base/memory/raw_ptr_exclusion.h" #include "media/base/container_names.h" #include "media/base/media_export.h" #include "media/ffmpeg/ffmpeg_deleters.h" struct AVFormatContext; struct AVIOContext; namespace media { class MEDIA_EXPORT FFmpegURLProtocol { … }; class MEDIA_EXPORT FFmpegGlue { … }; } // namespace media #endif // MEDIA_FILTERS_FFMPEG_GLUE_H_