Friday, October 17, 2008

Problem: Source Filter's Pause() fn was not called and directly Stop() fn was called


Problem;
----------------
  Source Filter's Pause() fn was not called and directly Stop() fn was called.
 
 
Solution steps:
------------------------
         For this problem I tried two approach.
 
          1.I have checked the source filter output pin's GetMediaType() fn and CheckMediaType() fn was succeeded and Decoder filter's CheckInputType() fn and CheckTransform() fn was succeeded. so no problem with pin connection
        2.I have developed the player application and rendered only the video output pin and still I got the same error
 
So there is no
            
 
 
Solution:
------------------
 
Importance of biPlanes in BITMAPINFOHEADER:
-------------------------------------------------------------------------

                In Source filter, we set the GetMediaType() returns media type.
This media type have BITMAPINFOHEADER; BITMAPINFOHEADER have biPlanes variable;
 if we set it to zero, then Source Filter directly goes to Filter's Stop() fn...
   if I modified it to 1, then the video is playing fine.
MSDN DSHOW docs prescribed this variable must be set to 1;
 
            So it is better to make the biPlanes  as 1 in media type returned with GetMediaType() fn in our Decoder.
 
 
 
 
 
 
 

how to find framerate of 3GP file?

 
 
how to find framerate of 3GP file? 
Is there any particular box present in 3gp file to specify framerate?
 
Solution:
--------------
      
3gp is actually QuickTime file. There is no special field for Frames Per Second, so you have to
calculate  by dividing the number of frames in stream and stream time
duration.
 

mDurationInSecs =  pMediaTrkInfo->trackDuration / lMovieInfo.timescale;

fFrameRate = pMediaTrkInfo->totalNumOfFrames/ (*apVidInfoLst)[index].mDurationInSecs;

//Frame Rate calculation if 10 frames r played in 2 secs, then FPS is 5 (10/5)

AvgTimePerFrame calculation

 
//FrameRate calculataion
header File is reftime.h
-----------------------------
const LONGLONG MILLISECONDS = (1000);            // 10 ^ 3
const LONGLONG NANOSECONDS = (1000000000);       // 10 ^ 9
const LONGLONG UNITS = (NANOSECONDS / 100);      // 10 ^ 7
//const REFERENCE_TIME FPS_25  = UNITS / 25;
//const REFERENCE_TIME FPS_30  = UNITS / 30;
//AvgTimePerFrame  = UNITS/frameRate;

 

VS 2005 Dshow Error PVOID64

 Error C2146: syntax error: missing ';' before identifier PVOID64

VS 2005 error with Dshow baseclasses.

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(222) : error

C2146: syntax error : missing ';' before identifier 'PVOID64'


Solution:
--------------

The DirectX Include directory contains an early version of BaseTsd.h which does not

include the definition for POINTER_64. You should instead use the version of BaseTsd.h in

the Platform SDK, either the one that ships with Visual Studio 2005 (C:\Program

Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\BaseTsd.h) or in an updated

Microsoft SDK installation. In order to get the compiler to use the right file, just

remove BaseTsd.h from the DirectX Include directory.


 

Error

 
 
Error :
---------
AKY=00080001 PC=03f6dc24(coredll.dll+0x00021c24) RA=29b314b8(tcpip6.dll+0x000414b8)
BVA=390614b8 FSR=000000f5
and explain the scenario

Solution:
------------
 1.This is the memory based error. somewhere we are using the memory beyond its
boundary.
 I have allocated the 30 bytes of memory and try to do copy more than 40 bytes with
memcpy() fn. It causes the crash.
 

 

Difference between Normal file and PD streamable clip

Difference between Normal file and PD streamable clip:
----------------------------------------------------------------------------------
 
                   Normal video file can have the file index information at the end. ( video track audio track and its duration and all informations available @ the end. if it is so, we can play the file only after downloading the entire contents of a file.)
                 Progressive Download streamable clip will have the index information at the beginning.In case of 3gp file, moov atom will have the file index position and information .
              if the moov atom is available @ the end of the file, then the file is not streamable using PD.
     In case of rtsp streamable 3gp file also have some hint track @ the beginning to inform the file index positions @ the beginning.
                

