diff options
author | phintuka <phintuka> | 2010-02-03 00:13:10 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2010-02-03 00:13:10 +0000 |
commit | a9109c232d3b368f5a84545d63b0f93983bb35f5 (patch) | |
tree | 9297e593175fbf9334ec38e6572331ddc9f992eb | |
parent | 71ad6e150272a79cd78bc6ec748c34758e9655af (diff) | |
download | xineliboutput-a9109c232d3b368f5a84545d63b0f93983bb35f5.tar.gz xineliboutput-a9109c232d3b368f5a84545d63b0f93983bb35f5.tar.bz2 |
Parse video size from ts stream
-rw-r--r-- | device.c | 21 | ||||
-rw-r--r-- | device.h | 8 |
2 files changed, 20 insertions, 9 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.c,v 1.91 2010-02-01 12:20:01 phintuka Exp $ + * $Id: device.c,v 1.92 2010-02-03 00:13:10 phintuka Exp $ * */ @@ -214,6 +214,7 @@ cXinelibDevice::cXinelibDevice() m_h264 = false; m_VideoSize = (video_size_t*)calloc(1, sizeof(video_size_t)); + m_tssVideoSize = NULL; TsBufferClear(); } @@ -227,6 +228,7 @@ cXinelibDevice::~cXinelibDevice() m_pInstance = NULL; free (m_VideoSize); + ts_state_dispose(m_tssVideoSize); } bool cXinelibDevice::StartDevice() @@ -1189,12 +1191,19 @@ int cXinelibDevice::PlayTsVideo(const uchar *Data, int Length) if (!AcceptVideoPacket(Data, Length)) return Length; - if (m_StreamStart) { - //if (ts_get_video_size(Data, Length, m_VideoSize, m_h264 ? 1:0)) { + if (m_StreamStart /*&& TS_PID(Data) == m_PatPmtParser.VPid()*/) { + if (!m_tssVideoSize) + m_tssVideoSize = ts_state_init(4096); + + if (ts_get_video_size(m_tssVideoSize, Data, m_VideoSize, m_h264 ? 1:0)) { + m_StreamStart = false; - //LOGDBG("Detected video size %dx%d", m_VideoSize->width, m_VideoSize->height); - //ForEach(m_clients, &cXinelibThread::SetHDMode, (m_VideoSize->width > 800)); - //} + LOGMSG("Detected video size %dx%d", m_VideoSize->width, m_VideoSize->height); + ForEach(m_clients, &cXinelibThread::SetHDMode, (m_VideoSize->width > 800)); + + ts_state_dispose(m_tssVideoSize); + m_tssVideoSize = NULL; + } } return PlayTsAny(Data, Length); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.h,v 1.50 2010-02-01 12:20:01 phintuka Exp $ + * $Id: device.h,v 1.51 2010-02-03 00:13:10 phintuka Exp $ * */ @@ -21,6 +21,7 @@ class cChannel; class cFunctor; struct video_size_s; +struct ts_state_s; typedef enum { miTitle = 0, @@ -32,8 +33,8 @@ typedef enum { mi_Count = 6 } eMetainfoType; -# define ttXSubtitleNone (-2) -# define ttXSubtitleAuto (-1) +#define ttXSubtitleNone (-2) +#define ttXSubtitleAuto (-1) #define MAX_METAINFO_LEN 63 @@ -116,6 +117,7 @@ class cXinelibDevice : public cDevice virtual eVideoSystem GetVideoSystem(void); struct video_size_s *m_VideoSize; + struct ts_state_s *m_tssVideoSize; #if VDRVERSNUM >= 10708 virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect); #endif |