libeplayer3: cleanup types

This commit is contained in:
martii
2014-04-05 10:01:52 +02:00
parent 10e201b279
commit e5237866c4
30 changed files with 68 additions and 91 deletions

View File

@@ -18,9 +18,12 @@ typedef enum {
CONTAINER_METADATA,
} ContainerCmd_t;
struct Context_s;
typedef struct Context_s Context_t;
typedef struct Container_s {
char *Name;
int (*Command) ( /*Context_t */ void *, ContainerCmd_t, void *);
int (*Command) (Context_t *, ContainerCmd_t, void *);
char **Capabilities;
} Container_t;
@@ -31,7 +34,7 @@ extern Container_t FFMPEGContainer;
typedef struct ContainerHandler_s {
char *Name;
Container_t *selectedContainer;
int (*Command) ( /*Context_t */ void *, ContainerCmd_t, void *);
int (*Command) (Context_t *, ContainerCmd_t, void *);
} ContainerHandler_t;
#endif

View File

@@ -4,6 +4,12 @@
#include <stdio.h>
#include <stdint.h>
#include <libavutil/avutil.h>
#include <libavutil/time.h>
#include <libavformat/avformat.h>
#include <libswresample/swresample.h>
#include <libavutil/opt.h>
typedef enum {
MANAGER_ADD,
MANAGER_LIST,
@@ -44,14 +50,16 @@ typedef struct Track_s {
int height;
/* stream from ffmpeg */
void *stream;
AVStream *stream;
/* codec extra data (header or some other stuff) */
void *extraData;
uint8_t *extraData;
int extraSize;
#if 0
uint8_t *aacbuf;
unsigned int aacbuflen;
int have_aacheader;
#endif
/* If player2 or the elf do not support decoding of audio codec set this.
* AVCodec is than used for softdecoding and stream will be injected as PCM */
@@ -64,9 +72,12 @@ typedef struct Track_s {
long long int chapter_end;
} Track_t;
struct Context_s;
typedef struct Context_s Context_t;
typedef struct Manager_s {
char *Name;
int (*Command) ( /*Context_t */ void *, ManagerCmd_t, void *);
int (*Command) ( Context_t *, ManagerCmd_t, void *);
char **Capabilities;
} Manager_t;

View File

@@ -2,6 +2,7 @@
#define OUTPUT_H_
#include <stdio.h>
#include <stdint.h>
typedef enum {
OUTPUT_INIT,
@@ -28,13 +29,13 @@ typedef enum {
} OutputCmd_t;
typedef struct {
unsigned char *data;
uint8_t *data;
unsigned int len;
unsigned char *extradata;
uint8_t *extradata;
unsigned int extralen;
unsigned long long int pts;
uint64_t pts;
float frameRate;
unsigned int timeScale;
@@ -45,10 +46,13 @@ typedef struct {
char *type;
} AudioVideoOut_t;
struct Context_s;
typedef struct Context_s Context_t;
typedef struct Output_s {
char *Name;
int (*Command) ( /*Context_t */ void *, OutputCmd_t, void *);
int (*Write) ( /*Context_t */ void *, void *privateData);
int (*Command) (Context_t *, OutputCmd_t, void *);
int (*Write) (Context_t *, AudioVideoOut_t *privateData);
char **Capabilities;
} Output_t;
@@ -60,7 +64,7 @@ typedef struct OutputHandler_s {
char *Name;
Output_t *audio;
Output_t *video;
int (*Command) ( /*Context_t */ void *, OutputCmd_t, void *);
int (*Command) (Context_t *, OutputCmd_t, void *);
} OutputHandler_t;
#endif

View File

@@ -26,7 +26,7 @@
#define VC1_VIDEO_PES_START_CODE 0xfd
#define AAC_AUDIO_PES_START_CODE 0xcf
int InsertPesHeader(unsigned char *data, int size, unsigned char stream_id, unsigned long long int pts, int pic_start_code);
int InsertVideoPrivateDataHeader(unsigned char *data, int payload_size);
int InsertPesHeader(uint8_t *data, int size, unsigned char stream_id, unsigned long long int pts, int pic_start_code);
int InsertVideoPrivateDataHeader(uint8_t *data, int payload_size);
#endif

View File

@@ -11,6 +11,9 @@ typedef enum { PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP,
PLAYBACK_SWITCH_TELETEXT
} PlaybackCmd_t;
struct Context_s;
typedef struct Context_s Context_t;
typedef struct PlaybackHandler_s {
char *Name;
@@ -33,7 +36,7 @@ typedef struct PlaybackHandler_s {
unsigned char abortRequested;
unsigned char abortPlayback;
int (*Command) ( /*Context_t */ void *, PlaybackCmd_t, void *);
int (*Command) ( Context_t *, PlaybackCmd_t, void *);
char *uri;
unsigned char noprobe; /* hack: only minimal probing in av_find_stream_info */
unsigned long long readCount;

View File

@@ -8,10 +8,10 @@ typedef enum { eNone, eAudio, eVideo, eGfx } eWriterType_t;
typedef struct {
int fd;
unsigned char *data;
uint8_t *data;
unsigned int len;
unsigned long long int Pts;
unsigned char *private_data;
uint64_t Pts;
uint8_t *private_data;
unsigned int private_size;
unsigned int FrameRate;
unsigned int FrameScale;
@@ -30,8 +30,8 @@ typedef struct WriterCaps_s {
typedef struct Writer_s {
int (*reset) ();
int (*writeData) (void *);
int (*writeReverseData) (void *);
int (*writeData) (WriterAVCallData_t *);
int (*writeReverseData) (WriterAVCallData_t *);
WriterCaps_t *caps;
} Writer_t;