mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 07:23:11 +02:00
libeplayer3-arm: cleanup types, use Context_t in commands
This commit is contained in:
@@ -98,9 +98,8 @@ static int32_t selectContainer(Context_t *context, char *extension)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int Command(void *_context, ContainerCmd_t command, void *argument)
|
||||
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__, __FUNCTION__);
|
||||
|
||||
|
@@ -42,12 +42,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 <ffmpeg/mpeg4audio.h>
|
||||
|
||||
#include "common.h"
|
||||
@@ -56,10 +50,12 @@
|
||||
#include "aac.h"
|
||||
#include "pcm.h"
|
||||
#include "ffmpeg_metadata.h"
|
||||
|
||||
/* ***************************** */
|
||||
/* Makros/Constants */
|
||||
/* ***************************** */
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR > 57)
|
||||
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR > 56)
|
||||
#define TS_BYTES_SEEKING 0
|
||||
#else
|
||||
#define TS_BYTES_SEEKING 1
|
||||
@@ -1302,7 +1298,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
||||
void *opaque = NULL;
|
||||
const char *protoName = NULL;
|
||||
uint8_t haveNativeProto = 0;
|
||||
while (protoName = avio_enum_protocols(&opaque, 1))
|
||||
while ((protoName = avio_enum_protocols(&opaque, 1)))
|
||||
{
|
||||
if (0 == strcmp("rtmp", protoName))
|
||||
{
|
||||
@@ -2581,12 +2577,14 @@ static int container_ffmpeg_get_metadata(Context_t * context, char ***p)
|
||||
size_t psize = 1;
|
||||
char **pp;
|
||||
|
||||
if (!context) {
|
||||
if (!context)
|
||||
{
|
||||
fprintf(stderr, "BUG %s:%d\n", __func__, __LINE__);
|
||||
return cERR_CONTAINER_FFMPEG_ERR;
|
||||
}
|
||||
|
||||
if (!p || *p) {
|
||||
if (!p || *p)
|
||||
{
|
||||
fprintf(stderr, "BUG %s:%d\n", __func__, __LINE__);
|
||||
return cERR_CONTAINER_FFMPEG_ERR;
|
||||
}
|
||||
@@ -2602,28 +2600,34 @@ static int container_ffmpeg_get_metadata(Context_t * context, char ***p)
|
||||
psize += av_dict_count(((AVStream *)(audioTrack->stream))->metadata);
|
||||
|
||||
*p = malloc(sizeof(char *) * psize * 2);
|
||||
if (!*p) {
|
||||
if (!*p)
|
||||
{
|
||||
fprintf(stderr, "MALLOC %s:%d\n", __func__, __LINE__);
|
||||
return cERR_CONTAINER_FFMPEG_ERR;
|
||||
}
|
||||
pp = *p;
|
||||
|
||||
if (avContextTab[0]->metadata)
|
||||
while ((tag = av_dict_get(avContextTab[0]->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
|
||||
while ((tag = av_dict_get(avContextTab[0]->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
|
||||
{
|
||||
*pp++ = strdup(tag->key);
|
||||
*pp++ = strdup(tag->value);
|
||||
}
|
||||
|
||||
if (videoTrack) {
|
||||
if (videoTrack)
|
||||
{
|
||||
tag = NULL;
|
||||
while ((tag = av_dict_get(((AVStream *)(videoTrack->stream))->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
|
||||
while ((tag = av_dict_get(((AVStream *)(videoTrack->stream))->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
|
||||
{
|
||||
*pp++ = strdup(tag->key);
|
||||
*pp++ = strdup(tag->value);
|
||||
}
|
||||
}
|
||||
if (audioTrack) {
|
||||
if (audioTrack)
|
||||
{
|
||||
tag = NULL;
|
||||
while ((tag = av_dict_get(((AVStream *)(audioTrack->stream))->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
|
||||
while ((tag = av_dict_get(((AVStream *)(audioTrack->stream))->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
|
||||
{
|
||||
*pp++ = strdup(tag->key);
|
||||
*pp++ = strdup(tag->value);
|
||||
}
|
||||
@@ -2634,9 +2638,8 @@ static int container_ffmpeg_get_metadata(Context_t * context, char ***p)
|
||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
}
|
||||
|
||||
static int32_t Command(void *_context, ContainerCmd_t command, void *argument)
|
||||
static int32_t 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);
|
||||
if (command != CONTAINER_SET_BUFFER_SEEK_TIME &&
|
||||
|
@@ -28,10 +28,13 @@ typedef enum
|
||||
CONTAINER_GET_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;
|
||||
@@ -43,7 +46,7 @@ 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,
|
||||
@@ -54,11 +60,11 @@ typedef struct Track_s
|
||||
int32_t aspect_ratio_den;
|
||||
|
||||
/* stream from ffmpeg */
|
||||
void *stream;
|
||||
AVStream *stream;
|
||||
/* AVCodecContext for steam */
|
||||
void *avCodecCtx;
|
||||
/* codec extra data (header or some other stuff) */
|
||||
void *extraData;
|
||||
uint8_t *extraData;
|
||||
int extraSize;
|
||||
|
||||
uint8_t *aacbuf;
|
||||
@@ -88,10 +94,13 @@ typedef struct TrackDescription_s
|
||||
int progressive;
|
||||
} TrackDescription_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;
|
||||
|
||||
|
@@ -64,11 +64,14 @@ typedef struct
|
||||
char *type;
|
||||
} SubtitleOut_t;
|
||||
|
||||
struct Context_s;
|
||||
typedef struct Context_s Context_t;
|
||||
|
||||
typedef struct Output_s
|
||||
{
|
||||
char *Name;
|
||||
int32_t (* Command)(/*Context_t*/void *, OutputCmd_t, void *);
|
||||
int32_t (* Write)(/*Context_t*/void *, void *privateData);
|
||||
int32_t (* Command)(Context_t *, OutputCmd_t, void *);
|
||||
int32_t (* Write)(Context_t *, void *privateData);
|
||||
char **Capabilities;
|
||||
} Output_t;
|
||||
|
||||
@@ -81,7 +84,7 @@ typedef struct OutputHandler_s
|
||||
Output_t *audio;
|
||||
Output_t *video;
|
||||
Output_t *subtitle;
|
||||
int32_t (* Command)(/*Context_t*/void *, OutputCmd_t, void *);
|
||||
int32_t (* Command)(Context_t *, OutputCmd_t, void *);
|
||||
} OutputHandler_t;
|
||||
|
||||
#endif
|
||||
|
@@ -26,6 +26,9 @@ typedef enum {
|
||||
PLAYBACK_METADATA
|
||||
} PlaybackCmd_t;
|
||||
|
||||
struct Context_s;
|
||||
typedef struct Context_s Context_t;
|
||||
|
||||
typedef struct PlaybackHandler_s
|
||||
{
|
||||
char *Name;
|
||||
@@ -51,7 +54,7 @@ typedef struct PlaybackHandler_s
|
||||
uint8_t isSubtitle;
|
||||
uint8_t abortRequested;
|
||||
|
||||
int32_t (* Command)(/*Context_t*/void *, PlaybackCmd_t, void *);
|
||||
int32_t (* Command)(Context_t *, PlaybackCmd_t, void *);
|
||||
char *uri;
|
||||
off_t size;
|
||||
uint8_t noprobe; /* hack: only minimal probing in av_find_stream_info */
|
||||
|
@@ -10,11 +10,11 @@ typedef enum { eNone, eAudio, eVideo} eWriterType_t;
|
||||
typedef struct
|
||||
{
|
||||
int fd;
|
||||
unsigned char *data;
|
||||
uint8_t *data;
|
||||
unsigned int len;
|
||||
unsigned long long int Pts;
|
||||
uint64_t Pts;
|
||||
unsigned long long int Dts;
|
||||
unsigned char *private_data;
|
||||
uint8_t *private_data;
|
||||
unsigned int private_size;
|
||||
unsigned int FrameRate;
|
||||
unsigned int FrameScale;
|
||||
@@ -38,7 +38,7 @@ typedef struct WriterCaps_s
|
||||
typedef struct Writer_s
|
||||
{
|
||||
int (* reset)();
|
||||
int (* writeData)(void *);
|
||||
int (* writeData)(WriterAVCallData_t *);
|
||||
WriterCaps_t *caps;
|
||||
} Writer_t;
|
||||
|
||||
|
@@ -212,9 +212,8 @@ static int ManagerDel(Context_t *context)
|
||||
return cERR_AUDIO_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_AUDIO_MGR_NO_ERROR;
|
||||
audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
|
||||
switch (command)
|
||||
@@ -228,7 +227,8 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
|
||||
case MANAGER_LIST:
|
||||
{
|
||||
container_ffmpeg_update_tracks(context, context->playback->uri, 0);
|
||||
*((TrackDescription_t **)argument) = ManagerList(context);
|
||||
// *((TrackDescription_t **)argument) = ManagerList(context);
|
||||
*((char ** *) argument) = (char **) ManagerList(context);
|
||||
break;
|
||||
}
|
||||
case MANAGER_GET:
|
||||
|
@@ -181,9 +181,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", __FILE__, __FUNCTION__);
|
||||
switch (command)
|
||||
|
@@ -347,11 +347,13 @@ int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
|
||||
linuxdvb_err("AUDIO_CLEAR_BUFFER: %s\n", strerror(errno));
|
||||
}
|
||||
/* set back to normal speed (end trickmodes) */
|
||||
// if (ioctl(audiofd, AUDIO_SET_SPEED, DVB_SPEED_NORMAL_PLAY) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("AUDIO_SET_SPEED: %s\n", strerror(errno));
|
||||
// }
|
||||
/*
|
||||
if (ioctl(audiofd, AUDIO_SET_SPEED, DVB_SPEED_NORMAL_PLAY) == -1)
|
||||
{
|
||||
linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
linuxdvb_err("AUDIO_SET_SPEED: %s\n", strerror(errno));
|
||||
}
|
||||
*/
|
||||
if (ioctl(audiofd, AUDIO_STOP) == -1)
|
||||
{
|
||||
linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
@@ -428,14 +430,16 @@ int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type)
|
||||
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus __attribute__((unused)))
|
||||
{
|
||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||
// int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
|
||||
// linuxdvb_printf(50, "\n");
|
||||
// if (ioctl(videofd, VIDEO_DISCONTINUITY, (void*) dis_type) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("VIDEO_DISCONTINUITY: %s\n", strerror(errno));
|
||||
// }
|
||||
// linuxdvb_printf(50, "exiting\n");
|
||||
/*
|
||||
int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
|
||||
linuxdvb_printf(50, "\n");
|
||||
if (ioctl(videofd, VIDEO_DISCONTINUITY, (void *) dis_type) == -1)
|
||||
{
|
||||
linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
linuxdvb_err("VIDEO_DISCONTINUITY: %s\n", strerror(errno));
|
||||
}
|
||||
linuxdvb_printf(50, "exiting\n");
|
||||
*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -476,28 +480,33 @@ int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
|
||||
|
||||
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
|
||||
{
|
||||
// unsigned char video = !strcmp("video", type);
|
||||
// unsigned char audio = !strcmp("audio", type);
|
||||
// linuxdvb_printf(10, "v%d a%d\n", video, audio);
|
||||
// if ((video && videofd != -1) || (audio && audiofd != -1)) {
|
||||
// getLinuxDVBMutex(FILENAME, __FUNCTION__,__LINE__);
|
||||
// if (video && videofd != -1) {
|
||||
// if (ioctl(videofd, VIDEO_FLUSH, NULL) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("VIDEO_FLUSH: %s\n", strerror(errno));
|
||||
// }
|
||||
// }
|
||||
// if (audio && audiofd != -1) {
|
||||
// if (ioctl(audiofd, AUDIO_FLUSH, NULL) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("AUDIO_FLUSH: %s\n", strerror(errno));
|
||||
// }
|
||||
// }
|
||||
// releaseLinuxDVBMutex(FILENAME, __FUNCTION__,__LINE__);
|
||||
// }
|
||||
// linuxdvb_printf(10, "exiting\n");
|
||||
/*
|
||||
unsigned char video = !strcmp("video", type);
|
||||
unsigned char audio = !strcmp("audio", type);
|
||||
linuxdvb_printf(10, "v%d a%d\n", video, audio);
|
||||
if ((video && videofd != -1) || (audio && audiofd != -1))
|
||||
{
|
||||
getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__);
|
||||
if (video && videofd != -1)
|
||||
{
|
||||
if (ioctl(videofd, VIDEO_FLUSH, NULL) == -1)
|
||||
{
|
||||
linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
linuxdvb_err("VIDEO_FLUSH: %s\n", strerror(errno));
|
||||
}
|
||||
}
|
||||
if (audio && audiofd != -1)
|
||||
{
|
||||
if (ioctl(audiofd, AUDIO_FLUSH, NULL) == -1)
|
||||
{
|
||||
linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
linuxdvb_err("AUDIO_FLUSH: %s\n", strerror(errno));
|
||||
}
|
||||
}
|
||||
releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__);
|
||||
}
|
||||
linuxdvb_printf(10, "exiting\n");
|
||||
*/
|
||||
return cERR_LINUXDVB_NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -546,12 +555,14 @@ int LinuxDvbFastForward(Context_t *context, char *type)
|
||||
getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__);
|
||||
speedIndex = context->playback->Speed % (sizeof(SpeedList) / sizeof(int));
|
||||
linuxdvb_printf(1, "speedIndex %d\n", speedIndex);
|
||||
// if (ioctl(videofd, VIDEO_SET_SPEED, SpeedList[speedIndex]) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("VIDEO_SET_SPEED: %s\n", strerror(errno));
|
||||
// ret = cERR_LINUXDVB_ERROR;
|
||||
// }
|
||||
/*
|
||||
if (ioctl(videofd, VIDEO_SET_SPEED, SpeedList[speedIndex]) == -1)
|
||||
{
|
||||
linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
linuxdvb_err("VIDEO_SET_SPEED: %s\n", strerror(errno));
|
||||
ret = cERR_LINUXDVB_ERROR;
|
||||
}
|
||||
*/
|
||||
releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__);
|
||||
}
|
||||
if (audio && audiofd != -1)
|
||||
@@ -559,12 +570,14 @@ int LinuxDvbFastForward(Context_t *context, char *type)
|
||||
getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__);
|
||||
speedIndex = context->playback->Speed % (sizeof(SpeedList) / sizeof(int));
|
||||
linuxdvb_printf(1, "speedIndex %d\n", speedIndex);
|
||||
// if (ioctl(audiofd, AUDIO_SET_SPEED, SpeedList[speedIndex]) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("AUDIO_SET_SPEED: %s\n", strerror(errno));
|
||||
// ret = cERR_LINUXDVB_ERROR;
|
||||
// }
|
||||
/*
|
||||
if (ioctl(audiofd, AUDIO_SET_SPEED, SpeedList[speedIndex]) == -1)
|
||||
{
|
||||
linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
linuxdvb_err("AUDIO_SET_SPEED: %s\n", strerror(errno));
|
||||
ret = cERR_LINUXDVB_ERROR;
|
||||
}
|
||||
*/
|
||||
releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__);
|
||||
}
|
||||
linuxdvb_printf(10, "exiting with value %d\n", ret);
|
||||
@@ -728,11 +741,13 @@ int LinuxDvbSwitch(Context_t *context, char *type)
|
||||
if (writer == NULL)
|
||||
{
|
||||
linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding);
|
||||
// if (ioctl(audiofd, AUDIO_SET_BYPASS_MODE, (void*) AUDIO_ENCODING_MP3) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("AUDIO_SET_BYPASS_MODE: %s\n", strerror(errno));
|
||||
// }
|
||||
/*
|
||||
if (ioctl(audiofd, AUDIO_SET_BYPASS_MODE, (void *) AUDIO_ENCODING_MP3) == -1)
|
||||
{
|
||||
linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
linuxdvb_err("AUDIO_SET_BYPASS_MODE: %s\n", strerror(errno));
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -776,11 +791,13 @@ int LinuxDvbSwitch(Context_t *context, char *type)
|
||||
if (writer == NULL)
|
||||
{
|
||||
linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding);
|
||||
// if (ioctl(videofd, VIDEO_SET_STREAMTYPE, (void*) VIDEO_ENCODING_AUTO) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("VIDEO_SET_STREAMTYPE: %s\n", strerror(errno));
|
||||
// }
|
||||
/*
|
||||
if (ioctl(videofd, VIDEO_SET_STREAMTYPE, (void *) VIDEO_ENCODING_AUTO) == -1)
|
||||
{
|
||||
linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
linuxdvb_err("VIDEO_SET_STREAMTYPE: %s\n", strerror(errno));
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -812,9 +829,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, void *_out)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
AudioVideoOut_t *out = (AudioVideoOut_t *) _out;
|
||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||
int res = 0;
|
||||
@@ -996,9 +1012,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);
|
||||
switch (command)
|
||||
|
@@ -147,9 +147,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", __FILE__, __FUNCTION__, command);
|
||||
switch (command)
|
||||
|
@@ -188,9 +188,8 @@ static int Flush()
|
||||
return cERR_SUBTITLE_NO_ERROR;
|
||||
}
|
||||
|
||||
static int Write(void *_context, void *data)
|
||||
static int Write(Context_t *context, void *data)
|
||||
{
|
||||
Context_t *context = (Context_t *)_context;
|
||||
char *Encoding = NULL;
|
||||
SubtitleOut_t *out = NULL;
|
||||
int32_t curtrackid = -1;
|
||||
@@ -257,9 +256,8 @@ static int32_t subtitle_Close(Context_t *context __attribute__((unused)))
|
||||
return cERR_SUBTITLE_NO_ERROR;
|
||||
}
|
||||
|
||||
static int Command(void *_context, OutputCmd_t command, void *argument __attribute__((unused)))
|
||||
static int Command(Context_t *context, OutputCmd_t command, void *argument __attribute__((unused)))
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_SUBTITLE_NO_ERROR;
|
||||
subtitle_printf(50, "%d\n", command);
|
||||
switch (command)
|
||||
|
@@ -156,9 +156,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _writeData(void *_call, int type)
|
||||
static int _writeData(WriterAVCallData_t *call, int type)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
aac_printf(10, "\n _writeData type[%d]\n", type);
|
||||
if (call == NULL)
|
||||
{
|
||||
@@ -199,9 +198,8 @@ static int _writeData(void *_call, int type)
|
||||
return writev_with_retry(call->fd, iov, 2);
|
||||
}
|
||||
|
||||
static int writeDataADTS(void *_call)
|
||||
static int writeDataADTS(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
aac_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
{
|
||||
@@ -221,7 +219,7 @@ static int writeDataADTS(void *_call)
|
||||
if ((call->private_data && 0 == strncmp("ADTS", (const char *)call->private_data, call->private_size)) ||
|
||||
HasADTSHeader(call->data, call->len))
|
||||
{
|
||||
return _writeData(_call, 0);
|
||||
return _writeData(call, 0);
|
||||
}
|
||||
uint32_t PacketLength = call->len + AAC_HEADER_LENGTH;
|
||||
uint8_t PesHeader[PES_MAX_HEADER_SIZE + AAC_HEADER_LENGTH];
|
||||
@@ -258,9 +256,8 @@ static int writeDataADTS(void *_call)
|
||||
return writev_with_retry(call->fd, iov, 2);
|
||||
}
|
||||
|
||||
static int writeDataLATM(void *_call)
|
||||
static int writeDataLATM(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
aac_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
{
|
||||
@@ -274,7 +271,7 @@ static int writeDataLATM(void *_call)
|
||||
}
|
||||
if (call->private_data && 0 == strncmp("LATM", (const char *)call->private_data, call->private_size))
|
||||
{
|
||||
return _writeData(_call, 1);
|
||||
return _writeData(call, 1);
|
||||
}
|
||||
aac_printf(10, "AudioPts %lld\n", call->Pts);
|
||||
if (!pLATMCtx)
|
||||
|
@@ -95,9 +95,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];
|
||||
if (call == NULL)
|
||||
|
@@ -96,9 +96,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 + 4 + 9];
|
||||
amr_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
|
@@ -113,9 +113,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 + 4];
|
||||
// unsigned char Version = 5;
|
||||
// unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE;
|
||||
|
@@ -100,9 +100,8 @@ static int32_t reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
uint8_t PesHeader[PES_AUDIO_HEADER_SIZE];
|
||||
dts_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
|
@@ -91,9 +91,8 @@ static int32_t reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
uint8_t PesHeader[PES_MAX_HEADER_SIZE];
|
||||
int32_t len = 0;
|
||||
h263_printf(10, "\n");
|
||||
|
@@ -284,9 +284,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;
|
||||
|
@@ -168,9 +168,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;
|
||||
|
@@ -132,9 +132,8 @@ static int32_t reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
lpcm_printf(10, "\n");
|
||||
if (!call)
|
||||
{
|
||||
|
@@ -91,9 +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 + 22];
|
||||
mp3_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
|
@@ -92,9 +92,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;
|
||||
|
@@ -100,9 +100,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];
|
||||
mpeg4_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
|
@@ -110,9 +110,8 @@ static int32_t reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
pcm_printf(10, "\n");
|
||||
if (!call)
|
||||
{
|
||||
|
@@ -107,9 +107,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");
|
||||
if (call == NULL)
|
||||
|
@@ -98,9 +98,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call, int is_vp6)
|
||||
static int writeData(WriterAVCallData_t *call, int is_vp6)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
vp_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
{
|
||||
@@ -142,14 +141,14 @@ static int writeData(void *_call, int is_vp6)
|
||||
return writev_with_retry(call->fd, iov, 2);
|
||||
}
|
||||
|
||||
static int writeDataVP6(void *_call)
|
||||
static int writeDataVP6(WriterAVCallData_t *call)
|
||||
{
|
||||
return writeData(_call, 1);
|
||||
return writeData(call, 1);
|
||||
}
|
||||
|
||||
static int writeDataVP89(void *_call)
|
||||
static int writeDataVP89(WriterAVCallData_t *call)
|
||||
{
|
||||
return writeData(_call, 0);
|
||||
return writeData(call, 0);
|
||||
}
|
||||
|
||||
/* ***************************** */
|
||||
|
@@ -103,9 +103,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");
|
||||
if (call == NULL)
|
||||
|
@@ -105,9 +105,8 @@ static int reset()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int writeData(void *_call)
|
||||
static int writeData(WriterAVCallData_t *call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
wmv_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
{
|
||||
|
@@ -27,6 +27,7 @@
|
||||
/* ***************************** */
|
||||
/* Makros/Constants */
|
||||
/* ***************************** */
|
||||
|
||||
// SULGE DEBUG
|
||||
//#define SAM_WITH_DEBUG
|
||||
|
||||
@@ -706,9 +707,8 @@ static int PlaybackMetadata(Context_t *context, char ***metadata)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int32_t Command(void *_context, PlaybackCmd_t command, void *argument)
|
||||
static int32_t Command(Context_t *context, PlaybackCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context; /* to satisfy compiler */
|
||||
int32_t ret = cERR_PLAYBACK_NO_ERROR;
|
||||
playback_printf(20, "Command %d\n", command);
|
||||
switch (command)
|
||||
|
Reference in New Issue
Block a user