Skip to content
Browse files

Backport r25061 from trunk.

MythZoneMinder: Fix the colors of the live images when using a V4L2 source
in ZM 1.24. Refs #8182.


git-svn-id: http://svn.mythtv.org/svn/branches/release-0-23-fixes@25065 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent 46ada0c commit 62f6f34644223f9f064362efc65284a9a11bfe70 Paul Harrison committed Jun 9, 2010
View
16 mythplugins/mythzoneminder/mythzoneminder/zmclient.cpp
@@ -665,9 +665,21 @@ void ZMClient::getMonitorList(vector<Monitor*> *monitorList)
item->zmaStatus = "";
item->events = 0;
item->status = "";
+ item->isV4L2 = (item->palette > 255);
monitorList->push_back(item);
- VERBOSE(VB_IMPORTANT, QString("Monitor: %1 (%2) is using palette: %3")
- .arg(item->name).arg(item->id).arg(item->palette));
+ if (item->isV4L2)
+ {
+ QString pallete;
+ pallete = (char) (item->palette & 0xff);
+ pallete += (char) ((item->palette >> 8) & 0xff);
+ pallete += (char) ((item->palette >> 16) & 0xff);
+ pallete += (char) ((item->palette >> 24) & 0xff);
+ VERBOSE(VB_IMPORTANT, QString("Monitor: %1 (%2) is using palette: %3 (%4)")
+ .arg(item->name).arg(item->id).arg(item->palette).arg(pallete));
+ }
+ else
+ VERBOSE(VB_IMPORTANT, QString("Monitor: %1 (%2) is using palette: %3")
+ .arg(item->name).arg(item->id).arg(item->palette));
}
}
View
1 mythplugins/mythzoneminder/mythzoneminder/zmdefines.h
@@ -61,6 +61,7 @@ typedef struct
int width;
int height;
int palette;
+ bool isV4L2;
} Monitor;
#endif
View
18 mythplugins/mythzoneminder/mythzoneminder/zmliveplayer.cpp
@@ -450,10 +450,20 @@ void Player::updateFrame(const unsigned char* buffer)
r = buffer[pos_data++];
g = buffer[pos_data++];
b = buffer[pos_data++];
- m_rgba[pos_rgba++] = b;
- m_rgba[pos_rgba++] = g;
- m_rgba[pos_rgba++] = r;
- m_rgba[pos_rgba++] = 0xff;
+ if (m_monitor.isV4L2)
+ {
+ m_rgba[pos_rgba++] = g;
+ m_rgba[pos_rgba++] = r;
+ m_rgba[pos_rgba++] = b;
+ m_rgba[pos_rgba++] = 0xff;
+ }
+ else
+ {
+ m_rgba[pos_rgba++] = b;
+ m_rgba[pos_rgba++] = g;
+ m_rgba[pos_rgba++] = r;
+ m_rgba[pos_rgba++] = 0xff;
+ }
}
}

0 comments on commit 62f6f34

Please sign in to comment.
Something went wrong with that request. Please try again.