List Info

Thread: CR: symbian asf file recognition




CR: symbian asf file recognition
user name
2007-07-26 18:43:30

ASF file can't be scanned into music library

Nokia submits this code under the terms of a commercial contribution agreement with RealNetworks, and I a
m authorized to contribute this code under said agreement."

Modified by:  ashish.as.guptanokia.com

Reviewed by:

Date: 25-July-2007

Project: SymbianMmf_Rel

ErrorId: EJZO-73JEWY

Synopsis: ASF file can't be scanned into music library

Files Modified:

Problem is that the system ASF recognizer is not working correctly.
This CR adds the logic to recognize ASF files based on unique GUID. This will be used by metadata engine to enable
the recognition of ASF files. Further, asfff.dll will be used to parse the file to distinguish between audio and video.

Please note that this only partial fix. It also depends on the corresponding changes in the recognizer to use the metadata utility

to recognize the ASF files.

common/system/platform/symbian/symbianrecognizer.cpp

Files Added: None

Image Size and Heap Use impact: no major impact

Module Release Testing (STIF) :  MRT test cases run and passed.

Root Cause: new feature/implementation

Test case(s) Added ; :  None. File recognition is not done through MMF APIs.

Memory leak check performed : Yes.  No new leaks introduced.

Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-arm

Platforms and Profiles Functionality verified: armv5, winscw

Branch: Head & 210CayS

? common_system_platform_symbian_diff.txt
Index: symbianrecognizer.cpp
===================================================================
RCS file: /cvsroot/common/system/platform/symbian/symbianrecognizer.cpp,v
retrieving revision 1.2.156.2
diff -u -w -r1.2.156.2 symbianrecognizer.cpp
--- symbianrecognizer.cpp  ;     19 Sep 2006 21:04:35 -0000 ;     1.2.156.2
+++ symbianrecognizer.cpp  ;     26 Jul 2007 22:56:42 -0000
-119,6 +119,39
     return bRet;
 }
 
+static HXBOOL IsASFHeader(const TDesC& fileName,
+         ;           ;      const TDesC8&; fileBuf,
+         ;           ;      TDataType &type)
+{
+    // known GUID header for ASF file.
+
+   _LIT8(KASF_HEADER_GUID,
+        "x30x26xB2x75x8Ex66xCFx11xA6xD9x00xAAx00x62xCEx6C");
+
+    // mime type to be returned.
+    _LIT8(KASFMimeType , "application/vnd.ms-asf" );
+
+ &nbsp;  if (fileBuf.Length() < 16)
+ &nbsp;  {
+ &nbsp; &nbsp; &nbsp;  return FALSE;
+ &nbsp;  }
+
+ &nbsp; 
+ &nbsp;  HXBOOL bRet = TRUE;
+ &nbsp; 
+ &nbsp;  TPtrC8 buffer = fileBuf.Mid(0, 16);
+ &nbsp;  if (buffer.Compare(KASF_HEADER_GUID) == 0)
+ &nbsp;  {
+ &nbsp; &nbsp; &nbsp;  type = TDataType(KASFMimeType);
+ &nbsp;  }
+ &nbsp;  else
+ &nbsp;  {
+ &nbsp; &nbsp; &nbsp;  bRet = FALSE;
+ &nbsp;  }
+ &nbsp;  return bRet;
+}
+
+
 static TInt DoGetMimeType(const TDesC& fileName,
 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; const TDesC8&; fileBuf,
 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; TDataType &type,
-134,6 +167,10
 &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; return ret;
 &nbsp; &nbsp; }
+ &nbsp;  else if (IsASFHeader(fileName, fileBuf, type))
+ &nbsp;  {
+ &nbsp; &nbsp; &nbsp;  return ret;
+ &nbsp;  }
 &nbsp; &nbsp; else
 &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; // check if system recognizer has been disabled.


Re: CR: symbian asf file recognition
country flaguser name
United States
2007-07-26 19:07:02
Looks good.
--greg.

