libeplayer3-arm: Code formatting

This commit is contained in:
max_10
2017-12-28 12:07:38 +01:00
committed by Thilo Graf
parent 9b48c84176
commit 96bb5eb255
49 changed files with 50 additions and 170 deletions

View File

@@ -2,10 +2,12 @@ AUTOMAKE_OPTIONS = subdir-objects
noinst_LTLIBRARIES = libeplayer3_arm.la
AM_CPPFLAGS = -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
AM_CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
AM_CPPFLAGS += -I$(srcdir)/include -I$(top_srcdir)/include
AM_CFLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
AM_CPPFLAGS = -I$(srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(srcdir)/external
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
libeplayer3_arm_la_SOURCES = \

View File

@@ -98,7 +98,6 @@ static int32_t selectContainer(Context_t *context, char *extension)
return ret;
}
static int Command(void *_context, ContainerCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
@@ -128,7 +127,6 @@ static int Command(void *_context, ContainerCmd_t command, void *argument)
return ret;
}
ContainerHandler_t ContainerHandler =
{
"Output",

View File

@@ -5,7 +5,6 @@
#include "flv2mpeg4/flv2mpeg4.h"
typedef struct
{
flv2mpeg4_CTX *ctx;
@@ -16,7 +15,6 @@ typedef struct
Track_t *track;
} Flv2Mpeg4Context;
static int flv2mpeg4_context_write_packet_cb(void *usr_data, int keyframe, int pts, const uint8_t *buf, int size)
{
Flv2Mpeg4Context *ctx = usr_data;
@@ -82,4 +80,3 @@ static int flv2mpeg4_write_packet(Context_t *out_ctx, Flv2Mpeg4Context *mpeg4p2_
uint32_t time_ms = (uint32_t)(track->pts / 90);
return flv2mpeg4_process_flv_packet(mpeg4p2_ctx->ctx, 0, pkt->data, pkt->size, time_ms);
}

View File

@@ -14,7 +14,6 @@ typedef struct
AVPacket *second_ip_frame;
} Mpeg4P2Context;
static void set_packet(AVPacket **pkt_dest, AVPacket *pkt_src)
{
if (pkt_dest == NULL)
@@ -207,4 +206,3 @@ static int mpeg4p2_write_packet(Context_t *ctx, Mpeg4P2Context *mpeg4p2_ctx, Tra
}
return 0;
}

View File

@@ -100,11 +100,9 @@ typedef struct GetBitContext
unsigned int name ## _index = (gb)->index; \
unsigned int av_unused name ## _cache
#define OPEN_READER(name, gb) OPEN_READER_NOSIZE(name, gb)
#define BITS_AVAILABLE(name, gb) 1
#define CLOSE_READER(name, gb) (gb)->index = name ## _index
# ifdef LONG_BITSTREAM_READER
@@ -125,7 +123,6 @@ typedef struct GetBitContext
#endif
#ifdef BITSTREAM_READER_LE
# define UPDATE_CACHE(name, gb) UPDATE_CACHE_LE(name, gb)
@@ -142,7 +139,6 @@ typedef struct GetBitContext
#define SKIP_COUNTER(name, gb, num) name ## _index += (num)
#define BITS_LEFT(name, gb) ((int)((gb)->size_in_bits - name ## _index))
#define SKIP_BITS(name, gb, num) \
@@ -504,7 +500,6 @@ do { \
SKIP_BITS(name, gb, n); \
} while (0)
static inline int decode012(GetBitContext *gb)
{
int n;

View File

@@ -42,4 +42,3 @@ int latmenc_decode_extradata(LATMContext *ctx, uint8_t *buf, int size);
int latmenc_write_packet(LATMContext *ctx, uint8_t *data, int size, uint8_t *extradata, int extradata_size);
#endif /* AVCODEC_LATMENC_H */

View File

@@ -31,7 +31,6 @@
#include <libavutil/avassert.h>
#include <ffmpeg/put_bits.h>
void avpriv_align_put_bits(PutBitContext *s)
{
put_bits(s, s->bit_left & 7, 0);
@@ -72,4 +71,3 @@ void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
}
put_bits(pb, bits, AV_RB16(src + 2 * words) >> (16 - bits));
}

View File

@@ -38,7 +38,6 @@
#define latmenc_err(fmt, x...)
#endif
int latmenc_decode_extradata(LATMContext *ctx, uint8_t *buf, int size)
{
MPEG4AudioConfig m4ac;
@@ -152,4 +151,3 @@ too_large:
latmenc_err("LATM packet size larger than maximum size 0x1fff\n");
return AVERROR_INVALIDDATA;
}

View File

@@ -25,7 +25,6 @@
#include "dcprediction.h"
// M4V ADDED
static const uint8 mpeg4_y_dc_scale_table[32] =
{

View File

@@ -40,7 +40,6 @@ typedef struct _M4V_DCPRED
int y_dc_scale;
int c_dc_scale;
} M4V_DCPRED;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -65,7 +65,6 @@ typedef struct _PICTURE
int width;
int height;
#define FLV_I_TYPE 0
#define FLV_P_TYPE 1
@@ -157,5 +156,4 @@ static const int8 rl_inter_run[102] =
static const int rl_inter_n = 102;
static const int rl_inter_last = 58;
#endif // FLV_H

View File

@@ -41,7 +41,6 @@ typedef struct _CONVCTX
M4V_VOL vol;
} CONVCTX;
typedef struct
{
uint8 *out_buf;
@@ -65,7 +64,6 @@ static const uint8 ff_mpeg4_c_dc_scale_table[32] =
0, 8, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25
};
static void copy_vol(PICTURE *flv_pic, M4V_VOL *vol)
{
vol->width = flv_pic->width;
@@ -284,6 +282,3 @@ void flv2mpeg4_release_ctx(flv2mpeg4_CTX **pub_ctx)
free(*pub_ctx);
*pub_ctx = NULL;
}

