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

List:       helix-datatype-dev
Subject:    [datatype-dev] CR:-Fixed thumbnail generation failure in helix HEAD
From:       <saleem.adookkattil () nokia ! com>
Date:       2010-01-21 21:40:38
Message-ID: 19113978AB61DA44AC317B211CF1C32A26B6EBBB20 () NOK-EUMSG-02 ! mgdnok ! nokia ! com
[Download RAW message or body]

"Nokia submits this code under the terms of a commercial contribution agreement with \
Real Networks, and I am authorized to contribute this code under said agreement."

Modified by: saleem.adookkattil@nokia.com

Reviewed by:

Date: 01/21/2010

Project: symbianMmf_wm

ErrorId: N/A

Synopsis: Fixed thumbnail generation failure in helix HEAD and hxclient_4_2_0_brizo \
when asynchronous file reading is enabled.

Overview: Thumbnail generation in hxclient_2_1_0_cayennes works fine when \
asynchronous file reading is enabled. Then the following changes cause the failure in \
helix head/hxclient_4_2_0_brizo.

1) New interface introduced to handle 64bit file reading IHXMMFDataSource2 - \
CHXSymbianMetaDataEng::QueryInterface failed to return IHXMMFDataSource2 this \
interface pointer. Modified QueryInterface method to return this interface.

2) Asynchronous file reading needed the current thread to return to active object \
scheduler in order to run file read active object. hxclient_2_1_0_cayennes branch \
source has new State_RecognizeFormatPending switch case to handle it. Added this case \
to fix it.

3) Changes made to helix head/hxclient_4_2_0_brizo dtdriver context method \
MiniContext::FindPluginForFile - Logical condition to find the file format plugin in \
hxclient_2_1_0_cayennes branch uses only the mime type. Changes made to    \
MiniContext::FindPluginForFile method uses both mime type and file extension. Fixed \
this failure by not passing file name to the method.

4) STDMETHODIMP CHXTNEngine::OnTermination(HX_RESULT status) method call with \
HX_CLOSE status and setting m_LastError to HX_CLOSE failed to process packet in \
CHXTNEngine::OnPacket. Added condition to not to set this value.

5) Missing thumbnail utility implementation - Added hxtnutil_impl.cpp, hxtnutil.cpp \
and path../engine/pub/platform/symbian to symbian.pcf file to have thumbnail utility \
implementation.

In addition made changes to CHXSymbianMetaDataEng class implementation to pass actual \
file instead of dummy file to FFDriver instance.

Files modified:

cvsroot\datatype\tools\metadataeng\engine\platform\symbian\symbian_metadataeng.cpp
cvsroot\datatype\tools\metadataeng\engine\platform\symbian\symbian_thumbnaileng.cpp
cvsroot\datatype\tools\dtdriver\engine\ffdriver.cpp
cvsroot\datatype\tools\metadataeng\utility\symbian.pcf

Files added: None

Image Size and Heap Use impact: None.

Module Release testing (STIF) :  N/A

Test case(s) Added  : No

Memory leak check performed : Yes

Platforms and Profiles Build Verified: helix-client-s60-52-mmf-mdf-dsp

Platforms and Profiles Functionality verified: armv5, winscw

Branch: 4_2_0_brizo, HEAD

Index: symbian.pcf
===================================================================
RCS file: /cvsroot/datatype/tools/metadataeng/utility/symbian.pcf,v
retrieving revision 1.4
diff -u -w -r1.4 symbian.pcf
--- symbian.pcf 6 Jul 2007 22:02:07 -0000       1.4
+++ symbian.pcf 20 Jan 2010 02:03:06 -0000
@@ -60,4 +60,10 @@

 project.AddSources("platform/symbian/hxmetadatautil.cpp")

+project.AddIncludes("../engine/pub/platform/symbian")
+
+if project.IsDefined('HELIX_FEATURE_DTDR_THUMBNAIL'):
+        project.AddSources("platform/symbian/hxtnutil.cpp",
+                           "platform/symbian/hxtnutil_impl.cpp")
+


