FFmpeg
hwcontext_oh.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * Copyright (c) 2025 Zhao Zhili <quinkblack@foxmail.com>
5  *
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.
10  *
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.
15  *
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
19  */
20 
21 #include <multimedia/player_framework/native_avcodec_base.h>
22 
23 #include "hwcontext.h"
24 #include "hwcontext_internal.h"
25 #include "hwcontext_oh.h"
26 
27 static int oh_device_create(AVHWDeviceContext *ctx, const char *device,
28  AVDictionary *opts, int flags)
29 {
30  if (device && device[0]) {
31  av_log(ctx, AV_LOG_ERROR, "Device selection unsupported.\n");
32  return AVERROR_UNKNOWN;
33  }
34 
35  return 0;
36 }
37 
40  .name = "ohcodec",
41  .device_hwctx_size = sizeof(AVOHCodecDeviceContext),
42  .device_create = oh_device_create,
43  .pix_fmts = (const enum AVPixelFormat[]) {
46  },
47 };
flags
const SwsFlags flags[]
Definition: swscale.c:61
ff_hwcontext_type_oh
const HWContextType ff_hwcontext_type_oh
Definition: hwcontext_oh.c:38
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
AVDictionary
Definition: dict.c:32
AVERROR_UNKNOWN
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
Definition: error.h:73
oh_device_create
static int oh_device_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
Definition: hwcontext_oh.c:27
AVHWDeviceContext
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
Definition: hwcontext.h:63
HWContextType::type
enum AVHWDeviceType type
Definition: hwcontext_internal.h:30
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
hwcontext_oh.h
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:298
ctx
AVFormatContext * ctx
Definition: movenc.c:49
opts
AVDictionary * opts
Definition: movenc.c:51
AV_HWDEVICE_TYPE_OHCODEC
@ AV_HWDEVICE_TYPE_OHCODEC
Definition: hwcontext.h:43
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AVOHCodecDeviceContext
OpenHarmony codec device.
Definition: hwcontext_oh.h:27
hwcontext_internal.h
AV_PIX_FMT_OHCODEC
@ AV_PIX_FMT_OHCODEC
Definition: pixfmt.h:500
hwcontext.h
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
HWContextType
Definition: hwcontext_internal.h:29