[Player-cvs] kit/dbus-server/src helix-dbus-server.cpp, 1.2.2.31, 1.2.2.32 hxplayer.cpp, 1.2.2.30, 1.2.2.31
weian at helixcommunity.org weian at helixcommunity.orgUpdate of /cvsroot/player/kit/dbus-server/src
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv29693/dbus-server/src
Modified Files:
Tag: hxclient_3_1_0_atlas
helix-dbus-server.cpp hxplayer.cpp
Log Message:
synopsis:
Fix the issue that mjpeg thumbnail in avi container can not be displayed correctly.
Overview:
The color space of decoded stream can be RGB or I420, and we should do different color conversion, then solve the mjpeg thumbnail issue, we used to regarding all decoded stream as RGB.
Files Added:
None
Files Modified:
player/hxclientkit/pub/HXClientCallbacks.h
player/hxclientkit/src/platform/unix/CHXClientThumbnailUnix.cpp
player/kit/dbus-server/pub/hxplayer.h
player/kit/dbus-server/src/hxplayer.cpp
player/kit/dbus-server/src/helix-dbus-server.cpp
Image Size and Heap Use impact (Client -Only):
Little
Platforms and Profiles Affected:
platform: linux-2.2-libc6-gcc32-i586
profile: helix-client-all-defines
Distribution Libraries Affected:
<libhxclient.a> <helix-dbus-server.bin>
Distribution library impact and planned action:
<None>
Platforms and Profiles Build Verified:
Set BIF branch -> hxdbus_3_1_0_atlas
Set Target(s) -> dbus_server_with_video
Set Profile -> helix-client-all-defines
System ID -> linux-2.2-libc6-gcc32-i586
Branch:
HEAD, hxclient_3_1_0_atlas
Copyright assignment: <MUST be one of the following statements >
2. Intel has signed and delivered a Joint Copyright Assignment
to RealNetworks, and received acknowledgment that the
agreement was received.
Files Attached:
hxclient_thumbnail_mjpeg.diff
dbus_server_thumbnail_mjpeg.diff
Index: helix-dbus-server.cpp
===================================================================
RCS file: /cvsroot/player/kit/dbus-server/src/helix-dbus-server.cpp,v
retrieving revision 1.2.2.31
retrieving revision 1.2.2.32
diff -u -d -r1.2.2.31 -r1.2.2.32
--- helix-dbus-server.cpp 6 Jun 2008 18:11:41 -0000 1.2.2.31
+++ helix-dbus-server.cpp 27 Jun 2008 01:51:50 -0000 1.2.2.32
@@ -1358,20 +1358,58 @@
{
char * pRgb = new char [pThumbPicInfo->width * pThumbPicInfo->height * 3];
- retcode = rgbColourConvert.ConvertYUV420ToRgb32(pBuf,
- pBuf + pThumbPicInfo->width * pThumbPicInfo->height,
- pBuf + pThumbPicInfo->width * pThumbPicInfo->height
+ if (!strcmp ("video/X-HX-I420", pThumbPicInfo->mimeType))
+ {
+
+ retcode = rgbColourConvert.ConvertYUV420ToRgb24(pBuf,
+ pBuf + pThumbPicInfo->width * pThumbPicInfo->height,
+ pBuf + pThumbPicInfo->width * pThumbPicInfo->height
+ pThumbPicInfo->width * pThumbPicInfo->height / 4,
- pRgb, pThumbPicInfo->width, pThumbPicInfo->height);
- if(!retcode)
+ pRgb, pThumbPicInfo->width, pThumbPicInfo->height);
+ if(!retcode)
+ {
+ HX_VECTOR_DELETE (pRgb);
+ HX_VECTOR_DELETE (pBuf);
+ HX_DELETE (pThumbPicInfo);
+ return;
+ }
+ }
+
+ else if (!strcmp ("video/X-HX-RGB", pThumbPicInfo->mimeType))
{
- HX_VECTOR_DELETE (pRgb);
- HX_VECTOR_DELETE (pBuf);
- HX_DELETE (pThumbPicInfo);
- return;
+ if (pThumbPicInfo->bitsPerPixel == 32)
+ {
+ retcode = rgbColourConvert.ConvertRgb32ToRgb24 (pBuf,
+ pRgb, pThumbPicInfo->width, pThumbPicInfo->height);
+ }
+ else if (pThumbPicInfo->bitsPerPixel == 24)
+ {
+ retcode = memcpy (pRgb, pBuf, pThumbPicInfo->width * pThumbPicInfo->height * 3);
+ }
+ else
+ {
+ HX_VECTOR_DELETE (pRgb);
+ HX_VECTOR_DELETE (pBuf);
+ HX_DELETE (pThumbPicInfo);
+ return;
+ }
+
+ if(!retcode)
+ {
+ HX_VECTOR_DELETE (pRgb);
+ HX_VECTOR_DELETE (pBuf);
+ HX_DELETE (pThumbPicInfo);
+ return;
+ }
+
}
- retcode = rgbColourConvert.RGBRaw2PNG(pRgb, pThumbPicInfo->width, pThumbPicInfo->height, file);
+ else
+ {
+ return;
+ }
+
+ retcode = rgbColourConvert.ConvertRGB24ToPNG(pRgb, pThumbPicInfo->width, pThumbPicInfo->height, file);
if(retcode)
{
HX_VECTOR_DELETE (pRgb);
Index: hxplayer.cpp
===================================================================
RCS file: /cvsroot/player/kit/dbus-server/src/hxplayer.cpp,v
retrieving revision 1.2.2.30
retrieving revision 1.2.2.31
diff -u -d -r1.2.2.30 -r1.2.2.31
--- hxplayer.cpp 30 May 2008 06:00:44 -0000 1.2.2.30
+++ hxplayer.cpp 27 Jun 2008 01:51:50 -0000 1.2.2.31
@@ -1543,7 +1543,7 @@
m_clp[ind++]=255;
}
-bool CColourConvert::ConvertYUV420ToRgb32(unsigned char *src0,
+bool CColourConvert::ConvertYUV420ToRgb24(unsigned char *src0,
unsigned char *src1,
unsigned char *src2,
unsigned char *dst_ori,
@@ -1618,7 +1618,28 @@
return true;
}
-static int CColourConvert::RGBRaw2PNG(const guchar* data, int width, int height, const char* filename)
+bool CColourConvert::ConvertRgb32ToRgb24 (unsigned char *src,
+ unsigned char *dst_ori,
+ int width,
+ int height)
+{
+ if (!src || !dst_ori)
+ return false;
+
+ if (width < 0 || height < 0)
+ return false;
+
+ for (int i = 0; i < width * height; i++)
+ {
+ dst_ori [i * 3 + 0]= src [i * 4 + 2];
+ dst_ori [i * 3 + 1]= src [i * 4 + 1];
+ dst_ori [i * 3 + 2]= src [i * 4 + 0];
+ }
+
+ return true;
+}
+
+static int CColourConvert::ConvertRGB24ToPNG(const guchar* data, int width, int height, const char* filename)
{
//I'm using hardcode because i know the format of the data
GdkPixbuf* pix_buf = NULL;