[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] tools/dtdriver/apps/dtdrive Umakefil, 1.20,
From:       hychoi () helixcommunity ! org
Date:       2008-08-25 8:07:46
Message-ID: 200808250812.m7P8C1f7024901 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/datatype/tools/dtdriver/apps/dtdrive
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv4064/dtdriver/apps/dtdrive


Modified Files:
      Tag: hxclient_3_1_0_atlas
	Umakefil main.cpp 
Log Message:
Synopsis:

=============

Basically, this CR is a sub one of thumbnail generation improvement CR.

Because to generate a thumbnail image file from a video file, the color format \
conversion should be done first while creating a thumbnail image.

Also the command-line option ¡°-CC¡± which stands for color conversion is added into \
the dtdrive application.

 

Overview: 

=============

1) OnVideoBlt() method modified

In datatype/tools/decoder/video/vdecoder.cpp, OnVideoBlt() method has been modified \
to be possible to convert to any color format supported by helix.

 

2) Adding color converting command-line option into the dtdrive application

In datatype/tools/dtdriver/app/main.cpp, the color convert command-line option is \
added so it could be used like below.

 > dtdrive +u +f -DV 1 -CC RGB24 -W prisoner_450k_480x_rgb24.raw \
prisoner_450k_480x.rm

In above example, the option -CC (Color Convert) means that this video color format \
to be converted as RGB24 color format and it to be written to the \
prisoner_450k_480x_rgb24.raw file.




Index: main.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/apps/dtdrive/main.cpp,v
retrieving revision 1.31.2.1
retrieving revision 1.31.2.2
diff -u -d -r1.31.2.1 -r1.31.2.2
--- main.cpp	8 Aug 2007 20:40:04 -0000	1.31.2.1
+++ main.cpp	25 Aug 2008 08:07:44 -0000	1.31.2.2
@@ -125,6 +125,7 @@
 #define POSTDECODESORTQUEUEDEPTH_OPTION_STRING    "PDSQD"
 #define POSTDECODESORTQUEUETIMESPAN_OPTION_STRING "PDSQT"
 #define POSTDECODESORTQUEUEBYTES_OPTION_STRING    "PDSQB"
+#define COLOR_CONVERT_OPTION_STRING		"CC"		
 
 #ifdef _DEBUG
 
@@ -169,6 +170,7 @@
 #include "pckunpck.h"
 
 #include "dllpath.h"
+#include "ciddefs.h"
 
 ENABLE_DLLACCESS_PATHS(g_DTDriveAccessPath);
 
@@ -178,6 +180,7 @@
  */
 static void SetDefaultOptions(CHXHeader* pOptions);
 static void DisplayUsage(const char *argv0);
+static int ConvertCCToUINT32 (char* strColor);
 static HX_RESULT GetULONG32Option(REF(int) ArgIndex, int argc, char *argv[],
                                   REF(ULONG32) ulValue);
 static HX_RESULT AddULONG32Option(REF(int) ArgIndex, int argc, char *argv[],
@@ -355,6 +358,19 @@
                     pOptions->SetPropertyULONG32(OPTIMIZEDTRANSCODE_OPTION_NAME, 1);
             }
             else if(strcmp(pCmdOption, 
+				COLOR_CONVERT_OPTION_STRING) == 0)
+			{
+				int cc = ConvertCCToUINT32(argv[++ArgIndex]);
+				if (cc != -1) 
+				{
+					RetVal = pOptions->SetPropertyULONG32(COLOR_CONVERT_OPTION_NAME, cc);
+				}
+				else
+				{
+					RetVal = HXR_PARSE_ERROR;
+				}
+			}
+            else if(strcmp(pCmdOption, 
                            ENCODEAUDIORATETOL_OPTION_STRING) == 0)
             {
                 RetVal = AddULONG32Option(ArgIndex, argc, argv, pOptions,
@@ -1173,6 +1189,9 @@
            POSTDECODESORTQUEUETIMESPAN_OPTION_STRING, \
                HX_STREAM_MERGE_SORTER_QUEUE_TIMESPAN_LIMIT_DEFAULT);
     printf("      -%s <bytes> = set max post-decode merge sort queue size in bytes \
                (default = %lu)\n",
            POSTDECODESORTQUEUEBYTES_OPTION_STRING, \
HX_STREAM_MERGE_SORTER_QUEUE_BYTE_LIMIT_DEFAULT); +	printf("      -%s <format>   = \
convert color to specifed format, where <format> is one of the following:\n", \
COLOR_CONVERT_OPTION_STRING); +	printf("                       (I420, YV12, YVU9, \
YUY2, UYVY, RGB32, RGB24, RGB565, RGB555, RGB8, XING, ARGB32, YUVA,\n"); +	printf("   \
YUVU, BGR32, BGR24, RGB32S, RGB444, MC12, MCAM, MCS3, IGOR, DVPF)\n");  printf("\n=> \
Decryption:\n");  printf("     Options: (+ = add, - = remove)\n");
     printf("      %c = decrypt content into unprotected (clear) form\n", \
DECRYPT_OPT); @@ -1236,6 +1255,121 @@
 #endif	// _MEMPROBE_ENABLED
 }
 
