summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2010-01-09 20:22:33 +0100
committerChristian Gmeiner <christian.gmeiner@gmail.com>2010-01-09 20:22:33 +0100
commit8bf0451b4c0bc6b9bc4a86fb0544c09c1f9b824b (patch)
tree0e8fb9d222b09ac39892d505a7d33e8d430124b9
parent65514506b381200bc0bd7ecb0c84d51fef5b23fe (diff)
downloadvdr-plugin-dxr3-8bf0451b4c0bc6b9bc4a86fb0544c09c1f9b824b.tar.gz
vdr-plugin-dxr3-8bf0451b4c0bc6b9bc4a86fb0544c09c1f9b824b.tar.bz2
there is no need to store the type of a buffer
The type is known by the used buffer.
-rw-r--r--dxr3demuxdevice.c4
-rw-r--r--dxr3syncbuffer.c8
-rw-r--r--dxr3syncbuffer.h11
3 files changed, 8 insertions, 15 deletions
diff --git a/dxr3demuxdevice.c b/dxr3demuxdevice.c
index 25d3225..0814488 100644
--- a/dxr3demuxdevice.c
+++ b/dxr3demuxdevice.c
@@ -304,7 +304,7 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts)
} else if (synchState == DXR3_DEMUX_VIDEO_SYNCHED || synchState == DXR3_DEMUX_SYNCHED) {
cDxr3Interface::instance()->setDimension(pesFrame->GetHorizontalSize(), pesFrame->GetVerticalSize());
while (!Poll(100)) {}
- cFixedLengthFrame* pTempFrame = vBuf.Push(pesFrame->GetPayload(), (int) (pesFrame->GetPayloadLength()), pts, ftVideo);
+ cFixedLengthFrame* pTempFrame = vBuf.Push(pesFrame->GetPayload(), (int) (pesFrame->GetPayloadLength()), pts);
// TODO: rework me
//if (!pTempFrame) /* Push Timeout */
@@ -329,7 +329,7 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts)
vPts = pts;
cDxr3Interface::instance()->setDimension(pesFrame->GetHorizontalSize(), pesFrame->GetVerticalSize());
- cFixedLengthFrame* pTempFrame = vBuf.Push(pesFrame->GetPayload(), (int) (pesFrame->GetPayloadLength()), pts, ftVideo);
+ cFixedLengthFrame* pTempFrame = vBuf.Push(pesFrame->GetPayload(), (int) (pesFrame->GetPayloadLength()), pts);
// TODO: rework me
//if (!pTempFrame) /* Push Timeout */
// throw (cDxr3PesFrame::PES_GENERAL_ERROR);
diff --git a/dxr3syncbuffer.c b/dxr3syncbuffer.c
index 50996f1..180cb55 100644
--- a/dxr3syncbuffer.c
+++ b/dxr3syncbuffer.c
@@ -54,15 +54,13 @@ void cFixedLengthFrame::Init(uint32_t lenght)
}
// ==================================
-void cFixedLengthFrame::CopyFrame(const uint8_t* pStart, int length,
- uint32_t pts, eFrameType type)
+void cFixedLengthFrame::CopyFrame(const uint8_t* pStart, int length, uint32_t pts)
{
if (length > m_length) {
delete[] m_pData;
m_pData = new uint8_t[length];
m_length = length;
}
- m_type = type;
m_count = length;
m_pts = pts;
memcpy((void*) m_pData, (void*) pStart, length);
@@ -180,7 +178,7 @@ bool cDxr3SyncBuffer::Poll(int TimeoutMs)
}
// ==================================
-cFixedLengthFrame* cDxr3SyncBuffer::Push(const uint8_t* pStart, int length, uint32_t pts, eFrameType type) throw (eSyncBufferException)
+cFixedLengthFrame* cDxr3SyncBuffer::Push(const uint8_t* pStart, int length, uint32_t pts) throw (eSyncBufferException)
{
int lastIndex = 0;
struct timeval tv_start, tv;
@@ -202,7 +200,7 @@ cFixedLengthFrame* cDxr3SyncBuffer::Push(const uint8_t* pStart, int length, uint
}
lastIndex = m_nextFree;
- m_pBuffer[m_nextFree].CopyFrame(pStart, length, pts, type);
+ m_pBuffer[m_nextFree].CopyFrame(pStart, length, pts);
m_pBuffer[m_nextFree].channels(UNKNOWN_CHANNEL_COUNT);
m_pBuffer[m_nextFree].samplerate(UNKNOWN_DATA_RATE);
m_pBuffer[m_nextFree].aspectratio(UNKNOWN_ASPECT_RATIO);
diff --git a/dxr3syncbuffer.h b/dxr3syncbuffer.h
index e5f5476..d14bba7 100644
--- a/dxr3syncbuffer.h
+++ b/dxr3syncbuffer.h
@@ -38,22 +38,19 @@ const uint32_t UNKNOWN_ASPECT_RATIO = 0xFFFFFFFF;
class cFixedLengthFrame : private Uncopyable {
public:
cFixedLengthFrame() : samplerate(UNKNOWN_DATA_RATE), channels(UNKNOWN_CHANNEL_COUNT), aspectratio(UNKNOWN_ASPECT_RATIO),
- m_count(0), m_length(0), m_pts(0), m_type(ftUnknown)
+ m_count(0), m_length(0), m_pts(0)
{}
~cFixedLengthFrame();
void Init(uint32_t lenght);
- void CopyFrame(const uint8_t* pStart, int length, uint32_t pts,
- eFrameType type);
+ void CopyFrame(const uint8_t* pStart, int length, uint32_t pts);
uint8_t* GetData(void);
int GetCount(void);
uint32_t GetPts(void);
void SetPts(uint32_t pts);
- eFrameType GetFrameType() { return m_type; }
-
Accessors<uint32_t> samplerate;
Accessors<uint32_t> channels;
Accessors<uint32_t> aspectratio;
@@ -64,7 +61,6 @@ private:
int m_count;
int m_length;
uint32_t m_pts;
- eFrameType m_type;
};
// ==================================
@@ -79,8 +75,7 @@ public:
~cDxr3SyncBuffer();
virtual int Available(void);
- cFixedLengthFrame* Push(const uint8_t* pStart, int length, uint32_t pts,
- eFrameType type = ftUnknown)
+ cFixedLengthFrame* Push(const uint8_t* pStart, int length, uint32_t pts)
throw (eSyncBufferException);
void Pop(void);
cFixedLengthFrame* Get(void);