Modified by: dyek real.com
Date: 6/25/2007
Project: RealPlayer
Synopsis: Implementing Superbuffer in RealPlayer
Overview:
Created a custom Superbuffer scale by subclassing
GtkHScale
and extensively modifying its and GtkRange's (GtkHScale's
superclass)
behavior.
(As a result and especially because of a few duplication
of GtkRange's
private functions, these two superclasses should really be
converted
to private copies to avoid possible changes in the toolkit
to
negatively affect the custom Superbuffer scale.
This is planned for after my long vacation.)
Superbuffer scale has 4 visual modes:
(1) Background mode:
This is the non-playback mode where the light gray
background track
graphic is shown.
This corresponds to track.png.
(2) Non-superbuffered mode:
This is for non-superbuffered playback modes, such as
local playback,
playback of datatypes without working Superbuffer
support, and when
the Superbuffer functionality is being turned off.
This has the darker gray color slider track graphic
shown.
This corresponds to nonsuperb.png (originally
postrack.png).
(3) Superbuffered mode:
This is mostly the case for OnDemand playback.
This has brighter slate gray and cadet blue colors.
This corresponds to superbuffer.png (originally
trackmask.png,)
with track.png as background.
(4) Superbuffered Live mode:
This is for Live playback cases.
This corresponds to superbufferlive.png (originally
superbuffertile.png)
in addition to superbuffer.png.
The Live case is subdivided into:
growing buffer mode, with hatch-tile growing,
and:
buffer-full mode, where the hatch-tile graphic
animates
(moving to the left at the rate of buffer write).
Superbuffer scale is not very theme-able -- the track is
drawn using
fast tiling of graphic images, not using GTK+'s theme
routines.
(The slider or the thumb should be replaced with a
circular and
smaller graphic too, but it is not done yet.)
Added:
ClientPlayerGetSuperBufferRange()
to HXClientCFuncs.cpp to return Superbuffer minimum,
maximum, and
write positions.
This function currently returns mostly correct values for
most modes,
but I hope to investigate the implementation of
GetSeekRange(), as
it doesn't seem to be returning correct values for me.
Related functions are:
CHXRecordFile::GetSeekRange()
CHXClientRecordService::GetSeekRange()
CHXClientPlayer::GetBufferedRange()
ClientPlayerGetSuperBufferRange()
With this check-in, most playback modes worked, but there
is more
work to do before it will be ready for end user.
Currently, the user can easily get the following error
message if
clicked *outside* the Superbuffered range of the scale:
You cannot receive this content.
You do not have enough network bandwidth.
The same happens, at the moment, when pausing Live stream
too long,
and the original play position dropped off the circular
buffer.
The mouse-over labels are displayed in "developer
demo" format, not
the final format yet.
Files Modified:
player/hxclientkit/Umakefil
- Enable record engine (actually, superbuffer) target.
player/hxclientkit/src/HXClientCFuncs.cpp
- Added ClientPlayerGetSuperBufferSeekRange().
player/hxclientkit/pub/HXClientCFuncs.h - Added
function prototype.
player/hxclientkit/src/hxrecordengine/CHXClientRecordService
.cpp
- Changed INT32 to UINT32 to avoid compiler warnings.
player/common/gtk/hxplayer.cpp - Enable Superbuffer in
constructor.
player/app/gtk/hxstatus.cpp - user_assumes_ownership
gives user control;
pause_should_stop_timer prevent timeout function from
stopping.
player/app/gtk/hxstatus.h
player/app/gtk/hxstatuspositionslider.cpp
- Integrate HXSuperbufHScale with Superbuffer in
hxclientkit.
player/app/gtk/hxstatuspositionslider.h - Added
delay_timeout_id.
player/app/gtk/libgladeemu.cpp
- Added search for Superbuffer graphics.
player/app/gtk/mainapp.cpp
- Seek_scale remain sensitive in Superbuffer modes.
player/app/gtk/Umakefil - Added superbufhscale.c.
player/installer/archive/make_tempdir
- Copy superbuffer graphics; copy hxrecordengine.so
superbuffer DLL,
graphic files.
player/hxclientkit/src/hxrecordengine/CHXClientRecordFile.cp
p
- Temporary TransformBuffer() "fix".
Added Files:
player/app/gtk/superbufhscale.h
- Custom Superbuffer playback position scale
player/app/gtk/superbufhscale.c
- Custom Superbuffer playback position scale
player/app/gtk/res/superbuffer/track.png
- background track Graphics
player/app/gtk/res/superbuffer/nonsuperb.png
- non-superbuffered/local Graphics
player/app/gtk/res/superbuffer/superbuffer.png
- OnDemand/Live Graphics
player/app/gtk/res/superbuffer/superbufferlive.png - Live
tile.
Image Size and Heap Use impact (Client -Only):
None.
Platforms and Profiles Affected:
Linux
Distribution Libraries Affected:
None.
Distribution library impact and planned action:
None.
Platforms and Profiles Build Verified:
Profile: helix_client_all_define
Platform: Fedora Core 5
Platforms and Profiles Functionality verified:
Profile: helix_client_all_define
Platform: Fedora Core 5
Branch: HEAD (player), 150Cay (hxclientkit)
Copyright assignment: I am a RealNetworks employee.
--
Daniel Yek.
_______________________________________________
Player-dev mailing list
Player-dev helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/play
er-dev
|