libeplayer3: c++ adjustments

This commit is contained in:
martii
2014-04-05 16:02:06 +02:00
parent b6c1f8a5e3
commit ec307c0f09
21 changed files with 308 additions and 820 deletions

View File

@@ -16,5 +16,5 @@ typedef struct Context_s {
int64_t *currentAudioPtsP;
} Context_t;
int container_ffmpeg_update_tracks(Context_t * context, char *filename);
int container_ffmpeg_update_tracks(Context_t * context, const char *filename);
#endif

View File

@@ -22,19 +22,18 @@ struct Context_s;
typedef struct Context_s Context_t;
typedef struct Container_s {
char *Name;
int (*Command) (Context_t *, ContainerCmd_t, void *);
char **Capabilities;
const char *Name;
int (*Command) (Context_t *, ContainerCmd_t, const char *);
const char **Capabilities;
} Container_t;
extern Container_t FFMPEGContainer;
typedef struct ContainerHandler_s {
char *Name;
const char *Name;
Container_t *selectedContainer;
int (*Command) (Context_t *, ContainerCmd_t, void *);
int (*Command) (Context_t *, ContainerCmd_t, const char *);
} ContainerHandler_t;
#endif

View File

@@ -3,12 +3,15 @@
#include <stdio.h>
#include <stdint.h>
#include <string>
extern "C" {
#include <libavutil/avutil.h>
#include <libavutil/time.h>
#include <libavformat/avformat.h>
#include <libswresample/swresample.h>
#include <libavutil/opt.h>
}
typedef enum {
MANAGER_ADD,
@@ -28,8 +31,8 @@ typedef enum {
} eTrackTypeEplayer;
typedef struct Track_s {
char *Name;
char *Encoding;
std::string Name;
const char *Encoding;
int Id;
/* new field for ffmpeg - add at the end so no problem
@@ -50,20 +53,21 @@ typedef struct Track_s {
int is_static;
long long int chapter_start;
long long int chapter_end;
Track_s() : Encoding(NULL), Id(0), language(NULL), duration(-1), avfc(NULL), stream(NULL), pending(0), is_static(0), chapter_start(0), chapter_end(0) {}
} Track_t;
struct Context_s;
typedef struct Context_s Context_t;
typedef struct Manager_s {
char *Name;
const char *Name;
int (*Command) ( Context_t *, ManagerCmd_t, void *);
char **Capabilities;
const char **Capabilities;
} Manager_t;
typedef struct ManagerHandler_s {
char *Name;
const char *Name;
Manager_t *audio;
Manager_t *video;
Manager_t *subtitle;

View File

@@ -4,11 +4,13 @@
#include <stdio.h>
#include <stdint.h>
extern "C" {
#include <libavutil/avutil.h>
#include <libavutil/time.h>
#include <libavformat/avformat.h>
#include <libswresample/swresample.h>
#include <libavutil/opt.h>
}
typedef enum {
OUTPUT_INIT,
@@ -46,7 +48,7 @@ typedef struct {
int64_t pts;
char *type;
const char *type;
AVFormatContext *avfc;
AVStream *stream;
@@ -57,10 +59,10 @@ struct Context_s;
typedef struct Context_s Context_t;
typedef struct Output_s {
char *Name;
int (*Command) (Context_t *, OutputCmd_t, void *);
const char *Name;
int (*Command) (Context_t *, OutputCmd_t, const char *);
int (*Write) (Context_t *, AudioVideoOut_t *privateData);
char **Capabilities;
const char **Capabilities;
} Output_t;
@@ -68,10 +70,10 @@ extern Output_t LinuxDvbOutput;
extern Output_t SubtitleOutput;
typedef struct OutputHandler_s {
char *Name;
const char *Name;
Output_t *audio;
Output_t *video;
int (*Command) (Context_t *, OutputCmd_t, void *);
int (*Command) (Context_t *, OutputCmd_t, const char *);
} OutputHandler_t;
#endif

View File

@@ -1,6 +1,7 @@
#ifndef PLAYBACK_H_
#define PLAYBACK_H_
#include <sys/types.h>
#include <string>
typedef enum { PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP,
PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM,
@@ -15,7 +16,7 @@ struct Context_s;
typedef struct Context_s Context_t;
typedef struct PlaybackHandler_s {
char *Name;
const char *Name;
int fd;
@@ -37,7 +38,7 @@ typedef struct PlaybackHandler_s {
unsigned char abortPlayback;
int (*Command) ( Context_t *, PlaybackCmd_t, void *);
char *uri;
std::string uri;
unsigned char noprobe; /* hack: only minimal probing in av_find_stream_info */
unsigned long long readCount;
} PlaybackHandler_t;

View File

@@ -4,11 +4,13 @@
#include <stdio.h>
#include <stdint.h>
extern "C" {
#include <libavutil/avutil.h>
#include <libavutil/time.h>
#include <libavformat/avformat.h>
#include <libswresample/swresample.h>
#include <libavutil/opt.h>
}
typedef enum { eNone, eAudio, eVideo, eGfx } eWriterType_t;
@@ -32,9 +34,9 @@ typedef struct {
} WriterAVCallData_t;
typedef struct WriterCaps_s {
char *name;
const char *name;
eWriterType_t type;
char *textEncoding;
const char *textEncoding;
/* fixme: revise if this is an enum! */
int dvbEncoding;
} WriterCaps_t;