Index: ffdriver.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v
retrieving revision 1.59
diff -u -w -r1.59 ffdriver.cpp
--- ffdriver.cpp        11 Feb 2009 17:22:21 -0000      1.59
+++ ffdriver.cpp        20 Jan 2010 02:23:07 -0000
@@ -836,6 +836,7 @@
         switch (m_state)
         {
             case State_InitFileObjectDonePending:
+            case State_RecognizeFormatPending:
             case State_InitFileFormatDonePending:
             case State_FileHeaderDonePending:
             case State_StreamHeadersDonePending:
@@ -1037,7 +1038,7 @@
                 const char *pMimeType = NULL;
                 pMimeType = m_strMimeType;
                 status = m_pContext->FindFileFormat(m_pFileFormat,
-                                m_pInputFileName,
+                                NULL,
                                 m_ulFormatAttemptCount,
                                 NULL,
                                 (char *)pMimeType);

Index: symbian_thumbnaileng.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/metadataeng/engine/platform/symbian/symbian_thumbnaileng.cpp,v
 retrieving revision 1.4.14.1
diff -u -w -r1.4.14.1 symbian_thumbnaileng.cpp
--- symbian_thumbnaileng.cpp    9 Oct 2009 20:33:45 -0000       1.4.14.1
+++ symbian_thumbnaileng.cpp    20 Jan 2010 02:24:49 -0000
@@ -226,7 +226,7 @@

 {
     m_pFFDriver->OnTermination(status);
-    if (status != HXR_OK)
+    if (status != HXR_OK && status != HXR_CLOSED)
     {
        m_LastError = status;
     }


Index: symbian_metadataeng.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/metadataeng/engine/platform/symbian/symbian_metadataeng.cpp,v
 retrieving revision 1.12
diff -u -w -r1.12 symbian_metadataeng.cpp
--- symbian_metadataeng.cpp     1 Sep 2009 21:44:59 -0000       1.12
+++ symbian_metadataeng.cpp     20 Jan 2010 02:49:34 -0000
@@ -67,7 +67,8 @@

 static const int KMinMetaDataStartupMemory = 512*1024;

-const char * const METADATA_DUMMYSOURCE_NAME = "file://c:\\dummy.3gp";
+_LIT(KFileScheme, "file://");
+const char * const METADATA_DUMMYFILE_NAME = "c:\\dummy.3gp";

 #include "symbian_dll_map_inst.h"
 #include "symbian_dll_map.h"
@@ -199,7 +200,11 @@
         AddRef();
         return HXR_OK;
        }
-       else if ( IsEqualIID(riid, IID_IHXMMFDataSource) && (m_pDataSource) )
+               else if ( (IsEqualIID(riid, IID_IHXMMFDataSource)
+#ifdef HELIX_FEATURE_64_BIT_FILE_SUPPORT
+                         || IsEqualIID(riid, IID_IHXMMFDataSource2)
+#endif
+                         ) && (m_pDataSource) )
        {
            res = m_pDataSource->QueryInterface(riid, ppvObj);
        }
@@ -271,27 +276,38 @@

 STDMETHODIMP CHXSymbianMetaDataEng::OpenSource(CHXMediaSource &aMediaSource)
 {
-    HX_RESULT hxr;
-
-    if (!m_pFFDriver)
+    HX_RESULT hxr = HXR_NOT_INITIALIZED;
+    if (m_pFFDriver)
+    {
+        hxr = HXR_NOT_SUPPORTED;
+        if (aMediaSource.m_pData)
     {
-        return HXR_NOT_INITIALIZED;
-    }
-
-    HX_RELEASE(m_pDataSource);
     m_pDataSource = CHXDataSourceFactory::Build(aMediaSource, TRUE /* bPeek */);

-    MD_LOG("CHXSymbianMetaDataEng::OpenSource m_pDataSource=%p\n",
-            m_pDataSource);
+            MD_LOG("CHXSymbianMetaDataEng::OpenSource m_pDataSource=%p\n", \
m_pDataSource);

     if (m_pDataSource)
     {
         HX_ADDREF(m_pDataSource);
-        hxr = DoOpenSource(METADATA_DUMMYSOURCE_NAME);
+                if ( aMediaSource.mType == CHXMediaSource::ERFile)
+                {
+                    RFile* pFile = (RFile*)aMediaSource.m_pData;
+                    TBuf<KMaxFileName> FileName;
+                    if ( KErrNone == pFile->FullName(FileName) )
+                    {
+                        hxr = DoOpenSource((const char*)(FileName.PtrZ()));
     }
-    else
+                }
+                else if ( aMediaSource.mType == CHXMediaSource::EFileName)
     {
-        hxr = HXR_NOT_SUPPORTED;
+                    hxr = DoOpenSource((const char*)(aMediaSource.m_pData));
+                }
+                else if ( aMediaSource.mType == CHXMediaSource::EDescriptor )
+                {
+                    hxr = DoOpenSource(METADATA_DUMMYFILE_NAME);
+                }
+            }
+        }
     }

     return hxr;
@@ -300,15 +316,13 @@
 // Checks if content is protected and can't be played.
 // content is passed to FFDriver if required.

-STDMETHODIMP CHXSymbianMetaDataEng::DoOpenSource(const char *pName)
+STDMETHODIMP CHXSymbianMetaDataEng::DoOpenSource(const char *pFileName)
 {
     MD_LOG("CHXSymbianMetaDataEng::DoOpenSource\n");

     HX_RESULT hxr = HXR_OK;
-
     m_LastError = HXR_OK;

-
     m_bProtectedAndCantPlay = IsProtected(*m_pDataSource) && \
(!CanPlay(*m_pDataSource));

     if (m_bProtectedAndCantPlay)
@@ -327,14 +341,24 @@
     }
     else
     {
-
-        hxr = m_pFFDriver->Drive((char*)pName, NULL);
-
+        // Generate File URL using File name
+        HBufC8 *pFileURL = HBufC8::New(strlen(pFileName) + \
((TDesC8&)KFileScheme).Length() + 1); +        if (pFileURL)
+        {
+           pFileURL->Des().Copy(KFileScheme);
+           pFileURL->Des().Append((const TUint8*)pFileName, strlen(pFileName));
+           hxr = m_pFFDriver->Drive((char*)pFileURL->Des().PtrZ(), NULL);
+           delete pFileURL;
            if (hxr == HXR_OK)
            {
               hxr = m_LastError;
            }
          }
+         else
+         {
+            hxr = HXR_OUTOFMEMORY;
+         }
+    }

     MD_LOG("CHXSymbianMetaDataEng::DoOpenSource hxr=%d\n", hxr);
     return hxr;


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 \
2px solid; } --></style> </head>
<body>
<font face="Georgia, serif" size="2">
<div>&quot;Nokia submits this code under the terms of a commercial contribution \
agreement with Real Networks, and I am authorized to contribute this code under said \
agreement.&quot;</div> <div>&nbsp;</div>
<div>Modified by: saleem.adookkattil@nokia.com</div>
<div>&nbsp;</div>
<div>Reviewed by:</div>
<div>&nbsp;</div>
<div>Date: 01/21/2010</div>
<div>&nbsp;</div>
<div>Project: symbianMmf_wm</div>
<div>&nbsp;</div>
<div>ErrorId: N/A</div>
<div>&nbsp;</div>
<div>Synopsis: Fixed thumbnail generation failure in helix HEAD and \
hxclient_4_2_0_brizo when asynchronous file reading is enabled.</div> \
<div>&nbsp;</div> <div>Overview: Thumbnail generation in hxclient_2_1_0_cayennes \
works fine when asynchronous file reading is enabled. Then the following changes \
cause the failure in helix head/hxclient_4_2_0_brizo.</div> <div>&nbsp;</div>
<div>1) New interface introduced to handle 64bit file reading IHXMMFDataSource2 - \
CHXSymbianMetaDataEng::QueryInterface failed to return IHXMMFDataSource2 this \
interface pointer. Modified QueryInterface method to return this interface.</div> \
<div>&nbsp;</div> <div>2) Asynchronous file reading needed the current thread to \
return to active object scheduler in order to run file read active object. \
hxclient_2_1_0_cayennes branch source has new State_RecognizeFormatPending switch \
case to handle it. Added this case to fix it.</div>
<div>&nbsp;</div>
<div>3) Changes made to helix head/hxclient_4_2_0_brizo dtdriver context method \
MiniContext::FindPluginForFile - Logical condition to find the file format plugin in \
hxclient_2_1_0_cayennes branch uses only the mime type. Changes made \
to&nbsp;&nbsp;&nbsp; MiniContext::FindPluginForFile method uses both mime type and \
file extension. Fixed this failure by not passing file name to the method. </div> \
<div>&nbsp;</div> <div>4) STDMETHODIMP CHXTNEngine::OnTermination(HX_RESULT status) \
method call with HX_CLOSE status and setting m_LastError to HX_CLOSE failed to \
process packet in CHXTNEngine::OnPacket. Added condition to not to set this \
value.</div> <div>&nbsp;</div>
<div>5) Missing thumbnail utility implementation - Added hxtnutil_impl.cpp, \
hxtnutil.cpp and path../engine/pub/platform/symbian to symbian.pcf file to have \
thumbnail utility implementation.</div> <div>&nbsp;</div>
<div>In addition made changes to CHXSymbianMetaDataEng class implementation to pass \
actual file instead of dummy file to FFDriver instance.</div> <div>&nbsp;</div>
<div>Files modified:</div>
<div>&nbsp;</div>
<div>cvsroot\datatype\tools\metadataeng\engine\platform\symbian\symbian_metadataeng.cpp</div>
 <div>cvsroot\datatype\tools\metadataeng\engine\platform\symbian\symbian_thumbnaileng.cpp</div>
 <div>cvsroot\datatype\tools\dtdriver\engine\ffdriver.cpp</div>
