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
19extern "C" {
20#include <libavcodec/avcodec.h>
21}
22
23namespace jami {
24
29const AVCodec*
31{
32 const char* codec_name;
33 switch (codec_id) {
34#if 0 && defined(__ANDROID__) && defined(RING_ACCEL)
36 codec_name = "mpeg4_mediacodec"; break;
38 codec_name = "h264_mediacodec"; break;
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
47 codec_name = "libopus"; break;
48 default:
49 codec_name = nullptr;
50 }
51 const AVCodec* codec = nullptr;
52 if (codec_name)
54 if (not codec)
56 return codec;
57}
58
59} // namespace jami
void emitSignal(Args... args)
Definition ring_signal.h:64
const AVCodec * findDecoder(const enum AVCodecID codec_id)
Attempt to find standalone AVCodec decoder using AVCodecID, or fallback to the default decoder.