MMAL Video Decoder.
More...
#include <bcm_host.h>
#include <interface/mmal/mmal.h>
#include <interface/mmal/mmal_parameters_video.h>
#include <interface/mmal/util/mmal_util.h>
#include <interface/mmal/util/mmal_util_params.h>
#include <interface/mmal/util/mmal_default_components.h>
#include <interface/mmal/vc/mmal_vc_api.h>
#include <stdatomic.h>
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "hwconfig.h"
#include "internal.h"
#include "libavutil/avassert.h"
#include "libavutil/buffer.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/log.h"
Go to the source code of this file.
|
| static void | ffmmal_poolref_unref (FFPoolRef *ref) |
| |
| static void | ffmmal_release_frame (void *opaque, uint8_t *data) |
| |
| static int | ffmmal_set_ref (AVFrame *frame, FFPoolRef *pool, MMAL_BUFFER_HEADER_T *buffer) |
| |
| static void | ffmmal_stop_decoder (AVCodecContext *avctx) |
| |
| static av_cold int | ffmmal_close_decoder (AVCodecContext *avctx) |
| |
| static void | input_callback (MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) |
| |
| static void | output_callback (MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) |
| |
| static void | control_port_cb (MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) |
| |
| static int | ffmmal_fill_output_port (AVCodecContext *avctx) |
| |
| static enum AVColorSpace | ffmmal_csp_to_av_csp (MMAL_FOURCC_T fourcc) |
| |
| static int | ffmal_update_format (AVCodecContext *avctx) |
| |
| static av_cold int | ffmmal_init_decoder (AVCodecContext *avctx) |
| |
| static void | ffmmal_flush (AVCodecContext *avctx) |
| |
| static int | ffmmal_add_packet (AVCodecContext *avctx, AVPacket *avpkt, int is_extradata) |
| |
| static int | ffmmal_fill_input_port (AVCodecContext *avctx) |
| |
| static int | ffmal_copy_frame (AVCodecContext *avctx, AVFrame *frame, MMAL_BUFFER_HEADER_T *buffer) |
| |
| static int | ffmmal_read_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame) |
| |
| static int | ffmmal_receive_frame (AVCodecContext *avctx, AVFrame *frame) |
| |
MMAL Video Decoder.
Definition in file mmaldec.c.
◆ MAX_DELAYED_FRAMES
| #define MAX_DELAYED_FRAMES 16 |
◆ FFMMAL_DEC
| #define FFMMAL_DEC |
( |
| NAME, |
|
|
| ID ) |
Value: const FFCodec ff_##NAME##_mmal_decoder = { \
.p.name = #NAME "_mmal", \
CODEC_LONG_NAME(#NAME " (mmal)"), \
.p.wrapper_name = "mmal", \
};
static av_cold void close(AVCodecParserContext *s)
#define FF_CODEC_RECEIVE_FRAME_CB(func)
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
static av_cold int ffmmal_close_decoder(AVCodecContext *avctx)
static av_cold int ffmmal_init_decoder(AVCodecContext *avctx)
static const AVClass ffmmal_dec_class
static const AVCodecHWConfigInternal *const mmal_hw_configs[]
static void ffmmal_flush(AVCodecContext *avctx)
static int ffmmal_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Definition at line 838 of file mmaldec.c.
◆ ffmmal_poolref_unref()
| static void ffmmal_poolref_unref |
( |
FFPoolRef * | ref | ) |
|
|
static |
◆ ffmmal_release_frame()
| static void ffmmal_release_frame |
( |
void * | opaque, |
|
|
uint8_t * | data ) |
|
static |
◆ ffmmal_set_ref()
| static int ffmmal_set_ref |
( |
AVFrame * | frame, |
|
|
FFPoolRef * | pool, |
|
|
MMAL_BUFFER_HEADER_T * | buffer ) |
|
static |
◆ ffmmal_stop_decoder()
◆ ffmmal_close_decoder()
◆ input_callback()
| static void input_callback |
( |
MMAL_PORT_T * | port, |
|
|
MMAL_BUFFER_HEADER_T * | buffer ) |
|
static |
◆ output_callback()
| static void output_callback |
( |
MMAL_PORT_T * | port, |
|
|
MMAL_BUFFER_HEADER_T * | buffer ) |
|
static |
◆ control_port_cb()
| static void control_port_cb |
( |
MMAL_PORT_T * | port, |
|
|
MMAL_BUFFER_HEADER_T * | buffer ) |
|
static |
◆ ffmmal_fill_output_port()
◆ ffmmal_csp_to_av_csp()
| static enum AVColorSpace ffmmal_csp_to_av_csp |
( |
MMAL_FOURCC_T | fourcc | ) |
|
|
static |
◆ ffmal_update_format()
◆ ffmmal_init_decoder()
◆ ffmmal_flush()
◆ ffmmal_add_packet()
◆ ffmmal_fill_input_port()
◆ ffmal_copy_frame()
◆ ffmmal_read_frame()
◆ ffmmal_receive_frame()
◆ mmal_pixfmts
Initial value:= {
}
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_MMAL
HW acceleration though MMAL, data[3] contains a pointer to the MMAL_BUFFER_HEADER_T structure.
Definition at line 105 of file mmaldec.c.
Referenced by ffmmal_init_decoder().
◆ mmal_hw_configs
Initial value:= {
}
#define HW_CONFIG_INTERNAL(format)
Definition at line 820 of file mmaldec.c.
◆ options
Initial value:={
{
"extra_buffers",
"extra buffers", 0x42 ,
AV_OPT_TYPE_INT, {.i64 = 10}, 0, 256, 0},
{
"extra_decoder_buffers",
"extra MMAL internal buffered frames", 0x42 ,
AV_OPT_TYPE_INT, {.i64 = 10}, 0, 256, 0},
}
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition at line 825 of file mmaldec.c.
◆ ffmmal_dec_class
Initial value:= {
.class_name = "mmal_dec",
}
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
Definition at line 831 of file mmaldec.c.