<div>cvsroot\datatype\tools\metadataeng\utility\symbian.pcf</div>
<div>&nbsp;</div>
<div>Files added: None</div>
<div>&nbsp;</div>
<div>Image Size and Heap Use impact: None.</div>
<div>&nbsp;</div>
<div>Module Release testing (STIF) :&nbsp; N/A</div>
<div>&nbsp;</div>
<div>Test case(s) Added&nbsp; : No</div>
<div>&nbsp;</div>
<div>Memory leak check performed : Yes</div>
<div>&nbsp;</div>
<div>Platforms and Profiles Build Verified: helix-client-s60-52-mmf-mdf-dsp</div>
<div>&nbsp;</div>
<div>Platforms and Profiles Functionality verified: armv5, winscw</div>
<div>&nbsp;</div>
<div>Branch: 4_2_0_brizo, HEAD</div>
<div>&nbsp;</div>
<div>Index: symbian.pcf</div>
<div>===================================================================</div>
<div>RCS file: /cvsroot/datatype/tools/metadataeng/utility/symbian.pcf,v</div>
<div>retrieving revision 1.4</div>
<div>diff -u -w -r1.4 symbian.pcf</div>
<div>--- symbian.pcf 6 Jul 2007 22:02:07 -0000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
1.4</div> <div>&#43;&#43;&#43; symbian.pcf 20 Jan 2010 02:03:06 -0000</div>
<div>@@ -60,4 &#43;60,10 @@</div>
<div>&nbsp;</div>
<div> project.AddSources(&quot;platform/symbian/hxmetadatautil.cpp&quot;)</div>
<div>&nbsp;</div>
<div>&#43;project.AddIncludes(&quot;../engine/pub/platform/symbian&quot;)</div>
<div>&#43;</div>
<div>&#43;if project.IsDefined('HELIX_FEATURE_DTDR_THUMBNAIL'):</div>
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
project.AddSources(&quot;platform/symbian/hxtnutil.cpp&quot;,</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&quot;platform/symbian/hxtnutil_impl.cpp&quot;)</div> <div>&#43;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Index: ffdriver.cpp</div>
<div>===================================================================</div>
<div>RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v</div>
<div>retrieving revision 1.59</div>
<div>diff -u -w -r1.59 ffdriver.cpp</div>
<div>--- ffdriver.cpp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 11 Feb 2009 17:22:21 \
-0000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.59</div> <div>&#43;&#43;&#43; \
ffdriver.cpp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 20 Jan 2010 02:23:07 \
-0000</div> <div>@@ -836,6 &#43;836,7 @@</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch (m_state)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case \
State_InitFileObjectDonePending:</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case \
State_RecognizeFormatPending:</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case \
State_InitFileFormatDonePending:</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case \
State_FileHeaderDonePending:</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case \
State_StreamHeadersDonePending:</div> <div>@@ -1037,7 &#43;1038,7 @@</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
const char *pMimeType = NULL;</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
pMimeType = m_strMimeType;</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
status = m_pContext-&gt;FindFileFormat(m_pFileFormat, </div> \
<div>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
m_pInputFileName,</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
NULL,</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
m_ulFormatAttemptCount,</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
NULL,</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
(char *)pMimeType);</div> <div>&nbsp;</div>
<div>Index: symbian_thumbnaileng.cpp</div>
<div>===================================================================</div>
<div>RCS file: /cvsroot/datatype/tools/metadataeng/engine/platform/symbian/symbian_thumbnaileng.cpp,v</div>
 <div>retrieving revision 1.4.14.1</div>
