Class: shaka.msf.BufferControlWriter

Constructor

new BufferControlWriter(initialSizeopt)

Creates a new BufferControlWriter with an initial buffer size
Parameters:
Name Type Attributes Default Description
initialSize number <optional>
1024
Source:

Members

Methods

getBytes() → {Uint8Array}

Gets the current buffer with only the written data
Source:
Returns:
Type
Uint8Array

marshal_(type, fn) → {shaka.msf.BufferControlWriter}

Helper to marshal a message and return this
Parameters:
Name Type Description
type shaka.msf.Utils.MessageTypeId
fn function()
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalClientSetup(msg) → {shaka.msf.BufferControlWriter}

Marshals a Client setup message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.ClientSetup
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalGoaway(msg) → {shaka.msf.BufferControlWriter}

Marshals a Goaway message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.Goaway
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalMaxRequestId(msg) → {shaka.msf.BufferControlWriter}

Marshals a MaxRequestId message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.MaxRequestId
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalPublish(msg) → {shaka.msf.BufferControlWriter}

Marshals a Publish message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.Publish
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalPublishDone(msg) → {shaka.msf.BufferControlWriter}

Marshals a PublishDone message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.PublishDone
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalPublishError(msg) → {shaka.msf.BufferControlWriter}

Marshals a PublishError message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.PublishError
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalPublishNamespace(msg) → {shaka.msf.BufferControlWriter}

Marshals an PublishNamespace message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.PublishNamespace
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalPublishNamespaceCancel(msg) → {shaka.msf.BufferControlWriter}

Marshals an PublishNamespaceCancel message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.PublishNamespaceCancel
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalPublishNamespaceDone(msg) → {shaka.msf.BufferControlWriter}

Marshals an PublishNamespaceDone message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.PublishNamespaceDone
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalPublishNamespaceError(msg) → {shaka.msf.BufferControlWriter}

Marshals an PublishNamespaceError message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.PublishNamespaceError
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalPublishNamespaceOk(msg) → {shaka.msf.BufferControlWriter}

Marshals an PublishNamespaceOk message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.PublishNamespaceOk
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalPublishOk(msg) → {shaka.msf.BufferControlWriter}

Marshals a PublishOk message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.PublishOk
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalRequestsBlocked(msg) → {shaka.msf.BufferControlWriter}

Marshals a RequestsBlocked message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.RequestsBlocked
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalServerSetup(msg) → {shaka.msf.BufferControlWriter}

Marshals a Server setup message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.ServerSetup
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalSubscribe(msg) → {shaka.msf.BufferControlWriter}

Marshals a Subscribe message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.Subscribe
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalSubscribeError(msg) → {shaka.msf.BufferControlWriter}

Marshals a SubscribeError message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.SubscribeError
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalSubscribeNamespace(msg) → {shaka.msf.BufferControlWriter}

Marshals an SubscribeNamespace message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.SubscribeNamespace
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalSubscribeNamespaceError(msg) → {shaka.msf.BufferControlWriter}

Marshals an SubscribeNamespaceError message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.SubscribeNamespaceError
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalSubscribeNamespaceOk(msg) → {shaka.msf.BufferControlWriter}

Marshals an SubscribeNamespaceOk message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.SubscribeNamespaceOk
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalSubscribeOk(msg) → {shaka.msf.BufferControlWriter}

Marshals a SubscribeOk message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.SubscribeOk
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalSubscribeUpdate(msg) → {shaka.msf.BufferControlWriter}

Marshals a SubscribeUpdate message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.SubscribeUpdate
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalUnsubscribe(msg) → {shaka.msf.BufferControlWriter}

Marshals an Unsubscribe message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.Unsubscribe
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalUnsubscribeNamespace(msg) → {shaka.msf.BufferControlWriter}

Marshals an UnsubscribeNamespace message to the buffer
Parameters:
Name Type Description
msg shaka.msf.Utils.UnsubscribeNamespace
Source:
Returns:
Type
shaka.msf.BufferControlWriter

marshalWithLength(messageType, writeContent)

Helper method to marshal a message with proper type and length
Parameters:
Name Type Description
messageType shaka.msf.Utils.MessageTypeId
writeContent function()
Source:

reset()

Resets the buffer to start writing from the beginning
Source:

writeArray_(arraynon-null, writeFn)

Writes an array with a var int length prefix
Parameters:
Name Type Description
array Array<T>
writeFn function(T)
Source:

writeBoolAsUint8_(value)

Writes a boolean value as a uint8 to the buffer
Parameters:
Name Type Description
value boolean
Source:

writeKeyValuePair_(pair)

Writes a single key-value pair to the buffer
Parameters:
Name Type Description
pair shaka.msf.Utils.KeyValuePair
Source:

writeKeyValuePairs_(pairs)

Writes an array of key-value pairs to the buffer
Parameters:
Name Type Description
pairs Array<shaka.msf.Utils.KeyValuePair> | undefined
Source:

writeLocation_(location)

Writes a location to the buffer
Parameters:
Name Type Description
location shaka.msf.Utils.Location
Source:

writeString_(str)

Writes a string to the buffer
Parameters:
Name Type Description
str string
Source:

writeTuple_(tuple)

Writes a tuple (array of strings) to the buffer
Parameters:
Name Type Description
tuple Array<string>
Source: