mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
libarmbox: Code formatting playback_libeplayer3
Origin commit data
------------------
Branch: master
Commit: 707c47aca9
Author: max_10 <max_10@gmx.de>
Date: 2017-12-28 (Thu, 28 Dec 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -28,7 +28,8 @@ extern cVideo *videoDecoder;
|
|||||||
//Used by Fileplay
|
//Used by Fileplay
|
||||||
bool cPlayback::Open(playmode_t PlayMode)
|
bool cPlayback::Open(playmode_t PlayMode)
|
||||||
{
|
{
|
||||||
const char *aPLAYMODE[] = {
|
const char *aPLAYMODE[] =
|
||||||
|
{
|
||||||
"PLAYMODE_TS",
|
"PLAYMODE_TS",
|
||||||
"PLAYMODE_FILE"
|
"PLAYMODE_FILE"
|
||||||
};
|
};
|
||||||
@@ -130,68 +131,80 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//AUDIO
|
//AUDIO
|
||||||
if(player && player->manager && player->manager->audio) {
|
if (player && player->manager && player->manager->audio)
|
||||||
char ** TrackList = NULL;
|
{
|
||||||
player->manager->audio->Command(player, MANAGER_LIST, &TrackList);
|
char ** TrackList = NULL;
|
||||||
if (TrackList != NULL) {
|
player->manager->audio->Command(player, MANAGER_LIST, &TrackList);
|
||||||
printf("AudioTrack List\n");
|
if (TrackList != NULL)
|
||||||
int i = 0;
|
{
|
||||||
for (i = 0; TrackList[i] != NULL; i+=2) {
|
printf("AudioTrack List\n");
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
int i = 0;
|
||||||
free(TrackList[i]);
|
for (i = 0; TrackList[i] != NULL; i+=2)
|
||||||
free(TrackList[i+1]);
|
{
|
||||||
}
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
free(TrackList);
|
free(TrackList[i]);
|
||||||
}
|
free(TrackList[i+1]);
|
||||||
}
|
}
|
||||||
//SUB
|
free(TrackList);
|
||||||
if(player && player->manager && player->manager->subtitle) {
|
}
|
||||||
char ** TrackList = NULL;
|
}
|
||||||
player->manager->subtitle->Command(player, MANAGER_LIST, &TrackList);
|
//SUB
|
||||||
if (TrackList != NULL) {
|
if (player && player->manager && player->manager->subtitle)
|
||||||
printf("SubtitleTrack List\n");
|
{
|
||||||
int i = 0;
|
char ** TrackList = NULL;
|
||||||
for (i = 0; TrackList[i] != NULL; i+=2) {
|
player->manager->subtitle->Command(player, MANAGER_LIST, &TrackList);
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
if (TrackList != NULL)
|
||||||
free(TrackList[i]);
|
{
|
||||||
free(TrackList[i+1]);
|
printf("SubtitleTrack List\n");
|
||||||
}
|
int i = 0;
|
||||||
free(TrackList);
|
for (i = 0; TrackList[i] != NULL; i+=2)
|
||||||
}
|
{
|
||||||
}
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
|
free(TrackList[i]);
|
||||||
|
free(TrackList[i+1]);
|
||||||
|
}
|
||||||
|
free(TrackList);
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
//Teletext
|
//Teletext
|
||||||
if(player && player->manager && player->manager->teletext) {
|
if (player && player->manager && player->manager->teletext)
|
||||||
char ** TrackList = NULL;
|
{
|
||||||
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
|
char ** TrackList = NULL;
|
||||||
if (TrackList != NULL) {
|
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
|
||||||
printf("TeletextTrack List\n");
|
if (TrackList != NULL)
|
||||||
int i = 0;
|
{
|
||||||
for (i = 0; TrackList[i] != NULL; i+=2) {
|
printf("TeletextTrack List\n");
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
int i = 0;
|
||||||
free(TrackList[i]);
|
for (i = 0; TrackList[i] != NULL; i+=2)
|
||||||
free(TrackList[i+1]);
|
{
|
||||||
}
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
free(TrackList);
|
free(TrackList[i]);
|
||||||
}
|
free(TrackList[i+1]);
|
||||||
}
|
}
|
||||||
|
free(TrackList);
|
||||||
|
}
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
//Chapters
|
//Chapters
|
||||||
if(player && player->manager && player->manager->chapter) {
|
if (player && player->manager && player->manager->chapter)
|
||||||
char ** TrackList = NULL;
|
{
|
||||||
player->manager->chapter->Command(player, MANAGER_LIST, &TrackList);
|
char ** TrackList = NULL;
|
||||||
if (TrackList != NULL) {
|
player->manager->chapter->Command(player, MANAGER_LIST, &TrackList);
|
||||||
printf("Chapter List\n");
|
if (TrackList != NULL)
|
||||||
int i = 0;
|
{
|
||||||
for (i = 0; TrackList[i] != NULL; i+=2) {
|
printf("Chapter List\n");
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
int i = 0;
|
||||||
free(TrackList[i]);
|
for (i = 0; TrackList[i] != NULL; i+=2)
|
||||||
free(TrackList[i+1]);
|
{
|
||||||
}
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
free(TrackList);
|
free(TrackList[i]);
|
||||||
}
|
free(TrackList[i+1]);
|
||||||
}
|
}
|
||||||
|
free(TrackList);
|
||||||
|
}
|
||||||
|
}
|
||||||
playing = true;
|
playing = true;
|
||||||
player->output->Command(player, OUTPUT_OPEN, NULL);
|
player->output->Command(player, OUTPUT_OPEN, NULL);
|
||||||
ret = (player->playback->Command(player, PLAYBACK_PLAY, NULL) == 0);
|
ret = (player->playback->Command(player, PLAYBACK_PLAY, NULL) == 0);
|
||||||
@@ -433,49 +446,54 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu
|
|||||||
lt_info("%s\n", __func__);
|
lt_info("%s\n", __func__);
|
||||||
int max_numpida = *numpida;
|
int max_numpida = *numpida;
|
||||||
*numpida = 0;
|
*numpida = 0;
|
||||||
if(player && player->manager && player->manager->audio) {
|
if (player && player->manager && player->manager->audio)
|
||||||
char ** TrackList = NULL;
|
{
|
||||||
player->manager->audio->Command(player, MANAGER_LIST, &TrackList);
|
char **TrackList = NULL;
|
||||||
if (TrackList != NULL) {
|
player->manager->audio->Command(player, MANAGER_LIST, &TrackList);
|
||||||
printf("AudioTrack List\n");
|
if (TrackList != NULL)
|
||||||
int i = 0,j=0;
|
{
|
||||||
for (i = 0,j=0; TrackList[i] != NULL; i+=2,j++) {
|
printf("AudioTrack List\n");
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
int i = 0, j = 0;
|
||||||
if (j < max_numpida) {
|
for (i = 0, j = 0; TrackList[i] != NULL; i += 2, j++)
|
||||||
int _pid;
|
{
|
||||||
char _lang[strlen(TrackList[i])];
|
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
|
||||||
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang)) {
|
if (j < max_numpida)
|
||||||
apids[j]=_pid;
|
{
|
||||||
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
int _pid;
|
||||||
if( !strncmp("A_MPEG/L3", TrackList[i+1], 9))
|
char _lang[strlen(TrackList[i])];
|
||||||
ac3flags[j] = 3;
|
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang))
|
||||||
if( !strncmp("A_MP3", TrackList[i+1], 5))
|
{
|
||||||
ac3flags[j] = 4;
|
apids[j] = _pid;
|
||||||
else if(!strncmp("A_AC3", TrackList[i+1], 5))
|
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
||||||
ac3flags[j] = 1;
|
if (!strncmp("A_MPEG/L3", TrackList[i + 1], 9))
|
||||||
else if(!strncmp("A_EAC3", TrackList[i+1], 6))
|
ac3flags[j] = 3;
|
||||||
ac3flags[j] = 7;
|
if (!strncmp("A_MP3", TrackList[i + 1], 5))
|
||||||
else if(!strncmp("A_DTS", TrackList[i+1], 5))
|
ac3flags[j] = 4;
|
||||||
ac3flags[j] = 6;
|
else if (!strncmp("A_AC3", TrackList[i + 1], 5))
|
||||||
else if(!strncmp("A_AAC", TrackList[i+1], 5))
|
ac3flags[j] = 1;
|
||||||
ac3flags[j] = 5;
|
else if (!strncmp("A_EAC3", TrackList[i + 1], 6))
|
||||||
else if(!strncmp("A_PCM", TrackList[i+1], 5))
|
ac3flags[j] = 7;
|
||||||
ac3flags[j] = 0; //todo
|
else if (!strncmp("A_DTS", TrackList[i + 1], 5))
|
||||||
else if(!strncmp("A_VORBIS", TrackList[i+1], 8))
|
ac3flags[j] = 6;
|
||||||
ac3flags[j] = 0; //todo
|
else if (!strncmp("A_AAC", TrackList[i + 1], 5))
|
||||||
else if(!strncmp("A_FLAC", TrackList[i+1], 6))
|
ac3flags[j] = 5;
|
||||||
ac3flags[j] = 0; //todo
|
else if (!strncmp("A_PCM", TrackList[i + 1], 5))
|
||||||
else
|
ac3flags[j] = 0; //todo
|
||||||
ac3flags[j] = 0; //todo
|
else if (!strncmp("A_VORBIS", TrackList[i + 1], 8))
|
||||||
language[j]=std::string(_lang);
|
ac3flags[j] = 0; //todo
|
||||||
}
|
else if (!strncmp("A_FLAC", TrackList[i + 1], 6))
|
||||||
}
|
ac3flags[j] = 0; //todo
|
||||||
free(TrackList[i]);
|
else
|
||||||
free(TrackList[i+1]);
|
ac3flags[j] = 0; //todo
|
||||||
}
|
language[j] = std::string(_lang);
|
||||||
free(TrackList);
|
}
|
||||||
*numpida=j;
|
}
|
||||||
}
|
free(TrackList[i]);
|
||||||
|
free(TrackList[i + 1]);
|
||||||
|
}
|
||||||
|
free(TrackList);
|
||||||
|
*numpida = j;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,31 +538,35 @@ void cPlayback::FindAllTeletextsubtitlePids(int *pids, unsigned int *numpids, st
|
|||||||
int max_numpids = *numpids;
|
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;
|
{
|
||||||
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
|
char **TrackList = NULL;
|
||||||
if (TrackList != NULL) {
|
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
|
||||||
printf("Teletext List\n");
|
if (TrackList != NULL)
|
||||||
int i = 0,j=0;
|
{
|
||||||
for (i = 0,j=0; TrackList[i] != NULL; i+=2) {
|
printf("Teletext List\n");
|
||||||
int type = 0;
|
int i = 0, j = 0;
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
for (i = 0, j = 0; TrackList[i] != NULL; i += 2)
|
||||||
if (j < max_numpids) {
|
{
|
||||||
int _pid;
|
int type = 0;
|
||||||
if (2 != sscanf(TrackList[i], "%*d %d %*s %d %*d %*d", &_pid, &type))
|
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
|
||||||
continue;
|
if (j < max_numpids)
|
||||||
if (type != 2 && type != 5) // return subtitles only
|
{
|
||||||
continue;
|
int _pid;
|
||||||
pids[j]=_pid;
|
if (2 != sscanf(TrackList[i], "%d %*s %d %*d %*d", &_pid, &type))
|
||||||
language[j]=std::string(TrackList[i]);
|
continue;
|
||||||
j++;
|
if (type != 2 && type != 5) // return subtitles only
|
||||||
}
|
continue;
|
||||||
free(TrackList[i]);
|
pids[j] = _pid;
|
||||||
free(TrackList[i+1]);
|
language[j] = std::string(TrackList[i]);
|
||||||
}
|
j++;
|
||||||
free(TrackList);
|
}
|
||||||
*numpids=j;
|
free(TrackList[i]);
|
||||||
}
|
free(TrackList[i + 1]);
|
||||||
|
}
|
||||||
|
free(TrackList);
|
||||||
|
*numpids = j;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -554,26 +576,30 @@ int cPlayback::GetTeletextPid(void)
|
|||||||
lt_info("%s\n", __func__);
|
lt_info("%s\n", __func__);
|
||||||
int pid = -1;
|
int pid = -1;
|
||||||
/*
|
/*
|
||||||
if(player && player->manager && player->manager->teletext) {
|
if (player && player->manager && player->manager->teletext)
|
||||||
char ** TrackList = NULL;
|
{
|
||||||
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
|
char **TrackList = NULL;
|
||||||
if (TrackList != NULL) {
|
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
|
||||||
printf("Teletext List\n");
|
if (TrackList != NULL)
|
||||||
int i = 0;
|
{
|
||||||
for (i = 0; TrackList[i] != NULL; i+=2) {
|
printf("Teletext List\n");
|
||||||
int type = 0;
|
int i = 0;
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
for (i = 0; TrackList[i] != NULL; i += 2)
|
||||||
if (pid < 0) {
|
{
|
||||||
if (2 != sscanf(TrackList[i], "%*d %d %*s %d %*d %*d", &pid, &type))
|
int type = 0;
|
||||||
continue;
|
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
||||||
if (type != 1)
|
if (pid < 0)
|
||||||
pid = -1;
|
{
|
||||||
}
|
if (2 != sscanf(TrackList[i], "%*d %d %*s %d %*d %*d", &pid, &type))
|
||||||
free(TrackList[i]);
|
continue;
|
||||||
free(TrackList[i+1]);
|
if (type != 1)
|
||||||
}
|
pid = -1;
|
||||||
free(TrackList);
|
}
|
||||||
}
|
free(TrackList[i]);
|
||||||
|
free(TrackList[i + 1]);
|
||||||
|
}
|
||||||
|
free(TrackList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
printf("teletext pid id %d (0x%x)\n", pid, pid);
|
printf("teletext pid id %d (0x%x)\n", pid, pid);
|
||||||
@@ -597,24 +623,27 @@ void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string
|
|||||||
{
|
{
|
||||||
positions.clear();
|
positions.clear();
|
||||||
titles.clear();
|
titles.clear();
|
||||||
if(player && player->manager && player->manager->chapter) {
|
if (player && player->manager && player->manager->chapter)
|
||||||
char ** TrackList = NULL;
|
{
|
||||||
player->manager->chapter->Command(player, MANAGER_LIST, &TrackList);
|
char **TrackList = NULL;
|
||||||
if (TrackList != NULL) {
|
player->manager->chapter->Command(player, MANAGER_LIST, &TrackList);
|
||||||
printf("%s: Chapter List\n", __func__);
|
if (TrackList != NULL)
|
||||||
int i = 0;
|
{
|
||||||
for (i = 0; TrackList[i] != NULL; i+=2) {
|
printf("%s: Chapter List\n", __func__);
|
||||||
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
|
int i = 0;
|
||||||
int pos = atoi(TrackList[i]);
|
for (i = 0; TrackList[i] != NULL; i += 2)
|
||||||
std::string title(TrackList[i + 1]);
|
{
|
||||||
positions.push_back(pos);
|
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
|
||||||
titles.push_back(title);
|
int pos = atoi(TrackList[i]);
|
||||||
free(TrackList[i]);
|
std::string title(TrackList[i + 1]);
|
||||||
free(TrackList[i+1]);
|
positions.push_back(pos);
|
||||||
}
|
titles.push_back(title);
|
||||||
free(TrackList);
|
free(TrackList[i]);
|
||||||
}
|
free(TrackList[i + 1]);
|
||||||
}
|
}
|
||||||
|
free(TrackList);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cPlayback::GetMetadata(std::vector<std::string> &keys, std::vector<std::string> &values)
|
void cPlayback::GetMetadata(std::vector<std::string> &keys, std::vector<std::string> &values)
|
||||||
@@ -675,8 +704,9 @@ bool cPlayback::IsPlaying()
|
|||||||
|
|
||||||
uint64_t cPlayback::GetReadCount()
|
uint64_t cPlayback::GetReadCount()
|
||||||
{
|
{
|
||||||
//if (player && player->playback) {
|
//if (player && player->playback)
|
||||||
//return player->playback->readCount;
|
//{
|
||||||
|
// return player->playback->readCount;
|
||||||
//}
|
//}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@ struct AVFormatContext;
|
|||||||
|
|
||||||
class cPlayback
|
class cPlayback
|
||||||
{
|
{
|
||||||
friend class CStreamInfo2;
|
friend class CStreamInfo2;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool enabled;
|
bool enabled;
|
||||||
@@ -43,18 +43,9 @@ class cPlayback
|
|||||||
bool SetVPid(int pid);
|
bool SetVPid(int pid);
|
||||||
bool SetSubtitlePid(int pid);
|
bool SetSubtitlePid(int pid);
|
||||||
bool SetTeletextPid(int pid);
|
bool SetTeletextPid(int pid);
|
||||||
int GetAPid(void)
|
int GetAPid(void) { return mAudioStream; }
|
||||||
{
|
int GetVPid(void) { return 0; }
|
||||||
return mAudioStream;
|
int GetSubtitlePid(void) { return mSubtitleStream; }
|
||||||
};
|
|
||||||
int GetVPid(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
int GetSubtitlePid(void)
|
|
||||||
{
|
|
||||||
return mSubtitleStream;
|
|
||||||
};
|
|
||||||
int GetTeletextPid(void);
|
int GetTeletextPid(void);
|
||||||
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