Commit d3a2a9a9 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

libav: Change from deprecated PIX_FMT_* to AV_PIX_FMT_*

parent 4459d706
......@@ -209,7 +209,7 @@ gst_ffmpeg_video_set_pix_fmts (GstCaps * caps, const enum AVPixelFormat *fmts)
g_value_init (&va, GST_TYPE_LIST);
g_value_init (&v, G_TYPE_STRING);
for (i = 0; i <= PIX_FMT_NB; i++) {
for (i = 0; i <= AV_PIX_FMT_NB; i++) {
format = gst_ffmpeg_pixfmt_to_videoformat (i);
if (format == GST_VIDEO_FORMAT_UNKNOWN)
continue;
......@@ -1080,22 +1080,22 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
const gchar *format;
switch (context->pix_fmt) {
case PIX_FMT_YUYV422:
case AV_PIX_FMT_YUYV422:
format = "YUY2";
break;
case PIX_FMT_YUV420P:
case AV_PIX_FMT_YUV420P:
format = "I420";
break;
case PIX_FMT_YUVA420P:
case AV_PIX_FMT_YUVA420P:
format = "A420";
break;
case PIX_FMT_YUV411P:
case AV_PIX_FMT_YUV411P:
format = "Y41B";
break;
case PIX_FMT_YUV422P:
case AV_PIX_FMT_YUV422P:
format = "Y42B";
break;
case PIX_FMT_YUV410P:
case AV_PIX_FMT_YUV410P:
format = "YUV9";
break;
default:
......@@ -2442,53 +2442,53 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
switch (format) {
case GST_VIDEO_FORMAT_YUY2:
context->pix_fmt = PIX_FMT_YUYV422;
context->pix_fmt = AV_PIX_FMT_YUYV422;
break;
case GST_VIDEO_FORMAT_I420:
context->pix_fmt = PIX_FMT_YUV420P;
context->pix_fmt = AV_PIX_FMT_YUV420P;
break;
case GST_VIDEO_FORMAT_A420:
context->pix_fmt = PIX_FMT_YUVA420P;
context->pix_fmt = AV_PIX_FMT_YUVA420P;
break;
case GST_VIDEO_FORMAT_Y41B:
context->pix_fmt = PIX_FMT_YUV411P;
context->pix_fmt = AV_PIX_FMT_YUV411P;
break;
case GST_VIDEO_FORMAT_Y42B:
context->pix_fmt = PIX_FMT_YUV422P;
context->pix_fmt = AV_PIX_FMT_YUV422P;
break;
case GST_VIDEO_FORMAT_YUV9:
context->pix_fmt = PIX_FMT_YUV410P;
context->pix_fmt = AV_PIX_FMT_YUV410P;
break;
case GST_VIDEO_FORMAT_Y444:
context->pix_fmt = PIX_FMT_YUV444P;
context->pix_fmt = AV_PIX_FMT_YUV444P;
break;
case GST_VIDEO_FORMAT_GRAY8:
context->pix_fmt = PIX_FMT_GRAY8;
context->pix_fmt = AV_PIX_FMT_GRAY8;
break;
case GST_VIDEO_FORMAT_xRGB:
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
context->pix_fmt = PIX_FMT_RGB32;
context->pix_fmt = AV_PIX_FMT_RGB32;
#endif
break;
case GST_VIDEO_FORMAT_BGRx:
#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
context->pix_fmt = PIX_FMT_RGB32;
context->pix_fmt = AV_PIX_FMT_RGB32;
#endif
break;
case GST_VIDEO_FORMAT_RGB:
context->pix_fmt = PIX_FMT_RGB24;
context->pix_fmt = AV_PIX_FMT_RGB24;
break;
case GST_VIDEO_FORMAT_BGR:
context->pix_fmt = PIX_FMT_BGR24;
context->pix_fmt = AV_PIX_FMT_BGR24;
break;
case GST_VIDEO_FORMAT_RGB16:
context->pix_fmt = PIX_FMT_RGB565;
context->pix_fmt = AV_PIX_FMT_RGB565;
break;
case GST_VIDEO_FORMAT_RGB15:
context->pix_fmt = PIX_FMT_RGB555;
context->pix_fmt = AV_PIX_FMT_RGB555;
break;
case GST_VIDEO_FORMAT_RGB8P:
context->pix_fmt = PIX_FMT_PAL8;
context->pix_fmt = AV_PIX_FMT_PAL8;
break;
default:
break;
......@@ -2504,83 +2504,83 @@ typedef struct
/* FIXME : FILLME */
static const PixToFmt pixtofmttable[] = {
/* GST_VIDEO_FORMAT_I420, */
{GST_VIDEO_FORMAT_I420, PIX_FMT_YUV420P},
{GST_VIDEO_FORMAT_I420, AV_PIX_FMT_YUV420P},
/* Note : this should use a different chroma placement */
{GST_VIDEO_FORMAT_I420, PIX_FMT_YUVJ420P},
{GST_VIDEO_FORMAT_I420, AV_PIX_FMT_YUVJ420P},
/* GST_VIDEO_FORMAT_YV12, */
/* GST_VIDEO_FORMAT_YUY2, */
{GST_VIDEO_FORMAT_YUY2, PIX_FMT_YUYV422},
{GST_VIDEO_FORMAT_YUY2, AV_PIX_FMT_YUYV422},
/* GST_VIDEO_FORMAT_UYVY, */
{GST_VIDEO_FORMAT_UYVY, PIX_FMT_UYVY422},
{GST_VIDEO_FORMAT_UYVY, AV_PIX_FMT_UYVY422},
/* GST_VIDEO_FORMAT_AYUV, */
/* GST_VIDEO_FORMAT_RGBx, */
/* GST_VIDEO_FORMAT_BGRx, */
/* GST_VIDEO_FORMAT_xRGB, */
/* GST_VIDEO_FORMAT_xBGR, */
/* GST_VIDEO_FORMAT_RGBA, */
{GST_VIDEO_FORMAT_RGBA, PIX_FMT_RGBA},
{GST_VIDEO_FORMAT_RGBA, AV_PIX_FMT_RGBA},
/* GST_VIDEO_FORMAT_BGRA, */
{GST_VIDEO_FORMAT_BGRA, PIX_FMT_BGRA},
{GST_VIDEO_FORMAT_BGRA, AV_PIX_FMT_BGRA},
/* GST_VIDEO_FORMAT_ARGB, */
{GST_VIDEO_FORMAT_ARGB, PIX_FMT_ARGB},
{GST_VIDEO_FORMAT_ARGB, AV_PIX_FMT_ARGB},
/* GST_VIDEO_FORMAT_ABGR, */
{GST_VIDEO_FORMAT_ABGR, PIX_FMT_ABGR},
{GST_VIDEO_FORMAT_ABGR, AV_PIX_FMT_ABGR},
/* GST_VIDEO_FORMAT_RGB, */
{GST_VIDEO_FORMAT_RGB, PIX_FMT_RGB24},
{GST_VIDEO_FORMAT_RGB, AV_PIX_FMT_RGB24},
/* GST_VIDEO_FORMAT_BGR, */
{GST_VIDEO_FORMAT_BGR, PIX_FMT_BGR24},
{GST_VIDEO_FORMAT_BGR, AV_PIX_FMT_BGR24},
/* GST_VIDEO_FORMAT_Y41B, */
{GST_VIDEO_FORMAT_Y41B, PIX_FMT_YUV411P},
{GST_VIDEO_FORMAT_Y41B, AV_PIX_FMT_YUV411P},
/* GST_VIDEO_FORMAT_Y42B, */
{GST_VIDEO_FORMAT_Y42B, PIX_FMT_YUV422P},
{GST_VIDEO_FORMAT_Y42B, PIX_FMT_YUVJ422P},
{GST_VIDEO_FORMAT_Y42B, AV_PIX_FMT_YUV422P},
{GST_VIDEO_FORMAT_Y42B, AV_PIX_FMT_YUVJ422P},
/* GST_VIDEO_FORMAT_YVYU, */
/* GST_VIDEO_FORMAT_Y444, */
{GST_VIDEO_FORMAT_Y444, PIX_FMT_YUV444P},
{GST_VIDEO_FORMAT_Y444, PIX_FMT_YUVJ444P},
{GST_VIDEO_FORMAT_Y444, AV_PIX_FMT_YUV444P},
{GST_VIDEO_FORMAT_Y444, AV_PIX_FMT_YUVJ444P},
/* GST_VIDEO_FORMAT_v210, */
/* GST_VIDEO_FORMAT_v216, */
/* GST_VIDEO_FORMAT_NV12, */
{GST_VIDEO_FORMAT_NV12, PIX_FMT_NV12},
{GST_VIDEO_FORMAT_NV12, AV_PIX_FMT_NV12},
/* GST_VIDEO_FORMAT_NV21, */
{GST_VIDEO_FORMAT_NV21, PIX_FMT_NV21},
{GST_VIDEO_FORMAT_NV21, AV_PIX_FMT_NV21},
/* GST_VIDEO_FORMAT_GRAY8, */
{GST_VIDEO_FORMAT_GRAY8, PIX_FMT_GRAY8},
{GST_VIDEO_FORMAT_GRAY8, AV_PIX_FMT_GRAY8},
/* GST_VIDEO_FORMAT_GRAY16_BE, */
{GST_VIDEO_FORMAT_GRAY16_BE, PIX_FMT_GRAY16BE},
{GST_VIDEO_FORMAT_GRAY16_BE, AV_PIX_FMT_GRAY16BE},
/* GST_VIDEO_FORMAT_GRAY16_LE, */
{GST_VIDEO_FORMAT_GRAY16_LE, PIX_FMT_GRAY16LE},
{GST_VIDEO_FORMAT_GRAY16_LE, AV_PIX_FMT_GRAY16LE},
/* GST_VIDEO_FORMAT_v308, */
/* GST_VIDEO_FORMAT_Y800, */
/* GST_VIDEO_FORMAT_Y16, */
/* GST_VIDEO_FORMAT_RGB16, */
{GST_VIDEO_FORMAT_RGB16, PIX_FMT_RGB565},
{GST_VIDEO_FORMAT_RGB16, AV_PIX_FMT_RGB565},
/* GST_VIDEO_FORMAT_BGR16, */
/* GST_VIDEO_FORMAT_RGB15, */
{GST_VIDEO_FORMAT_RGB15, PIX_FMT_RGB555},
{GST_VIDEO_FORMAT_RGB15, AV_PIX_FMT_RGB555},
/* GST_VIDEO_FORMAT_BGR15, */
/* GST_VIDEO_FORMAT_UYVP, */
/* GST_VIDEO_FORMAT_A420, */
{GST_VIDEO_FORMAT_A420, PIX_FMT_YUVA420P},
{GST_VIDEO_FORMAT_A420, AV_PIX_FMT_YUVA420P},
/* GST_VIDEO_FORMAT_RGB8_PALETTED, */
{GST_VIDEO_FORMAT_RGB8P, PIX_FMT_PAL8},
{GST_VIDEO_FORMAT_RGB8P, AV_PIX_FMT_PAL8},
/* GST_VIDEO_FORMAT_YUV9, */
{GST_VIDEO_FORMAT_YUV9, PIX_FMT_YUV410P},
{GST_VIDEO_FORMAT_YUV9, AV_PIX_FMT_YUV410P},
/* GST_VIDEO_FORMAT_YVU9, */
/* GST_VIDEO_FORMAT_IYU1, */
/* GST_VIDEO_FORMAT_ARGB64, */
/* GST_VIDEO_FORMAT_AYUV64, */
/* GST_VIDEO_FORMAT_r210, */
{GST_VIDEO_FORMAT_I420_10LE, PIX_FMT_YUV420P10LE},
{GST_VIDEO_FORMAT_I420_10BE, PIX_FMT_YUV420P10BE},
{GST_VIDEO_FORMAT_I422_10LE, PIX_FMT_YUV422P10LE},
{GST_VIDEO_FORMAT_I422_10BE, PIX_FMT_YUV422P10BE},
{GST_VIDEO_FORMAT_Y444_10LE, PIX_FMT_YUV444P10LE},
{GST_VIDEO_FORMAT_Y444_10BE, PIX_FMT_YUV444P10BE},
{GST_VIDEO_FORMAT_GBR, PIX_FMT_GBRP},
{GST_VIDEO_FORMAT_GBR_10LE, PIX_FMT_GBRP10LE},
{GST_VIDEO_FORMAT_GBR_10BE, PIX_FMT_GBRP10BE},
{GST_VIDEO_FORMAT_I420_10LE, AV_PIX_FMT_YUV420P10LE},
{GST_VIDEO_FORMAT_I420_10BE, AV_PIX_FMT_YUV420P10BE},
{GST_VIDEO_FORMAT_I422_10LE, AV_PIX_FMT_YUV422P10LE},
{GST_VIDEO_FORMAT_I422_10BE, AV_PIX_FMT_YUV422P10BE},
{GST_VIDEO_FORMAT_Y444_10LE, AV_PIX_FMT_YUV444P10LE},
{GST_VIDEO_FORMAT_Y444_10BE, AV_PIX_FMT_YUV444P10BE},
{GST_VIDEO_FORMAT_GBR, AV_PIX_FMT_GBRP},
{GST_VIDEO_FORMAT_GBR_10LE, AV_PIX_FMT_GBRP10LE},
{GST_VIDEO_FORMAT_GBR_10BE, AV_PIX_FMT_GBRP10BE},
};
GstVideoFormat
......@@ -2604,7 +2604,7 @@ gst_ffmpeg_videoformat_to_pixfmt (GstVideoFormat format)
for (i = 0; i < G_N_ELEMENTS (pixtofmttable); i++)
if (pixtofmttable[i].format == format)
return pixtofmttable[i].pixfmt;
return PIX_FMT_NONE;
return AV_PIX_FMT_NONE;
}
void
......@@ -3039,17 +3039,17 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
if ((format = gst_structure_get_string (str, "format"))) {
if (g_str_equal (format, "YUY2"))
context->pix_fmt = PIX_FMT_YUYV422;
context->pix_fmt = AV_PIX_FMT_YUYV422;
else if (g_str_equal (format, "I420"))
context->pix_fmt = PIX_FMT_YUV420P;
context->pix_fmt = AV_PIX_FMT_YUV420P;
else if (g_str_equal (format, "A420"))
context->pix_fmt = PIX_FMT_YUVA420P;
context->pix_fmt = AV_PIX_FMT_YUVA420P;
else if (g_str_equal (format, "Y41B"))
context->pix_fmt = PIX_FMT_YUV411P;
context->pix_fmt = AV_PIX_FMT_YUV411P;
else if (g_str_equal (format, "Y42B"))
context->pix_fmt = PIX_FMT_YUV422P;
context->pix_fmt = AV_PIX_FMT_YUV422P;
else if (g_str_equal (format, "YUV9"))
context->pix_fmt = PIX_FMT_YUV410P;
context->pix_fmt = AV_PIX_FMT_YUV410P;
else {
GST_WARNING ("couldn't convert format %s" " to a pixel format",
format);
......
......@@ -206,9 +206,9 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps)
ctx = avcodec_alloc_context3 (NULL);
ctx->width = deinterlace->width;
ctx->height = deinterlace->height;
ctx->pix_fmt = PIX_FMT_NB;
ctx->pix_fmt = AV_PIX_FMT_NB;
gst_ffmpeg_caps_with_codectype (AVMEDIA_TYPE_VIDEO, caps, ctx);
if (ctx->pix_fmt == PIX_FMT_NB) {
if (ctx->pix_fmt == AV_PIX_FMT_NB) {
gst_ffmpeg_avcodec_close (ctx);
av_free (ctx);
return FALSE;
......@@ -270,7 +270,7 @@ gst_ffmpegdeinterlace_init (GstFFMpegDeinterlace * deinterlace)
deinterlace->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
gst_element_add_pad (GST_ELEMENT (deinterlace), deinterlace->srcpad);
deinterlace->pixfmt = PIX_FMT_NB;
deinterlace->pixfmt = AV_PIX_FMT_NB;
deinterlace->interlaced = FALSE;
deinterlace->passthrough = FALSE;
......
......@@ -754,9 +754,9 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
gst_buffer_map (buf, &map, GST_MAP_READ);
gst_ffmpeg_avpicture_fill (&src, map.data,
PIX_FMT_RGB24, st->codec->width, st->codec->height);
AV_PIX_FMT_RGB24, st->codec->width, st->codec->height);
av_picture_copy (&dst, &src, PIX_FMT_RGB24,
av_picture_copy (&dst, &src, AV_PIX_FMT_RGB24,
st->codec->width, st->codec->height);
gst_buffer_unmap (buf, &map);
} else {
......
......@@ -133,7 +133,7 @@ gst_ffmpegscale_init (GstFFMpegScale * scale, GstFFMpegScaleClass * klass)
gst_pad_set_event_function (trans->srcpad, gst_ffmpegscale_handle_src_event);
scale->pixfmt = PIX_FMT_NB;
scale->pixfmt = AV_PIX_FMT_NB;
scale->res = NULL;
}
......@@ -269,9 +269,9 @@ gst_ffmpegscale_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
ctx = avcodec_alloc_context ();
ctx->width = width;
ctx->height = height;
ctx->pix_fmt = PIX_FMT_NB;
ctx->pix_fmt = AV_PIX_FMT_NB;
gst_ffmpeg_caps_with_codectype (CODEC_TYPE_VIDEO, caps, ctx);
if (ctx->pix_fmt == PIX_FMT_NB) {
if (ctx->pix_fmt == AV_PIX_FMT_NB) {
av_free (ctx);
return FALSE;
}
......@@ -314,9 +314,9 @@ gst_ffmpegscale_set_caps (GstBaseTransform * trans, GstCaps * incaps,
ctx = avcodec_alloc_context ();
ctx->width = scale->in_width;
ctx->height = scale->in_height;
ctx->pix_fmt = PIX_FMT_NB;
ctx->pix_fmt = AV_PIX_FMT_NB;
gst_ffmpeg_caps_with_codectype (CODEC_TYPE_VIDEO, incaps, ctx);
if (ctx->pix_fmt == PIX_FMT_NB) {
if (ctx->pix_fmt == AV_PIX_FMT_NB) {
av_free (ctx);
return FALSE;
}
......
This diff is collapsed.
......@@ -478,7 +478,7 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
/* we may have failed mapping caps to a pixfmt,
* and quite some codecs do not make up their own mind about that
* in any case, _NONE can never work out later on */
if (pix_fmt == PIX_FMT_NONE)
if (pix_fmt == AV_PIX_FMT_NONE)
goto bad_input_fmt;
/* second pass stats buffer no longer needed */
......
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