<div>diff -u -w -r1.4.14.1 symbian_thumbnaileng.cpp</div>
<div>--- symbian_thumbnaileng.cpp&nbsp;&nbsp;&nbsp; 9 Oct 2009 20:33:45 \
-0000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.4.14.1</div> <div>&#43;&#43;&#43; \
symbian_thumbnaileng.cpp&nbsp;&nbsp;&nbsp; 20 Jan 2010 02:24:49 -0000</div> <div>@@ \
-226,7 &#43;226,7 @@</div> <div>&nbsp;</div>
<div> {</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; m_pFFDriver-&gt;OnTermination(status);</div>
<div>-&nbsp;&nbsp;&nbsp; if (status != HXR_OK)</div>
<div>&#43;&nbsp;&nbsp;&nbsp; if (status != HXR_OK &amp;&amp; status != \
HXR_CLOSED)</div> <div>&nbsp;&nbsp;&nbsp;&nbsp; {</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_LastError = status;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; \
}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
</div> <div>&nbsp;</div>
<div>&nbsp;</div>
<div>Index: symbian_metadataeng.cpp</div>
<div>===================================================================</div>
<div>RCS file: /cvsroot/datatype/tools/metadataeng/engine/platform/symbian/symbian_metadataeng.cpp,v</div>
 <div>retrieving revision 1.12</div>