Ashish.As.Guptanokia.com wrote:
> ASF file can't be scanned into music library
> 
> Nokia submits this code under the terms of a commercial
contribution
> agreement with RealNetworks, and I a
> m authorized to contribute this code under said
agreement."
> 
> Modified by:  ashish.as.guptanokia.com
> 
> Reviewed by:
> 
> Date: 25-July-2007
> 
> Project: SymbianMmf_Rel
> 
> ErrorId: EJZO-73JEWY
> 
> Synopsis: ASF file can't be scanned into music library
> 
> Files Modified:
> 
> Problem is that the system ASF recognizer is not
working correctly. 
> This CR adds the logic to recognize ASF files based on
unique GUID. This
> will be used by metadata engine to enable 
> the recognition of ASF files. Further, asfff.dll will
be used to parse
> the file to distinguish between audio and video.
> 
> Please note that this only partial fix. It also depends
on the
> corresponding changes in the recognizer to use the
metadata utility
> to recognize the ASF files.
> 
> common/system/platform/symbian/symbianrecognizer.cpp
> 
> Files Added: None
> 
> Image Size and Heap Use impact: no major impact
> 
> Module Release Testing (STIF) :  MRT test cases run and
passed.
> 
> Root Cause: new feature/implementation
> 
> Test case(s) Added  :  None. File recognition is not
done through MMF
> APIs.
> 
> Memory leak check performed : Yes.  No new leaks
introduced.
> 
> Platforms and Profiles Build Verified:
helix-client-s60-32-mmf-mdf-arm
> 
> Platforms and Profiles Functionality verified: armv5,
winscw
> 
> Branch: Head & 210CayS 
> 
> ? common_system_platform_symbian_diff.txt
> Index: symbianrecognizer.cpp
>
============================================================
=======
> RCS file:
>
/cvsroot/common/system/platform/symbian/symbianrecognizer.cp
p,v
> retrieving revision 1.2.156.2
> diff -u -w -r1.2.156.2 symbianrecognizer.cpp
> --- symbianrecognizer.cpp	19 Sep 2006 21:04:35 -0000
> 1.2.156.2
> +++ symbianrecognizer.cpp	26 Jul 2007 22:56:42 -0000
>  -119,6 +119,39 
>      return bRet;
>  }
>  
> +static HXBOOL IsASFHeader(const TDesC& fileName,
> +                          const TDesC8& fileBuf,
> +                          TDataType &type)
> +{
> +    // known GUID header for ASF file.
> +
> +   _LIT8(KASF_HEADER_GUID, 
> +
>
"x30x26xB2x75x8Ex66xCFx11xA6xD9x00xAAx00x
62xCEx6C");
> +
> +    // mime type to be returned.
> +    _LIT8(KASFMimeType ,
"application/vnd.ms-asf" );
> +
> +    if (fileBuf.Length() < 16)
> +    {
> +        return FALSE;
> +    }
> +
> +    
> +    HXBOOL bRet = TRUE;
> +    
> +    TPtrC8 buffer = fileBuf.Mid(0, 16);
> +    if (buffer.Compare(KASF_HEADER_GUID) == 0) 
> +    {
> +        type = TDataType(KASFMimeType);
> +    }
> +    else
> +    {
> +        bRet = FALSE;
> +    }
> +    return bRet;
> +}
> +
> +
>  static TInt DoGetMimeType(const TDesC& fileName, 
>                            const TDesC8& fileBuf,
>                            TDataType &type,
>  -134,6 +167,10 
>      {
>          return ret;
>      }
> +    else if (IsASFHeader(fileName, fileBuf, type))
> +    {
> +        return ret;
> +    }
>      else 
>      {
>          // check if system recognizer has been
disabled.
> 
> 
> 
> 
> 
>
------------------------------------------------------------
------------
> 
> _______________________________________________
> Common-dev mailing list
> Common-devhelixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/comm
on-dev


_______________________________________________
Common-dev mailing list
Common-devhelixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/comm
on-dev

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )