Ring Daemon
16.0.0
Loading...
Searching...
No Matches
decoder_finder.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16
*/
17
#pragma once
18
19
extern
"C"
{
20
#include <libavcodec/avcodec.h>
21
}
22
23
namespace
jami
{
24
29
const
AVCodec
*
30
findDecoder
(
const
enum
AVCodecID
codec_id
)
31
{
32
const
char
*
codec_name
;
33
switch
(
codec_id
) {
34
#if 0 && defined(__ANDROID__) && defined(RING_ACCEL)
35
case
AV_CODEC_ID_MPEG4
:
36
codec_name
=
"mpeg4_mediacodec"
;
break
;
37
case
AV_CODEC_ID_H264
:
38
codec_name
=
"h264_mediacodec"
;
break
;
39
case
AV_CODEC_ID_HEVC
:
40
codec_name
=
"hevc_mediacodec"
;
break
;
41
case
AV_CODEC_ID_VP8
:
42
codec_name
=
"vp8_mediacodec"
;
break
;
43
case
AV_CODEC_ID_VP9
:
44
codec_name
=
"vp9_mediacodec"
;
break
;
45
#endif
46
case
AV_CODEC_ID_OPUS
:
47
codec_name
=
"libopus"
;
break
;
48
default
:
49
codec_name
=
nullptr
;
50
}
51
const
AVCodec
* codec =
nullptr
;
52
if
(
codec_name
)
53
codec =
avcodec_find_decoder_by_name
(
codec_name
);
54
if
(
not
codec)
55
codec =
avcodec_find_decoder
(
codec_id
);
56
return
codec;
57
}
58
59
}
// namespace jami
jami
Definition
account.cpp:61
jami::emitSignal
void emitSignal(Args... args)
Definition
ring_signal.h:64
jami::findDecoder
const AVCodec * findDecoder(const enum AVCodecID codec_id)
Attempt to find standalone AVCodec decoder using AVCodecID, or fallback to the default decoder.
Definition
decoder_finder.h:30
src
media
decoder_finder.h
Generated on Thu Jun 19 2025 15:50:37 for Ring Daemon by
1.9.8