Files
ustreamer/src/encoder.h
Devaev Maxim c2b82312ec omx prototype
2018-09-24 11:17:39 +03:00

54 lines
2.0 KiB
C

/*****************************************************************************
# uStreamer - Lightweight and fast MJPG-HTTP streamer. #
# #
# Copyright (C) 2018 Maxim Devaev <mdevaev@gmail.com> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
# #
*****************************************************************************/
#pragma once
#include "tools.h"
#include "device.h"
#ifdef OMX_ENCODER
# include "omx/encoder.h"
#endif
enum encoder_type_t {
ENCODER_TYPE_CPU,
#ifdef OMX_ENCODER
ENCODER_TYPE_OMX,
#endif
};
struct encoder_t {
enum encoder_type_t type;
#ifdef OMX_ENCODER
struct omx_encoder_t *omx;
#endif
};
struct encoder_t *encoder_init(enum encoder_type_t type);
void encoder_destroy(struct encoder_t *encoder);
void encoder_prepare(struct encoder_t *encoder, struct device_t *dev);
void encoder_compress_buffer(struct encoder_t *encoder, struct device_t *dev, int index);