<div>diff -u -w -r1.12 symbian_metadataeng.cpp</div>
<div>--- symbian_metadataeng.cpp&nbsp;&nbsp;&nbsp;&nbsp; 1 Sep 2009 21:44:59 \
-0000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.12</div> <div>&#43;&#43;&#43; \
symbian_metadataeng.cpp&nbsp;&nbsp;&nbsp;&nbsp; 20 Jan 2010 02:49:34 -0000</div> \
<div>@@ -67,7 &#43;67,8 @@</div> <div>&nbsp;</div>
<div> static const int KMinMetaDataStartupMemory = 512*1024;</div>
<div>&nbsp;</div>
<div>-const char * const METADATA_DUMMYSOURCE_NAME = &quot;<a \
href="file://c:\\dummy.3gp"><font \
color="#0000FF"><u>file://c:\\dummy.3gp</u></font></a>&quot;;</div> \
<div>&#43;_LIT(KFileScheme, &quot;<a href="file://"><font \
color="#0000FF"><u>file://</u></font></a>&quot;);</div> <div>&#43;const char * const \
METADATA_DUMMYFILE_NAME = &quot;c:\\dummy.3gp&quot;;</div> <div>&nbsp;</div>
<div> #include &quot;symbian_dll_map_inst.h&quot;</div>
<div> #include &quot;symbian_dll_map.h&quot;</div>
<div>@@ -199,7 &#43;200,11 @@</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddRef();</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return HXR_OK;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div>
<div>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( IsEqualIID(riid, \
IID_IHXMMFDataSource) &amp;&amp; (m_pDataSource) )</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
else if ( (IsEqualIID(riid, IID_IHXMMFDataSource)</div> <div>&#43;#ifdef \
HELIX_FEATURE_64_BIT_FILE_SUPPORT</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
|| IsEqualIID(riid, IID_IHXMMFDataSource2)</div> <div>&#43;#endif</div>
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
) &amp;&amp; (m_pDataSource) )</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
{</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res = \
m_pDataSource-&gt;QueryInterface(riid, ppvObj);&nbsp;&nbsp;&nbsp;&nbsp; </div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div> <div>@@ -271,27 &#43;276,38 \
@@</div> <div>&nbsp;</div>
<div> STDMETHODIMP CHXSymbianMetaDataEng::OpenSource(CHXMediaSource \
&amp;aMediaSource)</div> <div> {</div>
<div>-&nbsp;&nbsp;&nbsp; HX_RESULT hxr;</div>
<div>-</div>
<div>-&nbsp;&nbsp;&nbsp; if (!m_pFFDriver)</div>
<div>&#43;&nbsp;&nbsp;&nbsp; HX_RESULT hxr = HXR_NOT_INITIALIZED;</div>
<div>&#43;&nbsp;&nbsp;&nbsp; if (m_pFFDriver)</div>
<div>&#43;&nbsp;&nbsp;&nbsp; {</div>
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hxr = HXR_NOT_SUPPORTED;</div>
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (aMediaSource.m_pData)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; {</div>
<div>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return HXR_NOT_INITIALIZED;</div>
<div>-&nbsp;&nbsp;&nbsp; }</div>
<div>-</div>
<div>-&nbsp;&nbsp;&nbsp; HX_RELEASE(m_pDataSource);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; m_pDataSource = \
CHXDataSourceFactory::Build(aMediaSource, TRUE /* bPeek */);</div> <div>&nbsp;</div>
<div>-&nbsp;&nbsp;&nbsp; MD_LOG(&quot;CHXSymbianMetaDataEng::OpenSource \
m_pDataSource=%p\n&quot;, </div> \
<div>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
m_pDataSource);</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
MD_LOG(&quot;CHXSymbianMetaDataEng::OpenSource m_pDataSource=%p\n&quot;, \
m_pDataSource);</div> <div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; if (m_pDataSource)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; {</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HX_ADDREF(m_pDataSource);</div>
<div>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hxr = \
DoOpenSource(METADATA_DUMMYSOURCE_NAME);</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
if ( aMediaSource.mType == CHXMediaSource::ERFile)</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
{</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
RFile* pFile = (RFile*)aMediaSource.m_pData;</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
TBuf&lt;KMaxFileName&gt; FileName;</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
if ( KErrNone == pFile-&gt;FullName(FileName) )</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
{</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
hxr = DoOpenSource((const char*)(FileName.PtrZ()));</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp; }</div> <div>-&nbsp;&nbsp;&nbsp; else</div>
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
else if ( aMediaSource.mType == CHXMediaSource::EFileName)</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp; {</div> \
<div>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hxr = HXR_NOT_SUPPORTED;</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
hxr = DoOpenSource((const char*)(aMediaSource.m_pData));</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
else if ( aMediaSource.mType == CHXMediaSource::EDescriptor )</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
{</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
hxr = DoOpenSource(METADATA_DUMMYFILE_NAME);</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; return hxr;</div>
<div>@@ -300,15 &#43;316,13 @@</div>
<div> // Checks if content is protected and can't be played.</div>
<div> // content is passed to FFDriver if required.</div>
<div>&nbsp;</div>
<div>-STDMETHODIMP CHXSymbianMetaDataEng::DoOpenSource(const char *pName)</div>
<div>&#43;STDMETHODIMP CHXSymbianMetaDataEng::DoOpenSource(const char \
*pFileName)</div> <div> {</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; \
MD_LOG(&quot;CHXSymbianMetaDataEng::DoOpenSource\n&quot;);</div> <div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; HX_RESULT hxr = HXR_OK;</div>
<div>-</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; m_LastError = HXR_OK;</div>
<div>&nbsp;</div>
<div>-</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; m_bProtectedAndCantPlay = IsProtected(*m_pDataSource) \
&amp;&amp; (!CanPlay(*m_pDataSource));</div> <div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; if (m_bProtectedAndCantPlay)</div>
<div>@@ -327,14 &#43;341,24 @@</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; else</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; {</div>
<div>-</div>
<div>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hxr = \
m_pFFDriver-&gt;Drive((char*)pName, NULL);</div> <div>-</div>
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Generate File URL using File \
name</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HBufC8 *pFileURL = \
HBufC8::New(strlen(pFileName) &#43; ((TDesC8&amp;)KFileScheme).Length() &#43; \
1);</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pFileURL)</div>
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</div>
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
pFileURL-&gt;Des().Copy(KFileScheme);</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
pFileURL-&gt;Des().Append((const TUint8*)pFileName, strlen(pFileName));</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hxr = \
m_pFFDriver-&gt;Drive((char*)pFileURL-&gt;Des().PtrZ(), NULL);</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete \
pFileURL;</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
if (hxr == HXR_OK)</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
hxr = m_LastError;</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</div> \
<div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hxr = \
HXR_OUTOFMEMORY;</div> <div>&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}</div> <div>&#43;&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; MD_LOG(&quot;CHXSymbianMetaDataEng::DoOpenSource \
hxr=%d\n&quot;, hxr);</div> <div>&nbsp;&nbsp;&nbsp;&nbsp; return hxr;</div>
<div>&nbsp;</div>
</font>
</body>
</html>



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

--===============0997349371==--


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

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