/*
 *  FFMPEGDummySource.h
 *  live555 Test
 *
 *  Created by Severin Schoepke on 05.06.07.
 *  Copyright 2007 Neotrivium AG. All rights reserved.
 *
 */

#ifndef FFMPEG_DUMMY_SOURCE_H
#define FFMPEG_DUMMY_SOURCE_H

#include "FFMPEGEncoder.hh"

#ifndef _FRAMED_SOURCE_HH
#include "FramedSource.hh"
#endif

#define AUDIO_SOURCE 0
#define VIDEO_SOURCE 1

class FFMPEGDummySource: public FramedSource 
{
public:
    static FFMPEGDummySource* createNew(UsageEnvironment& env, 
                                        FFMPEGEncoder *encoder,
                                        int sourceType);
    
protected:
    FFMPEGDummySource(UsageEnvironment& env, 
                      FFMPEGEncoder *encoder,
                      int sourceType);
    virtual         ~FFMPEGDummySource();
    
private:
    virtual void    doGetNextFrame();
    void            deliverFrame();
    
    void            generateDummyImage(void);
    void            generateDummySound(void);
    
    FFMPEGEncoder   *_encoder;
    int             _sourceType;
    int             _frameDuration;
    struct timeval  _startTime;
    struct timeval  _lastTime;
    
    void            *_inputBuffer;
    unsigned int    _inputBufferSize;
    
    unsigned int    _streamedFrames;
    unsigned int    _streamedBytes;
};

#endif