2 * Copyright (C) 2018 Wonchul Lee <chul0812@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
24 #include "gstav1utils.h"
28 enum aom_img_fmt aom_format;
29 GstVideoFormat gst_format;
32 static const AomImageFormat img_formats[] = {
33 {AOM_IMG_FMT_YV12, GST_VIDEO_FORMAT_YV12},
34 {AOM_IMG_FMT_I420, GST_VIDEO_FORMAT_I420},
35 {AOM_IMG_FMT_I422, GST_VIDEO_FORMAT_Y42B},
36 {AOM_IMG_FMT_I444, GST_VIDEO_FORMAT_Y444},
40 gst_av1_get_error_name (aom_codec_err_t status)
47 case AOM_CODEC_MEM_ERROR:
49 case AOM_CODEC_ABI_MISMATCH:
50 return "abi mismatch";
51 case AOM_CODEC_INCAPABLE:
53 case AOM_CODEC_UNSUP_BITSTREAM:
54 return "unsupported bitstream";
55 case AOM_CODEC_UNSUP_FEATURE:
56 return "unsupported feature";
57 case AOM_CODEC_CORRUPT_FRAME:
58 return "corrupt frame";
59 case AOM_CODEC_INVALID_PARAM:
60 return "invalid parameter";
67 gst_video_format_to_av1_img_format (GstVideoFormat format)
71 for (i = 0; i < G_N_ELEMENTS (img_formats); i++)
72 if (img_formats[i].gst_format == format)
73 return img_formats[i].aom_format;
75 GST_WARNING ("av1 img format not found");