mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 23:43:00 +02:00
Code formatting
This commit is contained in:
@@ -524,8 +524,8 @@ static void FFMPEGThread(Context_t *context)
|
||||
strncpy(threadname, __func__, sizeof(threadname));
|
||||
threadname[16] = 0;
|
||||
prctl(PR_SET_NAME, (unsigned long)&threadname);
|
||||
AVPacket packet;
|
||||
off_t lastSeek = -1;
|
||||
AVPacket packet;
|
||||
off_t lastSeek = -1;
|
||||
int64_t lastPts = -1;
|
||||
int64_t currentVideoPts = -1;
|
||||
int64_t currentAudioPts = -1;
|
||||
@@ -536,7 +536,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
int64_t lastAudioDts = -1;
|
||||
int64_t showtime = 0;
|
||||
int64_t bofcount = 0;
|
||||
int32_t err = 0;
|
||||
int32_t err = 0;
|
||||
AudioVideoOut_t avOut;
|
||||
g_context = context;
|
||||
SwrContext *swr = NULL;
|
||||
@@ -831,8 +831,8 @@ static void FFMPEGThread(Context_t *context)
|
||||
pcmExtradata.bit_rate = get_codecpar(audioTrack->stream)->bit_rate;
|
||||
pcmExtradata.ffmpeg_codec_id = get_codecpar(audioTrack->stream)->codec_id;
|
||||
pcmExtradata.bResampling = restart_audio_resampling;
|
||||
uint8_t *pAudioExtradata = get_codecpar(audioTrack->stream)->extradata;
|
||||
uint32_t audioExtradataSize = get_codecpar(audioTrack->stream)->extradata_size;
|
||||
uint8_t *pAudioExtradata = get_codecpar(audioTrack->stream)->extradata;
|
||||
uint32_t audioExtradataSize = get_codecpar(audioTrack->stream)->extradata_size;
|
||||
ffmpeg_printf(200, "AudioTrack index = %d\n", pid);
|
||||
if (audioTrack->inject_raw_pcm == 1)
|
||||
{
|
||||
@@ -1034,7 +1034,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
else if (audioTrack->have_aacheader == 1)
|
||||
{
|
||||
ffmpeg_printf(200, "write audio aac\n");
|
||||
ffmpeg_printf(200, ">>>>>>> %x %x %x %x %x %x\n", packet.data[0], packet.data[1], packet.data[2], packet.data[3], packet.data[4], packet.data[5], packet.data[6]);
|
||||
ffmpeg_printf(200, ">>>>>>> %x %x %x %x %x %x %x\n", packet.data[0], packet.data[1], packet.data[2], packet.data[3], packet.data[4], packet.data[5], packet.data[6]);
|
||||
avOut.data = packet.data;
|
||||
avOut.len = packet.size;
|
||||
avOut.pts = pts;
|
||||
@@ -1105,8 +1105,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
static char errbuf[256];
|
||||
if (0 == av_strerror(ffmpegStatus, errbuf, sizeof(errbuf)))
|
||||
{
|
||||
/* In this way we inform user about error within the core
|
||||
*/
|
||||
/* In this way we inform user about error within the core */
|
||||
printf("{\"log\":\"Frame read error: '%s'\"}\n", errbuf);
|
||||
}
|
||||
/*
|
||||
@@ -1603,7 +1602,7 @@ int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames)
|
||||
avformat_network_init();
|
||||
// SULGE DEBUG ENABLED
|
||||
// make ffmpeg silen
|
||||
//av_log_set_level( AV_LOG_DEBUG );
|
||||
// av_log_set_level( AV_LOG_DEBUG );
|
||||
av_log_set_callback(ffmpeg_silen_callback);
|
||||
context->playback->abortRequested = 0;
|
||||
int32_t res = container_ffmpeg_init_av_context(context, playFilesNames->szFirstFile, 0);
|
||||
|
@@ -103,7 +103,7 @@ typedef struct ManagerHandler_s
|
||||
Manager_t *audio;
|
||||
Manager_t *video;
|
||||
Manager_t *subtitle;
|
||||
Manager_t *chapter;
|
||||
Manager_t *chapter;
|
||||
} ManagerHandler_t;
|
||||
|
||||
void freeTrack(Track_t *track);
|
||||
|
@@ -44,16 +44,16 @@
|
||||
#define IPTV_MAX_FILE_PATH 1024
|
||||
|
||||
extern int ffmpeg_av_dict_set(const char *key, const char *value, int flags);
|
||||
extern void aac_software_decoder_set(const int32_t val);
|
||||
extern void aac_latm_software_decoder_set(const int32_t val);
|
||||
extern void dts_software_decoder_set(const int32_t val);
|
||||
extern void wma_software_decoder_set(const int32_t val);
|
||||
extern void ac3_software_decoder_set(const int32_t val);
|
||||
extern void eac3_software_decoder_set(const int32_t val);
|
||||
extern void mp3_software_decoder_set(const int32_t val);
|
||||
extern void rtmp_proto_impl_set(const int32_t val);
|
||||
extern void flv2mpeg4_converter_set(const int32_t val);
|
||||
extern void sel_program_id_set(const int32_t val);
|
||||
extern void aac_software_decoder_set(const int32_t val);
|
||||
extern void aac_latm_software_decoder_set(const int32_t val);
|
||||
extern void dts_software_decoder_set(const int32_t val);
|
||||
extern void wma_software_decoder_set(const int32_t val);
|
||||
extern void ac3_software_decoder_set(const int32_t val);
|
||||
extern void eac3_software_decoder_set(const int32_t val);
|
||||
extern void mp3_software_decoder_set(const int32_t val);
|
||||
extern void rtmp_proto_impl_set(const int32_t val);
|
||||
extern void flv2mpeg4_converter_set(const int32_t val);
|
||||
extern void sel_program_id_set(const int32_t val);
|
||||
|
||||
extern void pcm_resampling_set(int32_t val);
|
||||
extern void stereo_software_decoder_set(int32_t val);
|
||||
|
@@ -128,36 +128,35 @@ static int ManagerAdd(Context_t *context, Track_t track)
|
||||
|
||||
static char **ManagerList(Context_t * context __attribute__ ((unused)))
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
char **tracklist = NULL;
|
||||
int i = 0, j = 0;
|
||||
char **tracklist = NULL;
|
||||
|
||||
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||
|
||||
if (Tracks != NULL) {
|
||||
if (Tracks != NULL) {
|
||||
|
||||
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
|
||||
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
|
||||
|
||||
if (tracklist == NULL) {
|
||||
audio_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__);
|
||||
return 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) {
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount);
|
||||
|
||||
audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME,
|
||||
__FUNCTION__, tracklist, j, TrackCount);
|
||||
|
||||
return tracklist;
|
||||
return tracklist;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@@ -112,8 +112,7 @@ static int ManagerAdd(Context_t * context __attribute__((unused)), Track_t track
|
||||
}
|
||||
else
|
||||
{
|
||||
chapter_mgr_err("%s:%s TrackCount out if range %d - %d\n", FILENAME,
|
||||
__FUNCTION__, TrackCount, TRACKWRAP);
|
||||
chapter_mgr_err("%s:%s TrackCount out if range %d - %d\n", FILENAME, __FUNCTION__, TrackCount, TRACKWRAP);
|
||||
return cERR_CHAPTER_MGR_ERROR;
|
||||
}
|
||||
|
||||
@@ -175,8 +174,7 @@ static int ManagerDel(Context_t * context __attribute__((unused)))
|
||||
}
|
||||
else
|
||||
{
|
||||
chapter_mgr_err("%s::%s nothing to delete!\n", FILENAME,
|
||||
__FUNCTION__);
|
||||
chapter_mgr_err("%s::%s nothing to delete!\n", FILENAME, __FUNCTION__);
|
||||
return cERR_CHAPTER_MGR_ERROR;
|
||||
}
|
||||
|
||||
@@ -222,14 +220,12 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
chapter_mgr_err("%s::%s ContainerCmd %d not supported!\n", FILENAME,
|
||||
__FUNCTION__, command);
|
||||
chapter_mgr_err("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command);
|
||||
ret = cERR_CHAPTER_MGR_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
chapter_mgr_printf(10, "%s:%s: returning %d\n", FILENAME, __FUNCTION__,
|
||||
ret);
|
||||
chapter_mgr_printf(10, "%s:%s: returning %d\n", FILENAME, __FUNCTION__, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@
|
||||
|
||||
#ifdef SUBTITLE_MGR_DEBUG
|
||||
|
||||
static short debug_level = 10;
|
||||
static short debug_level = 20;
|
||||
|
||||
#define subtitle_mgr_printf(level, x...) do { \
|
||||
if (debug_level >= level) printf(x); } while (0)
|
||||
|
@@ -127,36 +127,35 @@ static int ManagerAdd(Context_t *context, Track_t track)
|
||||
|
||||
static char **ManagerList(Context_t * context __attribute__ ((unused)))
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
char **tracklist = NULL;
|
||||
int i = 0, j = 0;
|
||||
char **tracklist = NULL;
|
||||
|
||||
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||
|
||||
if (Tracks != NULL) {
|
||||
if (Tracks != NULL) {
|
||||
|
||||
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
|
||||
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
|
||||
|
||||
if (tracklist == NULL) {
|
||||
video_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__);
|
||||
return NULL;
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME,
|
||||
__FUNCTION__, tracklist, j, TrackCount);
|
||||
|
||||
return tracklist;
|
||||
return tracklist;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@@ -312,8 +312,8 @@ static int writeData(void *_call)
|
||||
}
|
||||
/* AnnexA */
|
||||
if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) ||
|
||||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
|
||||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
|
||||
{
|
||||
uint32_t PacketLength = 0;
|
||||
uint32_t FakeStartCode = (call->Version << 8) | PES_VERSION_FAKE_START_CODE;
|
||||
|
@@ -201,4 +201,3 @@ Writer_t *getDefaultAudioWriter()
|
||||
writer_printf(1, "%s: no writer found\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -230,8 +230,8 @@ static int32_t writeData(void *_call)
|
||||
}
|
||||
/* AnnexA */
|
||||
if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) ||
|
||||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
|
||||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
|
||||
{
|
||||
uint32_t PacketLength = 0;
|
||||
uint32_t FakeStartCode = /*(call->Version << 8) | */PES_VERSION_FAKE_START_CODE;
|
||||
@@ -281,7 +281,7 @@ static int32_t writeData(void *_call)
|
||||
if (private_data != call->private_data)
|
||||
{
|
||||
avc3 = 1;
|
||||
avcCHeader = (avcC_t *)private_data;
|
||||
avcCHeader = (avcC_t *)private_data;
|
||||
}
|
||||
}
|
||||
HeaderData[ParametersLength++] = 0x00; // Start code
|
||||
@@ -292,7 +292,7 @@ static int32_t writeData(void *_call)
|
||||
HeaderData[ParametersLength++] = CONTAINER_PARAMETERS_VERSION;
|
||||
HeaderData[ParametersLength++] = 0xff; // Field separator
|
||||
if (TimeDelta == 0xffffffff)
|
||||
TimeDelta = (TimeScale > 1000) ? 1001 : 1;
|
||||
TimeDelta = (TimeScale > 1000) ? 1001 : 1;
|
||||
HeaderData[ParametersLength++] = (TimeScale >> 24) & 0xff; // Output the timescale
|
||||
HeaderData[ParametersLength++] = (TimeScale >> 16) & 0xff;
|
||||
HeaderData[ParametersLength++] = 0xff;
|
||||
|
@@ -141,4 +141,3 @@ Writer_t *getDefaultAudioWriter()
|
||||
writer_printf(1, "%s: no writer found\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -593,10 +593,8 @@ static int PlaybackMetadata(Context_t * context, char ***metadata)
|
||||
int ret = cERR_PLAYBACK_NO_ERROR;
|
||||
|
||||
if (context->container && context->container->selectedContainer)
|
||||
context->container->selectedContainer->Command(context,
|
||||
CONTAINER_GET_METADATA,
|
||||
metadata);
|
||||
return ret;
|
||||
context->container->selectedContainer->Command(context, CONTAINER_GET_METADATA, metadata);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int32_t Command(void *_context, PlaybackCmd_t command, void *argument)
|
||||
@@ -687,9 +685,11 @@ 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;
|
||||
|
Reference in New Issue
Block a user