mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-16 20:43:42 +00:00
WITH_OMX_ENCODER -> WITH_OMX
This commit is contained in:
4
Makefile
4
Makefile
@@ -23,9 +23,9 @@ $(filter $(shell echo $(1) | tr A-Z a-z), yes on 1)
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
ifneq ($(call optbool,$(WITH_OMX_ENCODER)),)
|
ifneq ($(call optbool,$(WITH_OMX)),)
|
||||||
LIBS += -lbcm_host -lvcos -lopenmaxil -L$(RPI_VC_LIBS)
|
LIBS += -lbcm_host -lvcos -lopenmaxil -L$(RPI_VC_LIBS)
|
||||||
override CFLAGS += -DWITH_OMX_ENCODER -DOMX_SKIP64BIT -I$(RPI_VC_HEADERS)
|
override CFLAGS += -DWITH_OMX -DOMX_SKIP64BIT -I$(RPI_VC_HEADERS)
|
||||||
SOURCES += $(shell ls src/encoders/omx/*.c)
|
SOURCES += $(shell ls src/encoders/omx/*.c)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ If you're going to live-stream from your backyard webcam and need to control it,
|
|||||||
# Building
|
# Building
|
||||||
You'll need ```make```, ```gcc```, ```libevent``` with ```pthreads``` support, ```libjpeg8```/```libjpeg-turbo``` and ```libuuid```.
|
You'll need ```make```, ```gcc```, ```libevent``` with ```pthreads``` support, ```libjpeg8```/```libjpeg-turbo``` and ```libuuid```.
|
||||||
|
|
||||||
On Raspberry Pi you can build the program with OpenMAX IL. To do this pass option ```WITH_OMX_ENCODER=1``` to ```make```. To enable GPIO support install [wiringPi](http://wiringpi.com) and pass option ```WITH_GPIO=1```.
|
On Raspberry Pi you can build the program with OpenMAX IL. To do this pass option ```WITH_OMX=1``` to ```make```. To enable GPIO support install [wiringPi](http://wiringpi.com) and pass option ```WITH_GPIO=1```.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ git clone --depth=1 https://github.com/pi-kvm/ustreamer
|
$ git clone --depth=1 https://github.com/pi-kvm/ustreamer
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
# Сборка
|
# Сборка
|
||||||
Для сборки вам понадобятся ```make```, ```gcc```, ```libevent``` с поддержкой ```pthreads```, ```libjpeg8```/```libjpeg-turbo``` и ```libuuid```.
|
Для сборки вам понадобятся ```make```, ```gcc```, ```libevent``` с поддержкой ```pthreads```, ```libjpeg8```/```libjpeg-turbo``` и ```libuuid```.
|
||||||
|
|
||||||
На Raspberry Pi программу можно собрать с поддержкой OpenMAX IL. Для этого передайте ```make``` параметр ```WITH_OMX_ENCODER=1```. Для включения сборки с поддержкой GPIO установите [wiringPi](http://wiringpi.com) и добавьте параметр ```WITH_GPIO=1```.
|
На Raspberry Pi программу можно собрать с поддержкой OpenMAX IL. Для этого передайте ```make``` параметр ```WITH_OMX=1```. Для включения сборки с поддержкой GPIO установите [wiringPi](http://wiringpi.com) и добавьте параметр ```WITH_GPIO=1```.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ git clone --depth=1 https://github.com/pi-kvm/ustreamer
|
$ git clone --depth=1 https://github.com/pi-kvm/ustreamer
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ build() {
|
|||||||
cd $pkgname-build
|
cd $pkgname-build
|
||||||
|
|
||||||
local _options=""
|
local _options=""
|
||||||
[ -e /opt/vc/include/IL/OMX_Core.h ] && _options="$_options WITH_OMX_ENCODER=1"
|
[ -e /opt/vc/include/IL/OMX_Core.h ] && _options="$_options WITH_OMX=1"
|
||||||
[ -e /usr/include/wiringPi.h ] && _options="$_options WITH_GPIO=1"
|
[ -e /usr/include/wiringPi.h ] && _options="$_options WITH_GPIO=1"
|
||||||
|
|
||||||
make $_options CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" $MAKEFLAGS
|
make $_options CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" $MAKEFLAGS
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
#include "encoders/cpu/encoder.h"
|
#include "encoders/cpu/encoder.h"
|
||||||
#include "encoders/hw/encoder.h"
|
#include "encoders/hw/encoder.h"
|
||||||
|
|
||||||
#ifdef WITH_OMX_ENCODER
|
#ifdef WITH_OMX
|
||||||
# include "encoders/omx/encoder.h"
|
# include "encoders/omx/encoder.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ static const struct {
|
|||||||
} _ENCODER_TYPES[] = {
|
} _ENCODER_TYPES[] = {
|
||||||
{"CPU", ENCODER_TYPE_CPU},
|
{"CPU", ENCODER_TYPE_CPU},
|
||||||
{"HW", ENCODER_TYPE_HW},
|
{"HW", ENCODER_TYPE_HW},
|
||||||
# ifdef WITH_OMX_ENCODER
|
# ifdef WITH_OMX
|
||||||
{"OMX", ENCODER_TYPE_OMX},
|
{"OMX", ENCODER_TYPE_OMX},
|
||||||
# endif
|
# endif
|
||||||
};
|
};
|
||||||
@@ -69,7 +69,7 @@ struct encoder_t *encoder_init(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void encoder_destroy(struct encoder_t *encoder) {
|
void encoder_destroy(struct encoder_t *encoder) {
|
||||||
# ifdef WITH_OMX_ENCODER
|
# ifdef WITH_OMX
|
||||||
if (encoder->run->omxs) {
|
if (encoder->run->omxs) {
|
||||||
for (unsigned index = 0; index < encoder->run->n_omxs; ++index) {
|
for (unsigned index = 0; index < encoder->run->n_omxs; ++index) {
|
||||||
if (encoder->run->omxs[index]) {
|
if (encoder->run->omxs[index]) {
|
||||||
@@ -124,7 +124,7 @@ void encoder_prepare(struct encoder_t *encoder, struct device_t *dev) {
|
|||||||
|
|
||||||
dev->run->n_workers = 1;
|
dev->run->n_workers = 1;
|
||||||
}
|
}
|
||||||
# ifdef WITH_OMX_ENCODER
|
# ifdef WITH_OMX
|
||||||
else if (type == ENCODER_TYPE_OMX) {
|
else if (type == ENCODER_TYPE_OMX) {
|
||||||
LOG_DEBUG("Preparing OMX JPEG encoder ...");
|
LOG_DEBUG("Preparing OMX JPEG encoder ...");
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ int encoder_compress_buffer(struct encoder_t *encoder, struct device_t *dev, uns
|
|||||||
} else if (encoder->run->type == ENCODER_TYPE_HW) {
|
} else if (encoder->run->type == ENCODER_TYPE_HW) {
|
||||||
hw_encoder_compress_buffer(dev, buf_index);
|
hw_encoder_compress_buffer(dev, buf_index);
|
||||||
}
|
}
|
||||||
# ifdef WITH_OMX_ENCODER
|
# ifdef WITH_OMX
|
||||||
else if (encoder->run->type == ENCODER_TYPE_OMX) {
|
else if (encoder->run->type == ENCODER_TYPE_OMX) {
|
||||||
if (omx_encoder_compress_buffer(encoder->run->omxs[worker_number], dev, buf_index) < 0) {
|
if (omx_encoder_compress_buffer(encoder->run->omxs[worker_number], dev, buf_index) < 0) {
|
||||||
goto error;
|
goto error;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
|
|
||||||
#ifdef WITH_OMX_ENCODER
|
#ifdef WITH_OMX
|
||||||
# include "encoders/omx/encoder.h"
|
# include "encoders/omx/encoder.h"
|
||||||
# define ENCODER_TYPES_OMX_HINT ", OMX"
|
# define ENCODER_TYPES_OMX_HINT ", OMX"
|
||||||
#else
|
#else
|
||||||
@@ -45,7 +45,7 @@ enum encoder_type_t {
|
|||||||
ENCODER_TYPE_UNKNOWN, // Only for encoder_parse_type() and main()
|
ENCODER_TYPE_UNKNOWN, // Only for encoder_parse_type() and main()
|
||||||
ENCODER_TYPE_CPU,
|
ENCODER_TYPE_CPU,
|
||||||
ENCODER_TYPE_HW,
|
ENCODER_TYPE_HW,
|
||||||
# ifdef WITH_OMX_ENCODER
|
# ifdef WITH_OMX
|
||||||
ENCODER_TYPE_OMX,
|
ENCODER_TYPE_OMX,
|
||||||
# endif
|
# endif
|
||||||
};
|
};
|
||||||
@@ -56,7 +56,7 @@ struct encoder_runtime_t {
|
|||||||
bool cpu_forced;
|
bool cpu_forced;
|
||||||
pthread_mutex_t mutex;
|
pthread_mutex_t mutex;
|
||||||
|
|
||||||
# ifdef WITH_OMX_ENCODER
|
# ifdef WITH_OMX
|
||||||
unsigned n_omxs;
|
unsigned n_omxs;
|
||||||
struct omx_encoder_t **omxs;
|
struct omx_encoder_t **omxs;
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ static const struct option _LONG_OPTS[] = {
|
|||||||
|
|
||||||
static void _version(bool nl) {
|
static void _version(bool nl) {
|
||||||
printf(VERSION);
|
printf(VERSION);
|
||||||
# ifdef WITH_OMX_ENCODER
|
# ifdef WITH_OMX
|
||||||
printf(" + OMX");
|
printf(" + OMX");
|
||||||
# endif
|
# endif
|
||||||
if (nl) {
|
if (nl) {
|
||||||
|
|||||||
Reference in New Issue
Block a user