FFmpeg
libavcodec
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
33
typedef
struct
OHBufferQueueItem
{
34
uint32_t
index
;
35
OH_AVBuffer *
buffer
;
36
}
OHBufferQueueItem
;
37
38
int
ff_oh_err_to_ff_err
(OH_AVErrCode err);
39
40
static
inline
const
char
*
ff_oh_mime
(
enum
AVCodecID
codec_id
,
void
*
log
)
41
{
42
switch
(
codec_id
) {
43
case
AV_CODEC_ID_H264
:
44
return
OH_AVCODEC_MIMETYPE_VIDEO_AVC;
45
case
AV_CODEC_ID_HEVC
:
46
return
OH_AVCODEC_MIMETYPE_VIDEO_HEVC;
47
default
:
48
av_log
(
log
,
AV_LOG_ERROR
,
"Unsupported codec %s\n"
,
49
avcodec_get_name
(
codec_id
));
50
return
NULL
;
51
}
52
}
53
54
enum
AVPixelFormat
ff_oh_pix_to_ff_pix
(OH_AVPixelFormat
oh_pix
);
55
int
ff_oh_pix_from_ff_pix
(
enum
AVPixelFormat
pix
);
56
57
#endif
AVPixelFormat
AVPixelFormat
Pixel format.
Definition:
pixfmt.h:71
ff_oh_pix_from_ff_pix
int ff_oh_pix_from_ff_pix(enum AVPixelFormat pix)
Definition:
ohcodec.c:72
OHBufferQueueItem
Definition:
ohcodec.h:33
normalize.log
log
Definition:
normalize.py:21
OHBufferQueueItem::buffer
OH_AVBuffer * buffer
Definition:
ohcodec.h:35
pix
enum AVPixelFormat pix
Definition:
ohcodec.c:55
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition:
log.h:210
codec_id.h
ff_oh_err_to_ff_err
int ff_oh_err_to_ff_err(OH_AVErrCode err)
Definition:
ohcodec.c:25
OHBufferQueueItem::index
uint32_t index
Definition:
ohcodec.h:34
codec_id
enum AVCodecID codec_id
Definition:
vaapi_decode.c:410
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition:
codec_id.h:79
NULL
#define NULL
Definition:
coverity.c:32
AVCodecID
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition:
codec_id.h:49
ff_oh_mime
static const char * ff_oh_mime(enum AVCodecID codec_id, void *log)
Definition:
ohcodec.h:40
avcodec_get_name
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
Definition:
utils.c:406
AV_CODEC_ID_HEVC
@ AV_CODEC_ID_HEVC
Definition:
codec_id.h:228
pixfmt.h
ff_oh_pix_to_ff_pix
enum AVPixelFormat ff_oh_pix_to_ff_pix(OH_AVPixelFormat oh_pix)
Definition:
ohcodec.c:63
oh_pix
OH_AVPixelFormat oh_pix
Definition:
ohcodec.c:54
av_log
#define av_log(a,...)
Definition:
tableprint_vlc.h:27
Generated on Sat Aug 2 2025 19:22:23 for FFmpeg by
1.8.17