org.red5.server.stream
Interface IBWControlService

All Known Implementing Classes:
DummyBWControlService, SimpleBWControlService

public interface IBWControlService

Bandwidth controller service interface.

The bandwidth controllable is registered in the bandwidth controller which provides the three token buckets used for bandwidth control.

The bandwidth controller manages the token buckets assigned to the bandwidth controllable and distributes the tokens to the buckets in an implementation-specific way. (eg timely distribute the tokens according to the bandwidth config of the controllable)

Author:
The Red5 Project (red5@osflash.org), Steven Gong (steven.gong@gmail.com)

Field Summary
static String KEY
           
 
Method Summary
 ITokenBucket getAudioBucket(IBWControlContext context)
          Return the token bucket for audio channel.
 ITokenBucket getDataBucket(IBWControlContext context)
          Return the token bucket for data channel.
 ITokenBucket getVideoBucket(IBWControlContext context)
          Return the token bucket for video channel.
 IBWControlContext lookupContext(IBWControllable bc)
          Lookup the registry context according to the controllable.
 IBWControlContext registerBWControllable(IBWControllable bc)
          Register a bandwidth controllable.
 void resetBuckets(IBWControlContext context)
          Reset all the token buckets for a controllable.
 void unregisterBWControllable(IBWControlContext context)
          Unregister the bandwidth controllable.
 void updateBWConfigure(IBWControlContext context)
          Update the bandwidth configuration of a controllable.
 

Field Detail

KEY

static final String KEY
See Also:
Constant Field Values
Method Detail

registerBWControllable

IBWControlContext registerBWControllable(IBWControllable bc)
Register a bandwidth controllable. The necessary resources will be allocated and assigned to the controllable.

Parameters:
bc - The bandwidth controllable.
Returns:
The registry context. It's used in the subsequent calls to controller's method.

unregisterBWControllable

void unregisterBWControllable(IBWControlContext context)
Unregister the bandwidth controllable. The resources that were allocated will be freed.

Parameters:
context - The registry context.

lookupContext

IBWControlContext lookupContext(IBWControllable bc)
Lookup the registry context according to the controllable.

Parameters:
bc - The bandwidth controllable.
Returns:
The registry context.

updateBWConfigure

void updateBWConfigure(IBWControlContext context)
Update the bandwidth configuration of a controllable. Each time when the controllable changes the bandwidth config and wants to make the changes take effect, this method should be called.

Parameters:
context - The registry context.

resetBuckets

void resetBuckets(IBWControlContext context)
Reset all the token buckets for a controllable. All the callback will be reset and all blocked threads will be woken up.

Parameters:
context - The registry context.

getAudioBucket

ITokenBucket getAudioBucket(IBWControlContext context)
Return the token bucket for audio channel.

Parameters:
context - The registry context.
Returns:
Token bucket for audio channel.

getVideoBucket

ITokenBucket getVideoBucket(IBWControlContext context)
Return the token bucket for video channel.

Parameters:
context - The registry context.
Returns:
Token bucket for video channel.

getDataBucket

ITokenBucket getDataBucket(IBWControlContext context)
Return the token bucket for data channel.

Parameters:
context - The registry context.
Returns:
Token bucket for data channel.


Copyright © 2006-2009 The Red5 Project