mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +02:00
Drop vdr code, use ffmpeg dvb sub decoder. atm patched ffmpeg used
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@153 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 83e422bfea
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-01-11 (Mon, 11 Jan 2010)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -8,4 +8,4 @@ AM_CPPFLAGS = -fno-rtti -fno-exceptions
|
||||
noinst_LIBRARIES = libdvbsub.a
|
||||
|
||||
libdvbsub_a_SOURCES = dvbsub.cpp dvbsubtitle.cpp \
|
||||
tools.cpp osd.cpp PacketQueue.cpp helpers.cpp Debug.cpp
|
||||
tools.cpp PacketQueue.cpp helpers.cpp Debug.cpp
|
||||
|
@@ -149,6 +149,41 @@ int dvbsub_close()
|
||||
|
||||
static cDemux * dmx;
|
||||
|
||||
|
||||
void dvbsub_get_stc(int64_t * STC)
|
||||
{
|
||||
if(dmx)
|
||||
dmx->getSTC(STC);
|
||||
}
|
||||
|
||||
static int64_t get_pts(unsigned char * packet)
|
||||
{
|
||||
int64_t pts;
|
||||
int pts_dts_flag;
|
||||
|
||||
pts_dts_flag = getbits(packet, 7*8, 2);
|
||||
if ((pts_dts_flag == 2) || (pts_dts_flag == 3)) {
|
||||
pts = (uint64_t)getbits(packet, 9*8+4, 3) << 30; /* PTS[32..30] */
|
||||
pts |= getbits(packet, 10*8, 15) << 15; /* PTS[29..15] */
|
||||
pts |= getbits(packet, 12*8, 15); /* PTS[14..0] */
|
||||
} else {
|
||||
pts = 0;
|
||||
}
|
||||
return pts;
|
||||
}
|
||||
|
||||
#define LimitTo32Bit(n) (n & 0x00000000FFFFFFFFL)
|
||||
|
||||
static int64_t get_pts_stc_delta(int64_t pts)
|
||||
{
|
||||
int64_t stc, delta;
|
||||
|
||||
dvbsub_get_stc(&stc);
|
||||
delta = LimitTo32Bit(pts) - LimitTo32Bit(stc);
|
||||
delta /= 90;
|
||||
return delta;
|
||||
}
|
||||
|
||||
void* reader_thread(void * /*arg*/)
|
||||
{
|
||||
uint8_t tmp[16]; /* actually 6 should be enough */
|
||||
@@ -243,7 +278,7 @@ void* reader_thread(void * /*arg*/)
|
||||
}
|
||||
}
|
||||
if(!dvbsub_paused) {
|
||||
sub_debug.print(Debug::VERBOSE, "[subtitles] adding packet, len %d buf 0x%x\n", count, buf);
|
||||
sub_debug.print(Debug::VERBOSE, "[subtitles] ******************* new packet, len %d buf 0x%x pts-stc diff %lld *******************\n", count, buf, get_pts_stc_delta(get_pts(buf)));
|
||||
/* Packet now in memory */
|
||||
packet_queue.push(buf);
|
||||
/* TODO: allocation exception */
|
||||
@@ -337,6 +372,7 @@ void* dvbsub_thread(void* /*arg*/)
|
||||
}
|
||||
packlen = (packet[4] << 8 | packet[5]) + 6;
|
||||
|
||||
#if 0
|
||||
/* Get PTS */
|
||||
pts_dts_flag = getbits(packet, 7*8, 2);
|
||||
if ((pts_dts_flag == 2) || (pts_dts_flag == 3)) {
|
||||
@@ -346,6 +382,8 @@ void* dvbsub_thread(void* /*arg*/)
|
||||
} else {
|
||||
pts = 0;
|
||||
}
|
||||
#endif
|
||||
pts = get_pts(packet);
|
||||
|
||||
dataoffset = packet[8] + 8 + 1;
|
||||
if (packet[dataoffset] != 0x20) {
|
||||
@@ -356,9 +394,9 @@ void* dvbsub_thread(void* /*arg*/)
|
||||
goto next_round;
|
||||
}
|
||||
|
||||
sub_debug.print(Debug::VERBOSE, "PES packet: len %d PTS=%Ld (%02d:%02d:%02d.%d)\n",
|
||||
packlen, pts, (int)(pts/324000000), (int)((pts/5400000)%60),
|
||||
(int)((pts/90000)%60), (int)(pts%90000));
|
||||
sub_debug.print(Debug::VERBOSE, "PES packet: len %d data len %d PTS=%Ld (%02d:%02d:%02d.%d) diff %lld\n",
|
||||
packlen, packlen - (dataoffset + 2), pts, (int)(pts/324000000), (int)((pts/5400000)%60),
|
||||
(int)((pts/90000)%60), (int)(pts%90000), get_pts_stc_delta(pts));
|
||||
|
||||
if (packlen <= dataoffset + 3) {
|
||||
sub_debug.print(Debug::INFO, "Packet too short, discard\n");
|
||||
@@ -382,9 +420,3 @@ next_round:
|
||||
sub_debug.print(Debug::VERBOSE, "%s shutdown\n", __FUNCTION__);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
void dvbsub_get_stc(int64_t * STC)
|
||||
{
|
||||
if(dmx)
|
||||
dmx->getSTC(STC);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -12,26 +12,27 @@
|
||||
#ifndef __DVBSUBTITLE_H
|
||||
#define __DVBSUBTITLE_H
|
||||
|
||||
#include "osd.h"
|
||||
extern "C" {
|
||||
#include <unistd.h>
|
||||
#include <linux/fb.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavutil/avutil.h>
|
||||
}
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
class cDvbSubtitlePage;
|
||||
class cDvbSubtitleAssembler; // for legacy PES recordings
|
||||
class cDvbSubtitleBitmaps;
|
||||
|
||||
class cDvbSubtitleConverter /*: public cThread */{
|
||||
private:
|
||||
static int setupLevel;
|
||||
cDvbSubtitleAssembler *dvbSubtitleAssembler;
|
||||
// cOsd *osd;
|
||||
cList<cDvbSubtitlePage> *pages;
|
||||
cList<cDvbSubtitleBitmaps> *bitmaps;
|
||||
tColor yuv2rgb(int Y, int Cb, int Cr);
|
||||
bool AssertOsd(void);
|
||||
int ExtractSegment(const uchar *Data, int Length, int64_t Pts);
|
||||
void FinishPage(cDvbSubtitlePage *Page);
|
||||
bool running;
|
||||
pthread_mutex_t mutex;
|
||||
cList<cDvbSubtitleBitmaps> *bitmaps;
|
||||
AVCodecContext * avctx;
|
||||
AVCodec * avcodec;
|
||||
public:
|
||||
cDvbSubtitleConverter(void);
|
||||
virtual ~cDvbSubtitleConverter();
|
||||
@@ -41,9 +42,7 @@ public:
|
||||
void Pause(bool pause);
|
||||
void Lock();
|
||||
void Unlock();
|
||||
int ConvertFragments(const uchar *Data, int Length, int64_t pts); // for legacy PES recordings
|
||||
int Convert(const uchar *Data, int Length, int64_t pts);
|
||||
static void SetupChanged(void);
|
||||
bool Running() { return running; };
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user