Loading...
Searching...
No Matches
FFmpegUtilities.h File Reference

Header file for FFmpegUtilities. More...

`#include "OpenShotVersion.h"`
`#include <libavcodec/avcodec.h>`
`#include <libavformat/avformat.h>`
`#include <libswscale/swscale.h>`
`#include <libavresample/avresample.h>`
`#include <libavutil/mathematics.h>`
`#include <libavutil/pixfmt.h>`
`#include <libavutil/pixdesc.h>`
`#include <libavcodec/opt.h>`
`#include "libavutil/imgutils.h"`

Go to the source code of this file.

## Macros

#define | ALLOC_CODEC_CTX(ctx, codec, stream) ctx = avcodec_alloc_context3(codec);
#define | AUDIO_PACKET_ENCODING_SIZE 768000
#define | AV_ALLOCATE_FRAME() av_frame_alloc()
#define | AV_ALLOCATE_IMAGE(av_frame, pix_fmt, width, height) av_image_alloc(av_frame->data, av_frame->linesize, width, height, pix_fmt, 1)
#define | AV_COPY_PARAMS_FROM_CONTEXT(av_stream, av_codec) avcodec_parameters_from_context(av_stream->codecpar, av_codec);
#define | AV_COPY_PICTURE_DATA(av_frame, buffer, pix_fmt, width, height) av_image_fill_arrays(av_frame->data, av_frame->linesize, buffer, pix_fmt, width, height, 1)
#define | av_err2str(errnum) av_err2string(errnum).c_str()
#define | AV_ERROR_MAX_STRING_SIZE 64
#define | AV_FILENAME filename
#define | AV_FIND_DECODER_CODEC_ID(av_stream) av_stream->codecpar->codec_id
#define | AV_FREE_CONTEXT(av_context) avcodec_free_context(&av_context)
#define | AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
#define | AV_FREE_PACKET(av_packet) av_packet_unref(av_packet)
#define | AV_GET_CODEC_ATTRIBUTES(av_stream, av_context) av_stream->codecpar
#define | AV_GET_CODEC_CONTEXT(av_stream, av_codec)
#define | AV_GET_CODEC_FROM_STREAM(av_stream, codec_in)
#define | AV_GET_CODEC_PAR_CONTEXT(av_stream, av_codec) av_codec;
#define | AV_GET_CODEC_PIXEL_FORMAT(av_stream, av_context) (AVPixelFormat) av_stream->codecpar->format
#define | AV_GET_CODEC_TYPE(av_stream) av_stream->codecpar->codec_type
#define | AV_GET_IMAGE_SIZE(pix_fmt, width, height) av_image_get_buffer_size(pix_fmt, width, height, 1)
#define | AV_GET_SAMPLE_FORMAT(av_stream, av_context) av_stream->codecpar->format
#define | AV_OPTION_FIND(priv_data, name) av_opt_find(priv_data, name, NULL, 0, 0)
#define | AV_OPTION_SET(av_stream, priv_data, name, value, avcodec)
#define | AV_OUTPUT_CONTEXT(output_context, path) avformat_alloc_output_context2( output_context, NULL, NULL, path)
#define | AV_REGISTER_ALL av_register_all();
#define | AV_RESET_FRAME(av_frame) av_frame_unref(av_frame)
#define | AV_SET_FILENAME(oc, f) snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", f)
#define | AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
#define | AVCODEC_REGISTER_ALL avcodec_register_all();
#define | INT64_C(c) (c ## LL)
#define | IS_FFMPEG_3_2 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 64, 101))
#define | MY_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
#define | PIX_FMT_NONE AV_PIX_FMT_NONE
#define | PIX_FMT_RGB24 AV_PIX_FMT_RGB24
#define | PIX_FMT_RGBA AV_PIX_FMT_RGBA
#define | PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
#define | PIX_FMT_YUV444P AV_PIX_FMT_YUV444P
#define | PixelFormat AVPixelFormat
#define | SWR_ALLOC() avresample_alloc_context()
#define | SWR_CLOSE(ctx) avresample_close(ctx)
#define | SWR_CONVERT(ctx, out, linesize, out_count, in, linesize2, in_count) avresample_convert(ctx, out, linesize, out_count, (uint8_t **)in, linesize2, in_count)
#define | SWR_FREE(ctx) avresample_free(ctx)
#define | SWR_INIT(ctx) avresample_open(ctx)
#define | SWRCONTEXT AVAudioResampleContext
#define | UINT64_C(c) (c ## ULL)
#define | USE_HW_ACCEL (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 107, 100))
#define | USE_SW FFMPEG_USE_SWRESAMPLE

## Detailed Description

Header file for FFmpegUtilities.

Author
  Jonathan Thomas jonat.nosp@m.han@.nosp@m.opens.nosp@m.hot..nosp@m.org

License

Definition in file FFmpegUtilities.h.

## Macro Definition Documentation

## ALLOC_CODEC_CTX