View File

@@ -38,7 +38,6 @@ static const uint8 zig_zag_scan[64] =
58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63
};
static const VLCtab vlc_table_intra_MCBPC[] = //: table_size=72 table_allocated=128 bits=6
{
{64, -3},
@@ -128,7 +127,6 @@ static const VLCtab vlc_table_rl_inter[] = //: table_size=554 table_allocated=10
{100, 3}, {101, 3}, {8, 1}, {7, 1}
};
static const VLCtab vlc_table_mv[] = //mv_vlc: table_size=538 table_allocated=1024 bits=9
{
{512, -3}, {520, -2}, {524, -1}, {526, -1}, {528, -1}, {530, -1}, {532, -1}, {534, -1}, {536, -1}, {10, 9},

View File

@@ -134,6 +134,4 @@ static const uint8 alternate_vertical_scan[64] =
38, 46, 54, 62, 39, 47, 55, 63,
};
#endif // M4V_H

View File

@@ -293,7 +293,6 @@ static void __inline encode_inter_8x8_MCBPC(BW *bw, int cbpc)
put_bits(bw, vlce_inter_MCBPC_bits[cbpc + 16], vlce_inter_MCBPC_code[cbpc + 16]);
}
// same as H.263
static void __inline encode_cbpy(BW *bw, int cbpy)
{

View File

@@ -35,7 +35,6 @@ typedef enum
CT_VP9
} video_codec_type_t;
typedef enum
{
STREAMTYPE_UNKNOWN = -1,
@@ -57,8 +56,6 @@ typedef enum
STREAMTYPE_SPARK = 21,
} video_stream_type_t;
typedef enum
{
AUDIOTYPE_UNKNOWN = -1,
@@ -78,8 +75,4 @@ typedef enum
AUDIOTYPE_RAW = 0xf
} audio_stream_type_t;
#endif /* H_DVB_BCM_H */

View File

@@ -26,4 +26,5 @@ typedef struct Context_s
} Context_t;
int container_ffmpeg_update_tracks(Context_t *context, char *filename, int initial);
#endif

View File

