blob: 1c5c41312a7f8b8bda795028b8eb0b41c5ae5456 [file] [log] [blame]
agsantosc9181b42020-11-26 12:03:04 -05001/**
Sébastien Blincb783e32021-02-12 11:34:10 -05002 * Copyright (C) 2020-2021 Savoir-faire Linux Inc.
agsantosc9181b42020-11-26 12:03:04 -05003 *
4 * Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program 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
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef FRAMEUTILS_H
22#define FRAMEUTILS_H
23
24extern "C" {
25#include <libavutil/frame.h>
26}
agsantos1bbc7cc2021-05-20 16:43:35 -040027#include <memory>
agsantosc9181b42020-11-26 12:03:04 -050028
29/**
30 * @brief moveFrom
31 * @param dst
32 * @param src
33 */
34void moveFrom(AVFrame* dst, AVFrame* src);
35
agsantos4bb4bc52021-03-08 14:21:45 -050036/**
37 * @brief unref and free AVFrame
38 *
39 * @param frame
40 */
41void frameFree(AVFrame* frame);
agsantos1bbc7cc2021-05-20 16:43:35 -040042
43using uniqueFramePtr = std::unique_ptr<AVFrame, decltype(&frameFree)>;
44
Aline Gondim Santosbd75c212022-10-03 12:28:26 -030045/**
46 * @brief Crate allocated frame with destructor
47 */
48uniqueFramePtr getUniqueFrame();
49
agsantosc9181b42020-11-26 12:03:04 -050050#endif // FRAMEUTILS_H