mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
crude hack for movieplayer tuxtxt integration
Origin commit data
------------------
Branch: master
Commit: 0962c08e90
Author: martii <m4rtii@gmx.de>
Date: 2013-03-31 (Sun, 31 Mar 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "output.h"
|
#include "output.h"
|
||||||
|
@@ -958,54 +958,42 @@ static int PlaybackSwitchSubtitle(Context_t *context, int* track) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
static int PlaybackSwitchDVBSubtitle(Context_t *context, int* track) {
|
static int PlaybackSwitchDVBSubtitle(Context_t *context, int* pid) {
|
||||||
int ret = cERR_PLAYBACK_NO_ERROR;
|
int ret = cERR_PLAYBACK_NO_ERROR;
|
||||||
|
|
||||||
playback_printf(10, "Track: %d\n", *track);
|
playback_printf(10, "Track: %d\n", *pid);
|
||||||
|
|
||||||
if (context && context->playback && context->playback->isPlaying ) {
|
if (context && context->manager && context->manager->dvbsubtitle ) {
|
||||||
if (context->manager && context->manager->dvbsubtitle) {
|
if (context->manager->dvbsubtitle->Command(context, *pid == 0xffff ? MANAGER_DEL : MANAGER_SET, pid) < 0) {
|
||||||
if (context->manager->dvbsubtitle->Command(context, MANAGER_SET, track) < 0)
|
playback_err("dvbsub manager set track failed\n");
|
||||||
{
|
ret = cERR_PLAYBACK_ERROR;
|
||||||
playback_err("manager set track failed\n");
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
ret = cERR_PLAYBACK_ERROR;
|
|
||||||
playback_err("no dvbsubtitle\n");
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
playback_err("no dvbsubtitle\n");
|
||||||
playback_err("not possible\n");
|
|
||||||
ret = cERR_PLAYBACK_ERROR;
|
if (*pid == 0xffff)
|
||||||
}
|
container_ffmpeg_update_tracks(context, "current stream");
|
||||||
|
|
||||||
playback_printf(10, "exiting with value %d\n", ret);
|
playback_printf(10, "exiting with value %d\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int PlaybackSwitchTeletext(Context_t *context, int* track) {
|
static int PlaybackSwitchTeletext(Context_t *context, int* pid) {
|
||||||
int ret = cERR_PLAYBACK_NO_ERROR;
|
int ret = cERR_PLAYBACK_NO_ERROR;
|
||||||
|
|
||||||
playback_printf(10, "Track: %d\n", *track);
|
playback_printf(10, "Track: %d\n", *pid);
|
||||||
|
|
||||||
if (context && context->playback && context->playback->isPlaying ) {
|
if (context && context->manager && context->manager->teletext ) {
|
||||||
if (context->manager && context->manager->teletext) {
|
if (context->manager->teletext->Command(context, *pid == 0xffff ? MANAGER_DEL : MANAGER_SET, pid)) {
|
||||||
if (context->manager->teletext->Command(context, MANAGER_SET, track) < 0)
|
playback_err("ttxsub manager set track failed\n");
|
||||||
{
|
ret = cERR_PLAYBACK_ERROR;
|
||||||
playback_err("manager set track failed\n");
|
}
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
ret = cERR_PLAYBACK_ERROR;
|
|
||||||
playback_err("no dvbsubtitle\n");
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
{
|
playback_err("no dvbsubtitle\n");
|
||||||
playback_err("not possible\n");
|
|
||||||
ret = cERR_PLAYBACK_ERROR;
|
if (*pid == 0xffff)
|
||||||
}
|
container_ffmpeg_update_tracks(context, "current stream");
|
||||||
|
|
||||||
playback_printf(10, "exiting with value %d\n", ret);
|
playback_printf(10, "exiting with value %d\n", ret);
|
||||||
|
|
||||||
|
@@ -124,7 +124,7 @@ bool cPlayback::Start(char *filename, unsigned short vpid, int vtype, unsigned s
|
|||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
mSubtitleStream=-1;
|
mSubtitleStream=-1;
|
||||||
mDvbsubtitleStream=-1;
|
mDvbsubtitleStream=-1;
|
||||||
mTeletextStream=0;
|
mTeletextStream=-1;
|
||||||
#endif
|
#endif
|
||||||
char file[400] = {""};
|
char file[400] = {""};
|
||||||
|
|
||||||
@@ -554,6 +554,7 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
|||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
|
int max_numpida = *numpida;
|
||||||
*numpida = 0;
|
*numpida = 0;
|
||||||
#endif
|
#endif
|
||||||
if(player && player->manager && player->manager->audio) {
|
if(player && player->manager && player->manager->audio) {
|
||||||
@@ -564,6 +565,9 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
|||||||
int i = 0,j=0;
|
int i = 0,j=0;
|
||||||
for (i = 0,j=0; TrackList[i] != NULL; i+=2,j++) {
|
for (i = 0,j=0; TrackList[i] != NULL; i+=2,j++) {
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
|
#ifdef MARTII
|
||||||
|
if (j < max_numpida) {
|
||||||
|
#endif
|
||||||
apids[j]=j;
|
apids[j]=j;
|
||||||
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
||||||
if( !strncmp("A_MPEG/L3", TrackList[i+1], 9))
|
if( !strncmp("A_MPEG/L3", TrackList[i+1], 9))
|
||||||
@@ -582,7 +586,14 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
|||||||
ac3flags[j] = 0; //todo
|
ac3flags[j] = 0; //todo
|
||||||
else
|
else
|
||||||
ac3flags[j] = 0; //todo
|
ac3flags[j] = 0; //todo
|
||||||
|
#ifdef MARTII
|
||||||
|
language[j]=std::string(TrackList[i]);
|
||||||
|
#else
|
||||||
language[j]=TrackList[i];
|
language[j]=TrackList[i];
|
||||||
|
#endif
|
||||||
|
#ifdef MARTII
|
||||||
|
}
|
||||||
|
#endif
|
||||||
free(TrackList[i]);
|
free(TrackList[i]);
|
||||||
free(TrackList[i+1]);
|
free(TrackList[i+1]);
|
||||||
}
|
}
|
||||||
@@ -595,6 +606,7 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
|||||||
void cPlayback::FindAllSubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language)
|
void cPlayback::FindAllSubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
|
int max_numpids = *numpids;
|
||||||
*numpids = 0;
|
*numpids = 0;
|
||||||
if(player && player->manager && player->manager->subtitle) {
|
if(player && player->manager && player->manager->subtitle) {
|
||||||
char ** TrackList = NULL;
|
char ** TrackList = NULL;
|
||||||
@@ -604,9 +616,10 @@ void cPlayback::FindAllSubtitlePids(uint16_t *pids, uint16_t *numpids, std::stri
|
|||||||
int i = 0,j=0;
|
int i = 0,j=0;
|
||||||
for (i = 0,j=0; TrackList[i] != NULL; i+=2,j++) {
|
for (i = 0,j=0; TrackList[i] != NULL; i+=2,j++) {
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
pids[j]=j;
|
if (j < max_numpids) {
|
||||||
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
pids[j]=j;
|
||||||
language[j]=TrackList[i];
|
language[j]=std::string(TrackList[i]);
|
||||||
|
}
|
||||||
free(TrackList[i]);
|
free(TrackList[i]);
|
||||||
free(TrackList[i+1]);
|
free(TrackList[i+1]);
|
||||||
}
|
}
|
||||||
@@ -619,6 +632,7 @@ void cPlayback::FindAllSubtitlePids(uint16_t *pids, uint16_t *numpids, std::stri
|
|||||||
void cPlayback::FindAllDvbsubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language)
|
void cPlayback::FindAllDvbsubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
|
int max_numpids = *numpids;
|
||||||
*numpids = 0;
|
*numpids = 0;
|
||||||
if(player && player->manager && player->manager->dvbsubtitle) {
|
if(player && player->manager && player->manager->dvbsubtitle) {
|
||||||
char ** TrackList = NULL;
|
char ** TrackList = NULL;
|
||||||
@@ -628,9 +642,10 @@ void cPlayback::FindAllDvbsubtitlePids(uint16_t *pids, uint16_t *numpids, std::s
|
|||||||
int i = 0,j=0;
|
int i = 0,j=0;
|
||||||
for (i = 0,j=0; TrackList[i] != NULL; i+=2,j++) {
|
for (i = 0,j=0; TrackList[i] != NULL; i+=2,j++) {
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
pids[j]=j;
|
if (j < max_numpids) {
|
||||||
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
pids[j]=j;
|
||||||
language[j]=TrackList[i];
|
language[j]=std::string(TrackList[i]);
|
||||||
|
}
|
||||||
free(TrackList[i]);
|
free(TrackList[i]);
|
||||||
free(TrackList[i+1]);
|
free(TrackList[i+1]);
|
||||||
}
|
}
|
||||||
@@ -643,6 +658,7 @@ void cPlayback::FindAllDvbsubtitlePids(uint16_t *pids, uint16_t *numpids, std::s
|
|||||||
void cPlayback::FindAllTeletextsubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language)
|
void cPlayback::FindAllTeletextsubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
|
int max_numpids = *numpids;
|
||||||
*numpids = 0;
|
*numpids = 0;
|
||||||
if(player && player->manager && player->manager->teletext) {
|
if(player && player->manager && player->manager->teletext) {
|
||||||
char ** TrackList = NULL;
|
char ** TrackList = NULL;
|
||||||
@@ -653,22 +669,52 @@ void cPlayback::FindAllTeletextsubtitlePids(uint16_t *pids, uint16_t *numpids, s
|
|||||||
for (i = 0,j=0; TrackList[i] != NULL; i+=2) {
|
for (i = 0,j=0; TrackList[i] != NULL; i+=2) {
|
||||||
int type = 0;
|
int type = 0;
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
if (1 != sscanf(TrackList[i], "%*d %*s %d %*d %*d", &type))
|
if (j < max_numpids) {
|
||||||
continue;
|
if (1 != sscanf(TrackList[i], "%*d %*s %d %*d %*d", &type))
|
||||||
if (type != 2 && type != 5) // return subtitles only
|
continue;
|
||||||
continue;
|
if (type != 2 && type != 5) // return subtitles only
|
||||||
pids[j]=j;
|
continue;
|
||||||
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
pids[j]=j;
|
||||||
language[j]=TrackList[i];
|
language[j]=std::string(TrackList[i]);
|
||||||
|
j++;
|
||||||
|
}
|
||||||
free(TrackList[i]);
|
free(TrackList[i]);
|
||||||
free(TrackList[i+1]);
|
free(TrackList[i+1]);
|
||||||
j++;
|
|
||||||
}
|
}
|
||||||
free(TrackList);
|
free(TrackList);
|
||||||
*numpids=j;
|
*numpids=j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned short cPlayback::GetTeletextPid(void)
|
||||||
|
{
|
||||||
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
|
int pid = 0;
|
||||||
|
if(player && player->manager && player->manager->teletext) {
|
||||||
|
char ** TrackList = NULL;
|
||||||
|
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
|
||||||
|
if (TrackList != NULL) {
|
||||||
|
printf("Teletext List\n");
|
||||||
|
int i = 0;
|
||||||
|
for (i = 0; TrackList[i] != NULL; i+=2) {
|
||||||
|
int type = 0;
|
||||||
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
|
if (!pid) {
|
||||||
|
if (2 != sscanf(TrackList[i], "%d %*s %d %*d %*d", &pid, &type))
|
||||||
|
continue;
|
||||||
|
if (type != 1)
|
||||||
|
pid = 0;
|
||||||
|
}
|
||||||
|
free(TrackList[i]);
|
||||||
|
free(TrackList[i+1]);
|
||||||
|
}
|
||||||
|
free(TrackList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("teletext pid id %d (0x%x)\n", pid, pid);
|
||||||
|
return (unsigned short)pid;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@@ -46,7 +46,7 @@ class cPlayback
|
|||||||
unsigned short GetAPid(void) { return mAudioStream; }
|
unsigned short GetAPid(void) { return mAudioStream; }
|
||||||
unsigned short GetSubtitlePid(void) { return mSubtitleStream; }
|
unsigned short GetSubtitlePid(void) { return mSubtitleStream; }
|
||||||
unsigned short GetDvbsubtitlePid(void) { return mDvbsubtitleStream; }
|
unsigned short GetDvbsubtitlePid(void) { return mDvbsubtitleStream; }
|
||||||
unsigned short GetTeletextPid(void) { return mTeletextStream; }
|
unsigned short GetTeletextPid(void);
|
||||||
void SuspendSubtitle(bool);
|
void SuspendSubtitle(bool);
|
||||||
#endif
|
#endif
|
||||||
bool SetSpeed(int speed);
|
bool SetSpeed(int speed);
|
||||||
|
Reference in New Issue
Block a user