@@ -63,7 +63,6 @@ typedef struct
char *type;
} SubtitleOut_t;
typedef struct Output_s
{
char *Name;

View File

@@ -12,10 +12,8 @@
#define PES_START_CODE_RESERVED_4 0xfd
#define PES_VERSION_FAKE_START_CODE 0x31
#define MAX_PES_PACKET_SIZE (65535)
/* start codes */
#define PCM_PES_START_CODE 0xbd
#define PRIVATE_STREAM_1_PES_START_CODE 0xbd

View File

@@ -92,7 +92,6 @@ typedef enum
VIDEO_ENCODING_PRIVATE
} video_encoding_t;
/*
* List of possible audio encodings - used to select frame parser and codec.
*/
@@ -199,7 +198,6 @@ typedef struct dvb_play_info_s
typedef dvb_play_info_t video_play_info_t;
typedef dvb_play_info_t audio_play_info_t;
typedef enum
{
#define DVB_OPTION_VALUE_DISABLE 0
@@ -285,7 +283,6 @@ typedef enum
// Legacy typo correction
#define DVP_OPTION_H264_FORCE_PIC_ORDER_CNT_IGNORE_DPB_DISPLAY_FRAME_ORDERING DVB_OPTION_H264_FORCE_PIC_ORDER_CNT_IGNORE_DPB_DISPLAY_FRAME_ORDERING
typedef dvb_option_t video_option_t;
/* Decoder commands */
@@ -296,7 +293,6 @@ typedef dvb_option_t video_option_t;
#define VIDEO_CMD_SET_OPTION (4)
#define VIDEO_CMD_GET_OPTION (5)
/* Flags for VIDEO_CMD_FREEZE */
#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0)

View File

@@ -24,8 +24,6 @@ typedef struct
unsigned int InfoFlags;
} WriterAVCallData_t;
typedef struct WriterCaps_s
{
char *name;

View File

@@ -126,23 +126,21 @@ static int ManagerAdd(Context_t *context, Track_t track)
return cERR_AUDIO_MGR_NO_ERROR;
}
static char **ManagerList(Context_t * context __attribute__ ((unused)))
static char **ManagerList(Context_t *context __attribute__((unused)))
{
int i = 0, j = 0;
char **tracklist = NULL;
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
if (Tracks != NULL) {
if (Tracks != NULL)
{
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
if (tracklist == NULL) {
if (tracklist == NULL)
{
audio_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__);
return NULL;
}
for (i = 0, j = 0; i < TrackCount; i++, j += 2) {
for (i = 0, j = 0; i < TrackCount; i++, j += 2)
{
if (Tracks[i].pending)
continue;
size_t len = strlen(Tracks[i].Name) + 20;
@@ -153,9 +151,7 @@ static char **ManagerList(Context_t * context __attribute__ ((unused)))
}
tracklist[j] = NULL;
}
audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount);
return tracklist;
}
@@ -217,7 +213,6 @@ static int ManagerDel(Context_t *context)
return cERR_AUDIO_MGR_NO_ERROR;
}
static int Command(void *_context, ManagerCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
@@ -349,7 +344,6 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
return ret;
}
struct Manager_s AudioManager =
{
"Audio",

View File

@@ -230,7 +230,6 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument)
return ret;
}
struct Manager_s ChapterManager =
{
"Chapter",

View File

@@ -39,7 +39,6 @@
#define SUBTITLE_MGR_SILENT
#endif
#ifdef SUBTITLE_MGR_DEBUG
static short debug_level = 20;
@@ -326,7 +325,6 @@ static int32_t Command(void *_context, ManagerCmd_t command, void *argument)
return ret;
}
Manager_t SubtitleManager =
{
"Subtitle",

View File

@@ -125,41 +125,7 @@ static int ManagerAdd(Context_t *context, Track_t track)
return cERR_VIDEO_MGR_NO_ERROR;
}
static char **ManagerList(Context_t * context __attribute__ ((unused)))
{
int i = 0, j = 0;
char **tracklist = NULL;
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
if (Tracks != NULL) {
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
if (tracklist == NULL) {
video_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__);
return NULL;
}
for (i = 0, j = 0; i < TrackCount; i++, j += 2) {
if (Tracks[i].pending)
continue;
size_t len = strlen(Tracks[i].Name) + 20;
char tmp[len];
snprintf(tmp, len, "%d %s\n", Tracks[i].Id, Tracks[i].Name);
tracklist[j] = strdup(tmp);
tracklist[j + 1] = strdup(Tracks[i].Encoding);
}
tracklist[j] = NULL;
}
video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount);
return tracklist;
}
#if 0
static char **ManagerList(Context_t *context __attribute__((unused)))
static char **ManagerList(Context_t * context __attribute__((unused)))
{
int i = 0, j = 0;
char **tracklist = NULL;
@@ -189,7 +155,6 @@ static char **ManagerList(Context_t *context __attribute__((unused)))
video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount);
return tracklist;
}
#endif
static int ManagerDel(Context_t *context)
{
@@ -362,7 +327,6 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
return ret;
}
struct Manager_s VideoManager =
{
"Video",

View File

@@ -468,7 +468,6 @@ int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
return ret;
}
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
{
// unsigned char video = !strcmp("video", type);
@@ -566,7 +565,6 @@ int LinuxDvbFastForward(Context_t *context, char *type)
}
#endif
int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
{
int ret = cERR_LINUXDVB_NO_ERROR;

View File

@@ -439,7 +439,6 @@ int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
return ret;
}
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
{
unsigned char video = !strcmp("video", type);
@@ -540,7 +539,6 @@ int LinuxDvbFastForward(Context_t *context, char *type)
}
#endif
int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
{
int ret = cERR_LINUXDVB_NO_ERROR;

View File

@@ -84,7 +84,6 @@ Number, Style, Name,, MarginL, MarginR, MarginV, Effect,, Text
/* Types */
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* ***************************** */
@@ -320,7 +319,6 @@ static int Command(void *_context, OutputCmd_t command, void *argument)
return ret;
}
static char *SubtitleCapabilitis[] = { "subtitle", NULL };
Output_t SubtitleOutput =

