mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
libeplayer3-arm: reduce compiler warnings
Origin commit data
------------------
Branch: master
Commit: 9a7b46f8a3
Author: max_10 <max_10@gmx.de>
Date: 2018-02-08 (Thu, 08 Feb 2018)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -87,7 +87,7 @@ bool cPlayback::Start(std::string filename, std::string headers)
|
|||||||
return Start((char *) filename.c_str(), 0, 0, 0, 0, 0, headers);
|
return Start((char *) filename.c_str(), 0, 0, 0, 0, 0, headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, int, std::string headers)
|
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, int, std::string headers __attribute__((unused)))
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
bool isHTTP = false;
|
bool isHTTP = false;
|
||||||
@@ -247,7 +247,7 @@ bool cPlayback::SetAPid(int pid, bool /* ac3 */)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::SetVPid(int pid)
|
bool cPlayback::SetVPid(int /*pid*/)
|
||||||
{
|
{
|
||||||
lt_info("%s\n", __func__);
|
lt_info("%s\n", __func__);
|
||||||
return true;
|
return true;
|
||||||
@@ -269,7 +269,7 @@ bool cPlayback::SetSubtitlePid(int pid)
|
|||||||
bool cPlayback::SetTeletextPid(int pid)
|
bool cPlayback::SetTeletextPid(int pid)
|
||||||
{
|
{
|
||||||
lt_info("%s\n", __func__);
|
lt_info("%s\n", __func__);
|
||||||
int i = pid;
|
//int i = pid;
|
||||||
if (pid != mTeletextStream)
|
if (pid != mTeletextStream)
|
||||||
{
|
{
|
||||||
//if(player && player->playback)
|
//if(player && player->playback)
|
||||||
@@ -534,10 +534,10 @@ void cPlayback::FindAllSubtitlePids(int *pids, unsigned int *numpids, std::strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cPlayback::FindAllTeletextsubtitlePids(int *pids, unsigned int *numpids, std::string *language, int *mags, int *pages)
|
void cPlayback::FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpids, std::string */*language*/, int */*mags*/, int */*pages*/)
|
||||||
{
|
{
|
||||||
lt_info("%s\n", __func__);
|
lt_info("%s\n", __func__);
|
||||||
int max_numpids = *numpids;
|
//int max_numpids = *numpids;
|
||||||
*numpids = 0;
|
*numpids = 0;
|
||||||
/*
|
/*
|
||||||
if (player && player->manager && player->manager->teletext)
|
if (player && player->manager && player->manager->teletext)
|
||||||
|
@@ -40,7 +40,7 @@ class cPlayback
|
|||||||
bool Start(char *filename, int vpid, int vtype, int apid, int ac3, int duration, std::string headers = "");
|
bool Start(char *filename, int vpid, int vtype, int apid, int ac3, int duration, std::string headers = "");
|
||||||
bool Start(std::string filename, std::string headers = "");
|
bool Start(std::string filename, std::string headers = "");
|
||||||
bool SetAPid(int pid, bool ac3 = false);
|
bool SetAPid(int pid, bool ac3 = false);
|
||||||
bool SetVPid(int pid);
|
bool SetVPid(int /*pid*/);
|
||||||
bool SetSubtitlePid(int pid);
|
bool SetSubtitlePid(int pid);
|
||||||
bool SetTeletextPid(int pid);
|
bool SetTeletextPid(int pid);
|
||||||
int GetAPid(void) { return mAudioStream; }
|
int GetAPid(void) { return mAudioStream; }
|
||||||
@@ -54,7 +54,7 @@ class cPlayback
|
|||||||
bool SetPosition(int position, bool absolute = false);
|
bool SetPosition(int position, bool absolute = false);
|
||||||
void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language);
|
void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language);
|
||||||
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
||||||
void FindAllTeletextsubtitlePids(int *pids, unsigned int *numpidt, std::string *tlanguage, int *mags, int *pages);
|
void FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpidt, std::string */*tlanguage*/, int */*mags*/, int */*pages*/);
|
||||||
void RequestAbort(void);
|
void RequestAbort(void);
|
||||||
bool IsPlaying(void);
|
bool IsPlaying(void);
|
||||||
uint64_t GetReadCount(void);
|
uint64_t GetReadCount(void);
|
||||||
|
@@ -290,7 +290,7 @@ int image_to_mpeg2(const char *image_name, int fd)
|
|||||||
uint8_t endcode[] = { 0, 0, 1, 0xb7 };
|
uint8_t endcode[] = { 0, 0, 1, 0xb7 };
|
||||||
write_all(fd,endcode, sizeof(endcode));
|
write_all(fd,endcode, sizeof(endcode));
|
||||||
}
|
}
|
||||||
av_free_packet(&packet);
|
av_packet_unref(&packet);
|
||||||
}
|
}
|
||||||
avcodec_close(codecContext);
|
avcodec_close(codecContext);
|
||||||
}
|
}
|
||||||
|
@@ -163,33 +163,33 @@ static int32_t ffmpeg_read_wrapper(void *opaque, uint8_t *buf, int32_t buf_size)
|
|||||||
return ffmpeg_real_read_org(opaque, buf, buf_size);
|
return ffmpeg_real_read_org(opaque, buf, buf_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
static int32_t ffmpeg_read_wrapper2(void *opaque, uint8_t *buf, int32_t buf_size)
|
static int32_t ffmpeg_read_wrapper2(void *opaque, uint8_t *buf, int32_t buf_size)
|
||||||
{
|
{
|
||||||
return ffmpeg_read_wrapper_base(opaque, buf, buf_size, 1);
|
return ffmpeg_read_wrapper_base(opaque, buf, buf_size, 1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//for buffered io
|
//for buffered io
|
||||||
void getfillerMutex(const char *filename, const char *function, int line)
|
void getfillerMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused)))
|
||||||
{
|
{
|
||||||
ffmpeg_printf(100, "::%d requesting mutex\n", line);
|
ffmpeg_printf(100, "::%d requesting mutex\n", line);
|
||||||
pthread_mutex_lock(&fillermutex);
|
pthread_mutex_lock(&fillermutex);
|
||||||
ffmpeg_printf(100, "::%d received mutex\n", line);
|
ffmpeg_printf(100, "::%d received mutex\n", line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void releasefillerMutex(const char *filename, const const char *function, int line)
|
void releasefillerMutex(const char *filename __attribute__((unused)), const const char *function __attribute__((unused)), int line __attribute__((unused)))
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&fillermutex);
|
pthread_mutex_unlock(&fillermutex);
|
||||||
ffmpeg_printf(100, "::%d released mutex\n", line);
|
ffmpeg_printf(100, "::%d released mutex\n", line);
|
||||||
}
|
}
|
||||||
//for buffered io (end)encoding
|
//for buffered io (end)encoding
|
||||||
|
#if 0
|
||||||
static int32_t container_set_ffmpeg_buf_seek_time(int32_t *time)
|
static int32_t container_set_ffmpeg_buf_seek_time(int32_t *time)
|
||||||
{
|
{
|
||||||
ffmpeg_buf_seek_time = (*time);
|
ffmpeg_buf_seek_time = (*time);
|
||||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
static int32_t container_set_ffmpeg_buf_size(int32_t *size)
|
static int32_t container_set_ffmpeg_buf_size(int32_t *size)
|
||||||
{
|
{
|
||||||
if (ffmpeg_buf == NULL)
|
if (ffmpeg_buf == NULL)
|
||||||
@@ -229,13 +229,13 @@ static int32_t container_get_fillbufstatus(int32_t *size)
|
|||||||
}
|
}
|
||||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
static int32_t container_stop_buffer()
|
static int32_t container_stop_buffer()
|
||||||
{
|
{
|
||||||
ffmpeg_buf_stop = 1;
|
ffmpeg_buf_stop = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//flag 0: start direct
|
//flag 0: start direct
|
||||||
//flag 1: from thread
|
//flag 1: from thread
|
||||||
static void ffmpeg_filler(Context_t *context, int32_t id, int32_t *inpause, int32_t flag)
|
static void ffmpeg_filler(Context_t *context, int32_t id, int32_t *inpause, int32_t flag)
|
||||||
@@ -414,7 +414,7 @@ static int32_t ffmpeg_start_fillerTHREAD(Context_t *context)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t ffmpeg_read_real(void *opaque, uint8_t *buf, int32_t buf_size)
|
static int32_t ffmpeg_read_real(void *opaque __attribute__((unused)), uint8_t *buf, int32_t buf_size)
|
||||||
{
|
{
|
||||||
int32_t len = buf_size;
|
int32_t len = buf_size;
|
||||||
int32_t rwdiff = 0;
|
int32_t rwdiff = 0;
|
||||||
@@ -495,7 +495,7 @@ static int32_t ffmpeg_read(void *opaque, uint8_t *buf, int32_t buf_size)
|
|||||||
return sumlen;
|
return sumlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t ffmpeg_seek(void *opaque, int64_t offset, int32_t whence)
|
static int64_t ffmpeg_seek(void *opaque __attribute__((unused)), int64_t offset, int32_t whence)
|
||||||
{
|
{
|
||||||
int64_t diff;
|
int64_t diff;
|
||||||
int32_t rwdiff = 0;
|
int32_t rwdiff = 0;
|
||||||
|
@@ -147,7 +147,7 @@ static int32_t seek_target_flag = 0;
|
|||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
static int32_t container_ffmpeg_seek_bytes(off_t pos);
|
static int32_t container_ffmpeg_seek_bytes(off_t pos);
|
||||||
static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t absolute);
|
static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t absolute);
|
||||||
static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t pts, int64_t sec);
|
//static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t pts, int64_t sec);
|
||||||
static int32_t container_ffmpeg_get_length(Context_t *context, int64_t *length);
|
static int32_t container_ffmpeg_get_length(Context_t *context, int64_t *length);
|
||||||
static int64_t calcPts(uint32_t avContextIdx, AVStream *stream, int64_t pts);
|
static int64_t calcPts(uint32_t avContextIdx, AVStream *stream, int64_t pts);
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ static int32_t flv2mpeg4_converter = 0;
|
|||||||
/* MISC Functions */
|
/* MISC Functions */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
|
||||||
static void ffmpeg_silen_callback(void *avcl, int level, const char *fmt, va_list vl)
|
static void ffmpeg_silen_callback(void *avcl __attribute__((unused)), int level __attribute__((unused)), const char *fmt __attribute__((unused)), va_list vl __attribute__((unused)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ static void initMutex(void)
|
|||||||
mutexInitialized = 1;
|
mutexInitialized = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int32_t line)
|
static void getMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int32_t line __attribute__((unused)))
|
||||||
{
|
{
|
||||||
ffmpeg_printf(100, "::%d requesting mutex\n", line);
|
ffmpeg_printf(100, "::%d requesting mutex\n", line);
|
||||||
if (!mutexInitialized)
|
if (!mutexInitialized)
|
||||||
@@ -298,13 +298,13 @@ static void getMutex(const char *filename __attribute__((unused)), const char *f
|
|||||||
ffmpeg_printf(100, "::%d received mutex\n", line);
|
ffmpeg_printf(100, "::%d received mutex\n", line);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void releaseMutex(const char *filename __attribute__((unused)), const const char *function __attribute__((unused)), int32_t line)
|
static void releaseMutex(const char *filename __attribute__((unused)), const const char *function __attribute__((unused)), int32_t line __attribute__((unused)))
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&mutex);
|
pthread_mutex_unlock(&mutex);
|
||||||
ffmpeg_printf(100, "::%d released mutex\n", line);
|
ffmpeg_printf(100, "::%d released mutex\n", line);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *Codec2Encoding(int32_t codec_id, int32_t media_type, uint8_t *extradata, int extradata_size, int profile, int32_t *version)
|
static char *Codec2Encoding(int32_t codec_id, int32_t media_type, uint8_t *extradata, int extradata_size, int profile __attribute__((unused)), int32_t *version)
|
||||||
{
|
{
|
||||||
ffmpeg_printf(10, "Codec ID: %d (%.8lx)\n", codec_id, codec_id);
|
ffmpeg_printf(10, "Codec ID: %d (%.8lx)\n", codec_id, codec_id);
|
||||||
switch (codec_id)
|
switch (codec_id)
|
||||||
@@ -524,8 +524,8 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
threadname[16] = 0;
|
threadname[16] = 0;
|
||||||
prctl(PR_SET_NAME, (unsigned long)&threadname);
|
prctl(PR_SET_NAME, (unsigned long)&threadname);
|
||||||
AVPacket packet;
|
AVPacket packet;
|
||||||
off_t lastSeek = -1;
|
//off_t lastSeek = -1;
|
||||||
int64_t lastPts = -1;
|
//int64_t lastPts = -1;
|
||||||
int64_t currentVideoPts = -1;
|
int64_t currentVideoPts = -1;
|
||||||
int64_t currentAudioPts = -1;
|
int64_t currentAudioPts = -1;
|
||||||
/* lastVideoDts and lastAudioDts
|
/* lastVideoDts and lastAudioDts
|
||||||
@@ -535,7 +535,7 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
int64_t lastAudioDts = -1;
|
int64_t lastAudioDts = -1;
|
||||||
int64_t showtime = 0;
|
int64_t showtime = 0;
|
||||||
int64_t bofcount = 0;
|
int64_t bofcount = 0;
|
||||||
int32_t err = 0;
|
//int32_t err = 0;
|
||||||
AudioVideoOut_t avOut;
|
AudioVideoOut_t avOut;
|
||||||
g_context = context;
|
g_context = context;
|
||||||
SwrContext *swr = NULL;
|
SwrContext *swr = NULL;
|
||||||
@@ -737,7 +737,7 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
ffmpeg_err("error getting subtitle track\n");
|
ffmpeg_err("error getting subtitle track\n");
|
||||||
}
|
}
|
||||||
ffmpeg_printf(200, "packet.size %d - index %d\n", packet.size, pid);
|
ffmpeg_printf(200, "packet.size %d - index %d\n", packet.size, pid);
|
||||||
if (videoTrack && (videoTrack->AVIdx == cAVIdx) && (videoTrack->Id == pid))
|
if (videoTrack && (videoTrack->AVIdx == (int)cAVIdx) && (videoTrack->Id == pid))
|
||||||
{
|
{
|
||||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 34, 100)
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 34, 100)
|
||||||
AVCodecContext *codec_context = videoTrack->avCodecCtx;
|
AVCodecContext *codec_context = videoTrack->avCodecCtx;
|
||||||
@@ -826,7 +826,7 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (audioTrack && (audioTrack->AVIdx == cAVIdx) && (audioTrack->Id == pid))
|
else if (audioTrack && (audioTrack->AVIdx == (int)cAVIdx) && (audioTrack->Id == pid))
|
||||||
{
|
{
|
||||||
uint8_t skipPacket = 0;
|
uint8_t skipPacket = 0;
|
||||||
currentAudioPts = audioTrack->pts = pts = calcPts(cAVIdx, audioTrack->stream, packet.pts);
|
currentAudioPts = audioTrack->pts = pts = calcPts(cAVIdx, audioTrack->stream, packet.pts);
|
||||||
@@ -1111,7 +1111,7 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
else if (subtitleTrack && (subtitleTrack->Id == pid))
|
else if (subtitleTrack && (subtitleTrack->Id == pid))
|
||||||
{
|
{
|
||||||
int64_t duration = -1;
|
int64_t duration = -1;
|
||||||
int64_t pts = calcPts(cAVIdx, subtitleTrack->stream, packet.pts);
|
pts = calcPts(cAVIdx, subtitleTrack->stream, packet.pts);
|
||||||
AVStream *stream = subtitleTrack->stream;
|
AVStream *stream = subtitleTrack->stream;
|
||||||
if (packet.duration != 0)
|
if (packet.duration != 0)
|
||||||
{
|
{
|
||||||
@@ -1604,7 +1604,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
|||||||
|
|
||||||
int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames)
|
int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames)
|
||||||
{
|
{
|
||||||
int32_t err = 0;
|
//int32_t err = 0;
|
||||||
ffmpeg_printf(10, ">\n");
|
ffmpeg_printf(10, ">\n");
|
||||||
if (playFilesNames == NULL)
|
if (playFilesNames == NULL)
|
||||||
{
|
{
|
||||||
@@ -1741,7 +1741,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int32_t n = 0;
|
uint32_t n = 0;
|
||||||
for (n = 0; n < avContext->nb_streams; n++)
|
for (n = 0; n < avContext->nb_streams; n++)
|
||||||
{
|
{
|
||||||
Track_t track;
|
Track_t track;
|
||||||
@@ -2323,7 +2323,7 @@ static int32_t container_ffmpeg_seek_bytes(off_t pos)
|
|||||||
ffmpeg_printf(30, "current_pos after seek %lld\n", avio_tell(avContextTab[0]->pb));
|
ffmpeg_printf(30, "current_pos after seek %lld\n", avio_tell(avContextTab[0]->pb));
|
||||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
#if 0 //unused
|
||||||
/* seeking relative to a given byteposition N seconds ->for reverse playback needed */
|
/* seeking relative to a given byteposition N seconds ->for reverse playback needed */
|
||||||
static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t pts, int64_t sec)
|
static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t pts, int64_t sec)
|
||||||
{
|
{
|
||||||
@@ -2399,12 +2399,12 @@ static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t
|
|||||||
releaseMutex(__FILE__, __FUNCTION__, __LINE__);
|
releaseMutex(__FILE__, __FUNCTION__, __LINE__);
|
||||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t absolute)
|
static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t absolute)
|
||||||
{
|
{
|
||||||
Track_t *videoTrack = NULL;
|
Track_t *videoTrack = NULL;
|
||||||
Track_t *audioTrack = NULL;
|
Track_t *audioTrack = NULL;
|
||||||
Track_t *current = NULL;
|
// Track_t *current = NULL;
|
||||||
seek_target_flag = 0;
|
seek_target_flag = 0;
|
||||||
sec *= AV_TIME_BASE;
|
sec *= AV_TIME_BASE;
|
||||||
if (!absolute)
|
if (!absolute)
|
||||||
@@ -2435,6 +2435,13 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab
|
|||||||
ffmpeg_printf(10, "goto %lld sec\n", sec / AV_TIME_BASE);
|
ffmpeg_printf(10, "goto %lld sec\n", sec / AV_TIME_BASE);
|
||||||
context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack);
|
context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack);
|
||||||
context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack);
|
context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack);
|
||||||
|
if (!videoTrack && !audioTrack)
|
||||||
|
{
|
||||||
|
ffmpeg_err("no track available to seek\n");
|
||||||
|
return cERR_CONTAINER_FFMPEG_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (videoTrack != NULL)
|
if (videoTrack != NULL)
|
||||||
{
|
{
|
||||||
current = videoTrack;
|
current = videoTrack;
|
||||||
@@ -2448,6 +2455,8 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab
|
|||||||
ffmpeg_err("no track available to seek\n");
|
ffmpeg_err("no track available to seek\n");
|
||||||
return cERR_CONTAINER_FFMPEG_ERR;
|
return cERR_CONTAINER_FFMPEG_ERR;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sec < 0)
|
if (sec < 0)
|
||||||
{
|
{
|
||||||
seek_target_flag |= AVSEEK_FLAG_BACKWARD;
|
seek_target_flag |= AVSEEK_FLAG_BACKWARD;
|
||||||
@@ -2546,7 +2555,7 @@ static int32_t container_ffmpeg_get_length(Context_t *context, int64_t *length)
|
|||||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t container_ffmpeg_switch_audio(Context_t *context, int32_t *arg)
|
static int32_t container_ffmpeg_switch_audio(Context_t *context, int32_t *arg __attribute__((unused)))
|
||||||
{
|
{
|
||||||
ffmpeg_printf(10, "track %d\n", *arg);
|
ffmpeg_printf(10, "track %d\n", *arg);
|
||||||
/* Hellmaster1024: nothing to do here! */
|
/* Hellmaster1024: nothing to do here! */
|
||||||
@@ -2555,7 +2564,7 @@ static int32_t container_ffmpeg_switch_audio(Context_t *context, int32_t *arg)
|
|||||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t container_ffmpeg_switch_subtitle(Context_t *context, int32_t *arg)
|
static int32_t container_ffmpeg_switch_subtitle(Context_t *context, int32_t *arg __attribute__((unused)))
|
||||||
{
|
{
|
||||||
ffmpeg_printf(10, "track %d\n", *arg);
|
ffmpeg_printf(10, "track %d\n", *arg);
|
||||||
/* This is made to flush inside the buffer because
|
/* This is made to flush inside the buffer because
|
||||||
|
@@ -87,12 +87,12 @@ static void mpeg4p2_context_reset(Mpeg4P2Context *context)
|
|||||||
context->packet_duration = 0;
|
context->packet_duration = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mpeg4p2_write(Context_t *ctx, Track_t *track, int avContextIdx, int64_t *currentVideoPts, int64_t *latestPts, AVPacket *pkt)
|
static void mpeg4p2_write(Context_t *ctx, Track_t *track, int avContextIdx, int64_t *pts_current, int64_t *pts_latest, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
*currentVideoPts = track->pts = calcPts(avContextIdx, track->stream, pkt->pts);
|
*pts_current = track->pts = calcPts(avContextIdx, track->stream, pkt->pts);
|
||||||
if ((*currentVideoPts > *latestPts) && (*currentVideoPts != INVALID_PTS_VALUE))
|
if ((*pts_current > *pts_latest) && (*pts_current != INVALID_PTS_VALUE))
|
||||||
{
|
{
|
||||||
*latestPts = *currentVideoPts;
|
*pts_latest = *pts_current;
|
||||||
}
|
}
|
||||||
track->dts = calcPts(avContextIdx, track->stream, pkt->dts);
|
track->dts = calcPts(avContextIdx, track->stream, pkt->dts);
|
||||||
AudioVideoOut_t avOut;
|
AudioVideoOut_t avOut;
|
||||||
|
@@ -39,7 +39,7 @@ static void wrapped_packet_unref(void *param)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wrapped_set_max_analyze_duration(void *param, int val)
|
static void wrapped_set_max_analyze_duration(void *param, int val __attribute__((unused)))
|
||||||
{
|
{
|
||||||
#if (LIBAVFORMAT_VERSION_MAJOR > 55) && (LIBAVFORMAT_VERSION_MAJOR < 56)
|
#if (LIBAVFORMAT_VERSION_MAJOR > 55) && (LIBAVFORMAT_VERSION_MAJOR < 56)
|
||||||
((AVFormatContext *)param)->max_analyze_duration2 = val;
|
((AVFormatContext *)param)->max_analyze_duration2 = val;
|
||||||
@@ -114,7 +114,7 @@ void free_all_stored_avcodec_context()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int store_avcodec_context(AVCodecContext *avCodecCtx, uint32_t cAVIdx, int id)
|
int store_avcodec_context(AVCodecContext *avCodecCtx __attribute__((unused)), uint32_t cAVIdx __attribute__((unused)), int id __attribute__((unused)))
|
||||||
{
|
{
|
||||||
CodecCtxStoreItem_t *ptr = malloc(sizeof(CodecCtxStoreItem_t));
|
CodecCtxStoreItem_t *ptr = malloc(sizeof(CodecCtxStoreItem_t));
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
@@ -152,8 +152,8 @@ static AVCodecContext *wrapped_avcodec_get_context(uint32_t cAVIdx, AVStream *st
|
|||||||
}
|
}
|
||||||
av_codec_set_pkt_timebase(avCodecCtx, stream->time_base);
|
av_codec_set_pkt_timebase(avCodecCtx, stream->time_base);
|
||||||
store_avcodec_context(avCodecCtx, cAVIdx, stream->id);
|
store_avcodec_context(avCodecCtx, cAVIdx, stream->id);
|
||||||
return avCodecCtx;
|
|
||||||
}
|
}
|
||||||
|
return avCodecCtx;
|
||||||
#else
|
#else
|
||||||
return stream->codec;
|
return stream->codec;
|
||||||
#endif
|
#endif
|
||||||
|
2
libeplayer3-arm/external/ffmpeg/get_bits.h
vendored
2
libeplayer3-arm/external/ffmpeg/get_bits.h
vendored
@@ -368,7 +368,7 @@ static inline unsigned int show_bits_long(GetBitContext *s, int n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int check_marker(void *logctx, GetBitContext *s, const char *msg)
|
static inline int check_marker(void *logctx __attribute__((unused)), GetBitContext *s, const char *msg __attribute__((unused)))
|
||||||
{
|
{
|
||||||
int bit = get_bits1(s);
|
int bit = get_bits1(s);
|
||||||
return bit;
|
return bit;
|
||||||
|
@@ -71,8 +71,7 @@ static inline int get_object_type(GetBitContext *gb)
|
|||||||
static inline int get_sample_rate(GetBitContext *gb, int *index)
|
static inline int get_sample_rate(GetBitContext *gb, int *index)
|
||||||
{
|
{
|
||||||
*index = get_bits(gb, 4);
|
*index = get_bits(gb, 4);
|
||||||
return *index == 0x0f ? get_bits(gb, 24) :
|
return *index == 0x0f ? (int)get_bits(gb, 24) : avpriv_mpeg4audio_sample_rates[*index];
|
||||||
avpriv_mpeg4audio_sample_rates[*index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
||||||
@@ -88,7 +87,7 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
|||||||
c->object_type = get_object_type(&gb);
|
c->object_type = get_object_type(&gb);
|
||||||
c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
|
c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
|
||||||
c->chan_config = get_bits(&gb, 4);
|
c->chan_config = get_bits(&gb, 4);
|
||||||
if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
|
if (c->chan_config < (int)FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
|
||||||
c->channels = ff_mpeg4audio_channels[c->chan_config];
|
c->channels = ff_mpeg4audio_channels[c->chan_config];
|
||||||
c->sbr = -1;
|
c->sbr = -1;
|
||||||
c->ps = -1;
|
c->ps = -1;
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
static inline int HasADTSHeader(uint8_t *data, int size)
|
static inline int HasADTSHeader(uint8_t *data, int size)
|
||||||
{
|
{
|
||||||
if (size >= AAC_HEADER_LENGTH && 0xFF == data[0] && 0xF0 == 0xF0 & data[1] &&
|
if (size >= AAC_HEADER_LENGTH && 0xFF == data[0] && 0xF0 == (0xF0 & data[1]) &&
|
||||||
size == ((data[3] & 0x3) << 11 | data[4] << 3 | data[5] >> 5))
|
size == ((data[3] & 0x3) << 11 | data[4] << 3 | data[5] >> 5))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -88,7 +88,7 @@ static int g_pfd[2] = {-1, -1}; /* Used to wake terminate thread */
|
|||||||
static int isPlaybackStarted = 0;
|
static int isPlaybackStarted = 0;
|
||||||
static pthread_mutex_t playbackStartMtx;
|
static pthread_mutex_t playbackStartMtx;
|
||||||
|
|
||||||
static void *TermThreadFun(void *arg)
|
static void *TermThreadFun(void *arg __attribute__((unused)))
|
||||||
{
|
{
|
||||||
const char *socket_path = "/tmp/iptvplayer_extplayer_term_fd";
|
const char *socket_path = "/tmp/iptvplayer_extplayer_term_fd";
|
||||||
struct sockaddr_un addr;
|
struct sockaddr_un addr;
|
||||||
@@ -211,7 +211,7 @@ static void SetNice(int prio)
|
|||||||
};
|
};
|
||||||
sched_setscheduler(0, SCHED_RR, ¶m);
|
sched_setscheduler(0, SCHED_RR, ¶m);
|
||||||
#else
|
#else
|
||||||
int prevPrio = getpriority(PRIO_PROCESS, 0);
|
//int prevPrio = getpriority(PRIO_PROCESS, 0);
|
||||||
if (-1 == setpriority(PRIO_PROCESS, 0, prio))
|
if (-1 == setpriority(PRIO_PROCESS, 0, prio))
|
||||||
{
|
{
|
||||||
printf("setpriority - failed\n");
|
printf("setpriority - failed\n");
|
||||||
@@ -484,9 +484,9 @@ static int ParseParams(int argc, char *argv[], char *file, char *audioFile, int
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int c;
|
int c;
|
||||||
int digit_optind = 0;
|
//int digit_optind = 0;
|
||||||
int aopt = 0, bopt = 0;
|
//int aopt = 0, bopt = 0;
|
||||||
char *copt = 0, *dopt = 0;
|
//char *copt = 0, *dopt = 0;
|
||||||
while ((c = getopt(argc, argv, "we3dlsrimva:n:x:u:c:h:o:p:P:t:9:0:1:4:f:")) != -1)
|
while ((c = getopt(argc, argv, "we3dlsrimva:n:x:u:c:h:o:p:P:t:9:0:1:4:f:")) != -1)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c)
|
||||||
@@ -877,7 +877,7 @@ int main(int argc, char *argv[])
|
|||||||
CurrentSec = (int32_t)(pts / 90000);
|
CurrentSec = (int32_t)(pts / 90000);
|
||||||
if (0 == commandRetVal)
|
if (0 == commandRetVal)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90, commandRetVal);
|
fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90);
|
||||||
}
|
}
|
||||||
if (0 == commandRetVal || force)
|
if (0 == commandRetVal || force)
|
||||||
{
|
{
|
||||||
@@ -922,7 +922,7 @@ int main(int argc, char *argv[])
|
|||||||
commandRetVal = g_player->playback->Command(g_player, PLAYBACK_PTS, &pts);
|
commandRetVal = g_player->playback->Command(g_player, PLAYBACK_PTS, &pts);
|
||||||
if (0 == commandRetVal)
|
if (0 == commandRetVal)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90, commandRetVal);
|
fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -941,7 +941,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
case 'n':
|
case 'n':
|
||||||
{
|
{
|
||||||
uint8_t loop = 0;
|
//uint8_t loop = 0;
|
||||||
if ('1' == argvBuff[1] || '0' == argvBuff[1])
|
if ('1' == argvBuff[1] || '0' == argvBuff[1])
|
||||||
{
|
{
|
||||||
PlaybackHandler_t *ptrP = g_player->playback;
|
PlaybackHandler_t *ptrP = g_player->playback;
|
||||||
|
@@ -54,12 +54,11 @@
|
|||||||
|
|
||||||
#ifdef SAM_WITH_DEBUG
|
#ifdef SAM_WITH_DEBUG
|
||||||
#define LINUXDVB_DEBUG
|
#define LINUXDVB_DEBUG
|
||||||
|
static unsigned short debug_level = 20;
|
||||||
#else
|
#else
|
||||||
#define LINUXDVB_SILENT
|
#define LINUXDVB_SILENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned short debug_level = 20;
|
|
||||||
|
|
||||||
static const char FILENAME[] = __FILE__;
|
static const char FILENAME[] = __FILE__;
|
||||||
|
|
||||||
#ifdef LINUXDVB_DEBUG
|
#ifdef LINUXDVB_DEBUG
|
||||||
@@ -311,8 +310,9 @@ int LinuxDvbPlay(Context_t *context, char *type)
|
|||||||
}
|
}
|
||||||
free(Encoding);
|
free(Encoding);
|
||||||
}
|
}
|
||||||
//return ret;
|
ret = cERR_LINUXDVB_NO_ERROR;
|
||||||
return 0;
|
return ret;
|
||||||
|
//return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
|
int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
|
||||||
@@ -425,7 +425,7 @@ int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus)
|
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus __attribute__((unused)))
|
||||||
{
|
{
|
||||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||||
// int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
|
// int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
|
||||||
@@ -474,7 +474,7 @@ int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
|
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
|
||||||
{
|
{
|
||||||
// unsigned char video = !strcmp("video", type);
|
// unsigned char video = !strcmp("video", type);
|
||||||
// unsigned char audio = !strcmp("audio", type);
|
// unsigned char audio = !strcmp("audio", type);
|
||||||
@@ -507,6 +507,7 @@ int LinuxDvbFastForward(Context_t *context, char *type)
|
|||||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||||
unsigned char video = !strcmp("video", type);
|
unsigned char video = !strcmp("video", type);
|
||||||
unsigned char audio = !strcmp("audio", type);
|
unsigned char audio = !strcmp("audio", type);
|
||||||
|
if (audio) {}
|
||||||
linuxdvb_printf(10, "v%d a%d speed %d\n", video, audio, context->playback->Speed);
|
linuxdvb_printf(10, "v%d a%d speed %d\n", video, audio, context->playback->Speed);
|
||||||
if (video && videofd != -1)
|
if (video && videofd != -1)
|
||||||
{
|
{
|
||||||
@@ -601,7 +602,7 @@ int LinuxDvbSlowMotion(Context_t *context, char *type)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused)))
|
int LinuxDvbAVSync(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
|
||||||
{
|
{
|
||||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||||
/* konfetti: this one is dedicated to audiofd so we
|
/* konfetti: this one is dedicated to audiofd so we
|
||||||
@@ -691,7 +692,7 @@ int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long i
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned long long int *frameCount)
|
int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned long long int *frameCount __attribute__((unused)))
|
||||||
{
|
{
|
||||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||||
return ret;
|
return ret;
|
||||||
|
@@ -97,14 +97,14 @@ static int isSubtitleOpened = 0;
|
|||||||
/* Functions */
|
/* Functions */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
|
||||||
static void getMutex(int line)
|
static void getMutex(int line __attribute__((unused)))
|
||||||
{
|
{
|
||||||
subtitle_printf(100, "%d requesting mutex\n", line);
|
subtitle_printf(100, "%d requesting mutex\n", line);
|
||||||
pthread_mutex_lock(&mutex);
|
pthread_mutex_lock(&mutex);
|
||||||
subtitle_printf(100, "%d received mutex\n", line);
|
subtitle_printf(100, "%d received mutex\n", line);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void releaseMutex(int line)
|
static void releaseMutex(int line __attribute__((unused)))
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&mutex);
|
pthread_mutex_unlock(&mutex);
|
||||||
subtitle_printf(100, "%d released mutex\n", line);
|
subtitle_printf(100, "%d released mutex\n", line);
|
||||||
@@ -202,7 +202,7 @@ static int Write(void *_context, void *data)
|
|||||||
}
|
}
|
||||||
out = (SubtitleOut_t *) data;
|
out = (SubtitleOut_t *) data;
|
||||||
context->manager->subtitle->Command(context, MANAGER_GET, &curtrackid);
|
context->manager->subtitle->Command(context, MANAGER_GET, &curtrackid);
|
||||||
if (curtrackid != out->trackId)
|
if (curtrackid != (int32_t)out->trackId)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
@@ -232,7 +232,7 @@ static int Write(void *_context, void *data)
|
|||||||
|
|
||||||
static int32_t subtitle_Open(Context_t *context __attribute__((unused)))
|
static int32_t subtitle_Open(Context_t *context __attribute__((unused)))
|
||||||
{
|
{
|
||||||
uint32_t i = 0 ;
|
//uint32_t i = 0 ;
|
||||||
subtitle_printf(10, "\n");
|
subtitle_printf(10, "\n");
|
||||||
if (isSubtitleOpened == 1)
|
if (isSubtitleOpened == 1)
|
||||||
{
|
{
|
||||||
@@ -248,7 +248,7 @@ static int32_t subtitle_Open(Context_t *context __attribute__((unused)))
|
|||||||
|
|
||||||
static int32_t subtitle_Close(Context_t *context __attribute__((unused)))
|
static int32_t subtitle_Close(Context_t *context __attribute__((unused)))
|
||||||
{
|
{
|
||||||
uint32_t i = 0 ;
|
//uint32_t i = 0 ;
|
||||||
subtitle_printf(10, "\n");
|
subtitle_printf(10, "\n");
|
||||||
getMutex(__LINE__);
|
getMutex(__LINE__);
|
||||||
isSubtitleOpened = 0;
|
isSubtitleOpened = 0;
|
||||||
@@ -257,7 +257,7 @@ static int32_t subtitle_Close(Context_t *context __attribute__((unused)))
|
|||||||
return cERR_SUBTITLE_NO_ERROR;
|
return cERR_SUBTITLE_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int Command(void *_context, OutputCmd_t command, void *argument)
|
static int Command(void *_context, OutputCmd_t command, void *argument __attribute__((unused)))
|
||||||
{
|
{
|
||||||
Context_t *context = (Context_t *) _context;
|
Context_t *context = (Context_t *) _context;
|
||||||
int ret = cERR_SUBTITLE_NO_ERROR;
|
int ret = cERR_SUBTITLE_NO_ERROR;
|
||||||
|
@@ -182,7 +182,7 @@ static int _writeData(void *_call, int type)
|
|||||||
else // check LOAS header
|
else // check LOAS header
|
||||||
{
|
{
|
||||||
if (!(call->len > 2 && call->data[0] == 0x56 && (call->data[1] >> 4) == 0xe &&
|
if (!(call->len > 2 && call->data[0] == 0x56 && (call->data[1] >> 4) == 0xe &&
|
||||||
(AV_RB16(call->data + 1) & 0x1FFF) + 3 == call->len))
|
((uint32_t)(AV_RB16(call->data + 1) & 0x1FFF) + 3) == call->len))
|
||||||
{
|
{
|
||||||
aac_err("parsing Data with wrong latm header. ignoring...\n");
|
aac_err("parsing Data with wrong latm header. ignoring...\n");
|
||||||
return 0;
|
return 0;
|
||||||
@@ -218,7 +218,7 @@ static int writeDataADTS(void *_call)
|
|||||||
aac_err("file pointer < 0. ignoring ...\n");
|
aac_err("file pointer < 0. ignoring ...\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((call->private_data && 0 == strncmp("ADTS", call->private_data, call->private_size)) ||
|
if ((call->private_data && 0 == strncmp("ADTS", (const char *)call->private_data, call->private_size)) ||
|
||||||
HasADTSHeader(call->data, call->len))
|
HasADTSHeader(call->data, call->len))
|
||||||
{
|
{
|
||||||
return _writeData(_call, 0);
|
return _writeData(_call, 0);
|
||||||
@@ -272,7 +272,7 @@ static int writeDataLATM(void *_call)
|
|||||||
aac_err("parsing NULL Data. ignoring...\n");
|
aac_err("parsing NULL Data. ignoring...\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (call->private_data && 0 == strncmp("LATM", call->private_data, call->private_size))
|
if (call->private_data && 0 == strncmp("LATM", (const char *)call->private_data, call->private_size))
|
||||||
{
|
{
|
||||||
return _writeData(_call, 1);
|
return _writeData(_call, 1);
|
||||||
}
|
}
|
||||||
|
@@ -117,7 +117,7 @@ static int writeData(void *_call)
|
|||||||
{
|
{
|
||||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE + 4];
|
unsigned char PesHeader[PES_MAX_HEADER_SIZE + 4];
|
||||||
unsigned char Version = 5;
|
// unsigned char Version = 5;
|
||||||
// unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE;
|
// unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE;
|
||||||
divx_printf(10, "\n");
|
divx_printf(10, "\n");
|
||||||
if (call == NULL)
|
if (call == NULL)
|
||||||
|
@@ -195,12 +195,14 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne
|
|||||||
if (cd_len > 7 && data[0] == 1)
|
if (cd_len > 7 && data[0] == 1)
|
||||||
{
|
{
|
||||||
unsigned short len = (data[6] << 8) | data[7];
|
unsigned short len = (data[6] << 8) | data[7];
|
||||||
if (cd_len >= (len + 8))
|
if (cd_len >= (uint32_t)(len + 8))
|
||||||
{
|
{
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
uint8_t profile_num[] = { 66, 77, 88, 100 };
|
uint8_t profile_num[] = { 66, 77, 88, 100 };
|
||||||
uint8_t profile_cmp[2] = { 0x67, 0x00 };
|
uint8_t profile_cmp[2] = { 0x67, 0x00 };
|
||||||
const char *profile_str[] = { "baseline", "main", "extended", "high" };
|
const char *profile_str[] = { "baseline", "main", "extended", "high" };
|
||||||
|
/* avoid compiler warning */
|
||||||
|
if (*profile_str) {}
|
||||||
memcpy(tmp, Head, sizeof(Head));
|
memcpy(tmp, Head, sizeof(Head));
|
||||||
tmp_len += 4;
|
tmp_len += 4;
|
||||||
memcpy(tmp + tmp_len, data + 8, len);
|
memcpy(tmp + tmp_len, data + 8, len);
|
||||||
@@ -289,7 +291,7 @@ static int writeData(void *_call)
|
|||||||
unsigned long long int VideoPts;
|
unsigned long long int VideoPts;
|
||||||
unsigned int TimeDelta;
|
unsigned int TimeDelta;
|
||||||
unsigned int TimeScale;
|
unsigned int TimeScale;
|
||||||
int len = 0;
|
unsigned int len = 0;
|
||||||
int ic = 0;
|
int ic = 0;
|
||||||
struct iovec iov[IOVEC_SIZE];
|
struct iovec iov[IOVEC_SIZE];
|
||||||
h264_printf(20, "\n");
|
h264_printf(20, "\n");
|
||||||
@@ -300,6 +302,9 @@ static int writeData(void *_call)
|
|||||||
}
|
}
|
||||||
TimeDelta = call->FrameRate;
|
TimeDelta = call->FrameRate;
|
||||||
TimeScale = call->FrameScale;
|
TimeScale = call->FrameScale;
|
||||||
|
/* avoid compiler warnings */
|
||||||
|
if (TimeDelta) {}
|
||||||
|
if (TimeScale) {}
|
||||||
VideoPts = call->Pts;
|
VideoPts = call->Pts;
|
||||||
h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale);
|
h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale);
|
||||||
if ((call->data == NULL) || (call->len <= 0))
|
if ((call->data == NULL) || (call->len <= 0))
|
||||||
@@ -314,8 +319,8 @@ static int writeData(void *_call)
|
|||||||
}
|
}
|
||||||
/* AnnexA */
|
/* AnnexA */
|
||||||
if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) ||
|
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->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->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff)))))
|
||||||
{
|
{
|
||||||
uint32_t PacketLength = 0;
|
uint32_t PacketLength = 0;
|
||||||
uint32_t FakeStartCode = (call->Version << 8) | PES_VERSION_FAKE_START_CODE;
|
uint32_t FakeStartCode = (call->Version << 8) | PES_VERSION_FAKE_START_CODE;
|
||||||
|
@@ -116,7 +116,7 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne
|
|||||||
}
|
}
|
||||||
*NalLength = (data[21] & 3) + 1;
|
*NalLength = (data[21] & 3) + 1;
|
||||||
int num_param_sets = data[22];
|
int num_param_sets = data[22];
|
||||||
int pos = 23;
|
uint32_t pos = 23;
|
||||||
for (i = 0; i < num_param_sets; i++)
|
for (i = 0; i < num_param_sets; i++)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
@@ -175,7 +175,7 @@ static int writeData(void *_call)
|
|||||||
unsigned long long int VideoPts;
|
unsigned long long int VideoPts;
|
||||||
unsigned int TimeDelta;
|
unsigned int TimeDelta;
|
||||||
unsigned int TimeScale;
|
unsigned int TimeScale;
|
||||||
int len = 0;
|
unsigned int len = 0;
|
||||||
int ic = 0;
|
int ic = 0;
|
||||||
struct iovec iov[IOVEC_SIZE];
|
struct iovec iov[IOVEC_SIZE];
|
||||||
h264_printf(20, "\n");
|
h264_printf(20, "\n");
|
||||||
@@ -186,6 +186,9 @@ static int writeData(void *_call)
|
|||||||
}
|
}
|
||||||
TimeDelta = call->FrameRate;
|
TimeDelta = call->FrameRate;
|
||||||
TimeScale = call->FrameScale;
|
TimeScale = call->FrameScale;
|
||||||
|
/* avoid compiler warnings */
|
||||||
|
if (TimeDelta) {}
|
||||||
|
if (TimeScale) {}
|
||||||
VideoPts = call->Pts;
|
VideoPts = call->Pts;
|
||||||
h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale);
|
h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale);
|
||||||
if ((call->data == NULL) || (call->len <= 0))
|
if ((call->data == NULL) || (call->len <= 0))
|
||||||
|
@@ -152,7 +152,7 @@ static int32_t writeData(void *_call)
|
|||||||
int32_t block_align = 0;
|
int32_t block_align = 0;
|
||||||
int32_t byterate = 0;
|
int32_t byterate = 0;
|
||||||
uint32_t codecID = (uint32_t)pcmPrivateData->ffmpeg_codec_id;
|
uint32_t codecID = (uint32_t)pcmPrivateData->ffmpeg_codec_id;
|
||||||
uint8_t dataPrecision = 0;
|
//uint8_t dataPrecision = 0;
|
||||||
uint8_t LE = 0;
|
uint8_t LE = 0;
|
||||||
switch (codecID)
|
switch (codecID)
|
||||||
{
|
{
|
||||||
@@ -224,6 +224,8 @@ static int32_t writeData(void *_call)
|
|||||||
fixed_buffer = malloc(fixed_buffersize);
|
fixed_buffer = malloc(fixed_buffersize);
|
||||||
}
|
}
|
||||||
fixed_bufferfilled = 0;
|
fixed_bufferfilled = 0;
|
||||||
|
/* avoid compiler warning */
|
||||||
|
if (LE) {}
|
||||||
//printf("PCM fixed_buffersize [%u] [%s]\n", fixed_buffersize, LE ? "LE":"BE");
|
//printf("PCM fixed_buffersize [%u] [%s]\n", fixed_buffersize, LE ? "LE":"BE");
|
||||||
}
|
}
|
||||||
while (size > 0)
|
while (size > 0)
|
||||||
|
@@ -110,7 +110,7 @@ static int reset()
|
|||||||
static int writeData(void *_call)
|
static int writeData(void *_call)
|
||||||
{
|
{
|
||||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||||
int len = 0;
|
//int len = 0;
|
||||||
vc1_printf(10, "\n");
|
vc1_printf(10, "\n");
|
||||||
if (call == NULL)
|
if (call == NULL)
|
||||||
{
|
{
|
||||||
|
@@ -106,7 +106,7 @@ static int reset()
|
|||||||
static int writeData(void *_call)
|
static int writeData(void *_call)
|
||||||
{
|
{
|
||||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||||
int len = 0;
|
//int len = 0;
|
||||||
wma_printf(10, "\n");
|
wma_printf(10, "\n");
|
||||||
if (call == NULL)
|
if (call == NULL)
|
||||||
{
|
{
|
||||||
|
@@ -145,7 +145,7 @@ ssize_t write_with_retry(int fd, const void *buf, size_t size)
|
|||||||
ssize_t writev_with_retry(int fd, const struct iovec *iov, size_t ic)
|
ssize_t writev_with_retry(int fd, const struct iovec *iov, size_t ic)
|
||||||
{
|
{
|
||||||
ssize_t len = 0;
|
ssize_t len = 0;
|
||||||
int i = 0;
|
uint32_t i = 0;
|
||||||
for (i = 0; i < ic; ++i)
|
for (i = 0; i < ic; ++i)
|
||||||
{
|
{
|
||||||
write_with_retry(fd, iov[i].iov_base, iov[i].iov_len);
|
write_with_retry(fd, iov[i].iov_base, iov[i].iov_len);
|
||||||
|
@@ -32,12 +32,11 @@
|
|||||||
|
|
||||||
#ifdef SAM_WITH_DEBUG
|
#ifdef SAM_WITH_DEBUG
|
||||||
#define PLAYBACK_DEBUG
|
#define PLAYBACK_DEBUG
|
||||||
|
static short debug_level = 20;
|
||||||
#else
|
#else
|
||||||
#define PLAYBACK_SILENT
|
#define PLAYBACK_SILENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static short debug_level = 20;
|
|
||||||
|
|
||||||
#ifdef PLAYBACK_DEBUG
|
#ifdef PLAYBACK_DEBUG
|
||||||
#define playback_printf(level, fmt, x...) do { \
|
#define playback_printf(level, fmt, x...) do { \
|
||||||
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
|
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
|
||||||
@@ -565,7 +564,7 @@ static int32_t PlaybackPts(Context_t *context, int64_t *pts)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t PlaybackGetFrameCount(Context_t *context, int64_t *frameCount)
|
static int32_t PlaybackGetFrameCount(Context_t *context, uint64_t *frameCount)
|
||||||
{
|
{
|
||||||
int ret = cERR_PLAYBACK_NO_ERROR;
|
int ret = cERR_PLAYBACK_NO_ERROR;
|
||||||
playback_printf(20, "\n");
|
playback_printf(20, "\n");
|
||||||
|
Reference in New Issue
Block a user