Producers must comply to the mmstream.producer.ProducerControl
interface.
The interface is an extension of the java.lang.Runnable
interface. Hence, a java.lang.Thread
object can be generated from implementations of the
ProducerControl
interface. Because Producers are multimedia objects, the
ProducerControl
interface comprises a
Start()
, a Stop()
, and a Finish()
method.
To facilitate control over the quantity of the Producer's data generation, the
ConsumerControl
interface contains a pair of accessor functions for the maximum allowed
bandwidth, the maximum length of the produced Chunk
byte
array, and the maximum
allowed Chunk
rate.
At the moment, the mmstream.producer
package includes two ProducerControl
implementations. The simple Byte_Producer
class generates Chunk
objects whose
byte
array elements all contain a number that is incremented for each produced
Chunk
object. The generated Chunk
objects can be interpreted as RGB images in
order to simulate a video stream.
The File_Producer
forwards Chunk
objects previously stored in a
SessionFile
object by a File_Consumer
object.