+/*
+* Convert the Color Convert STRING to UINT32
+*/
+static int ConvertCCToUINT32 (char* strColor)
+{
+	UINT32 uiColor;
+
+	if (strcmp(strColor, "I420") == 0)
+	{
+		uiColor = CID_I420;
+	}
+	else if (strcmp(strColor, "YV12") == 0)
+	{
+		uiColor = CID_YV12;
+	}
+	else if (strcmp(strColor, "YUVA") == 0)
+	{
+		uiColor = CID_YUVA;
+	}
+	else if (strcmp(strColor, "YVU9") == 0)
+	{
+		uiColor = CID_YVU9;
+	}
+	else if (strcmp(strColor, "YUY2") == 0)
+	{
+		uiColor = CID_YUY2;
+	}
+	else if (strcmp(strColor, "UYVY") == 0)
+	{
+		uiColor = CID_UYVY;
+	}
+	else if (strcmp(strColor, "RGB32") == 0)
+	{
+		uiColor = CID_RGB32;
+	}
+	else if (strcmp(strColor, "RGB24") == 0)
+	{
+		uiColor = CID_RGB24;
+	}
+	else if (strcmp(strColor, "RGB565") == 0)
+	{
+		uiColor = CID_RGB565;
+	}
+	else if (strcmp(strColor, "RGB555") == 0)
+	{
+		uiColor = CID_RGB555;
+	}
+	else if (strcmp(strColor, "RGB8") == 0)
+	{
+		uiColor = CID_RGB8;
+	}
+	else if (strcmp(strColor, "XING") == 0)
+	{
+		uiColor = CID_XING;
+	}
+	else if (strcmp(strColor, "ARGB32") == 0)
+	{
+		uiColor = CID_ARGB32;
+	}
+	else if (strcmp(strColor, "YUVA") == 0)
+	{
+		uiColor = CID_YUVA;
+	}
+	else if (strcmp(strColor, "YUVU") == 0)
+	{
+		uiColor = CID_YUVU;
+	}
+	else if (strcmp(strColor, "UNKNOWN") == 0)
+	{
+		uiColor = CID_UNKNOWN;
+	}
+	else if (strcmp(strColor, "BGR32") == 0)
+	{
+		uiColor = CID_BGR32;
+	}
+	else if (strcmp(strColor, "BGR24") == 0)
+	{
+		uiColor = CID_BGR24;
+	}
+	else if (strcmp(strColor, "RGB32S") == 0)
+	{
+		uiColor = CID_RGB32S;
+	}
+	else if (strcmp(strColor, "RGB444") == 0)
+	{
+		uiColor = CID_RGB444;
+	}
+	else if (strcmp(strColor, "MC12") == 0)
+	{
+		uiColor = CID_MC12;
+	}
+	else if (strcmp(strColor, "MCAM") == 0)
+	{
+		uiColor = CID_MCAM;
+	}
+	else if (strcmp(strColor, "MCS3") == 0)
+	{
+		uiColor = CID_MCS3;
+	}
+	else if (strcmp(strColor, "IGOR") == 0)
+	{
+		uiColor = CID_IGOR;
+	}
+	else if (strcmp(strColor, "DVPF") == 0)
+	{
+		uiColor = CID_DVPF;
+	}
+	else 
+	{
+		uiColor = -1;		// something wrong <format>
+	}
+
+	return uiColor;
+}
+
 HX_RESULT GetULONG32Option(REF(int) ArgIndex, int argc, char *argv[],
                            REF(ULONG32) ulValue)
 {

Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/apps/dtdrive/Umakefil,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -u -d -r1.20 -r1.20.2.1
--- Umakefil	11 Jul 2007 16:41:05 -0000	1.20
+++ Umakefil	25 Aug 2008 08:07:44 -0000	1.20.2.1
@@ -4,6 +4,7 @@
 
 project.AddModuleIncludes("common/include",
                           "producersdk/include",
+			  "video/include",
                           "common/log/logobserverfile/pub")
 
 project.AddModuleLibraries( "datatype/tools/dtdriver/common[dtdrcomlib]",
@@ -24,6 +25,7 @@
 			    "common/util[utillib]", 
 			    "common/container[contlib]",
 			    "common/system[syslib]",
+			    "video/vidutil[vidutillib]",
 			    "common/fileio[fileiolib]",
 			    "common/log/logutil[logutillib]")
 


_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic