Commit 13d858be authored by Philippe Gorley's avatar Philippe Gorley

media: remove old libav* macros

Change-Id: I6f7477c227e7b846c3399e7beabb90339c1bef90
parent 66a5d04f
......@@ -21,29 +21,8 @@
#ifndef __LIBAV_DEPS_H__
#define __LIBAV_DEPS_H__
/* LIBAVFORMAT_VERSION_CHECK checks for the right version of libav and FFmpeg
* a is the major version
* b and c the minor and micro versions of libav
* d and e the minor and micro versions of FFmpeg */
#define LIBAVFORMAT_VERSION_CHECK( a, b, c, d, e ) \
( (LIBAVFORMAT_VERSION_MICRO < 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
(LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
/* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg
* a is the major version
* b and c the minor and micro versions of libav
* d and e the minor and micro versions of FFmpeg */
#define LIBAVCODEC_VERSION_CHECK( a, b, c, d, e ) \
( (LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
(LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
/* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg
* a is the major version
* b and c the minor and micro versions of libav
* d and e the minor and micro versions of FFmpeg */
#define LIBAVUTIL_VERSION_CHECK( a, b, c, d, e ) \
( (LIBAVUTIL_VERSION_MICRO < 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
(LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
// NOTE versions of FFmpeg's librairies can be checked using something like this:
// #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( major, minor, micro )
extern "C" {
#include <libavcodec/avcodec.h>
......@@ -55,7 +34,6 @@ extern "C" {
#include <libavutil/pixdesc.h>
#include <libavutil/opt.h>
#include <libavutil/channel_layout.h>
#include <libavutil/mathematics.h> // for av_rescale_q (old libav support)
#include <libavutil/imgutils.h>
#include <libavutil/intreadwrite.h>
#include <libavutil/log.h>
......@@ -63,6 +41,4 @@ extern "C" {
#include "libav_utils.h"
#define PIXEL_FORMAT(FMT) AV_PIX_FMT_ ## FMT
#endif // __LIBAV_DEPS_H__
......@@ -160,11 +160,11 @@ void ring_avcodec_init()
int libav_pixel_format(int fmt)
{
switch (fmt) {
case video::VIDEO_PIXFMT_BGRA: return PIXEL_FORMAT(BGRA);
case video::VIDEO_PIXFMT_RGBA: return PIXEL_FORMAT(RGBA);
case video::VIDEO_PIXFMT_YUYV422: return PIXEL_FORMAT(YUYV422);
case video::VIDEO_PIXFMT_YUV420P: return PIXEL_FORMAT(YUV420P);
case video::VIDEO_PIXFMT_NV21: return PIXEL_FORMAT(NV21);
case video::VIDEO_PIXFMT_BGRA: return AV_PIX_FMT_BGRA;
case video::VIDEO_PIXFMT_RGBA: return AV_PIX_FMT_RGBA;
case video::VIDEO_PIXFMT_YUYV422: return AV_PIX_FMT_YUYV422;
case video::VIDEO_PIXFMT_YUV420P: return AV_PIX_FMT_YUV420P;
case video::VIDEO_PIXFMT_NV21: return AV_PIX_FMT_NV21;
}
return fmt;
}
......@@ -172,7 +172,7 @@ int libav_pixel_format(int fmt)
int ring_pixel_format(int fmt)
{
switch (fmt) {
case PIXEL_FORMAT(YUYV422): return video::VIDEO_PIXFMT_YUYV422;
case AV_PIX_FMT_YUYV422: return video::VIDEO_PIXFMT_YUYV422;
}
return fmt;
}
......
......@@ -538,7 +538,7 @@ void MediaEncoder::prepareEncoderContext(bool is_video)
// emit one intra frame every gop_size frames
encoderCtx_->max_b_frames = 0;
encoderCtx_->pix_fmt = PIXEL_FORMAT(YUV420P); // TODO: option me !
encoderCtx_->pix_fmt = AV_PIX_FMT_YUV420P; // TODO: option me !
// Fri Jul 22 11:37:59 EDT 2011:tmatth:XXX: DON'T set this, we want our
// pps and sps to be sent in-band for RTP
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment