src/main/java/com/amazonaws/kinesisvideo/internal/mediasource/bytes/BytesGenerator.java [48:88]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void onStreamDataAvailable(final OnStreamDataAvailable streamDataAvailable) {
        this.streamDataAvailable = streamDataAvailable;
    }

    public synchronized void start() {
        if (isRunning) {
            throw new IllegalStateException("should stop previous generator before starting the new one");
        }

        isRunning = true;

        startGeneratorInBackground();
    }

    public synchronized void stop() {
        isRunning = false;
    }

    private void startGeneratorInBackground() {
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    generateBytesAndNotifyListener();
                } catch (final KinesisVideoException e) {
                    log.error("Failed to keep generating frames with Exception", e);
                }
            }
        });
    }

    private void generateBytesAndNotifyListener() throws KinesisVideoException {
        while (isRunning) {
            fillArrayWithDigitsOfFramesCounter();

            if (streamDataAvailable != null) {
                streamDataAvailable
                        .onFrameDataAvailable(createKinesisVideoFrame());
            }

            frameCounter++;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/com/amazonaws/kinesisvideo/internal/mediasource/multitrack/MultiTrackFrameSource.java [46:86]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void onStreamDataAvailable(final OnStreamDataAvailable streamDataAvailable) {
        this.streamDataAvailable = streamDataAvailable;
    }

    public synchronized void start() {
        if (isRunning) {
            throw new IllegalStateException("should stop previous generator before starting the new one");
        }

        isRunning = true;

        startGeneratorInBackground();
    }

    public synchronized void stop() {
        isRunning = false;
    }

    private void startGeneratorInBackground() {
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    generateBytesAndNotifyListener();
                } catch (final KinesisVideoException e) {
                    log.error("Failed to keep generating frames with Exception", e);
                }
            }
        });
    }

    private void generateBytesAndNotifyListener() throws KinesisVideoException {
        while (isRunning) {
            fillArrayWithDigitsOfFramesCounter();

            if (streamDataAvailable != null) {
                streamDataAvailable
                        .onFrameDataAvailable(createKinesisVideoFrame());
            }

            frameCounter++;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