Assumptions:
------------------

1.Quicktime, mp4,3gp file having hint track can be transferred thru http or ftp protocols
 
2.Moov atom index must be at the beginning of the file ... so that player can play the file before downloading the entire content...

3.Self contained movie can be streamable...

 

Solutions:
-----------
  Any Quicktime,mp4 or 3gp files can be able to do Progressive Download Streaming
if moov  atom is @ first..Moov atom index must be at the beginning of the file ... so that player can play the file before downloading the entire content.

 


 For Example


3gp file atoms are like this:
------------------------------
 ftyp
 moov
  mdat

 we can stream it in PD streaming.

if the 3gp atoms are as follows:

 ftyp
 mdat
 moov


 this indicates Moov atom is at the end of the file... So it can't be streamable in Progressive Download.

 

PD Stack:
-----------
 within PD stack,we will wait for the File Size and information about the video and audio track info...

 if it doesnt receive the video, audio track info and file information it will not proceed to download the content.  

 


  

Without calling Pause () fn we are not able to set seek position...

 


Without calling  Pause () fn we are not able to set seek position...
--------------------------------------------------------------------------

we are able to do the SetPosition ( set the seek position) on the fly while running the video.

    In our Source Filter we are not able to set the seek position. Before setting the seek position, we have to the

following:

        Pause() of IMediaControl;
 SetPosition();
 Run()

then only  we are able to set the seek position to the source filter.

 

Solution:
--------------
       The reason we are not able to do the seek position while running the video is we are not handling
setPosition properly.


  if Source Filter's output pin thread  exists , that represents the video is running; then

          i)call the stop on Source Filter's output pins .

  if(m_paStreams[i]->ThreadExists())
   {
     if(m_paStreams[i]->IsConnected())
     {
    hr = m_paStreams[i]->DeliverBeginFlush() ;
     }
    
     if(m_State != State_Stopped )
     {
      hr = m_paStreams[i]->Stop();
     }
         
     if(m_paStreams[i]->IsConnected())
     {
    hr = m_paStreams[i]->DeliverEndFlush() ;
     }  
   }
 

         ii)Set the seek position

 iii)call the Pause () fn on Each output pins of the source Filter


 
If the filter graph is stopped, the video renderer does not update the image after a seek operation. To the user, it will

appear as if the seek did not happen. To update the image, pause the graph after the seek operation. Pausing the graph cues a

new video frame for the video renderer. You can use the IMediaControl::StopWhenReady method, which pauses the graph and then

stops it.
 

when the Source filter output pin connects to Decoder ?

 
Source Filter:
-------------------------
For Media type, check the
1.GetMediaType() and CheckMediaType() succeeds then only the
Source Filter output pin will connects to any decoder filters

H.264 Nonstandard clip Crash issue in Quicktime 7.0.3

H.264 Nonstandard clip Crash issue in Quicktime 7.0.3 :
=========================================================

 i) Normally the width and height of the H.264 will be the multiple of 16.
 ii)Non standard clip means it will not be the multiple of 16,like 450x360

 iii)In Quicktime Player,Quicktime File parser will give original width and height
  ( 450x360) and the decoder allocated the output video width and height as

450 *360. This will leads to crash. Decoder must output the buffer as follows
464 * 364; (width and height are aligned as multiple of 16).

 In H264, we will encode the video frame with 100x100 and the width and height may

be the 112 * 112; the actual video width height is as 100,100.

 iv)if the decoder allocates only the 450* 360 output width the crash might happen

in decoder or the renderer which renders the data;

 Quicktime may solved this issue in latest version Quicktime 7.5. In older

version,they may allocate the output width and height as 450*360 and crashed.
 Our decoder too behaved in the same way.

 

 


 

 

RGB565 video renderer performance and how can we tackle it ?

RGB565 video renderer performance and how can we tackle it ?

Reason:
=========
 In case of RGB 565 scaling and rotation, for retrieving the R,G,B component,we
have to do calculation for Each and every pixel that will decreases the time taken.
RGB 565 format scaling and rotation is taking so much of time. But In case of the YV12 we are able to do scaling and rotation with twice a speed of the RGB565;
 
