Ring Daemon 16.0.0
Loading...
Searching...
No Matches
video_scaler.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
18#ifndef __VIDEO_SCALER_H__
19#define __VIDEO_SCALER_H__
20
21#include "video_base.h"
22#include "noncopyable.h"
23
24struct SwsContext;
25
26extern "C" {
27struct AVFrame;
28}
29
30namespace jami {
31namespace video {
32
34{
35public:
38 void reset();
39 void scale(const AVFrame* input, AVFrame* output);
40 void scale(const VideoFrame& input, VideoFrame& output);
41 void scale_with_aspect(const VideoFrame& input, VideoFrame& output);
42 void scale_and_pad(const VideoFrame& input,
44 unsigned xoff,
45 unsigned yoff,
46 unsigned dest_width,
47 unsigned dest_height,
48 bool keep_aspect);
49 std::unique_ptr<VideoFrame> convertFormat(const VideoFrame& input, AVPixelFormat pix);
50
51private:
53 SwsContext* ctx_;
54 int mode_;
55 uint8_t* tmp_data_[4]; // used by scale_and_pad
56};
57
58} // namespace video
59} // namespace jami
60
61#endif // __VIDEO_SCALER_H__
void scale(const AVFrame *input, AVFrame *output)
void scale_with_aspect(const VideoFrame &input, VideoFrame &output)
void scale_and_pad(const VideoFrame &input, VideoFrame &output, unsigned xoff, unsigned yoff, unsigned dest_width, unsigned dest_height, bool keep_aspect)
std::unique_ptr< VideoFrame > convertFormat(const VideoFrame &input, AVPixelFormat pix)
void emitSignal(Args... args)
Definition ring_signal.h:64
Simple macro to hide class' copy constructor and assignment operator.
#define NON_COPYABLE(ClassName)
Definition noncopyable.h:30