#define ALLOC_CODEC_CTX | ( |  | ctx,
|  |  | codec,
|  |  | stream
| ) |  | ctx = avcodec_alloc_context3(codec);

Definition at line 224 of file FFmpegUtilities.h.

## AUDIO_PACKET_ENCODING_SIZE

#define AUDIO_PACKET_ENCODING_SIZE 768000

Definition at line 83 of file FFmpegUtilities.h.

## AV_ALLOCATE_FRAME

#define AV_ALLOCATE_FRAME | ( |  | ) | av_frame_alloc()

Definition at line 196 of file FFmpegUtilities.h.

## AV_ALLOCATE_IMAGE

#define AV_ALLOCATE_IMAGE | ( |  | av_frame,
|  |  | pix_fmt,
|  |  | width,
|  |  | height
| ) |  | av_image_alloc(av_frame->data, av_frame->linesize, width, height, pix_fmt, 1)

Definition at line 197 of file FFmpegUtilities.h.

## AV_COPY_PARAMS_FROM_CONTEXT

#define AV_COPY_PARAMS_FROM_CONTEXT | ( |  | av_stream,
|  |  | av_codec
| ) |  | avcodec_parameters_from_context(av_stream->codecpar, av_codec);

Definition at line 226 of file FFmpegUtilities.h.

## AV_COPY_PICTURE_DATA

#define AV_COPY_PICTURE_DATA | ( |  | av_frame,
|  |  | buffer,
|  |  | pix_fmt,
|  |  | width,
|  |  | height
| ) |  | av_image_fill_arrays(av_frame->data, av_frame->linesize, buffer, pix_fmt, width, height, 1)

Definition at line 216 of file FFmpegUtilities.h.

## av_err2str

#define av_err2str | ( |  | errnum | ) | av_err2string(errnum).c_str()

Definition at line 96 of file FFmpegUtilities.h.

## AV_ERROR_MAX_STRING_SIZE

#define AV_ERROR_MAX_STRING_SIZE 64

Definition at line 79 of file FFmpegUtilities.h.

## AV_FILENAME

#define AV_FILENAME filename

Definition at line 193 of file FFmpegUtilities.h.

## AV_FIND_DECODER_CODEC_ID

#define AV_FIND_DECODER_CODEC_ID | ( |  | av_stream | ) | av_stream->codecpar->codec_id

Definition at line 204 of file FFmpegUtilities.h.

## AV_FREE_CONTEXT

#define AV_FREE_CONTEXT | ( |  | av_context | ) | avcodec_free_context(&av_context)

Definition at line 202 of file FFmpegUtilities.h.

## AV_FREE_FRAME

#define AV_FREE_FRAME | ( |  | av_frame | ) | av_frame_free(av_frame)

Definition at line 200 of file FFmpegUtilities.h.

## AV_FREE_PACKET

#define AV_FREE_PACKET | ( |  | av_packet | ) | av_packet_unref(av_packet)

Definition at line 201 of file FFmpegUtilities.h.

## AV_GET_CODEC_ATTRIBUTES

#define AV_GET_CODEC_ATTRIBUTES | ( |  | av_stream,
|  |  | av_context
| ) |  | av_stream->codecpar

Definition at line 211 of file FFmpegUtilities.h.

## AV_GET_CODEC_CONTEXT

#define AV_GET_CODEC_CONTEXT | ( |  | av_stream,
|  |  | av_codec
| ) |  |

Value:
({ AVCodecContext *context = avcodec_alloc_context3(av_codec); \
avcodec_parameters_to_context(context, av_stream->codecpar); \
context; })

Definition at line 205 of file FFmpegUtilities.h.

## AV_GET_CODEC_FROM_STREAM

#define AV_GET_CODEC_FROM_STREAM | ( |  | av_stream,
|  |  | codec_in
| ) |  |

Definition at line 210 of file FFmpegUtilities.h.

## AV_GET_CODEC_PAR_CONTEXT

#define AV_GET_CODEC_PAR_CONTEXT | ( |  | av_stream,
|  |  | av_codec
| ) |  | av_codec;

Definition at line 209 of file FFmpegUtilities.h.

## AV_GET_CODEC_PIXEL_FORMAT

#define AV_GET_CODEC_PIXEL_FORMAT | ( |  | av_stream,
|  |  | av_context
| ) |  | (AVPixelFormat) av_stream->codecpar->format

Definition at line 212 of file FFmpegUtilities.h.

## AV_GET_CODEC_TYPE

#define AV_GET_CODEC_TYPE | ( |  | av_stream | ) | av_stream->codecpar->codec_type

Definition at line 203 of file FFmpegUtilities.h.

## AV_GET_IMAGE_SIZE

#define AV_GET_IMAGE_SIZE | ( |  | pix_fmt,
|  |  | width,
|  |  | height
| ) |  | av_image_get_buffer_size(pix_fmt, width, height, 1)

Definition at line 215 of file FFmpegUtilities.h.

## AV_GET_SAMPLE_FORMAT