Solution:
============
        if we need more performance or effective execution do it as follows:
if they need RGB565 scaling and rotation,do the following:
             i)  convert the RGB 565 to YV12
      ii) Do YV12 scaling or rotation
      iii)Convert YV12 to RGB 565 back.
it will increase the performance;
 
 
 

Why WMP calls the IFileSourceFilter's Load fn Twice

Why WMP calls the IFileSourceFilter's Load fn Twice:
-----------------------------------------------------------

if we implemented the IFileSourceFilter in our Filter, WMP calls the IFileSourceFilter's Load() function twice;

Reason:
----------
 WMP calls "Load" two times, First time just to check whether the filter is proper dll or not
 WMP call "Load" again for the second time. Second time only  we have to create any pins to the Filter;
In case of Source Filter,we will be creating pins only at the second time;
      

WMP player is not loading the Filter DLL in Wifi

WMP player is not loading the Filter DLL in Wifi :
-------------------------------------------------------------------------

1.We enabled the Wifi in a mobile device;
Thru the Wifi, we try to reach the server for streaming server;

 We are giving the rtsp/PD server address in WMP;
In WMP, if we specified the  http  or rtsp, WMP must automatically load the
Filter.
         But it doesnt happen and our filter is not getting loaded;


Reason:
----------
 WMP player will not load the filter DLL before checking the host.

WMP Behavior:
-------------
 WMP will sends some form of HTTP GET / some requests to server

 For Example rtsp://10.203.92.78:8080/1.3gp

 WMP will sends the some network request to the the 10.203.92.78 server; if the

server acknowledges the WMP, then only WMP tries to load the filter DLL for the

corresponding format;

 In case of the Wifi, it may sends the HTTP Get command. Wifi server may not

response to the request or some form of communication gap happens.. so WMP will not get

the response;


  But In case of GPRS streaming,WMP loads the filter DLL and we are able to do streaming well;
 
Another reason WMP may not be able to detect the connected network intelligently;


Solution:
==========
      Develop our own player application to insert the Streaming source Filter and render

it...
 


Note:
------- 
  if our Player application is using RenderFile() means that might cause the same problem;


 

 

WinCE macro and Log Location

WinCE macro:
----------------------
 
#ifndef WINCE
 fp  = fopen("C:\\Test2ByteAligned.Dump","wb");
#else
 fp = fopen("\\My Documents\\Test2ByteAligned.Dump","wb");

RTSP Audio video Sync


Problem :
------------

 Issues in RTSP/LiveStream Audio and video sync

 RTSP video on Demand videos are playing fine. But Only Livestream audio and video

sync is not happening  Streaming server is sending RTSP as meta data channel( just for DESCRIBE,

PLAY,PAUSE and TEARDOWN commands);Streaming server will send video and audio data over the

RTP.

Analysis:
----------

 if there is any issue in audio and video sync issues in RTSP/Livestream RTSP,
it is because of the Streaming Server.

 

 rtsp streaming servers are specialized servers;They have to do audio and video

sync; In case of rtsp streaming, it is enough to render the audio and video data using the

RTP timestamp. there is no need to do audio video sync with RTCP.if we are doing RTCP

sync, that will be better;
 But For RTCP sync timestamp calculation it will takes much time because of

floating operations involved in it. So In case of low end devices such as mobile they will

not use the RTCP for sync; it is enough to do render the video and audio with RTP

timestamp;


 
Solution:
----------
 Make the Streaming server to give output as video and audio synchronized;
 
  


 

Tuesday, September 09, 2008

IE internet browsing problem in Windows Mobile

IE internet browsing problem in Windows Mobile:

---------------------------------------------------------------------

1.Even though I configured the proxy server and USB setting as Turbo Mode.

I am not able to open any web pages in a mobile.

Solution:

----------

I have opened Active Sync's connection Settings in PC and selected the automatic from the list of options in combo box.

The computer is connected to:

Automatic

Work Network

Internet

it was "Work Network" previously. I modified it to the "Automatic" in a PC then the web pages are able to open in IE.

Monday, September 08, 2008

WinCE Deployment error Deployment and/or registration failed with error

WinCE Deployment error:

------------------------------------------