View File

@@ -57,7 +57,6 @@
/* Types */
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* ***************************** */

View File

@@ -172,5 +172,3 @@ struct Writer_s WriterAudioAMR =
NULL,
&caps_amr
};

View File

@@ -55,7 +55,6 @@
#define B_GET_BITS(w,e,b) (((w)>>(b))&(((unsigned)(-1))>>((sizeof(unsigned))*8-(e+1-b))))
#define B_SET_BITS(name,v,e,b) (((unsigned)(v))<<(b))
#ifdef SAM_WITH_DEBUG
#define DIVX_DEBUG
#else

View File

@@ -186,4 +186,3 @@ struct Writer_s WriterAudioVORBIS =
NULL,
&caps_vorbis
};

View File

@@ -100,7 +100,6 @@ static uint32_t fixed_bufferfilled;
/* MISC Functions */
/* ***************************** */
static int32_t reset()
{
initialHeader = 1;

View File

@@ -78,7 +78,6 @@ static short debug_level = 10;
#define vc1_err(fmt, x...)
#endif
/* ***************************** */
/* Types */
/* ***************************** */

View File

@@ -75,7 +75,6 @@ static short debug_level = 10;
#define vp_err(fmt, x...)
#endif
/* ***************************** */
/* Types */
/* ***************************** */
@@ -150,7 +149,6 @@ static int writeDataVP89(void *_call)
return writeData(_call, 0);
}
/* ***************************** */
/* Writer Definition */
/* ***************************** */

View File

@@ -182,7 +182,6 @@ struct Writer_s WriterAudioWMAPRO =
&capsWMAPRO
};
static WriterCaps_t capsWMA =
{
"wma",

View File

@@ -63,7 +63,6 @@ static Writer_t *AvailableWriter[] =
{
&WriterAudioAAC,
&WriterAudioAACLATM,
&WriterAudioAACLATM,
&WriterAudioAACPLUS,
&WriterAudioAC3,
&WriterAudioEAC3,

View File

@@ -43,7 +43,6 @@
#include <libavutil/intreadwrite.h>
#include "ffmpeg/latmenc.h"
#include "common.h"
#include "output.h"
#include "debug.h"

View File

@@ -191,7 +191,6 @@ struct Writer_s WriterVideoMPEG4 =
&mpeg4p2_caps
};
struct Writer_s WriterVideoMSCOMP =
{
&reset,

View File

@@ -217,7 +217,6 @@ struct Writer_s WriterVideoMPEG4 =
&mpeg4p2_caps
};
struct Writer_s WriterVideoMSCOMP =
{
&reset,

View File

@@ -91,7 +91,6 @@ typedef struct avcC_s
unsigned char Params[1]; /* {length,params}{length,params}...sequence then picture*/
} avcC_t;
/* ***************************** */
/* Varaibles */
/* ***************************** */

View File

@@ -175,4 +175,3 @@ struct Writer_s WriterAudioVORBIS =
NULL,
&caps_vorbis
};

View File

@@ -54,7 +54,6 @@
/* Types */
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* ***************************** */

View File

@@ -58,7 +58,6 @@
#define METADATA_STRUCT_B_FRAMERATE_START 32
#define METADATA_STRUCT_C_START 8
#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80
#define VC1_FRAME_START_CODE 0x0d
@@ -84,14 +83,12 @@ static short debug_level = 0;
#define vc1_err(fmt, x...)
#endif
/* ***************************** */
/* Types */
/* ***************************** */
static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE};
static const unsigned char Metadata[] =
{
0x00, 0x00, 0x00, 0xc5,
@@ -260,4 +257,3 @@ struct Writer_s WriterVideoVC1 =
NULL,
&caps
};

View File

@@ -171,7 +171,6 @@ struct Writer_s WriterAudioWMAPRO =
&capsWMAPRO
};
static WriterCaps_t capsWMA =
{
"wma",

View File

@@ -80,7 +80,6 @@ static short debug_level = 0;
#define wmv_err(fmt, x...)
#endif
/* ***************************** */
/* Types */
/* ***************************** */

View File

@@ -685,12 +685,10 @@ static int32_t Command(void *_context, PlaybackCmd_t command, void *argument)
break;
}
default:
{
playback_err("PlaybackCmd %d not supported!\n", command);
ret = cERR_PLAYBACK_ERROR;
break;
}
}
playback_printf(20, "exiting with value %d\n", ret);
return ret;
}