mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 23:43:00 +02:00
libeplayer3: cleanup
This commit is contained in:
@@ -799,11 +799,7 @@ int LinuxDvbGetFrameCount(Context_t *context, unsigned long long int* frameCoun
|
||||
linuxdvb_err("VIDEO_GET_PLAY_INFO: %s\n", strerror(errno));
|
||||
ret = cERR_LINUXDVB_ERROR;
|
||||
}
|
||||
#ifdef MARTII
|
||||
else linuxdvb_err("V: %llu\n", playInfo.frame_count);
|
||||
#else
|
||||
else linuxdvb_err("V: %ull\n", playInfo.frame_count);
|
||||
#endif
|
||||
}
|
||||
else if (audiofd != -1)
|
||||
{
|
||||
@@ -813,11 +809,7 @@ int LinuxDvbGetFrameCount(Context_t *context, unsigned long long int* frameCoun
|
||||
linuxdvb_err("AUDIO_GET_PLAY_INFO: %s\n", strerror(errno));
|
||||
ret = cERR_LINUXDVB_ERROR;
|
||||
}
|
||||
#ifdef MARTII
|
||||
else linuxdvb_err("A: %llu\n", playInfo.frame_count);
|
||||
#else
|
||||
else linuxdvb_err("A: %ull\n", playInfo.frame_count);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
ret = cERR_LINUXDVB_ERROR;
|
||||
|
@@ -37,14 +37,9 @@
|
||||
|
||||
static short debug_level = 0;
|
||||
|
||||
#ifdef MARTII
|
||||
#define output_printf(level, x...) do { \
|
||||
if (debug_level >= level) fprintf(stderr, x); } while (0)
|
||||
#else
|
||||
#define output_printf(level, x...) do { \
|
||||
if (debug_level >= level) printf(x); } while (0)
|
||||
#endif
|
||||
#else
|
||||
#define output_printf(level, x...)
|
||||
#endif
|
||||
|
||||
@@ -102,7 +97,6 @@ static void OutputAdd(Context_t *context, char * port) {
|
||||
|
||||
for (i = 0; AvailableOutput[i] != NULL; i++)
|
||||
for (j = 0; AvailableOutput[i]->Capabilities[j] != NULL; j++)
|
||||
#ifdef MARTII
|
||||
if (!strcmp(AvailableOutput[i]->Capabilities[j], port)) {
|
||||
if (!strcmp("audio", port)) {
|
||||
context->output->audio = AvailableOutput[i];
|
||||
@@ -125,17 +119,6 @@ static void OutputAdd(Context_t *context, char * port) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (!strcmp(AvailableOutput[i]->Capabilities[j], port)) {
|
||||
if (!strcmp("audio", port))
|
||||
context->output->audio = AvailableOutput[i];
|
||||
else if (!strcmp("video", port))
|
||||
context->output->video = AvailableOutput[i];
|
||||
else if (!strcmp("subtitle", port))
|
||||
context->output->subtitle = AvailableOutput[i];
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void OutputDel(Context_t *context, char * port) {
|
||||
@@ -147,12 +130,10 @@ static void OutputDel(Context_t *context, char * port) {
|
||||
context->output->video = NULL;
|
||||
else if (!strcmp("subtitle", port))
|
||||
context->output->subtitle = NULL;
|
||||
#ifdef MARTII
|
||||
else if (!strcmp("dvbsubtitle", port))
|
||||
context->output->dvbsubtitle = NULL;
|
||||
else if (!strcmp("teletext", port))
|
||||
context->output->teletext = NULL;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -171,12 +152,10 @@ static int Command(void *_context, OutputCmd_t command, void * argument) {
|
||||
ret |= context->output->audio->Command(context, OUTPUT_OPEN, "audio");
|
||||
if (context->playback->isSubtitle)
|
||||
ret |= context->output->subtitle->Command(context, OUTPUT_OPEN, "subtitle");
|
||||
#ifdef MARTII
|
||||
if (context->playback->isDvbSubtitle)
|
||||
ret |= context->output->dvbsubtitle->Command(context, command, "dvbsubtitle");
|
||||
if (context->playback->isTeletext)
|
||||
ret |= context->output->teletext->Command(context, command, "teletext");
|
||||
#endif
|
||||
} else
|
||||
ret = cERR_OUTPUT_INTERNAL_ERROR;
|
||||
break;
|
||||
@@ -189,12 +168,10 @@ static int Command(void *_context, OutputCmd_t command, void * argument) {
|
||||
ret |= context->output->audio->Command(context, OUTPUT_CLOSE, "audio");
|
||||
if (context->playback->isSubtitle)
|
||||
ret |= context->output->subtitle->Command(context, OUTPUT_CLOSE, "subtitle");
|
||||
#ifdef MARTII
|
||||
if (context->playback->isDvbSubtitle)
|
||||
ret |= context->output->dvbsubtitle->Command(context, command, "dvbsubtitle");
|
||||
if (context->playback->isTeletext)
|
||||
ret |= context->output->teletext->Command(context, command, "teletext");
|
||||
#endif
|
||||
} else
|
||||
ret = cERR_OUTPUT_INTERNAL_ERROR;
|
||||
break;
|
||||
@@ -224,12 +201,10 @@ static int Command(void *_context, OutputCmd_t command, void * argument) {
|
||||
if (context->playback->isSubtitle)
|
||||
ret = context->output->subtitle->Command(context, OUTPUT_PLAY, "subtitle");
|
||||
}
|
||||
#ifdef MARTII
|
||||
if (context->playback->isDvbSubtitle)
|
||||
ret |= context->output->dvbsubtitle->Command(context, command, "dvbsubtitle");
|
||||
if (context->playback->isTeletext)
|
||||
ret |= context->output->teletext->Command(context, command, "teletext");
|
||||
#endif
|
||||
}
|
||||
} else
|
||||
ret = cERR_OUTPUT_INTERNAL_ERROR;
|
||||
@@ -243,12 +218,10 @@ static int Command(void *_context, OutputCmd_t command, void * argument) {
|
||||
ret |= context->output->audio->Command(context, OUTPUT_STOP, "audio");
|
||||
if (context->playback->isSubtitle)
|
||||
ret |= context->output->subtitle->Command(context, OUTPUT_STOP, "subtitle");
|
||||
#ifdef MARTII
|
||||
if (context->playback->isDvbSubtitle)
|
||||
ret |= context->output->dvbsubtitle->Command(context, command, "dvbsubtitle");
|
||||
if (context->playback->isTeletext)
|
||||
ret |= context->output->teletext->Command(context, command, "teletext");
|
||||
#endif
|
||||
} else
|
||||
ret = cERR_OUTPUT_INTERNAL_ERROR;
|
||||
break;
|
||||
@@ -307,12 +280,10 @@ static int Command(void *_context, OutputCmd_t command, void * argument) {
|
||||
ret |= context->output->audio->Command(context, OUTPUT_CONTINUE, "audio");
|
||||
//if (context->playback->isSubtitle)
|
||||
// ret |= context->output->subtitle->Command(context, OUTPUT_CONTINUE, "subtitle");
|
||||
#ifdef MARTII
|
||||
if (context->playback->isDvbSubtitle)
|
||||
ret |= context->output->dvbsubtitle->Command(context, command, "dvbsubtitle");
|
||||
if (context->playback->isTeletext)
|
||||
ret |= context->output->teletext->Command(context, command, "teletext");
|
||||
#endif
|
||||
} else
|
||||
ret = cERR_OUTPUT_INTERNAL_ERROR;
|
||||
break;
|
||||
@@ -333,12 +304,10 @@ static int Command(void *_context, OutputCmd_t command, void * argument) {
|
||||
ret |= context->output->audio->Command(context, OUTPUT_CLEAR, "audio");
|
||||
//if (context->playback->isSubtitle && (argument == NULL || *(char *) argument == 's'))
|
||||
// ret |= context->output->subtitle->Command(context, OUTPUT_CLEAR, "subtitle");
|
||||
#ifdef MARTII
|
||||
if (context->playback->isDvbSubtitle)
|
||||
ret |= context->output->dvbsubtitle->Command(context, command, "dvbsubtitle");
|
||||
if (context->playback->isTeletext)
|
||||
ret |= context->output->teletext->Command(context, command, "teletext");
|
||||
#endif
|
||||
} else
|
||||
ret = cERR_OUTPUT_INTERNAL_ERROR;
|
||||
break;
|
||||
@@ -361,12 +330,10 @@ static int Command(void *_context, OutputCmd_t command, void * argument) {
|
||||
return context->output->audio->Command(context, OUTPUT_SWITCH, "audio");
|
||||
if (context->playback->isVideo)
|
||||
return context->output->video->Command(context, OUTPUT_SWITCH, "video");
|
||||
#ifdef MARTII
|
||||
if (context->playback->isDvbSubtitle)
|
||||
ret |= context->output->dvbsubtitle->Command(context, command, "dvbsubtitle");
|
||||
if (context->playback->isTeletext)
|
||||
ret |= context->output->teletext->Command(context, command, "teletext");
|
||||
#endif
|
||||
} else
|
||||
ret = cERR_OUTPUT_INTERNAL_ERROR;
|
||||
break;
|
||||
@@ -427,9 +394,7 @@ OutputHandler_t OutputHandler = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#ifdef MARTII
|
||||
NULL, // dvbsubtitle
|
||||
NULL, // teletext
|
||||
#endif
|
||||
&Command
|
||||
};
|
||||
|
@@ -1,4 +1,3 @@
|
||||
#ifdef MARTII
|
||||
/*
|
||||
* Pipe Output handling.
|
||||
*
|
||||
@@ -452,4 +451,3 @@ struct Output_s PipeOutput = {
|
||||
&Write,
|
||||
PipeCapabilities
|
||||
};
|
||||
#endif
|
||||
|
@@ -597,11 +597,7 @@ static int Write(void* _context, void *data) {
|
||||
return cERR_SUBTITLE_NO_ERROR;
|
||||
}
|
||||
|
||||
#ifdef MARTII
|
||||
static int subtitle_Open(Context_t* context) {
|
||||
#else
|
||||
static int subtitle_Open(context) {
|
||||
#endif
|
||||
int i;
|
||||
|
||||
subtitle_printf(10, "\n");
|
||||
@@ -694,11 +690,7 @@ static int subtitle_Play(Context_t* context) {
|
||||
return cERR_SUBTITLE_NO_ERROR;
|
||||
}
|
||||
|
||||
#ifdef MARTII
|
||||
static int subtitle_Stop(Context_t* context) {
|
||||
#else
|
||||
static int subtitle_Stop(context) {
|
||||
#endif
|
||||
int wait_time = 20;
|
||||
int i;
|
||||
|
||||
|
@@ -37,9 +37,7 @@
|
||||
#include <asm/types.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#ifdef MARTII
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
#include "output.h"
|
||||
|
@@ -100,19 +100,8 @@ static int reset()
|
||||
|
||||
static int writeData(void* _call)
|
||||
{
|
||||
#ifndef MARTII
|
||||
unsigned char r;
|
||||
unsigned char g;
|
||||
unsigned char b;
|
||||
#endif
|
||||
unsigned char a;
|
||||
#ifndef MARTII
|
||||
int x,y;
|
||||
#endif
|
||||
int res = 0;
|
||||
#ifndef MARTII
|
||||
unsigned char* dst;
|
||||
#endif
|
||||
|
||||
WriterFBCallData_t* call = (WriterFBCallData_t*) _call;
|
||||
|
||||
@@ -162,7 +151,7 @@ static int writeData(void* _call)
|
||||
{
|
||||
k = ((unsigned)src[x]) * opacity / 255;
|
||||
ck = 255 - k;
|
||||
#ifdef MARTII // or __sh__, or !HAVE_TRIPLEDRAGON
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
*dst++ = 0;
|
||||
t = *dst;
|
||||
*dst++ = (k*r + ck*t) / 255;
|
||||
@@ -186,9 +175,7 @@ static int writeData(void* _call)
|
||||
}
|
||||
} else
|
||||
{
|
||||
#ifdef MARTII
|
||||
int y;
|
||||
#endif
|
||||
for (y = 0; y < call->Height; y++)
|
||||
memset(call->destination + ((call->y + y) * call->destStride) + call->x * 4, 0, call->Width * 4);
|
||||
}
|
||||
|
@@ -88,9 +88,7 @@ static const unsigned char clpcm_pes[18] = { 0x00, 0x00, 0x01, 0xBD, //start c
|
||||
0x1E, 0x60, 0x0A, //first pes only, 0xFF after
|
||||
0xFF
|
||||
};
|
||||
#ifdef MARTII
|
||||
// reference: search for TypeLpcmDVDAudio in player/frame_parser/frame_parser_audio_lpcm.cpp
|
||||
#endif
|
||||
static const unsigned char clpcm_prv[14] = { 0xA0, //sub_stream_id
|
||||
0, 0, //resvd and UPC_EAN_ISRC stuff, unused
|
||||
0x0A, //private header length
|
||||
|
@@ -91,11 +91,7 @@ int InsertPesHeader (unsigned char *data, int size, unsigned char stream_id, uns
|
||||
BitPacker_t ld2 = {data, 0, 32};
|
||||
|
||||
if (size > MAX_PES_PACKET_SIZE)
|
||||
#ifdef MARTII
|
||||
size = 0; // unbounded
|
||||
#else
|
||||
printf("%s: Packet bigger than 63.9K eeeekkkkk\n",__FUNCTION__);
|
||||
#endif
|
||||
size = 0; // unbounded
|
||||
|
||||
PutBits(&ld2,0x0 ,8);
|
||||
PutBits(&ld2,0x0 ,8);
|
||||
|
@@ -260,7 +260,7 @@ static int writeData(void* _call)
|
||||
iov[1].iov_base = call->data + Position;
|
||||
iov[1].iov_len = PacketLength;
|
||||
|
||||
size_t l = writev(call->fd, iov, 2);
|
||||
ssize_t l = writev(call->fd, iov, 2);
|
||||
if (l < 0) {
|
||||
len = l;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user