From 3624368eb34b2cde9f5a73146338bcdd07894e64 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 6 Oct 2018 18:43:59 +0200 Subject: [PATCH 1/3] arm another fix fastforward Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/e8346468626f1c6331399a0f2621dbc7eee87547 Author: TangoCash Date: 2018-10-06 (Sat, 06 Oct 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/playback/playback.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index 4ec98be..b8fe5bb 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -399,9 +399,6 @@ static int32_t PlaybackContinue(Context_t *context) if (context->playback->SlowMotion || context->playback->isForwarding || context->playback->BackWard) context->output->Command(context, OUTPUT_CLEAR, NULL); - context->output->Command(context, OUTPUT_PAUSE, NULL); - context->output->Command(context, OUTPUT_CONTINUE, NULL); - if (context->playback->BackWard) context->output->Command(context, OUTPUT_AUDIOMUTE, "0"); @@ -411,6 +408,8 @@ static int32_t PlaybackContinue(Context_t *context) context->playback->BackWard = 0; context->playback->SlowMotion = 0; context->playback->Speed = 1; + + context->output->Command(context, OUTPUT_CONTINUE, NULL); } else { @@ -540,7 +539,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); + context->output->Command(context, OUTPUT_CONTINUE, NULL); } else { From a8fa9816ad549d24cdf6c53abb436024da76d4ea Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 6 Oct 2018 18:53:42 +0200 Subject: [PATCH 2/3] Revert "update video streamtype" This reverts commit ebda3bf0417182ce9b0859ba66fcf7a5b28300a5. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/66aefaf4e79bea98cef0e0d7d9312344f5b58655 Author: TangoCash Date: 2018-10-06 (Sat, 06 Oct 2018) ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 56 ++++++++++++++++++++++++++++++------------- libarmbox/video_lib.h | 25 +++++++------------ 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index a7422de..3a49622 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -140,6 +140,15 @@ static const char *vid_modes[] = { "720p50" // VIDEO_STD_AUTO }; +#define VIDEO_STREAMTYPE_MPEG2 0 +#define VIDEO_STREAMTYPE_MPEG4_H264 1 +#define VIDEO_STREAMTYPE_VC1 3 +#define VIDEO_STREAMTYPE_MPEG4_Part2 4 +#define VIDEO_STREAMTYPE_VC1_SM 5 +#define VIDEO_STREAMTYPE_MPEG1 6 +#define VIDEO_STREAMTYPE_H265_HEVC 7 +#define VIDEO_STREAMTYPE_AVS 16 + ssize_t write_all(int fd, const void *buf, size_t count) { int retval; @@ -751,26 +760,39 @@ void cVideo::SetSyncMode(AVSYNC_TYPE mode) int cVideo::SetStreamType(VIDEO_FORMAT type) { - const char *VF[] = { - "VIDEO_STREAMTYPE_MPEG2", - "VIDEO_STREAMTYPE_MPEG4_H264", - "VIDEO_STREAMTYPE_MPEG4_H263", - "VIDEO_STREAMTYPE_VC1", - "VIDEO_STREAMTYPE_MPEG4_Part2", - "VIDEO_STREAMTYPE_VC1_SM", - "VIDEO_STREAMTYPE_MPEG1", - "VIDEO_STREAMTYPE_DIVX311" - "VIDEO_STREAMTYPE_H265_HEVC", - "VIDEO_STREAMTYPE_AVS" + static const char *VF[] = { + "VIDEO_FORMAT_MPEG2", + "VIDEO_FORMAT_MPEG4", + "VIDEO_FORMAT_VC1", + "VIDEO_FORMAT_JPEG", + "VIDEO_FORMAT_GIF", + "VIDEO_FORMAT_PNG" }; + int t; + lt_debug("#%d: %s type=%s\n", devnum, __func__, VF[type]); - lt_info("%s - type=%s\n", __FUNCTION__, VF[type]); - - if (ioctl( fd, VIDEO_SET_STREAMTYPE, type) < 0) - perror("VIDEO_SET_STREAMTYPE"); - - StreamType = type; + switch (type) + { + case VIDEO_FORMAT_MPEG4_H264: + t = VIDEO_STREAMTYPE_MPEG4_H264; + break; + case VIDEO_FORMAT_MPEG4_H265: + t = VIDEO_STREAMTYPE_H265_HEVC; + break; + case VIDEO_FORMAT_AVS: + t = VIDEO_STREAMTYPE_AVS; + break; + case VIDEO_FORMAT_VC1: + t = VIDEO_STREAMTYPE_VC1; + break; + case VIDEO_FORMAT_MPEG2: + default: + t = VIDEO_STREAMTYPE_MPEG2; + break; + } + if (ioctl(fd, VIDEO_SET_STREAMTYPE, t) < 0) + lt_info("%s VIDEO_SET_STREAMTYPE(%d) failed: %m\n", __func__, t); return 0; } diff --git a/libarmbox/video_lib.h b/libarmbox/video_lib.h index 4cdc073..d14354e 100644 --- a/libarmbox/video_lib.h +++ b/libarmbox/video_lib.h @@ -35,23 +35,14 @@ typedef enum { } COLOR_FORMAT; typedef enum { - VIDEO_STREAMTYPE_UNKNOWN = -1, - VIDEO_STREAMTYPE_MPEG2 = 0, - VIDEO_STREAMTYPE_MPEG4_H264 = 1, - VIDEO_STREAMTYPE_H263 = 2, - VIDEO_STREAMTYPE_VC1 = 3, - VIDEO_STREAMTYPE_MPEG4_Part2 = 4, - VIDEO_STREAMTYPE_VC1_SM = 5, - VIDEO_STREAMTYPE_MPEG1 = 6, - VIDEO_STREAMTYPE_MPEG4_H265 = 7, - VIDEO_STREAMTYPE_VB8 = 8, - VIDEO_STREAMTYPE_VB9 = 9, - VIDEO_STREAMTYPE_XVID = 10, - VIDEO_STREAMTYPE_DIVX311 = 13, - VIDEO_STREAMTYPE_DIVX4 = 14, - VIDEO_STREAMTYPE_DIVX5 = 15, - VIDEO_STREAMTYPE_VB6 = 18, - VIDEO_STREAMTYPE_SPARK = 21 + VIDEO_FORMAT_MPEG2 = 0, + VIDEO_FORMAT_MPEG4_H264, + VIDEO_FORMAT_VC1, + VIDEO_FORMAT_JPEG, + VIDEO_FORMAT_GIF, + VIDEO_FORMAT_PNG, + VIDEO_FORMAT_MPEG4_H265, + VIDEO_FORMAT_AVS = 16 } VIDEO_FORMAT; typedef enum { From 4171712604f18a750f780d221f3a71317fa0c60a Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 6 Oct 2018 18:53:49 +0200 Subject: [PATCH 3/3] Revert "update audio streamtype" This reverts commit b95524d059dfaec36034e23592f7c7236067c2d2. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/5abba5033a9adbcc4718813ae8f88a52e55820fe Author: TangoCash Date: 2018-10-06 (Sat, 06 Oct 2018) ------------------ This commit was generated by Migit --- libarmbox/audio.cpp | 57 +++++++++++++++++++++++-------------------- libarmbox/audio_lib.h | 29 +++++++++++----------- 2 files changed, 45 insertions(+), 41 deletions(-) diff --git a/libarmbox/audio.cpp b/libarmbox/audio.cpp index d6af373..809b594 100644 --- a/libarmbox/audio.cpp +++ b/libarmbox/audio.cpp @@ -150,36 +150,41 @@ void cAudio::SetSyncMode(AVSYNC_TYPE Mode) ioctl(fd, AUDIO_SET_AV_SYNC, Mode); } +#define AUDIO_STREAMTYPE_AC3 0 +#define AUDIO_STREAMTYPE_MPEG 1 +#define AUDIO_STREAMTYPE_DTS 2 +#define AUDIO_STREAMTYPE_AAC 8 +#define AUDIO_STREAMTYPE_AACHE 9 + void cAudio::SetStreamType(AUDIO_FORMAT type) { - const char *AF[] = { - "AUDIO_STREAMTYPE_AC3", - "AUDIO_STREAMTYPE_MPEG", - "AUDIO_STREAMTYPE_DTS", - "AUDIO_STREAMTYPE_LPCM", - "AUDIO_STREAMTYPE_AAC", - "AUDIO_STREAMTYPE_AAC_HE", - "AUDIO_STREAMTYPE_MP3", - "AUDIO_STREAMTYPE_AAC_PLUS", - "AUDIO_STREAMTYPE_DTS_HD", - "AUDIO_STREAMTYPE_WMA", - "AUDIO_STREAMTYPE_WMA_PRO", - "AUDIO_STREAMTYPE_AC3_PLUS", - "AUDIO_STREAMTYPE_AMR", - "AUDIO_STREAMTYPE_RAW" - }; - - lt_info("%s - type=%s\n", __FUNCTION__, AF[type]); - - if (ioctl(fd, AUDIO_SET_BYPASS_MODE, type) < 0) - { - perror("AUDIO_SET_BYPASS_MODE"); - return; - } - + int bypass = AUDIO_STREAMTYPE_MPEG; + lt_debug("%s %d\n", __FUNCTION__, type); StreamType = type; - return; + switch (type) + { + case AUDIO_FMT_DD_PLUS: + case AUDIO_FMT_DOLBY_DIGITAL: + bypass = AUDIO_STREAMTYPE_AC3; + break; + case AUDIO_FMT_AAC: + bypass = AUDIO_STREAMTYPE_AAC; + break; + case AUDIO_FMT_AAC_PLUS: + bypass = AUDIO_STREAMTYPE_AACHE; + break; + case AUDIO_FMT_DTS: + bypass = AUDIO_STREAMTYPE_DTS; + break; + default: + break; + } + + // Normaly the encoding should be set using AUDIO_SET_ENCODING + // But as we implemented the behavior to bypass (cause of e2) this is correct here + if (ioctl(fd, AUDIO_SET_BYPASS_MODE, bypass) < 0) + lt_info("%s: AUDIO_SET_BYPASS_MODE failed (%m)\n", __func__); } int cAudio::setChannel(int channel) diff --git a/libarmbox/audio_lib.h b/libarmbox/audio_lib.h index 2bcd073..1fb896f 100644 --- a/libarmbox/audio_lib.h +++ b/libarmbox/audio_lib.h @@ -20,21 +20,20 @@ typedef enum { typedef enum { - AUDIO_FMT_UNKNOWN = -1, - AUDIO_FMT_DOLBY_DIGITAL = 0, - AUDIO_FMT_MPEG = 1, - AUDIO_FMT_DTS = 2, - AUDIO_FMT_LPCM = 6, - AUDIO_FMT_AAC = 8, - AUDIO_FMT_AAC_HE = 9, - AUDIO_FMT_MP3 = 0xa, - AUDIO_FMT_AAC_PLUS = 0xb, - AUDIO_FMT_DTS_HD = 0x10, - AUDIO_FMT_WMA = 0x20, - AUDIO_FMT_WMA_PRO = 0x21, - AUDIO_FMT_DD_PLUS = 0x22, - AUDIO_FMT_AMR = 0x23, - AUDIO_FMT_RAW = 0xf + AUDIO_FMT_AUTO = 0, + AUDIO_FMT_MPEG, + AUDIO_FMT_MP3, + AUDIO_FMT_DOLBY_DIGITAL, + AUDIO_FMT_BASIC = AUDIO_FMT_DOLBY_DIGITAL, + AUDIO_FMT_AAC, + AUDIO_FMT_AAC_PLUS, + AUDIO_FMT_DD_PLUS, + AUDIO_FMT_DTS, + AUDIO_FMT_AVS, + AUDIO_FMT_MLP, + AUDIO_FMT_WMA, + AUDIO_FMT_MPG1, // TD only. For Movieplayer / cPlayback + AUDIO_FMT_ADVANCED = AUDIO_FMT_MLP } AUDIO_FORMAT; class mixerVolume;