summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2010-01-09 20:56:25 +0100
committerChristian Gmeiner <christian.gmeiner@gmail.com>2010-01-09 20:56:25 +0100
commitd1ae16e9c46724dfe3be488a81e5cff3084ded99 (patch)
tree8f0e5da40c582751934cad2a1d0fbaff18637513
parent7ebd290822891494ce536126a2ee446bcd69876e (diff)
downloadvdr-plugin-dxr3-d1ae16e9c46724dfe3be488a81e5cff3084ded99.tar.gz
vdr-plugin-dxr3-d1ae16e9c46724dfe3be488a81e5cff3084ded99.tar.bz2
add first ro Accessor at cFixedLengthFrame
-rw-r--r--dxr3interface.c4
-rw-r--r--dxr3output-audio.c4
-rw-r--r--dxr3output-video.c2
-rw-r--r--dxr3syncbuffer.c16
-rw-r--r--dxr3syncbuffer.h5
5 files changed, 13 insertions, 18 deletions
diff --git a/dxr3interface.c b/dxr3interface.c
index 258e33f..0625029 100644
--- a/dxr3interface.c
+++ b/dxr3interface.c
@@ -285,8 +285,8 @@ void cDxr3Interface::PlayVideoFrame(cFixedLengthFrame* pFrame)
Lock();
- while (written < pFrame->GetCount() && count >= 0) {
- if ((count = write(m_fdVideo, pFrame->GetData() + written, pFrame->GetCount() - written)) == -1) {
+ while (written < pFrame->length() && count >= 0) {
+ if ((count = write(m_fdVideo, pFrame->GetData() + written, pFrame->length() - written)) == -1) {
// an error occured
Resuscitation();
}
diff --git a/dxr3output-audio.c b/dxr3output-audio.c
index 7c8fcab..25f40c1 100644
--- a/dxr3output-audio.c
+++ b/dxr3output-audio.c
@@ -121,10 +121,10 @@ void cDxr3AudioOutThread::PlayFrame(cFixedLengthFrame *frame)
}
// volume changes
- audioOutput->changeVolume((short *)frame->GetData(), (size_t)frame->GetCount());
+ audioOutput->changeVolume((short *)frame->GetData(), (size_t)frame->length());
}
- audioOutput->write(frame->GetData(), frame->GetCount());
+ audioOutput->write(frame->GetData(), frame->length());
}
#undef SCR
diff --git a/dxr3output-video.c b/dxr3output-video.c
index afebab9..4773853 100644
--- a/dxr3output-video.c
+++ b/dxr3output-video.c
@@ -69,7 +69,7 @@ void cDxr3VideoOutThread::Action()
m_dxr3Device->SetPts(pts);
if (m_buffer.Available() && pNext->GetData() &&
- pNext->GetCount())
+ pNext->length())
{
m_dxr3Device->PlayVideoFrame(pNext);
m_buffer.Pop();
diff --git a/dxr3syncbuffer.c b/dxr3syncbuffer.c
index db6475f..d9b7f3d 100644
--- a/dxr3syncbuffer.c
+++ b/dxr3syncbuffer.c
@@ -41,10 +41,10 @@ cFixedLengthFrame::~cFixedLengthFrame()
// ==================================
// ! setup our frame
-void cFixedLengthFrame::Init(uint32_t lenght)
+void cFixedLengthFrame::Init(uint32_t length)
{
- m_length = lenght;
- m_pData = new uint8_t[lenght];
+ this->length = length;
+ m_pData = new uint8_t[length];
// allocation ok?
if (!m_pData) {
@@ -56,11 +56,11 @@ void cFixedLengthFrame::Init(uint32_t lenght)
// ==================================
void cFixedLengthFrame::CopyFrame(const uint8_t* pStart, int length)
{
- if (length > m_length) {
+ if (length > this->length()) {
delete[] m_pData;
m_pData = new uint8_t[length];
}
- m_length = length;
+ this->length = length;
memcpy((void*) m_pData, (void*) pStart, length);
}
@@ -71,12 +71,6 @@ uint8_t* cFixedLengthFrame::GetData(void)
}
// ==================================
-int cFixedLengthFrame::GetCount(void)
-{
- return m_length;
-}
-
-// ==================================
//! constructor
cDxr3SyncBuffer::cDxr3SyncBuffer(int frameCount, int frameLength) :
cRingBuffer(frameCount, true)
diff --git a/dxr3syncbuffer.h b/dxr3syncbuffer.h
index 49ed8c6..0be8d91 100644
--- a/dxr3syncbuffer.h
+++ b/dxr3syncbuffer.h
@@ -38,7 +38,7 @@ 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),
- pts(0), m_length(0)
+ pts(0), length(0)
{}
~cFixedLengthFrame();
@@ -54,9 +54,10 @@ public:
Accessors<uint32_t> aspectratio;
Accessors<uint32_t> pts;
+ Accessors<uint32_t, ro> length;
+
private:
uint8_t* m_pData;
- int m_length;
};
// ==================================