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

List:       helix-common-dev
Subject:    [Common-dev] RE: [datatype-dev] CR : Modifications to allow loading
From:       "Eric Hyche" <ehyche () real ! com>
Date:       2009-05-11 21:28:13
Message-ID: 00d801c9d27f$644fa2f0$2ceee8d0$ () com
[Download RAW message or body]

Umakant,

+    UINT32 len1 = 0;
+	UINT32 len2 = 0;
+	char *pszProtocolName=NULL;
+	char *pch=NULL;
+	pch = strstr(pszFileName,"://");
+	if(pch)
+	{
+		len2 = strlen(pszFileName);
+		len1 = strlen(pch);
+		pszProtocolName = new char[len2-len1];
+		pszProtocolName = strncpy(pszProtocolName,pszFileName,(len2-len1));
+		pszProtocolName[(len2-len1)]='\0';
+	}


Instead of parsing the URL yourself, you should use the CHXURL class in \
common/util/pub/hxurl.h to obtain the protocol.

+	if(pszProtocolName)
+	{
+		res = FindPluginForFile(pUnknown,
+			    PLUGIN_FILEWRITER_TYPE,
+			    pszFileName,
+			    ulSelectionIndex,
+			    pszProtocolName);
+	}
+	else
+	{
+		res = FindPluginForFile(pUnknown,
 			    PLUGIN_FILEWRITER_TYPE,
 			    pszFileName,
 			    ulSelectionIndex);
-
+	}

There's no need for a separate else{} clause here. Just pass pszProtocolName all the \
time. If it's NULL, then FindPluginForFile() knows how to deal with a NULL value.

Eric

=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.


> -----Original Message-----
> From: datatype-dev-bounces@helixcommunity.org \
> [mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of Umakant Gundeli
> Sent: Monday, May 11, 2009 4:26 PM
> To: client-dev@helixcommunity.org; common-dev@helixcommunity.org; \
>                 datatype-dev@helixcommunity.org
> Subject: [datatype-dev] CR : Modifications to allow loading of a filewriter based \
> on its protocol scheme.
> 
> Synopsis : Loading a filewriter based on the protocol scheme that it claims.
> 
> 
> 
> Overview : Currently a file writer is loaded based on only the file extension of \
> output file. 
> With these changes filewriters which claim protocol schemes (example: rtp://, \
> srtp:// , etc) can be loaded.
> 
> 
> 
> Files Modified :
> 
> Datatype/tools/minicntx/minicntx.cpp
> 
> 
> 
> BIF Branch :  HEAD
> 
> Profile : helix-client-all-defines
> 
> 
> 
> DIFF is attached with this email.
> 
> 
> 
> Thank you,
> 
> 
> 
> - Umakant.
> 
> 



_______________________________________________
Common-dev mailing list
Common-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/common-dev


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

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