Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include "console_video.h"
#include "asterisk/frame.h"
#include "asterisk/utils.h"
Go to the source code of this file.
Data Structures | |
struct | _cm |
struct | video_codec_desc |
struct | video_dec_desc |
Macros | |
#define | H261_MIN_LEN 10 |
#define | H263_MIN_LEN 6 |
#define | HAVE_NAL(x) (x[-4] == 0 && x[-3] == 0 && x[-2] == 0 && x[-1] == 1) |
#define | N_DEC_IN 3 /* number of incoming buffers */ |
Typedefs | |
typedef int(* | decoder_decap_f) (struct fbuf_t *b, uint8_t *data, int len) |
extract the bitstream from RTP frames and store in the fbuf. return 0 if ok, 1 on error More... | |
typedef int(* | decoder_decode_f) (struct video_dec_desc *v, struct fbuf_t *b) |
actually call the decoder More... | |
typedef int(* | decoder_init_f) (AVCodecContext *enc_ctx) |
inizialize the decoder More... | |
typedef struct ast_frame *(* | encoder_encap_f) (struct fbuf_t *, int mtu, struct ast_frame **tail) |
encapsulate the bistream in RTP frames More... | |
typedef int(* | encoder_encode_f) (struct video_out_desc *v) |
actually call the encoder More... | |
typedef int(* | encoder_init_f) (AVCodecContext *v) |
initialize the encoder More... | |
Functions | |
static struct ast_frame * | create_video_frame (uint8_t *start, uint8_t *end, int format, int head, struct ast_frame *prev) |
static struct video_dec_desc * | dec_init (uint32_t the_ast_format) |
static struct video_dec_desc * | dec_uninit (struct video_dec_desc *v) |
uninitialize the descriptor for remote video stream More... | |
static int | fbuf_append (struct fbuf_t *b, uint8_t *src, int len, int sbit, int ebit) |
static int | ffmpeg_decode (struct video_dec_desc *v, struct fbuf_t *b) |
static int | ffmpeg_encode (struct video_out_desc *v) |
static int | h261_decap (struct fbuf_t *b, uint8_t *data, int len) |
static int | h261_enc_init (AVCodecContext *enc_ctx) |
static struct ast_frame * | h261_encap (struct fbuf_t *b, int mtu, struct ast_frame **tail) |
static int | h263_decap (struct fbuf_t *b, uint8_t *data, int len) |
static int | h263_enc_init (AVCodecContext *enc_ctx) |
static struct ast_frame * | h263_encap (struct fbuf_t *b, int mtu, struct ast_frame **tail) |
static int | h263p_decap (struct fbuf_t *b, uint8_t *data, int len) |
extract the bitstreem from the RTP payload. This is format dependent. For h263+, the format is defined in RFC 2429 and basically has a fixed 2-byte header as follows: 5 bits RR reserved, shall be 0 1 bit P indicate a start/end condition, in which case the payload should be prepended by two zero-valued bytes. 1 bit V there is an additional VRC header after this header 6 bits PLEN length in bytes of extra picture header 3 bits PEBIT how many bits to be ignored in the last byte More... | |
static int | h263p_enc_init (AVCodecContext *enc_ctx) |
initialization of h263p More... | |
static struct ast_frame * | h263p_encap (struct fbuf_t *b, int mtu, struct ast_frame **tail) |
static int | h264_dec_init (AVCodecContext *dec_ctx) |
static int | h264_decap (struct fbuf_t *b, uint8_t *data, int len) |
static int | h264_enc_init (AVCodecContext *enc_ctx) |
static struct ast_frame * | h264_encap (struct fbuf_t *b, int mtu, struct ast_frame **tail) |
static struct video_codec_desc * | map_video_codec (int fmt) |
static enum CodecID | map_video_format (uint32_t ast_format, int rw) |
map an asterisk format into an ffmpeg one More... | |
static int | mpeg4_decap (struct fbuf_t *b, uint8_t *data, int len) |
static int | mpeg4_decode (struct video_dec_desc *v, struct fbuf_t *b) |
static int | mpeg4_enc_init (AVCodecContext *enc_ctx) |
static struct ast_frame * | mpeg4_encap (struct fbuf_t *b, int mtu, struct ast_frame **tail) |
Variables | |
static struct video_codec_desc | h261_codec |
static struct video_codec_desc | h263_codec |
static struct video_codec_desc | h263p_codec |
static struct video_codec_desc | h264_codec |
static struct video_codec_desc | mpeg4_codec |
static const struct video_codec_desc * | supported_codecs [] |
static const struct _cm | video_formats [] |
#define H261_MIN_LEN 10 |
Referenced by h261_encap().
#define H263_MIN_LEN 6 |
Referenced by h263_encap().
#define HAVE_NAL | ( | x | ) | (x[-4] == 0 && x[-3] == 0 && x[-2] == 0 && x[-1] == 1) |
Referenced by h264_encap().
#define N_DEC_IN 3 /* number of incoming buffers */ |
Definition at line 92 of file vcodecs.c.
Referenced by dec_uninit().
typedef int(* decoder_decode_f) (struct video_dec_desc *v, struct fbuf_t *b) |
typedef int(* decoder_init_f) (AVCodecContext *enc_ctx) |
typedef int(* encoder_encode_f) (struct video_out_desc *v) |
typedef int(* encoder_init_f) (AVCodecContext *v) |
|
static |
Build an ast_frame for a given chunk of data, and link it into the queue, with possibly 'head' bytes at the beginning to fill in some fields later.
Definition at line 228 of file vcodecs.c.
References ast_calloc, AST_FRAME_VIDEO, ast_free, AST_LIST_NEXT, ast_log, AST_MALLOCD_DATA, AST_MALLOCD_HDR, ast_frame::data, ast_frame::datalen, ast_frame::delivery, video_codec_desc::format, ast_frame::frametype, len(), LOG_WARNING, ast_frame::mallocd, NULL, ast_frame::offset, ast_frame::ptr, ast_frame::samples, ast_frame::seqno, ast_frame::src, and ast_frame::subclass.
Referenced by h261_encap(), h263_encap(), h263p_encap(), h264_encap(), and mpeg4_encap().
|
static |
Definition at line 1204 of file vcodecs.c.
References ast_calloc, ast_log, video_dec_desc::codec, video_dec_desc::d_callbacks, video_dec_desc::d_frame, video_dec_desc::dec_ctx, video_dec_desc::dec_in, video_dec_desc::dec_in_cur, video_dec_desc::dec_in_dpy, dec_uninit(), video_dec_desc::discard, video_codec_desc::format, LOG_WARNING, map_video_codec(), map_video_format(), NULL, and video_dec_desc::parser.
|
static |
uninitialize the descriptor for remote video stream
Definition at line 1172 of file vcodecs.c.
References ast_free, video_dec_desc::codec, video_dec_desc::d_callbacks, video_dec_desc::d_frame, video_dec_desc::dec_ctx, video_dec_desc::dec_in, video_dec_desc::dec_out, video_dec_desc::discard, fbuf_free(), N_DEC_IN, NULL, and video_dec_desc::parser.
Referenced by dec_init().
|
static |
Definition at line 273 of file vcodecs.c.
References ast_calloc, ast_log, ast_realloc, fbuf_t::data, fbuf_t::ebit, len(), LOG_WARNING, NULL, fbuf_t::size, and fbuf_t::used.
Referenced by h261_decap(), h263_decap(), h263p_decap(), h264_decap(), and mpeg4_decap().
|
static |
Definition at line 482 of file vcodecs.c.
References ast_log, video_dec_desc::d_frame, fbuf_t::data, video_dec_desc::dec_ctx, fbuf_t::ebit, len(), LOG_NOTICE, NULL, video_dec_desc::parser, and fbuf_t::used.
|
static |
Definition at line 461 of file vcodecs.c.
References ast_log, fbuf_t::data, LOG_WARNING, NULL, fbuf_t::size, and fbuf_t::used.
|
static |
Definition at line 827 of file vcodecs.c.
References ast_log, fbuf_append(), and LOG_WARNING.
|
static |
Definition at line 729 of file vcodecs.c.
References AST_FORMAT_H261, create_video_frame(), fbuf_t::data, ast_frame::data, first, H261_MIN_LEN, len(), NULL, ast_frame::ptr, ast_frame::subclass, and fbuf_t::used.
|
static |
Definition at line 671 of file vcodecs.c.
References ast_log, fbuf_append(), and LOG_WARNING.
|
static |
Definition at line 575 of file vcodecs.c.
References AST_FORMAT_H263, ast_log, create_video_frame(), fbuf_t::data, ast_frame::data, first, H263_MIN_LEN, len(), LOG_WARNING, NULL, ast_frame::ptr, ast_frame::subclass, and fbuf_t::used.
|
static |
extract the bitstreem from the RTP payload. This is format dependent. For h263+, the format is defined in RFC 2429 and basically has a fixed 2-byte header as follows: 5 bits RR reserved, shall be 0 1 bit P indicate a start/end condition, in which case the payload should be prepended by two zero-valued bytes. 1 bit V there is an additional VRC header after this header 6 bits PLEN length in bytes of extra picture header 3 bits PEBIT how many bits to be ignored in the last byte
XXX the code below is not complete.
Definition at line 433 of file vcodecs.c.
References ast_log, fbuf_append(), and LOG_WARNING.
|
static |
|
static |
Definition at line 360 of file vcodecs.c.
References ast_log, create_video_frame(), fbuf_t::data, ast_frame::data, first, len(), LOG_WARNING, MIN, NULL, ast_frame::ptr, ast_frame::subclass, and fbuf_t::used.
|
static |
|
static |
Definition at line 1046 of file vcodecs.c.
References ast_log, fbuf_append(), LOG_WARNING, retval, and type.
|
static |
Definition at line 959 of file vcodecs.c.
References AST_FORMAT_H264, ast_log, create_video_frame(), d, fbuf_t::data, ast_frame::data, end, first, HAVE_NAL, LOG_WARNING, MIN, NULL, ast_frame::ptr, ast_frame::subclass, and fbuf_t::used.
|
static |
Definition at line 1158 of file vcodecs.c.
References ast_log, video_codec_desc::format, LOG_WARNING, video_codec_desc::name, and NULL.
Referenced by dec_init().
|
static |
map an asterisk format into an ffmpeg one
Definition at line 1133 of file vcodecs.c.
References _cm::ast_format, _cm::codec, and _cm::rw.
Referenced by dec_init().
|
static |
Definition at line 893 of file vcodecs.c.
References fbuf_append().
|
static |
Definition at line 898 of file vcodecs.c.
References ast_log, video_dec_desc::d_frame, fbuf_t::data, ast_frame::datalen, video_dec_desc::dec_ctx, fbuf_t::ebit, LOG_NOTICE, and fbuf_t::used.
|
static |
|
static |
Definition at line 871 of file vcodecs.c.
References create_video_frame(), fbuf_t::data, end, first, len(), MIN, NULL, ast_frame::subclass, and fbuf_t::used.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |