mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
improve subtitle handling
Origin commit data
------------------
Branch: master
Commit: 9150713e46
Author: martii <m4rtii@gmx.de>
Date: 2012-11-06 (Tue, 06 Nov 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -397,6 +397,8 @@ static void ASSThread(Context_t *context) {
|
|||||||
// subtitel zeitpunkt zu bestimmen und solange zu schlafen.
|
// subtitel zeitpunkt zu bestimmen und solange zu schlafen.
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
|
if(!context->playback->mayWriteToFramebuffer)
|
||||||
|
continue;
|
||||||
getMutex(__LINE__);
|
getMutex(__LINE__);
|
||||||
checkRegions();
|
checkRegions();
|
||||||
#else
|
#else
|
||||||
@@ -560,7 +562,7 @@ static void ASSThread(Context_t *context) {
|
|||||||
|
|
||||||
ass_printf(10, "terminating\n");
|
ass_printf(10, "terminating\n");
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_SEEK_ABS, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT, PLAYBACK_SWITCH_TELETEXT, PLAYBACK_SWITCH_DVBSUBTITLE} PlaybackCmd_t;
|
typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_SEEK_ABS, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT, PLAYBACK_SWITCH_TELETEXT, PLAYBACK_SWITCH_DVBSUBTITLE, PLAYBACK_FRAMEBUFFER_LOCK, PLAYBACK_FRAMEBUFFER_UNLOCK} PlaybackCmd_t;
|
||||||
#else
|
#else
|
||||||
typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT} PlaybackCmd_t;
|
typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT} PlaybackCmd_t;
|
||||||
#endif
|
#endif
|
||||||
@@ -34,6 +34,7 @@ typedef struct PlaybackHandler_s {
|
|||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
unsigned char isDvbSubtitle;
|
unsigned char isDvbSubtitle;
|
||||||
unsigned char isTeletext;
|
unsigned char isTeletext;
|
||||||
|
unsigned char mayWriteToFramebuffer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
||||||
|
@@ -529,7 +529,7 @@ static int Write(void* _context, void *data) {
|
|||||||
int DataLength;
|
int DataLength;
|
||||||
unsigned long long int Pts;
|
unsigned long long int Pts;
|
||||||
float Duration;
|
float Duration;
|
||||||
|
|
||||||
subtitle_printf(10, "\n");
|
subtitle_printf(10, "\n");
|
||||||
|
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
|
@@ -1119,6 +1119,16 @@ static int Command(void* _context, PlaybackCmd_t command, void * argument) {
|
|||||||
ret = PlaybackSwitchTeletext(context, (int*)argument);
|
ret = PlaybackSwitchTeletext(context, (int*)argument);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case PLAYBACK_FRAMEBUFFER_LOCK: {
|
||||||
|
context->playback->mayWriteToFramebuffer = 0;
|
||||||
|
ret = cERR_PLAYBACK_NO_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PLAYBACK_FRAMEBUFFER_UNLOCK: {
|
||||||
|
context->playback->mayWriteToFramebuffer = 1;
|
||||||
|
ret = cERR_PLAYBACK_NO_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
playback_err("PlaybackCmd %d not supported!\n", command);
|
playback_err("PlaybackCmd %d not supported!\n", command);
|
||||||
@@ -1153,6 +1163,7 @@ PlaybackHandler_t PlaybackHandler = {
|
|||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
1,
|
||||||
#endif
|
#endif
|
||||||
&Command,
|
&Command,
|
||||||
"",
|
"",
|
||||||
|
@@ -319,7 +319,7 @@ bool cPlayback::SetSubtitlePid(unsigned short pid)
|
|||||||
if(pid!=mSubtitleStream){
|
if(pid!=mSubtitleStream){
|
||||||
if(player && player->playback)
|
if(player && player->playback)
|
||||||
player->playback->Command(player, PLAYBACK_SWITCH_SUBTITLE, (void*)&i);
|
player->playback->Command(player, PLAYBACK_SWITCH_SUBTITLE, (void*)&i);
|
||||||
mSubtitleStream=pid;
|
mSubtitleStream = pid;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -631,6 +631,15 @@ cPlayback::~cPlayback()
|
|||||||
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
printf("%s:%s\n", FILENAME, __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MARTII
|
||||||
|
void cPlayback::SuspendSubtitle(bool b)
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
player->playback->Command(player, PLAYBACK_FRAMEBUFFER_LOCK, 0);
|
||||||
|
else
|
||||||
|
player->playback->Command(player, PLAYBACK_FRAMEBUFFER_UNLOCK, 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
bool cPlayback::IsPlaying(void) const
|
bool cPlayback::IsPlaying(void) const
|
||||||
{
|
{
|
||||||
|
@@ -43,6 +43,7 @@ class cPlayback
|
|||||||
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) { return mTeletextStream; }
|
||||||
|
void SuspendSubtitle(bool);
|
||||||
#endif
|
#endif
|
||||||
bool SetSpeed(int speed);
|
bool SetSpeed(int speed);
|
||||||
bool GetSpeed(int &speed) const;
|
bool GetSpeed(int &speed) const;
|
||||||
|
Reference in New Issue
Block a user