diff --git a/lib/hardware/coolstream/Makefile.am b/lib/hardware/coolstream/Makefile.am index d460837c3..b2a96b31e 100644 --- a/lib/hardware/coolstream/Makefile.am +++ b/lib/hardware/coolstream/Makefile.am @@ -1,12 +1,9 @@ -noinst_LIBRARIES = libhwcaps.a - AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing -if BOXMODEL_CS_HD2 -AM_CPPFLAGS = -I$(top_srcdir)/lib/hardware/coolstream/hd2/libcoolstream -else -AM_CPPFLAGS = -I$(top_srcdir)/lib/hardware/coolstream/hd1/libcoolstream -endif +AM_CPPFLAGS = \ + @HWLIB_CFLAGS@ + +noinst_LIBRARIES = libhwcaps.a libhwcaps_a_SOURCES = \ hardware_caps.cpp diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 216a6dcae..592202285 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -18,6 +18,7 @@ hw_caps_t *get_hwcaps(void) { if (initialized) return ∩︀ int rev = cs_get_revision(); + int chip = cs_get_chip_type(); caps.has_fan = (rev < 8); caps.has_HDMI = 1; caps.has_SCART = (rev != 10); @@ -33,7 +34,6 @@ hw_caps_t *get_hwcaps(void) { caps.can_ps_14_9 = 1; caps.force_tuner_2G = 0; strcpy(caps.boxvendor, "Coolstream"); - /* list of boxnames from neutrinoyparser.cpp */ strcpy(caps.boxarch, "Nevis"); switch (rev) { case 6: @@ -41,7 +41,7 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "HD1"); caps.force_tuner_2G = 1; break; - case 8: + case 8: // TODO: Neo2 - Twin strcpy(caps.boxname, "Neo"); caps.force_tuner_2G = 1; break; @@ -54,13 +54,29 @@ hw_caps_t *get_hwcaps(void) { caps.force_tuner_2G = 1; break; case 11: - strcpy(caps.boxname, "Trinity"); - strcpy(caps.boxarch, "Shiner"); + if (chip == CS_CHIP_SHINER) + { + strcpy(caps.boxname, "Trinity"); + strcpy(caps.boxarch, "Shiner"); + } + else + { + strcpy(caps.boxname, "Trinity V2"); + strcpy(caps.boxarch, "Kronos"); + } break; case 12: strcpy(caps.boxname, "Zee2"); strcpy(caps.boxarch, "Kronos"); break; + case 13: + strcpy(caps.boxname, "Link"); + strcpy(caps.boxarch, "Kronos"); + break; + case 14: + strcpy(caps.boxname, "Trinity Duo"); + strcpy(caps.boxarch, "Kronos"); + break; default: strcpy(caps.boxname, "UNKNOWN_BOX"); strcpy(caps.boxarch, "Unknown"); @@ -69,4 +85,3 @@ hw_caps_t *get_hwcaps(void) { initialized = 1; return ∩︀ } - diff --git a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h index f778e149b..1051c99c0 100644 --- a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h +++ b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h @@ -17,6 +17,13 @@ typedef void (*cs_messenger) (unsigned int msg, unsigned int data); +#define CS_CHIP_APOLLO 0x8490 +#define CS_CHIP_SHINER 0x8470 +#define CS_CHIP_KRONOS_S 0x7540 +#define CS_CHIP_KRONOS_C 0x7550 +#define CS_CHIP_KRONOS_IP 0x7530 +#define CS_CHIP_NEVIS 0x0000 /* workaround for nonexistant nevis chiptype */ + enum CS_LOG_MODULE { CS_LOG_CI = 0, CS_LOG_HDMI_CEC, @@ -71,6 +78,29 @@ int cs_get_tsp_config(unsigned int port, tsrouter_tsp_config_t *tsp_config); // Serial nr and revision accessors unsigned long long cs_get_serial(void); unsigned int cs_get_revision(void); +/* Dummy function for compatibility with hd2 */ +unsigned int cs_get_chip_type(void); +// library version functions +typedef struct cs_libversion_t +{ + int vMajor; + int vMinor; + int vPatch; + char vStr[16]; + char vGit[41]; + char vGitDescribe[64]; + time_t vGitTime; +} cs_libversion_struct_t; + +void cs_get_lib_version(cs_libversion_t *ver); + +/* return value: + ------------- + 1 Library version newer than given version + 0 library version equals given version + -1 Library version older than given version */ +int cs_compare_lib_versions(int Major, int Minor, int Patch); + #endif //__CS_API_H_ diff --git a/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h b/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h index bbb03eb46..120dcc5ac 100644 --- a/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h +++ b/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h @@ -26,6 +26,7 @@ typedef void (*cs_messenger) (unsigned int msg, unsigned int data); #define CS_CHIP_KRONOS_S 0x7540 #define CS_CHIP_KRONOS_C 0x7550 #define CS_CHIP_KRONOS_IP 0x7530 +#define CS_CHIP_NEVIS 0x0000 /* workaround for nonexistant nevis chiptype */ enum CS_LOG_MODULE { CS_LOG_CI = 0, @@ -49,6 +50,7 @@ enum CS_LOG_MODULE { // Initialization void cs_api_init(void); void cs_api_exit(void); +/* Preliminary function (for compatibility with older neutrino sources) */ void cs_new_auto_videosystem(); // Memory helpers @@ -90,4 +92,25 @@ bool cs_box_has_ci(void); unsigned int cs_get_chip_id(void); unsigned int cs_get_chip_rev_id(void); +// library version functions +typedef struct cs_libversion_t +{ + int vMajor; + int vMinor; + int vPatch; + char vStr[16]; + char vGit[41]; + char vGitDescribe[64]; + time_t vGitTime; +} cs_libversion_struct_t; + +void cs_get_lib_version(cs_libversion_t *ver); + +/* return value: + ------------- + 1 Library version newer than given version + 0 library version equals given version + -1 Library version older than given version */ +int cs_compare_lib_versions(int Major, int Minor, int Patch); + #endif //__CS_API_H_ diff --git a/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h b/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h index 3bfa62793..71f4e6db5 100644 --- a/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h +++ b/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h @@ -152,6 +152,12 @@ typedef enum VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS } VIDEO_CONTROL; +typedef struct cs_vs_format_t +{ + char formatHD[16]; + char formatSD[16]; +} cs_vs_format_struct_t; + class cDemux; class cAudio; @@ -244,8 +250,12 @@ public: int64_t GetPTS(void); int Flush(void); - /* set video_system */ + /* get video system infos */ int GetVideoSystem(); + /* when system = -1 then use current video system */ + void GetVideoSystemFormatName(cs_vs_format_t* format, int system = -1); + + /* set video_system */ int SetVideoSystem(int video_system, bool remember = true); int SetStreamType(VIDEO_FORMAT type); void SetSyncMode(AVSYNC_TYPE mode); diff --git a/lib/libdvbsub/dvbsubtitle.cpp b/lib/libdvbsub/dvbsubtitle.cpp index dad97acaa..be1bf983a 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -72,8 +72,13 @@ cDvbSubtitleBitmaps::~cDvbSubtitleBitmaps() if(sub.rects) { for (i = 0; i < Count(); i++) { +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) av_freep(&sub.rects[i]->pict.data[0]); av_freep(&sub.rects[i]->pict.data[1]); +#else + av_freep(&sub.rects[i]->data[0]); + av_freep(&sub.rects[i]->data[1]); +#endif av_freep(&sub.rects[i]); } @@ -137,7 +142,11 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) int xf = int(xc * (double) 720); #endif for (i = 0; i < Count(); i++) { +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) uint32_t * colors = (uint32_t *) sub.rects[i]->pict.data[1]; +#else + uint32_t * colors = (uint32_t *) sub.rects[i]->data[1]; +#endif int width = sub.rects[i]->w; int height = sub.rects[i]->h; int xoff, yoff; @@ -165,7 +174,11 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) // dbgconverter("cDvbSubtitleBitmaps::Draw: #%d at %d,%d size %dx%d colors %d (x=%d y=%d w=%d h=%d) \n", i+1, // sub.rects[i]->x, sub.rects[i]->y, sub.rects[i]->w, sub.rects[i]->h, sub.rects[i]->nb_colors, xoff, yoff, nw, nh); +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) fb_pixel_t * newdata = simple_resize32 (sub.rects[i]->pict.data[0], colors, sub.rects[i]->nb_colors, width, height, nw, nh); +#else + fb_pixel_t * newdata = simple_resize32 (sub.rects[i]->data[0], colors, sub.rects[i]->nb_colors, width, height, nw, nh); +#endif #ifdef HAVE_SPARK_HARDWARE // CFrameBuffer::getInstance()->waitForIdle(); diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index d83df3251..5eae7e587 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -5234,7 +5234,7 @@ void RenderPage() { page_atrb[32].fg = yellow; page_atrb[32].bg = menu1; - int showpage = tuxtxt_cache.page_receiving; + int showpage = tuxtxt_cache.page_receiving < 0 ? 0 : tuxtxt_cache.page_receiving; int showsubpage = tuxtxt_cache.subpagetable[showpage]; if (showsubpage!=0xff) { diff --git a/src/compatibility.h b/src/compatibility.h new file mode 100644 index 000000000..aa03d1ef8 --- /dev/null +++ b/src/compatibility.h @@ -0,0 +1,34 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Copyright (C) 2017, Michael Liebmann 'micha-bbg' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef __COMPATIBILITY_H__ +#define __COMPATIBILITY_H__ + + +#if !defined __UCLIBC__ || ((__UCLIBC_MAJOR__ >= 1) && (__UCLIBC_MINOR__ >= 0) && (__UCLIBC_SUBLEVEL__ >= 10)) +#define comp_malloc_stats(a) malloc_stats() +#else +#define comp_malloc_stats(a) malloc_stats(a) +#endif + + +#endif // __COMPATIBILITY_H__ diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index 3262a0a95..b85592897 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -47,6 +47,11 @@ extern "C" { #define av_frame_unref avcodec_get_frame_defaults #define av_frame_free avcodec_free_frame #endif + +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57, 8, 0 )) +#define av_packet_unref av_free_packet +#endif + #include #include @@ -218,9 +223,16 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, Status=DATA_ERR; return Status; } - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *c = avc->streams[best_stream]->codec; - +#else + AVCodecContext *c = avcodec_alloc_context3(codec); + if(avcodec_parameters_to_context(c,avc->streams[best_stream]->codecpar) < 0){ + DeInit(); + Status=DATA_ERR; + return Status; + } +#endif mutex.lock(); int r = avcodec_open2(c, codec, NULL); mutex.unlock(); @@ -322,9 +334,10 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, Status=DATA_ERR; break; } - } else + } else{ av_frame_unref(frame); - + } +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57,37,100) int len = avcodec_decode_audio4(c, frame, &got_frame, &packet); if (len < 0) { // skip frame @@ -336,6 +349,27 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, mutex.unlock(); continue; } + packet.size -= len; + packet.data += len; +#else + int ret = avcodec_send_packet(c, &packet); + if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF){ + break; + } + if (ret >= 0){ + packet.size = 0; + } + ret = avcodec_receive_frame(c, frame); + if (ret < 0){ + if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF){ + break; + } + else{ + continue; + } + } + got_frame = 1; +#endif if (got_frame && *state!=PAUSE) { int out_samples; outsamples = av_rescale_rnd(swr_get_delay(swr, c->sample_rate) + frame->nb_samples, @@ -364,8 +398,6 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, if (!start_pts) start_pts = pts; } - packet.size -= len; - packet.data += len; } if (time_played && avc->streams[best_stream]->time_base.den) *time_played = (pts - start_pts) * avc->streams[best_stream]->time_base.num / avc->streams[best_stream]->time_base.den; @@ -424,7 +456,11 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) if (!is_stream) { GetMeta(avc->metadata); for(unsigned int i = 0; i < avc->nb_streams; i++) { +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (avc->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) +#else + if (avc->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) +#endif GetMeta(avc->streams[i]->metadata); } } @@ -441,12 +477,17 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) DeInit(); return false; } - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (!codec) codec = avcodec_find_decoder(avc->streams[best_stream]->codec->codec_id); samplerate = avc->streams[best_stream]->codec->sample_rate; mChannels = av_get_channel_layout_nb_channels(avc->streams[best_stream]->codec->channel_layout); - +#else + if (!codec) + codec = avcodec_find_decoder(avc->streams[best_stream]->codecpar->codec_id); + samplerate = avc->streams[best_stream]->codecpar->sample_rate; + mChannels = av_get_channel_layout_nb_channels(avc->streams[best_stream]->codecpar->channel_layout); +#endif std::stringstream ss; if (codec && codec->long_name != NULL) @@ -466,8 +507,13 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) printf("CFfmpegDec: format %s (%s) duration %ld\n", avc->iformat->name, type_info.c_str(), total_time); for(unsigned int i = 0; i < avc->nb_streams; i++) { +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (avc->streams[i]->codec->bit_rate > 0) bitrate += avc->streams[i]->codec->bit_rate; +#else + if (avc->streams[i]->codecpar->bit_rate > 0) + bitrate += avc->streams[i]->codecpar->bit_rate; +#endif if (save_cover && (avc->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC)) { mkdir(COVERDIR, 0755); std::string cover(COVERDIR); diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 752d80d83..97eb84848 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -68,12 +68,20 @@ extern "C" { #include } +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57, 8, 0 )) +#define av_packet_unref av_free_packet +#endif + class CStreamRec : public CRecordInstance, OpenThreads::Thread { private: AVFormatContext *ifcx; AVFormatContext *ofcx; +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) AVBitStreamFilterContext *bsfc; +#else + AVBSFContext *bsfc; +#endif bool stopped; bool interrupt; time_t time_started; @@ -1993,8 +2001,13 @@ void CStreamRec::Close() } avformat_free_context(ofcx); } - if (bsfc) + if (bsfc){ +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) av_bitstream_filter_close(bsfc); +#else + av_bsf_free(&bsfc); +#endif + } ifcx = NULL; ofcx = NULL; bsfc = NULL; @@ -2011,7 +2024,11 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li for (unsigned i = 0; i < ofcx->nb_streams; i++) { AVStream *st = ofcx->streams[i]; +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * codec = st->codec; +#else + AVCodecParameters * codec = st->codecpar; +#endif if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { AUDIO_PIDS audio_pids; AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); @@ -2240,12 +2257,17 @@ bool CStreamRec::Open(CZapitChannel * channel) stream_index = -1; int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * iccx = ifcx->streams[i]->codec; - AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); +#else + AVCodecParameters * iccx = ifcx->streams[i]->codecpar; + AVStream *ost = avformat_new_stream(ofcx, NULL); + avcodec_parameters_copy(ost->codecpar, iccx); +#endif av_dict_copy(&ost->metadata, ifcx->streams[i]->metadata, 0); - ost->time_base = iccx->time_base; + ost->time_base = ifcx->streams[i]->time_base; ost->id = stid++; if (iccx->codec_type == AVMEDIA_TYPE_VIDEO) { stream_index = i; @@ -2255,10 +2277,19 @@ bool CStreamRec::Open(CZapitChannel * channel) av_log_set_level(AV_LOG_VERBOSE); av_dump_format(ofcx, 0, ofcx->filename, 1); av_log_set_level(AV_LOG_WARNING); +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) bsfc = av_bitstream_filter_init("h264_mp4toannexb"); if (!bsfc) printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); - +#else + const AVBitStreamFilter *bsf = av_bsf_get_by_name("h264_mp4toannexb"); + if(!bsf) { + return false; + } + if ((av_bsf_alloc(bsf, &bsfc))) { + return false; + } +#endif return true; } @@ -2282,16 +2313,34 @@ void CStreamRec::run() break; if (pkt.stream_index < 0) continue; - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; +#else + AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; +#endif if (bsfc && codec->codec_id == AV_CODEC_ID_H264) { AVPacket newpkt = pkt; - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); pkt = newpkt; } +#else + int ret = av_bsf_send_packet(bsfc, &pkt); + if (ret < 0){ + break; + } + ret = av_bsf_receive_packet(bsfc, &newpkt); + if (ret == AVERROR(EAGAIN)){ + break; + } + if(ret != AVERROR_EOF){ + av_packet_unref(&pkt); + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; + } +#endif } pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index e7a19e32b..71b37ac58 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -60,6 +60,10 @@ #include #include +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57, 8, 0 )) +#define av_packet_unref av_free_packet +#endif + /* experimental mode: * stream not possible, if record running * pids in url ignored, and added from channel, with fake PAT/PMT @@ -762,8 +766,13 @@ void CStreamStream::Close() if (avio_ctx) av_free(avio_ctx); - if (bsfc) + if (bsfc){ +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) av_bitstream_filter_close(bsfc); +#else + av_bsf_free(&bsfc); +#endif + } ifcx = NULL; ofcx = NULL; @@ -846,21 +855,35 @@ bool CStreamStream::Open() av_dict_copy(&ofcx->metadata, ifcx->metadata, 0); int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * iccx = ifcx->streams[i]->codec; - AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); +#else + AVCodecParameters * iccx = ifcx->streams[i]->codecpar; + AVStream *ost = avformat_new_stream(ofcx, NULL); + avcodec_parameters_copy(ost->codecpar, iccx); +#endif av_dict_copy(&ost->metadata, ifcx->streams[i]->metadata, 0); - ost->time_base = iccx->time_base; + ost->time_base = ifcx->streams[i]->time_base; ost->id = stid++; } av_log_set_level(AV_LOG_VERBOSE); av_dump_format(ofcx, 0, ofcx->filename, 1); av_log_set_level(AV_LOG_WARNING); +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) bsfc = av_bitstream_filter_init("h264_mp4toannexb"); if (!bsfc) printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); - +#else + const AVBitStreamFilter *bsf = av_bsf_get_by_name("h264_mp4toannexb"); + if(!bsf) { + return false; + } + if ((av_bsf_alloc(bsf, &bsfc))) { + return false; + } +#endif return true; } @@ -905,15 +928,34 @@ void CStreamStream::run() if (pkt.stream_index < 0) continue; +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; +#else + AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; +#endif if (bsfc && codec->codec_id == AV_CODEC_ID_H264 ) { AVPacket newpkt = pkt; - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); pkt = newpkt; - } + } +#else + int ret = av_bsf_send_packet(bsfc, &pkt); + if (ret < 0){ + break; + } + ret = av_bsf_receive_packet(bsfc, &newpkt); + if (ret == AVERROR(EAGAIN)){ + break; + } + if(ret != AVERROR_EOF){ + av_packet_unref(&pkt); + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; + } +#endif } pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); diff --git a/src/driver/streamts.h b/src/driver/streamts.h index da2708e51..7ec1bd321 100644 --- a/src/driver/streamts.h +++ b/src/driver/streamts.h @@ -73,7 +73,11 @@ class CStreamStream : public CStreamInstance private: AVFormatContext *ifcx; AVFormatContext *ofcx; +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) AVBitStreamFilterContext *bsfc; +#else + AVBSFContext *bsfc; +#endif AVIOContext *avio_ctx; bool stopped; diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 05483366b..4d0f39b5e 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -55,6 +55,8 @@ #include "xmlutil.h" #include "debug.h" +#include + //#define ENABLE_SDT //FIXME //#define DEBUG_SDT_THREAD @@ -1067,11 +1069,7 @@ static void commandDumpStatusInformation(int /*connfd*/, char* /*data*/, const u // resourceUsage.ru_maxrss, resourceUsage.ru_ixrss, resourceUsage.ru_idrss, resourceUsage.ru_isrss, ); printf("%s\n", stati); -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - malloc_stats(); -#endif + comp_malloc_stats(NULL); return ; } @@ -1200,11 +1198,7 @@ static void FreeMemory() unlockEvents(); -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - malloc_stats(); -#endif + comp_malloc_stats(NULL); xprintf("[sectionsd] free memory done\n"); //wakeupAll(); //FIXME should we re-start eit here ? } @@ -2098,11 +2092,7 @@ static void print_meminfo(void) if (!sections_debug) return; -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - malloc_stats(); -#endif + comp_malloc_stats(NULL); } //--------------------------------------------------------------------- diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index c4ab96790..2f278031c 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -2,7 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' - Copyright (C) 2009,2011,2013,2015-2016 Stefan Seyfried + Copyright (C) 2009,2011,2013,2015-2017 Stefan Seyfried License: GPL @@ -584,7 +584,7 @@ int CBouquetList::show(bool bShowChannelList) g_RCInput->postMsg(msg, data); loop = false; res = CHANLIST_CANCEL_ALL; - } else if (msg > CRCInput::RC_MaxRC) { + } else { if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; res = CHANLIST_CANCEL_ALL; diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 9ca52c03c..5c4d8448b 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2015, Thilo Graf 'dbt' + Copyright (C) 2012-2017, Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL @@ -27,8 +27,9 @@ #include "cc_draw.h" #include "cc_timer.h" #include - +#include #include +extern CPictureViewer * g_PicViewer; CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) { @@ -44,6 +45,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) col_frame = col_frame_old = COL_FRAME_PLUS_0; col_shadow_clean = 0; + cc_body_image = cc_body_image_old = string(); + fr_thickness = fr_thickness_old = 0; corner_type = corner_type_old = CORNER_ALL; @@ -176,6 +179,11 @@ inline bool CCDraw::applyColChanges() cc_body_gradient_direction_old = cc_body_gradient_direction; ret = true; } + if (cc_body_image != cc_body_image_old){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], col changes cc_body_image %s != cc_body_image_old %s...\033[0m\n", __func__, __LINE__, cc_body_image.c_str(), cc_body_image_old.c_str()); + cc_body_image_old = cc_body_image; + ret = true; + } return ret; } @@ -467,13 +475,13 @@ void CCDraw::enablePaintCache(bool enable) //paint framebuffer layers void CCDraw::paintFbItems(bool do_save_bg) { - //pick up signal if filled + //Pick up signal if filled and execute slots. OnBeforePaintLayers(); - //first modify background handling + //First we modify background handling. enableSaveBg(do_save_bg); - //save background before first paint, cc_save_bg must be true + //Save background before first paint, cc_save_bg must be true. if (firstPaint && cc_save_bg){ /* On first we must ensure that screen buffer is empty. * Here we clean possible screen buffers in bg layers, @@ -482,7 +490,7 @@ void CCDraw::paintFbItems(bool do_save_bg) clearSavedScreen(); /* On second step we check for - * usable item dimensions and exit here if found any problem + * usable item dimensions and exit here if found any problem. */ for(size_t i=0; i 0 && cc_allow_paint){ frameBuffer->paintBoxFrame(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.frame_thickness, fbdata.color, fbdata.r, fbdata.rtype); @@ -550,10 +558,10 @@ void CCDraw::paintFbItems(bool do_save_bg) } if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force || force_paint_bg)) { if (fbdata.enabled) { - /* here we paint the shadow around the body - * on 1st step we check for already cached screen buffer, if true - * then restore this instead to call the paint methode. - * This could be usally, if we use existant instances of "this" object + /* Here we paint the shadow around the body. + * On 1st step we check for already cached screen buffer, if true + * then restore this instead to call the paint methode. + * This could be usally, if we use an existant instances of "this" object */ if (cc_allow_paint){ if (fbdata.pixbuf){ @@ -562,7 +570,7 @@ void CCDraw::paintFbItems(bool do_save_bg) }else{ frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.color, fbdata.r, fbdata.rtype); } - //if is paint cache enabled + //If is paint cache enabled, catch screen into cache if (cc_paint_cache && fbdata.pixbuf == NULL) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); fbdata.is_painted = true; @@ -572,63 +580,104 @@ void CCDraw::paintFbItems(bool do_save_bg) if (paint_bg){ if (fbtype == CC_FBDATA_TYPE_BOX){ if(cc_allow_paint) { - /* here we paint the main body of box - * on 1st step we check for already cached background buffer, if true - * then restore this instead to call the paint methodes and gradient creation - * paint cache can be enable/disable with enablePaintCache() + /* Here we paint the main body of box. + * On 1st step we check for already cached background buffer, if true + * then restore this instead to call the paint methodes and gradient creation. + * Paint cache can be enable/disable with enablePaintCache() */ if (fbdata.pixbuf){ + /* If is paint cache enabled and cache is filled, it's prefered to paint + * from cache. Cache is also filled if body background images are used + */ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint body from cache...\033[0m\n", __func__, __LINE__); frameBuffer->RestoreScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.pixbuf); }else{ - //ensure clean gradient data on disabled gradient + //Ensure clean gradient data on disabled gradient. if(cc_body_gradient_enable == CC_COLGRAD_OFF && fbdata.gradient_data){ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], gradient mode is disabled but filled\033[0m\n", __func__, __LINE__); clearFbGradientData(); } - if (cc_body_gradient_enable != CC_COLGRAD_OFF){ - /* if color gradient enabled we create a gradient_data - * instance and add it to the fbdata object - * On disabled coloor gradient we do paint only a default box - */ - if (fbdata.gradient_data == NULL){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], crate new gradient data)...\033[0m\n", __func__, __LINE__); - fbdata.gradient_data = getGradientData(); + + /* If background image is defined, + * we try to render an image instead to render default box. + * Paint of background image is prefered, next steps will be ignored! + */ + if (!cc_body_image.empty()){ + if (g_PicViewer->DisplayImage(cc_body_image, fbdata.x, fbdata.y, fbdata.dx, fbdata.dy)){ + // catch screen and store into paint cache + fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + fbdata.is_painted = true; + }else{ + if (fbdata.pixbuf){ + delete[] fbdata.pixbuf; + fbdata.pixbuf = NULL; + } + fbdata.is_painted = false; } - // if found empty gradient buffer, create it, otherwise paint from gradient cache - if (fbdata.gradient_data->boxBuf == NULL){ - if (!fbdata.pixbuf){ - // on enabled clean up, paint blank screen before create gradient box, this prevents possible ghost text with hw acceleration - if (cc_gradient_bg_cleanup) - frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); + // On failed image paint, write this into log and reset image name. + if (!fbdata.is_painted){ + dprintf(DEBUG_NORMAL, "\033[33m\[CCDraw]\t[%s - %d], WARNING: bg image %s defined, but paint failed,\nfallback to default rendering...\033[0m\n", __func__, __LINE__, cc_body_image.c_str()); + cc_body_image = ""; + } + } - // create gradient buffer and paint gradient box - fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint and cache new gradient into gradient cache...\033[0m\n", __func__, __LINE__); + /* If no background image is defined, we paint default box or box with gradient + * This is also possible if any background image is defined but image paint ist failed + */ + if (cc_body_image.empty()){ + if (cc_body_gradient_enable != CC_COLGRAD_OFF ){ + + /* If color gradient enabled we create a gradient_data + * instance and add it to the fbdata object + * On disabled color gradient or image paint was failed, we do paint only a default box + */ + if (fbdata.gradient_data == NULL){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], create new gradient data)...\033[0m\n", __func__, __LINE__); + fbdata.gradient_data = getGradientData(); } - /* On enabled paint cache or clean up, catch the screen into paint cache and clean up unused gradient buffer. - * If we don't do this, gradient cache is used. - */ - if (cc_paint_cache || cc_gradient_bg_cleanup){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], cache new created gradient into external cache...\033[0m\n", __func__, __LINE__); - fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); - if (clearFbGradientData()) - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], remove unused gradient data...\033[0m\n", __func__, __LINE__); + if (fbdata.gradient_data->boxBuf == NULL){ + if (fbdata.pixbuf == NULL){ + /* Before we paint any gradient box with hw acceleration, we must cleanup first. + * FIXME: This is only a workaround for this framebuffer behavior on enabled hw acceleration. + * Without this, ugly ghost letters or ghost images inside gradient boxes are possible. + */ + if (cc_gradient_bg_cleanup) + frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); + + // create gradient buffer and paint gradient box + fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint and cache new gradient into gradient cache...\033[0m\n", __func__, __LINE__); + } + + /* On enabled paint cache or clean up, catch the screen into paint cache and clean up unused gradient buffer. + * If we don't do this explicit, gradient cache is used. + */ + if (cc_paint_cache || cc_gradient_bg_cleanup){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], cache new created gradient into external cache...\033[0m\n", __func__, __LINE__); + fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + if (clearFbGradientData()) + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], remove unused gradient data...\033[0m\n", __func__, __LINE__); + } + }else{ + // If found gradient buffer, paint box from gradient cache. + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); + frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, true); + frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); + frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, false); } }else{ - //use gradient cache to repaint gradient box - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); - frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, true); - frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); - frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, false); + /* If is nothihng cached or no background image was defined or image paint was failed, + * render a default box. + */ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); + frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.color, fbdata.r, fbdata.rtype); + + //If is paint cache enabled, catch screen into cache. + if (cc_paint_cache) + fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } - }else{ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); - frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.color, fbdata.r, fbdata.rtype); - if (cc_paint_cache) - fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } } v_fbdata[i].is_painted = true; @@ -653,7 +702,6 @@ void CCDraw::paintFbItems(bool do_save_bg) //reset is painted ignore flag to default value force_paint_bg = false; - //pick up signal if filled OnAfterPaintLayers(); } @@ -797,3 +845,21 @@ bool CCDraw::cancelBlink(bool keep_on_screen) return res; } + +bool CCDraw::setBodyBGImage(const std::string& image_path) +{ + if (cc_body_image == image_path) + return false; + + cc_body_image = image_path; + + if (clearPaintCache()) + dprintf(DEBUG_NORMAL, "\033[33m\[CCDraw]\t[%s - %d], new body background image defined: %s , \033[0m\n", __func__, __LINE__, cc_body_image.c_str()); + + return true; +} + +bool CCDraw::setBodyBGImageName(const std::string& image_name) +{ + return setBodyBGImage(frameBuffer->getIconPath(image_name)); +} diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 50be8a71d..26b8875d5 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2015, Thilo Graf 'dbt' + Copyright (C) 2012-2017, Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL @@ -78,6 +78,8 @@ class CCDraw : public COSDFader, public CComponentsSignals fb_pixel_t col_frame, col_frame_old; ///internal property: color for shadow clean up fb_pixel_t col_shadow_clean; + ///property: background image, see also setBodyBGImage() + std::string cc_body_image, cc_body_image_old; ///property: frame thickness, see also setFrameThickness() int fr_thickness, fr_thickness_old; @@ -407,8 +409,32 @@ class CCDraw : public COSDFader, public CComponentsSignals */ virtual void killShadow(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); - virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; }; - virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); }; + virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; } + virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); } + + /**Sets an image path for body background, returns true if new image was applied. + * + * @return bool + * + * @param[in] image_path Path to image. + * + * @see + * cc_body_image + * setBodyBGImageName() + */ + virtual bool setBodyBGImage(const std::string& image_path); + + /**Sets an image name for body background, returns true if new image was applied. + * + * @return bool + * + * @param[in] image_name Basename of image. + * + * @see + * cc_body_image + * setBodyBGImage() + */ + virtual bool setBodyBGImageName(const std::string& image_name); }; #endif diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index f125231f6..017bc7feb 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2013-2014, Thilo Graf 'dbt' + Copyright (C) 2013-2017, Thilo Graf 'dbt' License: GPL @@ -102,7 +102,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const initParent(parent); } -void CComponentsFooter::setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width, const int& label_width) +void CComponentsFooter::setButtonLabels(const struct button_label_cc * const content, const size_t& label_count, const int& chain_width, const int& label_width) { /* clean up before init*/ if (chain) @@ -178,7 +178,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont vector v_btns; int h_btn = /*(ccf_enable_button_bg ? */chain->getHeight()-2*fr_thickness/*-OFFSET_INNER_SMALL*//* : height)*/-ccf_button_shadow_width; for (size_t i= 0; i< label_count; i++){ - string txt = content[i].text; + string txt = content[i].locale == NONEXISTANT_LOCALE ? content[i].text : g_Locale->getText(content[i].locale); string icon_name = string(content[i].button); //ignore item, if no text and icon are defined; @@ -244,26 +244,10 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont } } -void CComponentsFooter::setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width, const int& label_width) -{ - button_label_s buttons[label_count]; - - for (size_t i= 0; i< label_count; i++){ - buttons[i].button = content[i].button; - buttons[i].text = content[i].locale != NONEXISTANT_LOCALE ? g_Locale->getText(content[i].locale) : ""; - buttons[i].directKey = content[i].directKey; - buttons[i].directKeyAlt = content[i].directKeyAlt; - buttons[i].btn_result = content[i].btn_result; - buttons[i].btn_alias = content[i].btn_alias; - } - - setButtonLabels(buttons, label_count, chain_width, label_width); -} - void CComponentsFooter::setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& chain_width, const int& label_width) { //conversion for compatibility with older paintButtons() methode, find in /gui/widget/buttons.h - button_label_l buttons[label_count]; + button_label_cc buttons[label_count]; for (size_t i = 0; i< label_count; i++){ buttons[i].button = content[i].button; buttons[i].locale = content[i].locale; @@ -276,31 +260,15 @@ void CComponentsFooter::setButtonLabels(const struct button_label * const conten setButtonLabels(buttons, label_count, chain_width, label_width); } -void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) +void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) { size_t label_count = v_content.size(); - button_label_l buttons[label_count]; - - for (size_t i= 0; i< label_count; i++){ - buttons[i].button = v_content[i].button; - buttons[i].locale = v_content[i].locale; - buttons[i].directKey = v_content[i].directKey; - buttons[i].directKeyAlt = v_content[i].directKeyAlt; - buttons[i].btn_result = v_content[i].btn_result; - buttons[i].btn_alias = v_content[i].btn_alias; - } - - setButtonLabels(buttons, label_count, chain_width, label_width); -} - -void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) -{ - size_t label_count = v_content.size(); - button_label_s buttons[label_count]; + button_label_cc buttons[label_count]; for (size_t i= 0; i< label_count; i++){ buttons[i].button = v_content[i].button; buttons[i].text = v_content[i].text; + buttons[i].locale = v_content[i].locale; buttons[i].directKey = v_content[i].directKey; buttons[i].directKeyAlt = v_content[i].directKeyAlt; buttons[i].btn_result = v_content[i].btn_result; @@ -319,7 +287,7 @@ void CComponentsFooter::setButtonLabel( const char *button_icon, const int& alias_value, const neutrino_msg_t& directKeyAlt) { - button_label_s button[1]; + button_label_cc button[1]; button[0].button = button_icon; button[0].text = text; diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index aebaddcc0..0a7aeb91d 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2012, 2013, 2014, Thilo Graf 'dbt' + Copyright (C) 2012-2017, Thilo Graf 'dbt' License: GPL @@ -30,25 +30,17 @@ #include //for compatibility with 'button_label' type //for 'button_label' type with string -typedef struct button_label_s +typedef struct button_label_cc { const char * button; std::string text; + neutrino_locale_t locale; neutrino_msg_t directKey; neutrino_msg_t directKeyAlt; int btn_result; int btn_alias; -} button_label_s_struct; - -typedef struct button_label_l -{ - const char * button; - neutrino_locale_t locale; - neutrino_msg_t directKey; - neutrino_msg_t directKeyAlt; - int btn_result; - int btn_alias; -} button_label_l_struct; + button_label_cc(): text(std::string()), locale(NONEXISTANT_LOCALE){} +} button_label_cc_struct; /*! CComponentsFooter, sub class of CComponentsHeader provides prepared container for footer @@ -101,13 +93,9 @@ class CComponentsFooter : public CComponentsHeader fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///add button labels with string label type as content, count as size_t, chain_width as int, label width as int - void setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); - ///add button labels with locale label type as content, count as size_t, chain_width as int, label width as int - void setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); - ///add button labels with locale label type as content, parameter 1 as vector, chain_width as int, label width as int - void setButtonLabels(const std::vector &v_content, const int& chain_width, const int& label_width); + void setButtonLabels(const struct button_label_cc * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); ///add button labels with string label type as content, parameter 1 as vector, chain_width as int, label width as int - void setButtonLabels(const std::vector &v_content, const int& chain_width, const int& label_width); + void setButtonLabels(const std::vector &v_content, const int& chain_width, const int& label_width); ///enable/disable button frame in icon color, predefined for red, green, yellow and blue inline void enableButtonFrameColor(bool enable = true){btn_auto_frame_col = enable;} diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp index b1354e132..985e41593 100644 --- a/src/gui/info_menue.cpp +++ b/src/gui/info_menue.cpp @@ -72,9 +72,7 @@ int CInfoMenu::exec(CMenuTarget* parent, const std::string &actionKey) //NI { char str[1024]; sprintf(str, "cs_get_revision(): 0x%02X\n", cs_get_revision()); -#ifdef BOXMODEL_CS_HD2 sprintf(str, "%scs_get_chip_type(): 0x%04X\n", str, cs_get_chip_type()); -#endif ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMsgBox::mbrBack, CMsgBox::mbBack); return res; } diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 494487614..2225797bc 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -139,27 +139,27 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) else { CComponentsFooter* footer = (*udata)->w->getFooterObject(); if (footer) { - vector buttons; + vector buttons; if (!btnRed.empty()) { - button_label_s btnSred; + button_label_cc btnSred; btnSred.button = NEUTRINO_ICON_BUTTON_RED; btnSred.text = btnRed; buttons.push_back(btnSred); } if (!btnGreen.empty()) { - button_label_s btnSgreen; + button_label_cc btnSgreen; btnSgreen.button = NEUTRINO_ICON_BUTTON_GREEN; btnSgreen.text = btnGreen; buttons.push_back(btnSgreen); } if (!btnYellow.empty()) { - button_label_s btnSyellow; + button_label_cc btnSyellow; btnSyellow.button = NEUTRINO_ICON_BUTTON_YELLOW; btnSyellow.text = btnYellow; buttons.push_back(btnSyellow); } if (!btnBlue.empty()) { - button_label_s btnSblue; + button_label_cc btnSblue; btnSblue.button = NEUTRINO_ICON_BUTTON_BLUE; btnSblue.text = btnBlue; buttons.push_back(btnSblue); diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 1a9e2c283..4fc768b19 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2863,7 +2863,7 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) for (i=0; i < size;i++) { if (*m_dir[i].used == true){ - OnLoadDir(i+1, size, m_dir[i].name); + OnGlobalProgress(i, size, m_dir[i].name); loadTsFileNamesFromDir(m_dir[i].name); } } @@ -2984,7 +2984,7 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) } else { result |= addFile(flist[i], dirItNr); } - OnLoadFile(i, flist.size(), dirname ); + OnLocalProgress(i, flist.size(), dirname ); } //result = true; } @@ -3223,7 +3223,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnProgress : &OnLocalProgress, &OnGlobalProgress); loadBox.enableShadow(); loadBox.paint(); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 774372e94..4d0ec91b0 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -57,6 +57,7 @@ #include #include #include +#include #include //NI #define MAX_NUMBER_OF_BOOKMARK_ITEMS MI_MOVIE_BOOK_USER_MAX // we just use the same size as used in Movie info (MAX_NUMBER_OF_BOOKMARK_ITEMS is used for the number of menu items) @@ -134,7 +135,7 @@ class CYTCacheSelectorTarget : public CMenuTarget }; // Priorities for Developmemt: P1: critical feature, P2: important feature, P3: for next release, P4: looks nice, lets see -class CMovieBrowser : public CMenuTarget +class CMovieBrowser : public CMenuTarget, public CProgressSignals { friend class CYTCacheSelectorTarget; @@ -364,8 +365,6 @@ class CMovieBrowser : public CMenuTarget void clearSelection(); bool supportedExtension(CFile &file); bool addFile(CFile &file, int dirItNr); - sigc::signal OnLoadFile; - sigc::signal OnLoadDir; }; // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage. diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 12aba2476..6820ed677 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2537,8 +2537,11 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) clearSubtitle(); for (unsigned i = 0; i < sub->num_rects; i++) { +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) uint32_t * colors = (uint32_t *) sub->rects[i]->pict.data[1]; - +#else + uint32_t * colors = (uint32_t *) sub->rects[i]->data[1]; +#endif int xoff = (double) sub->rects[i]->x * xc; int yoff = (double) sub->rects[i]->y * yc; int nw = frameBuffer->getWidth4FB_HW_ACC(xoff, (double) sub->rects[i]->w * xc); @@ -2547,9 +2550,14 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) printf("Draw: #%d at %d,%d size %dx%d colors %d (x=%d y=%d w=%d h=%d) \n", i+1, sub->rects[i]->x, sub->rects[i]->y, sub->rects[i]->w, sub->rects[i]->h, sub->rects[i]->nb_colors, xoff, yoff, nw, nh); - +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) fb_pixel_t * newdata = simple_resize32 (sub->rects[i]->pict.data[0], colors, sub->rects[i]->nb_colors, sub->rects[i]->w, sub->rects[i]->h, nw, nh); +#else + fb_pixel_t * newdata = simple_resize32 (sub->rects[i]->data[0], colors, + sub->rects[i]->nb_colors, sub->rects[i]->w, sub->rects[i]->h, nw, nh); +#endif + frameBuffer->blit2FB(newdata, nw, nh, xoff, yoff); free(newdata); diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index c4c78ca95..2675cffef 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -58,8 +58,15 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo } int videoSystem = getVideoSystem(); - if (!isVideoSystem1080(videoSystem)) + + if ((g_settings.video_Mode == VIDEO_STD_AUTO) && + (g_settings.enabled_auto_modes[videoSystem] == 1) && + (!isVideoSystem1080(videoSystem))) modeNew = OSDMODE_720; + +// if (!isVideoSystem1080(videoSystem)) +// modeNew = OSDMODE_720; + idx = frameBuffer->getIndexOsdResolution(modeNew); resetOsd = (modeNew != getOsdResolution()) ? true : false; #if 1 diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 43ade2362..ba6444ddd 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -141,9 +141,7 @@ void CFlashUpdate::update_php(std::string &url, const char* type) if (url.find("update.php") != std::string::npos) { url += "?revision=" + to_string(cs_get_revision()); -#ifdef BOXMODEL_CS_HD2 url += "&chip_type=" + to_string(cs_get_chip_type()); -#endif url += "&image_type=" + (std::string)type; printf("[update_php] url %s\n", url.c_str()); } diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 48921105b..bcdd23e8a 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -7,7 +7,7 @@ Günther@tuxbox.berlios.org Implementation of CComponent Window class. - Copyright (C) 2014-2016 Thilo Graf 'dbt' + Copyright (C) 2014-2017 Thilo Graf 'dbt' License: GPL @@ -101,10 +101,8 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t shadow = CC_SHADOW_ON; //set result - if (Default_result != mbrNone) - result = default_result = Default_result; - else - result = mbrNone; + result = default_result = Default_result; + //add and initialize footer buttons with required buttons and basic properties if (ShowButtons > -1) mb_show_button = ShowButtons; @@ -119,8 +117,8 @@ void CMsgBox::initTimeOut() void CMsgBox::initButtons() { - button_label_s btn; - vector v_buttons; + button_label_cc btn; + vector v_buttons; //evaluate combinations if (mb_show_button & mbAll) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index e94d08755..4943fb0e2 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -89,10 +89,10 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * status.hide(); * } * - * //That's it. Until now these steps are a classical way inside neutrino, but you can use proress window with signals too. - * //Working with signals have the advantage that the implementation could be more compactly, because - * //complex constructions within the classes are usually unnecessary, - * //beacuse of the signals can be installed where they directly take the required values. See next example: + * //That's it. Until now these steps are a classical way inside neutrino, but you can use proress window with signals too. + * //Working with signals have the advantage that the implementation could be more compactly, because + * //complex constructions within the classes are usually unnecessary, + * //beacuse of the signals can be installed where they directly catching the required values. See next example: * * class CFooClass * { @@ -101,6 +101,7 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * private: * //other members... * sigc::signal OnProgress; + * void DoCount(); * //other members... * public: * //other members... @@ -132,8 +133,53 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * //finally remove window from screen * progress.hide(); * } + * + * //Another and a recommended way to implement signals is to inherit prepared signals with + * //class CProgressSignals. This class contains prepared signals for implemantation and disconnetion of slots + * //is performed automatically. + * //See next example: + * class CFooClass : public CProgressSignals + * { + * private: + * //other members... + * void DoCount(); + * //other members... + * public: + * //other members... + * void DoAnything(); + * //other members... + * }; + * + * //add the OnGlobalProgress and OnLocalProgress signals into a counter methode + * void CFooClass::DoCount();{ + * size_t max = 10; + * for (size_t i = 0; i < max; i++){ + * OnGlobalProgress(i, max, "Test"); //visualize global progress + * for (size_t j = 0; j < max; j++){ + * OnLocalProgress(ij, max, "Test"); // visualize local progress + * } + * } + * } + * + * void CFooClass::DoAnything{ + * //inside of methode which calls the progress define a CProgressWindow object and the counter method: + * //...any code + * CProgressWindow progress(NULL, 500, 150, NULL, &OnLocalProgress, &OnGlobalProgress); + * progress.paint(); // paint window + * + * //... + * + * void DoCount(); + * + * //... + * + * //finally remove window from screen + * progress.hide(); + * } + * * @note - * Don't use status_Signal at same time with localSignal and globalSignal. In This case please set status_Signal = NULL + * Don't use status_Signal at same time with localSignal and globalSignal. \n + * In This case please set prameter 'status_Signal' = NULL */ CProgressWindow(CComponentsForm *parent = NULL, const int &dx = PW_MIN_WIDTH, @@ -241,5 +287,25 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget void paint(bool do_save_bg = true); }; +class CProgressSignals : public sigc::trackable +{ + public: + /**CProgressSignals Constructor: + * Additional class for inherited signal implemantations into classes with used CProgressWindow instances. + */ + CProgressSignals() + { + //obligatory init of signals. Not really required but just to be safe. + OnProgress.clear(); + OnLocalProgress.clear(); + OnGlobalProgress.clear(); + }; + + /** + * For general usage for implementations of signals for classes which are using CProgressBar() window instances based on inheritance. + * @see Take a look into examples to find in progressbar.h + */ + sigc::signal OnProgress, OnLocalProgress, OnGlobalProgress; +}; #endif diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 61f45841e..92be9680b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -139,6 +139,8 @@ #include #include +#include + #include #include #include @@ -5238,11 +5240,8 @@ void CNeutrinoApp::Cleanup() delete CEitManager::getInstance(); printf("cleanup 6\n");fflush(stdout); //delete CVFD::getInstance(); -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - //malloc_stats(); -#endif + + comp_malloc_stats(NULL); #endif } diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 89fba7264..4c77edfbf 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -799,18 +799,18 @@ void CControlAPI::MessageCGI(CyhookHandler *hh) void CControlAPI::InfoCGI(CyhookHandler *hh) { if (hh->ParamList.empty()) - hh->Write("Neutrino HD\n"); + hh->Write(PACKAGE_NAME " " PACKAGE_VERSION "\n"); else { if (hh->ParamList["1"] == "streaminfo") // print streaminfo SendStreamInfo(hh); else if (hh->ParamList["1"] == "version") // send version file hh->SendFile(TARGET_PREFIX "/.version"); - else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (only ffor comptibility) + else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (just for compatibility) hh->Write("3"); else if (hh->ParamList["1"] == "nhttpd_version")// print nhttpd version hh->printf("%s\n", HTTPD_VERSION); - else if (hh->ParamList["1"] == "hwinfo")// print hwinfo + else if (hh->ParamList["1"] == "hwinfo") // print hwinfo HWInfoCGI(hh); else hh->SendError(); @@ -819,14 +819,11 @@ void CControlAPI::InfoCGI(CyhookHandler *hh) void CControlAPI::HWInfoCGI(CyhookHandler *hh) { - std::string boxname = NeutrinoAPI->NeutrinoYParser->func_get_boxtype(hh, ""); - std::string boxmodel = NeutrinoAPI->NeutrinoYParser->func_get_boxmodel(hh, ""); - static CNetAdapter netadapter; std::string eth_id = netadapter.getMacAddr(); std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower); - hh->printf("%s (%s)\nMAC:%s\n", boxname.c_str(), boxmodel.c_str(), eth_id.c_str()); + hh->printf("%s %s (%s)\nMAC:%s\n", g_info.hw_caps->boxvendor, g_info.hw_caps->boxname, g_info.hw_caps->boxarch, eth_id.c_str()); } //----------------------------------------------------------------------------- void CControlAPI::ShutdownCGI(CyhookHandler *hh) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index ee5d4709c..b5621efa5 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -850,115 +850,21 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler *, std::str //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) { -#if 0 - unsigned int system_rev = cs_get_revision(); - std::string boxname = "CST "; + std::string boxvendor(g_info.hw_caps->boxvendor); + std::string boxname(g_info.hw_caps->boxname); -#if HAVE_TRIPLEDRAGON - boxname = "Armas "; -#endif - - switch(system_rev) - { - case 1: - if( boxname == "Armas ") - boxname += "TripleDragon"; - break; -#ifdef BOXMODEL_CS_HD1 - case 6: - boxname += "HD1"; - break; - case 7: - boxname += "BSE"; - break; - case 8: - boxname += "Neo"; - if (CFEManager::getInstance()->getFrontendCount() > 1) - boxname += " Twin"; - break; - case 10: - boxname += "Zee"; - break; -#endif -#ifdef BOXMODEL_CS_HD2 - case 9: - boxname += "Tank"; - break; - case 11: - boxname += "Trinity"; - if (cs_get_chip_type() != 33904 /*0x8470*/) - boxname += " V2"; - break; - case 12: - boxname += "Zee2"; - break; - case 13: - boxname += "Link"; - break; - case 14: - boxname += "Trinity Duo"; - break; -#endif - default: - char buffer[10]; - snprintf(buffer, sizeof(buffer), "%u\n", system_rev); - boxname += "Unknown nr. "; - boxname += buffer; - break; - } -#else - std::string boxname = g_info.hw_caps->boxvendor; - if (boxname.compare("Coolstream") == 0) - boxname = "CST"; /* that's more or less an external API... */ - boxname += " " + std::string(g_info.hw_caps->boxname); - if (!strcmp(g_info.hw_caps->boxname, "Neo") && - CFEManager::getInstance()->getFrontendCount() > 1) + /* workaround for Neo2 */ + if ((boxname.compare("Neo") == 0) && (CFEManager::getInstance()->getFrontendCount() > 1)) boxname += " Twin"; -#endif - return boxname; + + return boxvendor + " " + boxname; } //------------------------------------------------------------------------- // y-func : get boxmodel //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) { -#if 0 - unsigned int system_rev = cs_get_revision(); - std::string boxmodel = "Unknown"; - - switch(system_rev) - { -#ifdef BOXMODEL_CS_HD1 - case 6: - case 7: - case 8: - case 10: - boxmodel = "Nevis"; - break; -#endif -#ifdef BOXMODEL_CS_HD2 - case 9: - boxmodel = "Apollo"; - break; - case 11: - if (cs_get_chip_type() == 33904 /*0x8470*/) - boxmodel = "Shiner"; - else - boxmodel = "Kronos"; - break; - case 12: - case 13: - case 14: - boxmodel = "Kronos"; - break; -#endif - default: - break; - } -#else - std::string boxmodel = std::string(g_info.hw_caps->boxarch); -#endif - return boxmodel; + return g_info.hw_caps->boxarch; } //------------------------------------------------------------------------- // y-func : get stream info diff --git a/src/system/ytparser.cpp b/src/system/ytparser.cpp index 3c558ee1b..407d452a4 100644 --- a/src/system/ytparser.cpp +++ b/src/system/ytparser.cpp @@ -323,7 +323,7 @@ bool cYTFeedParser::parseFeedJSON(std::string &answer) Json::Value elements = root["items"]; for(unsigned int i=0; igetText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); + OnProgress(i, elements.size(), g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); #ifdef DEBUG_PARSER printf("=========================================================\n"); printf("Element %d in elements\n", i); diff --git a/src/system/ytparser.h b/src/system/ytparser.h index c54c2239b..dcc8f1322 100644 --- a/src/system/ytparser.h +++ b/src/system/ytparser.h @@ -30,6 +30,7 @@ #include #include #include +#include class cYTVideoUrl { @@ -68,7 +69,7 @@ class cYTVideoInfo typedef std::vector yt_video_list_t; -class cYTFeedParser +class cYTFeedParser : public CProgressSignals { private: std::string error; @@ -155,8 +156,6 @@ class cYTFeedParser void SetMaxResults(int count) { max_results = count; } void SetConcurrentDownloads(int count) { concurrent_downloads = count; } void SetThumbnailDir(std::string &_thumbnail_dir); - - sigc::signal OnLoadVideoInfo; }; #endif