mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libeplayer3: cleanup types
This commit is contained in:
@@ -41,9 +41,8 @@ if (debug_level >= level) printf(x); } while (0)
|
||||
#define container_err(x...)
|
||||
#endif
|
||||
|
||||
static int Command(void *_context, ContainerCmd_t command, void *argument __attribute__((unused)))
|
||||
static int Command(Context_t *context, ContainerCmd_t command, void *argument __attribute__((unused)))
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = 0;
|
||||
|
||||
container_printf(10, "%s::%s\n", __FILE__, __func__);
|
||||
|
@@ -39,12 +39,6 @@
|
||||
#include <pthread.h>
|
||||
#include <sys/prctl.h>
|
||||
|
||||
#include <libavutil/avutil.h>
|
||||
#include <libavutil/time.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libswresample/swresample.h>
|
||||
#include <libavutil/opt.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "misc.h"
|
||||
#include "debug.h"
|
||||
@@ -450,7 +444,7 @@ static void FFMPEGThread(Context_t * context)
|
||||
while (packet_size > 0) {
|
||||
int got_frame = 0;
|
||||
if (!decoded_frame) {
|
||||
if (!(decoded_frame = avcodec_alloc_frame())) {
|
||||
if (!(decoded_frame = av_frame_alloc())) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -1430,9 +1424,8 @@ static int container_ffmpeg_get_metadata(Context_t * context, char ***p)
|
||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
}
|
||||
|
||||
static int Command(void *_context, ContainerCmd_t command, void *argument)
|
||||
static int Command(Context_t *context, ContainerCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
|
||||
ffmpeg_printf(50, "Command %d\n", command);
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -185,9 +185,8 @@ static int ManagerDel(Context_t * context)
|
||||
}
|
||||
|
||||
|
||||
static int Command(void *_context, ManagerCmd_t command, void *argument)
|
||||
static int Command(Context_t *context, ManagerCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_AUDIO_MGR_NO_ERROR;
|
||||
|
||||
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||
|
@@ -175,9 +175,8 @@ static int ManagerDel(Context_t * context __attribute__((unused)))
|
||||
return cERR_CHAPTER_MGR_NO_ERROR;
|
||||
}
|
||||
|
||||
static int Command(void *_context, ManagerCmd_t command, void *argument)
|
||||
static int Command(Context_t *context, ManagerCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_CHAPTER_MGR_NO_ERROR;
|
||||
|
||||
chapter_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||
|
@@ -90,7 +90,9 @@ void freeTrack(Track_t * track)
|
||||
if (track->language != NULL)
|
||||
free(track->language);
|
||||
|
||||
#if 0
|
||||
if (track->aacbuf != NULL)
|
||||
free(track->aacbuf);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -181,9 +181,8 @@ static int ManagerDel(Context_t * context __attribute__((unused)))
|
||||
return cERR_SUBTITLE_MGR_NO_ERROR;
|
||||
}
|
||||
|
||||
static int Command(void *_context, ManagerCmd_t command, void *argument)
|
||||
static int Command(Context_t *context, ManagerCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_SUBTITLE_MGR_NO_ERROR;
|
||||
|
||||
subtitle_mgr_printf(50, "%s::%s %d\n", FILENAME, __FUNCTION__,
|
||||
|
@@ -182,9 +182,8 @@ static int ManagerDel(Context_t * context __attribute__((unused)))
|
||||
}
|
||||
|
||||
|
||||
static int Command(void *_context, ManagerCmd_t command, void *argument)
|
||||
static int Command(Context_t *context, ManagerCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_TELETEXT_MGR_NO_ERROR;
|
||||
|
||||
teletext_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||
|
@@ -180,9 +180,8 @@ static int ManagerDel(Context_t * context)
|
||||
return cERR_VIDEO_MGR_NO_ERROR;
|
||||
}
|
||||
|
||||
static int Command(void *_context, ManagerCmd_t command, void *argument)
|
||||
static int Command(Context_t *context, ManagerCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_VIDEO_MGR_NO_ERROR;
|
||||
|
||||
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||
|
@@ -894,10 +894,8 @@ int LinuxDvbSwitch(Context_t * context, char *type)
|
||||
return cERR_LINUXDVB_NO_ERROR;
|
||||
}
|
||||
|
||||
static int Write(void *_context, void *_out)
|
||||
static int Write(Context_t *context, AudioVideoOut_t *out)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
AudioVideoOut_t *out = (AudioVideoOut_t *) _out;
|
||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||
int res = 0;
|
||||
unsigned char video = 0;
|
||||
@@ -1045,9 +1043,8 @@ static int reset(Context_t * context)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int Command(void *_context, OutputCmd_t command, void *argument)
|
||||
static int Command(Context_t *context, OutputCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||
|
||||
linuxdvb_printf(50, "Command %d\n", command);
|
||||
|
@@ -127,9 +127,8 @@ static void OutputDel(Context_t * context, char *port)
|
||||
|
||||
}
|
||||
|
||||
static int Command(void *_context, OutputCmd_t command, void *argument)
|
||||
static int Command(Context_t *context, OutputCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_OUTPUT_NO_ERROR;
|
||||
|
||||
output_printf(10, "%s::%s Command %d\n", FILENAME, __FUNCTION__,
|
||||
|
@@ -212,10 +212,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
unsigned char ExtraData[AAC_HEADER_LENGTH];
|
||||
unsigned int PacketLength;
|
||||
|
@@ -91,10 +91,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
ac3_printf(10, "\n");
|
||||
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
|
@@ -91,10 +91,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
unsigned char FakeHeaders[64]; // 64bytes should be enough to make the fake headers
|
||||
unsigned int FakeHeaderLength;
|
||||
|
@@ -93,10 +93,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
unsigned char PesHeader[PES_AUDIO_HEADER_SIZE];
|
||||
|
||||
dts_printf(10, "\n");
|
||||
|
@@ -89,10 +89,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
|
||||
flac_printf(10, "\n");
|
||||
|
@@ -89,10 +89,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
int len = 0;
|
||||
|
||||
|
@@ -108,10 +108,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
unsigned long long int VideoPts;
|
||||
unsigned int TimeDelta;
|
||||
@@ -385,10 +383,8 @@ static int writeData(void *_call)
|
||||
return len;
|
||||
}
|
||||
|
||||
static int writeReverseData(void *_call)
|
||||
static int writeReverseData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
h264_printf(10, "\n");
|
||||
|
||||
if (call == NULL) {
|
||||
|
@@ -89,10 +89,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
|
||||
mp3_printf(10, "\n");
|
||||
|
@@ -90,10 +90,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
int len = 0;
|
||||
unsigned int Position = 0;
|
||||
|
@@ -184,10 +184,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
|
||||
pcm_printf(10, "\n");
|
||||
|
@@ -121,10 +121,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
int len = 0;
|
||||
|
||||
vc1_printf(10, "\n");
|
||||
|
@@ -93,10 +93,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
int len = 0;
|
||||
|
||||
wma_printf(10, "\n");
|
||||
|
@@ -118,10 +118,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
|
||||
awmv_t private_data;
|
||||
int len = 0;
|
||||
|
||||
|
@@ -740,9 +740,8 @@ static int PlaybackMetadata(Context_t * context, char ***metadata)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int Command(void *_context, PlaybackCmd_t command, void *argument)
|
||||
static int Command(Context_t *context, PlaybackCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context; /* to satisfy compiler */
|
||||
int ret = cERR_PLAYBACK_NO_ERROR;
|
||||
|
||||
playback_printf(20, "Command %d\n", command);
|
||||
|
Reference in New Issue
Block a user