#define AV_GET_SAMPLE_FORMAT | ( |  | av_stream,
|  |  | av_context
| ) |  | av_stream->codecpar->format

Definition at line 214 of file FFmpegUtilities.h.

## AV_OPTION_FIND

#define AV_OPTION_FIND | ( |  | priv_data,
|  |  | name
| ) |  | av_opt_find(priv_data, name, NULL, 0, 0)

Definition at line 220 of file FFmpegUtilities.h.

## AV_OPTION_SET

#define AV_OPTION_SET | ( |  | av_stream,
|  |  | priv_data,
|  |  | name,
|  |  | value,
|  |  | avcodec
| ) |  |

Value:
av_opt_set(priv_data, name, value, 0); \
avcodec_parameters_from_context(av_stream->codecpar, avcodec);

Definition at line 221 of file FFmpegUtilities.h.

## AV_OUTPUT_CONTEXT

#define AV_OUTPUT_CONTEXT | ( |  | output_context,
|  |  | path
| ) |  | avformat_alloc_output_context2( output_context, NULL, NULL, path)

Definition at line 218 of file FFmpegUtilities.h.

## AV_REGISTER_ALL

#define AV_REGISTER_ALL av_register_all();

Definition at line 191 of file FFmpegUtilities.h.

## AV_RESET_FRAME

#define AV_RESET_FRAME | ( |  | av_frame | ) | av_frame_unref(av_frame)

Definition at line 199 of file FFmpegUtilities.h.

## AV_SET_FILENAME

#define AV_SET_FILENAME | ( |  | oc,
|  |  | f
| ) |  | snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", f)

Definition at line 194 of file FFmpegUtilities.h.

## AVCODEC_MAX_AUDIO_FRAME_SIZE

#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000

Definition at line 76 of file FFmpegUtilities.h.

## AVCODEC_REGISTER_ALL

#define AVCODEC_REGISTER_ALL avcodec_register_all();

Definition at line 192 of file FFmpegUtilities.h.

## INT64_C

#define INT64_C | ( |  | c | ) | (c ## LL)

Definition at line 20 of file FFmpegUtilities.h.

## IS_FFMPEG_3_2

#define IS_FFMPEG_3_2 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 64, 101))

Definition at line 25 of file FFmpegUtilities.h.

## MY_INPUT_BUFFER_PADDING_SIZE

#define MY_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE

Definition at line 195 of file FFmpegUtilities.h.

## PIX_FMT_NONE

#define PIX_FMT_NONE AV_PIX_FMT_NONE

Definition at line 106 of file FFmpegUtilities.h.

## PIX_FMT_RGB24

#define PIX_FMT_RGB24 AV_PIX_FMT_RGB24

Definition at line 109 of file FFmpegUtilities.h.

## PIX_FMT_RGBA

#define PIX_FMT_RGBA AV_PIX_FMT_RGBA

Definition at line 103 of file FFmpegUtilities.h.

## PIX_FMT_YUV420P

#define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P

Definition at line 112 of file FFmpegUtilities.h.

## PIX_FMT_YUV444P

#define PIX_FMT_YUV444P AV_PIX_FMT_YUV444P

Definition at line 115 of file FFmpegUtilities.h.

## PixelFormat

#define PixelFormat AVPixelFormat

Definition at line 100 of file FFmpegUtilities.h.

## SWR_ALLOC

#define SWR_ALLOC | ( |  | ) | avresample_alloc_context()

Definition at line 144 of file FFmpegUtilities.h.

## SWR_CLOSE

#define SWR_CLOSE | ( |  | ctx | ) | avresample_close(ctx)

Definition at line 145 of file FFmpegUtilities.h.

## SWR_CONVERT

#define SWR_CONVERT | ( |  | ctx,
|  |  | out,
|  |  | linesize,
|  |  | out_count,
|  |  | in,
|  |  | linesize2,
|  |  | in_count
| ) |  | avresample_convert(ctx, out, linesize, out_count, (uint8_t **)in, linesize2, in_count)

Definition at line 142 of file FFmpegUtilities.h.

## SWR_FREE

#define SWR_FREE | ( |  | ctx | ) | avresample_free(ctx)

Definition at line 146 of file FFmpegUtilities.h.

## SWR_INIT

#define SWR_INIT | ( |  | ctx | ) | avresample_open(ctx)

Definition at line 147 of file FFmpegUtilities.h.

## SWRCONTEXT

#define SWRCONTEXT AVAudioResampleContext

Definition at line 148 of file FFmpegUtilities.h.

## UINT64_C

#define UINT64_C | ( |  | c | ) | (c ## ULL)

Definition at line 21 of file FFmpegUtilities.h.

## USE_HW_ACCEL

#define USE_HW_ACCEL (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 107, 100))

Definition at line 29 of file FFmpegUtilities.h.

## USE_SW

#define USE_SW FFMPEG_USE_SWRESAMPLE

Definition at line 33 of file FFmpegUtilities.h.