From a779a8bb08bdb80cd8351d075b40ce86e30b61ab Mon Sep 17 00:00:00 2001 From: max_10 Date: Thu, 4 Jan 2018 00:56:28 +0100 Subject: [PATCH 01/36] armbox eplayer: remove writeReverseData (unused) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/e6c29f2545e7cc6edb2446d08dd88646d6be88d3 Author: max_10 Date: 2018-01-04 (Thu, 04 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/include/writer.h | 1 - libeplayer3-arm/output/writer/mipsel/aac.c | 3 --- libeplayer3-arm/output/writer/mipsel/ac3.c | 2 -- libeplayer3-arm/output/writer/mipsel/amr.c | 1 - libeplayer3-arm/output/writer/mipsel/divx3.c | 1 - libeplayer3-arm/output/writer/mipsel/dts.c | 1 - libeplayer3-arm/output/writer/mipsel/h263.c | 2 -- libeplayer3-arm/output/writer/mipsel/h264.c | 6 ----- libeplayer3-arm/output/writer/mipsel/h265.c | 6 ----- libeplayer3-arm/output/writer/mipsel/lpcm.c | 1 - libeplayer3-arm/output/writer/mipsel/mp3.c | 3 --- libeplayer3-arm/output/writer/mipsel/mpeg2.c | 2 -- libeplayer3-arm/output/writer/mipsel/mpeg4.c | 1 - libeplayer3-arm/output/writer/mipsel/pcm.c | 6 ++--- libeplayer3-arm/output/writer/mipsel/vc1.c | 1 - libeplayer3-arm/output/writer/mipsel/vp.c | 4 ---- libeplayer3-arm/output/writer/mipsel/wma.c | 4 +--- libeplayer3-arm/output/writer/mipsel/wmv.c | 7 +++--- libeplayer3-arm/output/writer/mipsel/writer.c | 1 + libeplayer3-arm/output/writer/sh4/aac.c | 3 --- libeplayer3-arm/output/writer/sh4/ac3.c | 2 -- libeplayer3-arm/output/writer/sh4/divx.c | 4 ---- libeplayer3-arm/output/writer/sh4/divx2.c | 4 ---- libeplayer3-arm/output/writer/sh4/dts.c | 1 - libeplayer3-arm/output/writer/sh4/h263.c | 2 -- libeplayer3-arm/output/writer/sh4/h264.c | 24 +------------------ libeplayer3-arm/output/writer/sh4/mp3.c | 3 --- libeplayer3-arm/output/writer/sh4/mpeg2.c | 2 -- libeplayer3-arm/output/writer/sh4/pcm.c | 2 -- libeplayer3-arm/output/writer/sh4/vc1.c | 5 ++-- libeplayer3-arm/output/writer/sh4/vorbis.c | 1 - libeplayer3-arm/output/writer/sh4/wma.c | 4 +--- libeplayer3-arm/output/writer/sh4/wmv.c | 1 - 33 files changed, 11 insertions(+), 100 deletions(-) diff --git a/libeplayer3-arm/include/writer.h b/libeplayer3-arm/include/writer.h index ffae2a9..ad667e8 100644 --- a/libeplayer3-arm/include/writer.h +++ b/libeplayer3-arm/include/writer.h @@ -39,7 +39,6 @@ typedef struct Writer_s { int (* reset)(); int (* writeData)(void *); - int (* writeReverseData)(void *); WriterCaps_t *caps; } Writer_t; diff --git a/libeplayer3-arm/output/writer/mipsel/aac.c b/libeplayer3-arm/output/writer/mipsel/aac.c index f9f85a6..93a14fd 100644 --- a/libeplayer3-arm/output/writer/mipsel/aac.c +++ b/libeplayer3-arm/output/writer/mipsel/aac.c @@ -333,7 +333,6 @@ struct Writer_s WriterAudioAAC = { &reset, &writeDataADTS, - NULL, &caps }; @@ -351,7 +350,6 @@ struct Writer_s WriterAudioAACLATM = { &reset, &writeDataLATM, - NULL, &caps_aac_latm }; @@ -369,6 +367,5 @@ struct Writer_s WriterAudioAACPLUS = { &reset, &writeDataADTS, - NULL, &caps_aacplus }; diff --git a/libeplayer3-arm/output/writer/mipsel/ac3.c b/libeplayer3-arm/output/writer/mipsel/ac3.c index 39b7cc7..802f320 100644 --- a/libeplayer3-arm/output/writer/mipsel/ac3.c +++ b/libeplayer3-arm/output/writer/mipsel/ac3.c @@ -147,7 +147,6 @@ struct Writer_s WriterAudioAC3 = { &reset, &writeData, - NULL, &caps_ac3 }; @@ -165,6 +164,5 @@ struct Writer_s WriterAudioEAC3 = { &reset, &writeData, - NULL, &caps_eac3 }; diff --git a/libeplayer3-arm/output/writer/mipsel/amr.c b/libeplayer3-arm/output/writer/mipsel/amr.c index 06ed981..0847ecd 100644 --- a/libeplayer3-arm/output/writer/mipsel/amr.c +++ b/libeplayer3-arm/output/writer/mipsel/amr.c @@ -169,6 +169,5 @@ struct Writer_s WriterAudioAMR = { &reset, &writeData, - NULL, &caps_amr }; diff --git a/libeplayer3-arm/output/writer/mipsel/divx3.c b/libeplayer3-arm/output/writer/mipsel/divx3.c index ca8599c..349f4bc 100644 --- a/libeplayer3-arm/output/writer/mipsel/divx3.c +++ b/libeplayer3-arm/output/writer/mipsel/divx3.c @@ -190,6 +190,5 @@ struct Writer_s WriterVideoDIVX3 = { &reset, &writeData, - NULL, &divix3_caps }; diff --git a/libeplayer3-arm/output/writer/mipsel/dts.c b/libeplayer3-arm/output/writer/mipsel/dts.c index fa5103f..f001441 100644 --- a/libeplayer3-arm/output/writer/mipsel/dts.c +++ b/libeplayer3-arm/output/writer/mipsel/dts.c @@ -173,6 +173,5 @@ struct Writer_s WriterAudioDTS = { &reset, &writeData, - NULL, &caps }; diff --git a/libeplayer3-arm/output/writer/mipsel/h263.c b/libeplayer3-arm/output/writer/mipsel/h263.c index 9e6c32e..bca9f9b 100644 --- a/libeplayer3-arm/output/writer/mipsel/h263.c +++ b/libeplayer3-arm/output/writer/mipsel/h263.c @@ -148,7 +148,6 @@ struct Writer_s WriterVideoH263 = { &reset, &writeData, - NULL, &caps_h263 }; @@ -166,6 +165,5 @@ struct Writer_s WriterVideoFLV = { &reset, &writeData, - NULL, &caps_flv }; diff --git a/libeplayer3-arm/output/writer/mipsel/h264.c b/libeplayer3-arm/output/writer/mipsel/h264.c index 90fe5a1..a01cba1 100644 --- a/libeplayer3-arm/output/writer/mipsel/h264.c +++ b/libeplayer3-arm/output/writer/mipsel/h264.c @@ -413,11 +413,6 @@ static int writeData(void *_call) return len; } -static int writeReverseData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - return 0; -} /* ***************************** */ /* Writer Definition */ /* ***************************** */ @@ -436,6 +431,5 @@ struct Writer_s WriterVideoH264 = { &reset, &writeData, - &writeReverseData, &caps }; diff --git a/libeplayer3-arm/output/writer/mipsel/h265.c b/libeplayer3-arm/output/writer/mipsel/h265.c index b0d07b2..d34405f 100644 --- a/libeplayer3-arm/output/writer/mipsel/h265.c +++ b/libeplayer3-arm/output/writer/mipsel/h265.c @@ -282,11 +282,6 @@ static int writeData(void *_call) return len; } -static int writeReverseData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - return 0; -} /* ***************************** */ /* Writer Definition */ /* ***************************** */ @@ -305,6 +300,5 @@ struct Writer_s WriterVideoH265 = { &reset, &writeData, - &writeReverseData, &caps }; diff --git a/libeplayer3-arm/output/writer/mipsel/lpcm.c b/libeplayer3-arm/output/writer/mipsel/lpcm.c index 5030177..2fc6cec 100644 --- a/libeplayer3-arm/output/writer/mipsel/lpcm.c +++ b/libeplayer3-arm/output/writer/mipsel/lpcm.c @@ -261,6 +261,5 @@ struct Writer_s WriterAudioLPCM = { &reset, &writeData, /* writeDataLPCM */ - NULL, &caps_lpcm }; diff --git a/libeplayer3-arm/output/writer/mipsel/mp3.c b/libeplayer3-arm/output/writer/mipsel/mp3.c index 9afb51e..5b712bc 100644 --- a/libeplayer3-arm/output/writer/mipsel/mp3.c +++ b/libeplayer3-arm/output/writer/mipsel/mp3.c @@ -147,7 +147,6 @@ struct Writer_s WriterAudioMP3 = { &reset, &writeData, - NULL, &caps_mp3 }; @@ -165,7 +164,6 @@ struct Writer_s WriterAudioMPEGL3 = { &reset, &writeData, - NULL, &caps_mpegl3 }; @@ -183,6 +181,5 @@ struct Writer_s WriterAudioVORBIS = { &reset, &writeData, - NULL, &caps_vorbis }; diff --git a/libeplayer3-arm/output/writer/mipsel/mpeg2.c b/libeplayer3-arm/output/writer/mipsel/mpeg2.c index b15a4db..26706a0 100644 --- a/libeplayer3-arm/output/writer/mipsel/mpeg2.c +++ b/libeplayer3-arm/output/writer/mipsel/mpeg2.c @@ -157,7 +157,6 @@ struct Writer_s WriterVideoMPEG2 = { &reset, &writeData, - NULL, &caps }; @@ -175,6 +174,5 @@ struct Writer_s WriterVideoMPEG1 = { &reset, &writeData, - NULL, &mpg1_caps }; diff --git a/libeplayer3-arm/output/writer/mipsel/mpeg4.c b/libeplayer3-arm/output/writer/mipsel/mpeg4.c index f9f99b3..f5fcc13 100644 --- a/libeplayer3-arm/output/writer/mipsel/mpeg4.c +++ b/libeplayer3-arm/output/writer/mipsel/mpeg4.c @@ -159,6 +159,5 @@ struct Writer_s WriterVideoMPEG4 = { &reset, &writeData, - NULL, &mpeg4p2_caps }; diff --git a/libeplayer3-arm/output/writer/mipsel/pcm.c b/libeplayer3-arm/output/writer/mipsel/pcm.c index 29ef0f4..73c8359 100644 --- a/libeplayer3-arm/output/writer/mipsel/pcm.c +++ b/libeplayer3-arm/output/writer/mipsel/pcm.c @@ -127,7 +127,7 @@ static int32_t writeData(void *_call) return 0; } static uint8_t PesHeader[PES_MAX_HEADER_SIZE + 22]; - pcmPrivateData_t *pcmPrivateData = (pcmPrivateData_t *)call->private_data; + pcmPrivateData_t *pcmPrivateData = (pcmPrivateData_t *)call->private_data; uint8_t *buffer = call->data; uint32_t size = call->len; if (pcmPrivateData->bResampling || NULL == fixed_buffer) @@ -147,7 +147,7 @@ static int32_t writeData(void *_call) int32_t channels = (uint8_t) pcmPrivateData->channels; int32_t block_align = 0; int32_t byterate = 0; - uint32_t codecID = (uint32_t)pcmPrivateData->ffmpeg_codec_id; + uint32_t codecID = (uint32_t)pcmPrivateData->ffmpeg_codec_id; uint8_t dataPrecision = 0; uint8_t LE = 0; switch (codecID) @@ -288,7 +288,6 @@ struct Writer_s WriterAudioPCM = { &reset, &writeData, - NULL, &caps_pcm }; @@ -306,6 +305,5 @@ struct Writer_s WriterAudioIPCM = { &reset, &writeData, /* writeDataIPCM */ - NULL, &caps_ipcm }; diff --git a/libeplayer3-arm/output/writer/mipsel/vc1.c b/libeplayer3-arm/output/writer/mipsel/vc1.c index 2f543a0..33eeab8 100644 --- a/libeplayer3-arm/output/writer/mipsel/vc1.c +++ b/libeplayer3-arm/output/writer/mipsel/vc1.c @@ -194,6 +194,5 @@ struct Writer_s WriterVideoVC1 = { &reset, &writeData, - NULL, &caps }; diff --git a/libeplayer3-arm/output/writer/mipsel/vp.c b/libeplayer3-arm/output/writer/mipsel/vp.c index 326a7b3..3a4533b 100644 --- a/libeplayer3-arm/output/writer/mipsel/vp.c +++ b/libeplayer3-arm/output/writer/mipsel/vp.c @@ -167,7 +167,6 @@ struct Writer_s WriterVideoVP6 = { &reset, &writeDataVP6, - NULL, &capsVP6 }; @@ -185,7 +184,6 @@ struct Writer_s WriterVideoVP8 = { &reset, &writeDataVP89, - NULL, &capsVP8 }; @@ -203,7 +201,6 @@ struct Writer_s WriterVideoVP9 = { &reset, &writeDataVP89, - NULL, &capsVP9 }; @@ -221,6 +218,5 @@ struct Writer_s WriterVideoSPARK = { &reset, &writeDataVP89, - NULL, &capsSPARK }; diff --git a/libeplayer3-arm/output/writer/mipsel/wma.c b/libeplayer3-arm/output/writer/mipsel/wma.c index c407d60..1c43ee0 100644 --- a/libeplayer3-arm/output/writer/mipsel/wma.c +++ b/libeplayer3-arm/output/writer/mipsel/wma.c @@ -161,7 +161,7 @@ static int writeData(void *_call) } /* ***************************** */ -/* Writer Definition */ +/* Writer Definition */ /* ***************************** */ static WriterCaps_t capsWMAPRO = @@ -178,7 +178,6 @@ struct Writer_s WriterAudioWMAPRO = { &reset, &writeData, - NULL, &capsWMAPRO }; @@ -196,6 +195,5 @@ struct Writer_s WriterAudioWMA = { &reset, &writeData, - NULL, &capsWMA }; diff --git a/libeplayer3-arm/output/writer/mipsel/wmv.c b/libeplayer3-arm/output/writer/mipsel/wmv.c index e9b7053..6cf8da1 100644 --- a/libeplayer3-arm/output/writer/mipsel/wmv.c +++ b/libeplayer3-arm/output/writer/mipsel/wmv.c @@ -20,7 +20,7 @@ */ /* ***************************** */ -/* Includes */ +/* Includes */ /* ***************************** */ #include @@ -50,7 +50,7 @@ #include "writer.h" /* ***************************** */ -/* Makros/Constants */ +/* Makros/Constants */ /* ***************************** */ #define WMV_FRAME_START_CODE 0x0d @@ -79,7 +79,7 @@ static short debug_level = 10; #endif /* ***************************** */ -/* Types */ +/* Types */ /* ***************************** */ static const uint8_t Vc1FrameStartCode[] = {0, 0, 1, WMV_FRAME_START_CODE}; @@ -201,6 +201,5 @@ struct Writer_s WriterVideoWMV = { &reset, &writeData, - NULL, &caps }; diff --git a/libeplayer3-arm/output/writer/mipsel/writer.c b/libeplayer3-arm/output/writer/mipsel/writer.c index 4d5853f..de99006 100644 --- a/libeplayer3-arm/output/writer/mipsel/writer.c +++ b/libeplayer3-arm/output/writer/mipsel/writer.c @@ -22,6 +22,7 @@ /* ***************************** */ /* Includes */ /* ***************************** */ + #include #include #include diff --git a/libeplayer3-arm/output/writer/sh4/aac.c b/libeplayer3-arm/output/writer/sh4/aac.c index 0e4f344..8617e74 100644 --- a/libeplayer3-arm/output/writer/sh4/aac.c +++ b/libeplayer3-arm/output/writer/sh4/aac.c @@ -330,7 +330,6 @@ struct Writer_s WriterAudioAAC = { &reset, &writeDataADTS, - NULL, &caps }; @@ -348,7 +347,6 @@ struct Writer_s WriterAudioAACLATM = { &reset, &writeDataLATM, - NULL, &caps_aac_latm }; @@ -366,6 +364,5 @@ struct Writer_s WriterAudioAACPLUS = { &reset, &writeDataADTS, - NULL, &caps_aacplus }; diff --git a/libeplayer3-arm/output/writer/sh4/ac3.c b/libeplayer3-arm/output/writer/sh4/ac3.c index fccccf9..6214b65 100644 --- a/libeplayer3-arm/output/writer/sh4/ac3.c +++ b/libeplayer3-arm/output/writer/sh4/ac3.c @@ -142,7 +142,6 @@ struct Writer_s WriterAudioAC3 = { &reset, &writeData, - NULL, &caps_ac3 }; @@ -160,6 +159,5 @@ struct Writer_s WriterAudioEAC3 = { &reset, &writeData, - NULL, &caps_eac3 }; diff --git a/libeplayer3-arm/output/writer/sh4/divx.c b/libeplayer3-arm/output/writer/sh4/divx.c index fe67339..f0c2013 100644 --- a/libeplayer3-arm/output/writer/sh4/divx.c +++ b/libeplayer3-arm/output/writer/sh4/divx.c @@ -187,7 +187,6 @@ struct Writer_s WriterVideoMPEG4 = { &reset, &writeData, - NULL, &mpeg4p2_caps }; @@ -195,7 +194,6 @@ struct Writer_s WriterVideoMSCOMP = { &reset, &writeData, - NULL, &mpeg4p2_caps }; @@ -213,7 +211,6 @@ struct Writer_s WriterVideoFOURCC = { &reset, &writeData, - NULL, &fourcc_caps }; @@ -231,6 +228,5 @@ struct Writer_s WriterVideoDIVX = { &reset, &writeData, - NULL, &divx_caps }; diff --git a/libeplayer3-arm/output/writer/sh4/divx2.c b/libeplayer3-arm/output/writer/sh4/divx2.c index 8386046..c928058 100644 --- a/libeplayer3-arm/output/writer/sh4/divx2.c +++ b/libeplayer3-arm/output/writer/sh4/divx2.c @@ -213,7 +213,6 @@ struct Writer_s WriterVideoMPEG4 = { &reset, &writeData, - NULL, &mpeg4p2_caps }; @@ -221,7 +220,6 @@ struct Writer_s WriterVideoMSCOMP = { &reset, &writeData, - NULL, &mpeg4p2_caps }; @@ -239,7 +237,6 @@ struct Writer_s WriterVideoFOURCC = { &reset, &writeData, - NULL, &fourcc_caps }; @@ -257,6 +254,5 @@ struct Writer_s WriterVideoDIVX = { &reset, &writeData, - NULL, &divx_caps }; diff --git a/libeplayer3-arm/output/writer/sh4/dts.c b/libeplayer3-arm/output/writer/sh4/dts.c index 514bd7a..64b5862 100644 --- a/libeplayer3-arm/output/writer/sh4/dts.c +++ b/libeplayer3-arm/output/writer/sh4/dts.c @@ -171,6 +171,5 @@ struct Writer_s WriterAudioDTS = { &reset, &writeData, - NULL, &caps }; diff --git a/libeplayer3-arm/output/writer/sh4/h263.c b/libeplayer3-arm/output/writer/sh4/h263.c index 4f86fa9..4c56341 100644 --- a/libeplayer3-arm/output/writer/sh4/h263.c +++ b/libeplayer3-arm/output/writer/sh4/h263.c @@ -150,7 +150,6 @@ struct Writer_s WriterVideoH263 = { &reset, &writeData, - NULL, &caps_h263 }; @@ -168,6 +167,5 @@ struct Writer_s WriterVideoFLV = { &reset, &writeData, - NULL, &caps_flv }; diff --git a/libeplayer3-arm/output/writer/sh4/h264.c b/libeplayer3-arm/output/writer/sh4/h264.c index ed1e5a8..ffaf118 100644 --- a/libeplayer3-arm/output/writer/sh4/h264.c +++ b/libeplayer3-arm/output/writer/sh4/h264.c @@ -105,6 +105,7 @@ static int avc3 = 0; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + // Please see: https://bugzilla.mozilla.org/show_bug.cgi?id=1105771 static int32_t UpdateExtraData(uint8_t **ppExtraData, uint32_t *pExtraDataSize, uint8_t *pData, uint32_t dataSize) { @@ -434,28 +435,6 @@ static int32_t writeData(void *_call) return len; } -static int writeReverseData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - h264_printf(10, "\n"); - if (call == NULL) - { - h264_err("call data is NULL...\n"); - return 0; - } - h264_printf(10, "VideoPts %lld\n", call->Pts); - if ((call->data == NULL) || (call->len <= 0)) - { - h264_err("NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - h264_err("file pointer < 0. ignoring ...\n"); - return 0; - } - return 0; -} /* ***************************** */ /* Writer Definition */ /* ***************************** */ @@ -474,6 +453,5 @@ struct Writer_s WriterVideoH264 = { &reset, &writeData, - &writeReverseData, &caps }; diff --git a/libeplayer3-arm/output/writer/sh4/mp3.c b/libeplayer3-arm/output/writer/sh4/mp3.c index 3224ad3..d2edf18 100644 --- a/libeplayer3-arm/output/writer/sh4/mp3.c +++ b/libeplayer3-arm/output/writer/sh4/mp3.c @@ -140,7 +140,6 @@ struct Writer_s WriterAudioMP3 = { &reset, &writeData, - NULL, &caps_mp3 }; @@ -156,7 +155,6 @@ struct Writer_s WriterAudioMPEGL3 = { &reset, &writeData, - NULL, &caps_mpegl3 }; @@ -172,6 +170,5 @@ struct Writer_s WriterAudioVORBIS = { &reset, &writeData, - NULL, &caps_vorbis }; diff --git a/libeplayer3-arm/output/writer/sh4/mpeg2.c b/libeplayer3-arm/output/writer/sh4/mpeg2.c index 123f9dc..d501a8f 100644 --- a/libeplayer3-arm/output/writer/sh4/mpeg2.c +++ b/libeplayer3-arm/output/writer/sh4/mpeg2.c @@ -158,7 +158,6 @@ struct Writer_s WriterVideoMPEG2 = { &reset, &writeData, - NULL, &caps }; @@ -176,6 +175,5 @@ struct Writer_s WriterVideoMPEGH264 = { &reset, &writeData, - NULL, &h264_caps }; diff --git a/libeplayer3-arm/output/writer/sh4/pcm.c b/libeplayer3-arm/output/writer/sh4/pcm.c index 14710ae..796e052 100644 --- a/libeplayer3-arm/output/writer/sh4/pcm.c +++ b/libeplayer3-arm/output/writer/sh4/pcm.c @@ -333,7 +333,6 @@ struct Writer_s WriterAudioPCM = { &reset, &writeData, - NULL, &caps_pcm }; @@ -349,6 +348,5 @@ struct Writer_s WriterAudioIPCM = { &reset, &writeData, - NULL, &caps_ipcm }; diff --git a/libeplayer3-arm/output/writer/sh4/vc1.c b/libeplayer3-arm/output/writer/sh4/vc1.c index d034c2f..3f874a1 100644 --- a/libeplayer3-arm/output/writer/sh4/vc1.c +++ b/libeplayer3-arm/output/writer/sh4/vc1.c @@ -84,7 +84,7 @@ static short debug_level = 0; #endif /* ***************************** */ -/* Types */ +/* Types */ /* ***************************** */ static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE}; @@ -237,7 +237,7 @@ static int writeData(void *_call) } /* ***************************** */ -/* Writer Definition */ +/* Writer Definition */ /* ***************************** */ static WriterCaps_t caps = @@ -254,6 +254,5 @@ struct Writer_s WriterVideoVC1 = { &reset, &writeData, - NULL, &caps }; diff --git a/libeplayer3-arm/output/writer/sh4/vorbis.c b/libeplayer3-arm/output/writer/sh4/vorbis.c index 34d8a82..6e10217 100644 --- a/libeplayer3-arm/output/writer/sh4/vorbis.c +++ b/libeplayer3-arm/output/writer/sh4/vorbis.c @@ -141,6 +141,5 @@ struct Writer_s WriterAudioVORBIS = { &reset, &writeData, - NULL, &caps_vorbis }; diff --git a/libeplayer3-arm/output/writer/sh4/wma.c b/libeplayer3-arm/output/writer/sh4/wma.c index d84ad98..aa1ae54 100644 --- a/libeplayer3-arm/output/writer/sh4/wma.c +++ b/libeplayer3-arm/output/writer/sh4/wma.c @@ -150,7 +150,7 @@ static int writeData(void *_call) } /* ***************************** */ -/* Writer Definition */ +/* Writer Definition */ /* ***************************** */ static WriterCaps_t capsWMAPRO = @@ -167,7 +167,6 @@ struct Writer_s WriterAudioWMAPRO = { &reset, &writeData, - NULL, &capsWMAPRO }; @@ -185,6 +184,5 @@ struct Writer_s WriterAudioWMA = { &reset, &writeData, - NULL, &capsWMA }; diff --git a/libeplayer3-arm/output/writer/sh4/wmv.c b/libeplayer3-arm/output/writer/sh4/wmv.c index 75c6278..6e2325e 100644 --- a/libeplayer3-arm/output/writer/sh4/wmv.c +++ b/libeplayer3-arm/output/writer/sh4/wmv.c @@ -248,6 +248,5 @@ struct Writer_s WriterVideoWMV = { &reset, &writeData, - NULL, &caps }; From c967daac3b0fe544bb72f0eee916e89d4d00a322 Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Sat, 6 Jan 2018 14:15:16 +0100 Subject: [PATCH 02/36] fix ci arm hardware (thx DboxOldie) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/0cdc8591105fead7c28ad142944d1c90556117ec Author: Frankenstone Date: 2018-01-06 (Sat, 06 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- common/ca_ci.cpp | 15 +++++++++++---- libdvbci/descrambler.cpp | 18 ++++++++---------- libdvbci/dvbci_ccmgr.cpp | 2 -- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/common/ca_ci.cpp b/common/ca_ci.cpp index d50ced0..265dd35 100644 --- a/common/ca_ci.cpp +++ b/common/ca_ci.cpp @@ -190,7 +190,7 @@ eData waitData(int fd, unsigned char* buffer, int* len) else if (retval == 0) { #if wd_debug - //printf("**** wd DataTimeout\n"); + printf("**** wd DataTimeout\n"); #endif return eDataTimeout; } @@ -214,7 +214,7 @@ eData waitData(int fd, unsigned char* buffer, int* len) else if (fds.revents & POLLOUT) { #if wd_debug - //printf("**** wd DataWrite\n"); + printf("**** wd DataWrite\n"); #endif return eDataWrite; } @@ -1343,12 +1343,11 @@ void cCA::slot_pollthread(void *c) { unsigned char data[1024 * 4]; eDVBCISlot* slot = (eDVBCISlot*) c; + bool wait = false; while (1) { #if HAVE_ARM_HARDWARE /* Armbox */ - if (slot->init && !slot->mmiOpened) - sleep(1); int len = 1024 *4; eData status; @@ -1381,6 +1380,9 @@ void cCA::slot_pollthread(void *c) goto FROM_FIRST; } } + /* slow down the loop, if no CI cam present */ +// printf("***sleep\n"); + sleep(1); } /* case statusnone */ break; case eStatusWait: @@ -1389,6 +1391,7 @@ void cCA::slot_pollthread(void *c) FROM_FIRST: if (status == eDataReady) { + wait = false; slot->pollConnection = false; if (len) { @@ -1398,6 +1401,7 @@ FROM_FIRST: } /*if data ready */ else if (status == eDataWrite) { + wait = true; /* only writing any data here while status = eDataWrite */ if (!slot->sendqueue.empty()) { @@ -1619,6 +1623,9 @@ FROM_FIRST: if (slot->ccmgr_ready && slot->hasCCManager && slot->scrambled && !slot->SidBlackListed) slot->ccmgrSession->resendKey(slot); } + /* slow down for hd51 to avoid high cpu load */ + if (wait && slot->init) + usleep(300000); } } diff --git a/libdvbci/descrambler.cpp b/libdvbci/descrambler.cpp index 502ef1d..2d18585 100644 --- a/libdvbci/descrambler.cpp +++ b/libdvbci/descrambler.cpp @@ -20,8 +20,6 @@ static int desc_user_count = 0; #if HAVE_ARM_HARDWARE -//static const char *descrambler_filename = "/dev/dvb/adapter0/ca0"; -//static const char *descrambler_filename = "/dev/dvb/adapter0/ca1"; static const char *descrambler_filename = "/dev/ciplus_ca0"; enum ca_descr_data_type { @@ -43,19 +41,18 @@ struct ca_descr_data { }; #define CA_SET_DESCR_DATA _IOW('o', 137, struct ca_descr_data) -//#define CA_SET_DESCR_DATA _IOW('o', 10, struct ca_descr_data) int descrambler_set_key(int index, int parity, unsigned char *data) { struct ca_descr_data d; int ret; - printf("%s -> %s %s\n", FILENAME, __FUNCTION__, descrambler_filename); + printf("%s -> %s\n", FILENAME, __FUNCTION__); if (descrambler_open()) { - printf("Complete Data-> Index: (%d) Parity: (%d) -> ", index, parity); - hexdump(data, 32); + //printf("Complete Data-> Index: (%d) Parity: (%d) -> ", index, parity); + //hexdump(data, 32); d.index = index; d.parity = (ca_descr_parity)parity; @@ -78,7 +75,7 @@ int descrambler_set_key(int index, int parity, unsigned char *data) d.length = 16; d.data = data + 16; - printf("IV Index: (%d) Parity: (%d) -> ", d.index, d.parity); + printf("IV Index: (%d) Parity: (%d) -> ", d.index, d.parity); hexdump(d.data, 16); ret = ioctl(desc_fd, CA_SET_DESCR_DATA, &d); @@ -87,7 +84,6 @@ int descrambler_set_key(int index, int parity, unsigned char *data) printf("CA_SET_DESCR_DATA (IV) index=%d parity=%d (errno=%d %s)\n", index, parity, errno, strerror(errno)); } - descrambler_close(); } return 0; } @@ -102,7 +98,7 @@ int descrambler_set_key(int index, int parity, unsigned char *data) { struct ca_descr_data d; - printf("%s -> %s %s\n", FILENAME, __FUNCTION__, descrambler_filename); + printf("%s -> %s\n", FILENAME, __FUNCTION__); index |= 0x100; @@ -125,7 +121,6 @@ int descrambler_set_key(int index, int parity, unsigned char *data) printf("Index: %d Parity: (%d) -> ", d.index, d.parity); hexdump(d.data, 32); - descrambler_close(); } return 0; } @@ -165,6 +160,8 @@ int descrambler_set_pid(int index, int enable, int pid) bool descrambler_open(void) { + if (desc_fd > 0) + return true; desc_fd = open(descrambler_filename, O_RDWR | O_NONBLOCK ); if (desc_fd <= 0) { printf("cannot open %s\n", descrambler_filename); @@ -176,6 +173,7 @@ bool descrambler_open(void) int descrambler_init(void) { desc_user_count++; + descrambler_open(); printf("%s -> %s %d\n", FILENAME, __FUNCTION__, desc_user_count); return 0; } diff --git a/libdvbci/dvbci_ccmgr.cpp b/libdvbci/dvbci_ccmgr.cpp index 3011d64..53f3658 100644 --- a/libdvbci/dvbci_ccmgr.cpp +++ b/libdvbci/dvbci_ccmgr.cpp @@ -1357,7 +1357,6 @@ void eDVBCIContentControlManagerSession::resendKey(eDVBCISlot *tslot) { for (unsigned int i = 0; i < slot->pids.size(); i++) descrambler_set_pid((int)tslot->slot, 1, (int) slot->pids[i]); - descrambler_close(); } } slot->newPids = false; @@ -1372,7 +1371,6 @@ void eDVBCIContentControlManagerSession::resendKey(eDVBCISlot *tslot) { for (unsigned int i = 0; i < slot->pids.size(); i++) descrambler_set_pid((int)tslot->slot, 1, (int) slot->pids[i]); - descrambler_close(); } } slot->newPids = false; From ca32c0635907c9b1cea625ff42cafdd4cfd78c86 Mon Sep 17 00:00:00 2001 From: max_10 Date: Sat, 6 Jan 2018 22:02:22 +0100 Subject: [PATCH 03/36] libeplayer3-arm: Code formatting Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/f72e8edc2ee6af69bcda4e5e23bb9ad95cfc4857 Author: max_10 Date: 2018-01-06 (Sat, 06 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/container.c | 5 +- libeplayer3-arm/container/container_ffmpeg.c | 14 ++--- libeplayer3-arm/include/manager.h | 4 +- libeplayer3-arm/include/writer.h | 1 + libeplayer3-arm/manager/audio.c | 11 ++-- libeplayer3-arm/manager/chapter.c | 2 +- libeplayer3-arm/manager/manager.c | 3 +- libeplayer3-arm/manager/subtitle.c | 1 + libeplayer3-arm/manager/video.c | 12 ++-- libeplayer3-arm/output/linuxdvb_mipsel.c | 58 +++++++++--------- libeplayer3-arm/output/linuxdvb_sh4.c | 59 ++++++++++--------- libeplayer3-arm/output/output.c | 12 ++-- libeplayer3-arm/output/output_subtitle.c | 9 +-- libeplayer3-arm/output/writer/mipsel/aac.c | 8 +-- libeplayer3-arm/output/writer/mipsel/ac3.c | 5 +- libeplayer3-arm/output/writer/mipsel/amr.c | 4 +- libeplayer3-arm/output/writer/mipsel/divx3.c | 8 ++- libeplayer3-arm/output/writer/mipsel/dts.c | 5 +- libeplayer3-arm/output/writer/mipsel/h263.c | 4 +- libeplayer3-arm/output/writer/mipsel/h264.c | 6 +- libeplayer3-arm/output/writer/mipsel/h265.c | 6 +- libeplayer3-arm/output/writer/mipsel/lpcm.c | 7 ++- libeplayer3-arm/output/writer/mipsel/mp3.c | 4 +- libeplayer3-arm/output/writer/mipsel/mpeg2.c | 6 +- libeplayer3-arm/output/writer/mipsel/mpeg4.c | 6 +- libeplayer3-arm/output/writer/mipsel/pcm.c | 8 ++- libeplayer3-arm/output/writer/mipsel/vc1.c | 16 ++--- libeplayer3-arm/output/writer/mipsel/vp.c | 11 ++-- libeplayer3-arm/output/writer/mipsel/wma.c | 6 +- libeplayer3-arm/output/writer/mipsel/wmv.c | 5 +- libeplayer3-arm/output/writer/mipsel/writer.c | 4 +- libeplayer3-arm/output/writer/sh4/aac.c | 6 +- libeplayer3-arm/output/writer/sh4/ac3.c | 4 +- libeplayer3-arm/output/writer/sh4/divx.c | 6 +- libeplayer3-arm/output/writer/sh4/divx2.c | 6 +- libeplayer3-arm/output/writer/sh4/dts.c | 6 +- libeplayer3-arm/output/writer/sh4/h263.c | 6 +- libeplayer3-arm/output/writer/sh4/h264.c | 6 +- libeplayer3-arm/output/writer/sh4/mp3.c | 7 ++- libeplayer3-arm/output/writer/sh4/mpeg2.c | 7 ++- libeplayer3-arm/output/writer/sh4/pcm.c | 5 +- libeplayer3-arm/output/writer/sh4/pes.c | 2 +- libeplayer3-arm/output/writer/sh4/vc1.c | 8 ++- libeplayer3-arm/output/writer/sh4/vorbis.c | 9 ++- libeplayer3-arm/output/writer/sh4/wma.c | 6 +- libeplayer3-arm/output/writer/sh4/wmv.c | 6 +- libeplayer3-arm/output/writer/sh4/writer.c | 4 +- libeplayer3-arm/playback/playback.c | 36 +++++------ 48 files changed, 249 insertions(+), 191 deletions(-) diff --git a/libeplayer3-arm/container/container.c b/libeplayer3-arm/container/container.c index af5e50b..a36e40b 100644 --- a/libeplayer3-arm/container/container.c +++ b/libeplayer3-arm/container/container.c @@ -35,7 +35,7 @@ static short debug_level = 0; #define container_printf(level, x...) do { \ - if (debug_level >= level) printf(x); } while (0) +if (debug_level >= level) printf(x); } while (0) #else #define container_printf(level, x...) #endif @@ -98,11 +98,12 @@ static int32_t selectContainer(Context_t *context, char *extension) return ret; } -static int Command(void *_context, ContainerCmd_t command, void *argument) +static int Command(void *_context, ContainerCmd_t command, void *argument) { Context_t *context = (Context_t *) _context; int ret = 0; container_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); + switch (command) { case CONTAINER_ADD: diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index f844d8e..1433e4f 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include #include #include @@ -84,7 +84,7 @@ static short debug_level = 1; #define ffmpeg_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define ffmpeg_printf(level, fmt, x...) #endif @@ -115,7 +115,7 @@ static short debug_level = 1; typedef enum {RTMP_NATIVE, RTMP_LIBRTMP, RTMP_NONE} eRTMPProtoImplType; /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static pthread_mutex_t mutex; @@ -438,8 +438,8 @@ static char *Codec2Encoding(int32_t codec_id, int32_t media_type, uint8_t *extra case AV_CODEC_ID_MOV_TEXT: case AV_CODEC_ID_HDMV_PGS_SUBTITLE: case AV_CODEC_ID_DVB_TELETEXT: -// case CODEC_ID_DVB_TELETEXT: -// return "S_TEXT/SRT"; /* fixme */ +// case CODEC_ID_DVB_TELETEXT: +// return "S_TEXT/SRT"; /* fixme */ case AV_CODEC_ID_TEXT: ///< raw UTF-8 text return "S_TEXT/UTF-8"; case AV_CODEC_ID_SRT: @@ -2644,9 +2644,9 @@ 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(void *_context, ContainerCmd_t command, void *argument) { - Context_t *context = (Context_t *) _context; + 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/manager.h b/libeplayer3-arm/include/manager.h index 5609fa4..dd33492 100644 --- a/libeplayer3-arm/include/manager.h +++ b/libeplayer3-arm/include/manager.h @@ -34,8 +34,8 @@ typedef struct Track_s int32_t AVIdx; /* new field for ffmpeg - add at the end so no problem - * can occur with not changed srt saa container - */ + * can occur with not changed srt saa container + */ char *language; /* length of track */ diff --git a/libeplayer3-arm/include/writer.h b/libeplayer3-arm/include/writer.h index ad667e8..b50c158 100644 --- a/libeplayer3-arm/include/writer.h +++ b/libeplayer3-arm/include/writer.h @@ -86,4 +86,5 @@ Writer_t *getDefaultVideoWriter(); Writer_t *getDefaultAudioWriter(); 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); + #endif diff --git a/libeplayer3-arm/manager/audio.c b/libeplayer3-arm/manager/audio.c index c3676af..fc7603e 100644 --- a/libeplayer3-arm/manager/audio.c +++ b/libeplayer3-arm/manager/audio.c @@ -31,6 +31,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #define TRACKWRAP 20 //#define SAM_WITH_DEBUG @@ -45,7 +46,7 @@ static short debug_level = 40; #define audio_mgr_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] \n" fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] \n" fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define audio_mgr_printf(level, x...) #endif @@ -67,7 +68,7 @@ static const char FILENAME[] = __FILE__; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static Track_t *Tracks = NULL; @@ -82,7 +83,7 @@ static int CurrentTrack = 0; //TRACK[0] as default. /* Functions */ /* ***************************** */ -static int ManagerAdd(Context_t *context, Track_t track) +static int ManagerAdd(Context_t *context, Track_t track) { audio_mgr_printf(10, "%s::%s name=\"%s\" encoding=\"%s\" id=%d\n", FILENAME, __FUNCTION__, track.Name, track.Encoding, track.Id); if (Tracks == NULL) @@ -213,9 +214,9 @@ 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(void *_context, ManagerCmd_t command, void *argument) { - Context_t *context = (Context_t *) _context; + Context_t *context = (Context_t *) _context; int ret = cERR_AUDIO_MGR_NO_ERROR; audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); switch (command) diff --git a/libeplayer3-arm/manager/chapter.c b/libeplayer3-arm/manager/chapter.c index 3bf39ae..c09a0f2 100644 --- a/libeplayer3-arm/manager/chapter.c +++ b/libeplayer3-arm/manager/chapter.c @@ -61,7 +61,7 @@ static const char FILENAME[] = __FILE__; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static Track_t *Tracks = NULL; diff --git a/libeplayer3-arm/manager/manager.c b/libeplayer3-arm/manager/manager.c index 20ed602..7ad53e8 100644 --- a/libeplayer3-arm/manager/manager.c +++ b/libeplayer3-arm/manager/manager.c @@ -34,7 +34,7 @@ /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ extern Manager_t AudioManager; @@ -58,6 +58,7 @@ ManagerHandler_t ManagerHandler = /* ***************************** */ /* Functions */ /* ***************************** */ + void copyTrack(Track_t *to, Track_t *from) { if (NULL != to && NULL != from) diff --git a/libeplayer3-arm/manager/subtitle.c b/libeplayer3-arm/manager/subtitle.c index d6d7892..1d219f2 100644 --- a/libeplayer3-arm/manager/subtitle.c +++ b/libeplayer3-arm/manager/subtitle.c @@ -30,6 +30,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #define TRACKWRAP 20 //#define SAM_WITH_DEBUG diff --git a/libeplayer3-arm/manager/video.c b/libeplayer3-arm/manager/video.c index c84587c..ee5ef5f 100644 --- a/libeplayer3-arm/manager/video.c +++ b/libeplayer3-arm/manager/video.c @@ -30,6 +30,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #define TRACKWRAP 4 #ifdef SAM_WITH_DEBUG @@ -43,7 +44,7 @@ static short debug_level = 0; #define video_mgr_printf(level, x...) do { \ - if (debug_level >= level) printf(x); } while (0) +if (debug_level >= level) printf(x); } while (0) #else #define video_mgr_printf(level, x...) #endif @@ -65,7 +66,7 @@ static const char FILENAME[] = __FILE__; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static Track_t *Tracks = NULL; @@ -73,6 +74,7 @@ static int TrackCount = 0; static int CurrentTrack = 0; //TRACK[0] as default. static void (* updatedTrackInfoFnc)(void) = NULL; + /* ***************************** */ /* Prototypes */ /* ***************************** */ @@ -81,7 +83,7 @@ static void (* updatedTrackInfoFnc)(void) = NULL; /* Functions */ /* ***************************** */ -static int ManagerAdd(Context_t *context, Track_t track) +static int ManagerAdd(Context_t *context, Track_t track) { video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); if (Tracks == NULL) @@ -125,7 +127,7 @@ static int ManagerAdd(Context_t *context, Track_t track) return cERR_VIDEO_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; @@ -181,7 +183,7 @@ 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(void *_context, ManagerCmd_t command, void *argument) { Context_t *context = (Context_t *) _context; int ret = cERR_VIDEO_MGR_NO_ERROR; diff --git a/libeplayer3-arm/output/linuxdvb_mipsel.c b/libeplayer3-arm/output/linuxdvb_mipsel.c index 211ada5..1b34572 100644 --- a/libeplayer3-arm/output/linuxdvb_mipsel.c +++ b/libeplayer3-arm/output/linuxdvb_mipsel.c @@ -48,6 +48,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + // SULGE DEBUG //#define SAM_WITH_DEBUG @@ -63,7 +64,7 @@ static const char FILENAME[] = __FILE__; #ifdef LINUXDVB_DEBUG #define linuxdvb_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0) #else #define linuxdvb_printf(level, fmt, x...) #endif @@ -77,11 +78,11 @@ static const char FILENAME[] = __FILE__; #define cERR_LINUXDVB_NO_ERROR 0 #define cERR_LINUXDVB_ERROR -1 -static const char VIDEODEV[] = "/dev/dvb/adapter0/video0"; -static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0"; +static const char VIDEODEV[] = "/dev/dvb/adapter0/video0"; +static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0"; -static int videofd = -1; -static int audiofd = -1; +static int videofd = -1; +static int audiofd = -1; struct DVBApiVideoInfo_s { @@ -99,10 +100,11 @@ pthread_mutex_t LinuxDVBmutex; /* ***************************** */ /* Prototypes */ /* ***************************** */ -int LinuxDvbStop(Context_t *context, char *type); + +int LinuxDvbStop(Context_t *context, char *type); /* ***************************** */ -/* MISC Functions */ +/* Functions */ /* ***************************** */ void getLinuxDVBMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused))) @@ -127,7 +129,7 @@ static int LinuxDvbMapBypassMode(int bypass) return bypass; } -int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type) { unsigned char video = !strcmp("video", type); unsigned char audio = !strcmp("audio", type); @@ -185,7 +187,7 @@ int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type) return cERR_LINUXDVB_NO_ERROR; } -int LinuxDvbClose(Context_t *context, char *type) +int LinuxDvbClose(Context_t *context, char *type) { unsigned char video = !strcmp("video", type); unsigned char audio = !strcmp("audio", type); @@ -210,7 +212,7 @@ int LinuxDvbClose(Context_t *context, char *type) return cERR_LINUXDVB_NO_ERROR; } -int LinuxDvbPlay(Context_t *context, char *type) +int LinuxDvbPlay(Context_t *context, char *type) { int ret = cERR_LINUXDVB_NO_ERROR; Writer_t *writer; @@ -313,7 +315,7 @@ int LinuxDvbPlay(Context_t *context, char *type) return 0; } -int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -362,7 +364,7 @@ int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type) return ret; } -int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -391,7 +393,7 @@ int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type) return ret; } -int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -419,7 +421,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) { int ret = cERR_LINUXDVB_NO_ERROR; // int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus; @@ -433,7 +435,7 @@ int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), in return ret; } -int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag) +int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag) { int ret = cERR_LINUXDVB_NO_ERROR; linuxdvb_printf(10, "\n"); @@ -468,7 +470,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) { // unsigned char video = !strcmp("video", type); // unsigned char audio = !strcmp("audio", type); @@ -496,7 +498,7 @@ int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type) } #ifndef use_set_speed_instead_ff -int LinuxDvbFastForward(Context_t *context, char *type) +int LinuxDvbFastForward(Context_t *context, char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -527,7 +529,7 @@ static unsigned int SpeedList[] = 125, 250, 500, 700, 800, 900 }; -int LinuxDvbFastForward(Context_t *context, char *type) +int LinuxDvbFastForward(Context_t *context, char *type) { int ret = cERR_LINUXDVB_NO_ERROR; int speedIndex; @@ -565,13 +567,13 @@ int LinuxDvbFastForward(Context_t *context, char *type) } #endif -int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused))) +int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused))) { int ret = cERR_LINUXDVB_NO_ERROR; return ret; } -int LinuxDvbSlowMotion(Context_t *context, char *type) +int LinuxDvbSlowMotion(Context_t *context, char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -595,7 +597,7 @@ int LinuxDvbSlowMotion(Context_t *context, char *type) return ret; } -int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused))) +int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused))) { int ret = cERR_LINUXDVB_NO_ERROR; /* konfetti: this one is dedicated to audiofd so we @@ -618,7 +620,7 @@ int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused))) return ret; } -int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type) { int32_t ret = cERR_LINUXDVB_NO_ERROR; uint8_t video = !strcmp("video", type); @@ -651,7 +653,7 @@ int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type) return ret; } -int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts) +int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts) { int ret = cERR_LINUXDVB_ERROR; linuxdvb_printf(50, "\n"); @@ -691,7 +693,7 @@ int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned return ret; } -int LinuxDvbSwitch(Context_t *context, char *type) +int LinuxDvbSwitch(Context_t *context, char *type) { unsigned char audio = !strcmp("audio", type); unsigned char video = !strcmp("video", type); @@ -801,7 +803,7 @@ int LinuxDvbSwitch(Context_t *context, char *type) return cERR_LINUXDVB_NO_ERROR; } -static int Write(void *_context, void *_out) +static int Write(void *_context, void *_out) { Context_t *context = (Context_t *) _context; AudioVideoOut_t *out = (AudioVideoOut_t *) _out; @@ -953,10 +955,10 @@ static int Write(void *_context, void *_out) return ret; } -static int reset(Context_t *context) +static int reset(Context_t *context) { int ret = cERR_LINUXDVB_NO_ERROR; - Writer_t *writer; + Writer_t *writer; char *Encoding = NULL; context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); writer = getWriter(Encoding); @@ -985,7 +987,7 @@ static int reset(Context_t *context) return ret; } -static int Command(void *_context, OutputCmd_t command, void *argument) +static int Command(void *_context, OutputCmd_t command, void *argument) { Context_t *context = (Context_t *) _context; int ret = cERR_LINUXDVB_NO_ERROR; diff --git a/libeplayer3-arm/output/linuxdvb_sh4.c b/libeplayer3-arm/output/linuxdvb_sh4.c index 7cfba72..0b5c4f7 100644 --- a/libeplayer3-arm/output/linuxdvb_sh4.c +++ b/libeplayer3-arm/output/linuxdvb_sh4.c @@ -59,7 +59,7 @@ static const char FILENAME[] = __FILE__; #ifdef LINUXDVB_DEBUG #define linuxdvb_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0) #else #define linuxdvb_printf(x...) #endif @@ -73,11 +73,11 @@ static const char FILENAME[] = __FILE__; #define cERR_LINUXDVB_NO_ERROR 0 #define cERR_LINUXDVB_ERROR -1 -static const char VIDEODEV[] = "/dev/dvb/adapter0/video0"; -static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0"; +static const char VIDEODEV[] = "/dev/dvb/adapter0/video0"; +static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0"; -static int videofd = -1; -static int audiofd = -1; +static int videofd = -1; +static int audiofd = -1; struct DVBApiVideoInfo_s { @@ -95,10 +95,11 @@ pthread_mutex_t LinuxDVBmutex; /* ***************************** */ /* Prototypes */ /* ***************************** */ -int LinuxDvbStop(Context_t *context, char *type); + +int LinuxDvbStop(Context_t *context, char *type); /* ***************************** */ -/* MISC Functions */ +/* Functions */ /* ***************************** */ void getLinuxDVBMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused))) @@ -114,7 +115,7 @@ void releaseLinuxDVBMutex(const char *filename __attribute__((unused)), const ch linuxdvb_printf(250, "released mutex\n"); } -int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type) { unsigned char video = !strcmp("video", type); unsigned char audio = !strcmp("audio", type); @@ -179,7 +180,7 @@ int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type) return cERR_LINUXDVB_NO_ERROR; } -int LinuxDvbClose(Context_t *context, char *type) +int LinuxDvbClose(Context_t *context, char *type) { unsigned char video = !strcmp("video", type); unsigned char audio = !strcmp("audio", type); @@ -204,7 +205,7 @@ int LinuxDvbClose(Context_t *context, char *type) return cERR_LINUXDVB_NO_ERROR; } -int LinuxDvbPlay(Context_t *context, char *type) +int LinuxDvbPlay(Context_t *context, char *type) { int ret = cERR_LINUXDVB_NO_ERROR; Writer_t *writer; @@ -282,7 +283,7 @@ int LinuxDvbPlay(Context_t *context, char *type) return ret; } -int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -333,7 +334,7 @@ int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type) return ret; } -int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -362,7 +363,7 @@ int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type) return ret; } -int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -390,7 +391,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) { int ret = cERR_LINUXDVB_NO_ERROR; int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus; @@ -404,7 +405,7 @@ int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), in return ret; } -int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag) +int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag) { int ret = cERR_LINUXDVB_NO_ERROR; linuxdvb_printf(10, "\n"); @@ -439,7 +440,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) { unsigned char video = !strcmp("video", type); unsigned char audio = !strcmp("audio", type); @@ -470,7 +471,7 @@ int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type) } #ifndef use_set_speed_instead_ff -int LinuxDvbFastForward(Context_t *context, char *type) +int LinuxDvbFastForward(Context_t *context, char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -501,7 +502,7 @@ static unsigned int SpeedList[] = 125, 250, 500, 700, 800, 900 }; -int LinuxDvbFastForward(Context_t *context, char *type) +int LinuxDvbFastForward(Context_t *context, char *type) { int ret = cERR_LINUXDVB_NO_ERROR; int speedIndex; @@ -539,13 +540,13 @@ int LinuxDvbFastForward(Context_t *context, char *type) } #endif -int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused))) +int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused))) { int ret = cERR_LINUXDVB_NO_ERROR; return ret; } -int LinuxDvbSlowMotion(Context_t *context, char *type) +int LinuxDvbSlowMotion(Context_t *context, char *type) { int ret = cERR_LINUXDVB_NO_ERROR; unsigned char video = !strcmp("video", type); @@ -569,7 +570,7 @@ int LinuxDvbSlowMotion(Context_t *context, char *type) return ret; } -int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused))) +int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused))) { int ret = cERR_LINUXDVB_NO_ERROR; /* konfetti: this one is dedicated to audiofd so we @@ -592,7 +593,7 @@ int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused))) return ret; } -int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type) +int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type) { int32_t ret = cERR_LINUXDVB_NO_ERROR; uint8_t video = !strcmp("video", type); @@ -625,7 +626,7 @@ int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type) return ret; } -int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts) +int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts) { int ret = cERR_LINUXDVB_ERROR; linuxdvb_printf(50, "\n"); @@ -659,7 +660,7 @@ int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long 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) { int ret = cERR_LINUXDVB_NO_ERROR; dvb_play_info_t playInfo; @@ -695,7 +696,7 @@ int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned return ret; } -int LinuxDvbSwitch(Context_t *context, char *type) +int LinuxDvbSwitch(Context_t *context, char *type) { unsigned char audio = !strcmp("audio", type); unsigned char video = !strcmp("video", type); @@ -805,7 +806,7 @@ int LinuxDvbSwitch(Context_t *context, char *type) return cERR_LINUXDVB_NO_ERROR; } -static int Write(void *_context, void *_out) +static int Write(void *_context, void *_out) { Context_t *context = (Context_t *) _context; AudioVideoOut_t *out = (AudioVideoOut_t *) _out; @@ -957,10 +958,10 @@ static int Write(void *_context, void *_out) return ret; } -static int reset(Context_t *context) +static int reset(Context_t *context) { int ret = cERR_LINUXDVB_NO_ERROR; - Writer_t *writer; + Writer_t *writer; char *Encoding = NULL; context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); writer = getWriter(Encoding); @@ -989,7 +990,7 @@ static int reset(Context_t *context) return ret; } -static int Command(void *_context, OutputCmd_t command, void *argument) +static int Command(void *_context, OutputCmd_t command, void *argument) { Context_t *context = (Context_t *) _context; int ret = cERR_LINUXDVB_NO_ERROR; diff --git a/libeplayer3-arm/output/output.c b/libeplayer3-arm/output/output.c index 493435d..47ef2e2 100644 --- a/libeplayer3-arm/output/output.c +++ b/libeplayer3-arm/output/output.c @@ -42,7 +42,7 @@ static short debug_level = 0; #define output_printf(level, x...) do { \ - if (debug_level >= level) fprintf(stderr, x); } while (0) +if (debug_level >= level) fprintf(stderr, x); } while (0) #else #define output_printf(level, x...) #endif @@ -64,7 +64,7 @@ static const char *FILENAME = "output.c"; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static Output_t *AvailableOutput[] = @@ -79,7 +79,7 @@ static Output_t *AvailableOutput[] = /* ***************************** */ /* ***************************** */ -/* MISC Functions */ +/* Functions */ /* ***************************** */ static void printOutputCapabilities() @@ -102,7 +102,7 @@ static void printOutputCapabilities() /* Output Functions */ /* ***************************** */ -static void OutputAdd(Context_t *context, char *port) +static void OutputAdd(Context_t *context, char *port) { int i, j; output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); @@ -132,7 +132,7 @@ static void OutputAdd(Context_t *context, char *port) } } -static void OutputDel(Context_t *context, char *port) +static void OutputDel(Context_t *context, char *port) { output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); if (!strcmp("audio", port)) @@ -149,7 +149,7 @@ static void OutputDel(Context_t *context, char *port) } } -static int Command(void *_context, OutputCmd_t command, void *argument) +static int Command(void *_context, OutputCmd_t command, void *argument) { Context_t *context = (Context_t *) _context; int ret = cERR_OUTPUT_NO_ERROR; diff --git a/libeplayer3-arm/output/output_subtitle.c b/libeplayer3-arm/output/output_subtitle.c index bbe626f..607bb4b 100644 --- a/libeplayer3-arm/output/output_subtitle.c +++ b/libeplayer3-arm/output/output_subtitle.c @@ -53,7 +53,7 @@ static short debug_level = 0; #define subtitle_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define subtitle_printf(level, fmt, x...) #endif @@ -85,7 +85,7 @@ Number, Style, Name,, MarginL, MarginR, MarginV, Effect,, Text /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static pthread_mutex_t mutex; @@ -96,8 +96,9 @@ static int isSubtitleOpened = 0; /* ***************************** */ /* ***************************** */ -/* MISC Functions */ +/* Functions */ /* ***************************** */ + static void getMutex(int line) { subtitle_printf(100, "%d requesting mutex\n", line); @@ -258,7 +259,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) { 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 93a14fd..e6d0fd3 100644 --- a/libeplayer3-arm/output/writer/mipsel/aac.c +++ b/libeplayer3-arm/output/writer/mipsel/aac.c @@ -70,7 +70,7 @@ static short debug_level = 0; #define aac_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define aac_printf(level, fmt, x...) #endif @@ -86,7 +86,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /// ** AAC ADTS format ** @@ -125,7 +125,7 @@ ADTS = streaming format called Audio Data Transport Stream (ADTS) LOAS = Low Overhead Audio Stream (LOAS), a self-synchronizing streaming format */ -static unsigned char DefaultAACHeader[] = +static unsigned char DefaultAACHeader[] = { 0xff, 0xf1, @@ -143,7 +143,7 @@ LATMContext *pLATMCtx = NULL; /* ***************************** */ /* ***************************** */ -/* MISC Functions */ +/* Functions */ /* ***************************** */ static int reset() diff --git a/libeplayer3-arm/output/writer/mipsel/ac3.c b/libeplayer3-arm/output/writer/mipsel/ac3.c index 802f320..fb1c87e 100644 --- a/libeplayer3-arm/output/writer/mipsel/ac3.c +++ b/libeplayer3-arm/output/writer/mipsel/ac3.c @@ -61,7 +61,7 @@ static short debug_level = 0; #define ac3_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define ac3_printf(level, fmt, x...) #endif @@ -77,8 +77,9 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + unsigned char AC3_SYNC_HEADER[] = {0x80, 0x01, 0x00, 0x01}; /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/mipsel/amr.c b/libeplayer3-arm/output/writer/mipsel/amr.c index 0847ecd..c94dead 100644 --- a/libeplayer3-arm/output/writer/mipsel/amr.c +++ b/libeplayer3-arm/output/writer/mipsel/amr.c @@ -64,7 +64,7 @@ static short debug_level = 0; #define amr_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define amr_printf(level, fmt, x...) #endif @@ -80,7 +80,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/mipsel/divx3.c b/libeplayer3-arm/output/writer/mipsel/divx3.c index 349f4bc..cef568d 100644 --- a/libeplayer3-arm/output/writer/mipsel/divx3.c +++ b/libeplayer3-arm/output/writer/mipsel/divx3.c @@ -52,6 +52,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #define B_GET_BITS(w,e,b) (((w)>>(b))&(((unsigned)(-1))>>((sizeof(unsigned))*8-(e+1-b)))) #define B_SET_BITS(name,v,e,b) (((unsigned)(v))<<(b)) @@ -66,7 +67,7 @@ static short debug_level = 0; #define divx_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define divx_printf(level, fmt, x...) #endif @@ -82,8 +83,9 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static uint8_t initialHeader = 1; static uint8_t brcm_divx311_sequence_header[] = { @@ -115,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 int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE; + 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 f001441..06f0efb 100644 --- a/libeplayer3-arm/output/writer/mipsel/dts.c +++ b/libeplayer3-arm/output/writer/mipsel/dts.c @@ -68,7 +68,7 @@ static int16_t debug_level = 0; #define dts_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define dts_printf(level, fmt, x...) #endif @@ -84,7 +84,7 @@ static int16_t debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ @@ -94,6 +94,7 @@ static int16_t debug_level = 0; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int32_t reset() { return 0; diff --git a/libeplayer3-arm/output/writer/mipsel/h263.c b/libeplayer3-arm/output/writer/mipsel/h263.c index bca9f9b..259d77e 100644 --- a/libeplayer3-arm/output/writer/mipsel/h263.c +++ b/libeplayer3-arm/output/writer/mipsel/h263.c @@ -59,7 +59,7 @@ static short debug_level = 0; #define h263_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define h263_printf(level, fmt, x...) #endif @@ -74,7 +74,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/mipsel/h264.c b/libeplayer3-arm/output/writer/mipsel/h264.c index a01cba1..36cf343 100644 --- a/libeplayer3-arm/output/writer/mipsel/h264.c +++ b/libeplayer3-arm/output/writer/mipsel/h264.c @@ -61,7 +61,7 @@ static short debug_level = 0; #define h264_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define h264_printf(level, fmt, x...) #endif @@ -79,14 +79,16 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static unsigned char Head[] = {0, 0, 0, 1}; static int initialHeader = 1; static unsigned int NalLengthBytes = 1; static unsigned char *CodecData = NULL; static unsigned int CodecDataLen = 0; static int avc3 = 0; + /* ***************************** */ /* Prototypes */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/mipsel/h265.c b/libeplayer3-arm/output/writer/mipsel/h265.c index d34405f..32190e4 100644 --- a/libeplayer3-arm/output/writer/mipsel/h265.c +++ b/libeplayer3-arm/output/writer/mipsel/h265.c @@ -61,7 +61,7 @@ static short debug_level = 10; #define h264_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define h264_printf(level, fmt, x...) #endif @@ -79,13 +79,15 @@ static short debug_level = 10; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static unsigned char Head[] = {0, 0, 0, 1}; static int initialHeader = 1; static unsigned int NalLengthBytes = 1; static unsigned char *CodecData = NULL; static unsigned int CodecDataLen = 0; + /* ***************************** */ /* Prototypes */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/mipsel/lpcm.c b/libeplayer3-arm/output/writer/mipsel/lpcm.c index 2fc6cec..a0ef5ee 100644 --- a/libeplayer3-arm/output/writer/mipsel/lpcm.c +++ b/libeplayer3-arm/output/writer/mipsel/lpcm.c @@ -57,7 +57,9 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + //#define SAM_WITH_DEBUG + #ifdef SAM_WITH_DEBUG #define LPCM_DEBUG #else @@ -69,7 +71,7 @@ static uint16_t debug_level = 1; #define lpcm_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define lpcm_printf(level, fmt, x...) #endif @@ -87,8 +89,9 @@ static uint16_t debug_level = 1; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static uint8_t PesHeader[PES_MAX_HEADER_SIZE]; static uint8_t initialHeader = 1; diff --git a/libeplayer3-arm/output/writer/mipsel/mp3.c b/libeplayer3-arm/output/writer/mipsel/mp3.c index 5b712bc..ee8a83a 100644 --- a/libeplayer3-arm/output/writer/mipsel/mp3.c +++ b/libeplayer3-arm/output/writer/mipsel/mp3.c @@ -59,7 +59,7 @@ static short debug_level = 0; #define mp3_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define mp3_printf(level, fmt, x...) #endif @@ -75,7 +75,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/mipsel/mpeg2.c b/libeplayer3-arm/output/writer/mipsel/mpeg2.c index 26706a0..9ccce6d 100644 --- a/libeplayer3-arm/output/writer/mipsel/mpeg2.c +++ b/libeplayer3-arm/output/writer/mipsel/mpeg2.c @@ -60,7 +60,7 @@ static short debug_level = 0; #define mpeg2_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define mpeg2_printf(level, fmt, x...) #endif @@ -76,7 +76,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ @@ -118,7 +118,7 @@ static int writeData(void *_call) while (Position < call->len) { int PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ? - (call->len - Position) : MAX_PES_PACKET_SIZE; + (call->len - Position) : MAX_PES_PACKET_SIZE; int Remaining = call->len - Position - PacketLength; mpeg2_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position); struct iovec iov[2]; diff --git a/libeplayer3-arm/output/writer/mipsel/mpeg4.c b/libeplayer3-arm/output/writer/mipsel/mpeg4.c index f5fcc13..9d9d8e4 100644 --- a/libeplayer3-arm/output/writer/mipsel/mpeg4.c +++ b/libeplayer3-arm/output/writer/mipsel/mpeg4.c @@ -65,7 +65,7 @@ static short debug_level = 0; #define mpeg4_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define mpeg4_printf(level, fmt, x...) #endif @@ -81,8 +81,9 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static int initialHeader = 1; /* ***************************** */ @@ -92,6 +93,7 @@ static int initialHeader = 1; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { initialHeader = 1; diff --git a/libeplayer3-arm/output/writer/mipsel/pcm.c b/libeplayer3-arm/output/writer/mipsel/pcm.c index 73c8359..524cf29 100644 --- a/libeplayer3-arm/output/writer/mipsel/pcm.c +++ b/libeplayer3-arm/output/writer/mipsel/pcm.c @@ -55,6 +55,9 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + +//#define SAM_WITH_DEBUG + #ifdef SAM_WITH_DEBUG #define PCM_DEBUG #else @@ -66,7 +69,7 @@ static uint16_t debug_level = 0; #define pcm_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define pcm_printf(level, fmt, x...) #endif @@ -82,8 +85,9 @@ static uint16_t debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static uint8_t initialHeader = 1; static uint8_t codec_data[18]; static uint64_t fixed_buffertimestamp; diff --git a/libeplayer3-arm/output/writer/mipsel/vc1.c b/libeplayer3-arm/output/writer/mipsel/vc1.c index 33eeab8..f469c21 100644 --- a/libeplayer3-arm/output/writer/mipsel/vc1.c +++ b/libeplayer3-arm/output/writer/mipsel/vc1.c @@ -20,7 +20,7 @@ */ /* ***************************** */ -/* Includes */ +/* Includes */ /* ***************************** */ #include @@ -50,9 +50,10 @@ #include "writer.h" /* ***************************** */ -/* Makros/Constants */ +/* Makros/Constants */ /* ***************************** */ -#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80 + +#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80 #define VC1_FRAME_START_CODE 0x0d #define SAM_WITH_DEBUG @@ -67,7 +68,7 @@ static short debug_level = 10; #define vc1_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define vc1_printf(level, fmt, x...) #endif @@ -82,12 +83,13 @@ static short debug_level = 10; /* Types */ /* ***************************** */ -static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE}; -static const uint8_t Vc1FrameStartCode[] = {0, 0, 1, VC1_FRAME_START_CODE}; +static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE}; +static const uint8_t Vc1FrameStartCode[] = {0, 0, 1, VC1_FRAME_START_CODE}; /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static int initialHeader = 1; static video_codec_data_t videocodecdata = {0, 0}; diff --git a/libeplayer3-arm/output/writer/mipsel/vp.c b/libeplayer3-arm/output/writer/mipsel/vp.c index 3a4533b..d315358 100644 --- a/libeplayer3-arm/output/writer/mipsel/vp.c +++ b/libeplayer3-arm/output/writer/mipsel/vp.c @@ -20,7 +20,7 @@ */ /* ***************************** */ -/* Includes */ +/* Includes */ /* ***************************** */ #include @@ -50,9 +50,11 @@ #include "writer.h" /* ***************************** */ -/* Makros/Constants */ +/* Makros/Constants */ /* ***************************** */ + //#define SAM_WITH_DEBUG + #ifdef SAM_WITH_DEBUG #define VP_DEBUG #else @@ -64,7 +66,7 @@ static short debug_level = 10; #define vp_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define vp_printf(level, fmt, x...) #endif @@ -80,7 +82,7 @@ static short debug_level = 10; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ @@ -90,6 +92,7 @@ static short debug_level = 10; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { return 0; diff --git a/libeplayer3-arm/output/writer/mipsel/wma.c b/libeplayer3-arm/output/writer/mipsel/wma.c index 1c43ee0..c82acef 100644 --- a/libeplayer3-arm/output/writer/mipsel/wma.c +++ b/libeplayer3-arm/output/writer/mipsel/wma.c @@ -53,6 +53,8 @@ /* Makros/Constants */ /* ***************************** */ +//#define SAM_WITH_DEBUG + #ifdef SAM_WITH_DEBUG #define WMA_DEBUG #else @@ -64,7 +66,7 @@ static short debug_level = 0; #define wma_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define wma_printf(level, fmt, x...) #endif @@ -80,7 +82,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static int initialHeader = 1; diff --git a/libeplayer3-arm/output/writer/mipsel/wmv.c b/libeplayer3-arm/output/writer/mipsel/wmv.c index 6cf8da1..7658bce 100644 --- a/libeplayer3-arm/output/writer/mipsel/wmv.c +++ b/libeplayer3-arm/output/writer/mipsel/wmv.c @@ -67,7 +67,7 @@ static short debug_level = 10; #define wmv_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define wmv_printf(level, fmt, x...) #endif @@ -85,8 +85,9 @@ static short debug_level = 10; static const uint8_t Vc1FrameStartCode[] = {0, 0, 1, WMV_FRAME_START_CODE}; /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static int initialHeader = 1; static video_codec_data_t videocodecdata = {0, 0}; diff --git a/libeplayer3-arm/output/writer/mipsel/writer.c b/libeplayer3-arm/output/writer/mipsel/writer.c index de99006..ae0d2f4 100644 --- a/libeplayer3-arm/output/writer/mipsel/writer.c +++ b/libeplayer3-arm/output/writer/mipsel/writer.c @@ -41,7 +41,7 @@ static short debug_level = 0; #define writer_printf(level, x...) do { \ - if (debug_level >= level) printf(x); } while (0) +if (debug_level >= level) printf(x); } while (0) #else #define writer_printf(level, x...) #endif @@ -57,7 +57,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static Writer_t *AvailableWriter[] = diff --git a/libeplayer3-arm/output/writer/sh4/aac.c b/libeplayer3-arm/output/writer/sh4/aac.c index 8617e74..a7aded4 100644 --- a/libeplayer3-arm/output/writer/sh4/aac.c +++ b/libeplayer3-arm/output/writer/sh4/aac.c @@ -68,7 +68,7 @@ static short debug_level = 0; #define aac_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define aac_printf(level, fmt, x...) #endif @@ -84,7 +84,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /// ** AAC ADTS format ** @@ -123,7 +123,7 @@ ADTS = streaming format called Audio Data Transport Stream (ADTS) LOAS = Low Overhead Audio Stream (LOAS), a self-synchronizing streaming format */ -static unsigned char DefaultAACHeader[] = +static unsigned char DefaultAACHeader[] = { 0xff, 0xf1, diff --git a/libeplayer3-arm/output/writer/sh4/ac3.c b/libeplayer3-arm/output/writer/sh4/ac3.c index 6214b65..cf50f6b 100644 --- a/libeplayer3-arm/output/writer/sh4/ac3.c +++ b/libeplayer3-arm/output/writer/sh4/ac3.c @@ -63,7 +63,7 @@ static short debug_level = 0; #define ac3_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define ac3_printf(level, fmt, x...) #endif @@ -79,7 +79,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/sh4/divx.c b/libeplayer3-arm/output/writer/sh4/divx.c index f0c2013..904b7af 100644 --- a/libeplayer3-arm/output/writer/sh4/divx.c +++ b/libeplayer3-arm/output/writer/sh4/divx.c @@ -62,7 +62,7 @@ static short debug_level = 0; #define divx_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define divx_printf(level, fmt, x...) #endif @@ -78,8 +78,9 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static int initialHeader = 1; /* ***************************** */ @@ -89,6 +90,7 @@ static int initialHeader = 1; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { initialHeader = 1; diff --git a/libeplayer3-arm/output/writer/sh4/divx2.c b/libeplayer3-arm/output/writer/sh4/divx2.c index c928058..a658416 100644 --- a/libeplayer3-arm/output/writer/sh4/divx2.c +++ b/libeplayer3-arm/output/writer/sh4/divx2.c @@ -62,7 +62,7 @@ static short debug_level = 0; #define divx_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define divx_printf(level, fmt, x...) #endif @@ -78,8 +78,9 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static int initialHeader = 1; /* ***************************** */ @@ -89,6 +90,7 @@ static int initialHeader = 1; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { initialHeader = 1; diff --git a/libeplayer3-arm/output/writer/sh4/dts.c b/libeplayer3-arm/output/writer/sh4/dts.c index 64b5862..25bd117 100644 --- a/libeplayer3-arm/output/writer/sh4/dts.c +++ b/libeplayer3-arm/output/writer/sh4/dts.c @@ -50,6 +50,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #define PES_AUDIO_PRIVATE_HEADER_SIZE 16 // consider maximum private header size. #define PES_AUDIO_HEADER_SIZE (32 + PES_AUDIO_PRIVATE_HEADER_SIZE) #define PES_AUDIO_PACKET_SIZE 2028 @@ -66,7 +67,7 @@ static short debug_level = 0; #define dts_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define dts_printf(level, fmt, x...) #endif @@ -82,7 +83,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ @@ -92,6 +93,7 @@ static short debug_level = 0; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { return 0; diff --git a/libeplayer3-arm/output/writer/sh4/h263.c b/libeplayer3-arm/output/writer/sh4/h263.c index 4c56341..86430df 100644 --- a/libeplayer3-arm/output/writer/sh4/h263.c +++ b/libeplayer3-arm/output/writer/sh4/h263.c @@ -50,6 +50,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #ifdef SAM_WITH_DEBUG #define H263_DEBUG #else @@ -61,7 +62,7 @@ static short debug_level = 0; static const char *FILENAME = "h263.c"; #define h263_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) #else #define h263_printf(level, fmt, x...) #endif @@ -71,12 +72,13 @@ static const char *FILENAME = "h263.c"; #else #define h263_err(fmt, x...) #endif + /* ***************************** */ /* Types */ /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/sh4/h264.c b/libeplayer3-arm/output/writer/sh4/h264.c index ffaf118..f86e06f 100644 --- a/libeplayer3-arm/output/writer/sh4/h264.c +++ b/libeplayer3-arm/output/writer/sh4/h264.c @@ -63,7 +63,7 @@ static short debug_level = 0; #define h264_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define h264_printf(level, fmt, x...) #endif @@ -92,12 +92,14 @@ typedef struct avcC_s } avcC_t; /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + const uint8_t Head[] = {0, 0, 0, 1}; static int32_t initialHeader = 1; static uint32_t NalLengthBytes = 1; static int avc3 = 0; + /* ***************************** */ /* Prototypes */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/sh4/mp3.c b/libeplayer3-arm/output/writer/sh4/mp3.c index d2edf18..f66bb41 100644 --- a/libeplayer3-arm/output/writer/sh4/mp3.c +++ b/libeplayer3-arm/output/writer/sh4/mp3.c @@ -50,6 +50,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #ifdef SAM_WITH_DEBUG #define MP3_DEBUG #else @@ -61,7 +62,7 @@ static short debug_level = 0; #define mp3_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define mp3_printf(level, fmt, x...) #endif @@ -77,7 +78,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ @@ -96,7 +97,7 @@ static int reset() static int writeData(void *_call) { WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; + unsigned char PesHeader[PES_MAX_HEADER_SIZE]; mp3_printf(10, "\n"); if (call == NULL) { diff --git a/libeplayer3-arm/output/writer/sh4/mpeg2.c b/libeplayer3-arm/output/writer/sh4/mpeg2.c index d501a8f..063f301 100644 --- a/libeplayer3-arm/output/writer/sh4/mpeg2.c +++ b/libeplayer3-arm/output/writer/sh4/mpeg2.c @@ -50,6 +50,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #ifdef SAM_WITH_DEBUG #define MPEG2_DEBUG #else @@ -61,7 +62,7 @@ static short debug_level = 0; #define mpeg2_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define mpeg2_printf(level, fmt, x...) #endif @@ -77,7 +78,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ @@ -96,7 +97,7 @@ static int reset() static int writeData(void *_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/sh4/pcm.c b/libeplayer3-arm/output/writer/sh4/pcm.c index 796e052..7a17231 100644 --- a/libeplayer3-arm/output/writer/sh4/pcm.c +++ b/libeplayer3-arm/output/writer/sh4/pcm.c @@ -53,6 +53,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #ifdef SAM_WITH_DEBUG #define PCM_DEBUG #else @@ -64,7 +65,7 @@ static short debug_level = 0; #define pcm_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define pcm_printf(level, fmt, x...) #endif @@ -80,7 +81,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static int32_t initialHeader = 1; diff --git a/libeplayer3-arm/output/writer/sh4/pes.c b/libeplayer3-arm/output/writer/sh4/pes.c index 4a59896..8df20a8 100644 --- a/libeplayer3-arm/output/writer/sh4/pes.c +++ b/libeplayer3-arm/output/writer/sh4/pes.c @@ -55,7 +55,7 @@ /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/sh4/vc1.c b/libeplayer3-arm/output/writer/sh4/vc1.c index 3f874a1..e51a267 100644 --- a/libeplayer3-arm/output/writer/sh4/vc1.c +++ b/libeplayer3-arm/output/writer/sh4/vc1.c @@ -20,7 +20,7 @@ */ /* ***************************** */ -/* Includes */ +/* Includes */ /* ***************************** */ #include @@ -48,7 +48,7 @@ #include "writer.h" /* ***************************** */ -/* Makros/Constants */ +/* Makros/Constants */ /* ***************************** */ #define WMV3_PRIVATE_DATA_LENGTH 4 @@ -72,7 +72,7 @@ static short debug_level = 0; #define vc1_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define vc1_printf(level, fmt, x...) #endif @@ -105,6 +105,7 @@ static const unsigned char Metadata[] = /* ***************************** */ /* Varaibles */ /* ***************************** */ + static int initialHeader = 1; static unsigned char FrameHeaderSeen = 0; @@ -115,6 +116,7 @@ static unsigned char FrameHeaderSeen = 0; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { initialHeader = 1; diff --git a/libeplayer3-arm/output/writer/sh4/vorbis.c b/libeplayer3-arm/output/writer/sh4/vorbis.c index 6e10217..0b09940 100644 --- a/libeplayer3-arm/output/writer/sh4/vorbis.c +++ b/libeplayer3-arm/output/writer/sh4/vorbis.c @@ -49,6 +49,9 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + +//#define SAM_WITH_DEBUG + #ifdef SAM_WITH_DEBUG #define VORBIS_DEBUG #else @@ -60,7 +63,7 @@ static short debug_level = 1; #define vorbis_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define vorbis_printf(level, fmt, x...) #endif @@ -76,7 +79,7 @@ static short debug_level = 1; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ /* ***************************** */ @@ -95,7 +98,7 @@ static int reset() static int writeData(void *_call) { WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; + unsigned char PesHeader[PES_MAX_HEADER_SIZE]; vorbis_printf(10, "\n"); if (call == NULL) { diff --git a/libeplayer3-arm/output/writer/sh4/wma.c b/libeplayer3-arm/output/writer/sh4/wma.c index aa1ae54..39a42a9 100644 --- a/libeplayer3-arm/output/writer/sh4/wma.c +++ b/libeplayer3-arm/output/writer/sh4/wma.c @@ -51,6 +51,8 @@ /* Makros/Constants */ /* ***************************** */ +//#define SAM_WITH_DEBUG + #ifdef SAM_WITH_DEBUG #define WMA_DEBUG #else @@ -62,7 +64,7 @@ static short debug_level = 0; #define wma_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define wma_printf(level, fmt, x...) #endif @@ -78,7 +80,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static int initialHeader = 1; diff --git a/libeplayer3-arm/output/writer/sh4/wmv.c b/libeplayer3-arm/output/writer/sh4/wmv.c index 6e2325e..bcfbb0d 100644 --- a/libeplayer3-arm/output/writer/sh4/wmv.c +++ b/libeplayer3-arm/output/writer/sh4/wmv.c @@ -69,7 +69,7 @@ static short debug_level = 0; #define wmv_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define wmv_printf(level, fmt, x...) #endif @@ -106,8 +106,9 @@ static const unsigned char Metadata[] = }; /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ + static int initialHeader = 1; /* ***************************** */ @@ -117,6 +118,7 @@ static int initialHeader = 1; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { initialHeader = 1; diff --git a/libeplayer3-arm/output/writer/sh4/writer.c b/libeplayer3-arm/output/writer/sh4/writer.c index 015f2e1..a9d8548 100644 --- a/libeplayer3-arm/output/writer/sh4/writer.c +++ b/libeplayer3-arm/output/writer/sh4/writer.c @@ -43,7 +43,7 @@ static short debug_level = 0; #define writer_printf(level, x...) do { \ - if (debug_level >= level) printf(x); } while (0) +if (debug_level >= level) printf(x); } while (0) #else #define writer_printf(level, x...) #endif @@ -59,7 +59,7 @@ static short debug_level = 0; /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static Writer_t *AvailableWriter[] = diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index 9f1eb85..640866a 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -40,7 +40,7 @@ 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) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define playback_printf(level, fmt, x...) #endif @@ -67,7 +67,7 @@ static int hasThreadStarted = 0; /* ***************************** */ /* Prototypes */ /* ***************************** */ -static int32_t PlaybackTerminate(Context_t *context); +static int32_t PlaybackTerminate(Context_t *context); /* ***************************** */ /* MISC Functions */ @@ -107,9 +107,9 @@ static void SupervisorThread(Context_t *context) /* Functions */ /* ***************************** */ -static int PlaybackStop(Context_t *context); +static int PlaybackStop(Context_t *context); -static int PlaybackOpen(Context_t *context, PlayFiles_t *pFiles) +static int PlaybackOpen(Context_t *context, PlayFiles_t *pFiles) { if (context->playback->isPlaying) { @@ -186,7 +186,7 @@ static int PlaybackOpen(Context_t *context, PlayFiles_t *pFiles) return cERR_PLAYBACK_NO_ERROR; } -static int PlaybackClose(Context_t *context) +static int PlaybackClose(Context_t *context) { int ret = cERR_PLAYBACK_NO_ERROR; playback_printf(10, "\n"); @@ -212,7 +212,7 @@ static int PlaybackClose(Context_t *context) return ret; } -static int PlaybackPlay(Context_t *context) +static int PlaybackPlay(Context_t *context) { pthread_attr_t attr; int ret = cERR_PLAYBACK_NO_ERROR; @@ -277,7 +277,7 @@ static int PlaybackPlay(Context_t *context) return ret; } -static int PlaybackPause(Context_t *context) +static int PlaybackPause(Context_t *context) { int ret = cERR_PLAYBACK_NO_ERROR; playback_printf(10, "\n"); @@ -302,7 +302,7 @@ static int PlaybackPause(Context_t *context) return ret; } -static int32_t PlaybackContinue(Context_t *context) +static int32_t PlaybackContinue(Context_t *context) { int32_t ret = cERR_PLAYBACK_NO_ERROR; playback_printf(10, "\n"); @@ -329,7 +329,7 @@ static int32_t PlaybackContinue(Context_t *context) return ret; } -static int32_t PlaybackStop(Context_t *context) +static int32_t PlaybackStop(Context_t *context) { int32_t ret = cERR_PLAYBACK_NO_ERROR; int wait_time = 20; @@ -365,7 +365,7 @@ static int32_t PlaybackStop(Context_t *context) return ret; } -static int32_t PlaybackTerminate(Context_t *context) +static int32_t PlaybackTerminate(Context_t *context) { int32_t ret = cERR_PLAYBACK_NO_ERROR; int wait_time = 20; @@ -409,7 +409,7 @@ static int32_t PlaybackTerminate(Context_t *context) return ret; } -static int32_t PlaybackSeek(Context_t *context, int64_t *pos, uint8_t absolute) +static int32_t PlaybackSeek(Context_t *context, int64_t *pos, uint8_t absolute) { int32_t ret = cERR_PLAYBACK_NO_ERROR; playback_printf(10, "pos: %lldd\n", *pos); @@ -436,7 +436,7 @@ static int32_t PlaybackSeek(Context_t *context, int64_t *pos, uint8_t absolute) return ret; } -static int32_t PlaybackPts(Context_t *context, int64_t *pts) +static int32_t PlaybackPts(Context_t *context, int64_t *pts) { int32_t ret = cERR_PLAYBACK_NO_ERROR; playback_printf(20, "\n"); @@ -454,7 +454,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, int64_t *frameCount) { int ret = cERR_PLAYBACK_NO_ERROR; playback_printf(20, "\n"); @@ -472,7 +472,7 @@ static int32_t PlaybackGetFrameCount(Context_t *context, int64_t *frameCount) return ret; } -static int32_t PlaybackLength(Context_t *context, int64_t *length) +static int32_t PlaybackLength(Context_t *context, int64_t *length) { int32_t ret = cERR_PLAYBACK_NO_ERROR; playback_printf(20, "\n"); @@ -493,7 +493,7 @@ static int32_t PlaybackLength(Context_t *context, int64_t *length) return ret; } -static int32_t PlaybackSwitchAudio(Context_t *context, int32_t *track) +static int32_t PlaybackSwitchAudio(Context_t *context, int32_t *track) { int32_t ret = cERR_PLAYBACK_NO_ERROR; int32_t curtrackid = 0; @@ -535,7 +535,7 @@ static int32_t PlaybackSwitchAudio(Context_t *context, int32_t *track) return ret; } -static int32_t PlaybackSwitchSubtitle(Context_t *context, int32_t *track) +static int32_t PlaybackSwitchSubtitle(Context_t *context, int32_t *track) { int32_t ret = cERR_PLAYBACK_NO_ERROR; int32_t curtrackid = -1; @@ -575,7 +575,7 @@ static int32_t PlaybackSwitchSubtitle(Context_t *context, int32_t *track) return ret; } -static int32_t PlaybackInfo(Context_t *context, char **infoString) +static int32_t PlaybackInfo(Context_t *context, char **infoString) { int32_t ret = cERR_PLAYBACK_NO_ERROR; playback_printf(10, "\n"); @@ -592,7 +592,7 @@ static int32_t PlaybackInfo(Context_t *context, char **infoString) return ret; } -static int PlaybackMetadata(Context_t * context, char ***metadata) +static int PlaybackMetadata(Context_t *context, char ***metadata) { int ret = cERR_PLAYBACK_NO_ERROR; From d7e8ae0472442fd389ad9fbfdfbf9c19f7563170 Mon Sep 17 00:00:00 2001 From: max_10 Date: Sat, 6 Jan 2018 22:17:59 +0100 Subject: [PATCH 04/36] libeplayer3-arm: eliminate some warnings Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/32f64c474d84687578c52e780c38279161015c2f Author: max_10 Date: 2018-01-06 (Sat, 06 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/output/linuxdvb_mipsel.c | 6 +++++- libeplayer3-arm/output/linuxdvb_sh4.c | 6 +++++- libeplayer3-arm/output/writer/mipsel/divx3.c | 2 +- libeplayer3-arm/output/writer/mipsel/vc1.c | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libeplayer3-arm/output/linuxdvb_mipsel.c b/libeplayer3-arm/output/linuxdvb_mipsel.c index 1b34572..ab01aa2 100644 --- a/libeplayer3-arm/output/linuxdvb_mipsel.c +++ b/libeplayer3-arm/output/linuxdvb_mipsel.c @@ -687,7 +687,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) { int ret = cERR_LINUXDVB_NO_ERROR; return ret; @@ -746,7 +746,9 @@ int LinuxDvbSwitch(Context_t *context, char *type) free(Encoding); } else + { linuxdvb_printf(20, "no context for Audio\n"); + } } if (video && videofd != -1) { @@ -795,7 +797,9 @@ int LinuxDvbSwitch(Context_t *context, char *type) free(Encoding); } else + { linuxdvb_printf(20, "no context for Video\n"); + } } releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); } diff --git a/libeplayer3-arm/output/linuxdvb_sh4.c b/libeplayer3-arm/output/linuxdvb_sh4.c index 0b5c4f7..f11de46 100644 --- a/libeplayer3-arm/output/linuxdvb_sh4.c +++ b/libeplayer3-arm/output/linuxdvb_sh4.c @@ -749,7 +749,9 @@ int LinuxDvbSwitch(Context_t *context, char *type) free(Encoding); } else + { linuxdvb_printf(20, "no context for Audio\n"); + } } if (video && videofd != -1) { @@ -798,7 +800,9 @@ int LinuxDvbSwitch(Context_t *context, char *type) free(Encoding); } else + { linuxdvb_printf(20, "no context for Video\n"); + } } releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); } @@ -898,7 +902,7 @@ static int Write(void *_context, void *_out) call.FrameScale = out->timeScale; call.Width = out->width; call.Height = out->height; - call.InfoFlags = out->infoFlags; + call.InfoFlags = out->infoFlags; call.Version = 0; // is unsingned char if (writer->writeData) { diff --git a/libeplayer3-arm/output/writer/mipsel/divx3.c b/libeplayer3-arm/output/writer/mipsel/divx3.c index cef568d..f933f1a 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 int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE; +// 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/vc1.c b/libeplayer3-arm/output/writer/mipsel/vc1.c index f469c21..3fd5c96 100644 --- a/libeplayer3-arm/output/writer/mipsel/vc1.c +++ b/libeplayer3-arm/output/writer/mipsel/vc1.c @@ -83,7 +83,7 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); /* Types */ /* ***************************** */ -static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE}; +//static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE}; static const uint8_t Vc1FrameStartCode[] = {0, 0, 1, VC1_FRAME_START_CODE}; /* ***************************** */ From 056d58f9b4fe95b4568076cf49c896672375413d Mon Sep 17 00:00:00 2001 From: max_10 Date: Sat, 6 Jan 2018 22:23:12 +0100 Subject: [PATCH 05/36] libeplayer3-arm: update Makefile.am Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/1ac7e9202cdf7c8d3535cd27579ef04bfa018d7e Author: max_10 Date: 2018-01-06 (Sat, 06 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/Makefile.am | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libeplayer3-arm/Makefile.am b/libeplayer3-arm/Makefile.am index 7d133e2..b1bdd32 100644 --- a/libeplayer3-arm/Makefile.am +++ b/libeplayer3-arm/Makefile.am @@ -47,9 +47,8 @@ libeplayer3_arm_la_SOURCES = \ external/ffmpeg/src/mpeg4audio.c -LIBEPLAYER3_LIBS = libeplayer3_arm.la +LIBEPLAYER3_LIBS = libeplayer3_arm.la -lpthread -lavformat -lavcodec -lavutil -lswresample -lz -lm bin_PROGRAMS = eplayer3 eplayer3_SOURCES = main/exteplayer.c -eplayer3_LDADD = -leplayer3_arm -lpthread -lavformat -lavcodec -lavutil -lswresample -lz -lm -eplayer3_DEPENDENCIES = libeplayer3_arm.la +eplayer3_LDADD = $(LIBEPLAYER3_LIBS) From 34c7582feac359681540e980a9f106a858fbae52 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Jan 2018 09:35:31 +0100 Subject: [PATCH 06/36] fix build for generic-pc Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/32a693a51b41ac3ea345ad8f1adba0b8af235f37 Author: vanhofen Date: 2018-01-09 (Tue, 09 Jan 2018) Origin message was: ------------------ - fix build for generic-pc Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- generic-pc/playback.cpp | 9 ++++++--- generic-pc/playback.h | 6 ++++-- generic-pc/playback_gst.h | 8 ++++++-- generic-pc/playback_gst_01.cpp | 19 +++++++++++++++---- generic-pc/playback_gst_10.cpp | 19 +++++++++++++++---- 5 files changed, 46 insertions(+), 15 deletions(-) diff --git a/generic-pc/playback.cpp b/generic-pc/playback.cpp index 5e9c4ac..b13727e 100644 --- a/generic-pc/playback.cpp +++ b/generic-pc/playback.cpp @@ -31,9 +31,9 @@ bool cPlayback::SetAPid(int pid, bool /*ac3*/) return true; } -bool cPlayback::SelectSubtitles(int pid) +bool cPlayback::SelectSubtitles(int pid, std::string charset) { - printf("%s:%s pid %i\n", FILENAME, __func__, pid); + printf("%s:%s pid %i, charset: %s\n", FILENAME, __func__, pid, charset.c_str()); return true; } @@ -105,7 +105,7 @@ int cPlayback::GetTeletextPid(void) return -1; } -void cPlayback::FindAllSubs(uint16_t * /*pids*/, unsigned short * /*supp*/, uint16_t *num, std::string * /*lang*/) +void cPlayback::FindAllSubs(int * /*pids*/, unsigned int * /*supp*/, unsigned int *num, std::string * /*lang*/) { printf("%s:%s\n", FILENAME, __func__); *num = 0; @@ -125,6 +125,9 @@ void cPlayback::GetMetadata(std::vector &keys, std::vector &playlists, std::vector &titles, int ¤t) { + playlists.clear(); + titles.clear(); + current = 0; } void cPlayback::SetTitle(int /*title*/) diff --git a/generic-pc/playback.h b/generic-pc/playback.h index 4638456..c21d6ab 100644 --- a/generic-pc/playback.h +++ b/generic-pc/playback.h @@ -39,13 +39,15 @@ class cPlayback void GetPts(uint64_t &pts); bool SetPosition(int position, bool absolute = false); void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language); + void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language) { FindAllPids((int*) apids, (unsigned int*) ac3flags, (unsigned int*) numpida, 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 RequestAbort(void); bool IsPlaying(void) { return false; } uint64_t GetReadCount(void); - void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language); - bool SelectSubtitles(int pid); + void FindAllSubs(int *pids, unsigned int *supported, unsigned int *numpida, std::string *language); + void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language) { FindAllSubs((int*) pids, (unsigned int*) supported, (unsigned int*) numpida, language); }; + bool SelectSubtitles(int pid, std::string charset = ""); void GetTitles(std::vector &playlists, std::vector &titles, int ¤t); void SetTitle(int title); void GetChapters(std::vector &positions, std::vector &titles); diff --git a/generic-pc/playback_gst.h b/generic-pc/playback_gst.h index a58de78..80a0e30 100644 --- a/generic-pc/playback_gst.h +++ b/generic-pc/playback_gst.h @@ -81,11 +81,15 @@ public: int GetSubtitlePid(void); bool SetPosition(int position, bool absolute = false); void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language); + void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language) { FindAllPids((int*) apids, (unsigned int*) ac3flags, (unsigned int*) numpida, 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 RequestAbort(void); - void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language); - bool SelectSubtitles(int pid); + void FindAllSubs(int *pids, unsigned int *supported, unsigned int *numpida, std::string *language); + void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language) { FindAllSubs((int*) pids, (unsigned int*) supported, (unsigned int*) numpida, language); }; + bool SelectSubtitles(int pid, std::string charset = ""); + void GetTitles(std::vector &playlists, std::vector &titles, int ¤t); + void SetTitle(int title); uint64_t GetReadCount(void); void GetChapters(std::vector &positions, std::vector &titles); void GetMetadata(std::vector &keys, std::vector &values); diff --git a/generic-pc/playback_gst_01.cpp b/generic-pc/playback_gst_01.cpp index 3bf7321..0527be2 100644 --- a/generic-pc/playback_gst_01.cpp +++ b/generic-pc/playback_gst_01.cpp @@ -768,10 +768,10 @@ void cPlayback::RequestAbort() { } -void cPlayback::FindAllSubs(uint16_t *, unsigned short *, uint16_t *numpida, std::string *) +void cPlayback::FindAllSubs(int * /*pids*/, unsigned int * /*supp*/, unsigned int *num, std::string * /*lang*/) { printf("%s:%s\n", FILENAME, __func__); - *numpida = 0; + *num = 0; } void cPlayback::GetChapters(std::vector &positions, std::vector &titles) @@ -780,9 +780,20 @@ void cPlayback::GetChapters(std::vector &positions, std::vector &playlists, std::vector &titles, int ¤t) { - printf("%s:%s pid %i\n", FILENAME, __func__, pid); + playlists.clear(); + titles.clear(); + current = 0; +} + +void cPlayback::SetTitle(int /*title*/) +{ +} + +bool cPlayback::SelectSubtitles(int pid, std::string charset) +{ + printf("%s:%s pid %i, charset: %s\n", FILENAME, __func__, pid, charset.c_str()); return true; } diff --git a/generic-pc/playback_gst_10.cpp b/generic-pc/playback_gst_10.cpp index 08bc508..8acb951 100644 --- a/generic-pc/playback_gst_10.cpp +++ b/generic-pc/playback_gst_10.cpp @@ -1015,10 +1015,10 @@ void cPlayback::RequestAbort() { } -void cPlayback::FindAllSubs(uint16_t *, unsigned short *, uint16_t *numpida, std::string *) +void cPlayback::FindAllSubs(int * /*pids*/, unsigned int * /*supp*/, unsigned int *num, std::string * /*lang*/) { printf("%s:%s\n", FILENAME, __func__); - *numpida = 0; + *num = 0; } void cPlayback::GetChapters(std::vector &positions, std::vector &titles) @@ -1027,9 +1027,20 @@ void cPlayback::GetChapters(std::vector &positions, std::vector &playlists, std::vector &titles, int ¤t) { - printf("%s:%s pid %i\n", FILENAME, __func__, pid); + playlists.clear(); + titles.clear(); + current = 0; +} + +void cPlayback::SetTitle(int /*title*/) +{ +} + +bool cPlayback::SelectSubtitles(int pid, std::string charset) +{ + printf("%s:%s pid %i, charset: %s\n", FILENAME, __func__, pid, charset.c_str()); return true; } From 0571492de5cabb66d2daa4ee76e0170e3fe381ff Mon Sep 17 00:00:00 2001 From: max_10 Date: Tue, 9 Jan 2018 00:30:39 +0100 Subject: [PATCH 07/36] fix ci arm auth (thx DboxOldie) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/c8a4716085f7f2f6be914950f6bd5adbea26a28a Author: max_10 Date: 2018-01-09 (Tue, 09 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- common/ca_ci.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/ca_ci.cpp b/common/ca_ci.cpp index 265dd35..deaa4e5 100644 --- a/common/ca_ci.cpp +++ b/common/ca_ci.cpp @@ -922,9 +922,8 @@ bool cCA::SendCAPMT(u64 tpid, u8 source, u8 camask, const unsigned char * cabuf, if ((*it)->recordUse[j]) recordUse_found = true; } - if (!recordUse_found) + if (!recordUse_found && (*it)->init) { - printf("Slot: %d Change Input to Tuner: %d\n", (*it)->slot, (*it)->source); setInputSource((eDVBCISlot*)(*it), false); } } @@ -1050,6 +1049,7 @@ void cCA::setInputs() void cCA::setInputSource(eDVBCISlot* slot, bool ci) { char buf[64]; + printf("%s set input%d to %s%d\n", FILENAME, slot->source, ci ? "ci" : "tuner", ci ? slot->slot : slot->source); snprintf(buf, 64, "/proc/stb/tsmux/input%d", slot->source); FILE *input = fopen(buf, "wb"); @@ -1191,6 +1191,9 @@ void cCA::ModuleReset(enum CA_SLOT_TYPE, uint32_t slot) { (*it)->status = eStatusReset; usleep(200000); +#if HAVE_ARM_HARDWARE + setInputSource((eDVBCISlot*)(*it), false); +#endif if ((*it)->hasCCManager) (*it)->ccmgrSession->ci_ccmgr_doClose((eDVBCISlot*)(*it)); eDVBCISession::deleteSessions((eDVBCISlot*)(*it)); @@ -1280,6 +1283,9 @@ void cCA::ci_inserted(eDVBCISlot* slot) void cCA::ci_removed(eDVBCISlot* slot) { printf("cam (%d) status changed ->cam now _not_ present\n", slot->slot); +#if HAVE_ARM_HARDWARE + setInputSource(slot, false); +#endif if (slot->hasCCManager) slot->ccmgrSession->ci_ccmgr_doClose(slot); eDVBCISession::deleteSessions(slot); @@ -1377,6 +1383,7 @@ void cCA::slot_pollthread(void *c) } #endif ci_inserted(slot); + setInputSource(slot, true); goto FROM_FIRST; } } From 50a1b98d038e80f7e94778990758a7baaf855006 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 10 Jan 2018 20:04:51 +0100 Subject: [PATCH 08/36] armbox eplayer: fix init jump Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/3e166e612373b8691f4dd57a534af53a171fce8f Author: TangoCash Date: 2018-01-10 (Wed, 10 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_libeplayer3.cpp | 5 ++++- libarmbox/playback_libeplayer3.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libarmbox/playback_libeplayer3.cpp b/libarmbox/playback_libeplayer3.cpp index 15c6c51..7a62840 100644 --- a/libarmbox/playback_libeplayer3.cpp +++ b/libarmbox/playback_libeplayer3.cpp @@ -206,6 +206,7 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in } } playing = true; + first = true; player->output->Command(player, OUTPUT_OPEN, NULL); ret = (player->playback->Command(player, PLAYBACK_PLAY, NULL) == 0); if (ret && !isHTTP) @@ -424,7 +425,7 @@ bool cPlayback::GetPosition(int &position, int &duration) bool cPlayback::SetPosition(int position, bool absolute) { lt_info("%s %d\n", __func__, position); - if (!playing) + if (playing && first) { /* the calling sequence is: * Start() - paused @@ -433,6 +434,7 @@ bool cPlayback::SetPosition(int position, bool absolute) * so let's remember the initial jump position and later jump to it */ init_jump = position; + first = false; return false; } int64_t pos = (position / 1000.0); @@ -682,6 +684,7 @@ cPlayback::cPlayback(int num __attribute__((unused))) lt_info("%s\n", __func__); playing = false; decoders_closed = false; + first = false; } cPlayback::~cPlayback() diff --git a/libarmbox/playback_libeplayer3.h b/libarmbox/playback_libeplayer3.h index 7070f54..b658ba8 100644 --- a/libarmbox/playback_libeplayer3.h +++ b/libarmbox/playback_libeplayer3.h @@ -18,7 +18,7 @@ class cPlayback private: bool enabled; - bool playing; + bool playing, first; bool no_probe; int nPlaybackSpeed; int mAudioStream; From c3fa4a96de8ca7683299fc3762622e76696c4af5 Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Fri, 19 Jan 2018 15:09:41 +0100 Subject: [PATCH 09/36] libeplayer3-arm: fix fast forward (thx DboxOldie) Conflicts: libeplayer3-arm/playback/playback.c Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/fc5c510334017554741c88d8ab58341634cf38e0 Author: Frankenstone Date: 2018-01-19 (Fri, 19 Jan 2018) ------------------ This commit was generated by Migit --- libeplayer3-arm/output/linuxdvb_mipsel.c | 4 ++++ libeplayer3-arm/playback/playback.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libeplayer3-arm/output/linuxdvb_mipsel.c b/libeplayer3-arm/output/linuxdvb_mipsel.c index ab01aa2..85831ba 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 640866a..ba1b8c0 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 { From ca6977a6669e1ee57c7b133ef0619dc40b0cdf44 Mon Sep 17 00:00:00 2001 From: max_10 Date: Wed, 17 Jan 2018 22:29:27 +0100 Subject: [PATCH 10/36] libeplayer3-arm: fixes segfault on internet streams (thx DboxOldie) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/f793f03267d434bc9819e4a07cd48957578f438f Author: max_10 Date: 2018-01-17 (Wed, 17 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ 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 83d4a09..c06fcc7 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -351,7 +351,7 @@ void cVideo::closeDevice(void) { lt_debug("%s\n", __func__); /* looks like sometimes close is unhappy about non-empty buffers */ - Start(); +// Start(); if (fd >= 0) close(fd); fd = -1; From 2077b4a451f2589a3a4c16a0e2cdddf831e9d634 Mon Sep 17 00:00:00 2001 From: max_10 Date: Wed, 17 Jan 2018 21:17:01 +0100 Subject: [PATCH 11/36] libarmbox/video: Workaround Channel Change No Black Picture when Show Picture was active. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/fbad9e1bc474fe08c528b7c99de516517fcf23b8 Author: max_10 Date: 2018-01-17 (Wed, 17 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index c06fcc7..56bf050 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -602,6 +602,8 @@ void cVideo::StopPicture() lt_debug("%s\n", __func__); stillpicture = false; Stop(1); + closeDevice(); + openDevice(); } void cVideo::Standby(unsigned int bOn) From ae6412fa4827651829be0b680434338999178717 Mon Sep 17 00:00:00 2001 From: max_10 Date: Fri, 5 Jan 2018 12:11:32 +0100 Subject: [PATCH 12/36] generic-pc: switch to ffmpeg 3.0 API Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/4e1855eb7536a1c290f1fa37598d3c4d41f73098 Author: max_10 Date: 2018-01-05 (Fri, 05 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- generic-pc/audio.cpp | 42 ++++---- generic-pc/video.cpp | 219 +++++++++++++++++++++++++++++------------ generic-pc/video_lib.h | 15 ++- 3 files changed, 188 insertions(+), 88 deletions(-) diff --git a/generic-pc/audio.cpp b/generic-pc/audio.cpp index e6cda85..8b3ae48 100644 --- a/generic-pc/audio.cpp +++ b/generic-pc/audio.cpp @@ -54,7 +54,8 @@ static cAudio *gThiz = NULL; static ao_device *adevice = NULL; static ao_sample_format sformat; -static AVCodecContext *c= NULL; +static AVCodecContext *c = NULL; +static AVCodecParameters *p = NULL; cAudio::cAudio(void *, void *, void *) { @@ -356,28 +357,31 @@ void cAudio::run() lt_info("%s: nb_streams: %d, should be 1!\n", __func__, avfc->nb_streams); goto out; } - if (avfc->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO) - lt_info("%s: stream 0 no audio codec? 0x%x\n", __func__, avfc->streams[0]->codec->codec_type); + p = avfc->streams[0]->codecpar; + if (p->codec_type != AVMEDIA_TYPE_AUDIO) + lt_info("%s: stream 0 no audio codec? 0x%x\n", __func__, p->codec_type); - c = avfc->streams[0]->codec; - codec = avcodec_find_decoder(c->codec_id); + codec = avcodec_find_decoder(p->codec_id); if (!codec) { - lt_info("%s: Codec for %s not found\n", __func__, avcodec_get_name(c->codec_id)); + lt_info("%s: Codec for %s not found\n", __func__, avcodec_get_name(p->codec_id)); goto out; } + if (c) + av_free(c); + c = avcodec_alloc_context3(codec); if (avcodec_open2(c, codec, NULL) < 0) { lt_info("%s: avcodec_open2() failed\n", __func__); goto out; } frame = av_frame_alloc(); if (!frame) { - lt_info("%s: avcodec_alloc_frame failed\n", __func__); + lt_info("%s: av_frame_alloc failed\n", __func__); goto out2; } /* output sample rate, channels, layout could be set here if necessary */ - o_ch = c->channels; /* 2 */ - o_sr = c->sample_rate; /* 48000 */ - o_layout = c->channel_layout; /* AV_CH_LAYOUT_STEREO */ + o_ch = p->channels; /* 2 */ + o_sr = p->sample_rate; /* 48000 */ + o_layout = p->channel_layout; /* AV_CH_LAYOUT_STEREO */ if (sformat.channels != o_ch || sformat.rate != o_sr || sformat.byte_format != AO_FMT_NATIVE || sformat.bits != 16 || adevice == NULL) { @@ -392,8 +396,9 @@ void cAudio::run() adevice = ao_open_live(driver, &sformat, NULL); ai = ao_driver_info(driver); lt_info("%s: changed params ch %d srate %d bits %d adevice %p\n", - __func__, o_ch, o_sr, 16, adevice);; - lt_info("libao driver: %d name '%s' short '%s' author '%s'\n", + __func__, o_ch, o_sr, 16, adevice); + if(ai) + lt_info("libao driver: %d name '%s' short '%s' author '%s'\n", driver, ai->name, ai->short_name, ai->author); } #if 0 @@ -404,10 +409,10 @@ void cAudio::run() #endif av_get_sample_fmt_string(tmp, sizeof(tmp), c->sample_fmt); lt_info("decoding %s, sample_fmt %d (%s) sample_rate %d channels %d\n", - avcodec_get_name(c->codec_id), c->sample_fmt, tmp, c->sample_rate, c->channels); + avcodec_get_name(p->codec_id), c->sample_fmt, tmp, p->sample_rate, p->channels); swr = swr_alloc_set_opts(swr, o_layout, AV_SAMPLE_FMT_S16, o_sr, /* output */ - c->channel_layout, c->sample_fmt, c->sample_rate, /* input */ + p->channel_layout, c->sample_fmt, p->sample_rate, /* input */ 0, NULL); if (! swr) { lt_info("could not alloc resample context\n"); @@ -421,15 +426,15 @@ void cAudio::run() avcodec_decode_audio4(c, frame, &gotframe, &avpkt); if (gotframe && thread_started) { int out_linesize; - obuf_sz = av_rescale_rnd(swr_get_delay(swr, c->sample_rate) + - frame->nb_samples, o_sr, c->sample_rate, AV_ROUND_UP); + obuf_sz = av_rescale_rnd(swr_get_delay(swr, p->sample_rate) + + frame->nb_samples, o_sr, p->sample_rate, AV_ROUND_UP); if (obuf_sz > obuf_sz_max) { lt_info("obuf_sz: %d old: %d\n", obuf_sz, obuf_sz_max); av_free(obuf); if (av_samples_alloc(&obuf, &out_linesize, o_ch, frame->nb_samples, AV_SAMPLE_FMT_S16, 1) < 0) { lt_info("av_samples_alloc failed\n"); - av_free_packet(&avpkt); + av_packet_unref(&avpkt); break; /* while (thread_started) */ } obuf_sz_max = obuf_sz; @@ -442,7 +447,7 @@ void cAudio::run() obuf_sz, AV_SAMPLE_FMT_S16, 1); ao_play(adevice, (char *)obuf, o_buf_sz); } - av_free_packet(&avpkt); + av_packet_unref(&avpkt); } // ao_close(adevice); /* can take long :-( */ av_free(obuf); @@ -451,6 +456,7 @@ void cAudio::run() av_frame_free(&frame); out2: avcodec_close(c); + av_free(c); c = NULL; out: avformat_close_input(&avfc); diff --git a/generic-pc/video.cpp b/generic-pc/video.cpp index bf54a27..8723940 100644 --- a/generic-pc/video.cpp +++ b/generic-pc/video.cpp @@ -30,6 +30,7 @@ extern "C" { #include +#include #include } @@ -79,10 +80,12 @@ cVideo::cVideo(int, void *, void *, unsigned int) buf_in = 0; buf_out = 0; pig_x = pig_y = pig_w = pig_h = 0; + pig_changed = false; display_aspect = DISPLAY_AR_16_9; display_crop = DISPLAY_AR_MODE_LETTERBOX; v_format = VIDEO_FORMAT_MPEG2; output_h = 0; + stillpicture = false; } cVideo::~cVideo(void) @@ -163,6 +166,18 @@ int cVideo::setBlank(int) return 1; } +int cVideo::GetVideoSystem() +{ + int current_video_system = VIDEO_STD_1080I50; + + if(dec_w < 720) + current_video_system = VIDEO_STD_PAL; + else if(dec_w > 720 && dec_w <= 1280) + current_video_system = VIDEO_STD_720P50; + + return current_video_system; +} + int cVideo::SetVideoSystem(int system, bool) { int h; @@ -196,25 +211,13 @@ int cVideo::SetVideoSystem(int system, bool) lt_info("%s: unhandled value %d\n", __func__, system); return 0; } - v_std = (VIDEO_STD) system; +// v_std = (VIDEO_STD) system; output_h = h; if (display_aspect < DISPLAY_AR_RAW && output_h > 0) /* don't know what to do with this */ glfb->setOutputFormat(aspect_ratios[display_aspect], output_h, display_crop); return 0; } -int cVideo::GetVideoSystem() -{ - int current_video_system = VIDEO_STD_1080I50; - - if(dec_w < 720) - current_video_system = VIDEO_STD_PAL; - else if(dec_w > 720 && dec_w <= 1280) - current_video_system = VIDEO_STD_720P50; - - return 0; -} - int cVideo::getPlayState(void) { return VIDEO_PLAYING; @@ -224,11 +227,17 @@ void cVideo::SetVideoMode(analog_mode_t) { } -void cVideo::ShowPicture(const char *fname, const char *) +void cVideo::ShowPicture(const char *fname) { lt_info("%s(%s)\n", __func__, fname); if (access(fname, R_OK)) return; + still_m.lock(); + stillpicture = true; + buf_num = 0; + buf_in = 0; + buf_out = 0; + still_m.unlock(); unsigned int i; int stream_id = -1; @@ -236,6 +245,7 @@ void cVideo::ShowPicture(const char *fname, const char *) int len; AVFormatContext *avfc = NULL; AVCodecContext *c = NULL; + AVCodecParameters *p = NULL; AVCodec *codec; AVFrame *frame, *rgbframe; AVPacket avpkt; @@ -250,17 +260,18 @@ void cVideo::ShowPicture(const char *fname, const char *) goto out_close; } for (i = 0; i < avfc->nb_streams; i++) { - if (avfc->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { + if (avfc->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { stream_id = i; break; } } if (stream_id < 0) goto out_close; - c = avfc->streams[stream_id]->codec; - codec = avcodec_find_decoder(c->codec_id); - if (!avcodec_open2(c, codec, NULL) < 0) { - lt_info("%s: Could not find/open the codec, id 0x%x\n", __func__, c->codec_id); + p = avfc->streams[stream_id]->codecpar; + codec = avcodec_find_decoder(p->codec_id); + c = avcodec_alloc_context3(codec); + if (avcodec_open2(c, codec, NULL) < 0) { + lt_info("%s: Could not find/open the codec, id 0x%x\n", __func__, p->codec_id); goto out_close; } frame = av_frame_alloc(); @@ -277,15 +288,15 @@ void cVideo::ShowPicture(const char *fname, const char *) len = avcodec_decode_video2(c, frame, &got_frame, &avpkt); if (len < 0) { lt_info("%s: avcodec_decode_video2 %d\n", __func__, len); - av_free_packet(&avpkt); + av_packet_unref(&avpkt); goto out_free; } if (avpkt.size > len) lt_info("%s: WARN: pkt->size %d != len %d\n", __func__, avpkt.size, len); if (got_frame) { - unsigned int need = avpicture_get_size(PIX_FMT_RGB32, c->width, c->height); + unsigned int need = av_image_get_buffer_size(AV_PIX_FMT_RGB32, c->width, c->height, 1); struct SwsContext *convert = sws_getContext(c->width, c->height, c->pix_fmt, - c->width, c->height, PIX_FMT_RGB32, + c->width, c->height, AV_PIX_FMT_RGB32, SWS_BICUBIC, 0, 0, 0); if (!convert) lt_info("%s: ERROR setting up SWS context\n", __func__); @@ -294,8 +305,8 @@ void cVideo::ShowPicture(const char *fname, const char *) SWFramebuffer *f = &buffers[buf_in]; if (f->size() < need) f->resize(need); - avpicture_fill((AVPicture *)rgbframe, &(*f)[0], PIX_FMT_RGB32, - c->width, c->height); + av_image_fill_arrays(rgbframe->data, rgbframe->linesize, &(*f)[0], AV_PIX_FMT_RGB32, + c->width, c->height, 1); sws_scale(convert, frame->data, frame->linesize, 0, c->height, rgbframe->data, rgbframe->linesize); sws_freeContext(convert); @@ -308,7 +319,7 @@ void cVideo::ShowPicture(const char *fname, const char *) buf_in %= VDEC_MAXBUFS; buf_num++; if (buf_num > (VDEC_MAXBUFS - 1)) { - lt_debug("%s: buf_num overflow\n", __func__); + lt_info("%s: buf_num overflow\n", __func__); buf_out++; buf_out %= VDEC_MAXBUFS; buf_num--; @@ -316,9 +327,10 @@ void cVideo::ShowPicture(const char *fname, const char *) buf_m.unlock(); } } - av_free_packet(&avpkt); + av_packet_unref(&avpkt); out_free: avcodec_close(c); + av_free(c); av_frame_free(&frame); av_frame_free(&rgbframe); out_close: @@ -328,6 +340,10 @@ void cVideo::ShowPicture(const char *fname, const char *) void cVideo::StopPicture() { + lt_info("%s\n", __func__); + still_m.lock(); + stillpicture = false; + still_m.unlock(); } void cVideo::Standby(unsigned int) @@ -351,7 +367,32 @@ void cVideo::getPictureInfo(int &width, int &height, int &rate) { width = dec_w; height = dec_h; - rate = dec_r; + switch (dec_r) { + case 23://23.976fps + rate = VIDEO_FRAME_RATE_23_976; + break; + case 24: + rate = VIDEO_FRAME_RATE_24; + break; + case 25: + rate = VIDEO_FRAME_RATE_25; + break; + case 29://29,976fps + rate = VIDEO_FRAME_RATE_29_97; + break; + case 30: + rate = VIDEO_FRAME_RATE_30; + break; + case 50: + rate = VIDEO_FRAME_RATE_50; + break; + case 60: + rate = VIDEO_FRAME_RATE_60; + break; + default: + rate = dec_r; + break; + } } void cVideo::SetSyncMode(AVSYNC_TYPE) @@ -407,6 +448,7 @@ void cVideo::run(void) { lt_info("====================== start decoder thread ================================\n"); AVCodec *codec; + AVCodecParameters *p = NULL; AVCodecContext *c= NULL; AVFormatContext *avfc = NULL; AVInputFormat *inp; @@ -447,20 +489,21 @@ void cVideo::run(void) lt_info("%s: nb_streams %d, should be 1 => retry\n", __func__, avfc->nb_streams); if (av_read_frame(avfc, &avpkt) < 0) lt_info("%s: av_read_frame < 0\n", __func__); - av_free_packet(&avpkt); + av_packet_unref(&avpkt); if (! thread_running) goto out; } - if (avfc->streams[0]->codec->codec_type != AVMEDIA_TYPE_VIDEO) - lt_info("%s: no video codec? 0x%x\n", __func__, avfc->streams[0]->codec->codec_type); + p = avfc->streams[0]->codecpar; + if (p->codec_type != AVMEDIA_TYPE_VIDEO) + lt_info("%s: no video codec? 0x%x\n", __func__, p->codec_type); - c = avfc->streams[0]->codec; - codec = avcodec_find_decoder(c->codec_id); + codec = avcodec_find_decoder(p->codec_id); if (!codec) { - lt_info("%s: Codec for %s not found\n", __func__, avcodec_get_name(c->codec_id)); + lt_info("%s: Codec for %s not found\n", __func__, avcodec_get_name(p->codec_id)); goto out; } + c = avcodec_alloc_context3(codec); if (avcodec_open2(c, codec, NULL) < 0) { lt_info("%s: Could not open codec\n", __func__); goto out; @@ -488,16 +531,17 @@ void cVideo::run(void) lt_info("%s: avcodec_decode_video2 %d\n", __func__, len); warn_d = time(NULL); } - av_free_packet(&avpkt); + av_packet_unref(&avpkt); continue; } if (avpkt.size > len) lt_info("%s: WARN: pkt->size %d != len %d\n", __func__, avpkt.size, len); - if (got_frame) { - unsigned int need = avpicture_get_size(PIX_FMT_RGB32, c->width, c->height); + still_m.lock(); + if (got_frame && ! stillpicture) { + unsigned int need = av_image_get_buffer_size(AV_PIX_FMT_RGB32, c->width, c->height, 1); convert = sws_getCachedContext(convert, c->width, c->height, c->pix_fmt, - c->width, c->height, PIX_FMT_RGB32, + c->width, c->height, AV_PIX_FMT_RGB32, SWS_BICUBIC, 0, 0, 0); if (!convert) lt_info("%s: ERROR setting up SWS context\n", __func__); @@ -506,8 +550,8 @@ void cVideo::run(void) SWFramebuffer *f = &buffers[buf_in]; if (f->size() < need) f->resize(need); - avpicture_fill((AVPicture *)rgbframe, &(*f)[0], PIX_FMT_RGB32, - c->width, c->height); + av_image_fill_arrays(rgbframe->data, rgbframe->linesize, &(*f)[0], AV_PIX_FMT_RGB32, + c->width, c->height, 1); sws_scale(convert, frame->data, frame->linesize, 0, c->height, rgbframe->data, rgbframe->linesize); if (dec_w != c->width || dec_h != c->height) { @@ -521,6 +565,8 @@ void cVideo::run(void) f->height(c->height); int64_t vpts = av_frame_get_best_effort_timestamp(frame); if (v_format == VIDEO_FORMAT_MPEG2) + vpts += 90000*4/10; /* 400ms */ + else vpts += 90000*3/10; /* 300ms */ f->pts(vpts); AVRational a = av_guess_sample_aspect_ratio(avfc, avfc->streams[0], frame); @@ -529,7 +575,7 @@ void cVideo::run(void) buf_in %= VDEC_MAXBUFS; buf_num++; if (buf_num > (VDEC_MAXBUFS - 1)) { - lt_debug("%s: buf_num overflow\n", __func__); + lt_info("%s: buf_num overflow\n", __func__); buf_out++; buf_out %= VDEC_MAXBUFS; buf_num--; @@ -540,12 +586,15 @@ void cVideo::run(void) lt_debug("%s: time_base: %d/%d, ticks: %d rate: %d pts 0x%" PRIx64 "\n", __func__, c->time_base.num, c->time_base.den, c->ticks_per_frame, dec_r, av_frame_get_best_effort_timestamp(frame)); - } - av_free_packet(&avpkt); + } else + lt_info("%s: got_frame: %d stillpicture: %d\n", __func__, got_frame, stillpicture); + still_m.unlock(); + av_packet_unref(&avpkt); } sws_freeContext(convert); out2: avcodec_close(c); + av_free(c); av_frame_free(&frame); av_frame_free(&rgbframe); out: @@ -554,35 +603,59 @@ void cVideo::run(void) av_free(pIOCtx); /* reset output buffers */ bufpos = 0; - buf_num = 0; - buf_in = 0; - buf_out = 0; + still_m.lock(); + if (!stillpicture) { + buf_num = 0; + buf_in = 0; + buf_out = 0; + } + still_m.unlock(); lt_info("======================== end decoder thread ================================\n"); } -static bool swscale(unsigned char *src, unsigned char *dst, int sw, int sh, int dw, int dh) +static bool swscale(unsigned char *src, unsigned char *dst, int sw, int sh, int dw, int dh, AVPixelFormat sfmt) { bool ret = false; + int len = 0; struct SwsContext *scale = NULL; - AVFrame *sframe, *dframe; - scale = sws_getCachedContext(scale, sw, sh, PIX_FMT_RGB32, dw, dh, PIX_FMT_RGB32, SWS_BICUBIC, 0, 0, 0); + scale = sws_getCachedContext(scale, sw, sh, sfmt, dw, dh, AV_PIX_FMT_RGB32, SWS_BICUBIC, 0, 0, 0); if (!scale) { lt_info_c("%s: ERROR setting up SWS context\n", __func__); - return false; + return ret; } - sframe = av_frame_alloc(); - dframe = av_frame_alloc(); - if (!sframe || !dframe) { + AVFrame *sframe = av_frame_alloc(); + AVFrame *dframe = av_frame_alloc(); + if (sframe && dframe) { + len = av_image_fill_arrays(sframe->data, sframe->linesize, &(src)[0], sfmt, sw, sh, 1); + if(len>-1) + ret = true; + + if(ret && (len = av_image_fill_arrays(dframe->data, dframe->linesize, &(dst)[0], AV_PIX_FMT_RGB32, dw, dh, 1)<0)) + ret = false; + + if(ret && (len = sws_scale(scale, sframe->data, sframe->linesize, 0, sh, dframe->data, dframe->linesize)<0)) + ret = false; + else + ret = true; + }else{ lt_info_c("%s: could not alloc sframe (%p) or dframe (%p)\n", __func__, sframe, dframe); - goto out; + ret = false; } - avpicture_fill((AVPicture *)sframe, &(src[0]), PIX_FMT_RGB32, sw, sh); - avpicture_fill((AVPicture *)dframe, &(dst[0]), PIX_FMT_RGB32, dw, dh); - sws_scale(scale, sframe->data, sframe->linesize, 0, sh, dframe->data, dframe->linesize); - out: - av_frame_free(&sframe); - av_frame_free(&dframe); - sws_freeContext(scale); + + if(sframe){ + av_frame_free(&sframe); + sframe = NULL; + } + if(dframe){ + av_frame_free(&dframe); + dframe = NULL; + } + if(scale){ + sws_freeContext(scale); + scale = NULL; + } + lt_info_c("%s: %s scale %ix%i to %ix%i ,len %i\n",ret?" ":"ERROR",__func__, sw, sh, dw, dh,len); + return ret; } @@ -613,24 +686,40 @@ bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool ge xres = vid_w * a.num / a.den; } } + if(video.empty()){ + get_video=false; + xres = osd_w; + yres = osd_h; + } if (get_osd) osd = glfb->getOSDBuffer(); - unsigned int need = avpicture_get_size(PIX_FMT_RGB32, xres, yres); + unsigned int need = av_image_get_buffer_size(AV_PIX_FMT_RGB32, xres, yres, 1); data = (unsigned char *)realloc(data, need); /* will be freed by caller */ if (data == NULL) /* out of memory? */ return false; if (get_video) { - if (vid_w != xres || vid_h != yres) /* scale video into data... */ - swscale(&video[0], data, vid_w, vid_h, xres, yres); - else /* get_video and no fancy scaling needed */ + //memcpy dont work with copy BGR24 to RGB32 + if (vid_w != xres || vid_h != yres){ /* scale video into data... */ + bool ret = swscale(&video[0], data, vid_w, vid_h, xres, yres, AV_PIX_FMT_RGB32); + if(!ret){ + free(data); + return false; + } + //memcpy dont work with copy BGR24 to RGB32 + } else { /* get_video and no fancy scaling needed */ memcpy(data, &video[0], xres * yres * sizeof(uint32_t)); + } } if (get_osd && (osd_w != xres || osd_h != yres)) { /* rescale osd */ s_osd.resize(need); - swscale(&(*osd)[0], &s_osd[0], osd_w, osd_h, xres, yres); + bool ret = swscale(&(*osd)[0], &s_osd[0], osd_w, osd_h, xres, yres,AV_PIX_FMT_RGB32); + if(!ret){ + free(data); + return false; + } osd = &s_osd; } diff --git a/generic-pc/video_lib.h b/generic-pc/video_lib.h index e48aa71..832574d 100644 --- a/generic-pc/video_lib.h +++ b/generic-pc/video_lib.h @@ -157,8 +157,8 @@ class cVideo : public Thread /* aspect ratio */ int getAspectRatio(void); - void getPictureInfo(int &width, int &height, int &rate); int setAspectRatio(int aspect, int mode); + void getPictureInfo(int &width, int &height, int &rate); /* cropping mode */ int setCroppingMode(int x = 0 /*vidDispMode_t x = VID_DISPMODE_NORM*/); @@ -170,20 +170,22 @@ class cVideo : public Thread int getBlank(void); int setBlank(int enable); + /* set video_system */ + int SetVideoSystem(int video_system, bool remember = true); + int GetVideoSystem(); + /* change video play state. Parameters are all unused. */ int Start(void *PcrChannel = NULL, unsigned short PcrPid = 0, unsigned short VideoPid = 0, void *x = NULL); int Stop(bool blank = true); bool Pause(void); - /* set video_system */ - int SetVideoSystem(int video_system, bool remember = true); - int GetVideoSystem(); int SetStreamType(VIDEO_FORMAT type); + void ShowPicture(const char * fname); + void SetSyncMode(AVSYNC_TYPE mode); bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; void SetCECAutoView(bool) { return; }; void SetCECAutoStandby(bool) { return; }; - void ShowPicture(const char * fname, const char * destname = NULL); void StopPicture(); void Standby(unsigned int bOn); void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600, int startx = 0, int starty = 0, int endx = 1279, int endy = 719); @@ -218,6 +220,9 @@ class cVideo : public Thread int pig_y; int pig_w; int pig_h; + bool pig_changed; + Mutex still_m; + bool stillpicture; }; #endif From 11d079537908f4ddb20cc3a82bd042e998e6d5c5 Mon Sep 17 00:00:00 2001 From: max_10 Date: Thu, 28 Dec 2017 22:38:01 +0100 Subject: [PATCH 13/36] libeplayer3-arm: audio.c delete newline Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/5930dca63f2f42e7194b48a605c592ff5d79bf2d Author: max_10 Date: 2017-12-28 (Thu, 28 Dec 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/manager/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libeplayer3-arm/manager/audio.c b/libeplayer3-arm/manager/audio.c index fc7603e..5167124 100644 --- a/libeplayer3-arm/manager/audio.c +++ b/libeplayer3-arm/manager/audio.c @@ -146,7 +146,7 @@ static char **ManagerList(Context_t *context __attribute__((unused))) continue; size_t len = strlen(Tracks[i].Name) + 20; char tmp[len]; - snprintf(tmp, len, "%d %s\n", Tracks[i].Id, Tracks[i].Name); + snprintf(tmp, len, "%d %s", Tracks[i].Id, Tracks[i].Name); tracklist[j] = strdup(tmp); tracklist[j + 1] = strdup(Tracks[i].Encoding); } From 06d705133ab73c46bb907d2f318be75a399bb6f2 Mon Sep 17 00:00:00 2001 From: max_10 Date: Sat, 30 Dec 2017 13:41:06 +0100 Subject: [PATCH 14/36] armbox eplayer: fix playing files with subtitles Signed-off-by: Thilo Graf Conflicts: libeplayer3-arm/manager/subtitle.c additional format fixes, solved conflicts and clean up Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/15b4162b580e262cef699a60eca4e198a3bd5dbb Author: max_10 Date: 2017-12-30 (Sat, 30 Dec 2017) ------------------ This commit was generated by Migit --- libeplayer3-arm/manager/subtitle.c | 273 ++++++++++++++++------------- 1 file changed, 147 insertions(+), 126 deletions(-) diff --git a/libeplayer3-arm/manager/subtitle.c b/libeplayer3-arm/manager/subtitle.c index 1d219f2..4b64cd6 100644 --- a/libeplayer3-arm/manager/subtitle.c +++ b/libeplayer3-arm/manager/subtitle.c @@ -33,7 +33,6 @@ #define TRACKWRAP 20 -//#define SAM_WITH_DEBUG #ifdef SAM_WITH_DEBUG #define SUBTITLE_MGR_DEBUG #else @@ -60,19 +59,17 @@ if (debug_level >= level) printf(x); } while (0) #define cERR_SUBTITLE_MGR_NO_ERROR 0 #define cERR_SUBTITLE_MGR_ERROR -1 -static const char FILENAME[] = __FILE__; - /* ***************************** */ /* Types */ /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static Track_t *Tracks = NULL; static int TrackCount = 0; -static int CurrentTrack = -1; //no as default. +static int CurrentTrack = -1; //no as default. /* ***************************** */ /* Prototypes */ @@ -82,23 +79,23 @@ static int CurrentTrack = -1; //no 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) { - - subtitle_mgr_printf(10, "%s::%s %s %s %d\n", FILENAME, __FUNCTION__, - track.Name, track.Encoding, track.Id); + subtitle_mgr_printf(10, "%s::%s %s %s %d\n", __FILE__, __FUNCTION__, track.Name, track.Encoding, track.Id); if (Tracks == NULL) { Tracks = malloc(sizeof(Track_t) * TRACKWRAP); int i; for (i = 0; i < TRACKWRAP; i++) + { Tracks[i].Id = -1; + } } if (Tracks == NULL) { - subtitle_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); + subtitle_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__); return cERR_SUBTITLE_MGR_ERROR; } @@ -119,23 +116,26 @@ static int ManagerAdd(Context_t * context __attribute__((unused)), Track_t track } else { - - subtitle_mgr_err("%s:%s TrackCount out if range %d - %d\n", - FILENAME, __FUNCTION__, TrackCount, TRACKWRAP); + subtitle_mgr_err("%s:%s TrackCount out if range %d - %d\n", __FILE__, __FUNCTION__, TrackCount, TRACKWRAP); return cERR_SUBTITLE_MGR_ERROR; } - subtitle_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + if (TrackCount > 0) + { +// context->playback->isSubtitle = 1; + } + + subtitle_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); return cERR_SUBTITLE_MGR_NO_ERROR; } -static char **ManagerList(Context_t * context __attribute__ ((unused))) +static char **ManagerList(Context_t *context __attribute__((unused))) { char **tracklist = NULL; int i = 0, j = 0; - subtitle_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + subtitle_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); if (Tracks != NULL) { @@ -143,18 +143,20 @@ static char **ManagerList(Context_t * context __attribute__ ((unused))) if (tracklist == NULL) { - subtitle_mgr_err("%s:%s malloc failed\n", FILENAME, - __FUNCTION__); + subtitle_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__); return NULL; } for (i = 0, j = 0; i < TrackCount; i++, j += 2) { if (Tracks[i].pending) + { continue; + } + size_t len = strlen(Tracks[i].Name) + 20; char tmp[len]; - snprintf(tmp, len, "%d %s\n", Tracks[i].Id, Tracks[i].Name); + snprintf(tmp, len, "%d %s", Tracks[i].Id, Tracks[i].Name); tracklist[j] = strdup(tmp); tracklist[j + 1] = strdup(Tracks[i].Encoding); } @@ -162,18 +164,16 @@ static char **ManagerList(Context_t * context __attribute__ ((unused))) tracklist[j] = NULL; } - subtitle_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, - __FUNCTION__, tracklist, j, TrackCount); + subtitle_mgr_printf(10, "%s::%s return %p (%d - %d)\n", __FILE__, __FUNCTION__, tracklist, j, TrackCount); return tracklist; } -static int ManagerDel(Context_t * context __attribute__((unused))) +static int ManagerDel(Context_t *context __attribute__((unused))) { - int i = 0; - subtitle_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + subtitle_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); if (Tracks != NULL) { @@ -187,16 +187,15 @@ static int ManagerDel(Context_t * context __attribute__((unused))) } else { - subtitle_mgr_err("%s::%s nothing to delete!\n", FILENAME, - __FUNCTION__); + subtitle_mgr_err("%s::%s nothing to delete!\n", __FILE__, __FUNCTION__); return cERR_SUBTITLE_MGR_ERROR; } TrackCount = 0; CurrentTrack = -1; +// context->playback->isSubtitle = 0; - subtitle_mgr_printf(10, "%s::%s return no error\n", FILENAME, - __FUNCTION__); + subtitle_mgr_printf(10, "%s::%s return no error\n", __FILE__, __FUNCTION__); return cERR_SUBTITLE_MGR_NO_ERROR; } @@ -205,120 +204,142 @@ static int Command(Context_t *context, ManagerCmd_t command, void *argument) { int ret = cERR_SUBTITLE_MGR_NO_ERROR; - subtitle_mgr_printf(50, "%s::%s %d\n", FILENAME, __FUNCTION__, - command); + subtitle_mgr_printf(50, "%s::%s %d\n", __FILE__, __FUNCTION__, command); switch (command) { - case MANAGER_ADD: - { - Track_t *track = argument; - ret = ManagerAdd(context, *track); - break; - } - case MANAGER_LIST: - { - container_ffmpeg_update_tracks(context, context->playback->uri, 0); - *((char ***) argument) = (char **) ManagerList(context); - break; - } - case MANAGER_GET: - { - if (TrackCount > 0 && CurrentTrack >= 0) - *((int *) argument) = (int) Tracks[CurrentTrack].Id; - else - *((int *) argument) = (int) -1; - break; - } - case MANAGER_GET_TRACK: - { - //subtitle_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", FILENAME, __FUNCTION__); - - if ((TrackCount > 0) && (CurrentTrack >= 0)) + case MANAGER_ADD: { - subtitle_mgr_printf(120, "return %d, %p\n", CurrentTrack, - &Tracks[CurrentTrack]); - *((Track_t **) argument) = - (Track_t *) & Tracks[CurrentTrack]; - } - else - { - subtitle_mgr_printf(20, "return NULL\n"); - *((Track_t **) argument) = NULL; - } - break; - } - case MANAGER_GETENCODING: - { - if (TrackCount > 0 && CurrentTrack >= 0) - *((char **) argument) = - (char *) strdup(Tracks[CurrentTrack].Encoding); - else - *((char **) argument) = (char *) strdup(""); - break; - } - case MANAGER_GETNAME: - { - if (TrackCount > 0 && CurrentTrack >= 0) - *((char **) argument) = - (char *) strdup(Tracks[CurrentTrack].Name); - else - *((char **) argument) = (char *) strdup(""); - break; - } - case MANAGER_SET: - { - int i; - subtitle_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", FILENAME, - __FUNCTION__, *((int *) argument)); - - if (*((int *) argument) < 0) - { - CurrentTrack = -1; + Track_t *track = argument; + ret = ManagerAdd(context, *track); break; } - - for (i = 0; i < TrackCount; i++) - if (Tracks[i].Id == *((int *) argument)) + case MANAGER_LIST: + { + container_ffmpeg_update_tracks(context, context->playback->uri, 0); + *((char ** *)argument) = (char **)ManagerList(context); + break; + } + case MANAGER_GET: + { + if (TrackCount > 0 && CurrentTrack >= 0) { - CurrentTrack = i; + *((int *)argument) = (int)Tracks[CurrentTrack].Id; + } + else + { + *((int *)argument) = (int) - 1; + } + break; + } + case MANAGER_GET_TRACK_DESC: + { + if ((TrackCount > 0) && (CurrentTrack >= 0)) + { + TrackDescription_t *track = malloc(sizeof(TrackDescription_t)); + *((TrackDescription_t **)argument) = track; + if (track) + { + memset(track, 0, sizeof(TrackDescription_t)); + track->Id = Tracks[CurrentTrack].Id; + track->Name = strdup(Tracks[CurrentTrack].Name); + track->Encoding = strdup(Tracks[CurrentTrack].Encoding); + } + } + else + { + *((TrackDescription_t **)argument) = NULL; + } + break; + } + case MANAGER_GET_TRACK: + { + if ((TrackCount > 0) && (CurrentTrack >= 0)) + { + *((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack]; + } + else + { + *((Track_t **)argument) = NULL; + } + break; + } + case MANAGER_GETENCODING: + { + if (TrackCount > 0 && CurrentTrack >= 0) + { + *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Encoding); + } + else + { + *((char **)argument) = (char *)strdup(""); + } + break; + } + case MANAGER_GETNAME: + { + if (TrackCount > 0 && CurrentTrack >= 0) + { + *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Name); + } + else + { + *((char **)argument) = (char *)strdup(""); + } + break; + } + case MANAGER_SET: + { + int i; + subtitle_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", __FILE__, __FUNCTION__, *((int *)argument)); + + if (*((int *)argument) < 0) + { + CurrentTrack = -1; break; } - if (i == TrackCount) - { - subtitle_mgr_err("%s::%s track id %d unknown\n", FILENAME, - __FUNCTION__, *((int *) argument)); - ret = cERR_SUBTITLE_MGR_ERROR; + + for (i = 0; i < TrackCount; i++) + { + if (Tracks[i].Id == *((int *)argument)) + { + CurrentTrack = i; + break; + } + } + + if (i == TrackCount) + { + subtitle_mgr_err("%s::%s track id %d unknown\n", __FILE__, __FUNCTION__, *((int *)argument)); + ret = cERR_SUBTITLE_MGR_ERROR; + } + break; } - break; - } - case MANAGER_DEL: - { - ret = ManagerDel(context); - break; - } - case MANAGER_INIT_UPDATE: - { - int i; - for (i = 0; i < TrackCount; i++) - //if (!Tracks[i].is_static) - Tracks[i].pending = 1; - break; - } - default: - subtitle_mgr_err("%s:%s: ConatinerCmd not supported!", FILENAME, - __FUNCTION__); - ret = cERR_SUBTITLE_MGR_ERROR; - break; + case MANAGER_DEL: + { + ret = ManagerDel(context); + break; + } + case MANAGER_INIT_UPDATE: + { + int i; + for (i = 0; i < TrackCount; i++) + { + Tracks[i].pending = 1; + } + break; + } + default: + subtitle_mgr_err("%s:%s: ContainerCmd not supported!", __FILE__, __FUNCTION__); + ret = cERR_SUBTITLE_MGR_ERROR; + break; } - subtitle_mgr_printf(50, "%s:%s: returning %d\n", FILENAME, - __FUNCTION__, ret); + subtitle_mgr_printf(50, "%s:%s: returning %d\n", __FILE__, __FUNCTION__, ret); return ret; } - struct Manager_s SubtitleManager = { "Subtitle", From 45b02da77be154099127990a6e37c68565e6cdfc Mon Sep 17 00:00:00 2001 From: max_10 Date: Sun, 8 Oct 2017 16:51:10 +0200 Subject: [PATCH 15/36] armbox: Cosmetics replace spaces with tabs and delete unnecessary tabs Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/8f242002a947c336823e9c7fe9899735b9ba57e1 Author: max_10 Date: 2017-10-08 (Sun, 08 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 43 ++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 6007a67..cb6c6d0 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -52,18 +52,18 @@ extern cAudio * audioDecoder; typedef enum { - GST_PLAY_FLAG_VIDEO = (1 << 0), - GST_PLAY_FLAG_AUDIO = (1 << 1), - GST_PLAY_FLAG_TEXT = (1 << 2), - GST_PLAY_FLAG_VIS = (1 << 3), - GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4), - GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5), - GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6), - GST_PLAY_FLAG_DOWNLOAD = (1 << 7), - GST_PLAY_FLAG_BUFFERING = (1 << 8), - GST_PLAY_FLAG_DEINTERLACE = (1 << 9), - GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10), - GST_PLAY_FLAG_FORCE_FILTERS = (1 << 11), + GST_PLAY_FLAG_VIDEO = (1 << 0), + GST_PLAY_FLAG_AUDIO = (1 << 1), + GST_PLAY_FLAG_TEXT = (1 << 2), + GST_PLAY_FLAG_VIS = (1 << 3), + GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4), + GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5), + GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6), + GST_PLAY_FLAG_DOWNLOAD = (1 << 7), + GST_PLAY_FLAG_BUFFERING = (1 << 8), + GST_PLAY_FLAG_DEINTERLACE = (1 << 9), + GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10), + GST_PLAY_FLAG_FORCE_FILTERS = (1 << 11), } GstPlayFlags; @@ -354,6 +354,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) gst_object_unref(GST_OBJECT(videoSink)); videoSink = NULL; } + + // set audio sink children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin)); if (children && gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBAudioSink")) { @@ -363,6 +365,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) } gst_iterator_free(children); + + // set video sink children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin)); if (children && gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBVideoSink")) { @@ -370,7 +374,10 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) g_value_unset (&r); lt_info_c( "%s %s - video sink created\n", FILENAME, __FUNCTION__); } + gst_iterator_free(children); + } + break; } break; @@ -408,13 +415,13 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) return GST_BUS_DROP; } - cPlayback::cPlayback(int num) { lt_info( "%s:%s\n", FILENAME, __FUNCTION__); const gchar *nano_str; guint major, minor, micro, nano; + /* init gstreamer */ gst_init(NULL, NULL); gst_version (&major, &minor, µ, &nano); @@ -443,6 +450,7 @@ cPlayback::cPlayback(int num) first = false; } +/* called at housekepping */ cPlayback::~cPlayback() { lt_info( "%s:%s\n", FILENAME, __FUNCTION__); @@ -611,12 +619,14 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/, flags |= GST_PLAY_FLAG_BUFFERING; } + // set flags g_object_set(G_OBJECT (m_gst_playbin), "flags", flags, NULL); + // set uri g_object_set(G_OBJECT (m_gst_playbin), "uri", uri, NULL); //gstbus handler - GstBus * bus = gst_pipeline_get_bus( GST_PIPELINE(m_gst_playbin) ); + GstBus * bus = gst_pipeline_get_bus(GST_PIPELINE(m_gst_playbin)); gst_bus_set_sync_handler(bus, Gst_bus_call, NULL, NULL); if (bus) gst_object_unref(bus); @@ -673,6 +683,7 @@ bool cPlayback::Stop(void) { if(playing == false) return false; + lt_info( "%s:%s playing %d\n", FILENAME, __FUNCTION__, playing); // stop @@ -846,7 +857,7 @@ bool cPlayback::GetPosition(int &position, int &duration) lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); } } - position = pts / 1000000.0; + position = pts / 1000000.0; // duration GstFormat fmt_d = GST_FORMAT_TIME; //Returns time in nanosecs double length = 0; @@ -997,7 +1008,7 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu gst_tag_list_free(tags); } } - *numpida=i; + *numpida = i; } } From d85da6867a578325e6a407a53636b81acb15aea5 Mon Sep 17 00:00:00 2001 From: max_10 Date: Sat, 14 Oct 2017 11:18:21 +0200 Subject: [PATCH 16/36] libarmbox: fix resolution icon in infoviewer Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/f41378c49238c388687dceceb4d567b051a3a0f8 Author: max_10 Date: 2017-10-14 (Sat, 14 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 56bf050..7223a97 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -470,10 +470,6 @@ int cVideo::Stop(bool blank) int cVideo::setBlank(int) { - fop(ioctl, VIDEO_PLAY); - fop(ioctl, VIDEO_CONTINUE); - video_still_picture sp = { NULL, 0 }; - fop(ioctl, VIDEO_STILLPICTURE, &sp); return Stop(1); } From e1046bd30e4fe44a7292ca2bec9681d9615c5962 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 11 Nov 2017 16:52:38 +0100 Subject: [PATCH 17/36] return false in decoder have no time Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/5f230f4d38275396c83ea6220ee5fe30caa815b1 Author: Jacek Jendrzej Date: 2017-11-11 (Sat, 11 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index cb6c6d0..dacbd63 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -848,6 +848,7 @@ bool cPlayback::GetPosition(int &position, int &duration) if (!GST_CLOCK_TIME_IS_VALID(pts)) { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); + return false; } } else @@ -855,6 +856,7 @@ bool cPlayback::GetPosition(int &position, int &duration) if(!gst_element_query_position(m_gst_playbin, fmt, &pts)) { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); + return false; } } position = pts / 1000000.0; From e42875662de7ba58e367830ace843f963e7fe1f3 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 12 Nov 2017 08:57:41 +0100 Subject: [PATCH 18/36] Revert "return false in decoder have no time" This reverts commit e2c368551fd2adfd5ee2c7a5218551ee5b4ad5a4. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/d275525164461a8c86df45305ab8b9fa5ea24bba Author: Jacek Jendrzej Date: 2017-11-12 (Sun, 12 Nov 2017) ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index dacbd63..cb6c6d0 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -848,7 +848,6 @@ bool cPlayback::GetPosition(int &position, int &duration) if (!GST_CLOCK_TIME_IS_VALID(pts)) { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); - return false; } } else @@ -856,7 +855,6 @@ bool cPlayback::GetPosition(int &position, int &duration) if(!gst_element_query_position(m_gst_playbin, fmt, &pts)) { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); - return false; } } position = pts / 1000000.0; From 3937c681fd7f04cdf51118e9bd8b6b69d642db44 Mon Sep 17 00:00:00 2001 From: max_10 Date: Tue, 14 Nov 2017 13:36:29 +0100 Subject: [PATCH 19/36] Revert "Revert "libeplayer3: switch off the teletext sub"" This reverts commit 2377c0ce4ed65e78a49e73efadb701dce24cdd24. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/233e756d04c1091895eb016d56f0e0fba6f627f9 Author: max_10 Date: 2017-11-14 (Tue, 14 Nov 2017) ------------------ This commit was generated by Migit --- libeplayer3/input.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libeplayer3/input.cpp b/libeplayer3/input.cpp index 7218a4f..9af9aae 100644 --- a/libeplayer3/input.cpp +++ b/libeplayer3/input.cpp @@ -80,7 +80,7 @@ extern void dvbsub_write(AVSubtitle *, int64_t); extern void dvbsub_ass_write(AVCodecContext *c, AVSubtitle *sub, int pid); extern void dvbsub_ass_clear(void); // from neutrino-mp/lib/lib/libtuxtxt/tuxtxt_common.h -extern void teletext_write(int pid, uint8_t *data, int size); +//extern void teletext_write(int pid, uint8_t *data, int size); static std::string lastlog_message; static unsigned int lastlog_repeats; @@ -253,10 +253,11 @@ bool Input::Play() } } } - } else if (_teletextTrack && (_teletextTrack->stream == stream)) { - if (packet.data && packet.size > 1) - teletext_write(_teletextTrack->pid, packet.data + 1, packet.size - 1); } +// else if (_teletextTrack && (_teletextTrack->stream == stream)) { +// if (packet.data && packet.size > 1) +// teletext_write(_teletextTrack->pid, packet.data + 1, packet.size - 1); +// } #if (LIBAVFORMAT_VERSION_MAJOR == 57 && LIBAVFORMAT_VERSION_MINOR == 25) av_packet_unref(&packet); From 2b305610da84d1bbc5534f478162143cdb74116f Mon Sep 17 00:00:00 2001 From: max_10 Date: Fri, 1 Dec 2017 11:32:54 +0100 Subject: [PATCH 20/36] test Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/65a67f79192ae7a16a16f87de4b1101211505191 Author: max_10 Date: 2017-12-01 (Fri, 01 Dec 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/audio.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libarmbox/audio.cpp b/libarmbox/audio.cpp index 8064633..79470a5 100644 --- a/libarmbox/audio.cpp +++ b/libarmbox/audio.cpp @@ -200,10 +200,11 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian) const char *mix_dev = getenv("MIX_DEVICE"); lt_debug("%s ch %d srate %d bits %d le %d\n", __FUNCTION__, ch, srate, bits, little_endian); if (clipfd > -1) { - lt_info("%s: clipfd already opened (%d)\n", __FUNCTION__, clipfd); + lt_info("%s: clipfd already opened (%d)\n", __func__, clipfd); return -1; } mixer_num = -1; + mixer_fd = -1; /* a different DSP device can be given with DSP_DEVICE and MIX_DEVICE * if this device cannot be opened, we fall back to the internal OSS device * Example: @@ -215,7 +216,7 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian) if ((!dsp_dev) || (access(dsp_dev, W_OK))) { if (dsp_dev) lt_info("%s: DSP_DEVICE is set (%s) but cannot be opened," - " fall back to /dev/dsp\n", __func__, dsp_dev); + " fall back to /dev/dsp\n", __func__, dsp_dev); dsp_dev = "/dev/dsp"; } if ((!mix_dev) || (access(mix_dev, W_OK))) { From 49c2590b98ee103c4e3244497893dada5d09e5d4 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 10 Dec 2017 20:28:18 +0100 Subject: [PATCH 21/36] generic gestreamer align to armbox Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/136306c6d521e98de041c3190b46cfac0b1f0fd8 Author: TangoCash Date: 2017-12-10 (Sun, 10 Dec 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- generic-pc/playback_gst_10.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/generic-pc/playback_gst_10.cpp b/generic-pc/playback_gst_10.cpp index 8acb951..1e99a1f 100644 --- a/generic-pc/playback_gst_10.cpp +++ b/generic-pc/playback_gst_10.cpp @@ -474,6 +474,13 @@ bool cPlayback::Open(playmode_t PlayMode) { lt_info("%s: PlayMode %d\n", __func__, PlayMode); + if (PlayMode != PLAYMODE_TS) + { + audioDecoder->closeDevice(); + videoDecoder->closeDevice(); + decoders_closed = true; + } + init_jump = -1; return true; } @@ -521,6 +528,12 @@ void cPlayback::Close(void) m_gst_playbin = NULL; + if (decoders_closed) + { + audioDecoder->openDevice(); + videoDecoder->openDevice(); + decoders_closed = false; + } } } @@ -735,6 +748,14 @@ bool cPlayback::SetSpeed(int speed) { lt_info( "%s:%s speed %d\n", FILENAME, __FUNCTION__, speed); + if (!decoders_closed) + { + audioDecoder->closeDevice(); + videoDecoder->closeDevice(); + decoders_closed = true; + usleep(500000); + } + if(playing == false) return false; From 921cae60050f0f36f734b5eee068d3a4187ad087 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 10 Dec 2017 20:30:01 +0100 Subject: [PATCH 22/36] fix last commit Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/0290cefdee34e65aec0132ba255c078fb731d53f Author: TangoCash Date: 2017-12-10 (Sun, 10 Dec 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- generic-pc/playback_gst_10.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/generic-pc/playback_gst_10.cpp b/generic-pc/playback_gst_10.cpp index 1e99a1f..8acb951 100644 --- a/generic-pc/playback_gst_10.cpp +++ b/generic-pc/playback_gst_10.cpp @@ -474,13 +474,6 @@ bool cPlayback::Open(playmode_t PlayMode) { lt_info("%s: PlayMode %d\n", __func__, PlayMode); - if (PlayMode != PLAYMODE_TS) - { - audioDecoder->closeDevice(); - videoDecoder->closeDevice(); - decoders_closed = true; - } - init_jump = -1; return true; } @@ -528,12 +521,6 @@ void cPlayback::Close(void) m_gst_playbin = NULL; - if (decoders_closed) - { - audioDecoder->openDevice(); - videoDecoder->openDevice(); - decoders_closed = false; - } } } @@ -748,14 +735,6 @@ bool cPlayback::SetSpeed(int speed) { lt_info( "%s:%s speed %d\n", FILENAME, __FUNCTION__, speed); - if (!decoders_closed) - { - audioDecoder->closeDevice(); - videoDecoder->closeDevice(); - decoders_closed = true; - usleep(500000); - } - if(playing == false) return false; From 3a4468c5877e678ebf4874c07f136dc83d8614df Mon Sep 17 00:00:00 2001 From: max_10 Date: Wed, 17 Jan 2018 20:05:32 +0100 Subject: [PATCH 23/36] adding SLOWMOTION, FASTBACKWARD and FASTFORWARD are not working properly yet. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/c5dc767b64cf5bf8363517ce6d109c6492dd7c61 Author: max_10 Date: 2018-01-17 (Wed, 17 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/playback/playback.c | 119 ++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index ba1b8c0..f0c0563 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -409,6 +409,110 @@ static int32_t PlaybackTerminate(Context_t *context) return ret; } +static int PlaybackFastForward(Context_t *context, int *speed) +{ + int32_t ret = cERR_PLAYBACK_NO_ERROR; + playback_printf(10, "speed %d\n", *speed); + /* Audio only forwarding not supported */ + if (context->playback->isVideo && !context->playback->isHttp && !context->playback->BackWard && (!context->playback->isPaused || context->playback->isPlaying)) + { + if ((*speed <= 0) || (*speed > cMaxSpeed_ff)) + { + playback_err("speed %d out of range (1 - %d) \n", *speed, cMaxSpeed_ff); + return cERR_PLAYBACK_ERROR; + } + context->playback->isForwarding = 1; + context->playback->Speed = *speed; + playback_printf(20, "Speed: %d x {%d}\n", *speed, context->playback->Speed); + context->output->Command(context, OUTPUT_FASTFORWARD, NULL); + } + else + { + playback_err("fast forward not possible\n"); + ret = cERR_PLAYBACK_ERROR; + } + playback_printf(10, "exiting with value %d\n", ret); + return ret; +} + +static int PlaybackFastBackward(Context_t *context, int *speed) +{ + int32_t ret = cERR_PLAYBACK_NO_ERROR; + playback_printf(10, "speed = %d\n", *speed); + /* Audio only reverse play not supported */ + if (context->playback->isVideo && !context->playback->isForwarding && (!context->playback->isPaused || context->playback->isPlaying)) + { + if ((*speed > 0) || (*speed < cMaxSpeed_fr)) + { + playback_err("speed %d out of range (0 - %d) \n", *speed, cMaxSpeed_fr); + return cERR_PLAYBACK_ERROR; + } + if (*speed == 0) + { + context->playback->BackWard = 0; + context->playback->Speed = 0; /* reverse end */ + } + 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->output->Command(context, OUTPUT_AUDIOMUTE, "1"); + context->output->Command(context, OUTPUT_CLEAR, NULL); + if (context->output->Command(context, OUTPUT_REVERSE, NULL) < 0) + { + playback_err("OUTPUT_REVERSE failed\n"); + context->playback->BackWard = 0; + context->playback->Speed = 1; + context->playback->isSeeking = 0; + ret = cERR_PLAYBACK_ERROR; + } + } + else + { + playback_err("fast backward not possible\n"); + ret = cERR_PLAYBACK_ERROR; + } + context->playback->isSeeking = 0; + playback_printf(10, "exiting with value %d\n", ret); + return ret; +} + +static int32_t PlaybackSlowMotion(Context_t *context, int *speed) +{ + int32_t ret = cERR_PLAYBACK_NO_ERROR; + playback_printf(10, "\n"); + //Audio only forwarding not supported + if (context->playback->isVideo && !context->playback->isHttp && context->playback->isPlaying) + { + if (context->playback->isPaused) + PlaybackContinue(context); + switch (*speed) + { + case 2: + context->playback->SlowMotion = 2; + break; + case 4: + context->playback->SlowMotion = 4; + break; + case 8: + context->playback->SlowMotion = 8; + break; + } + playback_printf(20, "SlowMotion: %d x {%d}\n", *speed, context->playback->SlowMotion); + context->output->Command(context, OUTPUT_SLOWMOTION, NULL); + } + else + { + playback_err("slowmotion not possible\n"); + ret = cERR_PLAYBACK_ERROR; + } + playback_printf(10, "exiting with value %d\n", ret); + return ret; +} + static int32_t PlaybackSeek(Context_t *context, int64_t *pos, uint8_t absolute) { int32_t ret = cERR_PLAYBACK_NO_ERROR; @@ -678,6 +782,21 @@ static int32_t Command(void *_context, PlaybackCmd_t command, void *argument) ret = PlaybackInfo(context, (char **)argument); break; } + case PLAYBACK_SLOWMOTION: + { + ret = PlaybackSlowMotion(context, (int *)argument); + break; + } + case PLAYBACK_FASTBACKWARD: + { + ret = PlaybackFastBackward(context, (int *)argument); + break; + } + case PLAYBACK_FASTFORWARD: + { + ret = PlaybackFastForward(context, (int *)argument); + break; + } case PLAYBACK_GET_FRAME_COUNT: { ret = PlaybackGetFrameCount(context, (uint64_t *)argument); From cf6d1707ef0813c3ff78952c86d3ac399a5d73b1 Mon Sep 17 00:00:00 2001 From: max_10 Date: Wed, 17 Jan 2018 20:26:54 +0100 Subject: [PATCH 24/36] libeplayer3-arm: eliminate some warnings Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/5ccdc663b2b5cb887e239d9c0690adb6ec39f0e8 Author: max_10 Date: 2018-01-17 (Wed, 17 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/manager/audio.c | 42 +++++++++++------------- libeplayer3-arm/manager/video.c | 32 +++++++++--------- libeplayer3-arm/output/linuxdvb_mipsel.c | 2 +- libeplayer3-arm/output/output.c | 14 ++++---- libeplayer3-arm/output/output_subtitle.c | 2 -- 5 files changed, 42 insertions(+), 50 deletions(-) diff --git a/libeplayer3-arm/manager/audio.c b/libeplayer3-arm/manager/audio.c index 5167124..9bf93ab 100644 --- a/libeplayer3-arm/manager/audio.c +++ b/libeplayer3-arm/manager/audio.c @@ -61,8 +61,6 @@ if (debug_level >= level) printf("[%s:%s] \n" fmt, __FILE__, __FUNCTION__, ## x) #define cERR_AUDIO_MGR_NO_ERROR 0 #define cERR_AUDIO_MGR_ERROR -1 -static const char FILENAME[] = __FILE__; - /* ***************************** */ /* Types */ /* ***************************** */ @@ -85,7 +83,7 @@ static int CurrentTrack = 0; //TRACK[0] as default. static int ManagerAdd(Context_t *context, Track_t track) { - audio_mgr_printf(10, "%s::%s name=\"%s\" encoding=\"%s\" id=%d\n", FILENAME, __FUNCTION__, track.Name, track.Encoding, track.Id); + audio_mgr_printf(10, "%s::%s name=\"%s\" encoding=\"%s\" id=%d\n", __FILE__, __FUNCTION__, track.Name, track.Encoding, track.Id); if (Tracks == NULL) { Tracks = malloc(sizeof(Track_t) * TRACKWRAP); @@ -97,7 +95,7 @@ static int ManagerAdd(Context_t *context, Track_t track) } if (Tracks == NULL) { - audio_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); + audio_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__); return cERR_AUDIO_MGR_ERROR; } int i = 0; @@ -116,14 +114,14 @@ static int ManagerAdd(Context_t *context, Track_t track) } else { - audio_mgr_err("%s:%s TrackCount out if range %d - %d\n", FILENAME, __FUNCTION__, TrackCount, TRACKWRAP); + audio_mgr_err("%s:%s TrackCount out if range %d - %d\n", __FILE__, __FUNCTION__, TrackCount, TRACKWRAP); return cERR_AUDIO_MGR_ERROR; } if (TrackCount > 0) { context->playback->isAudio = 1; } - audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); return cERR_AUDIO_MGR_NO_ERROR; } @@ -131,13 +129,13 @@ static char **ManagerList(Context_t *context __attribute__((unused))) { int i = 0, j = 0; char **tracklist = NULL; - audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); if (Tracks != NULL) { tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); if (tracklist == NULL) { - audio_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); + audio_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__); return NULL; } for (i = 0, j = 0; i < TrackCount; i++, j += 2) @@ -152,7 +150,7 @@ static char **ManagerList(Context_t *context __attribute__((unused))) } tracklist[j] = NULL; } - audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount); + audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", __FILE__, __FUNCTION__, tracklist, j, TrackCount); return tracklist; } @@ -161,13 +159,13 @@ static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused { int i = 0; TrackDescription_t *tracklist = NULL; - audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); if (Tracks != NULL) { tracklist = malloc(sizeof(TrackDescription_t) * ((TrackCount) + 1)); if (tracklist == NULL) { - audio_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); + audio_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__); return NULL; } int j = 0; @@ -184,7 +182,7 @@ static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused } tracklist[j].Id = -1; } - //audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount); + //audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", __FILE__, __FUNCTION__, tracklist, j, TrackCount); return tracklist; } #endif @@ -192,7 +190,7 @@ static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused static int ManagerDel(Context_t *context) { int i = 0; - audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); if (Tracks != NULL) { for (i = 0; i < TrackCount; i++) @@ -204,13 +202,13 @@ static int ManagerDel(Context_t *context) } else { - audio_mgr_err("%s::%s nothing to delete!\n", FILENAME, __FUNCTION__); + audio_mgr_err("%s::%s nothing to delete!\n", __FILE__, __FUNCTION__); return cERR_AUDIO_MGR_ERROR; } TrackCount = 0; CurrentTrack = 0; context->playback->isAudio = 0; - audio_mgr_printf(10, "%s::%s return no error\n", FILENAME, __FUNCTION__); + audio_mgr_printf(10, "%s::%s return no error\n", __FILE__, __FUNCTION__); return cERR_AUDIO_MGR_NO_ERROR; } @@ -218,7 +216,7 @@ static int Command(void *_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", FILENAME, __FUNCTION__); + audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); switch (command) { case MANAGER_ADD: @@ -235,7 +233,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) } case MANAGER_GET: { - audio_mgr_printf(20, "%s::%s MANAGER_GET\n", FILENAME, __FUNCTION__); + audio_mgr_printf(20, "%s::%s MANAGER_GET\n", __FILE__, __FUNCTION__); if ((TrackCount > 0) && (CurrentTrack >= 0)) { *((int *)argument) = (int)Tracks[CurrentTrack].Id; @@ -268,7 +266,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) } case MANAGER_GET_TRACK: { - audio_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", FILENAME, __FUNCTION__); + audio_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", __FILE__, __FUNCTION__); if ((TrackCount > 0) && (CurrentTrack >= 0)) { *((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack]; @@ -306,7 +304,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) case MANAGER_SET: { int i; - audio_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", FILENAME, __FUNCTION__, *((int *)argument)); + audio_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", __FILE__, __FUNCTION__, *((int *)argument)); for (i = 0; i < TrackCount; i++) { if (Tracks[i].Id == *((int *)argument)) @@ -317,7 +315,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) } if (i == TrackCount) { - audio_mgr_err("%s::%s track id %d unknown\n", FILENAME, __FUNCTION__, *((int *)argument)); + audio_mgr_err("%s::%s track id %d unknown\n", __FILE__, __FUNCTION__, *((int *)argument)); ret = cERR_AUDIO_MGR_ERROR; } break; @@ -337,11 +335,11 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) break; } default: - audio_mgr_err("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); + audio_mgr_err("%s::%s ContainerCmd %d not supported!\n", __FILE__, __FUNCTION__, command); ret = cERR_AUDIO_MGR_ERROR; break; } - audio_mgr_printf(10, "%s:%s: returning %d\n", FILENAME, __FUNCTION__, ret); + audio_mgr_printf(10, "%s:%s: returning %d\n", __FILE__, __FUNCTION__, ret); return ret; } diff --git a/libeplayer3-arm/manager/video.c b/libeplayer3-arm/manager/video.c index ee5ef5f..70d2272 100644 --- a/libeplayer3-arm/manager/video.c +++ b/libeplayer3-arm/manager/video.c @@ -59,8 +59,6 @@ if (debug_level >= level) printf(x); } while (0) #define cERR_VIDEO_MGR_NO_ERROR 0 #define cERR_VIDEO_MGR_ERROR -1 -static const char FILENAME[] = __FILE__; - /* ***************************** */ /* Types */ /* ***************************** */ @@ -85,7 +83,7 @@ static void (* updatedTrackInfoFnc)(void) = NULL; static int ManagerAdd(Context_t *context, Track_t track) { - video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); if (Tracks == NULL) { Tracks = malloc(sizeof(Track_t) * TRACKWRAP); @@ -97,7 +95,7 @@ static int ManagerAdd(Context_t *context, Track_t track) } if (Tracks == NULL) { - video_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); + video_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__); return cERR_VIDEO_MGR_ERROR; } int i; @@ -116,14 +114,14 @@ static int ManagerAdd(Context_t *context, Track_t track) } else { - video_mgr_err("%s:%s TrackCount out if range %d - %d\n", FILENAME, __FUNCTION__, TrackCount, TRACKWRAP); + video_mgr_err("%s:%s TrackCount out if range %d - %d\n", __FILE__, __FUNCTION__, TrackCount, TRACKWRAP); return cERR_VIDEO_MGR_ERROR; } if (TrackCount > 0) { context->playback->isVideo = 1; } - video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); return cERR_VIDEO_MGR_NO_ERROR; } @@ -131,13 +129,13 @@ static char **ManagerList(Context_t *context __attribute__((unused))) { int i = 0, j = 0; char **tracklist = NULL; - video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); if (Tracks != NULL) { tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); if (tracklist == NULL) { - video_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); + video_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__); return NULL; } for (i = 0, j = 0; i < TrackCount; i++, j += 2) @@ -154,14 +152,14 @@ static char **ManagerList(Context_t *context __attribute__((unused))) } tracklist[j] = NULL; } - video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount); + video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", __FILE__, __FUNCTION__, tracklist, j, TrackCount); return tracklist; } static int ManagerDel(Context_t *context) { int i = 0; - video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); if (Tracks != NULL) { for (i = 0; i < TrackCount; i++) @@ -173,13 +171,13 @@ static int ManagerDel(Context_t *context) } else { - video_mgr_err("%s::%s nothing to delete!\n", FILENAME, __FUNCTION__); + video_mgr_err("%s::%s nothing to delete!\n", __FILE__, __FUNCTION__); return cERR_VIDEO_MGR_ERROR; } TrackCount = 0; CurrentTrack = 0; context->playback->isVideo = 0; - video_mgr_printf(10, "%s::%s return no error\n", FILENAME, __FUNCTION__); + video_mgr_printf(10, "%s::%s return no error\n", __FILE__, __FUNCTION__); return cERR_VIDEO_MGR_NO_ERROR; } @@ -187,7 +185,7 @@ static int Command(void *_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", FILENAME, __FUNCTION__); + video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); switch (command) { case MANAGER_ADD: @@ -242,7 +240,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) } case MANAGER_GET_TRACK: { - video_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", FILENAME, __FUNCTION__); + video_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", __FILE__, __FUNCTION__); if ((TrackCount > 0) && (CurrentTrack >= 0)) { *((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack]; @@ -290,7 +288,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) } if (i == TrackCount) { - video_mgr_err("%s::%s track id %d unknown\n", FILENAME, __FUNCTION__, *((int *)argument)); + video_mgr_err("%s::%s track id %d unknown\n", __FILE__, __FUNCTION__, *((int *)argument)); ret = cERR_VIDEO_MGR_ERROR; } break; @@ -321,11 +319,11 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) break; } default: - video_mgr_err("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); + video_mgr_err("%s::%s ContainerCmd %d not supported!\n", __FILE__, __FUNCTION__, command); ret = cERR_VIDEO_MGR_ERROR; break; } - video_mgr_printf(10, "%s:%s: returning %d\n", FILENAME, __FUNCTION__, ret); + video_mgr_printf(10, "%s:%s: returning %d\n", __FILE__, __FUNCTION__, ret); return ret; } diff --git a/libeplayer3-arm/output/linuxdvb_mipsel.c b/libeplayer3-arm/output/linuxdvb_mipsel.c index 85831ba..6526917 100644 --- a/libeplayer3-arm/output/linuxdvb_mipsel.c +++ b/libeplayer3-arm/output/linuxdvb_mipsel.c @@ -58,7 +58,7 @@ #define LINUXDVB_SILENT #endif -static short debug_level = 20; +static unsigned short debug_level = 20; static const char FILENAME[] = __FILE__; diff --git a/libeplayer3-arm/output/output.c b/libeplayer3-arm/output/output.c index 47ef2e2..c946c4b 100644 --- a/libeplayer3-arm/output/output.c +++ b/libeplayer3-arm/output/output.c @@ -57,8 +57,6 @@ if (debug_level >= level) fprintf(stderr, x); } while (0) #define cERR_OUTPUT_NO_ERROR 0 #define cERR_OUTPUT_INTERNAL_ERROR -1 -static const char *FILENAME = "output.c"; - /* ***************************** */ /* Types */ /* ***************************** */ @@ -85,7 +83,7 @@ static Output_t *AvailableOutput[] = static void printOutputCapabilities() { int i, j; - output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + output_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); output_printf(10, "Capabilities:\n"); for (i = 0; AvailableOutput[i] != NULL; i++) { @@ -105,7 +103,7 @@ static void printOutputCapabilities() static void OutputAdd(Context_t *context, char *port) { int i, j; - output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + output_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); for (i = 0; AvailableOutput[i] != NULL; i++) { for (j = 0; AvailableOutput[i]->Capabilities[j] != NULL; j++) @@ -134,7 +132,7 @@ static void OutputAdd(Context_t *context, char *port) static void OutputDel(Context_t *context, char *port) { - output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); + output_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); if (!strcmp("audio", port)) { context->output->audio = NULL; @@ -153,7 +151,7 @@ static int Command(void *_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", FILENAME, __FUNCTION__, command); + output_printf(10, "%s::%s Command %d\n", __FILE__, __FUNCTION__, command); switch (command) { case OUTPUT_OPEN: @@ -542,11 +540,11 @@ static int Command(void *_context, OutputCmd_t command, void *argument) } } default: - output_err("%s::%s OutputCmd %d not supported!\n", FILENAME, __FUNCTION__, command); + output_err("%s::%s OutputCmd %d not supported!\n", __FILE__, __FUNCTION__, command); ret = cERR_OUTPUT_INTERNAL_ERROR; break; } - output_printf(10, "%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); + output_printf(10, "%s::%s exiting with value %d\n", __FILE__, __FUNCTION__, ret); return ret; } diff --git a/libeplayer3-arm/output/output_subtitle.c b/libeplayer3-arm/output/output_subtitle.c index 607bb4b..0e8fe9b 100644 --- a/libeplayer3-arm/output/output_subtitle.c +++ b/libeplayer3-arm/output/output_subtitle.c @@ -68,8 +68,6 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); #define cERR_SUBTITLE_NO_ERROR 0 #define cERR_SUBTITLE_ERROR -1 -static const char FILENAME[] = __FILE__; - /* Number, Style, Name,, MarginL, MarginR, MarginV, Effect,, Text From 2f7422532bfaa8667d477aa1fb01f6a1b104f148 Mon Sep 17 00:00:00 2001 From: max_10 Date: Wed, 17 Jan 2018 21:00:50 +0100 Subject: [PATCH 25/36] libeplayer3-arm: Code formatting Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/8fe7fd7a3c63229617d2baa72a1ca4d7a130dc6f Author: max_10 Date: 2018-01-17 (Wed, 17 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/container/buff_ffmpeg.c | 5 +- libeplayer3-arm/container/container.c | 2 +- libeplayer3-arm/container/container_ffmpeg.c | 80 +++++---- libeplayer3-arm/container/mpeg4p2_ffmpeg.c | 12 +- libeplayer3-arm/external/ffmpeg/get_bits.h | 154 +++++++++--------- libeplayer3-arm/external/ffmpeg/mathops.h | 2 +- libeplayer3-arm/external/ffmpeg/mpeg4audio.h | 2 +- libeplayer3-arm/external/ffmpeg/put_bits.h | 6 +- .../external/ffmpeg/src/bitstream.c | 3 +- .../external/ffmpeg/src/mpeg4audio.c | 12 +- .../external/flv2mpeg4/src/flv2mpeg4.c | 16 +- .../external/flv2mpeg4/src/m4vencode.c | 4 +- libeplayer3-arm/include/aac.h | 2 +- libeplayer3-arm/include/common.h | 2 +- libeplayer3-arm/include/manager.h | 2 - libeplayer3-arm/include/misc.h | 16 +- libeplayer3-arm/include/output.h | 2 +- libeplayer3-arm/include/playback.h | 23 ++- libeplayer3-arm/main/exteplayer.c | 12 +- libeplayer3-arm/manager/audio.c | 6 +- libeplayer3-arm/manager/video.c | 2 +- libeplayer3-arm/output/linuxdvb_mipsel.c | 10 +- libeplayer3-arm/output/linuxdvb_sh4.c | 4 +- libeplayer3-arm/output/output.c | 2 +- libeplayer3-arm/output/output_subtitle.c | 6 +- libeplayer3-arm/output/writer/mipsel/aac.c | 10 +- libeplayer3-arm/output/writer/mipsel/ac3.c | 4 +- libeplayer3-arm/output/writer/mipsel/divx3.c | 7 +- libeplayer3-arm/output/writer/mipsel/h263.c | 1 + libeplayer3-arm/output/writer/mipsel/h264.c | 6 +- libeplayer3-arm/output/writer/mipsel/h265.c | 2 +- libeplayer3-arm/output/writer/mipsel/pcm.c | 3 +- libeplayer3-arm/output/writer/mipsel/vc1.c | 5 +- libeplayer3-arm/output/writer/mipsel/wmv.c | 5 +- libeplayer3-arm/output/writer/mipsel/writer.c | 1 + libeplayer3-arm/output/writer/sh4/aac.c | 6 +- libeplayer3-arm/output/writer/sh4/h264.c | 7 +- libeplayer3-arm/output/writer/sh4/mpeg2.c | 2 +- libeplayer3-arm/output/writer/sh4/pcm.c | 10 +- libeplayer3-arm/output/writer/sh4/vc1.c | 22 +-- libeplayer3-arm/output/writer/sh4/wmv.c | 13 +- libeplayer3-arm/playback/playback.c | 13 +- 42 files changed, 261 insertions(+), 243 deletions(-) diff --git a/libeplayer3-arm/container/buff_ffmpeg.c b/libeplayer3-arm/container/buff_ffmpeg.c index 1f394dd..7d6cc96 100644 --- a/libeplayer3-arm/container/buff_ffmpeg.c +++ b/libeplayer3-arm/container/buff_ffmpeg.c @@ -103,8 +103,7 @@ static void update_finish_timeout() /* On some STBs PTS readed from decoder is invalid after seek or at start * this is the reason for additional validation when we what to close immediately */ - if (!progressive_playback && 0 == ret && currPts >= maxInjectedPts && - ((currPts - maxInjectedPts) / 90000) < 2) + if (!progressive_playback && 0 == ret && currPts >= maxInjectedPts && ((currPts - maxInjectedPts) / 90000) < 2) { /* close immediately */ @@ -250,7 +249,7 @@ static void ffmpeg_filler(Context_t *context, int32_t id, int32_t *inpause, int3 return; } while ((flag == 0 && avContextTab[0] != NULL && avContextTab[0]->pb != NULL && rwdiff > FILLBUFDIFF) || - (flag == 1 && hasfillerThreadStarted[id] == 1 && avContextTab[0] != NULL && avContextTab[0]->pb != NULL && rwdiff > FILLBUFDIFF)) + (flag == 1 && hasfillerThreadStarted[id] == 1 && avContextTab[0] != NULL && avContextTab[0]->pb != NULL && rwdiff > FILLBUFDIFF)) { if (0 == PlaybackDieNow(0)) { diff --git a/libeplayer3-arm/container/container.c b/libeplayer3-arm/container/container.c index a36e40b..de71ef8 100644 --- a/libeplayer3-arm/container/container.c +++ b/libeplayer3-arm/container/container.c @@ -68,7 +68,7 @@ static void printContainerCapabilities() container_printf(10, "\n"); } -static int32_t selectContainer(Context_t *context, char *extension) +static int32_t selectContainer(Context_t *context, char *extension) { int32_t i = 0; int32_t j = 0; diff --git a/libeplayer3-arm/container/container_ffmpeg.c b/libeplayer3-arm/container/container_ffmpeg.c index 1433e4f..e0d7b7f 100644 --- a/libeplayer3-arm/container/container_ffmpeg.c +++ b/libeplayer3-arm/container/container_ffmpeg.c @@ -719,7 +719,7 @@ static void FFMPEGThread(Context_t *context) #endif #ifdef HAVE_FLV2MPEG4_CONVERTER if (get_codecpar(avContextTab[cAVIdx]->streams[packet.stream_index])->codec_id == AV_CODEC_ID_FLV1 && - 0 == memcmp(videoTrack->Encoding, "V_MPEG4", 7)) + 0 == memcmp(videoTrack->Encoding, "V_MPEG4", 7)) { flv2mpeg4_write_packet(context, &flv2mpeg4_context, videoTrack, cAVIdx, ¤tVideoPts, &latestPts, &packet); update_max_injected_pts(latestPts); @@ -979,7 +979,7 @@ static void FFMPEGThread(Context_t *context) if (e < 0) { ffmpeg_err("swr_init: %d (icl=%d ocl=%d isr=%d osr=%d isf=%d osf=%d\n", - -e, (int32_t)c->channel_layout, (int32_t)out_channel_layout, c->sample_rate, out_sample_rate, c->sample_fmt, AV_SAMPLE_FMT_S16); + -e, (int32_t)c->channel_layout, (int32_t)out_channel_layout, c->sample_rate, out_sample_rate, c->sample_fmt, AV_SAMPLE_FMT_S16); swr_free(&swr); swr = NULL; } @@ -994,11 +994,11 @@ static void FFMPEGThread(Context_t *context) continue; } int64_t next_in_pts = av_rescale(av_frame_get_best_effort_timestamp(decoded_frame), - ((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate, - ((AVStream *) audioTrack->stream)->time_base.den); + ((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate, + ((AVStream *) audioTrack->stream)->time_base.den); int64_t next_out_pts = av_rescale(swr_next_pts(swr, next_in_pts), - ((AVStream *) audioTrack->stream)->time_base.den, - ((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate); + ((AVStream *) audioTrack->stream)->time_base.den, + ((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate); currentAudioPts = audioTrack->pts = pts = calcPts(cAVIdx, audioTrack->stream, next_out_pts); out_samples = swr_convert(swr, &output[0], out_samples, (const uint8_t **) &decoded_frame->data[0], in_samples); ////////////////////////////////////////////////////////////////////// @@ -1108,9 +1108,9 @@ static void FFMPEGThread(Context_t *context) printf("{\"log\":\"Frame read error: '%s'\"}\n", errbuf); } /* - if( ffmpegStatus == AVERROR(EAGAIN) ) + if(ffmpegStatus == AVERROR(EAGAIN)) { - continue; + continue; } */ ffmpegStatus = 0; @@ -1261,8 +1261,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int avContextTab[AVIdx]->interrupt_callback.callback = interrupt_cb; avContextTab[AVIdx]->interrupt_callback.opaque = context->playback; #ifdef SAM_CUSTOM_IO - if (0 == strstr(filename, "://") || - 0 == strncmp(filename, "file://", 7)) + if (0 == strstr(filename, "://") || 0 == strncmp(filename, "file://", 7)) { AVIOContext *avio_ctx = container_ffmpeg_get_avio_context(filename, 4096); if (avio_ctx) @@ -1293,11 +1292,11 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int rtmpProtoImplType = RTMP_LIBRTMP; } if (0 == strncmp(filename, "rtmp://", 7) || - 0 == strncmp(filename, "rtmpe://", 8) || - 0 == strncmp(filename, "rtmps://", 8) || - 0 == strncmp(filename, "rtmpt://", 8) || - 0 == strncmp(filename, "rtmpte://", 9) || - 0 == strncmp(filename, "rtmpts://", 9)) + 0 == strncmp(filename, "rtmpe://", 8) || + 0 == strncmp(filename, "rtmps://", 8) || + 0 == strncmp(filename, "rtmpt://", 8) || + 0 == strncmp(filename, "rtmpte://", 9) || + 0 == strncmp(filename, "rtmpts://", 9)) { /* At first we need to check which protocol * implementations we have @@ -1334,8 +1333,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int * unless uri contain param wich can be understandable * only by librtmp */ - if (strstr(filename, " token=") || - strstr(filename, " jtv=")) + if (strstr(filename, " token=") || strstr(filename, " jtv=")) { rtmpProtoImplType = RTMP_LIBRTMP; } @@ -1479,8 +1477,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int } } } - else if (0 == strncmp(filename, "http://", 7) || - 0 == strncmp(filename, "https://", 8)) + else if (0 == strncmp(filename, "http://", 7) || 0 == strncmp(filename, "https://", 8)) { av_dict_set(&avio_opts, "timeout", "20000000", 0); //20sec av_dict_set(&avio_opts, "reconnect", "1", 0); @@ -1495,8 +1492,8 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int if ((err = avformat_open_input(&avContextTab[AVIdx], filename, fmt, pavio_opts)) != 0) { if (rtmp_proto_impl == 0 && //err == AVERROR_UNKNOWN && - rtmpProtoImplType == RTMP_NATIVE && - numOfRTMPImpl > 1) + rtmpProtoImplType == RTMP_NATIVE && + numOfRTMPImpl > 1) { // retry with librtmp err = avformat_open_input(&avContextTab[AVIdx], filename + 2, fmt, pavio_opts); @@ -1532,8 +1529,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int if (avContextTab[AVIdx] != NULL && avContextTab[AVIdx]->pb != NULL && !context->playback->isTSLiveMode) { ffmpeg_real_read_org = avContextTab[AVIdx]->pb->read_packet; - if (0 == AVIdx && strstr(filename, "://") != 0 && - strncmp(filename, "file://", 7) != 0) + if (0 == AVIdx && strstr(filename, "://") != 0 && strncmp(filename, "file://", 7) != 0) { if (ffmpeg_buf_size > 0 && ffmpeg_buf_size > FILLBUFDIFF + FILLBUFPAKET) { @@ -1601,7 +1597,7 @@ int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames) avformat_network_init(); // SULGE DEBUG ENABLED // make ffmpeg silen - // av_log_set_level( AV_LOG_DEBUG ); + // av_log_set_level(AV_LOG_DEBUG); av_log_set_callback(ffmpeg_silen_callback); context->playback->abortRequested = 0; int32_t res = container_ffmpeg_init_av_context(context, playFilesNames->szFirstFile, 0); @@ -1727,9 +1723,9 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 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, \ - (int)get_codecpar(stream)->extradata_size, \ - (int)get_codecpar(stream)->profile, &version); + (uint8_t *)get_codecpar(stream)->extradata, \ + (int)get_codecpar(stream)->extradata_size, \ + (int)get_codecpar(stream)->profile, &version); if (encoding != NULL && !strncmp(encoding, "A_IPCM", 6) && insert_pcm_as_lpcm) { encoding = "A_LPCM"; @@ -1885,7 +1881,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 else if (get_codecpar(stream)->codec_id == AV_CODEC_ID_AAC) { if (0 == strncmp(avContext->iformat->name, "mpegts", 6) || - 0 == strncmp(avContext->iformat->name, "hls,", 4)) + 0 == strncmp(avContext->iformat->name, "hls,", 4)) { const char marker[] = "ADTS"; track.aacbuflen = sizeof(marker) / sizeof(char); @@ -1961,10 +1957,10 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 } */ } - else if (get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAV1 - || get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAV2 - || get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAPRO - || get_codecpar(stream)->codec_id == AV_CODEC_ID_WMALOSSLESS) //if (get_codecpar(stream)->extradata_size > 0) + else if (get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAV1 || + get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAV2 || + get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAPRO || + get_codecpar(stream)->codec_id == AV_CODEC_ID_WMALOSSLESS) //if (get_codecpar(stream)->extradata_size > 0) { ffmpeg_printf(10, "Create WMA ExtraData\n"); uint16_t channels = get_codecpar(stream)->channels; @@ -2103,11 +2099,11 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 { if (get_codecpar(stream)->codec_id != AV_CODEC_ID_SSA && #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 3, 100) - get_codecpar(stream)->codec_id != AV_CODEC_ID_ASS && + get_codecpar(stream)->codec_id != AV_CODEC_ID_ASS && #endif - get_codecpar(stream)->codec_id != AV_CODEC_ID_SUBRIP && - get_codecpar(stream)->codec_id != AV_CODEC_ID_TEXT && - get_codecpar(stream)->codec_id != AV_CODEC_ID_SRT) + get_codecpar(stream)->codec_id != AV_CODEC_ID_SUBRIP && + get_codecpar(stream)->codec_id != AV_CODEC_ID_TEXT && + get_codecpar(stream)->codec_id != AV_CODEC_ID_SRT) { ffmpeg_printf(10, "subtitle with not supported codec codec_id[%u]\n", (uint32_t)get_codecpar(stream)->codec_id); } @@ -2509,7 +2505,7 @@ 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) { ffmpeg_printf(10, "track %d\n", *arg); - /* Hellmaster1024: nothing to do here!*/ + /* Hellmaster1024: nothing to do here! */ int64_t sec = -5; context->playback->Command(context, PLAYBACK_SEEK, (void *)&sec); return cERR_CONTAINER_FFMPEG_NO_ERROR; @@ -2650,11 +2646,11 @@ static int32_t Command(void *_context, ContainerCmd_t command, void *argument) int ret = cERR_CONTAINER_FFMPEG_NO_ERROR; ffmpeg_printf(50, "Command %d\n", command); if (command != CONTAINER_SET_BUFFER_SEEK_TIME && - command != CONTAINER_SET_BUFFER_SIZE && - command != CONTAINER_GET_BUFFER_SIZE && - command != CONTAINER_GET_BUFFER_STATUS && - command != CONTAINER_STOP_BUFFER && - command != CONTAINER_INIT && !avContextTab[0]) + command != CONTAINER_SET_BUFFER_SIZE && + command != CONTAINER_GET_BUFFER_SIZE && + command != CONTAINER_GET_BUFFER_STATUS && + command != CONTAINER_STOP_BUFFER && + command != CONTAINER_INIT && !avContextTab[0]) { return cERR_CONTAINER_FFMPEG_ERR; } diff --git a/libeplayer3-arm/container/mpeg4p2_ffmpeg.c b/libeplayer3-arm/container/mpeg4p2_ffmpeg.c index 9a37b9f..174d11e 100644 --- a/libeplayer3-arm/container/mpeg4p2_ffmpeg.c +++ b/libeplayer3-arm/container/mpeg4p2_ffmpeg.c @@ -32,9 +32,9 @@ static int filter_packet(AVBitStreamFilterContext *bsf_ctx, AVCodecContext *enc_ int ret; AVPacket new_pkt = *pkt; ret = av_bitstream_filter_filter(bsf_ctx, enc_ctx, NULL, - &new_pkt.data, &new_pkt.size, - pkt->data, pkt->size, - pkt->flags & AV_PKT_FLAG_KEY); + &new_pkt.data, &new_pkt.size, + pkt->data, pkt->size, + pkt->flags & AV_PKT_FLAG_KEY); if (ret == 0 && new_pkt.data != pkt->data) { if ((ret = av_copy_packet(&new_pkt, pkt)) < 0) @@ -47,15 +47,15 @@ static int filter_packet(AVBitStreamFilterContext *bsf_ctx, AVCodecContext *enc_ pkt->side_data_elems = 0; wrapped_packet_unref(pkt); new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size, - av_buffer_default_free, NULL, 0); + av_buffer_default_free, NULL, 0); if (!new_pkt.buf) return -1; } if (ret < 0) { ffmpeg_err("Failed to filter bitstream with filter %s for stream %d with codec %s\n", - bsf_ctx->filter->name, pkt->stream_index, - avcodec_get_name(enc_ctx->codec_id)); + bsf_ctx->filter->name, pkt->stream_index, + avcodec_get_name(enc_ctx->codec_id)); return -1; } *pkt = new_pkt; diff --git a/libeplayer3-arm/external/ffmpeg/get_bits.h b/libeplayer3-arm/external/ffmpeg/get_bits.h index c84b351..fd99374 100644 --- a/libeplayer3-arm/external/ffmpeg/get_bits.h +++ b/libeplayer3-arm/external/ffmpeg/get_bits.h @@ -97,8 +97,8 @@ typedef struct GetBitContext #endif #define OPEN_READER_NOSIZE(name, gb) \ - unsigned int name ## _index = (gb)->index; \ - unsigned int av_unused name ## _cache + unsigned int name ## _index = (gb)->index; \ + unsigned int av_unused name ## _cache #define OPEN_READER(name, gb) OPEN_READER_NOSIZE(name, gb) #define BITS_AVAILABLE(name, gb) 1 @@ -108,18 +108,18 @@ typedef struct GetBitContext # ifdef LONG_BITSTREAM_READER # define UPDATE_CACHE_LE(name, gb) name ## _cache = \ - AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) + AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) # define UPDATE_CACHE_BE(name, gb) name ## _cache = \ - AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7)) + AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7)) #else # define UPDATE_CACHE_LE(name, gb) name ## _cache = \ - AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) + AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) # define UPDATE_CACHE_BE(name, gb) name ## _cache = \ - AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7) + AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7) #endif @@ -142,10 +142,10 @@ typedef struct GetBitContext #define BITS_LEFT(name, gb) ((int)((gb)->size_in_bits - name ## _index)) #define SKIP_BITS(name, gb, num) \ - do { \ - SKIP_CACHE(name, gb, num); \ - SKIP_COUNTER(name, gb, num); \ - } while (0) + do { \ + SKIP_CACHE(name, gb, num); \ + SKIP_COUNTER(name, gb, num); \ + } while (0) #define LAST_SKIP_BITS(name, gb, num) SKIP_COUNTER(name, gb, num) @@ -383,7 +383,7 @@ static inline int check_marker(void *logctx, GetBitContext *s, const char *msg) * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. */ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, - int bit_size) + int bit_size) { int buffer_size; int ret = 0; @@ -411,7 +411,7 @@ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. */ static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer, - int byte_size) + int byte_size) { if (byte_size > INT_MAX / 8 || byte_size < 0) byte_size = -1; @@ -432,73 +432,73 @@ static inline const uint8_t *align_get_bits(GetBitContext *s) * is undefined. */ #define GET_VLC(code, name, gb, table, bits, max_depth) \ - do { \ - int n, nb_bits; \ - unsigned int index; \ - \ - index = SHOW_UBITS(name, gb, bits); \ - code = table[index][0]; \ - n = table[index][1]; \ - \ - if (max_depth > 1 && n < 0) { \ - LAST_SKIP_BITS(name, gb, bits); \ - UPDATE_CACHE(name, gb); \ - \ - nb_bits = -n; \ - \ - index = SHOW_UBITS(name, gb, nb_bits) + code; \ - code = table[index][0]; \ - n = table[index][1]; \ - if (max_depth > 2 && n < 0) { \ - LAST_SKIP_BITS(name, gb, nb_bits); \ - UPDATE_CACHE(name, gb); \ - \ - nb_bits = -n; \ - \ - index = SHOW_UBITS(name, gb, nb_bits) + code; \ - code = table[index][0]; \ - n = table[index][1]; \ - } \ - } \ - SKIP_BITS(name, gb, n); \ - } while (0) + do { \ + int n, nb_bits; \ + unsigned int index; \ + \ + index = SHOW_UBITS(name, gb, bits); \ + code = table[index][0]; \ + n = table[index][1]; \ + \ + if (max_depth > 1 && n < 0) { \ + LAST_SKIP_BITS(name, gb, bits); \ + UPDATE_CACHE(name, gb); \ + \ + nb_bits = -n; \ + \ + index = SHOW_UBITS(name, gb, nb_bits) + code; \ + code = table[index][0]; \ + n = table[index][1]; \ + if (max_depth > 2 && n < 0) { \ + LAST_SKIP_BITS(name, gb, nb_bits); \ + UPDATE_CACHE(name, gb); \ + \ + nb_bits = -n; \ + \ + index = SHOW_UBITS(name, gb, nb_bits) + code; \ + code = table[index][0]; \ + n = table[index][1]; \ + } \ + } \ + SKIP_BITS(name, gb, n); \ + } while (0) #define GET_RL_VLC(level, run, name, gb, table, bits, \ - max_depth, need_update) \ -do { \ - int n, nb_bits; \ - unsigned int index; \ - \ - index = SHOW_UBITS(name, gb, bits); \ - level = table[index].level; \ - n = table[index].len; \ - \ - if (max_depth > 1 && n < 0) { \ - SKIP_BITS(name, gb, bits); \ - if (need_update) { \ - UPDATE_CACHE(name, gb); \ - } \ - \ - nb_bits = -n; \ - \ - index = SHOW_UBITS(name, gb, nb_bits) + level; \ - level = table[index].level; \ - n = table[index].len; \ - if (max_depth > 2 && n < 0) { \ - LAST_SKIP_BITS(name, gb, nb_bits); \ - if (need_update) { \ - UPDATE_CACHE(name, gb); \ - } \ - nb_bits = -n; \ - \ - index = SHOW_UBITS(name, gb, nb_bits) + level; \ - level = table[index].level; \ - n = table[index].len; \ - } \ - } \ - run = table[index].run; \ - SKIP_BITS(name, gb, n); \ -} while (0) + max_depth, need_update) \ + do { \ + int n, nb_bits; \ + unsigned int index; \ + \ + index = SHOW_UBITS(name, gb, bits); \ + level = table[index].level; \ + n = table[index].len; \ + \ + if (max_depth > 1 && n < 0) { \ + SKIP_BITS(name, gb, bits); \ + if (need_update) { \ + UPDATE_CACHE(name, gb); \ + } \ + \ + nb_bits = -n; \ + \ + index = SHOW_UBITS(name, gb, nb_bits) + level; \ + level = table[index].level; \ + n = table[index].len; \ + if (max_depth > 2 && n < 0) { \ + LAST_SKIP_BITS(name, gb, nb_bits); \ + if (need_update) { \ + UPDATE_CACHE(name, gb); \ + } \ + nb_bits = -n; \ + \ + index = SHOW_UBITS(name, gb, nb_bits) + level; \ + level = table[index].level; \ + n = table[index].len; \ + } \ + } \ + run = table[index].run; \ + SKIP_BITS(name, gb, n); \ + } while (0) static inline int decode012(GetBitContext *gb) { diff --git a/libeplayer3-arm/external/ffmpeg/mathops.h b/libeplayer3-arm/external/ffmpeg/mathops.h index 641324e..b8c7ff7 100644 --- a/libeplayer3-arm/external/ffmpeg/mathops.h +++ b/libeplayer3-arm/external/ffmpeg/mathops.h @@ -30,7 +30,7 @@ #endif #ifndef NEG_SSR32 -# define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s))) +# define NEG_SSR32(a,s) (((int32_t)(a))>>(32-(s))) #endif #ifndef sign_extend diff --git a/libeplayer3-arm/external/ffmpeg/mpeg4audio.h b/libeplayer3-arm/external/ffmpeg/mpeg4audio.h index 940dff8..941df06 100644 --- a/libeplayer3-arm/external/ffmpeg/mpeg4audio.h +++ b/libeplayer3-arm/external/ffmpeg/mpeg4audio.h @@ -54,7 +54,7 @@ extern const uint8_t ff_mpeg4audio_channels[8]; * @return On error -1 is returned, on success AudioSpecificConfig bit index in extradata. */ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, - int bit_size, int sync_extension); + int bit_size, int sync_extension); enum AudioObjectType { diff --git a/libeplayer3-arm/external/ffmpeg/put_bits.h b/libeplayer3-arm/external/ffmpeg/put_bits.h index 8a88d11..f99cfac 100644 --- a/libeplayer3-arm/external/ffmpeg/put_bits.h +++ b/libeplayer3-arm/external/ffmpeg/put_bits.h @@ -47,7 +47,7 @@ typedef struct PutBitContext * @param buffer_size the size in bytes of buffer */ static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, - int buffer_size) + int buffer_size) { if (buffer_size < 0) { @@ -70,7 +70,7 @@ static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, * must be larger than the previous size */ static inline void rebase_put_bits(PutBitContext *s, uint8_t *buffer, - int buffer_size) + int buffer_size) { av_assert0(8 * buffer_size > s->size_in_bits); s->buf_end = buffer + buffer_size; @@ -136,7 +136,7 @@ void avpriv_align_put_bits(PutBitContext *s); * @param terminate_string 0-terminates the written string if value is 1 */ void avpriv_put_string(PutBitContext *pb, const char *string, - int terminate_string); + int terminate_string); /** * Copy the content of src to the bitstream. diff --git a/libeplayer3-arm/external/ffmpeg/src/bitstream.c b/libeplayer3-arm/external/ffmpeg/src/bitstream.c index 4371a7a..8c0f795 100644 --- a/libeplayer3-arm/external/ffmpeg/src/bitstream.c +++ b/libeplayer3-arm/external/ffmpeg/src/bitstream.c @@ -36,8 +36,7 @@ void avpriv_align_put_bits(PutBitContext *s) put_bits(s, s->bit_left & 7, 0); } -void avpriv_put_string(PutBitContext *pb, const char *string, - int terminate_string) +void avpriv_put_string(PutBitContext *pb, const char *string, int terminate_string) { while (*string) { diff --git a/libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c b/libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c index f07bc69..8bbd7eb 100644 --- a/libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c +++ b/libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c @@ -72,11 +72,11 @@ 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]; + avpriv_mpeg4audio_sample_rates[*index]; } int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, - int bit_size, int sync_extension) + int bit_size, int sync_extension) { GetBitContext gb; int specific_config_bitindex, ret; @@ -93,8 +93,8 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, c->sbr = -1; c->ps = -1; if (c->object_type == AOT_SBR || (c->object_type == AOT_PS && - // check for W6132 Annex YYYY draft MP3onMP4 - !(show_bits(&gb, 3) & 0x03 && !(show_bits(&gb, 9) & 0x3F)))) + // check for W6132 Annex YYYY draft MP3onMP4 + !(show_bits(&gb, 3) & 0x03 && !(show_bits(&gb, 9) & 0x3F)))) { if (c->object_type == AOT_PS) c->ps = 1; @@ -152,8 +152,8 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, } static av_always_inline unsigned int copy_bits(PutBitContext *pb, - GetBitContext *gb, - int bits) + GetBitContext *gb, + int bits) { unsigned int el = get_bits(gb, bits); put_bits(pb, bits, el); diff --git a/libeplayer3-arm/external/flv2mpeg4/src/flv2mpeg4.c b/libeplayer3-arm/external/flv2mpeg4/src/flv2mpeg4.c index f1cc609..3e22d98 100644 --- a/libeplayer3-arm/external/flv2mpeg4/src/flv2mpeg4.c +++ b/libeplayer3-arm/external/flv2mpeg4/src/flv2mpeg4.c @@ -129,10 +129,10 @@ static int write_pad_not_coded_frames(flv2mpeg4_CTX *pub_ctx, CONVCTX *c, BW *bw flash_bw(bw); // write frame if (pub_ctx->write_packet_cb(pub_ctx->usr_data, - 0, - 0,//c->frame, - bw->buf, - bw->pos) < 0) + 0, + 0,//c->frame, + bw->buf, + bw->pos) < 0) { return -1; } @@ -184,10 +184,10 @@ static int write_m4v_picture_frame(flv2mpeg4_CTX *pub_ctx, CONVCTX *c, BR *br, B flash_bw(bw); // write frame if (pub_ctx->write_packet_cb(pub_ctx->usr_data, - vop.picture_type == M4V_I_TYPE, - 0,//c->frame, - bw->buf, - bw->pos) < 0) + vop.picture_type == M4V_I_TYPE, + 0,//c->frame, + bw->buf, + bw->pos) < 0) { return -1; } diff --git a/libeplayer3-arm/external/flv2mpeg4/src/m4vencode.c b/libeplayer3-arm/external/flv2mpeg4/src/m4vencode.c index 50ba7dd..7860d83 100644 --- a/libeplayer3-arm/external/flv2mpeg4/src/m4vencode.c +++ b/libeplayer3-arm/external/flv2mpeg4/src/m4vencode.c @@ -109,8 +109,8 @@ static void __inline encode_escape_3(BW *p, int last, int run, int level) { #if 0 put_bits(p, - 7 + 2 + 1 + 6 + 1 + 12 + 1, //30bit - (3 << 23) + (3 << 21) + (last << 20) + (run << 14) + (1 << 13) + (((level - 64) & 0xfff) << 1) + 1); + 7 + 2 + 1 + 6 + 1 + 12 + 1, //30bit + (3 << 23) + (3 << 21) + (last << 20) + (run << 14) + (1 << 13) + (((level - 64) & 0xfff) << 1) + 1); #else put_bits(p, 7, 3); // escape put_bits(p, 2, 3); // escape3 diff --git a/libeplayer3-arm/include/aac.h b/libeplayer3-arm/include/aac.h index a50f7de..402087b 100644 --- a/libeplayer3-arm/include/aac.h +++ b/libeplayer3-arm/include/aac.h @@ -25,7 +25,7 @@ static inline int HasADTSHeader(uint8_t *data, int size) { if (size >= AAC_HEADER_LENGTH && 0xFF == data[0] && 0xF0 == 0xF0 & data[1] && - size == ((data[3] & 0x3) << 11 | data[4] << 3 | data[5] >> 5)) + size == ((data[3] & 0x3) << 11 | data[4] << 3 | data[5] >> 5)) { return 1; } diff --git a/libeplayer3-arm/include/common.h b/libeplayer3-arm/include/common.h index fa708f3..ae0f4d9 100644 --- a/libeplayer3-arm/include/common.h +++ b/libeplayer3-arm/include/common.h @@ -1,7 +1,7 @@ #ifndef COMMON_H_ #define COMMON_H_ -#include +#include #include "container.h" #include "output.h" diff --git a/libeplayer3-arm/include/manager.h b/libeplayer3-arm/include/manager.h index dd33492..0d9fd76 100644 --- a/libeplayer3-arm/include/manager.h +++ b/libeplayer3-arm/include/manager.h @@ -86,7 +86,6 @@ typedef struct TrackDescription_s int32_t aspect_ratio_num; int32_t aspect_ratio_den; int progressive; - } TrackDescription_t; typedef struct Manager_s @@ -94,7 +93,6 @@ typedef struct Manager_s char *Name; int (* Command)(/*Context_t*/void *, ManagerCmd_t, void *); char **Capabilities; - } Manager_t; typedef struct ManagerHandler_s diff --git a/libeplayer3-arm/include/misc.h b/libeplayer3-arm/include/misc.h index 55e98cb..4934180 100644 --- a/libeplayer3-arm/include/misc.h +++ b/libeplayer3-arm/include/misc.h @@ -15,16 +15,16 @@ typedef struct BitPacker_s { - uint8_t *Ptr; /* write pointer */ - uint32_t BitBuffer; /* bitreader shifter */ - int32_t Remaining; /* number of remaining in the shifter */ + uint8_t *Ptr; /* write pointer */ + uint32_t BitBuffer; /* bitreader shifter */ + int32_t Remaining; /* number of remaining in the shifter */ } BitPacker_t; /* ***************************** */ /* Makros/Constants */ /* ***************************** */ -#define INVALID_PTS_VALUE 0x200000000ull +#define INVALID_PTS_VALUE 0x200000000ull /* ***************************** */ /* Prototypes */ @@ -96,16 +96,16 @@ static inline int32_t IsDreambox() static inline uint32_t ReadUint32(uint8_t *buffer) { uint32_t num = (uint32_t)buffer[0] << 24 | - (uint32_t)buffer[1] << 16 | - (uint32_t)buffer[2] << 8 | - (uint32_t)buffer[3]; + (uint32_t)buffer[1] << 16 | + (uint32_t)buffer[2] << 8 | + (uint32_t)buffer[3]; return num; } static inline uint16_t ReadUInt16(uint8_t *buffer) { uint16_t num = (uint16_t)buffer[0] << 8 | - (uint16_t)buffer[1]; + (uint16_t)buffer[1]; return num; } diff --git a/libeplayer3-arm/include/output.h b/libeplayer3-arm/include/output.h index 356e5e1..dd0bb93 100644 --- a/libeplayer3-arm/include/output.h +++ b/libeplayer3-arm/include/output.h @@ -2,6 +2,7 @@ #define OUTPUT_H_ #include +#include typedef enum { @@ -69,7 +70,6 @@ typedef struct Output_s int32_t (* Command)(/*Context_t*/void *, OutputCmd_t, void *); int32_t (* Write)(/*Context_t*/void *, void *privateData); char **Capabilities; - } Output_t; extern Output_t LinuxDvbOutput; diff --git a/libeplayer3-arm/include/playback.h b/libeplayer3-arm/include/playback.h index 77781d6..5e80c8c 100644 --- a/libeplayer3-arm/include/playback.h +++ b/libeplayer3-arm/include/playback.h @@ -3,7 +3,28 @@ #include #include -typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_SEEK_ABS, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT, PLAYBACK_METADATA} PlaybackCmd_t; +typedef enum { + PLAYBACK_OPEN, + PLAYBACK_CLOSE, + PLAYBACK_PLAY, + PLAYBACK_STOP, + PLAYBACK_PAUSE, + PLAYBACK_CONTINUE, + PLAYBACK_FLUSH, + PLAYBACK_TERM, + PLAYBACK_FASTFORWARD, + PLAYBACK_SEEK, + PLAYBACK_SEEK_ABS, + PLAYBACK_PTS, + PLAYBACK_LENGTH, + PLAYBACK_SWITCH_AUDIO, + PLAYBACK_SWITCH_SUBTITLE, + PLAYBACK_INFO, + PLAYBACK_SLOWMOTION, + PLAYBACK_FASTBACKWARD, + PLAYBACK_GET_FRAME_COUNT, + PLAYBACK_METADATA +} PlaybackCmd_t; typedef struct PlaybackHandler_s { diff --git a/libeplayer3-arm/main/exteplayer.c b/libeplayer3-arm/main/exteplayer.c index e143fa3..17b3146 100644 --- a/libeplayer3-arm/main/exteplayer.c +++ b/libeplayer3-arm/main/exteplayer.c @@ -119,8 +119,7 @@ static void *TermThreadFun(void *arg) FD_SET(g_pfd[0], &readfds); FD_SET(fd, &readfds); nfds = fd > g_pfd[0] ? fd + 1 : g_pfd[0] + 1; - while (select(nfds, &readfds, NULL, NULL, NULL) == -1 - && errno == EINTR) + while (select(nfds, &readfds, NULL, NULL, NULL) == -1 && errno == EINTR) { /* Restart if interrupted by signal */ continue; @@ -128,7 +127,7 @@ static void *TermThreadFun(void *arg) if (FD_ISSET(fd, &readfds)) { /* - if ( (cl = accept(fd, NULL, NULL)) == -1) + if ((cl = accept(fd, NULL, NULL)) == -1) { perror("TermThreadFun accept error"); goto finish; @@ -404,7 +403,7 @@ static int HandleTracks(const Manager_t *ptrManager, const PlaybackCmd_t playbac else // video { fprintf(stderr, "{\"%c_%c\":{\"id\":%d,\"e\":\"%s\",\"n\":\"%s\",\"w\":%d,\"h\":%d,\"f\":%u,\"p\":%d,\"an\":%d,\"ad\":%d}}\n", \ - argvBuff[0], argvBuff[1], track->Id, track->Encoding, track->Name, track->width, track->height, track->frame_rate, track->progressive, track->aspect_ratio_num, track->aspect_ratio_den); + argvBuff[0], argvBuff[1], track->Id, track->Encoding, track->Name, track->width, track->height, track->frame_rate, track->progressive, track->aspect_ratio_num, track->aspect_ratio_den); } free(track->Encoding); free(track->Name); @@ -475,6 +474,7 @@ static int HandleTracks(const Manager_t *ptrManager, const PlaybackCmd_t playbac return commandRetVal; } #endif + static void UpdateVideoTrack() { HandleTracks(g_player->manager->video, (PlaybackCmd_t) - 1, "vc"); @@ -932,10 +932,10 @@ int main(int argc, char *argv[]) if (ptrP) { fprintf(stderr, "{\"PLAYBACK_INFO\":{ \"isPlaying\":%s, \"isPaused\":%s, \"isForwarding\":%s, \"isSeeking\":%s, \"isCreationPhase\":%s,", \ - DUMP_BOOL(ptrP->isPlaying), DUMP_BOOL(ptrP->isPaused), DUMP_BOOL(ptrP->isForwarding), DUMP_BOOL(ptrP->isSeeking), DUMP_BOOL(ptrP->isCreationPhase)); + DUMP_BOOL(ptrP->isPlaying), DUMP_BOOL(ptrP->isPaused), DUMP_BOOL(ptrP->isForwarding), DUMP_BOOL(ptrP->isSeeking), DUMP_BOOL(ptrP->isCreationPhase)); fprintf(stderr, "\"BackWard\":%d, \"SlowMotion\":%d, \"Speed\":%d, \"AVSync\":%d,", ptrP->BackWard, ptrP->SlowMotion, ptrP->Speed, ptrP->AVSync); fprintf(stderr, " \"isVideo\":%s, \"isAudio\":%s, \"isSubtitle\":%s, \"isDvbSubtitle\":%s, \"isTeletext\":%s, \"mayWriteToFramebuffer\":%s, \"abortRequested\":%s }}\n", \ - DUMP_BOOL(ptrP->isVideo), DUMP_BOOL(ptrP->isAudio), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(ptrP->abortRequested)); + DUMP_BOOL(ptrP->isVideo), DUMP_BOOL(ptrP->isAudio), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(ptrP->abortRequested)); } break; } diff --git a/libeplayer3-arm/manager/audio.c b/libeplayer3-arm/manager/audio.c index 9bf93ab..a29687e 100644 --- a/libeplayer3-arm/manager/audio.c +++ b/libeplayer3-arm/manager/audio.c @@ -253,9 +253,9 @@ static int Command(void *_context, ManagerCmd_t command, void *argument) if (track) { memset(track, 0, sizeof(TrackDescription_t)); - track->Id = Tracks[CurrentTrack].Id; - track->Name = strdup(Tracks[CurrentTrack].Name); - track->Encoding = strdup(Tracks[CurrentTrack].Encoding); + track->Id = Tracks[CurrentTrack].Id; + track->Name = strdup(Tracks[CurrentTrack].Name); + track->Encoding = strdup(Tracks[CurrentTrack].Encoding); } } else diff --git a/libeplayer3-arm/manager/video.c b/libeplayer3-arm/manager/video.c index 70d2272..1c8fcc3 100644 --- a/libeplayer3-arm/manager/video.c +++ b/libeplayer3-arm/manager/video.c @@ -183,7 +183,7 @@ static int ManagerDel(Context_t *context) static int Command(void *_context, ManagerCmd_t command, void *argument) { - Context_t *context = (Context_t *) _context; + Context_t *context = (Context_t *) _context; int ret = cERR_VIDEO_MGR_NO_ERROR; video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__); switch (command) diff --git a/libeplayer3-arm/output/linuxdvb_mipsel.c b/libeplayer3-arm/output/linuxdvb_mipsel.c index 6526917..8990c5b 100644 --- a/libeplayer3-arm/output/linuxdvb_mipsel.c +++ b/libeplayer3-arm/output/linuxdvb_mipsel.c @@ -430,7 +430,7 @@ int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int 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) + // 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)); @@ -479,7 +479,7 @@ int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type) // 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) ) { + // if ((video && videofd != -1) || (audio && audiofd != -1)) { // getLinuxDVBMutex(FILENAME, __FUNCTION__,__LINE__); // if (video && videofd != -1) { // if (ioctl(videofd, VIDEO_FLUSH, NULL) == -1) @@ -727,7 +727,7 @@ 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) + // 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)); @@ -775,7 +775,7 @@ 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) + // 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)); @@ -829,7 +829,7 @@ static int Write(void *_context, void *_out) video = !strcmp("video", out->type); audio = !strcmp("audio", out->type); linuxdvb_printf(20, "DataLength=%u PrivateLength=%u Pts=%llu FrameRate=%f\n", - out->len, out->extralen, out->pts, out->frameRate); + out->len, out->extralen, out->pts, out->frameRate); linuxdvb_printf(20, "v%d a%d\n", video, audio); if (video) { diff --git a/libeplayer3-arm/output/linuxdvb_sh4.c b/libeplayer3-arm/output/linuxdvb_sh4.c index f11de46..efbc39c 100644 --- a/libeplayer3-arm/output/linuxdvb_sh4.c +++ b/libeplayer3-arm/output/linuxdvb_sh4.c @@ -59,7 +59,7 @@ static const char FILENAME[] = __FILE__; #ifdef LINUXDVB_DEBUG #define linuxdvb_printf(level, fmt, x...) do { \ -if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0) +if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) #else #define linuxdvb_printf(x...) #endif @@ -828,7 +828,7 @@ static int Write(void *_context, void *_out) video = !strcmp("video", out->type); audio = !strcmp("audio", out->type); linuxdvb_printf(20, "DataLength=%u PrivateLength=%u Pts=%llu FrameRate=%f\n", - out->len, out->extralen, out->pts, out->frameRate); + out->len, out->extralen, out->pts, out->frameRate); linuxdvb_printf(20, "v%d a%d\n", video, audio); if (video) { diff --git a/libeplayer3-arm/output/output.c b/libeplayer3-arm/output/output.c index c946c4b..cf3640e 100644 --- a/libeplayer3-arm/output/output.c +++ b/libeplayer3-arm/output/output.c @@ -149,7 +149,7 @@ static void OutputDel(Context_t *context, char *port) static int Command(void *_context, OutputCmd_t command, void *argument) { - Context_t *context = (Context_t *) _context; + 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 0e8fe9b..411a30d 100644 --- a/libeplayer3-arm/output/output_subtitle.c +++ b/libeplayer3-arm/output/output_subtitle.c @@ -190,7 +190,7 @@ static int Flush() static int Write(void *_context, void *data) { - Context_t *context = (Context_t *)_context; + Context_t *context = (Context_t *)_context; char *Encoding = NULL; SubtitleOut_t *out = NULL; int32_t curtrackid = -1; @@ -224,7 +224,7 @@ static int Write(void *_context, void *data) else { subtitle_err("unknown encoding %s\n", Encoding); - return cERR_SUBTITLE_ERROR; + return cERR_SUBTITLE_ERROR; } subtitle_printf(10, "<\n"); return cERR_SUBTITLE_NO_ERROR; @@ -259,7 +259,7 @@ static int32_t subtitle_Close(Context_t *context __attribute__((unused))) static int Command(void *_context, OutputCmd_t command, void *argument) { - Context_t *context = (Context_t *) _context; + 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 e6d0fd3..3b6945b 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)) + (AV_RB16(call->data + 1) & 0x1FFF) + 3 == call->len)) { aac_err("parsing Data with wrong latm header. ignoring...\n"); return 0; @@ -193,9 +193,9 @@ static int _writeData(void *_call, int type) unsigned int HeaderLength = InsertPesHeader(PesHeader, call->len, MPEG_AUDIO_PES_START_CODE, call->Pts, 0); struct iovec iov[2]; iov[0].iov_base = PesHeader; - iov[0].iov_len = HeaderLength; + iov[0].iov_len = HeaderLength; iov[1].iov_base = call->data; - iov[1].iov_len = call->len; + iov[1].iov_len = call->len; return writev_with_retry(call->fd, iov, 2); } @@ -219,7 +219,7 @@ static int writeDataADTS(void *_call) return 0; } if ((call->private_data && 0 == strncmp("ADTS", call->private_data, call->private_size)) || - HasADTSHeader(call->data, call->len)) + HasADTSHeader(call->data, call->len)) { return _writeData(_call, 0); } @@ -294,7 +294,7 @@ static int writeDataLATM(void *_call) if (ret) { printf("%02x %02x %02x %02x %02x %02x %02x %02x\n", (int)call->data[0], (int)call->data[1], (int)call->data[2], (int)call->data[3], \ - (int)call->data[4], (int)call->data[5], (int)call->data[6], (int)call->data[7]); + (int)call->data[4], (int)call->data[5], (int)call->data[6], (int)call->data[7]); aac_err("latm_decode_extradata failed. ignoring...\n"); return 0; } diff --git a/libeplayer3-arm/output/writer/mipsel/ac3.c b/libeplayer3-arm/output/writer/mipsel/ac3.c index fb1c87e..017b2b2 100644 --- a/libeplayer3-arm/output/writer/mipsel/ac3.c +++ b/libeplayer3-arm/output/writer/mipsel/ac3.c @@ -99,7 +99,7 @@ static int writeData(void *_call) { WriterAVCallData_t *call = (WriterAVCallData_t *) _call; ac3_printf(10, "\n"); - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; + unsigned char PesHeader[PES_MAX_HEADER_SIZE]; if (call == NULL) { ac3_err("call data is NULL...\n"); @@ -118,7 +118,7 @@ static int writeData(void *_call) } struct iovec iov[3]; iov[0].iov_base = PesHeader; - iov[0].iov_len = InsertPesHeader(PesHeader, call->len, MPEG_AUDIO_PES_START_CODE, call->Pts, 0); //+ sizeof(AC3_SYNC_HEADER) + iov[0].iov_len = InsertPesHeader(PesHeader, call->len, MPEG_AUDIO_PES_START_CODE, call->Pts, 0); //+ sizeof(AC3_SYNC_HEADER) //PesHeader[6] = 0x81; //PesHeader[7] = 0x80; //PesHeader[8] = 0x09; diff --git a/libeplayer3-arm/output/writer/mipsel/divx3.c b/libeplayer3-arm/output/writer/mipsel/divx3.c index f933f1a..cc9f93a 100644 --- a/libeplayer3-arm/output/writer/mipsel/divx3.c +++ b/libeplayer3-arm/output/writer/mipsel/divx3.c @@ -106,6 +106,7 @@ static uint8_t brcm_divx311_sequence_header[] = /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { initialHeader = 1; @@ -146,11 +147,11 @@ static int writeData(void *_call) data += 38; data[0] = B_GET_BITS(width, 11, 4); data[1] = B_SET_BITS("width [3..0]", B_GET_BITS(width, 3, 0), 7, 4) | - B_SET_BITS("'10'", 0x02, 3, 2) | - B_SET_BITS("height [11..10]", B_GET_BITS(height, 11, 10), 1, 0); + B_SET_BITS("'10'", 0x02, 3, 2) | + B_SET_BITS("height [11..10]", B_GET_BITS(height, 11, 10), 1, 0); data[2] = B_GET_BITS(height, 9, 2); data[3] = B_SET_BITS("height [1.0]", B_GET_BITS(height, 1, 0), 7, 6) | - B_SET_BITS("'100000'", 0x20, 5, 0); + B_SET_BITS("'100000'", 0x20, 5, 0); iov[ic].iov_base = brcm_divx311_sequence_header; iov[ic++].iov_len = sizeof(brcm_divx311_sequence_header); } diff --git a/libeplayer3-arm/output/writer/mipsel/h263.c b/libeplayer3-arm/output/writer/mipsel/h263.c index 259d77e..ab79368 100644 --- a/libeplayer3-arm/output/writer/mipsel/h263.c +++ b/libeplayer3-arm/output/writer/mipsel/h263.c @@ -69,6 +69,7 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); #else #define h263_err(fmt, x...) #endif + /* ***************************** */ /* Types */ /* ***************************** */ diff --git a/libeplayer3-arm/output/writer/mipsel/h264.c b/libeplayer3-arm/output/writer/mipsel/h264.c index 36cf343..1f766e7 100644 --- a/libeplayer3-arm/output/writer/mipsel/h264.c +++ b/libeplayer3-arm/output/writer/mipsel/h264.c @@ -72,7 +72,7 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); #define h264_err(fmt, x...) #endif -#define IOVEC_SIZE 128 +#define IOVEC_SIZE 128 /* ***************************** */ /* Types */ @@ -314,8 +314,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 32190e4..87cc830 100644 --- a/libeplayer3-arm/output/writer/mipsel/h265.c +++ b/libeplayer3-arm/output/writer/mipsel/h265.c @@ -198,7 +198,7 @@ static int writeData(void *_call) h264_err("file pointer < 0. ignoring ...\n"); return 0; } - if (call->InfoFlags & 0x1) // TS container + if (call->InfoFlags & 0x1) // TS container { h264_printf(10, "H265 simple inject method!\n"); uint32_t PacketLength = 0; diff --git a/libeplayer3-arm/output/writer/mipsel/pcm.c b/libeplayer3-arm/output/writer/mipsel/pcm.c index 524cf29..00e6f31 100644 --- a/libeplayer3-arm/output/writer/mipsel/pcm.c +++ b/libeplayer3-arm/output/writer/mipsel/pcm.c @@ -266,8 +266,7 @@ static int32_t writeData(void *_call) iov[1].iov_len = fixed_buffersize; writev_with_retry(call->fd, iov, 2); fixed_buffertimestamp += fixed_bufferduration; - int g_fd_dump = open("/hdd/lpcm/ffmpeg.pes", O_CREAT | - O_RDWR | O_APPEND, S_IRUSR | S_IWUSR); + int g_fd_dump = open("/hdd/lpcm/ffmpeg.pes", O_CREAT | O_RDWR | O_APPEND, S_IRUSR | S_IWUSR); writev_with_retry(g_fd_dump, iov, 2); close(g_fd_dump); } diff --git a/libeplayer3-arm/output/writer/mipsel/vc1.c b/libeplayer3-arm/output/writer/mipsel/vc1.c index 3fd5c96..c591011 100644 --- a/libeplayer3-arm/output/writer/mipsel/vc1.c +++ b/libeplayer3-arm/output/writer/mipsel/vc1.c @@ -100,6 +100,7 @@ static video_codec_data_t videocodecdata = {0, 0}; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { initialHeader = 1; @@ -153,8 +154,8 @@ static int writeData(void *_call) } } uint8_t needFrameStartCode = 0; - if (sizeof(Vc1FrameStartCode) >= call->len - || memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0) + if (sizeof(Vc1FrameStartCode) >= call->len || + memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0) { needFrameStartCode = 1; PacketLength += sizeof(Vc1FrameStartCode); diff --git a/libeplayer3-arm/output/writer/mipsel/wmv.c b/libeplayer3-arm/output/writer/mipsel/wmv.c index 7658bce..7722818 100644 --- a/libeplayer3-arm/output/writer/mipsel/wmv.c +++ b/libeplayer3-arm/output/writer/mipsel/wmv.c @@ -98,6 +98,7 @@ static video_codec_data_t videocodecdata = {0, 0}; /* ***************************** */ /* MISC Functions */ /* ***************************** */ + static int reset() { initialHeader = 1; @@ -159,8 +160,8 @@ static int writeData(void *_call) } } uint8_t needFrameStartCode = 0; - if (sizeof(Vc1FrameStartCode) >= call->len - || memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0) + if (sizeof(Vc1FrameStartCode) >= call->len || + memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0) { needFrameStartCode = 1; PacketLength += sizeof(Vc1FrameStartCode); diff --git a/libeplayer3-arm/output/writer/mipsel/writer.c b/libeplayer3-arm/output/writer/mipsel/writer.c index ae0d2f4..fa9afe2 100644 --- a/libeplayer3-arm/output/writer/mipsel/writer.c +++ b/libeplayer3-arm/output/writer/mipsel/writer.c @@ -99,6 +99,7 @@ static Writer_t *AvailableWriter[] = /* ***************************** */ /* Functions */ /* ***************************** */ + ssize_t write_with_retry(int fd, const void *buf, size_t size) { ssize_t ret; diff --git a/libeplayer3-arm/output/writer/sh4/aac.c b/libeplayer3-arm/output/writer/sh4/aac.c index a7aded4..6eeab11 100644 --- a/libeplayer3-arm/output/writer/sh4/aac.c +++ b/libeplayer3-arm/output/writer/sh4/aac.c @@ -180,7 +180,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)) + (AV_RB16(call->data + 1) & 0x1FFF) + 3 == call->len)) { aac_err("parsing Data with wrong latm header. ignoring...\n"); return 0; @@ -217,7 +217,7 @@ static int writeDataADTS(void *_call) return 0; } if ((call->private_data && 0 == strncmp("ADTS", call->private_data, call->private_size)) || - HasADTSHeader(call->data, call->len)) + HasADTSHeader(call->data, call->len)) { return _writeData(_call, 0); } @@ -291,7 +291,7 @@ static int writeDataLATM(void *_call) if (ret) { printf("%02x %02x %02x %02x %02x %02x %02x %02x\n", (int)call->data[0], (int)call->data[1], (int)call->data[2], (int)call->data[3], \ - (int)call->data[4], (int)call->data[5], (int)call->data[6], (int)call->data[7]); + (int)call->data[4], (int)call->data[5], (int)call->data[6], (int)call->data[7]); aac_err("latm_decode_extradata failed. ignoring...\n"); return 0; } diff --git a/libeplayer3-arm/output/writer/sh4/h264.c b/libeplayer3-arm/output/writer/sh4/h264.c index f86e06f..482b219 100644 --- a/libeplayer3-arm/output/writer/sh4/h264.c +++ b/libeplayer3-arm/output/writer/sh4/h264.c @@ -52,6 +52,7 @@ /* ***************************** */ /* Makros/Constants */ /* ***************************** */ + #ifdef SAM_WITH_DEBUG #define H264_DEBUG #else @@ -232,8 +233,8 @@ static int32_t writeData(void *_call) } /* AnnexA */ if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) || - (call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) || - (call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff)))) + (call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) || + (call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff)))) { uint32_t PacketLength = 0; uint32_t FakeStartCode = /*(call->Version << 8) | */PES_VERSION_FAKE_START_CODE; @@ -401,7 +402,7 @@ static int32_t writeData(void *_call) if (NalStart + NalLength > SampleSize) { h264_printf(20, "nal length past end of buffer - size %u frame offset %u left %u\n", - NalLength, NalStart, SampleSize - NalStart); + NalLength, NalStart, SampleSize - NalStart); NalStart = SampleSize; } else diff --git a/libeplayer3-arm/output/writer/sh4/mpeg2.c b/libeplayer3-arm/output/writer/sh4/mpeg2.c index 063f301..2fd8ad6 100644 --- a/libeplayer3-arm/output/writer/sh4/mpeg2.c +++ b/libeplayer3-arm/output/writer/sh4/mpeg2.c @@ -120,7 +120,7 @@ static int writeData(void *_call) while (Position < call->len) { int32_t PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ? - (call->len - Position) : MAX_PES_PACKET_SIZE; + (call->len - Position) : MAX_PES_PACKET_SIZE; int32_t Remaining = call->len - Position - PacketLength; mpeg2_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position); struct iovec iov[2]; diff --git a/libeplayer3-arm/output/writer/sh4/pcm.c b/libeplayer3-arm/output/writer/sh4/pcm.c index 7a17231..5b752dd 100644 --- a/libeplayer3-arm/output/writer/sh4/pcm.c +++ b/libeplayer3-arm/output/writer/sh4/pcm.c @@ -119,11 +119,11 @@ static uint32_t breakBufferFillSize = 0; static int32_t prepareClipPlay(int32_t uNoOfChannels, int32_t uSampleRate, int32_t uBitsPerSample, uint8_t bLittleEndian __attribute__((unused))) { printf("rate: %d ch: %d bits: %d (%d bps)\n", - uSampleRate/*Format->dwSamplesPerSec*/, - uNoOfChannels/*Format->wChannels*/, - uBitsPerSample/*Format->wBitsPerSample*/, - (uBitsPerSample/*Format->wBitsPerSample*/ / 8) - ); + uSampleRate/*Format->dwSamplesPerSec*/, + uNoOfChannels/*Format->wChannels*/, + uBitsPerSample/*Format->wBitsPerSample*/, + (uBitsPerSample/*Format->wBitsPerSample*/ / 8) + ); SubFrameLen = 0; SubFramesPerPES = 0; breakBufferFillSize = 0; diff --git a/libeplayer3-arm/output/writer/sh4/vc1.c b/libeplayer3-arm/output/writer/sh4/vc1.c index e51a267..baa8129 100644 --- a/libeplayer3-arm/output/writer/sh4/vc1.c +++ b/libeplayer3-arm/output/writer/sh4/vc1.c @@ -51,15 +51,15 @@ /* Makros/Constants */ /* ***************************** */ -#define WMV3_PRIVATE_DATA_LENGTH 4 +#define WMV3_PRIVATE_DATA_LENGTH 4 -#define METADATA_STRUCT_A_START 12 -#define METADATA_STRUCT_B_START 24 -#define METADATA_STRUCT_B_FRAMERATE_START 32 -#define METADATA_STRUCT_C_START 8 +#define METADATA_STRUCT_A_START 12 +#define METADATA_STRUCT_B_START 24 +#define METADATA_STRUCT_B_FRAMERATE_START 32 +#define METADATA_STRUCT_C_START 8 -#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80 -#define VC1_FRAME_START_CODE 0x0d +#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80 +#define VC1_FRAME_START_CODE 0x0d #ifdef SAM_WITH_DEBUG #define VC1_DEBUG @@ -87,9 +87,9 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); /* Types */ /* ***************************** */ -static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE}; +static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE}; -static const unsigned char Metadata[] = +static const unsigned char Metadata[] = { 0x00, 0x00, 0x00, 0xc5, 0x04, 0x00, 0x00, 0x00, @@ -103,7 +103,7 @@ static const unsigned char Metadata[] = }; /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static int initialHeader = 1; @@ -199,7 +199,7 @@ static int writeData(void *_call) while (Position < call->len) { int32_t PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ? - (call->len - Position) : MAX_PES_PACKET_SIZE; + (call->len - Position) : MAX_PES_PACKET_SIZE; int32_t Remaining = call->len - Position - PacketLength; vc1_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position); uint8_t PesHeader[PES_MAX_HEADER_SIZE]; diff --git a/libeplayer3-arm/output/writer/sh4/wmv.c b/libeplayer3-arm/output/writer/sh4/wmv.c index bcfbb0d..cc61134 100644 --- a/libeplayer3-arm/output/writer/sh4/wmv.c +++ b/libeplayer3-arm/output/writer/sh4/wmv.c @@ -51,7 +51,7 @@ /* Makros/Constants */ /* ***************************** */ -#define WMV3_PRIVATE_DATA_LENGTH 4 +#define WMV3_PRIVATE_DATA_LENGTH 4 #define METADATA_STRUCT_A_START 12 #define METADATA_STRUCT_B_START 24 @@ -149,7 +149,7 @@ static int writeData(void *_call) wmv_printf(10, "VideoPts %lld\n", call->Pts); wmv_printf(10, "Got Private Size %d\n", call->private_size); memcpy(private_data.privateData, call->private_data, - call->private_size > WMV3_PRIVATE_DATA_LENGTH ? WMV3_PRIVATE_DATA_LENGTH : call->private_size); + call->private_size > WMV3_PRIVATE_DATA_LENGTH ? WMV3_PRIVATE_DATA_LENGTH : call->private_size); private_data.width = call->Width; private_data.height = call->Height; private_data.framerate = call->FrameRate; @@ -185,7 +185,7 @@ static int writeData(void *_call) *PesPtr++ = (crazyFramerate >> 16) & 0xff; *PesPtr++ = crazyFramerate >> 24; MetadataLength = PesPtr - &PesPacket[PES_MIN_HEADER_SIZE]; - int HeaderLength = InsertPesHeader(PesPacket, MetadataLength, VC1_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); + int HeaderLength = InsertPesHeader(PesPacket, MetadataLength, VC1_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); len = write(call->fd, PesPacket, HeaderLength + MetadataLength); initialHeader = 0; } @@ -196,7 +196,7 @@ static int writeData(void *_call) while (Position < call->len) { int PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ? - (call->len - Position) : MAX_PES_PACKET_SIZE; + (call->len - Position) : MAX_PES_PACKET_SIZE; int Remaining = call->len - Position - PacketLength; wmv_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position); unsigned char PesHeader[PES_MAX_HEADER_SIZE]; @@ -207,11 +207,10 @@ static int writeData(void *_call) { unsigned int PesLength; unsigned int PrivateHeaderLength; - PrivateHeaderLength = InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], - call->len); + PrivateHeaderLength = InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], call->len); /* Update PesLength */ PesLength = PesHeader[PES_LENGTH_BYTE_0] + - (PesHeader[PES_LENGTH_BYTE_1] << 8) + PrivateHeaderLength; + (PesHeader[PES_LENGTH_BYTE_1] << 8) + PrivateHeaderLength; PesHeader[PES_LENGTH_BYTE_0] = PesLength & 0xff; PesHeader[PES_LENGTH_BYTE_1] = (PesLength >> 8) & 0xff; PesHeader[PES_HEADER_DATA_LENGTH_BYTE] += PrivateHeaderLength; diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index f0c0563..05adce8 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -175,9 +175,9 @@ static int PlaybackOpen(Context_t *context, PlayFiles_t *pFiles) return cERR_PLAYBACK_ERROR; } pFiles->szFirstFile = context->playback->uri; - if ((context->container->Command(context, CONTAINER_ADD, extension) < 0) - || (!context->container->selectedContainer) - || (context->container->selectedContainer->Command(context, CONTAINER_INIT, pFiles) < 0)) + if ((context->container->Command(context, CONTAINER_ADD, extension) < 0) || + (!context->container->selectedContainer) || + (context->container->selectedContainer->Command(context, CONTAINER_INIT, pFiles) < 0)) { playback_err("CONTAINER_ADD failed\n"); return cERR_PLAYBACK_ERROR; @@ -307,8 +307,8 @@ static int32_t PlaybackContinue(Context_t *context) int32_t ret = cERR_PLAYBACK_NO_ERROR; playback_printf(10, "\n"); if (context->playback->isPlaying && - (context->playback->isPaused || context->playback->isForwarding || - context->playback->BackWard || context->playback->SlowMotion)) + (context->playback->isPaused || context->playback->isForwarding || + context->playback->BackWard || context->playback->SlowMotion)) { if (context->playback->SlowMotion || context->playback->isForwarding) context->output->Command(context, OUTPUT_CLEAR, NULL); @@ -440,7 +440,8 @@ static int PlaybackFastBackward(Context_t *context, int *speed) int32_t ret = cERR_PLAYBACK_NO_ERROR; playback_printf(10, "speed = %d\n", *speed); /* Audio only reverse play not supported */ - if (context->playback->isVideo && !context->playback->isForwarding && (!context->playback->isPaused || context->playback->isPlaying)) + if (context->playback->isVideo && !context->playback->isForwarding && + (!context->playback->isPaused || context->playback->isPlaying)) { if ((*speed > 0) || (*speed < cMaxSpeed_fr)) { From 4c7de1485f88ce5b535dcd6c2398db42c90a6b22 Mon Sep 17 00:00:00 2001 From: max_10 Date: Thu, 18 Jan 2018 11:53:42 +0100 Subject: [PATCH 26/36] Revert "libeplayer3: switch off the teletext sub" This reverts commit a932976706049e0358d7f96be3d9070a92d2dc05. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/bfb3de420fbbc620cbf309b0d918857f04e7d523 Author: max_10 Date: 2018-01-18 (Thu, 18 Jan 2018) ------------------ This commit was generated by Migit --- libeplayer3/input.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libeplayer3/input.cpp b/libeplayer3/input.cpp index 9af9aae..7218a4f 100644 --- a/libeplayer3/input.cpp +++ b/libeplayer3/input.cpp @@ -80,7 +80,7 @@ extern void dvbsub_write(AVSubtitle *, int64_t); extern void dvbsub_ass_write(AVCodecContext *c, AVSubtitle *sub, int pid); extern void dvbsub_ass_clear(void); // from neutrino-mp/lib/lib/libtuxtxt/tuxtxt_common.h -//extern void teletext_write(int pid, uint8_t *data, int size); +extern void teletext_write(int pid, uint8_t *data, int size); static std::string lastlog_message; static unsigned int lastlog_repeats; @@ -253,11 +253,10 @@ bool Input::Play() } } } + } else if (_teletextTrack && (_teletextTrack->stream == stream)) { + if (packet.data && packet.size > 1) + teletext_write(_teletextTrack->pid, packet.data + 1, packet.size - 1); } -// else if (_teletextTrack && (_teletextTrack->stream == stream)) { -// if (packet.data && packet.size > 1) -// teletext_write(_teletextTrack->pid, packet.data + 1, packet.size - 1); -// } #if (LIBAVFORMAT_VERSION_MAJOR == 57 && LIBAVFORMAT_VERSION_MINOR == 25) av_packet_unref(&packet); From a15821b775349ec4c3862b3f58bae3e7a933dee8 Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Fri, 19 Jan 2018 15:09:41 +0100 Subject: [PATCH 27/36] libeplayer3-arm: fix fast forward (thx DboxOldie) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/ee18fd5c8a39a93e1a5b4957ad8621dce2db6eed 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/playback/playback.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index 05adce8..986017e 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -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 84010cb992edded197971f6f600ea5e39dcb9a65 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 24 Oct 2017 15:57:30 +0200 Subject: [PATCH 28/36] fix get play position Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/e4d7f023172db4797de15a631ec98ca6b54eff73 Author: Jacek Jendrzej Date: 2017-10-24 (Tue, 24 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index cb6c6d0..f1df4b8 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -845,13 +845,10 @@ bool cPlayback::GetPosition(int &position, int &duration) if (audioSink || videoSink) { g_signal_emit_by_name(audioSink ? audioSink : videoSink, "get-decoder-time", &pts); - if (!GST_CLOCK_TIME_IS_VALID(pts)) - { + if (!GST_CLOCK_TIME_IS_VALID(pts)){ lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); } - } - else - { + }else{ if(!gst_element_query_position(m_gst_playbin, fmt, &pts)) { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); From 90719d7f357f1301fde818ce53418ff49fc6eb62 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 24 Oct 2017 18:32:36 +0200 Subject: [PATCH 29/36] fix null list Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/c0963b38f066a3b1b98bfb73ab6e6b546d440dc3 Author: Jacek Jendrzej Date: 2017-10-24 (Tue, 24 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index f1df4b8..f402cd0 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -457,7 +457,7 @@ cPlayback::~cPlayback() //FIXME: all deleting stuff is done in Close() pthread_mutex_lock (&mutex_tag_ist); if (m_stream_tags) - gst_tag_list_unref(m_stream_tags); + gst_tag_list_free(m_stream_tags); pthread_mutex_unlock (&mutex_tag_ist); } From e28d6f3d936e1b3c0fe9b527347110b9d8aa5ae2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 11 Nov 2017 16:52:38 +0100 Subject: [PATCH 30/36] return false in decoder have no time Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/0e1d7fe1b5ca02a0c818044750263b7c24495ed9 Author: Jacek Jendrzej Date: 2017-11-11 (Sat, 11 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index f402cd0..181c593 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -847,11 +847,14 @@ bool cPlayback::GetPosition(int &position, int &duration) g_signal_emit_by_name(audioSink ? audioSink : videoSink, "get-decoder-time", &pts); if (!GST_CLOCK_TIME_IS_VALID(pts)){ lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); + return false; } }else{ - if(!gst_element_query_position(m_gst_playbin, fmt, &pts)) + if(!gst_element_query_position(m_gst_playbin, fmt, &pts)){ { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); + return false; + } } } position = pts / 1000000.0; From 7e2988fa05ccf401cabd6443fb2d8c6511a4034d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 12 Nov 2017 08:57:41 +0100 Subject: [PATCH 31/36] Revert "return false in decoder have no time" This reverts commit e2c368551fd2adfd5ee2c7a5218551ee5b4ad5a4. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/a28ebe6eaeb88d2a6a6c97491a47cbca5a441a91 Author: Jacek Jendrzej Date: 2017-11-12 (Sun, 12 Nov 2017) ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 181c593..f402cd0 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -847,14 +847,11 @@ bool cPlayback::GetPosition(int &position, int &duration) g_signal_emit_by_name(audioSink ? audioSink : videoSink, "get-decoder-time", &pts); if (!GST_CLOCK_TIME_IS_VALID(pts)){ lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); - return false; } }else{ - if(!gst_element_query_position(m_gst_playbin, fmt, &pts)){ + if(!gst_element_query_position(m_gst_playbin, fmt, &pts)) { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); - return false; - } } } position = pts / 1000000.0; From 9d2b669b6b396b49edd4ce30ebefa71a557504c7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Nov 2017 15:24:03 +0100 Subject: [PATCH 32/36] libarmbox/playback_gst.cpp: small format changes Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/0ad071c97b9c57eeed4b3a20a5d04430f0a1b9a2 Author: Thilo Graf Date: 2017-11-14 (Tue, 14 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index f402cd0..7cb5b8f 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -845,10 +845,13 @@ bool cPlayback::GetPosition(int &position, int &duration) if (audioSink || videoSink) { g_signal_emit_by_name(audioSink ? audioSink : videoSink, "get-decoder-time", &pts); - if (!GST_CLOCK_TIME_IS_VALID(pts)){ + if (!GST_CLOCK_TIME_IS_VALID(pts)) + { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); } - }else{ + } + else + { if(!gst_element_query_position(m_gst_playbin, fmt, &pts)) { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); From 112400268e7c7e74c5cee1f4d303bd50382b5cb7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Jan 2018 13:52:58 +0100 Subject: [PATCH 33/36] libarmbox/playback_gst.cpp: minor format changes Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/4ecbe7733bef68743d196766146a5189c51ad977 Author: Thilo Graf Date: 2018-01-21 (Sun, 21 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 7cb5b8f..4d380be 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -354,8 +354,6 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) gst_object_unref(GST_OBJECT(videoSink)); videoSink = NULL; } - - // set audio sink children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin)); if (children && gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBAudioSink")) { @@ -365,8 +363,6 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) } gst_iterator_free(children); - - // set video sink children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin)); if (children && gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBVideoSink")) { @@ -374,10 +370,7 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) g_value_unset (&r); lt_info_c( "%s %s - video sink created\n", FILENAME, __FUNCTION__); } - gst_iterator_free(children); - } - break; } break; @@ -415,13 +408,13 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) return GST_BUS_DROP; } + cPlayback::cPlayback(int num) { lt_info( "%s:%s\n", FILENAME, __FUNCTION__); const gchar *nano_str; guint major, minor, micro, nano; - /* init gstreamer */ gst_init(NULL, NULL); gst_version (&major, &minor, µ, &nano); @@ -450,14 +443,13 @@ cPlayback::cPlayback(int num) first = false; } -/* called at housekepping */ cPlayback::~cPlayback() { lt_info( "%s:%s\n", FILENAME, __FUNCTION__); //FIXME: all deleting stuff is done in Close() pthread_mutex_lock (&mutex_tag_ist); if (m_stream_tags) - gst_tag_list_free(m_stream_tags); + gst_tag_list_unref(m_stream_tags); pthread_mutex_unlock (&mutex_tag_ist); } @@ -619,14 +611,12 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/, flags |= GST_PLAY_FLAG_BUFFERING; } - // set flags g_object_set(G_OBJECT (m_gst_playbin), "flags", flags, NULL); - // set uri g_object_set(G_OBJECT (m_gst_playbin), "uri", uri, NULL); //gstbus handler - GstBus * bus = gst_pipeline_get_bus(GST_PIPELINE(m_gst_playbin)); + GstBus * bus = gst_pipeline_get_bus( GST_PIPELINE(m_gst_playbin) ); gst_bus_set_sync_handler(bus, Gst_bus_call, NULL, NULL); if (bus) gst_object_unref(bus); @@ -683,7 +673,6 @@ bool cPlayback::Stop(void) { if(playing == false) return false; - lt_info( "%s:%s playing %d\n", FILENAME, __FUNCTION__, playing); // stop @@ -857,7 +846,7 @@ bool cPlayback::GetPosition(int &position, int &duration) lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); } } - position = pts / 1000000.0; + position = pts / 1000000.0; // duration GstFormat fmt_d = GST_FORMAT_TIME; //Returns time in nanosecs double length = 0; @@ -1008,7 +997,7 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu gst_tag_list_free(tags); } } - *numpida = i; + *numpida=i; } } From ce293f28f5251073d49790e18f737a5b25832b7d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Jan 2018 13:54:17 +0100 Subject: [PATCH 34/36] libarmbox/hardware_caps.c: add missing init for caps.display_can_deepstandby Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/a8c886d16627b609c898dc9a632bdcf31913d426 Author: Thilo Graf Date: 2018-01-21 (Sun, 21 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/hardware_caps.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libarmbox/hardware_caps.c b/libarmbox/hardware_caps.c index 6ab3fe9..7ec40c8 100644 --- a/libarmbox/hardware_caps.c +++ b/libarmbox/hardware_caps.c @@ -34,6 +34,7 @@ hw_caps_t *get_hwcaps(void) caps.can_shutdown = 1; caps.display_xres = 16; caps.display_type = HW_DISPLAY_LINE_TEXT; + caps.display_can_deepstandby = 0; caps.display_can_set_brightness = 1; caps.display_has_statusline = 0; caps.has_HDMI = 1; From f67797a109170697d0d31ef3fd1b7e34630065ae Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Jan 2018 13:58:58 +0100 Subject: [PATCH 35/36] libarmbox/video.cpp: add missing lines in setBlank() Fix lost lines in pick 'add armbox' Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/9395b18f89bed381c5d32ce00642e37276e91e7c Author: Thilo Graf Date: 2018-01-21 (Sun, 21 Jan 2018) ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 7223a97..56bf050 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -470,6 +470,10 @@ int cVideo::Stop(bool blank) int cVideo::setBlank(int) { + fop(ioctl, VIDEO_PLAY); + fop(ioctl, VIDEO_CONTINUE); + video_still_picture sp = { NULL, 0 }; + fop(ioctl, VIDEO_STILLPICTURE, &sp); return Stop(1); } From ad62052b2ff59f20da16adf841d680e2eee63f5b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Jan 2018 15:20:23 +0100 Subject: [PATCH 36/36] update to version 1.0.3-mpx Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/ac95d67e896a3e282c3606af0ccd58f56c716717 Author: Thilo Graf Date: 2018-01-21 (Sun, 21 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- ChangeLog | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- 2 files changed, 158 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8bebc1a..e7648ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,160 @@ +2018-01-21 Thilo Graf + + update to version 1.0.3-mpx + + libarmbox/video.cpp: add missing lines in setBlank() + Fix lost lines in pick 'add armbox' + + libarmbox/hardware_caps.c: add missing init for caps.display_can_deepstandby + + libarmbox/playback_gst.cpp: minor format changes + + libarmbox/playback_gst.cpp: small format changes + +2018-01-21 Jacek Jendrzej + + Revert "return false in decoder have no time" + This reverts commit 6f006f1ce9026cccddfe87a88fb3ebaa1f6a9e98. + + return false in decoder have no time + + fix null list + + fix get play position + +2018-01-21 Frankenstone + + libeplayer3-arm: fix fast forward (thx DboxOldie) + +2018-01-21 max_10 + + Revert "libeplayer3: switch off the teletext sub" + This reverts commit 96bd1c5c9f631ceb272dd4afb4667e8a976c8620. + + libeplayer3-arm: Code formatting + + libeplayer3-arm: eliminate some warnings + + adding SLOWMOTION, FASTBACKWARD and FASTFORWARD are not working properly yet. + +2018-01-21 TangoCash + + fix last commit + + generic gestreamer align to armbox + +2018-01-21 max_10 + + test + + Revert "Revert "libeplayer3: switch off the teletext sub"" + This reverts commit a2fc1d51ee2bd5d66263aecdbf2936cf26e91f17. + +2018-01-21 Jacek Jendrzej + + Revert "return false in decoder have no time" + This reverts commit 6f006f1ce9026cccddfe87a88fb3ebaa1f6a9e98. + + return false in decoder have no time + +2018-01-21 max_10 + + libarmbox: fix resolution icon in infoviewer + + armbox: Cosmetics replace spaces with tabs and delete unnecessary tabs + +2018-01-20 max_10 + + armbox eplayer: fix playing files with subtitles + + Conflicts: + libeplayer3-arm/manager/subtitle.c + + additional format fixes, solved conflicts and clean up + +2018-01-20 max_10 + + libeplayer3-arm: audio.c delete newline + + generic-pc: switch to ffmpeg 3.0 API + + libarmbox/video: Workaround Channel Change No Black Picture when Show Picture was active. + + libeplayer3-arm: fixes segfault on internet streams (thx DboxOldie) + +2018-01-20 Frankenstone + + libeplayer3-arm: fix fast forward (thx DboxOldie) + Conflicts: + libeplayer3-arm/playback/playback.c + +2018-01-11 TangoCash + + armbox eplayer: fix init jump + +2018-01-11 max_10 + + fix ci arm auth (thx DboxOldie) + +2018-01-11 svenhoefer + + - fix build for generic-pc + +2018-01-11 max_10 + + libeplayer3-arm: update Makefile.am + + libeplayer3-arm: eliminate some warnings + + libeplayer3-arm: Code formatting + +2018-01-07 Frankenstone + + fix ci arm hardware (thx DboxOldie) + +2018-01-07 max_10 + + armbox eplayer: remove writeReverseData (unused) + +2018-01-03 Jacek Jendrzej + + remove double AV_CODEC_ID_EAC3 + +2018-01-03 max_10 + + armbox eplayer: noprobe for ts (thx DboxOldie) + + armbox eplayer: increase wait time (thx DboxOldie) + + armbox eplayer: eplayer3 Binary adaptation to the changed manager list (thx DboxOldie) + +2018-01-03 TangoCash + + armbox eplayer: fix playing files with subtitles + +2018-01-02 svenhoefer + + - add some missing members for ARM_HARDWARE; mostly dummy functions + +2017-12-28 max_10 + + libeplayer3-arm: Code formatting + + libarmbox: Code formatting playback_libeplayer3 + + armbox eplayer: add eplayer3 bin + + Code formatting + +2017-12-28 TangoCash + + eplayer armbox: fix webtv (thx dbo) + +2017-12-21 Thilo Graf + + update version 1.0.2-mpx + eplayer beta + 2017-12-21 TangoCash armbox eplayer: reactivate audio, subtitle and chapters diff --git a/configure.ac b/configure.ac index cda32e2..f6bf9fe 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([libstb-hal], [1.0.2]) +AC_INIT([libstb-hal], [1.0.3]) AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AC_CONFIG_MACRO_DIR([m4])