FFmpeg
Loading...
Searching...
No Matches
ohcodec.h
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#ifndef AVCODEC_OHCODEC_H
22#define AVCODEC_OHCODEC_H
23
24#include <multimedia/player_framework/native_avbuffer.h>
25#include <multimedia/player_framework/native_avcodec_base.h>
26#include <multimedia/player_framework/native_averrors.h>
27#include <multimedia/player_framework/native_avformat.h>
28
29#include "libavutil/pixfmt.h"
30
31#include "codec_id.h"
32
33typedef struct OHBufferQueueItem {
34 uint32_t index;
35 OH_AVBuffer *buffer;
37
38int ff_oh_err_to_ff_err(OH_AVErrCode err);
39
40static inline const char *ff_oh_mime(enum AVCodecID codec_id, void *log)
41{
42 switch (codec_id) {
44 return OH_AVCODEC_MIMETYPE_VIDEO_AVC;
46 return OH_AVCODEC_MIMETYPE_VIDEO_HEVC;
47 default:
48 av_log(log, AV_LOG_ERROR, "Unsupported codec %s\n",
50 return NULL;
51 }
52}
53
54enum AVPixelFormat ff_oh_pix_to_ff_pix(OH_AVPixelFormat oh_pix);
56
57#endif
#define NULL
Definition coverity.c:32
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
Definition utils.c:421
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition codec_id.h:47
@ AV_CODEC_ID_H264
Definition codec_id.h:77
@ AV_CODEC_ID_HEVC
Definition codec_id.h:223
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
enum AVPixelFormat pix
Definition ohcodec.c:55
OH_AVPixelFormat oh_pix
Definition ohcodec.c:54
static const char * ff_oh_mime(enum AVCodecID codec_id, void *log)
Definition ohcodec.h:40
int ff_oh_pix_from_ff_pix(enum AVPixelFormat pix)
Definition ohcodec.c:72
enum AVPixelFormat ff_oh_pix_to_ff_pix(OH_AVPixelFormat oh_pix)
Definition ohcodec.c:63
int ff_oh_err_to_ff_err(OH_AVErrCode err)
Definition ohcodec.c:25
pixel format definitions
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
OH_AVBuffer * buffer
Definition ohcodec.h:35
uint32_t index
Definition ohcodec.h:34
#define av_log(a,...)
enum AVCodecID codec_id