Unified · Split
| @@ -322,6 +322,7 @@ External library support: · 321 unmodified lines | ||
| 322 | 322 | --enable-mediafoundation enable encoding via MediaFoundation [auto] |
| 323 | 323 | --disable-metal disable Apple Metal framework [autodetect] |
| 324 | 324 | --enable-libmysofa enable libmysofa, needed for sofalizer filter [no] |
| 325 | + --enable-ohcodec enable OpenHarmony Codec support [no] | |
| 325 | 326 | --enable-openal enable OpenAL 1.1 capture support [no] |
| 326 | 327 | --enable-opencl enable OpenCL processing [no] |
| 327 | 328 | --enable-opengl enable OpenGL rendering [no] |
| @@ -1997,6 +1998,7 @@ EXTERNAL_LIBRARY_LIST=" · 1669 unmodified lines | ||
| 1997 | 1998 | libzvbi |
| 1998 | 1999 | lv2 |
| 1999 | 2000 | mediacodec |
| 2001 | + ohcodec | |
| 2000 | 2002 | openal |
| 2001 | 2003 | opengl |
| 2002 | 2004 | openssl |
| @@ -7171,6 +7173,9 @@ enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_co · 5168 unmodified lines | ||
| 7171 | 7173 | check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } || |
| 7172 | 7174 | die "ERROR: mmal not found" && |
| 7173 | 7175 | check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; } |
| 7176 | +enabled ohcodec && { check_lib ohcodec "multimedia/player_framework/native_avcodec_videodecoder.h" \ | |
| 7177 | + OH_VideoDecoder_CreateByName -lnative_media_codecbase -lnative_media_core -lnative_media_vdec || | |
| 7178 | + die "ERROR: missing native_media libs"; } | |
| 7174 | 7179 | enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h" alGetError || |
| 7175 | 7180 | { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do |
| 7176 | 7181 | check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } || |
| @@ -2,6 +2,12 @@ The last version increases of all libraries were on 2025-03-28 · 1 unmodified line | ||
| 2 | 2 | |
| 3 | 3 | API changes, most recent first: |
| 4 | 4 | |
| 5 | +2025-07-18 - xxxxxxxxxx - lavu 60.5.100 - pixfmt.h | |
| 6 | + Add AV_PIX_FMT_OHCODEC. | |
| 7 | + | |
| 8 | +2025-07-18 - xxxxxxxxxx - lavu 60.5.100 - hwcontext.h | |
| 9 | + Add AV_HWDEVICE_TYPE_OHCODEC and AVOHCodecDeviceContext. | |
| 10 | + | |
| 5 | 11 | 2025-07-xx - xxxxxxxxxd - lavfi 11.2.100 - avfilter.h |
| 6 | 12 | Add AVFilterGraph->max_buffered_frames. |
| 7 | 13 | |
| @@ -51,6 +51,7 @@ HEADERS = adler32.h \ · 50 unmodified lines | ||
| 51 | 51 | hwcontext_qsv.h \ |
| 52 | 52 | hwcontext_mediacodec.h \ |
| 53 | 53 | hwcontext_opencl.h \ |
| 54 | + hwcontext_oh.h \ | |
| 54 | 55 | hwcontext_vaapi.h \ |
| 55 | 56 | hwcontext_videotoolbox.h \ |
| 56 | 57 | hwcontext_vdpau.h \ |
| @@ -210,6 +211,7 @@ OBJS-$(CONFIG_AMF) += hwcontext_amf.o · 153 unmodified lines | ||
| 210 | 211 | OBJS-$(CONFIG_LIBDRM) += hwcontext_drm.o |
| 211 | 212 | OBJS-$(CONFIG_MACOS_KPERF) += macos_kperf.o |
| 212 | 213 | OBJS-$(CONFIG_MEDIACODEC) += hwcontext_mediacodec.o |
| 214 | +OBJS-$(CONFIG_OHCODEC) += hwcontext_oh.o | |
| 213 | 215 | OBJS-$(CONFIG_OPENCL) += hwcontext_opencl.o |
| 214 | 216 | OBJS-$(CONFIG_QSV) += hwcontext_qsv.o |
| 215 | 217 | OBJS-$(CONFIG_VAAPI) += hwcontext_vaapi.o |
| @@ -68,6 +68,9 @@ static const HWContextType * const hw_table[] = { · 67 unmodified lines | ||
| 68 | 68 | #endif |
| 69 | 69 | #if CONFIG_AMF |
| 70 | 70 | &ff_hwcontext_type_amf, |
| 71 | +#endif | |
| 72 | +#if CONFIG_OHCODEC | |
| 73 | + &ff_hwcontext_type_oh, | |
| 71 | 74 | #endif |
| 72 | 75 | NULL, |
| 73 | 76 | }; |
| @@ -86,6 +89,7 @@ static const char *const hw_type_names[] = { · 12 unmodified lines | ||
| 86 | 89 | [AV_HWDEVICE_TYPE_MEDIACODEC] = "mediacodec", |
| 87 | 90 | [AV_HWDEVICE_TYPE_VULKAN] = "vulkan", |
| 88 | 91 | [AV_HWDEVICE_TYPE_AMF] = "amf", |
| 92 | + [AV_HWDEVICE_TYPE_OHCODEC] = "ohcodec", | |
| 89 | 93 | }; |
| 90 | 94 | |
| 91 | 95 | typedef struct FFHWDeviceContext { |
| @@ -39,6 +39,8 @@ enum AVHWDeviceType { · 38 unmodified lines | ||
| 39 | 39 | AV_HWDEVICE_TYPE_VULKAN, |
| 40 | 40 | AV_HWDEVICE_TYPE_D3D12VA, |
| 41 | 41 | AV_HWDEVICE_TYPE_AMF, |
| 42 | + /* OpenHarmony Codec device */ | |
| 43 | + AV_HWDEVICE_TYPE_OHCODEC, | |
| 42 | 44 | }; |
| 43 | 45 | |
| 44 | 46 | /** |
| @@ -164,5 +164,6 @@ extern const HWContextType ff_hwcontext_type_videotoolbox; · 163 unmodified lines | ||
| 164 | 164 | extern const HWContextType ff_hwcontext_type_mediacodec; |
| 165 | 165 | extern const HWContextType ff_hwcontext_type_vulkan; |
| 166 | 166 | extern const HWContextType ff_hwcontext_type_amf; |
| 167 | +extern const HWContextType ff_hwcontext_type_oh; | |
| 167 | 168 | |
| 168 | 169 | #endif /* AVUTIL_HWCONTEXT_INTERNAL_H */ |
| @@ -0,0 +1,47 @@ | ||
| 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 | + | |
| 38 | +const HWContextType ff_hwcontext_type_oh = { | |
| 39 | + .type = AV_HWDEVICE_TYPE_OHCODEC, | |
| 40 | + .name = "ohcodec", | |
| 41 | + .device_hwctx_size = sizeof(AVOHCodecDeviceContext), | |
| 42 | + .device_create = oh_device_create, | |
| 43 | + .pix_fmts = (const enum AVPixelFormat[]) { | |
| 44 | + AV_PIX_FMT_OHCODEC, | |
| 45 | + AV_PIX_FMT_NONE | |
| 46 | + }, | |
| 47 | +}; | |
| @@ -0,0 +1,34 @@ | ||
| 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 | +#ifndef AVUTIL_HWCONTEXT_OH_H | |
| 22 | +#define AVUTIL_HWCONTEXT_OH_H | |
| 23 | + | |
| 24 | +/** | |
| 25 | + * OpenHarmony codec device | |
| 26 | + */ | |
| 27 | +typedef struct AVOHCodecDeviceContext { | |
| 28 | + /** | |
| 29 | + * Pointer to OHNativeWindow | |
| 30 | + */ | |
| 31 | + void *native_window; | |
| 32 | +} AVOHCodecDeviceContext; | |
| 33 | + | |
| 34 | +#endif /* AVUTIL_HWCONTEXT_OH_H */ | |
| @@ -3263,6 +3263,10 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { · 3262 unmodified lines | ||
| 3263 | 3263 | }, |
| 3264 | 3264 | .flags = AV_PIX_FMT_FLAG_BE, |
| 3265 | 3265 | }, |
| 3266 | + [AV_PIX_FMT_OHCODEC] = { | |
| 3267 | + .name = "ohcodec", | |
| 3268 | + .flags = AV_PIX_FMT_FLAG_HWACCEL, | |
| 3269 | + }, | |
| 3266 | 3270 | }; |
| 3267 | 3271 | |
| 3268 | 3272 | static const char * const color_range_names[] = { |
| @@ -497,6 +497,8 @@ enum AVPixelFormat { · 496 unmodified lines | ||
| 497 | 497 | AV_PIX_FMT_GBRP12MSBBE, ///< planar GBR 4:4:4 36bpp, lowest bits zero, big-endian |
| 498 | 498 | AV_PIX_FMT_GBRP12MSBLE, ///< planar GBR 4:4:4 36bpp, lowest bits zero, little-endian |
| 499 | 499 | |
| 500 | + AV_PIX_FMT_OHCODEC, /// hardware decoding through openharmony | |
| 501 | + | |
| 500 | 502 | AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions |
| 501 | 503 | }; |
| 502 | 504 | |
| @@ -79,8 +79,8 @@ · 78 unmodified lines | ||
| 79 | 79 | */ |
| 80 | 80 | |
| 81 | 81 | #define LIBAVUTIL_VERSION_MAJOR 60 |
| 82 | −#define LIBAVUTIL_VERSION_MINOR 4 | |
| 83 | −#define LIBAVUTIL_VERSION_MICRO 101 | |
| 82 | +#define LIBAVUTIL_VERSION_MINOR 5 | |
| 83 | +#define LIBAVUTIL_VERSION_MICRO 100 | |
| 84 | 84 | |
| 85 | 85 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 86 | 86 | LIBAVUTIL_VERSION_MINOR, \ |