Deployment and/or registration failed with error: 0x8973190e. Error writing file '\Program Files\VideoRenderer.dll'. Error 0x80450001: (null)

========== Build: 0 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========

========== Deploy: 2 succeeded, 1 failed, 0 skipped ==========

This is due to I have deployed the DLL in Windows folder But the mobile is not allowing to deploy...

So I prepared the cab ( will have the DLL) and install it in mobile.

But it is also not working...

  The problem is Bulverde device shown error as the Problem occurred in tmarshaller.exe file.

Reason:

----------------

Previously I got the same error when Codec DLL is missing in the Codec Filter.

if I deployed it, then I got the error...

 

I have opened the file

using fopen() fn in Constructor of a video renderer... It causes the problem.

if I opened the file in SetMediaType() fn I didnt get any errors...

So Beware of Fopen() calls...

 

 

I have declared the public variable in CVideoRenderer and opened the fopen("\\My Documents\\test.log"); in the CVideoRenderer's constructor...

CVideoRenderer's constructor will be called in the CreateInstance of IUnknown implementation of a filter...

 

This is the General problem to any COM DLL.

Tuesday, September 02, 2008

How to configure the VS 2005 wizard to create the .rel file:


How to configure the VS 2005 wizard to create the .rel file:
----------------------------------------------------------------------------------------
Projects-> Properties->Linker ->CommandLine

 /subsystem:windowsce,5.01 /machine:THUMB /savebaserelocations:"$(TargetDir)$(TargetName).rel"

Monday, September 01, 2008

The difference between SmartPhone and Pocket PC?



---------- Forwarded message ----------
From: sundar rajan <sundararajan.svks@gmail.com>
Date: Sep 1, 2008 4:19 PM
Subject: Re: Anyone knows the difference between SmartPhone and Pocket PC?
To: ootaboys@googlegroups.com



 Windows mobile is a general term for Windows OS that are used in handheld devices.

For Example Windows OS is a general term... Under this category we are having different flavors like Windows 98,windows XP,

Windows NT and so on.
 

Windows Mobile  operating system for handhelds:


 1.Pocket PC Edition
 2.Pocket PC Phone Edition, and
 3.Smartphone Edition

Pocket PC Edition:
--------------------
 Stand-alone PDAs, such as the Dell Axim X51 series and the HP iPaq rx1950, use Pocket PC Edition and come with the

full Mobile Office suite, including Word Mobile, Excel Mobile,and PowerPoint Mobile. These handhelds typically have

240x320-pixel touch screens, can feature wireless connectivity, and are best for those who want a palm-size device to

organize vital information with the option to work on the go and surf the Web.
 ( it is like a handheld PC )

Pocket PC Phone Edition:
------------------------
 Devices that run Pocket PC Phone Edition are similar to Pocket PC PDAs in shape and size (including the touch-screen

functionality), with the full suite of office apps, but they add cellular-wireless capabilities so that you can make phone

calls. These all-in-one mobiles are good for power users who need the full functionality of being able to work and stay

connected on the road. Examples of Pocket PC phones are the Palm Treo 700w.

SmartPhone:
-------------
 Windows Mobile  Smartphone Edition offers the biggest difference of the three versions. First, the mobiles are

smaller, resembling cell phones, and they generally feature 320x240-pixel displays that aren't touch sensitive. Instead, you

navigate via soft keys and a joystick. Also, while you get all the calendar and contact tools, you don't get the entire

Office Mobile suite, just Outlook Mobile; third-party apps, such as Westtek's ClearVue Suite, are available so that you can

view work documents. These types of smart phones are perfect for users who want the phone form factor but also want to stay

up-to-date and be more productive on the road.

 

Major Difference between Smartphone  and Pocket PC:

 SmartPhone is a low cost solution compare to Pocket PC.

Touch screen facility available in Pocket PC.Smartphone will not have touch screen facility.we have to navigate via softkeys or joystick.

 That is it...

 
 

 

 

Thursday, August 28, 2008

fatal error LNK1181: cannot open input file

Linker Error
--------------
MS_LINK : fatal error LNK1181: cannot open input file '..\..\..\..\..\3gpstack\pd_streaming_lib\prj\lib_ppc2003_evc4\windows mobile 5.0 smartphone sdk (armv4i)\debug\etm_pd_stack_lib_ppc2003_evc4.lib'

