2 * This file is part of FFmpeg.
4 * Copyright (c) 2025 Zhao Zhili <quinkblack@foxmail.com>
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #include <multimedia/player_framework/native_avcodec_base.h>
23 #include "hwcontext.h"
24 #include "hwcontext_internal.h"
25 #include "hwcontext_oh.h"
27 static int oh_device_create(AVHWDeviceContext
*ctx
, const char *device
,
28 AVDictionary
*opts
, int flags
)
30 if (device
&& device
[0]) {
31 av_log(ctx
, AV_LOG_ERROR
, "Device selection unsupported.\n");
32 return AVERROR_UNKNOWN
;
38 const HWContextType ff_hwcontext_type_oh
= {
39 .type
= AV_HWDEVICE_TYPE_OHCODEC
,
41 .device_hwctx_size
= sizeof(AVOHCodecDeviceContext
),
42 .device_create
= oh_device_create
,
43 .pix_fmts
= (const enum AVPixelFormat
[]) {