You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.2 KiB
96 lines
2.2 KiB
#ifndef __BASICMEDIAINPUT_H_INCL__
|
|
#define __BASICMEDIAINPUT_H_INCL__
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/types.h>
|
|
|
|
#ifdef __linux__
|
|
#include <sys/time.h>
|
|
#include <unistd.h>
|
|
#include <sys/mman.h>
|
|
#include <linux/types.h>
|
|
#include <pthread.h>
|
|
#include <sys/ioctl.h>
|
|
#include <linux/ioctl.h>
|
|
#include <linux/videodev2.h>
|
|
#endif
|
|
|
|
#include "basicThread.h"
|
|
|
|
#include "basicLIBAV.h"
|
|
|
|
#define _VIN_DefaultWidth 640
|
|
#define _VIN_DefaultHeight 480
|
|
#define ARM_BR_NOW 0
|
|
#define _VIN_DefaultQueueSize 15
|
|
#define _VIN_DefaultFPS 15
|
|
|
|
typedef enum _VI_SAVE_MODE{
|
|
VI_NO_SAVE_MODE = 0,
|
|
VI_IMAGE_SEQUENCE = 1,
|
|
VI_MJPEG_FILE = 2,
|
|
VI_MPEG1_FILE = 3,
|
|
VI_MPEG2_FILE = 4,
|
|
VI_MP4_FILE = 5
|
|
} _VI_SAVE_MODE;
|
|
|
|
typedef enum _THREAD_STATUS{
|
|
VI_CREATED = 0,
|
|
VI_INIT_OK = 1,
|
|
VI_DEVICE_OK = 2,
|
|
VI_SETTINGS_OK = 3,
|
|
VI_MEMORY_OK = 4,
|
|
VI_STREAM_OK = 5,
|
|
VI_WORKING_OK = 6,
|
|
VI_STOPED = 7,
|
|
VI_RESTARTING = 8
|
|
} _THREAD_STATUS;
|
|
|
|
#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
|
|
#define VIDEO_PICTURE_QUEUE_SIZE 30
|
|
#define BUFFER_ALIGN 32
|
|
|
|
typedef enum _MediaTypes{
|
|
MT_UNDEFINED = 0,
|
|
MT_VIDEO = 1,
|
|
MT_AUDIO = 2,
|
|
MT_DEVICE = 4,
|
|
MT_FILE = 8,
|
|
MT_NETWORK = 16
|
|
} _MediaTypes;
|
|
|
|
/**
|
|
* basicMediaInput - parent to all (Audio/Video) media input
|
|
* pins
|
|
*
|
|
* @author gagua
|
|
*/
|
|
class basicMediaInput: public basicThread {
|
|
protected:
|
|
uint8_t m_eType;
|
|
//int m_nBitRate;
|
|
//char m_pInputName[MAX_PATH_LEN];
|
|
VideoState m_sMediaState;
|
|
public:
|
|
// Constructor
|
|
basicMediaInput();
|
|
|
|
basicMediaInput( _MediaTypes mediaType );
|
|
|
|
basicMediaInput( CSTR InputName, _MediaTypes mediaType = MT_UNDEFINED );
|
|
// Destructor
|
|
virtual ~basicMediaInput();
|
|
bool create( CSTR URI, _MediaTypes mediaType = MT_UNDEFINED );
|
|
// Copy constructor
|
|
// TODO: Uncomment the copy constructor when you need it.
|
|
//basicMediaInput(const basicMediaInput& src);
|
|
|
|
// Assignment operator
|
|
// TODO: Uncomment the assignment operator when you need it.
|
|
//basicMediaInput& operator=(const basicMediaInput& src);
|
|
};
|
|
|
|
#endif // __BASICMEDIAINPUT_H_INCL__
|