OMX_ENCODER -> WITH_OMX_ENCODER

This commit is contained in:
Devaev Maxim
2019-03-05 01:15:57 +03:00
parent b76b34ad65
commit 24fed54cae
4 changed files with 13 additions and 13 deletions

View File

@@ -16,7 +16,7 @@ PROG = ustreamer
ifeq ($(shell ls -d /opt/vc/include 2>/dev/null), /opt/vc/include)
SOURCES += $(shell ls src/encoders/omx/*.c)
LIBS += -lbcm_host -lvcos -lopenmaxil -L/opt/vc/lib
override CFLAGS += -DOMX_ENCODER -DOMX_SKIP64BIT -I/opt/vc/include
override CFLAGS += -DWITH_OMX_ENCODER -DOMX_SKIP64BIT -I/opt/vc/include
endif

View File

@@ -33,7 +33,7 @@
#include "encoders/cpu/encoder.h"
#include "encoders/hw/encoder.h"
#ifdef OMX_ENCODER
#ifdef WITH_OMX_ENCODER
# include "encoders/omx/encoder.h"
#endif
@@ -44,7 +44,7 @@ static const struct {
} _ENCODER_TYPES[] = {
{"CPU", ENCODER_TYPE_CPU},
{"HW", ENCODER_TYPE_HW},
# ifdef OMX_ENCODER
# ifdef WITH_OMX_ENCODER
{"OMX", ENCODER_TYPE_OMX},
# endif
};
@@ -78,7 +78,7 @@ void encoder_prepare(struct encoder_t *encoder, struct device_t *dev) {
LOG_INFO("Using JPEG quality: %u%%", encoder->quality);
# ifdef OMX_ENCODER
# ifdef WITH_OMX_ENCODER
if (encoder->run->type == ENCODER_TYPE_OMX) {
LOG_DEBUG("Preparing OMX JPEG encoder ...");
@@ -112,7 +112,7 @@ void encoder_prepare(struct encoder_t *encoder, struct device_t *dev) {
}
void encoder_destroy(struct encoder_t *encoder) {
# ifdef OMX_ENCODER
# ifdef WITH_OMX_ENCODER
if (encoder->run->omxs) {
for (unsigned index = 0; index < encoder->run->n_omxs; ++index) {
if (encoder->run->omxs[index]) {
@@ -170,7 +170,7 @@ void encoder_prepare_live(struct encoder_t *encoder, struct device_t *dev) {
LOG_INFO("Using JPEG quality: HW-default");
}
}
# ifdef OMX_ENCODER
# ifdef WITH_OMX_ENCODER
else if (encoder->run->type == ENCODER_TYPE_OMX) {
for (unsigned index = 0; index < encoder->run->n_omxs; ++index) {
if (omx_encoder_prepare_live(encoder->run->omxs[index], dev, encoder->quality) < 0) {
@@ -202,7 +202,7 @@ int encoder_compress_buffer(struct encoder_t *encoder, struct device_t *dev, uns
} else if (encoder->run->type == ENCODER_TYPE_HW) {
hw_encoder_compress_buffer(dev, buf_index);
}
# ifdef OMX_ENCODER
# ifdef WITH_OMX_ENCODER
else if (encoder->run->type == ENCODER_TYPE_OMX) {
if (omx_encoder_compress_buffer(encoder->run->omxs[worker_number], dev, buf_index) < 0) {
goto use_fallback;

View File

@@ -27,7 +27,7 @@
#include "tools.h"
#include "device.h"
#ifdef OMX_ENCODER
#ifdef WITH_OMX_ENCODER
# include "encoders/omx/encoder.h"
# define ENCODER_TYPES_OMX_HINT ", OMX"
#else
@@ -43,9 +43,9 @@ enum encoder_type_t {
ENCODER_TYPE_UNKNOWN, // Only for encoder_parse_type() and main()
ENCODER_TYPE_CPU,
ENCODER_TYPE_HW,
#ifdef OMX_ENCODER
# ifdef WITH_OMX_ENCODER
ENCODER_TYPE_OMX,
#endif
# endif
};
struct encoder_runtime_t {
@@ -53,10 +53,10 @@ struct encoder_runtime_t {
unsigned quality;
pthread_mutex_t mutex;
#ifdef OMX_ENCODER
# ifdef WITH_OMX_ENCODER
unsigned n_omxs;
struct omx_encoder_t **omxs;
#endif
# endif
};

View File

@@ -81,7 +81,7 @@ static const struct option _long_opts[] = {
static void _version(bool nl) {
printf(VERSION);
# ifdef OMX_ENCODER
# ifdef WITH_OMX_ENCODER
printf(" + OMX");
# endif
if (nl) {