From c5d1b0438268ed347ab37295beae8a0c88be5e74 Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Fri, 19 Jan 2018 15:09:41 +0100 Subject: [PATCH 01/18] libeplayer3-arm: fix fast forward (thx DboxOldie) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/fd5025a5070d9b84fe7f0ad6552df9ee055fd4bf Author: Frankenstone Date: 2018-01-19 (Fri, 19 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/output/linuxdvb_mipsel.c | 4 ++++ libeplayer3-arm/playback/playback.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libeplayer3-arm/output/linuxdvb_mipsel.c b/libeplayer3-arm/output/linuxdvb_mipsel.c index fd8cd56..8990c5b 100644 --- a/libeplayer3-arm/output/linuxdvb_mipsel.c +++ b/libeplayer3-arm/output/linuxdvb_mipsel.c @@ -401,6 +401,10 @@ int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type) linuxdvb_printf(10, "v%d a%d\n", video, audio); if (video && videofd != -1) { + if (context->playback->isForwarding == 0) + { + ioctl(videofd, VIDEO_FAST_FORWARD, 0); + } if (ioctl(videofd, VIDEO_CONTINUE, NULL) == -1) { linuxdvb_err("ioctl failed with errno %d\n", errno); diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index 1c8a668..986017e 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -310,15 +310,15 @@ static int32_t PlaybackContinue(Context_t *context) (context->playback->isPaused || context->playback->isForwarding || context->playback->BackWard || context->playback->SlowMotion)) { - if (context->playback->SlowMotion) + if (context->playback->SlowMotion || context->playback->isForwarding) context->output->Command(context, OUTPUT_CLEAR, NULL); - context->output->Command(context, OUTPUT_CONTINUE, NULL); context->playback->isPaused = 0; //context->playback->isPlaying = 1; context->playback->isForwarding = 0; context->playback->BackWard = 0; context->playback->SlowMotion = 0; context->playback->Speed = 1; + context->output->Command(context, OUTPUT_CONTINUE, NULL); } else { @@ -425,6 +425,7 @@ static int PlaybackFastForward(Context_t *context, int *speed) context->playback->Speed = *speed; playback_printf(20, "Speed: %d x {%d}\n", *speed, context->playback->Speed); context->output->Command(context, OUTPUT_FASTFORWARD, NULL); + context->output->Command(context, OUTPUT_CONTINUE, NULL); } else { From 1631c866199186546b4826ea85426cfeedd2bd7b Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 21 Jan 2018 15:46:53 +0100 Subject: [PATCH 02/18] arm try fix fast backward Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/2c7c605ff5af7aef7e3ce32f077c873e7139d220 Author: TangoCash Date: 2018-01-21 (Sun, 21 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/container_ffmpeg.c | 30 +++++++++++--------- libeplayer3-arm/playback/playback.c | 28 ++++++++++++++---- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index 12cd061..67dd742 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -59,7 +59,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ -#if (LIBAVFORMAT_VERSION_MAJOR > 57) +#if (LIBAVFORMAT_VERSION_MAJOR > 56) #define TS_BYTES_SEEKING 0 #else #define TS_BYTES_SEEKING 1 @@ -2365,9 +2365,10 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab Track_t *audioTrack = NULL; Track_t *current = NULL; seek_target_flag = 0; + sec *= AV_TIME_BASE; if (!absolute) { - ffmpeg_printf(10, "seeking %f sec\n", sec); + ffmpeg_printf(10, "seeking %lld sec\n", sec / AV_TIME_BASE); if (sec == 0) { ffmpeg_err("sec = 0 ignoring\n"); @@ -2382,14 +2383,15 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab ffmpeg_err("fail to get current PTS\n"); return cERR_CONTAINER_FFMPEG_ERR; } - sec += currPts / 90000; + sec += (currPts / 90000 * AV_TIME_BASE); + } + + if (sec < 0) + { + sec = 0; } } - ffmpeg_printf(10, "goto %d sec\n", sec); - if (sec < 0) - { - sec = 0; - } + ffmpeg_printf(10, "goto %lld sec\n", sec / AV_TIME_BASE); context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack); context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack); if (videoTrack != NULL) @@ -2415,7 +2417,7 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab releaseMutex(__FILE__, __FUNCTION__, __LINE__); return cERR_CONTAINER_FFMPEG_NO_ERROR; } - ffmpeg_printf(10, "iformat->flags %d\n", avContextTab[0]->iformat->flags); + ffmpeg_printf(10, "iformat->flags 0x%08x\n", avContextTab[0]->iformat->flags); #if defined(TS_BYTES_SEEKING) && TS_BYTES_SEEKING if (avContextTab[0]->iformat->flags & AVFMT_TS_DISCONT) { @@ -2426,11 +2428,11 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab * about 10 seconds, backward does not work. */ off_t pos = avio_tell(avContextTab[0]->pb); - ffmpeg_printf(10, "pos %lld %d\n", pos, avContextTab[0]->bit_rate); + ffmpeg_printf(10, "pos %lld %lld\n", pos, avContextTab[0]->bit_rate); if (avContextTab[0]->bit_rate) { sec *= avContextTab[0]->bit_rate / 8; - ffmpeg_printf(10, "bit_rate %d\n", avContextTab[0]->bit_rate); + ffmpeg_printf(10, "bit_rate %lld\n", avContextTab[0]->bit_rate); } else { @@ -2441,14 +2443,14 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab { pos = 0; } - ffmpeg_printf(10, "1. seeking to position %lld bytes ->sec %d\n", pos, sec); - seek_target_bytes = pos; + ffmpeg_printf(10, "1. seeking to position %lld bytes ->sec %lld\n", pos / AV_TIME_BASE, sec / AV_TIME_BASE); + seek_target_bytes = pos / AV_TIME_BASE; do_seek_target_bytes = 1; } else #endif { - seek_target_seconds = sec * AV_TIME_BASE; + seek_target_seconds = sec; do_seek_target_seconds = 1; } releaseMutex(__FILE__, __FUNCTION__, __LINE__); diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index 986017e..0ea3ad3 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -95,7 +95,22 @@ static void SupervisorThread(Context_t *context) hasThreadStarted = 1; playback_printf(10, ">\n"); while (context && context->playback && context->playback->isPlaying && !context->playback->abortRequested) - usleep(100000); + { + if (context->playback->BackWard != 0) + { + /* Offset -3 seconds for backward + * so initial backward speed is 4x */ + int64_t pos = (int64_t)context->playback->Speed - 3; + playback_printf(10, "Speed %d BackWard %d to seek %lld\n", context->playback->Speed, context->playback->BackWard, pos); + context->playback->isSeeking = 1; + context->output->Command(context, OUTPUT_CLEAR, NULL); + context->container->selectedContainer->Command(context, CONTAINER_SEEK, &pos); + context->playback->isSeeking = 0; + usleep(350000); + } else { + usleep(100000); + } + } playback_printf(10, "<\n"); hasThreadStarted = 2; PlaybackTerminate(context); @@ -310,8 +325,10 @@ static int32_t PlaybackContinue(Context_t *context) (context->playback->isPaused || context->playback->isForwarding || context->playback->BackWard || context->playback->SlowMotion)) { - if (context->playback->SlowMotion || context->playback->isForwarding) + if (context->playback->SlowMotion || context->playback->isForwarding || context->playback->BackWard) context->output->Command(context, OUTPUT_CLEAR, NULL); + if (context->playback->BackWard) + context->output->Command(context, OUTPUT_AUDIOMUTE, "0"); context->playback->isPaused = 0; //context->playback->isPlaying = 1; context->playback->isForwarding = 0; @@ -453,15 +470,16 @@ static int PlaybackFastBackward(Context_t *context, int *speed) { context->playback->BackWard = 0; context->playback->Speed = 0; /* reverse end */ + context->output->Command(context, OUTPUT_AUDIOMUTE, "0"); } else { context->playback->isSeeking = 1; context->playback->Speed = *speed; - context->playback->BackWard = 2 ^ (*speed); - playback_printf(1, "S %d B %f\n", context->playback->Speed, context->playback->BackWard); + context->playback->BackWard = 1; + context->output->Command(context, OUTPUT_AUDIOMUTE, "1"); + playback_printf(1, "S %d B %d\n", context->playback->Speed, context->playback->BackWard); } - context->output->Command(context, OUTPUT_AUDIOMUTE, "1"); context->output->Command(context, OUTPUT_CLEAR, NULL); if (context->output->Command(context, OUTPUT_REVERSE, NULL) < 0) { From bbedc17e753f0862c510297d2e9f3c2848dab0c3 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 3 Jan 2018 19:33:40 +0100 Subject: [PATCH 03/18] remove double AV_CODEC_ID_EAC3 Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/a364f5ef05890b352a7a2d8ab990c805b0afcb9c Author: Jacek Jendrzej Date: 2018-01-03 (Wed, 03 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/container_ffmpeg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index 67dd742..eb47aff 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -391,7 +391,6 @@ static char *Codec2Encoding(int32_t codec_id, int32_t media_type, uint8_t *extra case AV_CODEC_ID_WMAV1: case AV_CODEC_ID_WMAV2: return (wma_software_decode) ? "A_IPCM" : "A_WMA"; - case 86056: case AV_CODEC_ID_WMAPRO: return (wma_software_decode) ? "A_IPCM" : "A_WMA/PRO"; case AV_CODEC_ID_WMALOSSLESS: From 960f78ea17ec93507d9ebf08bfff138752e11226 Mon Sep 17 00:00:00 2001 From: max_10 Date: Wed, 24 Jan 2018 01:11:57 +0100 Subject: [PATCH 04/18] arm try improve fast backward Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/785f0bee1c647a534c3e9c9f72fd8aa1ef05c46d Author: max_10 Date: 2018-01-24 (Wed, 24 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/container_ffmpeg.c | 48 ++++++++++++++++++-- libeplayer3-arm/playback/playback.c | 15 +----- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index eb47aff..ed39ac1 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -588,8 +588,48 @@ static void FFMPEGThread(Context_t *context) } continue; } + if (context->playback->BackWard && av_gettime() >= showtime) { + context->output->Command(context, OUTPUT_CLEAR, "video"); + + if (bofcount == 1) { + showtime = av_gettime(); + usleep(100000); + continue; + } + + if (avContextTab[0]->iformat->flags & AVFMT_TS_DISCONT) { + off_t pos = avio_tell(avContextTab[0]->pb); + + if (pos > 0) { + float br; + if (avContextTab[0]->bit_rate) + br = avContextTab[0]->bit_rate / 8.0; + else + br = 180000.0; + seek_target_bytes = (double)pos + (double)context->playback->Speed * 8.0 * br; + if (seek_target_bytes < 0) + seek_target_bytes = 1; + do_seek_target_bytes = 1; + } + } + else + { + int64_t currPts = -1; + context->playback->Command(context, PLAYBACK_PTS, &currPts); + seek_target_seconds = ((double)currPts / 90000.0 + context->playback->Speed) * AV_TIME_BASE; + if (seek_target_seconds < 0) + seek_target_seconds = AV_TIME_BASE; + do_seek_target_seconds = 1; + } + showtime = av_gettime() + 300000; //jump back every 300ms + } + else + { + bofcount = 0; + } if (do_seek_target_seconds || do_seek_target_bytes) { + int res = -1; isWaitingForFinish = 0; if (do_seek_target_seconds) { @@ -607,8 +647,9 @@ static void FFMPEGThread(Context_t *context) { seek_target_seconds += avContextTab[i]->start_time; } - //av_seek_frame(avContextTab[i], -1, seek_target_seconds, 0); - avformat_seek_file(avContextTab[i], -1, INT64_MIN, seek_target_seconds, INT64_MAX, 0); + res = avformat_seek_file(avContextTab[i], -1, INT64_MIN, seek_target_seconds, INT64_MAX, 0); + if (res < 0 && context->playback->BackWard) + bofcount = 1; } else { @@ -1784,7 +1825,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 { track.TimeScale = 1000; } - ffmpeg_printf(10, "bit_rate [%d]\n", get_codecpar(stream)->bit_rate); + ffmpeg_printf(10, "bit_rate [%lld]\n", get_codecpar(stream)->bit_rate); ffmpeg_printf(10, "time_base.den [%d]\n", stream->time_base.den); ffmpeg_printf(10, "time_base.num [%d]\n", stream->time_base.num); ffmpeg_printf(10, "width [%d]\n", get_codecpar(stream)->width); @@ -1803,6 +1844,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 ffmpeg_printf(10, "Stream has no duration so we take the duration from context\n"); track.duration = (int64_t) avContext->duration / 1000; } + ffmpeg_printf(10, "duration [%lld]\n", track.duration); if (context->manager->video) { if (get_codecpar(stream)->codec_id == AV_CODEC_ID_MPEG4) diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index 0ea3ad3..071ef40 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -96,20 +96,7 @@ static void SupervisorThread(Context_t *context) playback_printf(10, ">\n"); while (context && context->playback && context->playback->isPlaying && !context->playback->abortRequested) { - if (context->playback->BackWard != 0) - { - /* Offset -3 seconds for backward - * so initial backward speed is 4x */ - int64_t pos = (int64_t)context->playback->Speed - 3; - playback_printf(10, "Speed %d BackWard %d to seek %lld\n", context->playback->Speed, context->playback->BackWard, pos); - context->playback->isSeeking = 1; - context->output->Command(context, OUTPUT_CLEAR, NULL); - context->container->selectedContainer->Command(context, CONTAINER_SEEK, &pos); - context->playback->isSeeking = 0; - usleep(350000); - } else { - usleep(100000); - } + usleep(100000); } playback_printf(10, "<\n"); hasThreadStarted = 2; From f598dbc93c09755b42e446f837f9afc2248fabf8 Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Mon, 29 Jan 2018 22:19:37 +0100 Subject: [PATCH 05/18] arm different tuner authorization (thx DboxOldie) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/009f1b7c1ee248dde727146140d1eb0e1cf4861c Author: Frankenstone Date: 2018-01-29 (Mon, 29 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- common/ca_ci.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/common/ca_ci.cpp b/common/ca_ci.cpp index deaa4e5..aa1fbc6 100644 --- a/common/ca_ci.cpp +++ b/common/ca_ci.cpp @@ -43,6 +43,7 @@ ca_slot_info_t info; #endif #if HAVE_ARM_HARDWARE const char ci_path[] = "/dev/ci%d"; +static int last_source = -1; #endif static bool checkLiveSlot = false; static bool CertChecked = false; @@ -927,6 +928,8 @@ bool cCA::SendCAPMT(u64 tpid, u8 source, u8 camask, const unsigned char * cabuf, setInputSource((eDVBCISlot*)(*it), false); } } + if (!(*it)->init) + last_source = (int)source; } #endif printf("No free ci-slot\n"); @@ -1192,6 +1195,7 @@ void cCA::ModuleReset(enum CA_SLOT_TYPE, uint32_t slot) (*it)->status = eStatusReset; usleep(200000); #if HAVE_ARM_HARDWARE + last_source = (int)(*it)->source; setInputSource((eDVBCISlot*)(*it), false); #endif if ((*it)->hasCCManager) @@ -1284,6 +1288,7 @@ void cCA::ci_removed(eDVBCISlot* slot) { printf("cam (%d) status changed ->cam now _not_ present\n", slot->slot); #if HAVE_ARM_HARDWARE + last_source = (int)slot->source; setInputSource(slot, false); #endif if (slot->hasCCManager) @@ -1383,7 +1388,7 @@ void cCA::slot_pollthread(void *c) } #endif ci_inserted(slot); - setInputSource(slot, true); + //setInputSource(slot, true); goto FROM_FIRST; } } @@ -1594,6 +1599,14 @@ FROM_FIRST: break; } /* switch(slot->status) */ #endif /* end Duckbox */ +#if HAVE_ARM_HARDWARE + if (!slot->init && slot->camIsReady && last_source > -1) + { + slot->source = (u8)last_source; + setInputSource(slot, true); + last_source = -1; + } +#endif if (slot->hasCAManager && slot->hasAppManager && !slot->init) { slot->init = true; @@ -1631,7 +1644,7 @@ FROM_FIRST: slot->ccmgrSession->resendKey(slot); } /* slow down for hd51 to avoid high cpu load */ - if (wait && slot->init) + if (wait && slot->init && !slot->mmiOpened) usleep(300000); } } From baceff16bbbbdad6dc107312e1d34acf15d31829 Mon Sep 17 00:00:00 2001 From: max_10 Date: Thu, 8 Feb 2018 20:42:15 +0100 Subject: [PATCH 06/18] libeplayer3-arm: reduce compiler warnings Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/0d4262e8e90456d749d5b489664ecb6a9fcf6869 Author: max_10 Date: 2018-02-08 (Thu, 08 Feb 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_libeplayer3.cpp | 10 ++--- libarmbox/playback_libeplayer3.h | 4 +- libarmbox/video.cpp | 2 +- libeplayer3-arm/container/buff_ffmpeg.c | 20 ++++----- libeplayer3-arm/container/container_ffmpeg.c | 45 +++++++++++-------- libeplayer3-arm/container/mpeg4p2_ffmpeg.c | 8 ++-- libeplayer3-arm/container/wrapped_ffmpeg.c | 6 +-- libeplayer3-arm/external/ffmpeg/get_bits.h | 2 +- .../external/ffmpeg/src/mpeg4audio.c | 5 +-- libeplayer3-arm/include/aac.h | 2 +- libeplayer3-arm/main/exteplayer.c | 16 +++---- libeplayer3-arm/output/linuxdvb_mipsel.c | 17 +++---- libeplayer3-arm/output/output_subtitle.c | 12 ++--- libeplayer3-arm/output/writer/mipsel/aac.c | 6 +-- libeplayer3-arm/output/writer/mipsel/divx3.c | 2 +- libeplayer3-arm/output/writer/mipsel/h264.c | 13 ++++-- libeplayer3-arm/output/writer/mipsel/h265.c | 7 ++- libeplayer3-arm/output/writer/mipsel/pcm.c | 4 +- libeplayer3-arm/output/writer/mipsel/vc1.c | 2 +- libeplayer3-arm/output/writer/mipsel/wma.c | 2 +- libeplayer3-arm/output/writer/mipsel/writer.c | 2 +- libeplayer3-arm/playback/playback.c | 5 +-- 22 files changed, 105 insertions(+), 87 deletions(-) diff --git a/libarmbox/playback_libeplayer3.cpp b/libarmbox/playback_libeplayer3.cpp index 846190d..c5acdba 100644 --- a/libarmbox/playback_libeplayer3.cpp +++ b/libarmbox/playback_libeplayer3.cpp @@ -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); } -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 isHTTP = false; @@ -247,7 +247,7 @@ bool cPlayback::SetAPid(int pid, bool /* ac3 */) return true; } -bool cPlayback::SetVPid(int pid) +bool cPlayback::SetVPid(int /*pid*/) { lt_info("%s\n", __func__); return true; @@ -269,7 +269,7 @@ bool cPlayback::SetSubtitlePid(int pid) bool cPlayback::SetTeletextPid(int pid) { lt_info("%s\n", __func__); - int i = pid; + //int i = pid; if (pid != mTeletextStream) { //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__); - int max_numpids = *numpids; + //int max_numpids = *numpids; *numpids = 0; /* if (player && player->manager && player->manager->teletext) diff --git a/libarmbox/playback_libeplayer3.h b/libarmbox/playback_libeplayer3.h index 15b1b16..0709384 100644 --- a/libarmbox/playback_libeplayer3.h +++ b/libarmbox/playback_libeplayer3.h @@ -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(std::string filename, std::string headers = ""); bool SetAPid(int pid, bool ac3 = false); - bool SetVPid(int pid); + bool SetVPid(int /*pid*/); bool SetSubtitlePid(int pid); bool SetTeletextPid(int pid); int GetAPid(void) { return mAudioStream; } @@ -54,7 +54,7 @@ class cPlayback bool SetPosition(int position, bool absolute = false); void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, 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); bool IsPlaying(void); uint64_t GetReadCount(void); diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 56bf050..ef8bc55 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -290,7 +290,7 @@ int image_to_mpeg2(const char *image_name, int fd) uint8_t endcode[] = { 0, 0, 1, 0xb7 }; write_all(fd,endcode, sizeof(endcode)); } - av_free_packet(&packet); + av_packet_unref(&packet); } avcodec_close(codecContext); } diff --git a/libeplayer3-arm/container/buff_ffmpeg.c b/libeplayer3-arm/container/buff_ffmpeg.c index 7d6cc96..61ac32d 100644 --- a/libeplayer3-arm/container/buff_ffmpeg.c +++ b/libeplayer3-arm/container/buff_ffmpeg.c @@ -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); } } - +#if 0 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); } - +#endif //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); pthread_mutex_lock(&fillermutex); 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); ffmpeg_printf(100, "::%d released mutex\n", line); } //for buffered io (end)encoding - +#if 0 static int32_t container_set_ffmpeg_buf_seek_time(int32_t *time) { ffmpeg_buf_seek_time = (*time); return cERR_CONTAINER_FFMPEG_NO_ERROR; } - +#endif static int32_t container_set_ffmpeg_buf_size(int32_t *size) { if (ffmpeg_buf == NULL) @@ -229,13 +229,13 @@ static int32_t container_get_fillbufstatus(int32_t *size) } return cERR_CONTAINER_FFMPEG_NO_ERROR; } - +#if 0 static int32_t container_stop_buffer() { ffmpeg_buf_stop = 1; return 0; } - +#endif //flag 0: start direct //flag 1: from thread 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; } -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 rwdiff = 0; @@ -495,7 +495,7 @@ static int32_t ffmpeg_read(void *opaque, uint8_t *buf, int32_t buf_size) 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; int32_t rwdiff = 0; diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index ed39ac1..69eb4e9 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -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(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 int64_t calcPts(uint32_t avContextIdx, AVStream *stream, int64_t pts); @@ -204,7 +204,7 @@ static int32_t flv2mpeg4_converter = 0; /* 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; } @@ -287,7 +287,7 @@ static void initMutex(void) 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); 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); } -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); 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); switch (codec_id) @@ -524,8 +524,8 @@ static void FFMPEGThread(Context_t *context) threadname[16] = 0; prctl(PR_SET_NAME, (unsigned long)&threadname); AVPacket packet; - off_t lastSeek = -1; - int64_t lastPts = -1; + //off_t lastSeek = -1; + //int64_t lastPts = -1; int64_t currentVideoPts = -1; int64_t currentAudioPts = -1; /* lastVideoDts and lastAudioDts @@ -535,7 +535,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; @@ -737,7 +737,7 @@ static void FFMPEGThread(Context_t *context) ffmpeg_err("error getting subtitle track\n"); } 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) 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; 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)) { int64_t duration = -1; - int64_t pts = calcPts(cAVIdx, subtitleTrack->stream, packet.pts); + pts = calcPts(cAVIdx, subtitleTrack->stream, packet.pts); AVStream *stream = subtitleTrack->stream; 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 err = 0; + //int32_t err = 0; ffmpeg_printf(10, ">\n"); 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++) { 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)); return cERR_CONTAINER_FFMPEG_NO_ERROR; } - +#if 0 //unused /* 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) { @@ -2399,12 +2399,12 @@ static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t releaseMutex(__FILE__, __FUNCTION__, __LINE__); return cERR_CONTAINER_FFMPEG_NO_ERROR; } - +#endif static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t absolute) { Track_t *videoTrack = NULL; Track_t *audioTrack = NULL; - Track_t *current = NULL; +// Track_t *current = NULL; seek_target_flag = 0; sec *= AV_TIME_BASE; 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); context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack); 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) { 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"); return cERR_CONTAINER_FFMPEG_ERR; } +#endif + if (sec < 0) { 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; } -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); /* 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; } -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); /* This is made to flush inside the buffer because diff --git a/libeplayer3-arm/container/mpeg4p2_ffmpeg.c b/libeplayer3-arm/container/mpeg4p2_ffmpeg.c index 174d11e..bf5a0b0 100644 --- a/libeplayer3-arm/container/mpeg4p2_ffmpeg.c +++ b/libeplayer3-arm/container/mpeg4p2_ffmpeg.c @@ -87,12 +87,12 @@ static void mpeg4p2_context_reset(Mpeg4P2Context *context) 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); - if ((*currentVideoPts > *latestPts) && (*currentVideoPts != INVALID_PTS_VALUE)) + *pts_current = track->pts = calcPts(avContextIdx, track->stream, pkt->pts); + if ((*pts_current > *pts_latest) && (*pts_current != INVALID_PTS_VALUE)) { - *latestPts = *currentVideoPts; + *pts_latest = *pts_current; } track->dts = calcPts(avContextIdx, track->stream, pkt->dts); AudioVideoOut_t avOut; diff --git a/libeplayer3-arm/container/wrapped_ffmpeg.c b/libeplayer3-arm/container/wrapped_ffmpeg.c index 589311a..3ca4738 100644 --- a/libeplayer3-arm/container/wrapped_ffmpeg.c +++ b/libeplayer3-arm/container/wrapped_ffmpeg.c @@ -39,7 +39,7 @@ static void wrapped_packet_unref(void *param) #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) ((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)); 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); store_avcodec_context(avCodecCtx, cAVIdx, stream->id); - return avCodecCtx; } + return avCodecCtx; #else return stream->codec; #endif diff --git a/libeplayer3-arm/external/ffmpeg/get_bits.h b/libeplayer3-arm/external/ffmpeg/get_bits.h index fd99374..b0f49e3 100644 --- a/libeplayer3-arm/external/ffmpeg/get_bits.h +++ b/libeplayer3-arm/external/ffmpeg/get_bits.h @@ -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); return bit; diff --git a/libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c b/libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c index 8bbd7eb..f43a568 100644 --- a/libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c +++ b/libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c @@ -71,8 +71,7 @@ static inline int get_object_type(GetBitContext *gb) static inline int get_sample_rate(GetBitContext *gb, int *index) { *index = get_bits(gb, 4); - return *index == 0x0f ? get_bits(gb, 24) : - avpriv_mpeg4audio_sample_rates[*index]; + return *index == 0x0f ? (int)get_bits(gb, 24) : avpriv_mpeg4audio_sample_rates[*index]; } 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->sample_rate = get_sample_rate(&gb, &c->sampling_index); 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->sbr = -1; c->ps = -1; diff --git a/libeplayer3-arm/include/aac.h b/libeplayer3-arm/include/aac.h index 402087b..4455043 100644 --- a/libeplayer3-arm/include/aac.h +++ b/libeplayer3-arm/include/aac.h @@ -24,7 +24,7 @@ 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)) { return 1; diff --git a/libeplayer3-arm/main/exteplayer.c b/libeplayer3-arm/main/exteplayer.c index 17b3146..adc0c2f 100644 --- a/libeplayer3-arm/main/exteplayer.c +++ b/libeplayer3-arm/main/exteplayer.c @@ -88,7 +88,7 @@ static int g_pfd[2] = {-1, -1}; /* Used to wake terminate thread */ static int isPlaybackStarted = 0; 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"; struct sockaddr_un addr; @@ -211,7 +211,7 @@ static void SetNice(int prio) }; sched_setscheduler(0, SCHED_RR, ¶m); #else - int prevPrio = getpriority(PRIO_PROCESS, 0); + //int prevPrio = getpriority(PRIO_PROCESS, 0); if (-1 == setpriority(PRIO_PROCESS, 0, prio)) { printf("setpriority - failed\n"); @@ -484,9 +484,9 @@ static int ParseParams(int argc, char *argv[], char *file, char *audioFile, int { int ret = 0; int c; - int digit_optind = 0; - int aopt = 0, bopt = 0; - char *copt = 0, *dopt = 0; + //int digit_optind = 0; + //int aopt = 0, bopt = 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) { switch (c) @@ -877,7 +877,7 @@ int main(int argc, char *argv[]) CurrentSec = (int32_t)(pts / 90000); if (0 == commandRetVal) { - fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90, commandRetVal); + fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90); } if (0 == commandRetVal || force) { @@ -922,7 +922,7 @@ int main(int argc, char *argv[]) commandRetVal = g_player->playback->Command(g_player, PLAYBACK_PTS, &pts); if (0 == commandRetVal) { - fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90, commandRetVal); + fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90); } break; } @@ -941,7 +941,7 @@ int main(int argc, char *argv[]) } case 'n': { - uint8_t loop = 0; + //uint8_t loop = 0; if ('1' == argvBuff[1] || '0' == argvBuff[1]) { PlaybackHandler_t *ptrP = g_player->playback; diff --git a/libeplayer3-arm/output/linuxdvb_mipsel.c b/libeplayer3-arm/output/linuxdvb_mipsel.c index 8990c5b..56cbc91 100644 --- a/libeplayer3-arm/output/linuxdvb_mipsel.c +++ b/libeplayer3-arm/output/linuxdvb_mipsel.c @@ -54,12 +54,11 @@ #ifdef SAM_WITH_DEBUG #define LINUXDVB_DEBUG +static unsigned short debug_level = 20; #else #define LINUXDVB_SILENT #endif -static unsigned short debug_level = 20; - static const char FILENAME[] = __FILE__; #ifdef LINUXDVB_DEBUG @@ -311,8 +310,9 @@ int LinuxDvbPlay(Context_t *context, char *type) } free(Encoding); } - //return ret; - return 0; + ret = cERR_LINUXDVB_NO_ERROR; + return ret; + //return 0; } int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type) @@ -425,7 +425,7 @@ int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type) 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 dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus; @@ -474,7 +474,7 @@ int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag) 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 audio = !strcmp("audio", type); @@ -507,6 +507,7 @@ int LinuxDvbFastForward(Context_t *context, char *type) int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); unsigned char audio = !strcmp("audio", type); + if (audio) {} linuxdvb_printf(10, "v%d a%d speed %d\n", video, audio, context->playback->Speed); if (video && videofd != -1) { @@ -601,7 +602,7 @@ int LinuxDvbSlowMotion(Context_t *context, char *type) 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; /* 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; } -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; return ret; diff --git a/libeplayer3-arm/output/output_subtitle.c b/libeplayer3-arm/output/output_subtitle.c index 411a30d..ef740f2 100644 --- a/libeplayer3-arm/output/output_subtitle.c +++ b/libeplayer3-arm/output/output_subtitle.c @@ -97,14 +97,14 @@ static int isSubtitleOpened = 0; /* Functions */ /* ***************************** */ -static void getMutex(int line) +static void getMutex(int line __attribute__((unused))) { subtitle_printf(100, "%d requesting mutex\n", line); pthread_mutex_lock(&mutex); subtitle_printf(100, "%d received mutex\n", line); } -static void releaseMutex(int line) +static void releaseMutex(int line __attribute__((unused))) { pthread_mutex_unlock(&mutex); subtitle_printf(100, "%d released mutex\n", line); @@ -202,7 +202,7 @@ static int Write(void *_context, void *data) } out = (SubtitleOut_t *) data; context->manager->subtitle->Command(context, MANAGER_GET, &curtrackid); - if (curtrackid != out->trackId) + if (curtrackid != (int32_t)out->trackId) { Flush(); } @@ -232,7 +232,7 @@ static int Write(void *_context, void *data) static int32_t subtitle_Open(Context_t *context __attribute__((unused))) { - uint32_t i = 0 ; + //uint32_t i = 0 ; subtitle_printf(10, "\n"); 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))) { - uint32_t i = 0 ; + //uint32_t i = 0 ; subtitle_printf(10, "\n"); getMutex(__LINE__); isSubtitleOpened = 0; @@ -257,7 +257,7 @@ 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) +static int Command(void *_context, OutputCmd_t command, void *argument __attribute__((unused))) { Context_t *context = (Context_t *) _context; int ret = cERR_SUBTITLE_NO_ERROR; diff --git a/libeplayer3-arm/output/writer/mipsel/aac.c b/libeplayer3-arm/output/writer/mipsel/aac.c index 3b6945b..c8e1b2f 100644 --- a/libeplayer3-arm/output/writer/mipsel/aac.c +++ b/libeplayer3-arm/output/writer/mipsel/aac.c @@ -182,7 +182,7 @@ static int _writeData(void *_call, int type) else // check LOAS header { 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"); return 0; @@ -218,7 +218,7 @@ static int writeDataADTS(void *_call) aac_err("file pointer < 0. ignoring ...\n"); 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)) { return _writeData(_call, 0); @@ -272,7 +272,7 @@ static int writeDataLATM(void *_call) aac_err("parsing NULL Data. ignoring...\n"); 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); } diff --git a/libeplayer3-arm/output/writer/mipsel/divx3.c b/libeplayer3-arm/output/writer/mipsel/divx3.c index cc9f93a..44a822d 100644 --- a/libeplayer3-arm/output/writer/mipsel/divx3.c +++ b/libeplayer3-arm/output/writer/mipsel/divx3.c @@ -117,7 +117,7 @@ static int writeData(void *_call) { WriterAVCallData_t *call = (WriterAVCallData_t *) _call; 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; divx_printf(10, "\n"); if (call == NULL) diff --git a/libeplayer3-arm/output/writer/mipsel/h264.c b/libeplayer3-arm/output/writer/mipsel/h264.c index 1f766e7..77e45c1 100644 --- a/libeplayer3-arm/output/writer/mipsel/h264.c +++ b/libeplayer3-arm/output/writer/mipsel/h264.c @@ -195,12 +195,14 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne if (cd_len > 7 && data[0] == 1) { unsigned short len = (data[6] << 8) | data[7]; - if (cd_len >= (len + 8)) + if (cd_len >= (uint32_t)(len + 8)) { unsigned int i = 0; uint8_t profile_num[] = { 66, 77, 88, 100 }; uint8_t profile_cmp[2] = { 0x67, 0x00 }; const char *profile_str[] = { "baseline", "main", "extended", "high" }; + /* avoid compiler warning */ + if (*profile_str) {} memcpy(tmp, Head, sizeof(Head)); tmp_len += 4; memcpy(tmp + tmp_len, data + 8, len); @@ -289,7 +291,7 @@ static int writeData(void *_call) unsigned long long int VideoPts; unsigned int TimeDelta; unsigned int TimeScale; - int len = 0; + unsigned int len = 0; int ic = 0; struct iovec iov[IOVEC_SIZE]; h264_printf(20, "\n"); @@ -300,6 +302,9 @@ static int writeData(void *_call) } TimeDelta = call->FrameRate; TimeScale = call->FrameScale; + /* avoid compiler warnings */ + if (TimeDelta) {} + if (TimeScale) {} VideoPts = call->Pts; h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale); if ((call->data == NULL) || (call->len <= 0)) @@ -314,8 +319,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; diff --git a/libeplayer3-arm/output/writer/mipsel/h265.c b/libeplayer3-arm/output/writer/mipsel/h265.c index 87cc830..aa80678 100644 --- a/libeplayer3-arm/output/writer/mipsel/h265.c +++ b/libeplayer3-arm/output/writer/mipsel/h265.c @@ -116,7 +116,7 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne } *NalLength = (data[21] & 3) + 1; int num_param_sets = data[22]; - int pos = 23; + uint32_t pos = 23; for (i = 0; i < num_param_sets; i++) { int j; @@ -175,7 +175,7 @@ static int writeData(void *_call) unsigned long long int VideoPts; unsigned int TimeDelta; unsigned int TimeScale; - int len = 0; + unsigned int len = 0; int ic = 0; struct iovec iov[IOVEC_SIZE]; h264_printf(20, "\n"); @@ -186,6 +186,9 @@ static int writeData(void *_call) } TimeDelta = call->FrameRate; TimeScale = call->FrameScale; + /* avoid compiler warnings */ + if (TimeDelta) {} + if (TimeScale) {} VideoPts = call->Pts; h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale); if ((call->data == NULL) || (call->len <= 0)) diff --git a/libeplayer3-arm/output/writer/mipsel/pcm.c b/libeplayer3-arm/output/writer/mipsel/pcm.c index 00e6f31..3a0045b 100644 --- a/libeplayer3-arm/output/writer/mipsel/pcm.c +++ b/libeplayer3-arm/output/writer/mipsel/pcm.c @@ -152,7 +152,7 @@ static int32_t writeData(void *_call) int32_t block_align = 0; int32_t byterate = 0; uint32_t codecID = (uint32_t)pcmPrivateData->ffmpeg_codec_id; - uint8_t dataPrecision = 0; + //uint8_t dataPrecision = 0; uint8_t LE = 0; switch (codecID) { @@ -224,6 +224,8 @@ static int32_t writeData(void *_call) fixed_buffer = malloc(fixed_buffersize); } fixed_bufferfilled = 0; + /* avoid compiler warning */ + if (LE) {} //printf("PCM fixed_buffersize [%u] [%s]\n", fixed_buffersize, LE ? "LE":"BE"); } while (size > 0) diff --git a/libeplayer3-arm/output/writer/mipsel/vc1.c b/libeplayer3-arm/output/writer/mipsel/vc1.c index c591011..845afb5 100644 --- a/libeplayer3-arm/output/writer/mipsel/vc1.c +++ b/libeplayer3-arm/output/writer/mipsel/vc1.c @@ -110,7 +110,7 @@ static int reset() static int writeData(void *_call) { WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - int len = 0; + //int len = 0; vc1_printf(10, "\n"); if (call == NULL) { diff --git a/libeplayer3-arm/output/writer/mipsel/wma.c b/libeplayer3-arm/output/writer/mipsel/wma.c index c82acef..5324836 100644 --- a/libeplayer3-arm/output/writer/mipsel/wma.c +++ b/libeplayer3-arm/output/writer/mipsel/wma.c @@ -106,7 +106,7 @@ static int reset() static int writeData(void *_call) { WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - int len = 0; + //int len = 0; wma_printf(10, "\n"); if (call == NULL) { diff --git a/libeplayer3-arm/output/writer/mipsel/writer.c b/libeplayer3-arm/output/writer/mipsel/writer.c index fa9afe2..2d7f70a 100644 --- a/libeplayer3-arm/output/writer/mipsel/writer.c +++ b/libeplayer3-arm/output/writer/mipsel/writer.c @@ -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 len = 0; - int i = 0; + uint32_t i = 0; for (i = 0; i < ic; ++i) { write_with_retry(fd, iov[i].iov_base, iov[i].iov_len); diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index 071ef40..602d265 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -32,12 +32,11 @@ #ifdef SAM_WITH_DEBUG #define PLAYBACK_DEBUG +static short debug_level = 20; #else #define PLAYBACK_SILENT #endif -static short debug_level = 20; - #ifdef PLAYBACK_DEBUG #define playback_printf(level, fmt, x...) do { \ 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; } -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; playback_printf(20, "\n"); From 712542335e2f63c35c981b6dbea5ff679fe00578 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 10 Feb 2018 20:34:01 +0100 Subject: [PATCH 07/18] fix OUTPUT_PLAY error handling Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/e1b49ab042532c02c439cb28b8602e71fa57fcfc Author: Jacek Jendrzej Date: 2018-02-10 (Sat, 10 Feb 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/output/output.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libeplayer3-arm/output/output.c b/libeplayer3-arm/output/output.c index cf3640e..548c1d6 100644 --- a/libeplayer3-arm/output/output.c +++ b/libeplayer3-arm/output/output.c @@ -224,6 +224,9 @@ static int Command(void *_context, OutputCmd_t command, void *argument) { ret = context->output->video->Command(context, OUTPUT_PLAY, "video"); } + else + ret = cERR_OUTPUT_INTERNAL_ERROR; + // success or not executed, dunn care if (!ret) { From 53e6502bb1f5e4beb18af40364cccfd3854845a5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 10 Feb 2018 20:41:24 +0100 Subject: [PATCH 08/18] remove isContainerRunning, this break next file play aufter eof stop Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/216e1f37cd35a35018648614a558fbf9c9f4d1f6 Author: Jacek Jendrzej Date: 2018-02-10 (Sat, 10 Feb 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/container_ffmpeg.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index 69eb4e9..58f4e9e 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -127,8 +127,6 @@ static AVFormatContext *avContextTab[IPTV_AV_CONTEXT_MAX_NUM] = {NULL, NULL}; static int32_t use_custom_io[IPTV_AV_CONTEXT_MAX_NUM] = {0, 0}; static AVDictionary *avio_opts = NULL; -static uint8_t isContainerRunning = 0; - static int64_t latestPts = 0; static int32_t restart_audio_resampling = 0; @@ -1626,12 +1624,6 @@ int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames) { ffmpeg_printf(10, "second filename %s\n", playFilesNames->szSecondFile); } - if (isContainerRunning) - { - ffmpeg_err("ups already running?\n"); - releaseMutex(__FILE__, __FUNCTION__, __LINE__); - return cERR_CONTAINER_FFMPEG_RUNNING; - } /* initialize ffmpeg */ avcodec_register_all(); av_register_all(); @@ -1656,7 +1648,6 @@ int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames) } terminating = 0; latestPts = 0; - isContainerRunning = 1; res = container_ffmpeg_update_tracks(context, playFilesNames->szFirstFile, 1); return res; } @@ -2241,11 +2232,6 @@ static int32_t container_ffmpeg_stop(Context_t *context) * and causes in most cases a segfault */ ffmpeg_printf(10, "\n"); - if (!isContainerRunning) - { - ffmpeg_err("Container not running\n"); - return cERR_CONTAINER_FFMPEG_ERR; - } if (context->playback) { context->playback->isPlaying = 0; @@ -2298,7 +2284,6 @@ static int32_t container_ffmpeg_stop(Context_t *context) { av_dict_free(&avio_opts); } - isContainerRunning = 0; avformat_network_deinit(); ffmpeg_buf_free(); releaseMutex(__FILE__, __FUNCTION__, __LINE__); From d7d500b2a5db065fb9b1e2fd7e6838113e0f7631 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 11 Feb 2018 12:01:19 +0100 Subject: [PATCH 09/18] supplement to 4bd66ae15da86b413d6de64c51b3471dd8bc801a, fix segfault with only audio stream Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/de6090c29e6956d95d4a162bc11190ddea667422 Author: Jacek Jendrzej Date: 2018-02-11 (Sun, 11 Feb 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/output/output.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libeplayer3-arm/output/output.c b/libeplayer3-arm/output/output.c index 548c1d6..4943a11 100644 --- a/libeplayer3-arm/output/output.c +++ b/libeplayer3-arm/output/output.c @@ -228,12 +228,9 @@ static int Command(void *_context, OutputCmd_t command, void *argument) ret = cERR_OUTPUT_INTERNAL_ERROR; // success or not executed, dunn care - if (!ret) + if (context->playback->isAudio) { - if (context->playback->isAudio) - { - ret = context->output->audio->Command(context, OUTPUT_PLAY, "audio"); - } + ret = context->output->audio->Command(context, OUTPUT_PLAY, "audio"); } if (!ret) { From 72f70359b285d852d85438e0e295b7fd4bd872e2 Mon Sep 17 00:00:00 2001 From: max_10 Date: Tue, 6 Mar 2018 19:08:31 +0100 Subject: [PATCH 10/18] libeplayer3-arm: reduce compiler warnings Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/afda7fff3eaaabd5e2907a39df5a97613ca2a95c Author: max_10 Date: 2018-03-06 (Tue, 06 Mar 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/mpeg4p2_ffmpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libeplayer3-arm/container/mpeg4p2_ffmpeg.c b/libeplayer3-arm/container/mpeg4p2_ffmpeg.c index bf5a0b0..c27056e 100644 --- a/libeplayer3-arm/container/mpeg4p2_ffmpeg.c +++ b/libeplayer3-arm/container/mpeg4p2_ffmpeg.c @@ -24,7 +24,7 @@ static void set_packet(AVPacket **pkt_dest, AVPacket *pkt_src) av_free(*pkt_dest); } *pkt_dest = av_malloc(sizeof(AVPacket)); - av_copy_packet(*pkt_dest, pkt_src); + av_packet_ref(*pkt_dest, pkt_src); } static int filter_packet(AVBitStreamFilterContext *bsf_ctx, AVCodecContext *enc_ctx, AVPacket *pkt) @@ -37,7 +37,7 @@ static int filter_packet(AVBitStreamFilterContext *bsf_ctx, AVCodecContext *enc_ pkt->flags & AV_PKT_FLAG_KEY); if (ret == 0 && new_pkt.data != pkt->data) { - if ((ret = av_copy_packet(&new_pkt, pkt)) < 0) + if ((ret = av_packet_ref(&new_pkt, pkt)) < 0) return -1; ret = 1; } From a51ed97fb2252b66cffc904d4ce08057e8af6599 Mon Sep 17 00:00:00 2001 From: max_10 Date: Wed, 7 Mar 2018 23:59:23 +0100 Subject: [PATCH 11/18] libeplayer3-arm: cleanup types, use Context_t in commands Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/76ff23f48735d119c8f152e7c3d82a91d18796a0 Author: max_10 Date: 2018-03-07 (Wed, 07 Mar 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/container.c | 3 +- libeplayer3-arm/container/container_ffmpeg.c | 37 +++-- libeplayer3-arm/include/container.h | 7 +- libeplayer3-arm/include/manager.h | 15 +- libeplayer3-arm/include/output.h | 9 +- libeplayer3-arm/include/playback.h | 5 +- libeplayer3-arm/include/writer.h | 8 +- libeplayer3-arm/manager/audio.c | 10 +- libeplayer3-arm/manager/chapter.c | 8 +- libeplayer3-arm/manager/subtitle.c | 4 +- libeplayer3-arm/manager/video.c | 7 +- libeplayer3-arm/output/linuxdvb_mipsel.c | 165 ++++++++++--------- libeplayer3-arm/output/output.c | 3 +- libeplayer3-arm/output/output_subtitle.c | 6 +- libeplayer3-arm/output/writer/mipsel/aac.c | 13 +- libeplayer3-arm/output/writer/mipsel/ac3.c | 3 +- libeplayer3-arm/output/writer/mipsel/amr.c | 5 +- libeplayer3-arm/output/writer/mipsel/divx3.c | 9 +- libeplayer3-arm/output/writer/mipsel/dts.c | 3 +- libeplayer3-arm/output/writer/mipsel/h263.c | 3 +- libeplayer3-arm/output/writer/mipsel/h264.c | 3 +- libeplayer3-arm/output/writer/mipsel/h265.c | 3 +- libeplayer3-arm/output/writer/mipsel/lpcm.c | 3 +- libeplayer3-arm/output/writer/mipsel/mp3.c | 5 +- libeplayer3-arm/output/writer/mipsel/mpeg2.c | 5 +- libeplayer3-arm/output/writer/mipsel/mpeg4.c | 5 +- libeplayer3-arm/output/writer/mipsel/pcm.c | 3 +- libeplayer3-arm/output/writer/mipsel/vc1.c | 3 +- libeplayer3-arm/output/writer/mipsel/vp.c | 11 +- libeplayer3-arm/output/writer/mipsel/wma.c | 3 +- libeplayer3-arm/output/writer/mipsel/wmv.c | 3 +- libeplayer3-arm/playback/playback.c | 6 +- 32 files changed, 194 insertions(+), 182 deletions(-) diff --git a/libeplayer3-arm/container/container.c b/libeplayer3-arm/container/container.c index de71ef8..3f56f21 100644 --- a/libeplayer3-arm/container/container.c +++ b/libeplayer3-arm/container/container.c @@ -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__); diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index 58f4e9e..d5a9ae1 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -42,12 +42,6 @@ #include #include -#include -#include -#include -#include -#include - #include #include "common.h" @@ -56,9 +50,11 @@ #include "aac.h" #include "pcm.h" #include "ffmpeg_metadata.h" + /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #if (LIBAVFORMAT_VERSION_MAJOR > 56) #define TS_BYTES_SEEKING 0 #else @@ -1343,7 +1339,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)) { @@ -2625,12 +2621,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; } @@ -2646,28 +2644,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); } @@ -2678,9 +2682,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 && diff --git a/libeplayer3-arm/include/container.h b/libeplayer3-arm/include/container.h index 5a4b5fd..a8a87e0 100644 --- a/libeplayer3-arm/include/container.h +++ b/libeplayer3-arm/include/container.h @@ -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 diff --git a/libeplayer3-arm/include/manager.h b/libeplayer3-arm/include/manager.h index 0d9fd76..d5eea58 100644 --- a/libeplayer3-arm/include/manager.h +++ b/libeplayer3-arm/include/manager.h @@ -4,6 +4,12 @@ #include #include +#include +#include +#include +#include +#include + 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; diff --git a/libeplayer3-arm/include/output.h b/libeplayer3-arm/include/output.h index dd0bb93..ac0c0bf 100644 --- a/libeplayer3-arm/include/output.h +++ b/libeplayer3-arm/include/output.h @@ -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 diff --git a/libeplayer3-arm/include/playback.h b/libeplayer3-arm/include/playback.h index 5e80c8c..e817e38 100644 --- a/libeplayer3-arm/include/playback.h +++ b/libeplayer3-arm/include/playback.h @@ -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 */ diff --git a/libeplayer3-arm/include/writer.h b/libeplayer3-arm/include/writer.h index b50c158..c027899 100644 --- a/libeplayer3-arm/include/writer.h +++ b/libeplayer3-arm/include/writer.h @@ -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; diff --git a/libeplayer3-arm/manager/audio.c b/libeplayer3-arm/manager/audio.c index a29687e..c527480 100644 --- a/libeplayer3-arm/manager/audio.c +++ b/libeplayer3-arm/manager/audio.c @@ -71,7 +71,7 @@ if (debug_level >= level) printf("[%s:%s] \n" fmt, __FILE__, __FUNCTION__, ## x) static Track_t *Tracks = NULL; static int TrackCount = 0; -static int CurrentTrack = 0; //TRACK[0] as default. +static int CurrentTrack = 0; //TRACK[0] as default. /* ***************************** */ /* Prototypes */ @@ -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: @@ -269,7 +269,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) audio_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", __FILE__, __FUNCTION__); if ((TrackCount > 0) && (CurrentTrack >= 0)) { - *((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack]; + *((Track_t **)argument) = (Track_t *) & Tracks[CurrentTrack]; } else { diff --git a/libeplayer3-arm/manager/chapter.c b/libeplayer3-arm/manager/chapter.c index c09a0f2..14167a9 100644 --- a/libeplayer3-arm/manager/chapter.c +++ b/libeplayer3-arm/manager/chapter.c @@ -66,7 +66,7 @@ static const char FILENAME[] = __FILE__; static Track_t *Tracks = NULL; static int TrackCount = 0; -static int CurrentTrack = 0; //TRACK[0] as default. +static int CurrentTrack = 0; //TRACK[0] as default. /* ***************************** */ /* Prototypes */ @@ -76,7 +76,7 @@ static int CurrentTrack = 0; //TRACK[0] as default. /* Functions */ /* ***************************** */ -static int ManagerAdd(Context_t * context __attribute__((unused)), Track_t track) +static int ManagerAdd(Context_t *context __attribute__((unused)), Track_t track) { chapter_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); @@ -121,7 +121,7 @@ static int ManagerAdd(Context_t * context __attribute__((unused)), Track_t track return cERR_CHAPTER_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; @@ -157,7 +157,7 @@ static char **ManagerList(Context_t * context __attribute__ ((unused))) return tracklist; } -static int ManagerDel(Context_t * context __attribute__((unused))) +static int ManagerDel(Context_t *context __attribute__((unused))) { int i = 0; diff --git a/libeplayer3-arm/manager/subtitle.c b/libeplayer3-arm/manager/subtitle.c index 4b64cd6..4cff07c 100644 --- a/libeplayer3-arm/manager/subtitle.c +++ b/libeplayer3-arm/manager/subtitle.c @@ -69,7 +69,7 @@ if (debug_level >= level) printf(x); } while (0) static Track_t *Tracks = NULL; static int TrackCount = 0; -static int CurrentTrack = -1; //no as default. +static int CurrentTrack = -1; //no as default. /* ***************************** */ /* Prototypes */ @@ -256,7 +256,7 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) { if ((TrackCount > 0) && (CurrentTrack >= 0)) { - *((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack]; + *((Track_t **)argument) = (Track_t *) & Tracks[CurrentTrack]; } else { diff --git a/libeplayer3-arm/manager/video.c b/libeplayer3-arm/manager/video.c index 1c8fcc3..adaa841 100644 --- a/libeplayer3-arm/manager/video.c +++ b/libeplayer3-arm/manager/video.c @@ -69,7 +69,7 @@ if (debug_level >= level) printf(x); } while (0) static Track_t *Tracks = NULL; static int TrackCount = 0; -static int CurrentTrack = 0; //TRACK[0] as default. +static int CurrentTrack = 0; //TRACK[0] as default. static void (* updatedTrackInfoFnc)(void) = NULL; @@ -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) @@ -243,7 +242,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) video_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", __FILE__, __FUNCTION__); if ((TrackCount > 0) && (CurrentTrack >= 0)) { - *((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack]; + *((Track_t **)argument) = (Track_t *) & Tracks[CurrentTrack]; } else { diff --git a/libeplayer3-arm/output/linuxdvb_mipsel.c b/libeplayer3-arm/output/linuxdvb_mipsel.c index 56cbc91..1699f7d 100644 --- a/libeplayer3-arm/output/linuxdvb_mipsel.c +++ b/libeplayer3-arm/output/linuxdvb_mipsel.c @@ -228,9 +228,9 @@ int LinuxDvbPlay(Context_t *context, char *type) /* if (0 != ioctl(videofd, VIDEO_STOP)) { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_STOP: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; + linuxdvb_err("ioctl failed with errno %d\n", errno); + linuxdvb_err("VIDEO_STOP: %s\n", strerror(errno)); + ret = cERR_LINUXDVB_ERROR; } */ if (writer == NULL) @@ -276,9 +276,9 @@ int LinuxDvbPlay(Context_t *context, char *type) /* if (0 != ioctl(audiofd, AUDIO_STOP)) { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_STOP: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; + linuxdvb_err("ioctl failed with errno %d\n", errno); + linuxdvb_err("AUDIO_STOP: %s\n", strerror(errno)); + ret = cERR_LINUXDVB_ERROR; } */ if (writer == NULL) @@ -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,15 +829,14 @@ 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; - unsigned char video = 0; - unsigned char audio = 0; - Writer_t *writer; + AudioVideoOut_t *out = (AudioVideoOut_t *) _out; + int ret = cERR_LINUXDVB_NO_ERROR; + int res = 0; + unsigned char video = 0; + unsigned char audio = 0; + Writer_t *writer; WriterAVCallData_t call; if (out == NULL) { @@ -905,7 +921,7 @@ static int Write(void *_context, void *_out) call.Width = out->width; call.Height = out->height; call.InfoFlags = out->infoFlags; - call.Version = 0; // is unsingned char + call.Version = 0; // is unsingned char if (writer->writeData) { res = writer->writeData(&call); @@ -947,7 +963,7 @@ static int Write(void *_context, void *_out) call.FrameRate = out->frameRate; call.FrameScale = out->timeScale; call.InfoFlags = out->infoFlags; - call.Version = 0; /* -1; unsigned char cannot be negative */ + call.Version = 0; /* -1; unsigned char cannot be negative */ if (writer->writeData) { res = writer->writeData(&call); @@ -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) diff --git a/libeplayer3-arm/output/output.c b/libeplayer3-arm/output/output.c index 4943a11..168c203 100644 --- a/libeplayer3-arm/output/output.c +++ b/libeplayer3-arm/output/output.c @@ -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) diff --git a/libeplayer3-arm/output/output_subtitle.c b/libeplayer3-arm/output/output_subtitle.c index ef740f2..726d230 100644 --- a/libeplayer3-arm/output/output_subtitle.c +++ b/libeplayer3-arm/output/output_subtitle.c @@ -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) diff --git a/libeplayer3-arm/output/writer/mipsel/aac.c b/libeplayer3-arm/output/writer/mipsel/aac.c index c8e1b2f..8e6d163 100644 --- a/libeplayer3-arm/output/writer/mipsel/aac.c +++ b/libeplayer3-arm/output/writer/mipsel/aac.c @@ -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) diff --git a/libeplayer3-arm/output/writer/mipsel/ac3.c b/libeplayer3-arm/output/writer/mipsel/ac3.c index 017b2b2..b71b089 100644 --- a/libeplayer3-arm/output/writer/mipsel/ac3.c +++ b/libeplayer3-arm/output/writer/mipsel/ac3.c @@ -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) diff --git a/libeplayer3-arm/output/writer/mipsel/amr.c b/libeplayer3-arm/output/writer/mipsel/amr.c index c94dead..cb843b5 100644 --- a/libeplayer3-arm/output/writer/mipsel/amr.c +++ b/libeplayer3-arm/output/writer/mipsel/amr.c @@ -96,10 +96,9 @@ 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]; + unsigned char PesHeader[PES_MAX_HEADER_SIZE + 4 + 9]; amr_printf(10, "\n"); if (call == NULL) { diff --git a/libeplayer3-arm/output/writer/mipsel/divx3.c b/libeplayer3-arm/output/writer/mipsel/divx3.c index 44a822d..98f1f4a 100644 --- a/libeplayer3-arm/output/writer/mipsel/divx3.c +++ b/libeplayer3-arm/output/writer/mipsel/divx3.c @@ -113,12 +113,11 @@ 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; + unsigned char PesHeader[PES_MAX_HEADER_SIZE + 4]; +// unsigned char Version = 5; +// unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE; divx_printf(10, "\n"); if (call == NULL) { diff --git a/libeplayer3-arm/output/writer/mipsel/dts.c b/libeplayer3-arm/output/writer/mipsel/dts.c index 06f0efb..b56969b 100644 --- a/libeplayer3-arm/output/writer/mipsel/dts.c +++ b/libeplayer3-arm/output/writer/mipsel/dts.c @@ -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) diff --git a/libeplayer3-arm/output/writer/mipsel/h263.c b/libeplayer3-arm/output/writer/mipsel/h263.c index ab79368..152b026 100644 --- a/libeplayer3-arm/output/writer/mipsel/h263.c +++ b/libeplayer3-arm/output/writer/mipsel/h263.c @@ -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"); diff --git a/libeplayer3-arm/output/writer/mipsel/h264.c b/libeplayer3-arm/output/writer/mipsel/h264.c index 77e45c1..04b3d2f 100644 --- a/libeplayer3-arm/output/writer/mipsel/h264.c +++ b/libeplayer3-arm/output/writer/mipsel/h264.c @@ -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; diff --git a/libeplayer3-arm/output/writer/mipsel/h265.c b/libeplayer3-arm/output/writer/mipsel/h265.c index aa80678..cb21d99 100644 --- a/libeplayer3-arm/output/writer/mipsel/h265.c +++ b/libeplayer3-arm/output/writer/mipsel/h265.c @@ -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; diff --git a/libeplayer3-arm/output/writer/mipsel/lpcm.c b/libeplayer3-arm/output/writer/mipsel/lpcm.c index a0ef5ee..aca119e 100644 --- a/libeplayer3-arm/output/writer/mipsel/lpcm.c +++ b/libeplayer3-arm/output/writer/mipsel/lpcm.c @@ -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) { diff --git a/libeplayer3-arm/output/writer/mipsel/mp3.c b/libeplayer3-arm/output/writer/mipsel/mp3.c index ee8a83a..88c5a82 100644 --- a/libeplayer3-arm/output/writer/mipsel/mp3.c +++ b/libeplayer3-arm/output/writer/mipsel/mp3.c @@ -91,10 +91,9 @@ 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]; + unsigned char PesHeader[PES_MAX_HEADER_SIZE + 22]; mp3_printf(10, "\n"); if (call == NULL) { diff --git a/libeplayer3-arm/output/writer/mipsel/mpeg2.c b/libeplayer3-arm/output/writer/mipsel/mpeg2.c index 9ccce6d..daa9daf 100644 --- a/libeplayer3-arm/output/writer/mipsel/mpeg2.c +++ b/libeplayer3-arm/output/writer/mipsel/mpeg2.c @@ -92,10 +92,9 @@ static int reset() return 0; } -static int writeData(void *_call) +static int writeData(WriterAVCallData_t *call) { - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; + unsigned char PesHeader[PES_MAX_HEADER_SIZE]; int len = 0; unsigned int Position = 0; mpeg2_printf(10, "\n"); diff --git a/libeplayer3-arm/output/writer/mipsel/mpeg4.c b/libeplayer3-arm/output/writer/mipsel/mpeg4.c index 9d9d8e4..7abce59 100644 --- a/libeplayer3-arm/output/writer/mipsel/mpeg4.c +++ b/libeplayer3-arm/output/writer/mipsel/mpeg4.c @@ -100,10 +100,9 @@ static int reset() return 0; } -static int writeData(void *_call) +static int writeData(WriterAVCallData_t *call) { - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; + unsigned char PesHeader[PES_MAX_HEADER_SIZE]; mpeg4_printf(10, "\n"); if (call == NULL) { diff --git a/libeplayer3-arm/output/writer/mipsel/pcm.c b/libeplayer3-arm/output/writer/mipsel/pcm.c index 3a0045b..bc63b09 100644 --- a/libeplayer3-arm/output/writer/mipsel/pcm.c +++ b/libeplayer3-arm/output/writer/mipsel/pcm.c @@ -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) { diff --git a/libeplayer3-arm/output/writer/mipsel/vc1.c b/libeplayer3-arm/output/writer/mipsel/vc1.c index 845afb5..f6997ab 100644 --- a/libeplayer3-arm/output/writer/mipsel/vc1.c +++ b/libeplayer3-arm/output/writer/mipsel/vc1.c @@ -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) diff --git a/libeplayer3-arm/output/writer/mipsel/vp.c b/libeplayer3-arm/output/writer/mipsel/vp.c index d315358..2e31151 100644 --- a/libeplayer3-arm/output/writer/mipsel/vp.c +++ b/libeplayer3-arm/output/writer/mipsel/vp.c @@ -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); } /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/mipsel/wma.c b/libeplayer3-arm/output/writer/mipsel/wma.c index 5324836..6500c7e 100644 --- a/libeplayer3-arm/output/writer/mipsel/wma.c +++ b/libeplayer3-arm/output/writer/mipsel/wma.c @@ -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) diff --git a/libeplayer3-arm/output/writer/mipsel/wmv.c b/libeplayer3-arm/output/writer/mipsel/wmv.c index 7722818..96db958 100644 --- a/libeplayer3-arm/output/writer/mipsel/wmv.c +++ b/libeplayer3-arm/output/writer/mipsel/wmv.c @@ -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) { diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index 602d265..f9364e9 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -27,6 +27,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + // SULGE DEBUG //#define SAM_WITH_DEBUG @@ -53,7 +54,7 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); #define cERR_PLAYBACK_NO_ERROR 0 #define cERR_PLAYBACK_ERROR -1 -#define cMaxSpeed_ff 128 /* fixme: revise */ +#define cMaxSpeed_ff 128 /* fixme: revise */ #define cMaxSpeed_fr -320 /* fixme: revise */ /* ***************************** */ @@ -711,9 +712,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) From 9d075a522aba64dee8f0a675d5093ffe37eaa20d Mon Sep 17 00:00:00 2001 From: max_10 Date: Thu, 8 Mar 2018 01:24:36 +0100 Subject: [PATCH 12/18] Revert "fix video policy" This reverts commit 959688031782ef187219b46400dcc43a366f00b3. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/eee8a524dfb4c23613b36477dba715726575ba4a Author: max_10 Date: 2018-03-08 (Thu, 08 Mar 2018) ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index ef8bc55..6c894c0 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -361,7 +361,7 @@ void cVideo::closeDevice(void) int cVideo::setAspectRatio(int aspect, int mode) { static const char *a[] = { "n/a", "4:3", "14:9", "16:9" }; - static const char *m[] = { "panscan", "bestfit", "letterbox", "nonlinear", "(unset)" }; + static const char *m[] = { "panscan", "letterbox", "bestfit", "nonlinear", "(unset)" }; int n; lt_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[(mode < 0||mode > 3) ? 4 : mode]); From bd55f57faad3249325373c9629a524b21bb8b52c Mon Sep 17 00:00:00 2001 From: BPanther Date: Sat, 10 Mar 2018 23:20:23 +0100 Subject: [PATCH 13/18] missing brightness added for ufs922, hdbox, octagon1008, mini2, av7500 Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/c43602246922709e6d59417523e94e02a523cb6a Author: BPanther Date: 2018-03-10 (Sat, 10 Mar 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libduckbox/hardware_caps.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libduckbox/hardware_caps.c b/libduckbox/hardware_caps.c index 9794338..56e9254 100644 --- a/libduckbox/hardware_caps.c +++ b/libduckbox/hardware_caps.c @@ -47,6 +47,7 @@ hw_caps_t *get_hwcaps(void) caps.can_cec = 1; caps.has_fan = 0; caps.has_CI = 2; + caps.display_can_set_brightness = 1; } else if (!strncmp(buf, "ufs912", 6)) { strcpy(caps.boxvendor, "DUCKBOX"); @@ -79,6 +80,7 @@ hw_caps_t *get_hwcaps(void) caps.can_cec = 0; caps.has_fan = 1; caps.has_CI = 2; + caps.display_can_set_brightness = 1; } else if (!strncmp(buf, "ufs910", 6)) { strcpy(caps.boxvendor, "DUCKBOX"); @@ -100,6 +102,7 @@ hw_caps_t *get_hwcaps(void) caps.can_cec = 0; caps.has_fan = 0; caps.has_CI = 2; + caps.display_can_set_brightness = 1; } else if (!strncmp(buf, "octagon1008", 11)) { strcpy(caps.boxvendor, "DUCKBOX"); @@ -110,6 +113,7 @@ hw_caps_t *get_hwcaps(void) caps.can_cec = 0; caps.has_fan = 0; caps.has_CI = 2; + caps.display_can_set_brightness = 1; } else if (!strncmp(buf, "hs7110", 6)) { strcpy(caps.boxvendor, "DUCKBOX"); @@ -175,6 +179,7 @@ hw_caps_t *get_hwcaps(void) caps.can_cec = 0; caps.has_fan = 1; caps.has_CI = 2; + caps.display_can_set_brightness = 1; } else if (!strncmp(buf, "cuberevo-250hd", 4)) { strcpy(caps.boxvendor, "DUCKBOX"); From bcc9767a59135c532effb209002eacff266132a8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 11 Mar 2018 22:41:07 +0100 Subject: [PATCH 14/18] introduce caps.has_button_timer Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/8e2bf5a58730198309bfd6811261ab884dab4807 Author: vanhofen Date: 2018-03-11 (Sun, 11 Mar 2018) Origin message was: ------------------ - introduce caps.has_button_timer ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- include/hardware_caps.h | 1 + libarmbox/hardware_caps.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/hardware_caps.h b/include/hardware_caps.h index 92da189..3a553ca 100644 --- a/include/hardware_caps.h +++ b/include/hardware_caps.h @@ -39,6 +39,7 @@ typedef struct hw_caps int display_can_set_brightness; int display_can_deepstandby; int display_has_statusline; + int has_button_timer; char boxvendor[64]; char boxname[64]; char boxarch[64]; diff --git a/libarmbox/hardware_caps.c b/libarmbox/hardware_caps.c index 7ec40c8..1190939 100644 --- a/libarmbox/hardware_caps.c +++ b/libarmbox/hardware_caps.c @@ -37,6 +37,7 @@ hw_caps_t *get_hwcaps(void) caps.display_can_deepstandby = 0; caps.display_can_set_brightness = 1; caps.display_has_statusline = 0; + caps.has_button_timer = 1; caps.has_HDMI = 1; strcpy(caps.boxvendor, "AX-Technologies"); strcpy(caps.boxname, "HD51"); From 52ff2909c5ee0e4452169f739aa796efd7cc3632 Mon Sep 17 00:00:00 2001 From: samsamsam Date: Tue, 13 Mar 2018 12:03:28 +0100 Subject: [PATCH 15/18] h264 writer - do not inject prive codec data if the Sequence Parameter Set (SPS) and the Picture Parameter Set (PPS) are available in the bitstreamThis should fix playback of stream http://www.djing.com/tv/live.m3u8 Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/4d7df28b2a4b8b1fd85d2b4dda02e2cbc27890f1 Author: samsamsam Date: 2018-03-13 (Tue, 13 Mar 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/main/exteplayer.c | 2 +- libeplayer3-arm/output/writer/mipsel/h264.c | 24 +++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/libeplayer3-arm/main/exteplayer.c b/libeplayer3-arm/main/exteplayer.c index adc0c2f..dd0c7ab 100644 --- a/libeplayer3-arm/main/exteplayer.c +++ b/libeplayer3-arm/main/exteplayer.c @@ -635,7 +635,7 @@ int main(int argc, char *argv[]) memset(argvBuff, '\0', sizeof(argvBuff)); int commandRetVal = -1; /* inform client that we can handle additional commands */ - fprintf(stderr, "{\"EPLAYER3_EXTENDED\":{\"version\":%d}}\n", 36); + fprintf(stderr, "{\"EPLAYER3_EXTENDED\":{\"version\":%d}}\n", 37); if (0 != ParseParams(argc, argv, file, audioFile, &audioTrackIdx, &subtitleTrackIdx)) { printf("Usage: exteplayer3 filePath [-u user-agent] [-c cookies] [-h headers] [-p prio] [-a] [-d] [-w] [-l] [-s] [-i] [-t audioTrackId] [-9 subtitleTrackId] [-x separateAudioUri] plabackUri\n"); diff --git a/libeplayer3-arm/output/writer/mipsel/h264.c b/libeplayer3-arm/output/writer/mipsel/h264.c index 04b3d2f..617a7af 100644 --- a/libeplayer3-arm/output/writer/mipsel/h264.c +++ b/libeplayer3-arm/output/writer/mipsel/h264.c @@ -88,6 +88,7 @@ static unsigned int NalLengthBytes = 1; static unsigned char *CodecData = NULL; static unsigned int CodecDataLen = 0; static int avc3 = 0; +static int sps_pps_in_stream = 0; /* ***************************** */ /* Prototypes */ @@ -281,6 +282,7 @@ static int reset() { initialHeader = 1; avc3 = 0; + sps_pps_in_stream = 0; return 0; } @@ -319,21 +321,31 @@ static int writeData(WriterAVCallData_t *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->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x01) || + (call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff)))) { + uint32_t i = 0; + uint8_t InsertPrivData = !sps_pps_in_stream; uint32_t PacketLength = 0; uint32_t FakeStartCode = (call->Version << 8) | PES_VERSION_FAKE_START_CODE; iov[ic++].iov_base = PesHeader; - initialHeader = 0; - //if (initialHeader) // some rtsp streams can update codec data at runtime + while (InsertPrivData && i < 36 && (call->len - i) > 5) + { + if ((call->data[i] == 0x00 && call->data[i + 1] == 0x00 && call->data[i + 2] == 0x00 && call->data[i + 3] == 0x01 && (call->data[i + 4] == 0x67 || call->data[i + 4] == 0x68)) || + (call->data[i] == 0x00 && call->data[i + 1] == 0x00 && call->data[i + 2] == 0x00 && (call->data[i + 3] == 0x67 || call->data[i + 3] == 0x68))) + { + InsertPrivData = 0; + sps_pps_in_stream = 1; + } + i += 1; + } + if (InsertPrivData && call->private_size > 0 /*&& initialHeader*/) // some rtsp streams can update codec data at runtime { initialHeader = 0; iov[ic].iov_base = call->private_data; iov[ic++].iov_len = call->private_size; PacketLength += call->private_size; } - iov[ic].iov_base = ""; - iov[ic++].iov_len = 1; iov[ic].iov_base = call->data; iov[ic++].iov_len = call->len; PacketLength += call->len; @@ -348,7 +360,7 @@ static int writeData(WriterAVCallData_t *call) uint32_t PacketLength = 0; ic = 0; iov[ic++].iov_base = PesHeader; - if (initialHeader) + //if (initialHeader) { if (CodecData) { From ac20ae8192324499776f87ff9433b266a2c695a3 Mon Sep 17 00:00:00 2001 From: samsamsam Date: Tue, 13 Mar 2018 12:55:59 +0100 Subject: [PATCH 16/18] h264 writer - Revert not intended test change Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/f1725779b5bf96594350c024ee9349bf5bfd9bdb Author: samsamsam Date: 2018-03-13 (Tue, 13 Mar 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/main/exteplayer.c | 2 +- libeplayer3-arm/output/writer/mipsel/h264.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libeplayer3-arm/main/exteplayer.c b/libeplayer3-arm/main/exteplayer.c index dd0c7ab..55f2d00 100644 --- a/libeplayer3-arm/main/exteplayer.c +++ b/libeplayer3-arm/main/exteplayer.c @@ -635,7 +635,7 @@ int main(int argc, char *argv[]) memset(argvBuff, '\0', sizeof(argvBuff)); int commandRetVal = -1; /* inform client that we can handle additional commands */ - fprintf(stderr, "{\"EPLAYER3_EXTENDED\":{\"version\":%d}}\n", 37); + fprintf(stderr, "{\"EPLAYER3_EXTENDED\":{\"version\":%d}}\n", 38); if (0 != ParseParams(argc, argv, file, audioFile, &audioTrackIdx, &subtitleTrackIdx)) { printf("Usage: exteplayer3 filePath [-u user-agent] [-c cookies] [-h headers] [-p prio] [-a] [-d] [-w] [-l] [-s] [-i] [-t audioTrackId] [-9 subtitleTrackId] [-x separateAudioUri] plabackUri\n"); diff --git a/libeplayer3-arm/output/writer/mipsel/h264.c b/libeplayer3-arm/output/writer/mipsel/h264.c index 617a7af..9855288 100644 --- a/libeplayer3-arm/output/writer/mipsel/h264.c +++ b/libeplayer3-arm/output/writer/mipsel/h264.c @@ -321,8 +321,7 @@ static int writeData(WriterAVCallData_t *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] == 0x00 && call->data[1] == 0x00 && call->data[2] == 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 i = 0; uint8_t InsertPrivData = !sps_pps_in_stream; @@ -331,8 +330,7 @@ static int writeData(WriterAVCallData_t *call) iov[ic++].iov_base = PesHeader; while (InsertPrivData && i < 36 && (call->len - i) > 5) { - if ((call->data[i] == 0x00 && call->data[i + 1] == 0x00 && call->data[i + 2] == 0x00 && call->data[i + 3] == 0x01 && (call->data[i + 4] == 0x67 || call->data[i + 4] == 0x68)) || - (call->data[i] == 0x00 && call->data[i + 1] == 0x00 && call->data[i + 2] == 0x00 && (call->data[i + 3] == 0x67 || call->data[i + 3] == 0x68))) + if ((call->data[i] == 0x00 && call->data[i + 1] == 0x00 && call->data[i + 2] == 0x00 && call->data[i + 3] == 0x01 && (call->data[i + 4] == 0x67 || call->data[i + 4] == 0x68))) { InsertPrivData = 0; sps_pps_in_stream = 1; From 9b429d8497bad42f8887be5917ef52d44feb83aa Mon Sep 17 00:00:00 2001 From: samsamsam Date: Sun, 18 Mar 2018 01:16:08 +0100 Subject: [PATCH 17/18] Set discard flag to all not active streams, do not process packets from discarded streams Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/ac23fcc6a91383d81d3c4acfd55dc9cdd03deb09 Author: samsamsam Date: 2018-03-18 (Sun, 18 Mar 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/container_ffmpeg.c | 184 ++++++++++++++----- libeplayer3-arm/container/flv2mpeg4_ffmpeg.c | 2 +- libeplayer3-arm/container/mpeg4p2_ffmpeg.c | 2 +- libeplayer3-arm/include/manager.h | 2 + libeplayer3-arm/include/output.h | 2 +- libeplayer3-arm/main/exteplayer.c | 2 +- libeplayer3-arm/manager/audio.c | 10 + 7 files changed, 152 insertions(+), 52 deletions(-) diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index d5a9ae1..a931176 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -136,6 +136,8 @@ static int64_t prev_seek_time_sec = -1; static int32_t seek_target_flag = 0; +static int32_t mutexInitialized = 0; + /* ***************************** */ /* Prototypes */ /* ***************************** */ @@ -155,6 +157,43 @@ void progressive_playback_set(int32_t val) progressive_playback = val; } +static void initMutex(void) +{ + pthread_mutex_init(&mutex, NULL); + mutexInitialized = 1; +} + +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); + if (!mutexInitialized) + { + initMutex(); + } + pthread_mutex_lock(&mutex); + 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 __attribute__((unused))) +{ + pthread_mutex_unlock(&mutex); + ffmpeg_printf(100, "::%d released mutex\n", line); +} + +typedef int32_t (* Write_FN)(void *, void *); + +static int32_t Write(Write_FN WriteFun, void *context, void *privateData) +{ + /* Because Write is blocking we will release mutex which protect + * avformat structures, during write time + */ + int32_t ret = 0; + releaseMutex(__FILE__, __FUNCTION__, __LINE__); + ret = WriteFun(context, privateData); + getMutex(__FILE__, __FUNCTION__, __LINE__); + return ret; +} + #include "buff_ffmpeg.c" #include "wrapped_ffmpeg.c" #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 34, 100) @@ -203,8 +242,6 @@ static void ffmpeg_silen_callback(void *avcl __attribute__((unused)), int level return; } -static int32_t mutexInitialized = 0; - void sel_program_id_set(const int32_t val) { g_sel_program_id = val; @@ -275,29 +312,6 @@ int32_t ffmpeg_av_dict_set(const char *key, const char *value, int32_t flags) return av_dict_set(&avio_opts, key, value, flags); } -static void initMutex(void) -{ - pthread_mutex_init(&mutex, NULL); - mutexInitialized = 1; -} - -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); - if (!mutexInitialized) - { - initMutex(); - } - pthread_mutex_lock(&mutex); - 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 __attribute__((unused))) -{ - pthread_mutex_unlock(&mutex); - 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 __attribute__((unused)), int32_t *version) { ffmpeg_printf(10, "Codec ID: %d (%.8lx)\n", codec_id, codec_id); @@ -718,17 +732,24 @@ static void FFMPEGThread(Context_t *context) Track_t *subtitleTrack = NULL; int32_t pid = avContextTab[cAVIdx]->streams[packet.stream_index]->id; reset_finish_timeout(); - if (context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack) < 0) + if (avContextTab[cAVIdx]->streams[packet.stream_index]->discard != AVDISCARD_ALL) { - ffmpeg_err("error getting video track\n"); + if (context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack) < 0) + { + ffmpeg_err("error getting video track\n"); + } + if (context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack) < 0) + { + ffmpeg_err("error getting audio track\n"); + } + if (context->manager->subtitle->Command(context, MANAGER_GET_TRACK, &subtitleTrack) < 0) + { + ffmpeg_err("error getting subtitle track\n"); + } } - if (context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack) < 0) + else { - ffmpeg_err("error getting audio track\n"); - } - if (context->manager->subtitle->Command(context, MANAGER_GET_TRACK, &subtitleTrack) < 0) - { - ffmpeg_err("error getting subtitle track\n"); + ffmpeg_printf(1, "SKIP DISCARDED PACKET stream_index[%d] pid[%d]\n", packet.size, (int)packet.stream_index, pid); } ffmpeg_printf(200, "packet.size %d - index %d\n", packet.size, pid); if (videoTrack && (videoTrack->AVIdx == (int)cAVIdx) && (videoTrack->Id == pid)) @@ -814,7 +835,7 @@ static void FFMPEGThread(Context_t *context) { avOut.infoFlags = 1; // TS container } - if (context->output->video->Write(context, &avOut) < 0) + if (Write(context->output->video->Write, context, &avOut) < 0) { ffmpeg_err("writing data to video device failed\n"); } @@ -882,7 +903,7 @@ static void FFMPEGThread(Context_t *context) avOut.width = 0; avOut.height = 0; avOut.type = "audio"; - if (context->output->audio->Write(context, &avOut) < 0) + if (Write(context->output->audio->Write, context, &avOut) < 0) { ffmpeg_err("(raw pcm) writing data to audio device failed\n"); } @@ -1058,7 +1079,7 @@ static void FFMPEGThread(Context_t *context) avOut.width = 0; avOut.height = 0; avOut.type = "audio"; - if (!context->playback->BackWard && context->output->audio->Write(context, &avOut) < 0) + if (!context->playback->BackWard && Write(context->output->audio->Write, context, &avOut) < 0) { ffmpeg_err("writing data to audio device failed\n"); } @@ -1079,7 +1100,7 @@ static void FFMPEGThread(Context_t *context) avOut.width = 0; avOut.height = 0; avOut.type = "audio"; - if (!context->playback->BackWard && context->output->audio->Write(context, &avOut) < 0) + if (!context->playback->BackWard && Write(context->output->audio->Write, context, &avOut) < 0) { ffmpeg_err("(aac) writing data to audio device failed\n"); } @@ -1096,7 +1117,7 @@ static void FFMPEGThread(Context_t *context) avOut.width = 0; avOut.height = 0; avOut.type = "audio"; - if (!context->playback->BackWard && context->output->audio->Write(context, &avOut) < 0) + if (!context->playback->BackWard && Write(context->output->audio->Write, context, &avOut) < 0) { ffmpeg_err("writing data to audio device failed\n"); } @@ -1125,7 +1146,7 @@ static void FFMPEGThread(Context_t *context) subOut.data = (uint8_t *)packet.data; subOut.pts = pts; subOut.durationMS = duration; - if (context->output->subtitle->Write(context, &subOut) < 0) + if (Write(context->output->subtitle->Write, context, &subOut) < 0) { ffmpeg_err("writing data to teletext fifo failed\n"); } @@ -1650,19 +1671,21 @@ int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames) int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32_t initial) { - Track_t *audioTrack = NULL; - Track_t *subtitleTrack = NULL; + Track_t *currAudioTrack = NULL; + Track_t *currSubtitleTrack = NULL; + uint32_t addedVideoTracksCount = 0; if (terminating) { return cERR_CONTAINER_FFMPEG_NO_ERROR; } + getMutex(__FILE__, __FUNCTION__, __LINE__); if (initial && context->manager->subtitle) { - context->manager->subtitle->Command(context, MANAGER_GET_TRACK, &subtitleTrack); + context->manager->subtitle->Command(context, MANAGER_GET_TRACK, &currSubtitleTrack); } if (context->manager->audio) { - context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack); + context->manager->audio->Command(context, MANAGER_GET_TRACK, &currAudioTrack); } if (context->manager->video) { @@ -1748,7 +1771,11 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 } } if (!isStreamFromSelProg) + { + stream->discard = AVDISCARD_ALL; + ffmpeg_printf(1, "cAVIdx[%d]: add DISCARD flag to stream index[%d]\n", cAVIdx, stream->index); continue; // skip this stream + } } encoding = Codec2Encoding((int32_t)get_codecpar(stream)->codec_id, (int32_t)get_codecpar(stream)->codec_type, \ (uint8_t *)get_codecpar(stream)->extradata, \ @@ -1775,6 +1802,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 { case AVMEDIA_TYPE_VIDEO: ffmpeg_printf(10, "CODEC_TYPE_VIDEO %d\n", get_codecpar(stream)->codec_type); + stream->discard = AVDISCARD_ALL; /* by default we discard all video streams */ if (encoding != NULL) { track.type = eTypeES; @@ -1844,6 +1872,14 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 /* konfetti: fixme: is this a reason to return with error? */ ffmpeg_err("failed to add track %d\n", n); } + else + { + if (addedVideoTracksCount == 0) /* at now we can handle only first video track */ + { + stream->discard = AVDISCARD_DEFAULT; + } + addedVideoTracksCount += 1; + } } } else @@ -1853,6 +1889,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 break; case AVMEDIA_TYPE_AUDIO: ffmpeg_printf(10, "CODEC_TYPE_AUDIO %d\n", get_codecpar(stream)->codec_type); + stream->discard = AVDISCARD_ALL; if (encoding != NULL) { AVDictionaryEntry *lang; @@ -2172,11 +2209,45 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 case AVMEDIA_TYPE_ATTACHMENT: case AVMEDIA_TYPE_NB: default: + stream->discard = AVDISCARD_ALL; ffmpeg_err("not handled or unknown codec_type %d\n", get_codecpar(stream)->codec_type); break; } } /* for */ } + if (context->manager->audio) + { + Track_t *Tracks = NULL; + int32_t TrackCount = 0; + int32_t selTrackIdx = -1; + context->manager->audio->Command(context, MANAGER_REF_LIST, &Tracks); + context->manager->audio->Command(context, MANAGER_REF_LIST_SIZE, &TrackCount); + if (Tracks && TrackCount) + { + int32_t i; + for (i = 0; i < TrackCount; ++i) + { + if (Tracks[i].pending || Tracks[i].Id < 0) + continue; + if (selTrackIdx == -1) + selTrackIdx = i; + if (currAudioTrack && currAudioTrack->Id == Tracks[i].Id) + { + selTrackIdx = i; + break; + } + } + if (selTrackIdx > -1) + { + ((AVStream *)Tracks[selTrackIdx].stream)->discard = AVDISCARD_DEFAULT; + if (!currAudioTrack || currAudioTrack->Id != Tracks[selTrackIdx].Id) + { + context->manager->audio->Command(context, MANAGER_SET, &Tracks[selTrackIdx].Id); + } + } + } + } + releaseMutex(__FILE__, __FUNCTION__, __LINE__); return cERR_CONTAINER_FFMPEG_NO_ERROR; } @@ -2442,7 +2513,6 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab { seek_target_flag |= AVSEEK_FLAG_BACKWARD; } - getMutex(__FILE__, __FUNCTION__, __LINE__); if (!context->playback || !context->playback->isPlaying) { releaseMutex(__FILE__, __FUNCTION__, __LINE__); @@ -2458,7 +2528,9 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab * seeking per HTTP does still not work very good. forward seeks everytime * about 10 seconds, backward does not work. */ + getMutex(__FILE__, __FUNCTION__, __LINE__); off_t pos = avio_tell(avContextTab[0]->pb); + releaseMutex(__FILE__, __FUNCTION__, __LINE__); ffmpeg_printf(10, "pos %lld %lld\n", pos, avContextTab[0]->bit_rate); if (avContextTab[0]->bit_rate) { @@ -2484,7 +2556,6 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab seek_target_seconds = sec; do_seek_target_seconds = 1; } - releaseMutex(__FILE__, __FUNCTION__, __LINE__); return cERR_CONTAINER_FFMPEG_NO_ERROR; } @@ -2539,8 +2610,25 @@ static int32_t container_ffmpeg_get_length(Context_t *context, int64_t *length) static int32_t container_ffmpeg_switch_audio(Context_t *context, int32_t *arg __attribute__((unused))) { ffmpeg_printf(10, "track %d\n", *arg); + getMutex(__FILE__, __FUNCTION__, __LINE__); + if (context->manager->audio) + { + Track_t *Tracks = NULL; + int32_t TrackCount = 0; + context->manager->audio->Command(context, MANAGER_REF_LIST, &Tracks); + context->manager->audio->Command(context, MANAGER_REF_LIST_SIZE, &TrackCount); + if (Tracks && TrackCount) + { + int32_t i; + for (i = 0; i < TrackCount; ++i) + { + ((AVStream *)Tracks[i].stream)->discard = Tracks[i].Id == *arg ? AVDISCARD_DEFAULT : AVDISCARD_ALL; + } + } + } + releaseMutex(__FILE__, __FUNCTION__, __LINE__); /* Hellmaster1024: nothing to do here! */ - int64_t sec = -5; + int64_t sec = -1; context->playback->Command(context, PLAYBACK_SEEK, (void *)&sec); return cERR_CONTAINER_FFMPEG_NO_ERROR; } @@ -2553,7 +2641,7 @@ static int32_t container_ffmpeg_switch_subtitle(Context_t *context, int32_t *arg * we seek to force ffmpeg to read once again the same data * but now we will not ignore subtitle frame */ - int64_t sec = -5; + int64_t sec = -1; context->playback->Command(context, PLAYBACK_SEEK, (void *)&sec); return cERR_CONTAINER_FFMPEG_NO_ERROR; } @@ -2788,4 +2876,4 @@ Container_t FFMPEGContainer = "FFMPEG", &Command, FFMPEG_Capabilities -}; +}; \ No newline at end of file diff --git a/libeplayer3-arm/container/flv2mpeg4_ffmpeg.c b/libeplayer3-arm/container/flv2mpeg4_ffmpeg.c index 968ba56..a96e055 100644 --- a/libeplayer3-arm/container/flv2mpeg4_ffmpeg.c +++ b/libeplayer3-arm/container/flv2mpeg4_ffmpeg.c @@ -34,7 +34,7 @@ static int flv2mpeg4_context_write_packet_cb(void *usr_data, int keyframe, int p avOut.width = ctx->track->width; avOut.height = ctx->track->height; avOut.type = "video"; - if (ctx->out_ctx->output->video->Write(ctx->out_ctx, &avOut) < 0) + if (Write(ctx->out_ctx->output->video->Write, ctx->out_ctx, &avOut) < 0) { ffmpeg_err("writing data to video device failed\n"); } diff --git a/libeplayer3-arm/container/mpeg4p2_ffmpeg.c b/libeplayer3-arm/container/mpeg4p2_ffmpeg.c index c27056e..f77ef73 100644 --- a/libeplayer3-arm/container/mpeg4p2_ffmpeg.c +++ b/libeplayer3-arm/container/mpeg4p2_ffmpeg.c @@ -107,7 +107,7 @@ static void mpeg4p2_write(Context_t *ctx, Track_t *track, int avContextIdx, int6 avOut.width = track->width; avOut.height = track->height; avOut.type = "video"; - if (ctx->output->video->Write(ctx, &avOut) < 0) + if (Write(ctx->output->video->Write, ctx, &avOut) < 0) { ffmpeg_err("writing data to video device failed\n"); } diff --git a/libeplayer3-arm/include/manager.h b/libeplayer3-arm/include/manager.h index d5eea58..81515bc 100644 --- a/libeplayer3-arm/include/manager.h +++ b/libeplayer3-arm/include/manager.h @@ -24,6 +24,8 @@ typedef enum MANAGER_INIT_UPDATE, MANAGER_UPDATED_TRACK_INFO, MANAGER_REGISTER_UPDATED_TRACK_INFO, + MANAGER_REF_LIST, + MANAGER_REF_LIST_SIZE, } ManagerCmd_t; typedef enum diff --git a/libeplayer3-arm/include/output.h b/libeplayer3-arm/include/output.h index ac0c0bf..5b0fedb 100644 --- a/libeplayer3-arm/include/output.h +++ b/libeplayer3-arm/include/output.h @@ -71,7 +71,7 @@ typedef struct Output_s { char *Name; int32_t (* Command)(Context_t *, OutputCmd_t, void *); - int32_t (* Write)(Context_t *, void *privateData); + int32_t (* Write)(Context_t *, void *); char **Capabilities; } Output_t; diff --git a/libeplayer3-arm/main/exteplayer.c b/libeplayer3-arm/main/exteplayer.c index 55f2d00..d7c2c19 100644 --- a/libeplayer3-arm/main/exteplayer.c +++ b/libeplayer3-arm/main/exteplayer.c @@ -635,7 +635,7 @@ int main(int argc, char *argv[]) memset(argvBuff, '\0', sizeof(argvBuff)); int commandRetVal = -1; /* inform client that we can handle additional commands */ - fprintf(stderr, "{\"EPLAYER3_EXTENDED\":{\"version\":%d}}\n", 38); + fprintf(stderr, "{\"EPLAYER3_EXTENDED\":{\"version\":%d}}\n", 39); if (0 != ParseParams(argc, argv, file, audioFile, &audioTrackIdx, &subtitleTrackIdx)) { printf("Usage: exteplayer3 filePath [-u user-agent] [-c cookies] [-h headers] [-p prio] [-a] [-d] [-w] [-l] [-s] [-i] [-t audioTrackId] [-9 subtitleTrackId] [-x separateAudioUri] plabackUri\n"); diff --git a/libeplayer3-arm/manager/audio.c b/libeplayer3-arm/manager/audio.c index c527480..6e5abde 100644 --- a/libeplayer3-arm/manager/audio.c +++ b/libeplayer3-arm/manager/audio.c @@ -231,6 +231,16 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) *((char ** *) argument) = (char **) ManagerList(context); break; } + case MANAGER_REF_LIST: + { + *((Track_t **)argument) = Tracks; + break; + } + case MANAGER_REF_LIST_SIZE: + { + *((int *)argument) = TrackCount; + break; + } case MANAGER_GET: { audio_mgr_printf(20, "%s::%s MANAGER_GET\n", __FILE__, __FUNCTION__); From cdc3ad2fa9fe560b176949444ee0c52b708cb9ec Mon Sep 17 00:00:00 2001 From: max_10 Date: Sun, 18 Mar 2018 01:21:50 +0100 Subject: [PATCH 18/18] container_ffmpeg: fix Write from incompatible pointer type Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/8c8cd8b0f79ed8b7b8cd0d87eb4821590b21aaee Author: max_10 Date: 2018-03-18 (Sun, 18 Mar 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/container_ffmpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index a931176..5fec340 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -180,9 +180,9 @@ static void releaseMutex(const char *filename __attribute__((unused)), const con ffmpeg_printf(100, "::%d released mutex\n", line); } -typedef int32_t (* Write_FN)(void *, void *); +typedef int32_t (* Write_FN)(Context_t *context, void *); -static int32_t Write(Write_FN WriteFun, void *context, void *privateData) +static int32_t Write(Write_FN WriteFun, Context_t *context, void *privateData) { /* Because Write is blocking we will release mutex which protect * avformat structures, during write time