List Info

Thread: CR-Client: change CVideoPaceMaker suspend behavior




CR-Client: change CVideoPaceMaker suspend behavior
country flaguser name
United States
2008-04-18 14:19:02
Description
---------------------------------------------
The CVideoPaceMaker class which implements IHXPaceMaker
is a class which provides regular callbacks at a
user-specified
interval to IHXPaceMakerResponse::OnPace() by using an
internal
thread and event. If the user-specified interval is 5ms,
then
the class starts up the internal thread which loops, calling
OnPace()
calling IHXEvent::Wait(5ms) calling OnPace, calling
IHXEvent::Wait(5ms),
etc. When the user calls IHXPaceMaker::Suspend(TRUE),
the user is saying that calls back to OnPace() are not
wanted
until the user resumes by calling
IHXPaceMaker::Suspend(FALSE).

Previously when the user suspended the pacemaker by calling
IHXPaceMaker::Suspend(TRUE), the thread continued to run,
still waking up every 5ms and then going right back to
sleep.
The only thing different was that OnPace was not called
while the pacemaker was suspended. This constant waking up
and sleeping causes heavy power consumption on mobile
devices
and is really not needed.

This change changes the internal behavior of
CVideoPaceMaker
(and one slight semantic change). With this change, when
the pacemaker is suspended, it calls
IHXEvent::Wait(HX_EVENT_WAIT_FOREVER),
where HX_EVENT_WAIT_FOREVER is 0xFFFFFFFF. When the user
then calls IHXPaceMaker::Suspend(FALSE) to resume the
pacemaker,
we signal the event. So this way the thread is not
continuing to
run while the pacemaker is suspended.

The one slight semantic change is this: while suspended,
the
user can call IHXPaceMaker::Signal() and it will receive
one
callback to OnPace(). Previously, if suspended,
IHXPaceMaker::Signal()
did not result in a callback to OnPace(). However, no code
that I
know of was ever calling Signal() while in a suspended
state.

Files Modified
---------------------------------------------
common/include/hxengin.h - add definition of
HX_EVENT_WAIT_FOREVER
common/util/cpacemkr.cpp
common/util/pub/cpacemkr.h

Branches
---------------------------------------------
HEAD and hxclient_3_1_0_atlas

=====================================
Eric Hyche, Technical Lead
RealNetworks, Inc.
ehychereal.com

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

  
CN-Client: change CVideoPaceMaker suspend behavior
country flaguser name
United States
2008-04-22 10:07:38
This is now checked into HEAD and 310Atlas.

=============================================
Eric Hyche (ehychereal.com)
Technical Lead
RealNetworks, Inc.  

> -----Original Message-----
> From: common-dev-bounceshelixcommunity.org 
> [mailto:common-dev-bounceshelixcommunity.org] On
Behalf Of Eric Hyche
> Sent: Friday, April 18, 2008 3:19 PM
> To: common-devlists.helixcommunity.org
> Subject: [Common-dev] CR-Client: change CVideoPaceMaker

> suspend behavior
> 
> 
> Description
> ---------------------------------------------
> The CVideoPaceMaker class which implements
IHXPaceMaker
> is a class which provides regular callbacks at a
user-specified
> interval to IHXPaceMakerResponse::OnPace() by using an
internal
> thread and event. If the user-specified interval is
5ms, then
> the class starts up the internal thread which loops,
calling OnPace()
> calling IHXEvent::Wait(5ms) calling OnPace, calling 
> IHXEvent::Wait(5ms),
> etc. When the user calls IHXPaceMaker::Suspend(TRUE),
> the user is saying that calls back to OnPace() are not
wanted
> until the user resumes by calling
IHXPaceMaker::Suspend(FALSE).
> 
> Previously when the user suspended the pacemaker by
calling
> IHXPaceMaker::Suspend(TRUE), the thread continued to
run,
> still waking up every 5ms and then going right back to
sleep.
> The only thing different was that OnPace was not
called
> while the pacemaker was suspended. This constant waking
up
> and sleeping causes heavy power consumption on mobile
devices
> and is really not needed.
> 
> This change changes the internal behavior of
CVideoPaceMaker
> (and one slight semantic change). With this change,
when
> the pacemaker is suspended, it calls 
> IHXEvent::Wait(HX_EVENT_WAIT_FOREVER),
> where HX_EVENT_WAIT_FOREVER is 0xFFFFFFFF. When the
user
> then calls IHXPaceMaker::Suspend(FALSE) to resume the
pacemaker,
> we signal the event. So this way the thread is not
continuing to
> run while the pacemaker is suspended.
> 
> The one slight semantic change is this: while
suspended, the
> user can call IHXPaceMaker::Signal() and it will
receive one
> callback to OnPace(). Previously, if suspended,
IHXPaceMaker::Signal()
> did not result in a callback to OnPace(). However, no
code that I
> know of was ever calling Signal() while in a suspended
state.
> 
> Files Modified
> ---------------------------------------------
> common/include/hxengin.h - add definition of
HX_EVENT_WAIT_FOREVER
> common/util/cpacemkr.cpp
> common/util/pub/cpacemkr.h
> 
> Branches
> ---------------------------------------------
> HEAD and hxclient_3_1_0_atlas
> 
> =====================================
> Eric Hyche, Technical Lead
> RealNetworks, Inc.
> ehychereal.com
> 


_______________________________________________
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 )