xine-lib: xine-lib-1.2.13/src/video_dec/mmal.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Typedefs | Functions | Variables
mmal.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <pthread.h>`
`#include <bcm_host.h>`
`#include <interface/mmal/mmal.h>`
`#include <interface/mmal/util/mmal_util.h>`
`#include <interface/mmal/util/mmal_default_components.h>`
`#include <xine/xine_internal.h>`
`#include <xine/video_out.h>`
`#include <xine/buffer.h>`
`#include <xine/xineutils.h>`

## Data Structures
struct | mmal_decoder_s

## Macros
#define | LOG_MODULE "mmal_video_decoder"

## Typedefs
typedef struct mmal_decoder_s | mmal_decoder_t

## Functions
static void | free_output_buffer (MMAL_BUFFER_HEADER_T *buffer)
static int | send_output_buffer (mmal_decoder_t *this)
static void | fill_output_port (mmal_decoder_t *this)
static void | control_port_cb (MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
static void | input_port_cb (MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
static void | output_port_cb (MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
static void | stop_codec (mmal_decoder_t *this)
static int | start_codec (mmal_decoder_t *this)
static void | send_frames (mmal_decoder_t *this)
static int | change_output_format (mmal_decoder_t *this)
static void | handle_output (mmal_decoder_t *this)
static void | set_extradata (mmal_decoder_t *this, void *extradata, size_t extradata_size)
static void | free_input_buffer (mmal_decoder_t *this)
static MMAL_BUFFER_HEADER_T * | get_input_buffer (mmal_decoder_t *this)
static int | send_input_buffer (mmal_decoder_t *this)
static void | handle_header (mmal_decoder_t *this, buf_element_t *buf)
static void | mmal_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
static void | mmal_flush (video_decoder_t *this_gen)
static void | mmal_reset (video_decoder_t *this_gen)
static void | mmal_discontinuity (video_decoder_t *this_gen)
static void | mmal_dispose (video_decoder_t *this_gen)
static video_decoder_t * | open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream)
static void * | init_plugin (xine_t *xine, const void *data)

## Variables
static const uint32_t | video_types []
static const decoder_info_t | dec_info
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ LOG_MODULE

#define LOG_MODULE "mmal_video_decoder"

Referenced by change_output_format(), control_port_cb(), get_input_buffer(), open_plugin(), send_input_buffer(), send_output_buffer(), set_extradata(), and start_codec().

## Typedef Documentation

## ◆ mmal_decoder_t

typedef struct mmal_decoder_s mmal_decoder_t

## Function Documentation

## ◆ change_output_format()

static int change_output_format | ( | mmal_decoder_t * | this | ) |
| static

References _x_stream_info_set(), height, LOG_MODULE, NULL, output_port_cb(), VO_SET_FLAGS_CM, width, XINE_STREAM_INFO_FRAME_DURATION, XINE_STREAM_INFO_VIDEO_HEIGHT, XINE_STREAM_INFO_VIDEO_RATIO, XINE_STREAM_INFO_VIDEO_WIDTH, XINE_VERBOSITY_LOG, and xprintf.

Referenced by handle_output().

## ◆ control_port_cb()

static void control_port_cb | ( | MMAL_PORT_T * | port,
|  | MMAL_BUFFER_HEADER_T * | buffer )
| static

References LOG_MODULE, XINE_VERBOSITY_LOG, and xprintf.

Referenced by mmal_reset(), and open_plugin().

## ◆ fill_output_port()

static void fill_output_port | ( | mmal_decoder_t * | this | ) |
| static

References send_output_buffer().

Referenced by output_port_cb(), and send_frames().

## ◆ free_input_buffer()

static void free_input_buffer | ( | mmal_decoder_t * | this | ) |
| static

References NULL.

Referenced by mmal_dispose(), mmal_reset(), and send_input_buffer().

## ◆ free_output_buffer()

static void free_output_buffer | ( | MMAL_BUFFER_HEADER_T * | buffer | ) |
| static

References vo_frame_s::base, vo_frame_s::free, and NULL.

Referenced by mmal_dispose(), mmal_reset(), output_port_cb(), send_frames(), and send_output_buffer().

## ◆ get_input_buffer()

static MMAL_BUFFER_HEADER_T * get_input_buffer | ( | mmal_decoder_t * | this | ) |
| static

References _x_action_pending(), handle_output(), LOG_MODULE, NULL, XINE_VERBOSITY_LOG, and xprintf.

Referenced by mmal_decode_data().

## ◆ handle_header()

static void handle_header | ( | mmal_decoder_t * | this,
|  | buf_element_t * | buf )
| static

References xine_bmiheader::biHeight, xine_bmiheader::biSize, xine_bmiheader::biWidth, BUF_FLAG_ASPECT, BUF_FLAG_STDHEADER, BUF_VIDEO_H264, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, height, NULL, set_extradata(), buf_element_s::type, and width.

Referenced by mmal_decode_data().

## ◆ handle_output()

static void handle_output | ( | mmal_decoder_t * | this | ) |
| static

References change_output_format(), and send_frames().

Referenced by get_input_buffer(), and mmal_decode_data().

## ◆ init_plugin()

static void * init_plugin | ( | xine_t * | xine,
|  | const void * | data )
| static

References video_decoder_s::dispose, N_, NULL, open_plugin(), and video_decoder_class_s::open_plugin.

## ◆ input_port_cb()

static void input_port_cb | ( | MMAL_PORT_T * | port,
|  | MMAL_BUFFER_HEADER_T * | buffer )
| static

Referenced by mmal_reset(), open_plugin(), and set_extradata().

## ◆ mmal_decode_data()

static void mmal_decode_data | ( | video_decoder_t * | this_gen,
|  | buf_element_t * | buf )
| static

References BUF_FLAG_COLOR_MATRIX, BUF_FLAG_FRAME_END, BUF_FLAG_PREVIEW, BUF_FLAG_SPECIAL, BUF_FLAG_STDHEADER, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, get_input_buffer(), handle_header(), handle_output(), buf_element_s::pts, send_input_buffer(), buf_element_s::size, start_codec(), VO_SET_FLAGS_CM, and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_discontinuity()

static void mmal_discontinuity | ( | video_decoder_t * | this_gen | ) |
| static

References send_input_buffer(), and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_dispose()

static void mmal_dispose | ( | video_decoder_t * | this_gen | ) |
| static

References free_input_buffer(), free_output_buffer(), stop_codec(), and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_flush()

static void mmal_flush | ( | video_decoder_t * | this_gen | ) |
| static

References send_frames(), and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_reset()

static void mmal_reset | ( | video_decoder_t * | this_gen | ) |
| static

References control_port_cb(), free_input_buffer(), free_output_buffer(), input_port_cb(), stop_codec(), and xine_container_of.

Referenced by open_plugin().

## ◆ open_plugin()

static video_decoder_t * open_plugin | ( | video_decoder_class_t * | class_gen,
|  | xine_stream_t * | stream )
| static

References _x_get_video_streamtype(), _x_meta_info_set_utf8(), BUF_VIDEO_BASE, BUF_VIDEO_H264, BUF_VIDEO_JPEG, BUF_VIDEO_MPEG, BUF_VIDEO_VC1, control_port_cb(), input(), input_port_cb(), LOG_MODULE, mmal_decode_data(), mmal_discontinuity(), mmal_dispose(), mmal_flush(), mmal_reset(), NULL, VO_SET_FLAGS_CM, xine_stream_s::xine, XINE_META_INFO_VIDEOCODEC, XINE_VERBOSITY_LOG, and xprintf.

Referenced by init_plugin().

## ◆ output_port_cb()

static void output_port_cb | ( | MMAL_PORT_T * | port,
|  | MMAL_BUFFER_HEADER_T * | buffer )
| static

References fill_output_port(), free_output_buffer(), and NULL.

Referenced by change_output_format(), and start_codec().

## ◆ send_frames()

static void send_frames | ( | mmal_decoder_t * | this | ) |
| static

References vo_frame_s::base, vo_frame_s::crop_bottom, vo_frame_s::crop_left, vo_frame_s::crop_right, vo_frame_s::crop_top, vo_frame_s::draw, fill_output_port(), free_output_buffer(), height, NULL, vo_frame_s::pitches, vo_frame_s::pts, width, and yv12_to_yv12().

Referenced by handle_output(), and mmal_flush().

## ◆ send_input_buffer()

static int send_input_buffer | ( | mmal_decoder_t * | this | ) |
| static

References free_input_buffer(), LOG_MODULE, NULL, XINE_VERBOSITY_LOG, and xprintf.

Referenced by mmal_decode_data(), and mmal_discontinuity().

## ◆ send_output_buffer()

static int send_output_buffer | ( | mmal_decoder_t * | this | ) |
| static

References vo_frame_s::base, free_output_buffer(), LOG_MODULE, vo_frame_s::pitches, VO_BOTH_FIELDS, XINE_IMGFMT_YV12, XINE_VERBOSITY_LOG, and xprintf.

Referenced by fill_output_port().

## ◆ set_extradata()

static void set_extradata | ( | mmal_decoder_t * | this,
|  | void * | extradata,
|  | size_t | extradata_size )
| static

References input(), input_port_cb(), LOG_MODULE, XINE_VERBOSITY_LOG, and xprintf.

Referenced by handle_header().

## ◆ start_codec()

static int start_codec | ( | mmal_decoder_t * | this | ) |
| static

References input(), LOG_MODULE, output_port_cb(), XINE_VERBOSITY_LOG, and xprintf.

Referenced by mmal_decode_data().

## ◆ stop_codec()

static void stop_codec | ( | mmal_decoder_t * | this | ) |
| static

Referenced by mmal_dispose(), and mmal_reset().

## Variable Documentation

## ◆ dec_info

const decoder_info_t dec_info
| static

Initial value:
= {
.supported_types = video_types,
.priority = 10,
}
video_types
static const uint32_t video_types[]
Definition mmal.c:860

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_VIDEO_DECODER, 19, "libmmal", XINE_VERSION_CODE, &dec_info, init_plugin },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
dec_info
static const decoder_info_t dec_info
Definition mmal.c:868
init_plugin
static void * init_plugin(xine_t *xine, const void *data)
Definition mmal.c:844
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition xine_internal.h:57
NULL
NULL
Definition xine_plugin.c:78
PLUGIN_NONE
#define PLUGIN_NONE
Definition xine_plugin.h:29
PLUGIN_VIDEO_DECODER
#define PLUGIN_VIDEO_DECODER
Definition xine_plugin.h:33

## ◆ video_types

const uint32_t video_types[]
| static

Initial value:
= {
BUF_VIDEO_H264,
BUF_VIDEO_VC1,
BUF_VIDEO_MPEG,
BUF_VIDEO_JPEG,
0
}
BUF_VIDEO_JPEG
#define BUF_VIDEO_JPEG
Definition buffer.h:108
BUF_VIDEO_MPEG
#define BUF_VIDEO_MPEG
Definition buffer.h:91
BUF_VIDEO_H264
#define BUF_VIDEO_H264
Definition buffer.h:167
BUF_VIDEO_VC1
#define BUF_VIDEO_VC1
Definition buffer.h:191