mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
cPlayback: add new API functions for DVD chapter/subtitles
right now these are mostly dummies...
Origin commit data
------------------
Branch: master
Commit: 70a2f5bca0
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-06-16 (Sun, 16 Jun 2013)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -336,7 +336,7 @@ bool cPlayback::SetAPid(unsigned short pid, int /*ac3*/)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::SetSPid(int pid)
|
bool cPlayback::SelectSubtitles(int pid)
|
||||||
{
|
{
|
||||||
lt_info("%s: pid %i\n", __func__, pid);
|
lt_info("%s: pid %i\n", __func__, pid);
|
||||||
if (pid != subpid)
|
if (pid != subpid)
|
||||||
@@ -464,7 +464,7 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cPlayback::FindAllSPids(int *spids, uint16_t *numpids, std::string *language)
|
void cPlayback::FindAllSubs(uint16_t *spids, unsigned short *supported, uint16_t *numpids, std::string *language)
|
||||||
{
|
{
|
||||||
lt_info("%s\n", __func__);
|
lt_info("%s\n", __func__);
|
||||||
char buf[32];
|
char buf[32];
|
||||||
@@ -487,6 +487,7 @@ void cPlayback::FindAllSPids(int *spids, uint16_t *numpids, std::string *languag
|
|||||||
spu_lang[20] = '\0';
|
spu_lang[20] = '\0';
|
||||||
spids[sid] = atoi(streamidstring);
|
spids[sid] = atoi(streamidstring);
|
||||||
language[sid] = spu_lang;
|
language[sid] = spu_lang;
|
||||||
|
supported[sid] = 1;
|
||||||
lt_info("%s: #%d apid:%d lang: %s\n", __func__, sid, spids[sid], spu_lang);
|
lt_info("%s: #%d apid:%d lang: %s\n", __func__, sid, spids[sid], spu_lang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -496,6 +497,13 @@ void cPlayback::FindAllSPids(int *spids, uint16_t *numpids, std::string *languag
|
|||||||
language[spu_count] = "Disable";
|
language[spu_count] = "Disable";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DVD support is not yet ready... */
|
||||||
|
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
|
||||||
|
{
|
||||||
|
positions.clear();
|
||||||
|
titles.clear();
|
||||||
|
}
|
||||||
|
|
||||||
cPlayback::cPlayback(int /*num*/)
|
cPlayback::cPlayback(int /*num*/)
|
||||||
{
|
{
|
||||||
lt_info("%s: constructor\n", __func__);
|
lt_info("%s: constructor\n", __func__);
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PLAYMODE_TS = 0,
|
PLAYMODE_TS = 0,
|
||||||
@@ -42,9 +43,9 @@ class cPlayback
|
|||||||
bool GetPosition(int &position, int &duration); /* pos: current time in ms, dur: file length in ms */
|
bool GetPosition(int &position, int &duration); /* pos: current time in ms, dur: file length in ms */
|
||||||
bool SetPosition(int position, bool absolute = false); /* position: jump in ms */
|
bool SetPosition(int position, bool absolute = false); /* position: jump in ms */
|
||||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
||||||
// AZbox specific
|
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
|
||||||
void FindAllSPids(int *spids, uint16_t *numpids, std::string *language);
|
bool SelectSubtitles(int pid);
|
||||||
bool SetSPid(int pid);
|
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
|
||||||
#if 0
|
#if 0
|
||||||
// Functions that are not used by movieplayer.cpp:
|
// Functions that are not used by movieplayer.cpp:
|
||||||
bool Stop(void);
|
bool Stop(void);
|
||||||
|
@@ -26,7 +26,7 @@ bool cPlayback::SetAPid(unsigned short pid, bool /*ac3*/)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::SetSPid(int pid)
|
bool cPlayback::SelectSubtitles(int pid)
|
||||||
{
|
{
|
||||||
printf("%s:%s pid %i\n", FILENAME, __func__, pid);
|
printf("%s:%s pid %i\n", FILENAME, __func__, pid);
|
||||||
return true;
|
return true;
|
||||||
@@ -63,6 +63,18 @@ void cPlayback::FindAllPids(uint16_t *, unsigned short *, uint16_t *numpida, std
|
|||||||
*numpida = 0;
|
*numpida = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cPlayback::FindAllSubs(uint16_t *, unsigned short *, uint16_t *numpida, std::string *)
|
||||||
|
{
|
||||||
|
printf("%s:%s\n", FILENAME, __func__);
|
||||||
|
*numpida = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
|
||||||
|
{
|
||||||
|
positions.clear();
|
||||||
|
titles.clear();
|
||||||
|
}
|
||||||
|
|
||||||
cPlayback::cPlayback(int /*num*/)
|
cPlayback::cPlayback(int /*num*/)
|
||||||
{
|
{
|
||||||
printf("%s:%s\n", FILENAME, __func__);
|
printf("%s:%s\n", FILENAME, __func__);
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PLAYMODE_TS = 0,
|
PLAYMODE_TS = 0,
|
||||||
@@ -19,13 +20,14 @@ class cPlayback
|
|||||||
bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, bool ac3, int duration);
|
bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, bool ac3, int duration);
|
||||||
bool Stop(void);
|
bool Stop(void);
|
||||||
bool SetAPid(unsigned short pid, bool ac3);
|
bool SetAPid(unsigned short pid, bool ac3);
|
||||||
bool SetSPid(int pid);
|
|
||||||
bool SetSpeed(int speed);
|
bool SetSpeed(int speed);
|
||||||
bool GetSpeed(int &speed) const;
|
bool GetSpeed(int &speed) const;
|
||||||
bool GetPosition(int &position, int &duration);
|
bool GetPosition(int &position, int &duration);
|
||||||
bool SetPosition(int position, bool absolute = false);
|
bool SetPosition(int position, bool absolute = false);
|
||||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
||||||
void FindAllSPids(int *spids, uint16_t *numpids, std::string *language);
|
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
|
||||||
|
bool SelectSubtitles(int pid);
|
||||||
|
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
|
||||||
//
|
//
|
||||||
cPlayback(int num = 0);
|
cPlayback(int num = 0);
|
||||||
~cPlayback();
|
~cPlayback();
|
||||||
|
@@ -459,6 +459,25 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* dummy functions for subtitles */
|
||||||
|
void cPlayback::FindAllSubs(uint16_t * /*pids*/, unsigned short * /*supp*/, uint16_t *num, std::string * /*lang*/)
|
||||||
|
{
|
||||||
|
*num = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cPlayback::SelectSubtitles(int pid)
|
||||||
|
{
|
||||||
|
printf("%s:%s pid %d\n", FILENAME, __func__, pid);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* another dummy function for DVD playback(?) */
|
||||||
|
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
|
||||||
|
{
|
||||||
|
positions.clear();
|
||||||
|
titles.clear();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
cPlayback::cPlayback(int num)
|
cPlayback::cPlayback(int num)
|
||||||
{
|
{
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#define __HAL_PLAYBACK_H
|
#define __HAL_PLAYBACK_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PLAYMODE_TS = 0,
|
PLAYMODE_TS = 0,
|
||||||
@@ -30,6 +31,9 @@ class cPlayback
|
|||||||
bool GetPosition(int &position, int &duration);
|
bool GetPosition(int &position, int &duration);
|
||||||
bool SetPosition(int position, bool absolute = false);
|
bool SetPosition(int position, bool absolute = false);
|
||||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
||||||
|
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
|
||||||
|
bool SelectSubtitles(int pid);
|
||||||
|
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
|
||||||
#if 0
|
#if 0
|
||||||
// Functions that are not used by movieplayer.cpp:
|
// Functions that are not used by movieplayer.cpp:
|
||||||
bool GetOffset(off64_t &offset);
|
bool GetOffset(off64_t &offset);
|
||||||
|
@@ -576,6 +576,24 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
|||||||
*numpida = i;
|
*numpida = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* it is unlikely that subtitle support will be implemented soon */
|
||||||
|
void cPlayback::FindAllSubs(uint16_t *, unsigned short *, uint16_t *num, std::string *)
|
||||||
|
{
|
||||||
|
*num = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cPlayback::SelectSubtitles(int)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DVD support is also unlikely... */
|
||||||
|
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
|
||||||
|
{
|
||||||
|
positions.clear();
|
||||||
|
titles.clear();
|
||||||
|
}
|
||||||
|
|
||||||
off_t cPlayback::seek_to_pts(int64_t pts)
|
off_t cPlayback::seek_to_pts(int64_t pts)
|
||||||
{
|
{
|
||||||
off_t newpos = curr_pos;
|
off_t newpos = curr_pos;
|
||||||
|
@@ -109,6 +109,9 @@ class cPlayback
|
|||||||
bool GetPosition(int &position, int &duration); /* pos: current time in ms, dur: file length in ms */
|
bool GetPosition(int &position, int &duration); /* pos: current time in ms, dur: file length in ms */
|
||||||
bool SetPosition(int position, bool absolute = false); /* position: jump in ms */
|
bool SetPosition(int position, bool absolute = false); /* position: jump in ms */
|
||||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
|
||||||
|
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
|
||||||
|
bool SelectSubtitles(int pid);
|
||||||
|
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
|
||||||
#if 0
|
#if 0
|
||||||
// Functions that are not used by movieplayer.cpp:
|
// Functions that are not used by movieplayer.cpp:
|
||||||
bool Stop(void);
|
bool Stop(void);
|
||||||
|
Reference in New Issue
Block a user