mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
re-formatting code using astyle; see https://github.com/neutrino-images/ni-buildsystem/blob/master/support/scripts/astyle.sh
Origin commit data
------------------
Branch: master
Commit: 53ca350af4
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-11-07 (Sun, 07 Nov 2021)
Origin message was:
------------------
- re-formatting code using astyle; see https://github.com/neutrino-images/ni-buildsystem/blob/master/support/scripts/astyle.sh
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -45,8 +45,8 @@ static bool checkLiveSlot = false;
|
||||
static bool CertChecked = false;
|
||||
static bool Cert_OK = false;
|
||||
static uint8_t NullPMT[50] = {0x9F, 0x80, 0x32, 0x2E, 0x03, 0x6E, 0xA7, 0x37, 0x00, 0x00, 0x1B, 0x15, 0x7D, 0x00, 0x00, 0x03, 0x15, 0x7E, 0x00, 0x00, 0x03, 0x15, 0x7F, 0x00,
|
||||
0x00, 0x06, 0x15, 0x80, 0x00, 0x00, 0x06, 0x15, 0x82, 0x00, 0x00, 0x0B, 0x08, 0x7B, 0x00, 0x00, 0x05, 0x09, 0x42, 0x00, 0x00, 0x06, 0x15, 0x81, 0x00, 0x00
|
||||
};
|
||||
0x00, 0x06, 0x15, 0x80, 0x00, 0x00, 0x06, 0x15, 0x82, 0x00, 0x00, 0x0B, 0x08, 0x7B, 0x00, 0x00, 0x05, 0x09, 0x42, 0x00, 0x00, 0x06, 0x15, 0x81, 0x00, 0x00
|
||||
};
|
||||
static cCA *pcCAInstance = NULL;
|
||||
|
||||
/* für callback */
|
||||
@@ -107,7 +107,8 @@ void cCA::write_ci_info(int slot, CaIdVector caids)
|
||||
snprintf(fname, sizeof(fname), "/tmp/ci-slot%d", slot);
|
||||
ModuleName(CA_SLOT_TYPE_CI, slot, mname);
|
||||
FILE *fd = fopen(fname, "w");
|
||||
if (fd == NULL) return;
|
||||
if (fd == NULL)
|
||||
return;
|
||||
snprintf(buf, sizeof(buf), "%s\n", mname);
|
||||
fputs(buf, fd);
|
||||
if (caids.size() > 40)
|
||||
@@ -129,7 +130,8 @@ void cCA::del_ci_info(int slot)
|
||||
{
|
||||
char fname[20];
|
||||
snprintf(fname, sizeof(fname), "/tmp/ci-slot%d", slot);
|
||||
if (access(fname, F_OK) == 0) remove(fname);
|
||||
if (access(fname, F_OK) == 0)
|
||||
remove(fname);
|
||||
}
|
||||
|
||||
/* helper function to call the cpp thread loop */
|
||||
@@ -143,7 +145,7 @@ void *execute_thread(void *c)
|
||||
|
||||
/* from dvb-apps */
|
||||
int asn_1_decode(uint16_t *length, unsigned char *asn_1_array,
|
||||
uint32_t asn_1_array_len)
|
||||
uint32_t asn_1_array_len)
|
||||
{
|
||||
uint8_t length_field;
|
||||
|
||||
@@ -645,7 +647,8 @@ bool cCA::SendCAPMT(u64 tpid, u8 source, u8 camask, const unsigned char *cabuf,
|
||||
bool sid_found = false;
|
||||
bool recordUse_found = false;
|
||||
printf("%s -> %s\n", FILENAME, __func__);
|
||||
if (!num_slots) return true; /* stb's without ci-slots */
|
||||
if (!num_slots)
|
||||
return true; /* stb's without ci-slots */
|
||||
#if x_debug
|
||||
printf("TP: %llX\n", TP);
|
||||
printf("SID: %04X\n", SID);
|
||||
@@ -727,7 +730,7 @@ bool cCA::SendCAPMT(u64 tpid, u8 source, u8 camask, const unsigned char *cabuf,
|
||||
(*It)->pmtlen = calen;
|
||||
for (i = 0; i < calen; i++)
|
||||
(*It)->pmtdata[i] = cabuf[i];
|
||||
(*It)->pmtdata[pos] = 0x04; // CAPMT_ADD
|
||||
(*It)->pmtdata[pos] = 0x04; // CAPMT_ADD
|
||||
(*It)->newCapmt = true;
|
||||
}
|
||||
|
||||
|
@@ -10,8 +10,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h> /* isspace */
|
||||
#include <stdio.h> /* sscanf */
|
||||
#include <ctype.h> /* isspace */
|
||||
#include <stdio.h> /* sscanf */
|
||||
|
||||
#include "proc_tools.h"
|
||||
|
||||
@@ -39,8 +39,8 @@ int proc_get(const char *path, char *value, const int len)
|
||||
if (ret >= 0)
|
||||
{
|
||||
while (ret > 0 && isspace(value[ret - 1]))
|
||||
ret--; /* remove trailing whitespace */
|
||||
value[ret] = '\0'; /* terminate, even if ret = 0 */
|
||||
ret--; /* remove trailing whitespace */
|
||||
value[ret] = '\0'; /* terminate, even if ret = 0 */
|
||||
}
|
||||
ret2 = close(pfd);
|
||||
if (ret2 < 0)
|
||||
|
@@ -469,13 +469,16 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char *const filte
|
||||
if (debuglevel == 2)
|
||||
{
|
||||
fprintf(stderr, "filt: ");
|
||||
for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]);
|
||||
for (int i = 0; i < len; i++)
|
||||
fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "mask: ");
|
||||
for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]);
|
||||
for (int i = 0; i < len; i++)
|
||||
fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "mode: ");
|
||||
for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]);
|
||||
for (int i = 0; i < len; i++)
|
||||
fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
|
@@ -29,10 +29,14 @@ hw_caps_t *get_hwcaps(void)
|
||||
memset(&caps, 0, sizeof(hw_caps_t));
|
||||
|
||||
caps.pip_devs = 0;
|
||||
if (access("/dev/dvb/adapter0/video1", F_OK) != -1) caps.pip_devs = 1;
|
||||
if (access("/dev/dvb/adapter0/video2", F_OK) != -1) caps.pip_devs = 2;
|
||||
if (access("/dev/dvb/adapter0/video3", F_OK) != -1) caps.pip_devs = 3;
|
||||
if (caps.pip_devs > 0) caps.can_pip = 1;
|
||||
if (access("/dev/dvb/adapter0/video1", F_OK) != -1)
|
||||
caps.pip_devs = 1;
|
||||
if (access("/dev/dvb/adapter0/video2", F_OK) != -1)
|
||||
caps.pip_devs = 2;
|
||||
if (access("/dev/dvb/adapter0/video3", F_OK) != -1)
|
||||
caps.pip_devs = 3;
|
||||
if (caps.pip_devs > 0)
|
||||
caps.can_pip = 1;
|
||||
|
||||
#if BOXMODEL_VUSOLO4K
|
||||
caps.has_CI = 1;
|
||||
|
@@ -918,11 +918,13 @@ void cVideo::QuadPiP(bool active, int _x, int _y, int _w, int _h)
|
||||
{
|
||||
char buffer[64];
|
||||
int _a = 1;
|
||||
if (active) {
|
||||
if (active)
|
||||
{
|
||||
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUDUO4KSE || BOXMODEL_VUULTIMO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
|
||||
proc_put("/proc/stb/video/decodermode", "mosaic", strlen("mosaic"));
|
||||
#endif
|
||||
for (unsigned int i = 0; i < 4; i++) {
|
||||
for (unsigned int i = 0; i < 4; i++)
|
||||
{
|
||||
sprintf(buffer, "%x", _x);
|
||||
proc_put(VMPEG_dst_left[i], buffer, strlen(buffer));
|
||||
sprintf(buffer, "%x", _y);
|
||||
@@ -934,8 +936,11 @@ void cVideo::QuadPiP(bool active, int _x, int _y, int _w, int _h)
|
||||
sprintf(buffer, "%x", _a);
|
||||
proc_put(VMPEG_dst_apply[i], buffer, strlen(buffer));
|
||||
}
|
||||
} else {
|
||||
for (unsigned int i = 0; i < 4; i++) {
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int i = 0; i < 4; i++)
|
||||
{
|
||||
sprintf(buffer, "%x", 0);
|
||||
proc_put(VMPEG_dst_left[i], buffer, strlen(buffer));
|
||||
sprintf(buffer, "%x", 0);
|
||||
|
@@ -391,11 +391,11 @@ void cAudio::run()
|
||||
#endif
|
||||
inp = av_find_input_format("mpegts");
|
||||
AVIOContext *pIOCtx = avio_alloc_context(inbuf, INBUF_SIZE, // internal Buffer and its size
|
||||
0, // bWriteable (1=true,0=false)
|
||||
NULL, // user data; will be passed to our callback functions
|
||||
_my_read, // read callback
|
||||
NULL, // write callback
|
||||
NULL); // seek callback
|
||||
0, // bWriteable (1=true,0=false)
|
||||
NULL, // user data; will be passed to our callback functions
|
||||
_my_read, // read callback
|
||||
NULL, // write callback
|
||||
NULL); // seek callback
|
||||
avfc = avformat_alloc_context();
|
||||
avfc->pb = pIOCtx;
|
||||
avfc->iformat = inp;
|
||||
@@ -473,9 +473,9 @@ void cAudio::run()
|
||||
av_get_sample_fmt_string(tmp, sizeof(tmp), c->sample_fmt);
|
||||
hal_info("decoding %s, sample_fmt %d (%s) sample_rate %d channels %d\n", avcodec_get_name(p->codec_id), c->sample_fmt, tmp, p->sample_rate, p->channels);
|
||||
swr = swr_alloc_set_opts(swr,
|
||||
o_layout, AV_SAMPLE_FMT_S16, o_sr, /* output */
|
||||
p->channel_layout, c->sample_fmt, p->sample_rate, /* input */
|
||||
0, NULL);
|
||||
o_layout, AV_SAMPLE_FMT_S16, o_sr, /* output */
|
||||
p->channel_layout, c->sample_fmt, p->sample_rate, /* input */
|
||||
0, NULL);
|
||||
if (! swr)
|
||||
{
|
||||
hal_info("could not alloc resample context\n");
|
||||
|
@@ -203,7 +203,8 @@ int cDemux::Read(unsigned char *buff, int len, int timeout)
|
||||
* return from read(), so as a "emergency exit" for e.g. NIT scan, set a (long)
|
||||
* timeout here */
|
||||
int to = timeout;
|
||||
if (dmx_type == DMX_PSI_CHANNEL && timeout <= 0){
|
||||
if (dmx_type == DMX_PSI_CHANNEL && timeout <= 0)
|
||||
{
|
||||
to = 60 * 1000;
|
||||
}
|
||||
|
||||
@@ -363,13 +364,16 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char *const filte
|
||||
if (debuglevel == 2)
|
||||
{
|
||||
fprintf(stderr, "filt: ");
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]);
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)
|
||||
fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "mask: ");
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]);
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)
|
||||
fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "mode: ");
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]);
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)
|
||||
fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
|
@@ -349,8 +349,8 @@ bool cVideo::ShowPicture(const char *fname)
|
||||
{
|
||||
unsigned int need = av_image_get_buffer_size(VDEC_PIXFMT, c->width, c->height, 1);
|
||||
struct SwsContext *convert = sws_getContext(c->width, c->height, c->pix_fmt,
|
||||
c->width, c->height, VDEC_PIXFMT,
|
||||
SWS_BICUBIC, 0, 0, 0);
|
||||
c->width, c->height, VDEC_PIXFMT,
|
||||
SWS_BICUBIC, 0, 0, 0);
|
||||
if (!convert)
|
||||
hal_info("%s: ERROR setting up SWS context\n", __func__);
|
||||
else
|
||||
@@ -541,11 +541,11 @@ void cVideo::run(void)
|
||||
#endif
|
||||
inp = av_find_input_format("mpegts");
|
||||
AVIOContext *pIOCtx = avio_alloc_context(inbuf, INBUF_SIZE, // internal Buffer and its size
|
||||
0, // bWriteable (1=true,0=false)
|
||||
NULL, // user data; will be passed to our callback functions
|
||||
my_read, // read callback
|
||||
NULL, // write callback
|
||||
NULL); // seek callback
|
||||
0, // bWriteable (1=true,0=false)
|
||||
NULL, // user data; will be passed to our callback functions
|
||||
my_read, // read callback
|
||||
NULL, // write callback
|
||||
NULL); // seek callback
|
||||
avfc = avformat_alloc_context();
|
||||
avfc->pb = pIOCtx;
|
||||
avfc->iformat = inp;
|
||||
@@ -639,9 +639,9 @@ void cVideo::run(void)
|
||||
{
|
||||
unsigned int need = av_image_get_buffer_size(VDEC_PIXFMT, c->width, c->height, 1);
|
||||
convert = sws_getCachedContext(convert,
|
||||
c->width, c->height, c->pix_fmt,
|
||||
c->width, c->height, VDEC_PIXFMT,
|
||||
SWS_BICUBIC, 0, 0, 0);
|
||||
c->width, c->height, c->pix_fmt,
|
||||
c->width, c->height, VDEC_PIXFMT,
|
||||
SWS_BICUBIC, 0, 0, 0);
|
||||
if (!convert)
|
||||
hal_info("%s: ERROR setting up SWS context\n", __func__);
|
||||
else
|
||||
@@ -701,7 +701,7 @@ void cVideo::run(void)
|
||||
#else
|
||||
frame->best_effort_timestamp
|
||||
#endif
|
||||
);
|
||||
);
|
||||
}
|
||||
else
|
||||
hal_debug("%s: got_frame: %d stillpicture: %d\n", __func__, got_frame, stillpicture);
|
||||
|
@@ -29,10 +29,14 @@ hw_caps_t *get_hwcaps(void)
|
||||
memset(&caps, 0, sizeof(hw_caps_t));
|
||||
|
||||
caps.pip_devs = 0;
|
||||
if (access("/dev/dvb/adapter0/video1", F_OK) != -1) caps.pip_devs = 1;
|
||||
if (access("/dev/dvb/adapter0/video2", F_OK) != -1) caps.pip_devs = 2;
|
||||
if (access("/dev/dvb/adapter0/video3", F_OK) != -1) caps.pip_devs = 3;
|
||||
if (caps.pip_devs > 0) caps.can_pip = 1;
|
||||
if (access("/dev/dvb/adapter0/video1", F_OK) != -1)
|
||||
caps.pip_devs = 1;
|
||||
if (access("/dev/dvb/adapter0/video2", F_OK) != -1)
|
||||
caps.pip_devs = 2;
|
||||
if (access("/dev/dvb/adapter0/video3", F_OK) != -1)
|
||||
caps.pip_devs = 3;
|
||||
if (caps.pip_devs > 0)
|
||||
caps.can_pip = 1;
|
||||
|
||||
#if BOXMODEL_VUDUO
|
||||
caps.has_CI = 2;
|
||||
|
@@ -350,13 +350,16 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char *const filte
|
||||
if (debuglevel == 2)
|
||||
{
|
||||
fprintf(stderr, "filt: ");
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]);
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)
|
||||
fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "mask: ");
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]);
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)
|
||||
fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "mode: ");
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]);
|
||||
for (int i = 0; i < DMX_FILTER_SIZE; i++)
|
||||
fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
|
@@ -143,15 +143,15 @@ void GLFramebuffer::setup()
|
||||
vc_dispmanx_rect_set(&src_rect, 0, 0, width << 16, height << 16);
|
||||
vc_dispmanx_rect_set(&dsp_rect, 0, 0, info.width, info.height);
|
||||
element = vc_dispmanx_element_add(update,
|
||||
display,
|
||||
2000 /*layer*/,
|
||||
&dsp_rect,
|
||||
res[curr_res],
|
||||
&src_rect,
|
||||
DISPMANX_PROTECTION_NONE,
|
||||
&alpha,
|
||||
NULL,
|
||||
DISPMANX_NO_ROTATE);
|
||||
display,
|
||||
2000 /*layer*/,
|
||||
&dsp_rect,
|
||||
res[curr_res],
|
||||
&src_rect,
|
||||
DISPMANX_PROTECTION_NONE,
|
||||
&alpha,
|
||||
NULL,
|
||||
DISPMANX_NO_ROTATE);
|
||||
ret = vc_dispmanx_update_submit_sync(update);
|
||||
CHECK(ret == 0);
|
||||
curr_res = !curr_res;
|
||||
|
Reference in New Issue
Block a user