Solution:
----------
The path of the library file "etm_pd_stack_lib_ppc2003_evc4.lib'" is too large.
It is less than the 255 characters but still it is the problem. if I copied my project directly to D:\ then I will not get any errors.
MSDN KB for LNK1181 Error:
--------------------------------------
SYMPTOMS
When you build a Microsoft Visual C++ .NET project in Microsoft Visual Studio .NET or a Microsoft Visual C++ 2005 project in Microsoft Visual Studio 2005, you may receive an error message that is similar to the following error message:
fatal error LNK1181: cannot open inputfile ‘f:\temp\test.obj’
Back to the top
CAUSE
This problem may occur when the path of the Intermediate file folder or the path of the Output file folder in the Visual C++ project starts with a leading backward slash (\). The IDE uses the drive from where it is launched. The IDE does not use the drive that the project uses.
Back to the top
WORKAROUND
To work around this problem, include the drive name for the Intermediate file folder and for the Output file folder. To edit the entries for the IntDir folder or for the OutDir folder, follow these steps:1. On the Project menu, click Properties Pages.
2. In the Properties Pages dialog box, click Configuration Properties.
3. In the General list, type new entries for the Output Directory items and for the Intermediate Directory items that include the drive names.

reference: http://support.microsoft.com/kb/839286

Friday, August 22, 2008

How to connect the Windows Pocket PC(Not having SIM) to the Internet thru ActiveSync

How to connect the Windows Pocket PC(Not having SIM) to the Internet thru ActiveSync:
------------------------------------------------------------------------------------
Two ways to connect our Development mobile to internet;
1.Thru the ActiveSync connected System
2.Thru the LAN settings

Development mobile will not have any SIM card in it;


Thru Active Sync Connected System:
-----------------------------------------------------------
To Select this mode we have to keep in mind the following things:
1.we must configure the Proxy server to the IE settings
2.USB Setting must be Turbo Mode;
How to Configure it:
----------------------------
Select Settings->Connections->connections->Tasks-> Set up Proxy server
general tab
Enter the name for the Settings: "Internet"
Proxy settings Tab:
-------------------------------
Enable the check boxes
1.this network connects to the internet option and
2.This network uses a proxy server to connect to the internet and enter the Proxy server address.
ProxyServer: 10.202.202.20
and click on OK.
Settings->Connections->connections has two tabs...
1.Tasks
2.Advanced
In the Advanced tab, click on "Select Networks" button.
Network Management page will appears.it has two combo boxes.
Select the "Internet" (description given in General Settings ) in both the combo boxes.
and then click on OK.

Moreover we have to set the "USB setting" mode as Turbo Mode;
Select the following option button:
Settings->connections->USB setting-> ActiveSync(Turbo Mode)

Restart the device to make the new Active Sync connection.
Now check the Internet explorer with URL.

LAN Based internet connection:
------------------------------------------------
Thru LAN based connection, we can access the LAN ( Intranet websites also) sites.


To Select this mode we have to keep in mind the following things:
1.we must configure the Proxy server to the IE settings
2.USB Setting must be Turbo Mode;
How to Configure it:
------------------------------
Select Settings->Connections->connections->Tasks-> Set up Proxy server or Edit my proxy server
general tab
Enter the name for the Settings: "Internet"
Proxy settings Tab:
-------------------------------------
Uncheck the following check boxes
1.this network connects to the internet option and
2.This network uses a proxy server to connect to the internet and enter the Proxy server address.
ProxyServer: 10.202.202.20
and click on OK.
Settings->Connections->connections has two tabs...
1.Tasks
2.Advanced
In the Advanced tab, click on "Select Networks" button.
Network Management page will appears.it has two combo boxes.
Select the "Internet" (description given in General Settings ) in both the combo boxes.
and then click on OK.

Moreover we have to set the "USB setting" mode as Normal Mode;
Select the following option button:
Settings->connections->USB setting-> ActiveSync(NormalTurbo

Restart the device to make the new Active Sync connection.
Now check the Internet explorer with URL.