diff --git a/projects/RPi/patches/xbmc/xbmc-gotham_rbp_backports.patch b/projects/RPi/patches/xbmc/xbmc-gotham_rbp_backports.patch index 4ba3faa2ec..9a03eedbbb 100644 --- a/projects/RPi/patches/xbmc/xbmc-gotham_rbp_backports.patch +++ b/projects/RPi/patches/xbmc/xbmc-gotham_rbp_backports.patch @@ -1,7 +1,7 @@ -From 5151afc763b3b2b01cf046d3538d2d7c4f6008a4 Mon Sep 17 00:00:00 2001 +From 755db827cdc1f75f38f05f4b4ae90c7339a45ea3 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 5 Aug 2013 13:12:46 +0100 -Subject: [PATCH 01/83] h264_parser: Initialize the h264dsp context in the +Subject: [PATCH 01/88] h264_parser: Initialize the h264dsp context in the parser as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -36,13 +36,13 @@ index aff9ba1..a732f79 100644 } -- -1.9.1 +1.9.3 -From 1b297d1cc8842b8df31376b24f72007f369f3abe Mon Sep 17 00:00:00 2001 +From eac2807ec9477c523726dd768889ecbf388c8634 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 5 Aug 2013 13:12:47 +0100 -Subject: [PATCH 02/83] h264dsp: Factorize code into a new function, +Subject: [PATCH 02/88] h264dsp: Factorize code into a new function, h264_find_start_code_candidate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -165,13 +165,13 @@ index 98ea15c..1be4804 100644 void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, -- -1.9.1 +1.9.3 -From 213daa616b204a266e896613759efbd2c0b128e6 Mon Sep 17 00:00:00 2001 +From 4b12bc6d9297065d125bc5726507aee2f72b017d Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 5 Aug 2013 13:12:48 +0100 -Subject: [PATCH 03/83] arm: Add assembly version of +Subject: [PATCH 03/88] arm: Add assembly version of h264_find_start_code_candidate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -502,13 +502,13 @@ index 972aace..363843c 100644 if(buf[i]==1) state^= 5; //2->7, 1->4, 0->5 else if(buf[i]) state = 7; -- -1.9.1 +1.9.3 -From 0ffba603212373eee7f4f7633522ac9188ee57a5 Mon Sep 17 00:00:00 2001 +From adcadea9c6ebc47e8e65ba42af0d3a039be3f1de Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 19 Aug 2013 22:48:05 +0100 -Subject: [PATCH 04/83] [ffmpeg] Backport of h264_find_start_code_candidate +Subject: [PATCH 04/88] [ffmpeg] Backport of h264_find_start_code_candidate optimisation --- @@ -1034,13 +1034,13 @@ index 0000000..cdc2d1e +-- +1.7.9.5 -- -1.9.1 +1.9.3 -From 868ac5ce468773f2b7d224de4c194d916da48b86 Mon Sep 17 00:00:00 2001 +From 229de7e33bde5692fa90140ca96dde3675af6dc4 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 16 Apr 2014 01:51:31 +0100 -Subject: [PATCH 05/83] h264: Move search code search functions into separate +Subject: [PATCH 05/88] h264: Move search code search functions into separate source files. This permits re-use with parsers for codecs which use similar start codes. @@ -1788,13 +1788,13 @@ index 0000000..cc55d5f + +#endif /* AVCODEC_STARTCODE_H */ -- -1.9.1 +1.9.3 -From 7da3e5b747910363ace46045d11c172c9db3a940 Mon Sep 17 00:00:00 2001 +From 504c24a2bde0d2d33769ba6b2e5f95cfe9944a2f Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 16 Apr 2014 01:51:32 +0100 -Subject: [PATCH 06/83] vc-1: Add platform-specific start code search routine +Subject: [PATCH 06/88] vc-1: Add platform-specific start code search routine to VC1DSPContext. Initialise VC1DSPContext for parser as well as for decoder. @@ -1972,13 +1972,13 @@ index 6540eff..302e4a8 100644 #endif /* AVCODEC_VC1DSP_H */ -- -1.9.1 +1.9.3 -From eddfc8611311caf4074d740728c041cf5c2a043c Mon Sep 17 00:00:00 2001 +From 64df474f51f21c5973a3dcdde49ec823d1171219 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 23 Apr 2014 01:41:04 +0100 -Subject: [PATCH 07/83] vc-1: Optimise parser (with special attention to ARM) +Subject: [PATCH 07/88] vc-1: Optimise parser (with special attention to ARM) The previous implementation of the parser made four passes over each input buffer (reduced to two if the container format already guaranteed the input @@ -2360,13 +2360,13 @@ index 53af61c..af601ad 100644 } -- -1.9.1 +1.9.3 -From eaede29de27188347d8461f4b74bdc6594850b4e Mon Sep 17 00:00:00 2001 +From ba417749ba8624f07dddbd77ecd4b9e07e8db1a8 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 19 Mar 2014 17:44:59 +0000 -Subject: [PATCH 08/83] truehd: add hand-scheduled ARM asm version of +Subject: [PATCH 08/88] truehd: add hand-scheduled ARM asm version of mlp_filter_channel. Profiling results for overall audio decode and the mlp_filter_channel(_arm) @@ -2919,13 +2919,13 @@ index 84a8aa3..129bcfe 100644 #endif /* AVCODEC_MLPDSP_H */ -- -1.9.1 +1.9.3 -From dd6372760ac5ac078c5a50b23df48858b32b382f Mon Sep 17 00:00:00 2001 +From c1bfbddc3b702e17581469dafaa0f7e89bbdcf1c Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 19 Mar 2014 17:48:54 +0000 -Subject: [PATCH 09/83] truehd: break out part of rematrix_channels into +Subject: [PATCH 09/88] truehd: break out part of rematrix_channels into platform-specific callback. Verified with profiling that this doesn't have a measurable effect upon @@ -3080,13 +3080,13 @@ index 129bcfe..f98e9be 100644 void ff_mlpdsp_init(MLPDSPContext *c); -- -1.9.1 +1.9.3 -From 3d258e1d8fdb26207f2a8b0bf8e9413c1c9d2fb6 Mon Sep 17 00:00:00 2001 +From a46876df68ffa9674e594075e12023423b926677 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 19 Mar 2014 17:49:48 +0000 -Subject: [PATCH 10/83] truehd: add hand-scheduled ARM asm version of +Subject: [PATCH 10/88] truehd: add hand-scheduled ARM asm version of ff_mlp_rematrix_channel. Profiling results for overall audio decode and the rematrix_channels function @@ -3376,13 +3376,13 @@ index f0ea285..268dfdd 100644 + c->mlp_rematrix_channel = ff_mlp_rematrix_channel_arm; } -- -1.9.1 +1.9.3 -From 7703bb7fe76f49378d7a9d1f7cacf92a0eee5d96 Mon Sep 17 00:00:00 2001 +From cfce1a565f18bfc810476a65533524802262a919 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 19 Mar 2014 17:50:36 +0000 -Subject: [PATCH 11/83] truehd: tune VLC decoding for ARM. +Subject: [PATCH 11/88] truehd: tune VLC decoding for ARM. Profiling on a Raspberry Pi revealed the best performance to correspond with VLC_BITS = 5. Results for overall audio decode and the get_vlc2 function @@ -3441,13 +3441,13 @@ index e9343a5..a998dac 100644 ff_mlp_init_crc(); -- -1.9.1 +1.9.3 -From e6dcddbd93ca44ff548deac8583b8290a8a7d1c6 Mon Sep 17 00:00:00 2001 +From 80219729d75f9ff4f44d4b48fcfa288e3fb7da58 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 19 Mar 2014 17:54:07 +0000 -Subject: [PATCH 12/83] truehd: break out part of output_data into +Subject: [PATCH 12/88] truehd: break out part of output_data into platform-specific callback. Verified with profiling that this doesn't have a measurable effect upon @@ -3638,13 +3638,13 @@ index f98e9be..5bc901f 100644 void ff_mlpdsp_init(MLPDSPContext *c); -- -1.9.1 +1.9.3 -From 45df548b240b36ccc1f07818821bc8372b49bcc1 Mon Sep 17 00:00:00 2001 +From 7a631c4cac568aef705f1f84fb9b5f679a5e0729 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 19 Mar 2014 17:54:59 +0000 -Subject: [PATCH 13/83] truehd: add hand-scheduled ARM asm version of +Subject: [PATCH 13/88] truehd: add hand-scheduled ARM asm version of ff_mlp_pack_output. Profiling results for overall decode and the output_data function in @@ -4265,13 +4265,13 @@ index 268dfdd..2d8b98d 100644 + c->mlp_select_pack_output = mlp_select_pack_output_arm; } -- -1.9.1 +1.9.3 -From c21fa5944e4711bafce1c476ba26216fedf841a0 Mon Sep 17 00:00:00 2001 +From 8467e651365fc573d767b7816f4768e2784ce286 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 14 Nov 2013 19:48:41 +0000 -Subject: [PATCH 14/83] More efficient infobool expression evaluator +Subject: [PATCH 14/88] More efficient infobool expression evaluator Expession infobools are evaluated at runtime from one or more single infobools and a combination of boolean NOT, AND and OR operators. Previously, parsing @@ -4767,13 +4767,13 @@ index 4e0faee..0a91399 100644 }; -- -1.9.1 +1.9.3 -From 25637ec0e35f1e745ede67708c1d877e00b8a69d Mon Sep 17 00:00:00 2001 +From faa4e1c54f77859dbb648734bdb6fb6b1b00aa85 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 24 Mar 2014 22:26:21 +0000 -Subject: [PATCH 15/83] Where an infobool expression failed to parse, evaluate +Subject: [PATCH 15/88] Where an infobool expression failed to parse, evaluate the infobool as false. Previously, this would result in a segfault due to the dereferencing of an uninitialised pointer to the head of the expression tree. @@ -4797,13 +4797,13 @@ index db461dd..7c54064 100644 void InfoExpression::Update(const CGUIListItem *item) -- -1.9.1 +1.9.3 -From 2ed5e8809d3d2ce8f9316de535fe3358b7cbd1ec Mon Sep 17 00:00:00 2001 +From 7e962904395b459b00bfa018dcbb49cd660d9a01 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 26 Nov 2013 20:09:48 +0000 -Subject: [PATCH 16/83] Add caching of infolabels +Subject: [PATCH 16/88] Add caching of infolabels The functions CGUIInfoLabel::GetLabel and CGUIInfoLabel::GetItemLabel take a number of strings returned from CGUIInfoManager::GetImage or @@ -5013,13 +5013,13 @@ index 8c1c1dc..418b2c4 100644 #endif -- -1.9.1 +1.9.3 -From 3d1cfa9968f438df9fbd7048768b8682232a9a5a Mon Sep 17 00:00:00 2001 +From 24bec7c1a8af65aa7e5f115d1f9d1af9bb9270b1 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 10 Dec 2013 01:12:31 +0000 -Subject: [PATCH 17/83] De-duplication of string cache for non-item and item +Subject: [PATCH 17/88] De-duplication of string cache for non-item and item labels --- @@ -5156,13 +5156,13 @@ index 418b2c4..6d9ebf7 100644 #endif -- -1.9.1 +1.9.3 -From 26bf02b8450b2d07bd94a2a2733f892b6cd4ebf5 Mon Sep 17 00:00:00 2001 +From 9f4e3722694048e509ff204736ca66e403a988b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 21 Feb 2014 15:16:13 +0000 -Subject: [PATCH 18/83] Faster and simpler portable implementation of +Subject: [PATCH 18/88] Faster and simpler portable implementation of MathUtils::round_int(). Much as I like a bit of inline assembler, I have also removed the ARM versions @@ -5365,13 +5365,13 @@ index 96af9f4..0dae77d 100644 inline int64_t abs(int64_t a) -- -1.9.1 +1.9.3 -From 11c635c06bb5e752b3a52bc9b6363bf28fe1cbd0 Mon Sep 17 00:00:00 2001 +From 64822e17ea73d300d2fab0c5464f16f16c2c21e1 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 19/83] Move the reference-counting of Begin and End calls from +Subject: [PATCH 19/88] Move the reference-counting of Begin and End calls from DX and GL source files into GUIFontTTF.cpp. --- @@ -5723,13 +5723,13 @@ index a0dacba..6736cf7 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -- -1.9.1 +1.9.3 -From 9f1bdf9c80cc5984244b1fd4178483f0f6135ca6 Mon Sep 17 00:00:00 2001 +From 720a41a7ee98e61c28f807d7d1b71ecf9d61582b Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 20/83] Convert CGUIFontTTFBase::m_vertex to be managed as a +Subject: [PATCH 20/88] Convert CGUIFontTTFBase::m_vertex to be managed as a std::vector. Also retired CGUIFontTTFBase::m_vertex_count and CGUIFontTTFBase::m_vertex_size because these can be derived from vector member functions. @@ -5908,13 +5908,13 @@ index 93b7ea6..a4e8571 100644 *vertices++ = m_vertex[i]; *vertices++ = m_vertex[i+1]; -- -1.9.1 +1.9.3 -From addb853daaf9d58d0d803feb10dedb5a1d27d0de Mon Sep 17 00:00:00 2001 +From c2547d28bd3abedf7db8b70ab8fbafb1913cae1e Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 21/83] CGUIFontTTFBase::RenderCharacter can now append to +Subject: [PATCH 21/88] CGUIFontTTFBase::RenderCharacter can now append to arbitrary vectors of vertices rather than only CGUIFontTTFBase::m_vertex --- @@ -5987,13 +5987,13 @@ index 35e3cf9..4a6a696 100644 virtual CBaseTexture* ReallocTexture(unsigned int& newHeight) = 0; -- -1.9.1 +1.9.3 -From 5fc0ed0c52e9ca6a111e7c630b8954df76b7b036 Mon Sep 17 00:00:00 2001 +From b878140b1ec597043fe34f9a40473deaed8b9885 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 22/83] Add a cache of font glyph bounding box vertices. This +Subject: [PATCH 22/88] Add a cache of font glyph bounding box vertices. This is implemented as a template because ultimately we will key on different parameters and store values of different types, depending upon whether we have a GLES or non-GLES backend, and for GLES, whether or not the currently @@ -6650,13 +6650,13 @@ index f351c99..9036ba9 100644 + return !operator==(a, b); +} -- -1.9.1 +1.9.3 -From 605feccfef31e6f5837592735a7f16e4cf68a0e1 Mon Sep 17 00:00:00 2001 +From 60832b92c2c3405aa2ed484b1eeba9914769484d Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 23/83] Lay the groundwork for hardware clipping. +Subject: [PATCH 23/88] Lay the groundwork for hardware clipping. For glScissor() to replace CGraphicContext::ClipRect, a necessary condition is that no shear or rotation is introduced between the coordinate systems @@ -6918,13 +6918,13 @@ index 98e398a..81ee49e 100644 virtual void ResetScissors(); -- -1.9.1 +1.9.3 -From d5792948591980c10feef1220a99d31c389bf57a Mon Sep 17 00:00:00 2001 +From 790b62e1b84f9c996a816a2ddc643af40172e543 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 24/83] Increase font cache hit rate by keying on the +Subject: [PATCH 24/88] Increase font cache hit rate by keying on the fractional part of m_originX and m_originY *after* they have been through the graphics context's transformation matrix, plus the scale/rotation elements of the matrix, rather than the origin in the original frame of reference plus @@ -7125,13 +7125,13 @@ index 7cb4669..78445ab 100644 private: virtual bool FirstBegin() = 0; -- -1.9.1 +1.9.3 -From beef78bc04d68b690c91fa6c4e8a786bc8b6b3a9 Mon Sep 17 00:00:00 2001 +From a38ff9f0d2b1001ee5c71d39ff064b8651a32dad Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 25/83] Rewrite of scrolling text code. +Subject: [PATCH 25/88] Rewrite of scrolling text code. No longer shuffles the string round to minimise the number of characters before the clipping rectangle; this doesn't save much on rendering time but @@ -7447,13 +7447,13 @@ index 2c6f366..b74faf2 100644 private: void Process(); -- -1.9.1 +1.9.3 -From f48c2017888bca8d59652e705665f11cc1d66925 Mon Sep 17 00:00:00 2001 +From fd0f4cc4d28921f59184ed9b74cbbd2526a0cf49 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 26/83] Move the application of the translation offsets into +Subject: [PATCH 26/88] Move the application of the translation offsets into the GLES code. Still all pure software at this stage. Main change is in the data types at the interface between CGUIFontTTFBase and CGUIFontTTFGL. The old way (array of vertices in m_vertex) are retained in addition, for the @@ -7646,13 +7646,13 @@ index cb56987..f6aa081 100644 memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); if (m_texture) -- -1.9.1 +1.9.3 -From 8a4e63a234332aafc1f6f388ab56bc01d6cfb37b Mon Sep 17 00:00:00 2001 +From 30965ec6473376642361498159e79171b343f72f Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 27/83] Rather than applying the translation offsets to the +Subject: [PATCH 27/88] Rather than applying the translation offsets to the vertices, now applies them to the model view matrix from the top of the matrix stack and pushes it over to OpenGL. The vertices themselves are still all held client-side. @@ -7796,13 +7796,13 @@ index 81ee49e..d2f9cd1 100644 protected: virtual void SetVSyncImpl(bool enable) = 0; -- -1.9.1 +1.9.3 -From 2a10762d357f43c08f4dcee2301da659a8ffbb46 Mon Sep 17 00:00:00 2001 +From 6090f19fbafb8669527c5a5569af00ed3f7c5f87 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 28/83] Enable hardware clipping. +Subject: [PATCH 28/88] Enable hardware clipping. --- xbmc/guilib/GUIFontTTF.cpp | 4 ++-- @@ -7875,13 +7875,13 @@ index fbffaa0..b7618e1 100644 glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); } -- -1.9.1 +1.9.3 -From c8d9b97c074181da280f8596e22472eb36a0e2ce Mon Sep 17 00:00:00 2001 +From 32a78d9068d4ca64034f8bec0ea8fd91ed3abad5 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 29/83] Move the vertex data across to a vertex buffer object +Subject: [PATCH 29/88] Move the vertex data across to a vertex buffer object just prior to drawing. --- @@ -7932,13 +7932,13 @@ index b7618e1..0df3749 100644 // Disable the attributes used by this shader -- -1.9.1 +1.9.3 -From 8ef808aa5559284ed1e1f3c1287363925818b887 Mon Sep 17 00:00:00 2001 +From 64a87a6c4d7d844d5600744c5874ea4920e33894 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 30/83] Move vertex data into an OpenGL VBO when the font cache +Subject: [PATCH 30/88] Move vertex data into an OpenGL VBO when the font cache entry is populated. The font cache now stores the "name" (handle) of the VBO, rather than a vector of vertices. @@ -8210,13 +8210,13 @@ index 6736cf7..168fb21 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -- -1.9.1 +1.9.3 -From 55b50aa17891e7d1a5e5abf2fcbf623fbe42120d Mon Sep 17 00:00:00 2001 +From fbdb2c034e69e8338473ed91904b4c5a63e4d703 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 16 Jan 2014 16:29:42 +0000 -Subject: [PATCH 31/83] Switch from glDrawArrays() to glDrawElements(). This +Subject: [PATCH 31/88] Switch from glDrawArrays() to glDrawElements(). This involves setting up a static VBO containing the indexes necessary to convert from quads to triangles on the fly in the GPU. @@ -8436,13 +8436,13 @@ index dfc4672..0c32947 100644 if (m_display != EGL_NO_DISPLAY) -- -1.9.1 +1.9.3 -From 47d93319ce6cdbff9d9cc2d7e6c809b555783422 Mon Sep 17 00:00:00 2001 +From f607fb5673e1145bad4a68328df8901d79610317 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 16:17:57 +0000 -Subject: [PATCH 32/83] Update Windows project files +Subject: [PATCH 32/88] Update Windows project files --- project/VS2010Express/XBMC.vcxproj | 2 ++ @@ -8494,13 +8494,13 @@ index b536eb3..cb34443 100644 guilib -- -1.9.1 +1.9.3 -From 2c4565f57fb4c63e21ab470ad99e3f8edbbcf225 Mon Sep 17 00:00:00 2001 +From e81bb9d08740a2c47d5aa4c93d9be422697c0841 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 16:49:45 +0000 -Subject: [PATCH 33/83] Update XCode project file +Subject: [PATCH 33/88] Update XCode project file --- XBMC.xcodeproj/project.pbxproj | 10 ++++++++++ @@ -8563,13 +8563,13 @@ index fdd10a1..62e7e69 100644 runOnlyForDeploymentPostprocessing = 0; }; -- -1.9.1 +1.9.3 -From ada4857fe0b4a5b93f129a046c2779d2d3bc8dea Mon Sep 17 00:00:00 2001 +From 098c8190deba94872efabab64364507d2d18363b Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 17:44:34 +0000 -Subject: [PATCH 34/83] Clang seems to be more picky than gcc about some C++ +Subject: [PATCH 34/88] Clang seems to be more picky than gcc about some C++ template syntax --- @@ -8634,13 +8634,13 @@ index 895fa72..bd84b9a 100644 template void CGUIFontCacheEntry::Reassign::operator()(CGUIFontCacheEntry &entry); -- -1.9.1 +1.9.3 -From 7228bef10ed348a028733bbb4f825cd9bcdbba96 Mon Sep 17 00:00:00 2001 +From 9e9d56af0b65f93489b816ff182b4a95bd076ca1 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 18:52:14 +0000 -Subject: [PATCH 35/83] Fix header to hopefully permit iOS builds to work +Subject: [PATCH 35/88] Fix header to hopefully permit iOS builds to work again. GUIShader.cpp added #include windowing/egl/WinSystemEGL.h inside a but also need the header windowing/osx/WinSystemIOS.h instead. The only thing GUIShader.cpp needed was g_windowing.GetViewPort, which is provided by the @@ -8666,13 +8666,13 @@ index 53bce09..86330cc 100644 CGUIShader::CGUIShader( const char *shader ) : CGLSLShaderProgram("guishader_vert.glsl", shader) -- -1.9.1 +1.9.3 -From 2731716b39783030e6d7ebb3ede2928a745a1656 Mon Sep 17 00:00:00 2001 +From 37b35cb903e778e8906a07610b40a2a16ffd5d26 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 8 Apr 2014 18:14:55 +0100 -Subject: [PATCH 36/83] Fix font display in stereoscopic modes +Subject: [PATCH 36/88] Fix font display in stereoscopic modes CGUIFontTTFGL::LastEnd was previously using the relatively high-level CGraphicContext::SetScissors function to enforce hardware clipping. However, the coordinates it passed in already contained the stereoscopic offset, so @@ -8710,13 +8710,13 @@ index d476409..8466a81 100644 glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); // Unbind GL_ARRAY_BUFFER and GL_ELEMENT_ARRAY_BUFFER -- -1.9.1 +1.9.3 -From e5355ebaadbb6f85aec1fbbf59cf733e3638d9e2 Mon Sep 17 00:00:00 2001 +From 22c556b579982ff7f873646e7612ea59a05bfd8b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 10 Jan 2014 12:10:43 +0000 -Subject: [PATCH 37/83] [rbp] Don't override dvdplayer with omxplayer. +Subject: [PATCH 37/88] [rbp] Don't override dvdplayer with omxplayer. Using dvdplayer can be useful on the Pi. We can actually play sd (up to 640x480 MPEG-4 video) video in real time. This is useful for codec variants like DivX3 which we don't currently play. @@ -8746,13 +8746,13 @@ index 27f0bec..fc12bb7 100644 case EPC_EXTPLAYER: pPlayer = new CExternalPlayer(callback); break; #if defined(HAS_OMXPLAYER) -- -1.9.1 +1.9.3 -From 436fed89bfb302c10c9bc383238fe14529abe871 Mon Sep 17 00:00:00 2001 +From 704c4fe6549d3edd93de34642e6da3f6cc1b973b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 10 Jan 2014 15:37:41 +0000 -Subject: [PATCH 38/83] [players] Use default players rather than hard coded +Subject: [PATCH 38/88] [players] Use default players rather than hard coded DVDPlayer/PAPlayer --- @@ -8808,23 +8808,23 @@ index 57dfcdd..7be9799 100644 -- -1.9.1 +1.9.3 -From 47e8fde3e2f164dfb71cc3483ccc529456273fb3 Mon Sep 17 00:00:00 2001 +From 5b4256d0fe8018541d92f3e4c69d88b2a06d4f31 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 11 Jan 2014 18:23:42 +0000 -Subject: [PATCH 39/83] [rbp] Don't force dvdplayer for airplay +Subject: [PATCH 39/88] [rbp] Don't force dvdplayer for airplay --- xbmc/network/AirPlayServer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xbmc/network/AirPlayServer.cpp b/xbmc/network/AirPlayServer.cpp -index 127a765..13b7ead 100644 +index 8040d9b..182daaa 100644 --- a/xbmc/network/AirPlayServer.cpp +++ b/xbmc/network/AirPlayServer.cpp -@@ -895,9 +895,11 @@ int CAirPlayServer::CTCPClient::ProcessRequest( CStdString& responseHeader, +@@ -906,9 +906,11 @@ int CAirPlayServer::CTCPClient::ProcessRequest( CStdString& responseHeader, CFileItem fileToPlay(location, false); fileToPlay.SetProperty("StartPercent", position*100.0f); ServerInstance->AnnounceToClients(EVENT_LOADING); @@ -8837,13 +8837,13 @@ index 127a765..13b7ead 100644 } } -- -1.9.1 +1.9.3 -From 4c9c78091281cdc82e37de76b5b114bf99466c57 Mon Sep 17 00:00:00 2001 +From 8c3a423de3b359dd4a39ee7c7d46a9322053268c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Jan 2014 13:11:06 +0000 -Subject: [PATCH 40/83] [rbp] Give plugins omxplayer when they request +Subject: [PATCH 40/88] [rbp] Give plugins omxplayer when they request dvdplayer on pi --- @@ -8867,13 +8867,13 @@ index 16f0174..b172d47 100644 int getPLAYER_CORE_PAPLAYER() { return EPC_PAPLAYER; } int getTRAY_OPEN() { return TRAY_OPEN; } -- -1.9.1 +1.9.3 -From 22e69f1ef53e4da6004d1c2caa56590998ff1a50 Mon Sep 17 00:00:00 2001 +From 5741a5082fc96eca6a3605ae104a436985b18cd1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Jan 2014 18:04:07 +0000 -Subject: [PATCH 41/83] [rbp] Allow ALSA to be chosen in addition to Pi sink +Subject: [PATCH 41/88] [rbp] Allow ALSA to be chosen in addition to Pi sink Needs --enable-alsa in ./configure step and alsa support on platform --- @@ -8962,13 +8962,13 @@ index e493123..7df6807 100644 info.m_deviceInfoList.clear(); -- -1.9.1 +1.9.3 -From 60d314958644a9f946d3ead7b2a026118a79c6f9 Mon Sep 17 00:00:00 2001 +From 63a9aa58ab9f68f2b6bcf913228e338f41889b5c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 16 Jan 2014 01:39:29 +0000 -Subject: [PATCH 42/83] [omxcodec] Add hardware decode to dvdplayer for Pi +Subject: [PATCH 42/88] [omxcodec] Add hardware decode to dvdplayer for Pi Hijack the abandoned OpenMaxVideo codec --- @@ -12021,13 +12021,13 @@ index 54d35aa..5b9c2f9 100644 bool Deinitialize(); -- -1.9.1 +1.9.3 -From 5251bf0ef4d07bf7624e510577ed2d7d16ccf071 Mon Sep 17 00:00:00 2001 +From f9a40ac221a8f2f1729a5aa09be533fb15e8ba79 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 3 May 2014 11:57:25 +0100 -Subject: [PATCH 43/83] [omxcodec] Enable for dvd menus +Subject: [PATCH 43/88] [omxcodec] Enable for dvd menus --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 ++++ @@ -12049,13 +12049,13 @@ index 18b8e3a..c85c8d2 100644 { // If dvd is an mpeg2 and hint.stills -- -1.9.1 +1.9.3 -From 690f3a89faccf35ca6c725b10052999055299a59 Mon Sep 17 00:00:00 2001 +From e52a7ad896a99c25957de1699bc526cb0c101a1f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 22:27:44 +0000 -Subject: [PATCH 44/83] [omxcodec] Add omx specific texture +Subject: [PATCH 44/88] [omxcodec] Add omx specific texture create/upload/delete functions --- @@ -12130,13 +12130,13 @@ index 0ca56a2..f3dd3d3 100644 // renderers -- -1.9.1 +1.9.3 -From 55c9fc2cd9eb471af08f079fef875b02390a00e4 Mon Sep 17 00:00:00 2001 +From b1e011ea09abbb2b08a0eaed0e2e739b6775538c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 22:50:43 +0000 -Subject: [PATCH 45/83] [omxcodec] Add shared pointer to delay shutdown of +Subject: [PATCH 45/88] [omxcodec] Add shared pointer to delay shutdown of codec until buffers are returned --- @@ -12314,13 +12314,13 @@ index 9079c13..0975e8a 100644 std::queue m_dts_queue; std::queue m_demux_queue; -- -1.9.1 +1.9.3 -From f327b0130b29b5fba5fa37e85bf50ec82125dc6e Mon Sep 17 00:00:00 2001 +From 79b5c7b475bfa6eff132c93fa6e1d82b5c6c6236 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 23:11:31 +0000 -Subject: [PATCH 46/83] [omxcodec] Fix for aspect ratio in non-square pixel +Subject: [PATCH 46/88] [omxcodec] Fix for aspect ratio in non-square pixel modes --- @@ -12406,13 +12406,13 @@ index 0975e8a..9138a20 100644 bool m_port_settings_changed; const char *m_pFormatName; -- -1.9.1 +1.9.3 -From 0e150f28be7064df4c8627589647645b9633e0ac Mon Sep 17 00:00:00 2001 +From d1d5a19b94ef887fb3f215b4cab287f7b802cdfd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 23:19:22 +0000 -Subject: [PATCH 47/83] [omxcodec] Report error when codec not enabled +Subject: [PATCH 47/88] [omxcodec] Report error when codec not enabled --- xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp | 10 +++++++++- @@ -12454,13 +12454,13 @@ index 7e23c87..2ae722b 100644 if (!m_omx_decoder.Initialize("OMX.broadcom.video_decode", OMX_IndexParamVideoInit)) { -- -1.9.1 +1.9.3 -From 1dbf602b303148c38ac6e90004711723c5b9b54f Mon Sep 17 00:00:00 2001 +From d5b26e9d129671c04c4fd829b17be5a6f23f7d82 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Feb 2014 17:29:37 +0000 -Subject: [PATCH 48/83] [omxcodec] Add deinterlace support +Subject: [PATCH 48/88] [omxcodec] Add deinterlace support --- xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 2 +- @@ -12694,13 +12694,13 @@ index 9138a20..c8ad4d8 100644 bool SendDecoderConfig(uint8_t *extradata, int extrasize); bool NaluFormatStartCodes(enum AVCodecID codec, uint8_t *extradata, int extrasize); -- -1.9.1 +1.9.3 -From 5f27b560dc3234022afddbe3c36a09249dcfd2a1 Mon Sep 17 00:00:00 2001 +From 4da24da7c04a56ae56080e39c245bbe7cfe40381 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 12 Feb 2014 18:43:14 +0000 -Subject: [PATCH 49/83] Improved file buffering in CArchive. +Subject: [PATCH 49/88] Improved file buffering in CArchive. CArchive already did some file buffering, but only on writes. Added the equivalent code for reads. Also improved the write buffer case so that it @@ -13087,13 +13087,13 @@ index 0148fcb..5b25be5 100644 + CArchive &streamin_bufferwrap(uint8_t *ptr, size_t size); +}; -- -1.9.1 +1.9.3 -From d3f9b41f5ed3fd44fe1d8f503b1320d09a9315e3 Mon Sep 17 00:00:00 2001 +From 03ebc04fb52910599e31d656538637fae38a3221 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Feb 2014 11:46:33 +0000 -Subject: [PATCH 50/83] [rbp/settings] Allow av sync type to be enabled +Subject: [PATCH 50/88] [rbp/settings] Allow av sync type to be enabled It works for dvdplayer --- @@ -13119,13 +13119,13 @@ index 2b7d0a6..1429256 100644 false -- -1.9.1 +1.9.3 -From 01c6dd354c55be2ae2f4c54efdc8ea85d541cd57 Mon Sep 17 00:00:00 2001 +From c4dfdf886c9600edc1b80cb5ee459a14b654ebaa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 16 Feb 2014 17:38:05 +0000 -Subject: [PATCH 51/83] [omxcodec] Only do essential calls in texture thread +Subject: [PATCH 51/88] [omxcodec] Only do essential calls in texture thread [omxcodec] Fix for files with no valid pts values. [omxcodec] Fix stall on seek/trickplay - need to reset start flag [omxcodec] Make sure we have a valid context when video decode starts before first fanart is decoded @@ -13472,13 +13472,13 @@ index c8ad4d8..f234f6d 100644 bool SendDecoderConfig(uint8_t *extradata, int extrasize); bool NaluFormatStartCodes(enum AVCodecID codec, uint8_t *extradata, int extrasize); -- -1.9.1 +1.9.3 -From 1a8446fa02a97395dcd6d1d696b47ae7de5b411e Mon Sep 17 00:00:00 2001 +From d68b0befd1c0fb6141406cd143647ccc0465a89e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 1 Mar 2014 14:24:08 +0000 -Subject: [PATCH 52/83] [omxplayer] Allow small audio packets to be +Subject: [PATCH 52/88] [omxplayer] Allow small audio packets to be concatenated to make better use of audio fifo Some audio codecs produce small packets which causes a high overhead when submitting to GPU, and doesn't make full use of GPU side buffering. @@ -13893,13 +13893,13 @@ index 8219015..a4c11777 100644 m_audioStats.AddSampleBytes(pkt->iSize); -- -1.9.1 +1.9.3 -From 12e7f20ddddea40d4eec1fce0645fbe61b420133 Mon Sep 17 00:00:00 2001 +From 6ca8643d2be3f8ca1d7c448c0c842fa693068897 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Mar 2014 22:10:01 +0000 -Subject: [PATCH 53/83] [omxplayer] Use media for determing audio delay and +Subject: [PATCH 53/88] [omxplayer] Use media for determing audio delay and cache time I've also added caching to the call to OMXMediaTime as the GPU round trip is expensive when called too frequently @@ -14152,13 +14152,13 @@ index d7d06fe..f83074a 100644 OMXClock(); ~OMXClock(); -- -1.9.1 +1.9.3 -From 47ca285779b35fe6813dd7bb14a16427d7921698 Mon Sep 17 00:00:00 2001 +From ef428a6da5a1d59d637117c36c17242ae6e2299e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 22:24:19 +0000 -Subject: [PATCH 54/83] [omx] Skip the resize when not needed when decoding +Subject: [PATCH 54/88] [omx] Skip the resize when not needed when decoding jpegs The decode to texture path almost always uses cached jpegs that are the correct size, so the resize is rarely needed. @@ -14506,13 +14506,13 @@ index 4456fdb..262a004 100644 omx_err = m_omx_egl_render.SetStateForComponent(OMX_StateExecuting); -- -1.9.1 +1.9.3 -From 02faafe4e9d26847a931f3e12984bd6fca717999 Mon Sep 17 00:00:00 2001 +From bd78efe076320626e98b47e485258fca4b3be5e4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 55/83] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 55/88] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -14535,13 +14535,13 @@ index b48a4fc..d9897e5 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -- -1.9.1 +1.9.3 -From 4b6aad8a7d83861ce19cd1793bfd555f2827cab3 Mon Sep 17 00:00:00 2001 +From 98545f928a07cd15494323afc147d1ee470729bf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Mar 2014 18:50:23 +0000 -Subject: [PATCH 56/83] [dvdplayer] Use inexact seeking like omxplayer +Subject: [PATCH 56/88] [dvdplayer] Use inexact seeking like omxplayer --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 11 +++++++++++ @@ -14589,13 +14589,13 @@ index 82d3720..54d22d7 100644 /* call with demuxer pts */ -- -1.9.1 +1.9.3 -From 155a31a782afdbff53c01da872eac52c0be37d32 Mon Sep 17 00:00:00 2001 +From de380170d0567f2063aa9e73fc5e3c70167d5d1e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 13 Mar 2014 16:08:46 +0000 -Subject: [PATCH 57/83] [omxplayer] Make use of TrueHD fastpath when downmixing +Subject: [PATCH 57/88] [omxplayer] Make use of TrueHD fastpath when downmixing The TrueHD codec actually works in 3 stages. It decodes the downmixed stereo. It then decodes the differences required to produce 5.1. It then decodes the differences required to produce 7.1. @@ -14637,13 +14637,13 @@ index 557e847..7f6ef6e 100644 // vorbis has variable sized planar output, so skip concatenation if (hints.codec == AV_CODEC_ID_VORBIS) -- -1.9.1 +1.9.3 -From 12a4756c465d4e07360855ae272111a834e354ce Mon Sep 17 00:00:00 2001 +From a2bbb3c2e96d893fb68743e03eec0ff9f4f580a1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Mar 2014 19:38:38 +0000 -Subject: [PATCH 58/83] [omxplayer] When in dual audio mode, make one output +Subject: [PATCH 58/88] [omxplayer] When in dual audio mode, make one output the slave May help audio sync between the two outputs @@ -14674,13 +14674,13 @@ index 3e64de0..72e42ec 100644 OMX_CONFIG_BOOLEANTYPE configBool; OMX_INIT_STRUCTURE(configBool); -- -1.9.1 +1.9.3 -From 9c98ae2efc02621b57fba9962e01234a770ef16a Mon Sep 17 00:00:00 2001 +From a69777ca817cb07c42d21f133bdb50111a7eba2b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 30 Dec 2013 12:02:14 +0000 -Subject: [PATCH 59/83] [rbp] Hardware accelerated resampling +Subject: [PATCH 59/88] [rbp] Hardware accelerated resampling This replaces the format conversion, up/down mixing and resampling code from ActiveAE with a GPU accelerated version. Should significantly reduce CPU when using paplayer or dvdplayer. @@ -15450,13 +15450,13 @@ index 99e407a..8d3c86a 100644 OMX_ERRORTYPE omx_err = OMX_ErrorNone; -- -1.9.1 +1.9.3 -From 9d922bff4c108828243026de082e1935f0279e92 Mon Sep 17 00:00:00 2001 +From 00c90ee3048fb66453ebe0d86d1cc30a2bd67039 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Mar 2014 00:22:05 +0000 -Subject: [PATCH 60/83] [PiResample] Work around AE not providing correct +Subject: [PATCH 60/88] [PiResample] Work around AE not providing correct src_bits --- @@ -15496,13 +15496,13 @@ index 1d7b425..a91e208 100644 if (m_dst_chan_layout == 0) m_dst_chan_layout = m_dllAvUtil.av_get_default_channel_layout(m_dst_channels); -- -1.9.1 +1.9.3 -From e3d39b73ab75e2eef1ccfa4e7c1069f4b575f3b2 Mon Sep 17 00:00:00 2001 +From 3814bea71721851d424f06f2801931bc8b96d67d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 25 Mar 2014 19:43:07 +0000 -Subject: [PATCH 61/83] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 61/88] [ffmpeg] Speed up wtv index creation The index creation is O(N^2) with number of entries (typically thousands). On a Pi this can take more than 60 seconds to execute for a recording of a few hours. @@ -15549,13 +15549,13 @@ index e423370..70898bd 100644 } } -- -1.9.1 +1.9.3 -From c5f34ddc42807b7cd2ad91079375aefd692e0369 Mon Sep 17 00:00:00 2001 +From fc1d5398f274cc24ec433e03bb96057e0f7565da Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 62/83] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 62/88] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -15579,13 +15579,13 @@ index e9ba7d3..0fdc3c2 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -- -1.9.1 +1.9.3 -From 54829b59b9d77816781bf1336609129dacd8d64b Mon Sep 17 00:00:00 2001 +From 990682c0f32becce18f26e7fcaed37e625acc14f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 15:28:57 +0100 -Subject: [PATCH 63/83] [omxcodec] Clamp video texture at edges to avoid image +Subject: [PATCH 63/88] [omxcodec] Clamp video texture at edges to avoid image wrapping --- @@ -15606,13 +15606,13 @@ index a57abe4..e22a153 100644 g_Windowing.EnableGUIShader(SM_TEXTURE_RGBA); -- -1.9.1 +1.9.3 -From dcd1022213e6c278570b1342f753c928738046ff Mon Sep 17 00:00:00 2001 +From b1cb42fc056c936624d8d95d6ce329107c39d47c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 17:36:19 +0100 -Subject: [PATCH 64/83] [PiSink] Remove unneeded header and use CAEChannelInfo +Subject: [PATCH 64/88] [PiSink] Remove unneeded header and use CAEChannelInfo directly --- @@ -15685,13 +15685,13 @@ index 9ce00e3..070e6eb 100644 m_format = format; m_sinkbuffer_sec_per_byte = 1.0 / (double)(m_format.m_frameSize * m_format.m_sampleRate); -- -1.9.1 +1.9.3 -From 4291375d1dce1b753d6d8479c56dbe13a6ea7855 Mon Sep 17 00:00:00 2001 +From 05d8f11cf7f2163a9e298d3fdb9399ce3159521a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 17:37:41 +0100 -Subject: [PATCH 65/83] [omxplayer] Remove PCMRemap and handle multichannel +Subject: [PATCH 65/88] [omxplayer] Remove PCMRemap and handle multichannel mixing like ActiveAE does --- @@ -17349,40 +17349,13 @@ index a273cd1..0000000 - -#endif -- -1.9.1 +1.9.3 -From d4b7448de4a87e66cc995a6d81011cfa601ee172 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 13 Apr 2014 15:13:10 +0100 -Subject: [PATCH 66/83] [omxplayer] Fix for 3d video in mono mode - -The test for no aspect wasn't correct, causing large black bars ---- - xbmc/cores/omxplayer/OMXVideo.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index 66a351d..f058a35 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -848,7 +848,7 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect) - - if (configDisplay.dest_rect.width == 0 || configDisplay.dest_rect.height == 0) - configDisplay.fullscreen = OMX_TRUE; -- else -+ if (configDisplay.src_rect.width != 0 && configDisplay.src_rect.height != 0) - configDisplay.noaspect = OMX_TRUE; - - m_omx_render.SetConfig(OMX_IndexConfigDisplayRegion, &configDisplay); --- -1.9.1 - - -From a5cd08668022ffe5586297c7cad96b1907a37a9c Mon Sep 17 00:00:00 2001 +From 515a6f6bc80e0b050780bcdff8e501d953cf5418 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 10 Apr 2014 17:19:18 +0100 -Subject: [PATCH 67/83] [omxplayer] Remove unused framerate functions +Subject: [PATCH 66/88] [omxplayer] Remove unused framerate functions --- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 4 +--- @@ -17486,13 +17459,13 @@ index f83074a..7bb6d4d 100644 }; -- -1.9.1 +1.9.3 -From b9ce9d1fbe0258764832e8982cea49cffbfcd50d Mon Sep 17 00:00:00 2001 +From bd0c89699971a95287bf7d361b673abfbde7260e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 30 Mar 2014 15:54:34 +0100 -Subject: [PATCH 68/83] [omxplayer] Make the sharpness control act as a +Subject: [PATCH 67/88] [omxplayer] Make the sharpness control act as a sharpness control. This fixes scaling kernel as Mitchell Netravali, and varies sharpness over range B=[5/3,0] C=[-1/3,1/2] @@ -17871,13 +17844,13 @@ index 0b80be5..463ef3c 100644 void COMXPlayer::GetDeinterlaceMethods(std::vector &deinterlaceMethods) -- -1.9.1 +1.9.3 -From 936d8ae57c0a5e4f43fbc3fb9d2a08ca82ba3d97 Mon Sep 17 00:00:00 2001 +From 55a0217489fef614cc635f3ea1cb11036b4d625a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 10 Apr 2014 17:24:51 +0100 -Subject: [PATCH 69/83] [rpi] Include ntsc frequencies in list of supported +Subject: [PATCH 68/88] [rpi] Include ntsc frequencies in list of supported resolutions --- @@ -18008,13 +17981,13 @@ index 0c32947..258a293 100644 ResDesktop = res_index; } -- -1.9.1 +1.9.3 -From 081d9a926f2927e2e6dffba961f31c0aaf2b92ae Mon Sep 17 00:00:00 2001 +From 5d4856e9d4c12a19abdd6563e362fda5b8f1113d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 10 Apr 2014 17:26:20 +0100 -Subject: [PATCH 70/83] [omxplayer] Allow a framerate callback from GPU to +Subject: [PATCH 69/88] [omxplayer] Allow a framerate callback from GPU to trigger a hdmi mode change --- @@ -18073,7 +18046,7 @@ index b49748f..33564dd 100644 }; #endif diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index f058a35..02bf554 100644 +index 66a351d..10a7530 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp +++ b/xbmc/cores/omxplayer/OMXVideo.cpp @@ -171,6 +171,22 @@ bool COMXVideo::PortSettingsChanged() @@ -18151,13 +18124,13 @@ index d69f854..fd23e70 100644 class COMXVideo { -- -1.9.1 +1.9.3 -From 3e612328e13857ffbc52dea65b3296a76c512c49 Mon Sep 17 00:00:00 2001 +From cf55c674653e182068f951c6044c069e66226dd1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 19:01:26 +0100 -Subject: [PATCH 71/83] [omxplayer] Request to be notified about framerate +Subject: [PATCH 70/88] [omxplayer] Request to be notified about framerate changes --- @@ -18165,7 +18138,7 @@ Subject: [PATCH 71/83] [omxplayer] Request to be notified about framerate 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index 02bf554..1b1711d 100644 +index 10a7530..148b16f 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp +++ b/xbmc/cores/omxplayer/OMXVideo.cpp @@ -183,7 +183,7 @@ bool COMXVideo::PortSettingsChanged() @@ -18197,72 +18170,13 @@ index 02bf554..1b1711d 100644 OMX_INIT_STRUCTURE(concanParam); if(g_advancedSettings.m_omxDecodeStartWithValidFrame) -- -1.9.1 +1.9.3 -From df2ddfe9c1c15751fd66eec65810b41ca97b8f5c Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 72/83] [omxplayer] Don't propagate 3d flags based on supported - 3d modes - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 ++++------------------------- - 1 file changed, 4 insertions(+), 25 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index e9010b1..c170cfb 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -703,36 +703,15 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - unsigned flags = 0; - ERenderFormat format = RENDER_FMT_BYPASS; - -+ /* figure out steremode expected based on user settings and hints */ -+ unsigned int stereo_flags = GetStereoModeFlags(GetStereoMode()); -+ - if(m_bAllowFullscreen) - { - flags |= CONF_FLAGS_FULLSCREEN; - m_bAllowFullscreen = false; // only allow on first configure - } -- -- flags |= GetStereoModeFlags(GetStereoMode()); -- -- if(flags & CONF_FLAGS_STEREO_MODE_SBS) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) -- CLog::Log(LOGNOTICE, "3DSBS movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); -- } -- } -- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) -- CLog::Log(LOGNOTICE, "3DTB movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); -- } -- } -- else -- CLog::Log(LOGNOTICE, "not a 3D movie"); -+ flags |= stereo_flags; - - unsigned int iDisplayWidth = width; - unsigned int iDisplayHeight = height; --- -1.9.1 - - -From da7d5e09d520a0b30ba2d12aeb816e62839793f9 Mon Sep 17 00:00:00 2001 +From bd466a846d6e5d973b6bbfb6c1501b21296ed8de Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Apr 2014 17:04:57 +0100 -Subject: [PATCH 73/83] [omxplayer] Support stereo view modes with scaling +Subject: [PATCH 71/88] [omxplayer] Support stereo view modes with scaling The Pi only supported a single view rectangle, which is sufficient for all mono view modes, but only supports a subset of stereo modes. @@ -18283,12 +18197,12 @@ Requires udpated firmware. --- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 103 +++++++++++++++++++++----------- xbmc/cores/omxplayer/OMXPlayerVideo.h | 4 +- - xbmc/cores/omxplayer/OMXVideo.cpp | 47 +++++++++------ + xbmc/cores/omxplayer/OMXVideo.cpp | 45 ++++++++------ xbmc/cores/omxplayer/OMXVideo.h | 3 +- - 4 files changed, 101 insertions(+), 56 deletions(-) + 4 files changed, 100 insertions(+), 55 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index c170cfb..e9f86f3 100644 +index e9010b1..d5f3bec 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -97,6 +97,9 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock, @@ -18448,7 +18362,7 @@ index 33564dd..6f19395 100644 DllBcmHost m_DllBcmHost; diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index 1b1711d..dceb8bf 100644 +index 148b16f..dceb8bf 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp +++ b/xbmc/cores/omxplayer/OMXVideo.cpp @@ -836,7 +836,7 @@ void COMXVideo::Reset(void) @@ -18477,8 +18391,6 @@ index 1b1711d..dceb8bf 100644 - - if (configDisplay.dest_rect.width == 0 || configDisplay.dest_rect.height == 0) - configDisplay.fullscreen = OMX_TRUE; -- if (configDisplay.src_rect.width != 0 && configDisplay.src_rect.height != 0) -- configDisplay.noaspect = OMX_TRUE; + configDisplay.set = (OMX_DISPLAYSETTYPE)(OMX_DISPLAY_SET_DEST_RECT|OMX_DISPLAY_SET_SRC_RECT|OMX_DISPLAY_SET_FULLSCREEN|OMX_DISPLAY_SET_NOASPECT|OMX_DISPLAY_SET_MODE); + configDisplay.dest_rect.x_offset = lrintf(DestRect.x1); + configDisplay.dest_rect.y_offset = lrintf(DestRect.y1); @@ -18501,7 +18413,8 @@ index 1b1711d..dceb8bf 100644 + configDisplay.mode = OMX_DISPLAY_MODE_STEREO_LEFT_TO_TOP; + else if (video_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && display_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + configDisplay.mode = OMX_DISPLAY_MODE_STEREO_LEFT_TO_LEFT; -+ else + else +- configDisplay.noaspect = OMX_TRUE; + configDisplay.mode = OMX_DISPLAY_MODE_LETTERBOX; m_omx_render.SetConfig(OMX_IndexConfigDisplayRegion, &configDisplay); @@ -18537,13 +18450,72 @@ index fd23e70..226000e 100644 void SubmitEOS(); bool IsEOS(); -- -1.9.1 +1.9.3 -From d329faba1508a612d6154267e5534289f12bc1c2 Mon Sep 17 00:00:00 2001 +From af1919b74274135b7a0cfde2b0d9e9874089e043 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 16 Apr 2014 21:18:06 +0100 +Subject: [PATCH 72/88] [omxplayer] Don't propagate 3d flags based on supported + 3d modes + +--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 ++++------------------------- + 1 file changed, 4 insertions(+), 25 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index d5f3bec..e9f86f3 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -736,36 +736,15 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f + unsigned flags = 0; + ERenderFormat format = RENDER_FMT_BYPASS; + ++ /* figure out steremode expected based on user settings and hints */ ++ unsigned int stereo_flags = GetStereoModeFlags(GetStereoMode()); ++ + if(m_bAllowFullscreen) + { + flags |= CONF_FLAGS_FULLSCREEN; + m_bAllowFullscreen = false; // only allow on first configure + } +- +- flags |= GetStereoModeFlags(GetStereoMode()); +- +- if(flags & CONF_FLAGS_STEREO_MODE_SBS) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) +- CLog::Log(LOGNOTICE, "3DSBS movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); +- } +- } +- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) +- CLog::Log(LOGNOTICE, "3DTB movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); +- } +- } +- else +- CLog::Log(LOGNOTICE, "not a 3D movie"); ++ flags |= stereo_flags; + + unsigned int iDisplayWidth = width; + unsigned int iDisplayHeight = height; +-- +1.9.3 + + +From ed1723bd2c6b1e0eec14017bab7e30f9a4309c2b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 74/83] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 73/88] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -18584,13 +18556,13 @@ index 5bffdf5..7e4fdd4 100644 m_iScreenWidth = info_mod.iWidth; -- -1.9.1 +1.9.3 -From 73134caaa8d40861898c8a7e2871b28b119fb328 Mon Sep 17 00:00:00 2001 +From df852843ef2574f33d6b7e40e09da6d15b6c9c06 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 75/83] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 74/88] [graphics] Allow switching to a more suitable 3D resolution --- @@ -18677,13 +18649,13 @@ index 0a27643..df55e92 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -- -1.9.1 +1.9.3 -From b5f083d712d30d75c47e1fba254885cabc56a3b8 Mon Sep 17 00:00:00 2001 +From 8fa5e019095f798310211a2644ab63e68696e0b1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 76/83] [3D] Support switching to 3D resolutions +Subject: [PATCH 75/88] [3D] Support switching to 3D resolutions Include matching 3D flags (SBS/TAB) in the score of a resolution to switch to, to enable switching to 3d modes. Also remove the old code that treated 3D modes differently when assigning a score. @@ -18765,13 +18737,13 @@ index 970b822..9ca1be1 100644 return current; } -- -1.9.1 +1.9.3 -From 6361e0ceb62f2b982eea7393a7d1f7337faf75a4 Mon Sep 17 00:00:00 2001 +From e3ff03c6bf2c3ed18aff778b8dc7ffd714edb946 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 77/83] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 76/88] [graphics] Make pixel ratio for 3d modes consistent Note: Use the stored stereo flags from lists of resolutions. Use current stereo mode for current resolution. @@ -18779,8 +18751,8 @@ Use current stereo mode for current resolution. xbmc/cores/VideoRenderers/BaseRenderer.cpp | 10 ++++---- xbmc/guilib/GraphicContext.cpp | 32 ++++++++++--------------- xbmc/guilib/GraphicContext.h | 4 ++-- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 9 +------ - 4 files changed, 20 insertions(+), 35 deletions(-) + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 8 ------- + 4 files changed, 19 insertions(+), 35 deletions(-) diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp index 9ca1be1..6bf42bf 100644 @@ -18920,10 +18892,10 @@ index df55e92..c77f2ff 100644 /* \brief Get UI scaling information from a given resolution to the screen resolution. Takes account of overscan and UI zooming. diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index 21b8cc4..4268f78 100644 +index 21b8cc4..f57b22b 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -446,15 +446,10 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r +@@ -446,15 +446,9 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r m_desktopRes.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); // Also add 3D flags if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) @@ -18936,11 +18908,10 @@ index 21b8cc4..4268f78 100644 m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - m_desktopRes.fPixelRatio *= 0.5; - } -+ HDMI_PROPERTY_PARAM_T property; property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; vc_tv_hdmi_get_property(&property); -@@ -605,7 +600,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v +@@ -605,7 +599,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v RESOLUTION_INFO res2 = res; res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); @@ -18948,7 +18919,7 @@ index 21b8cc4..4268f78 100644 SetResolutionString(res2); CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); -@@ -623,7 +617,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v +@@ -623,7 +616,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v RESOLUTION_INFO res2 = res; res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); @@ -18957,13 +18928,13 @@ index 21b8cc4..4268f78 100644 CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); -- -1.9.1 +1.9.3 -From e99c8f84767bf7246a79efcb51d827c4f1f8cfff Mon Sep 17 00:00:00 2001 +From 35f93e97642d7cad55731363276500f8359bc226 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 21:07:51 +0100 -Subject: [PATCH 78/83] [PiSink] More attempts to reduce underrun audio +Subject: [PATCH 77/88] [PiSink] More attempts to reduce underrun audio glitches with multichannl and high samplerate --- @@ -19082,13 +19053,13 @@ index 070e6eb..133b9f6 100644 void CAESinkPi::Drain() -- -1.9.1 +1.9.3 -From 920c5d6b63705550f3450371cda3ad190b4d910a Mon Sep 17 00:00:00 2001 +From d9584c9bde746a500fce687d373f61b9021957de Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 22:36:01 +0100 -Subject: [PATCH 79/83] [omxplayer] Fix for aspect ratio of portrait videos +Subject: [PATCH 78/88] [omxplayer] Fix for aspect ratio of portrait videos --- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 10 ++++++++++ @@ -19116,13 +19087,13 @@ index e9f86f3..7e2c644 100644 if (!(m_dst_rect != DestRect) && !(m_src_rect != SrcRect) && m_video_stereo_mode == video_stereo_mode && m_display_stereo_mode == display_stereo_mode && m_StereoInvert == stereo_invert) return; -- -1.9.1 +1.9.3 -From 77c04c0139e456f99c3ffa7b112035298ba00e82 Mon Sep 17 00:00:00 2001 +From cd282d367d4f0677fc3f84aed5f5dc12b45611f1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 22 Apr 2014 12:23:23 +0100 -Subject: [PATCH 80/83] [omxplayer] Make dvdplayer the default for dvd images +Subject: [PATCH 79/88] [omxplayer] Make dvdplayer the default for dvd images --- xbmc/cores/omxplayer/omxplayer_advancedsettings.xml | 2 +- @@ -19141,13 +19112,13 @@ index 77c6a15..51c0daf 100644 -- -1.9.1 +1.9.3 -From f71d59260ad0e70b12a3f42bfcca0d78ddc042b8 Mon Sep 17 00:00:00 2001 +From ce176c56750dd57117e5f50aab9483d0c9dbff63 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 81/83] [cec] Don't suspend pi on tv switch off - it can't wake +Subject: [PATCH 80/88] [cec] Don't suspend pi on tv switch off - it can't wake up --- @@ -19168,13 +19139,13 @@ index a906628..9b5271a 100644 -- -1.9.1 +1.9.3 -From e969ed75bab05305291e3327ce9e274a880993cd Mon Sep 17 00:00:00 2001 +From bd42268a3c2989120be5127552403d5afefa2d1b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 12 Apr 2014 17:57:19 +0100 -Subject: [PATCH 82/83] [omxplayer] Ignore occasionally valid pts values, they +Subject: [PATCH 81/88] [omxplayer] Ignore occasionally valid pts values, they cause live tv stutter --- @@ -19195,13 +19166,13 @@ index 7e2c644..b3786f6 100644 if (pts != DVD_NOPTS_VALUE) -- -1.9.1 +1.9.3 -From bba50323fb8576423895dfa948b6fe3d7d2a1a64 Mon Sep 17 00:00:00 2001 +From 68c9b842ad29a32f928030ce22a18a62cfa0d6f6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 7 May 2014 14:54:41 +0100 -Subject: [PATCH 83/83] [Pi] Fix naming of refresh rates to avoid lost +Subject: [PATCH 82/88] [Pi] Fix naming of refresh rates to avoid lost calibration settings --- @@ -19210,7 +19181,7 @@ Subject: [PATCH 83/83] [Pi] Fix naming of refresh rates to avoid lost 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index 4268f78..2355ab7 100644 +index f57b22b..5b26b20 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -58,6 +58,7 @@ @@ -19232,7 +19203,7 @@ index 4268f78..2355ab7 100644 int i = FindMatchingResolution(res, resolutions); if (i>=0) { // don't replace a progressive resolution with an interlaced one of same resolution -@@ -468,10 +470,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r +@@ -467,10 +469,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r m_desktopRes.fPixelRatio = get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); } @@ -19244,7 +19215,7 @@ index 4268f78..2355ab7 100644 m_initDesktopRes = false; -@@ -579,8 +578,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v +@@ -578,8 +577,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v res.iScreenHeight = tv->height; res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); @@ -19253,7 +19224,7 @@ index 4268f78..2355ab7 100644 CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); -@@ -600,7 +597,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v +@@ -599,7 +596,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v RESOLUTION_INFO res2 = res; res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); @@ -19261,7 +19232,7 @@ index 4268f78..2355ab7 100644 CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); res2.iSubtitles = (int)(0.965 * res2.iHeight); -@@ -617,7 +613,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v +@@ -616,7 +612,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v RESOLUTION_INFO res2 = res; res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); @@ -19282,5 +19253,1157 @@ index d1ebb81..59401f5 100644 #endif }; -- -1.9.1 +1.9.3 + + +From cf0d6dfd02e2700c8479ea7b8b3614f3d2ff51c4 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 10 May 2014 11:40:41 +0100 +Subject: [PATCH 83/88] [omxplayer] Skip out of submit loop when closing. + +Avoids a permanent hang at EOF when using IPTV streams +--- + xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 7 +++++-- + xbmc/cores/omxplayer/OMXPlayerAudio.h | 1 + + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 7 +++++-- + xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 + + 4 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +index d3348ec..4435d22 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +@@ -89,6 +89,7 @@ OMXPlayerAudio::OMXPlayerAudio(OMXClock *av_clock, CDVDMessageQueue& parent) + m_hw_decode = false; + m_silence = false; + m_flush = false; ++ m_bClose = false; + } + + +@@ -145,11 +146,13 @@ void OMXPlayerAudio::OpenStream(CDVDStreamInfo &hints, COMXAudioCodecOMX *codec) + m_format.m_dataFormat = GetDataFormat(m_hints); + m_format.m_sampleRate = 0; + m_format.m_channelLayout = 0; ++ m_bClose = false; + } + + bool OMXPlayerAudio::CloseStream(bool bWaitForBuffers) + { + // wait until buffers are empty ++ m_bClose = true; + if (bWaitForBuffers && m_speed > 0) m_messageQueue.WaitUntilEmpty(); + + m_messageQueue.Abort(); +@@ -259,8 +262,8 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket) + + while(!m_bStop) + { +- // discard if flushing as clocks may be stopped and we'll never submit it +- if(m_flush) ++ // discard if flushing or closing as clocks may be stopped and we'll never submit it ++ if(m_flush || m_bClose) + break; + + if(m_omxAudio.GetSpace() < (unsigned int)decoded_size) +diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.h b/xbmc/cores/omxplayer/OMXPlayerAudio.h +index 685a686..7b55e48 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerAudio.h ++++ b/xbmc/cores/omxplayer/OMXPlayerAudio.h +@@ -70,6 +70,7 @@ class OMXPlayerAudio : public CThread + bool m_DecoderOpen; + + bool m_bad_state; ++ bool m_bClose; + + virtual void OnStartup(); + virtual void OnExit(); +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index b3786f6..61b884e 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -104,6 +104,7 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock, + m_iCurrentPts = DVD_NOPTS_VALUE; + m_nextOverlay = DVD_NOPTS_VALUE; + m_flush = false; ++ m_bClose = false; + m_history_valid_pts = 0; + } + +@@ -118,6 +119,7 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints) + m_hdmi_clock_sync = (CSettings::Get().GetInt("videoplayer.adjustrefreshrate") != ADJUST_REFRESHRATE_OFF); + m_started = false; + m_flush = false; ++ m_bClose = false; + m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0; + m_nextOverlay = DVD_NOPTS_VALUE; + // force SetVideoRect to be called initially +@@ -161,6 +163,7 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints, COMXVideo *codec) + bool OMXPlayerVideo::CloseStream(bool bWaitForBuffers) + { + // wait until buffers are empty ++ m_bClose = true; + if (bWaitForBuffers && m_speed > 0) m_messageQueue.WaitUntilEmpty(); + + m_messageQueue.Abort(); +@@ -469,8 +472,8 @@ void OMXPlayerVideo::Process() + + while (!m_bStop) + { +- // discard if flushing as clocks may be stopped and we'll never submit it +- if (m_flush) ++ // discard if flushing or closing as clocks may be stopped and we'll never submit it ++ if (m_flush || m_bClose) + break; + + if((int)m_omxVideo.GetFreeSpace() < pPacket->iSize) +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h +index 6f19395..8eff32f 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.h ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h +@@ -66,6 +66,7 @@ class OMXPlayerVideo : public CThread + + float m_fForcedAspectRatio; + unsigned m_flags; ++ bool m_bClose; + + CRect m_src_rect; + CRect m_dst_rect; +-- +1.9.3 + + +From 0d7173c0136a4d2f14a3cb96d6328e36116b3857 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Mon, 28 May 2012 10:34:39 +0200 +Subject: [PATCH 84/88] videoplayer: adapt lateness detection and dropping to + buffering + +--- + xbmc/cores/VideoRenderers/RenderManager.cpp | 16 +- + xbmc/cores/VideoRenderers/RenderManager.h | 12 +- + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 38 +++- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 41 +++++ + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 7 + + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 197 +++++++++++++++++---- + xbmc/cores/dvdplayer/DVDPlayerVideo.h | 23 +++ + 7 files changed, 296 insertions(+), 38 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index 3503988..4ca74f8 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -286,6 +286,8 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi + m_bIsStarted = true; + m_bReconfigured = true; + m_presentstep = PRESENT_IDLE; ++ m_presentpts = DVD_NOPTS_VALUE; ++ m_sleeptime = 1.0; + m_presentevent.notifyAll(); + + m_firstFlipPage = false; // tempfix +@@ -629,7 +631,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) + m_pRenderer->SetViewMode(iViewMode); + } + +-void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) ++void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, double pts /* = 0 */, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) + { + { CSharedLock lock(m_sharedSection); + +@@ -697,6 +699,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L + m.timestamp = timestamp; + m.presentfield = sync; + m.presentmethod = presentmethod; ++ m.pts = pts; + requeue(m_queued, m_free); + + /* signal to any waiters to check state */ +@@ -1065,6 +1068,8 @@ void CXBMCRenderManager::PrepareNextRender() + m_discard.push_back(m_presentsource); + m_presentsource = idx; + m_queued.pop_front(); ++ m_sleeptime = m_Queue[idx].timestamp - clocktime; ++ m_presentpts = m_Queue[idx].pts; + m_presentevent.notifyAll(); + } + } +@@ -1081,3 +1086,12 @@ void CXBMCRenderManager::DiscardBuffer() + m_presentstep = PRESENT_IDLE; + m_presentevent.notifyAll(); + } ++ ++bool CXBMCRenderManager::GetStats(double &sleeptime, double &pts, int &bufferLevel) ++{ ++ CSingleLock lock(m_presentlock); ++ sleeptime = m_sleeptime; ++ pts = m_presentpts; ++ bufferLevel = m_queued.size() + m_discard.size(); ++ return true; ++} +diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h +index c469795..949c652b 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.h ++++ b/xbmc/cores/VideoRenderers/RenderManager.h +@@ -98,10 +98,11 @@ class CXBMCRenderManager + * + * @param bStop reference to stop flag of calling thread + * @param timestamp of frame delivered with AddVideoPicture ++ * @param pts used for lateness detection + * @param source depreciated + * @param sync signals frame, top, or bottom field + */ +- void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); ++ void FlipPage(volatile bool& bStop, double timestamp = 0.0, double pts = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); + unsigned int PreInit(); + void UnInit(); + bool Flush(); +@@ -176,6 +177,12 @@ class CXBMCRenderManager + int WaitForBuffer(volatile bool& bStop, int timeout = 100); + + /** ++ * Can be called by player for lateness detection. This is done best by ++ * looking at the end of the queue. ++ */ ++ bool GetStats(double &sleeptime, double &pts, int &bufferLevel); ++ ++ /** + * Video player call this on flush in oder to discard any queued frames + */ + void DiscardBuffer(); +@@ -222,6 +229,7 @@ class CXBMCRenderManager + + struct SPresent + { ++ double pts; + double timestamp; + EFIELDSYNC presentfield; + EPRESENTMETHOD presentmethod; +@@ -233,6 +241,8 @@ class CXBMCRenderManager + + ERenderFormat m_format; + ++ double m_sleeptime; ++ double m_presentpts; + double m_presentcorr; + double m_presenterr; + double m_errorbuff[ERRORBUFFSIZE]; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +index dc047d7..c09939c 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +@@ -129,6 +129,10 @@ struct DVDVideoUserData + #define DVP_FLAG_NOSKIP 0x00000010 // indicate this picture should never be dropped + #define DVP_FLAG_DROPPED 0x00000020 // indicate that this picture has been dropped in decoder stage, will have no data + ++#define DVP_FLAG_DROPDEINT 0x00000040 // indicate that this picture was requested to have been dropped in deint stage ++#define DVP_FLAG_NO_POSTPROC 0x00000100 // see GetCodecStats ++#define DVP_FLAG_DRAIN 0x00000200 // see GetCodecStats ++ + // DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2! + + #define DVP_QSCALE_UNKNOWN 0 +@@ -146,6 +150,8 @@ class CDVDCodecOptions; + #define VC_PICTURE 0x00000004 // the decoder got a picture, call Decode(NULL, 0) again to parse the rest of the data + #define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data + #define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again ++#define VC_DROPPED 0x00000020 // needed to identify if a picture was dropped ++ + class CDVDVideoCodec + { + public: +@@ -263,7 +269,6 @@ class CDVDVideoCodec + return 0; + } + +- + /** + * Number of references to old pictures that are allowed to + * be retained when calling decode on the next demux packet +@@ -280,4 +285,35 @@ class CDVDVideoCodec + * Interact with user settings so that user disabled codecs are disabled + */ + static bool IsCodecDisabled(DVDCodecAvailableType* map, unsigned int size, AVCodecID id); ++ ++ /* For calculation of dropping requirements player asks for some information. ++ * ++ * - pts : right after decoder, used to detect gaps (dropped frames in decoder) ++ * - droppedPics : indicates if decoder has dropped a picture ++ * -1 means that decoder has no info on this. ++ * ++ * If codec does not implement this method, pts of decoded frame at input ++ * video player is used. In case decoder does post-proc and de-interlacing there ++ * may be quite some frames queued up between exit decoder and entry player. ++ */ ++ virtual bool GetCodecStats(double &pts, int &droppedPics) ++ { ++ droppedPics= -1; ++ return false; ++ } ++ ++ /** ++ * Codec can be informed by player with the following flags: ++ * ++ * DVP_FLAG_NO_POSTPROC : if speed is not normal the codec can switch off ++ * postprocessing and de-interlacing ++ * ++ * DVP_FLAG_DRAIN : codecs may do postprocessing and de-interlacing. ++ * If video buffers in RenderManager are about to run dry, ++ * this is signaled to codec. Codec can wait for post-proc ++ * to be finished instead of returning empty and getting another ++ * packet. ++ * ++ */ ++ virtual void SetCodecControl(int flags) {} + }; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index 9b6a34d..81fe0cf 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -164,6 +164,7 @@ CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg() : CDVDVideoCodec() + m_iLastKeyframe = 0; + m_dts = DVD_NOPTS_VALUE; + m_started = false; ++ m_decoderPts = DVD_NOPTS_VALUE; + } + + CDVDVideoCodecFFmpeg::~CDVDVideoCodecFFmpeg() +@@ -355,6 +356,14 @@ void CDVDVideoCodecFFmpeg::SetDropState(bool bDrop) + { + if( m_pCodecContext ) + { ++ if (bDrop && m_pHardware && m_pHardware->CanSkipDeint()) ++ { ++ m_requestSkipDeint = true; ++ bDrop = false; ++ } ++ else ++ m_requestSkipDeint = false; ++ + // i don't know exactly how high this should be set + // couldn't find any good docs on it. think it varies + // from codec to codec on what it does +@@ -556,6 +565,7 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p + void CDVDVideoCodecFFmpeg::Reset() + { + m_started = false; ++ m_decoderPts = DVD_NOPTS_VALUE; + m_iLastKeyframe = m_pCodecContext->has_b_frames; + m_dllAvCodec.avcodec_flush_buffers(m_pCodecContext); + +@@ -665,6 +675,22 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) + else + pDvdVideoPicture->pts = DVD_NOPTS_VALUE; + ++ if (pDvdVideoPicture->pts != DVD_NOPTS_VALUE) ++ m_decoderPts = pDvdVideoPicture->pts; ++ else ++ m_decoderPts = m_dts; ++ ++ if (m_requestSkipDeint) ++ { ++ pDvdVideoPicture->iFlags |= DVP_FLAG_DROPDEINT; ++ m_skippedDeint = 1; ++ } ++ else ++ m_skippedDeint = 0; ++ ++ m_requestSkipDeint = false; ++ pDvdVideoPicture->iFlags |= m_codecControlFlags; ++ + if(!m_started) + pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; + +@@ -924,3 +950,18 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() + else + return 0; + } ++ ++bool CDVDVideoCodecFFmpeg::GetCodecStats(double &pts, int &droppedPics) ++{ ++ pts = m_decoderPts; ++ if (m_skippedDeint) ++ droppedPics = m_skippedDeint; ++ else ++ droppedPics = -1; ++ return true; ++} ++ ++void CDVDVideoCodecFFmpeg::SetCodecControl(int flags) ++{ ++ m_codecControlFlags = flags; ++} +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +index 2287031..827c9507 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +@@ -45,6 +45,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + virtual int Check (AVCodecContext* avctx) = 0; + virtual void Reset () {} + virtual unsigned GetAllowedReferences() { return 0; } ++ virtual bool CanSkipDeint() {return false; } + virtual const std::string Name() = 0; + virtual CCriticalSection* Section() { return NULL; } + }; +@@ -62,6 +63,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + virtual const char* GetName() { return m_name.c_str(); }; // m_name is never changed after open + virtual unsigned GetConvergeCount(); + virtual unsigned GetAllowedReferences(); ++ virtual bool GetCodecStats(double &pts, int &droppedPics); ++ virtual void SetCodecControl(int flags); + + bool IsHardwareAllowed() { return !m_bSoftware; } + IHardwareDecoder * GetHardware() { return m_pHardware; }; +@@ -127,4 +130,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + double m_dts; + bool m_started; + std::vector m_formats; ++ double m_decoderPts, m_decoderInterval; ++ int m_skippedDeint; ++ bool m_requestSkipDeint; ++ int m_codecControlFlags; + }; +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index fddb7f7..181ff74 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -38,6 +38,7 @@ + #include "DVDCodecs/DVDCodecs.h" + #include "DVDCodecs/Overlay/DVDOverlayCodecCC.h" + #include "DVDCodecs/Overlay/DVDOverlaySSA.h" ++#include "guilib/GraphicContext.h" + #include + #include + #include +@@ -320,8 +321,10 @@ void CDVDPlayerVideo::Process() + + int iDropped = 0; //frames dropped in a row + bool bRequestDrop = false; ++ int iDropDirective; + + m_videoStats.Start(); ++ m_droppingStats.Reset(); + + while (!m_bStop) + { +@@ -436,6 +439,7 @@ void CDVDPlayerVideo::Process() + picture.iFlags &= ~DVP_FLAG_ALLOCATED; + m_packets.clear(); + m_started = false; ++ m_droppingStats.Reset(); + } + else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (CDVDPlayerVideo::Flush()) + { +@@ -448,6 +452,7 @@ void CDVDPlayerVideo::Process() + //we need to recalculate the framerate + //TODO: this needs to be set on a streamchange instead + ResetFrameRateCalc(); ++ m_droppingStats.Reset(); + + m_stalled = true; + m_started = false; +@@ -467,6 +472,7 @@ void CDVDPlayerVideo::Process() + m_iNrOfPicturesNotToSkip = 0; + if (m_pVideoCodec) + m_pVideoCodec->SetSpeed(m_speed); ++ m_droppingStats.Reset(); + } + else if (pMsg->IsType(CDVDMsg::PLAYER_STARTED)) + { +@@ -515,6 +521,28 @@ void CDVDPlayerVideo::Process() + m_iNrOfPicturesNotToSkip = 1; + } + ++ bRequestDrop = false; ++ iDropDirective = CalcDropRequirement(pts); ++ if (iDropDirective & EOS_VERYLATE) ++ { ++ if (m_bAllowDrop) ++ { ++ m_pullupCorrection.Flush(); ++ bRequestDrop = true; ++ } ++ } ++ int codecControl = 0; ++ if (iDropDirective & EOS_BUFFER_LEVEL) ++ codecControl |= DVP_FLAG_DRAIN; ++ if (m_speed > DVD_PLAYSPEED_NORMAL) ++ codecControl |= DVP_FLAG_NO_POSTPROC; ++ m_pVideoCodec->SetCodecControl(codecControl); ++ if (iDropDirective & EOS_DROPPED) ++ { ++ m_iDroppedFrames++; ++ iDropped++; ++ } ++ + if (m_messageQueue.GetDataSize() == 0 + || m_speed < 0) + { +@@ -567,15 +595,7 @@ void CDVDPlayerVideo::Process() + } + + m_videoStats.AddSampleBytes(pPacket->iSize); +- // assume decoder dropped a picture if it didn't give us any +- // picture from a demux packet, this should be reasonable +- // for libavformat as a demuxer as it normally packetizes +- // pictures when they come from demuxer +- if(bRequestDrop && !bPacketDrop && (iDecoderState & VC_BUFFER) && !(iDecoderState & VC_PICTURE)) +- { +- m_iDroppedFrames++; +- iDropped++; +- } ++ + // reset the request, the following while loop may break before + // setting the flag to a new value + bRequestDrop = false; +@@ -1185,33 +1205,12 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) + m_FlipTimeStamp += max(0.0, iSleepTime); + m_FlipTimeStamp += iFrameDuration; + +- if (iSleepTime <= 0 && m_speed) +- m_iLateFrames++; +- else +- m_iLateFrames = 0; +- +- // ask decoder to drop frames next round, as we are very late +- if(m_iLateFrames > 10) ++ if ((pPicture->iFlags & DVP_FLAG_DROPPED)) + { +- if (!(pPicture->iFlags & DVP_FLAG_NOSKIP)) +- { +- //if we're calculating the framerate, +- //don't drop frames until we've calculated a stable framerate +- if (m_bAllowDrop || m_speed != DVD_PLAYSPEED_NORMAL) +- { +- result |= EOS_VERYLATE; +- m_pullupCorrection.Flush(); //dropped frames mess up the pattern, so just flush it +- } +- m_iDroppedRequest++; +- } +- } +- else +- { +- m_iDroppedRequest = 0; +- } +- +- if( (pPicture->iFlags & DVP_FLAG_DROPPED) ) ++ m_droppingStats.AddOutputDropGain(pts, 1/m_fFrameRate); ++ CLog::Log(LOGDEBUG,"%s - dropped in output", __FUNCTION__); + return result | EOS_DROPPED; ++ } + + // set fieldsync if picture is interlaced + EFIELDSYNC mDisplayField = FS_NONE; +@@ -1244,7 +1243,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) + if (index < 0) + return EOS_DROPPED; + +- g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, mDisplayField); ++ g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, pts, -1, mDisplayField); + + return result; + #else +@@ -1544,3 +1543,131 @@ void CDVDPlayerVideo::CalcFrameRate() + m_iFrameRateCount = 0; + } + } ++ ++int CDVDPlayerVideo::CalcDropRequirement(double pts) ++{ ++ int result = 0; ++ double iSleepTime; ++ double iDecoderPts, iRenderPts; ++ double iInterval; ++ double iGain; ++ double iLateness; ++ bool bNewFrame; ++ int iDroppedPics = -1; ++ int iBufferLevel; ++ ++ // get decoder stats ++ if (!m_pVideoCodec->GetCodecStats(iDecoderPts, iDroppedPics)) ++ iDecoderPts = pts; ++ if (iDecoderPts == DVD_NOPTS_VALUE) ++ iDecoderPts = pts; ++ ++ // get render stats ++ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); ++ ++ if (iBufferLevel < 0) ++ result |= EOS_BUFFER_LEVEL; ++ else if (iBufferLevel < 2) ++ { ++ result |= EOS_BUFFER_LEVEL; ++ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - hurry: %d", iBufferLevel); ++ } ++ ++ bNewFrame = iDecoderPts != m_droppingStats.m_lastDecoderPts; ++ ++ iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; ++ ++ m_FlipTimeStamp = m_pClock->GetAbsoluteClock() + max(0.0, iSleepTime) + iInterval; ++ ++ if (m_stalled) ++ m_iCurrentPts = DVD_NOPTS_VALUE; ++ else ++ m_iCurrentPts = iRenderPts - max(0.0, iSleepTime); ++ ++ if (m_droppingStats.m_lastDecoderPts > 0 ++ && bNewFrame ++ && m_bAllowDrop) ++ { ++ iGain = (iDecoderPts - m_droppingStats.m_lastDecoderPts - iInterval)/(double)DVD_TIME_BASE; ++ if (iDroppedPics > 0) ++ { ++ CDroppingStats::CGain gain; ++ gain.gain = iDroppedPics * 1/m_fFrameRate; ++ gain.pts = iDecoderPts; ++ m_droppingStats.m_gain.push_back(gain); ++ m_droppingStats.m_totalGain += gain.gain; ++ result |= EOS_DROPPED; ++ m_droppingStats.m_dropRequests = 0; ++ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped pictures, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); ++ } ++ else if (iDroppedPics < 0 && iGain > 1/m_fFrameRate) ++ { ++ CDroppingStats::CGain gain; ++ gain.gain = iGain; ++ gain.pts = iDecoderPts; ++ m_droppingStats.m_gain.push_back(gain); ++ m_droppingStats.m_totalGain += iGain; ++ result |= EOS_DROPPED; ++ m_droppingStats.m_dropRequests = 0; ++ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped in decoder, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); ++ } ++ } ++ m_droppingStats.m_lastDecoderPts = iDecoderPts; ++ ++ // subtract gains ++ while (!m_droppingStats.m_gain.empty() && ++ iRenderPts >= m_droppingStats.m_gain.front().pts) ++ { ++ m_droppingStats.m_totalGain -= m_droppingStats.m_gain.front().gain; ++ m_droppingStats.m_gain.pop_front(); ++ } ++ ++ // calculate lateness ++ iLateness = iSleepTime + m_droppingStats.m_totalGain; ++ if (iLateness < 0 && m_speed) ++ { ++ if (bNewFrame) ++ m_droppingStats.m_lateFrames++; ++ ++ // if lateness is smaller than frametime, we observe this state ++ // for 10 cycles ++ if (m_droppingStats.m_lateFrames > 10 || iLateness < -2/m_fFrameRate) ++ { ++ // is frame allowed to skip ++ if (m_iNrOfPicturesNotToSkip <= 0) ++ { ++ if (bNewFrame || m_droppingStats.m_dropRequests < 5) ++ { ++ result |= EOS_VERYLATE; ++ } ++ m_droppingStats.m_dropRequests++; ++ } ++ } ++ } ++ else ++ { ++ m_droppingStats.m_dropRequests = 0; ++ m_droppingStats.m_lateFrames = 0; ++ } ++ m_droppingStats.m_lastRenderPts = iRenderPts; ++ return result; ++} ++ ++void CDroppingStats::Reset() ++{ ++ m_gain.clear(); ++ m_totalGain = 0; ++ m_lastDecoderPts = 0; ++ m_lastRenderPts = 0; ++ m_lateFrames = 0; ++ m_dropRequests = 0; ++} ++ ++void CDroppingStats::AddOutputDropGain(double pts, double frametime) ++{ ++ CDroppingStats::CGain gain; ++ gain.gain = frametime; ++ gain.pts = pts; ++ m_gain.push_back(gain); ++ m_totalGain += frametime; ++} +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +index f8ad541..186e271 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +@@ -36,6 +36,25 @@ class CDVDOverlayCodecCC; + + #define VIDEO_PICTURE_QUEUE_SIZE 1 + ++class CDroppingStats ++{ ++public: ++ void Reset(); ++ void AddOutputDropGain(double pts, double frametime); ++ struct CGain ++ { ++ double gain; ++ double pts; ++ }; ++ std::deque m_gain; ++ double m_totalGain; ++ double m_lastDecoderPts; ++ double m_lastRenderPts; ++ unsigned int m_lateFrames; ++ unsigned int m_dropRequests; ++}; ++ ++ + class CDVDPlayerVideo : public CThread + { + public: +@@ -104,6 +123,7 @@ class CDVDPlayerVideo : public CThread + #define EOS_ABORT 1 + #define EOS_DROPPED 2 + #define EOS_VERYLATE 4 ++#define EOS_BUFFER_LEVEL 8 + + void AutoCrop(DVDVideoPicture* pPicture); + void AutoCrop(DVDVideoPicture *pPicture, RECT &crop); +@@ -129,6 +149,7 @@ class CDVDPlayerVideo : public CThread + + void ResetFrameRateCalc(); + void CalcFrameRate(); ++ int CalcDropRequirement(double pts); + + double m_fFrameRate; //framerate of the video currently playing + bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps +@@ -182,5 +203,7 @@ class CDVDPlayerVideo : public CThread + CPullupCorrection m_pullupCorrection; + + std::list m_packets; ++ ++ CDroppingStats m_droppingStats; + }; + +-- +1.9.3 + + +From aca54d66385a5d81124e355bbdcf79fab0d48526 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sun, 2 Sep 2012 16:05:21 +0200 +Subject: [PATCH 85/88] video player: present correct pts to user for a/v sync + (after buffering in renderer) + +--- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 16 ++++++++++++++++ + xbmc/cores/dvdplayer/DVDPlayerVideo.h | 2 +- + 2 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index 181ff74..01757cc 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -1463,6 +1463,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() + g_advancedSettings.m_videoFpsDetect == 0; + } + ++double CDVDPlayerVideo::GetCurrentPts() ++{ ++ double iSleepTime, iRenderPts; ++ int iBufferLevel; ++ ++ // get render stats ++ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); ++ ++ if( m_stalled ) ++ iRenderPts = DVD_NOPTS_VALUE; ++ else ++ iRenderPts = iRenderPts - max(0.0, iSleepTime); ++ ++ return iRenderPts; ++} ++ + #define MAXFRAMERATEDIFF 0.01 + #define MAXFRAMESERR 1000 + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +index 186e271..59c7f09 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +@@ -100,7 +100,7 @@ class CDVDPlayerVideo : public CThread + + bool InitializedOutputDevice(); + +- double GetCurrentPts() { return m_iCurrentPts; } ++ double GetCurrentPts(); + int GetPullupCorrection() { return m_pullupCorrection.GetPatternLength(); } + + double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ +-- +1.9.3 + + +From 1a0fed516ef3111bcc9c444bf72d31fd1d4fd1c3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 12 May 2014 23:06:43 +0100 +Subject: [PATCH 86/88] [omxcodec] Updates to work better with dropping and + lateness detection + +--- + .../DVDCodecs/Video/DVDVideoCodecOpenMax.cpp | 5 ++ + .../DVDCodecs/Video/DVDVideoCodecOpenMax.h | 1 + + .../dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp | 95 ++++++++++++++++------ + .../cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h | 9 +- + 4 files changed, 84 insertions(+), 26 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp +index ef10555..8323497 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp +@@ -91,4 +91,9 @@ bool CDVDVideoCodecOpenMax::ClearPicture(DVDVideoPicture* pDvdVideoPicture) + return m_omx_decoder->ClearPicture(pDvdVideoPicture); + } + ++bool CDVDVideoCodecOpenMax::GetCodecStats(double &pts, int &droppedPics) ++{ ++ return m_omx_decoder->GetCodecStats(pts, droppedPics); ++} ++ + #endif +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h +index b7c0c1b..4f243df 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h +@@ -41,6 +41,7 @@ class CDVDVideoCodecOpenMax : public CDVDVideoCodec + virtual unsigned GetAllowedReferences(); + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void); ++ virtual bool GetCodecStats(double &pts, int &droppedPics); + + protected: + OpenMaxVideoPtr m_omx_decoder; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp +index 71d19af..93cf521 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp +@@ -37,6 +37,7 @@ + #include "ApplicationMessenger.h" + #include "Application.h" + #include "threads/Atomics.h" ++#include "guilib/GUIWindowManager.h" + + #include + #include +@@ -57,6 +58,7 @@ + + #define OMX_BUFFERFLAG_PTS_INVALID (1<<28) + #define OMX_BUFFERFLAG_DROPPED (1<<29) ++#define OMX_BUFFERFLAG_FIRST_FIELD (1<<30) + + COpenMaxVideoBuffer::COpenMaxVideoBuffer(COpenMaxVideo *omv) + : m_omv(omv), m_refs(0) +@@ -139,8 +141,11 @@ COpenMaxVideo::COpenMaxVideo() + + m_deinterlace = false; + m_deinterlace_request = VS_DEINTERLACEMODE_OFF; +- m_deinterlace_second_field = false; + m_startframe = false; ++ m_decoderPts = DVD_NOPTS_VALUE; ++ m_droppedPics = 0; ++ m_decode_frame_number = 1; ++ m_skipDeinterlaceFields = false; + } + + COpenMaxVideo::~COpenMaxVideo() +@@ -369,7 +374,10 @@ void COpenMaxVideo::Dispose() + m_finished = true; + pthread_mutex_unlock(&m_omx_output_mutex); + if (done) ++ { ++ assert(m_dts_queue.empty()); + m_myself.reset(); ++ } + } + + void COpenMaxVideo::SetDropState(bool bDrop) +@@ -730,6 +738,7 @@ int COpenMaxVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + omx_buffer->nFilledLen = (demuxer_bytes > omx_buffer->nAllocLen) ? omx_buffer->nAllocLen : demuxer_bytes; + omx_buffer->nTimeStamp = ToOMXTime((uint64_t)(pts == DVD_NOPTS_VALUE) ? 0 : pts); + omx_buffer->pAppPrivate = omx_buffer; ++ omx_buffer->pMarkData = (OMX_PTR)m_decode_frame_number; + memcpy(omx_buffer->pBuffer, demuxer_content, omx_buffer->nFilledLen); + + demuxer_bytes -= omx_buffer->nFilledLen; +@@ -742,12 +751,18 @@ int COpenMaxVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + omx_buffer->nFlags |= OMX_BUFFERFLAG_TIME_UNKNOWN; + if (pts == DVD_NOPTS_VALUE) // hijack an omx flag to indicate there wasn't a real timestamp - it will be returned with the picture (but otherwise ignored) + omx_buffer->nFlags |= OMX_BUFFERFLAG_PTS_INVALID; +- if (m_drop_state) // hijack an omx flag to signal this frame to be dropped - it will be returned with the picture (but otherwise ignored) ++ if (m_drop_state) ++ { ++ // hijack an omx flag to signal this frame to be dropped - it will be returned with the picture (but otherwise ignored) + omx_buffer->nFlags |= OMX_BUFFERFLAG_DECODEONLY | OMX_BUFFERFLAG_DROPPED; ++ m_droppedPics += m_deinterlace ? 2:1; ++ } ++ // always set this flag on input. It won't be set on second field of interlaced video. ++ omx_buffer->nFlags |= OMX_BUFFERFLAG_FIRST_FIELD; + + #if defined(OMX_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - %-6d dts:%.3f pts:%.3f flags:%x", +- CLASSNAME, __func__, omx_buffer->nFilledLen, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, omx_buffer->nFlags); ++ CLog::Log(LOGDEBUG, "%s::%s - %-6d dts:%.3f pts:%.3f flags:%x frame:%d", ++ CLASSNAME, __func__, omx_buffer->nFilledLen, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, omx_buffer->nFlags, (int)omx_buffer->pMarkData); + #endif + + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); +@@ -758,13 +773,16 @@ int COpenMaxVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + } + if (demuxer_bytes == 0) + { ++ m_decode_frame_number++; + m_startframe = true; + #ifdef DTS_QUEUE + if (!m_drop_state) + { + // only push if we are successful with feeding OMX_EmptyThisBuffer ++ pthread_mutex_lock(&m_omx_output_mutex); + m_dts_queue.push(dts); + assert(m_dts_queue.size() < 32); ++ pthread_mutex_unlock(&m_omx_output_mutex); + } + #endif + if (buffer_to_free) +@@ -840,13 +858,18 @@ void COpenMaxVideo::Reset(void) + SetDropState(true); + SetDropState(false); + #ifdef DTS_QUEUE ++ pthread_mutex_lock(&m_omx_output_mutex); + while (!m_dts_queue.empty()) + m_dts_queue.pop(); ++ pthread_mutex_unlock(&m_omx_output_mutex); + #endif + + while (!m_demux_queue.empty()) + m_demux_queue.pop(); + m_startframe = false; ++ m_decoderPts = DVD_NOPTS_VALUE; ++ m_droppedPics = 0; ++ m_decode_frame_number = 1; + } + + +@@ -928,26 +951,17 @@ bool COpenMaxVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) + } + } + +-#ifdef DTS_QUEUE +- if (!m_deinterlace_second_field) +- { +- assert(!m_dts_queue.empty()); +- pDvdVideoPicture->dts = m_dts_queue.front(); +- m_dts_queue.pop(); +- } +- if (m_deinterlace) +- m_deinterlace_second_field = !m_deinterlace_second_field; +-#endif + // nTimeStamp is in microseconds ++ pDvdVideoPicture->dts = buffer->dts; + pDvdVideoPicture->pts = FromOMXTime(buffer->omx_buffer->nTimeStamp); + pDvdVideoPicture->openMaxBuffer->Acquire(); + pDvdVideoPicture->iFlags = DVP_FLAG_ALLOCATED; + if (buffer->omx_buffer->nFlags & OMX_BUFFERFLAG_PTS_INVALID) + pDvdVideoPicture->pts = DVD_NOPTS_VALUE; + #if defined(OMX_DEBUG_VERBOSE) +- CLog::Log(LOGINFO, "%s::%s dts:%.3f pts:%.3f flags:%x:%x openMaxBuffer:%p omx_buffer:%p egl_image:%p texture_id:%x", CLASSNAME, __func__, ++ CLog::Log(LOGINFO, "%s::%s dts:%.3f pts:%.3f flags:%x:%x frame:%d openMaxBuffer:%p omx_buffer:%p egl_image:%p texture_id:%x", CLASSNAME, __func__, + pDvdVideoPicture->dts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->dts*1e-6, pDvdVideoPicture->pts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->pts*1e-6, +- pDvdVideoPicture->iFlags, buffer->omx_buffer->nFlags, pDvdVideoPicture->openMaxBuffer, pDvdVideoPicture->openMaxBuffer->omx_buffer, pDvdVideoPicture->openMaxBuffer->egl_image, pDvdVideoPicture->openMaxBuffer->texture_id); ++ pDvdVideoPicture->iFlags, buffer->omx_buffer->nFlags, (int)buffer->omx_buffer->pMarkData, pDvdVideoPicture->openMaxBuffer, pDvdVideoPicture->openMaxBuffer->omx_buffer, pDvdVideoPicture->openMaxBuffer->egl_image, pDvdVideoPicture->openMaxBuffer->texture_id); + #endif + assert(!(buffer->omx_buffer->nFlags & (OMX_BUFFERFLAG_DECODEONLY | OMX_BUFFERFLAG_DROPPED))); + } +@@ -956,6 +970,12 @@ bool COpenMaxVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) + CLog::Log(LOGERROR, "%s::%s - called but m_omx_output_ready is empty", CLASSNAME, __func__); + return false; + } ++ ++ if (pDvdVideoPicture->pts != DVD_NOPTS_VALUE) ++ m_decoderPts = pDvdVideoPicture->pts; ++ else ++ m_decoderPts = pDvdVideoPicture->dts; // xxx is DVD_NOPTS_VALUE better? ++ + return true; + } + +@@ -970,25 +990,54 @@ bool COpenMaxVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) + return true; + } + ++bool COpenMaxVideo::GetCodecStats(double &pts, int &droppedPics) ++{ ++ pts = m_decoderPts; ++ droppedPics = m_droppedPics; ++ m_droppedPics = 0; ++ CLog::Log(LOGDEBUG, "%s::%s - pts:%.0f droppedPics:%d", CLASSNAME, __func__, pts, droppedPics); ++ return true; ++} ++ + // DecoderFillBufferDone -- OpenMax output buffer has been filled + OMX_ERRORTYPE COpenMaxVideo::DecoderFillBufferDone( + OMX_HANDLETYPE hComponent, + OMX_BUFFERHEADERTYPE* pBuffer) + { + COpenMaxVideoBuffer *buffer = (COpenMaxVideoBuffer*)pBuffer->pAppPrivate; ++ bool skipDeinterlaceFields = m_skipDeinterlaceFields || g_windowManager.HasDialogOnScreen(); + + #if defined(OMX_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - %p (%p,%p) buffer_size(%u), pts:%.3f flags:%x", +- CLASSNAME, __func__, buffer, pBuffer, buffer->omx_buffer, pBuffer->nFilledLen, (double)FromOMXTime(buffer->omx_buffer->nTimeStamp)*1e-6, buffer->omx_buffer->nFlags); ++ CLog::Log(LOGDEBUG, "%s::%s - %p (%p,%p) buffer_size(%u), pts:%.3f flags:%x frame:%d win:%x", ++ CLASSNAME, __func__, buffer, pBuffer, buffer->omx_buffer, pBuffer->nFilledLen, (double)FromOMXTime(buffer->omx_buffer->nTimeStamp)*1e-6, buffer->omx_buffer->nFlags, (int)buffer->omx_buffer->pMarkData, skipDeinterlaceFields); + #endif + + assert(!(buffer->omx_buffer->nFlags & (OMX_BUFFERFLAG_DECODEONLY | OMX_BUFFERFLAG_DROPPED))); +- // queue output omx buffer to ready list. +- pthread_mutex_lock(&m_omx_output_mutex); +- buffer->m_aspect_ratio = m_aspect_ratio; +- m_omx_output_ready.push(buffer); +- pthread_mutex_unlock(&m_omx_output_mutex); + ++ ++ // flags have OMX_BUFFERFLAG_FIRST_FIELD set if this is a direct result of a submitted frame, ++ // clear for second field of deinterlaced frame. They are zero when frame is returned due to a flush. ++#ifdef DTS_QUEUE ++ if ((!m_deinterlace || (buffer->omx_buffer->nFlags & OMX_BUFFERFLAG_FIRST_FIELD)) && buffer->omx_buffer->nFlags) ++ { ++ pthread_mutex_lock(&m_omx_output_mutex); ++ assert(!m_dts_queue.empty()); ++ buffer->dts = m_dts_queue.front(); ++ m_dts_queue.pop(); ++ pthread_mutex_unlock(&m_omx_output_mutex); ++ } ++#endif ++ if (m_drop_state || (m_deinterlace && skipDeinterlaceFields && !(buffer->omx_buffer->nFlags & OMX_BUFFERFLAG_FIRST_FIELD))) ++ { ++ ReturnOpenMaxBuffer(buffer); ++ } ++ else ++ { ++ buffer->m_aspect_ratio = m_aspect_ratio; ++ pthread_mutex_lock(&m_omx_output_mutex); ++ m_omx_output_ready.push(buffer); ++ pthread_mutex_unlock(&m_omx_output_mutex); ++ } + return OMX_ErrorNone; + } + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h +index f234f6d..adf53b5 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h +@@ -57,6 +57,7 @@ class COpenMaxVideoBuffer + int height; + float m_aspect_ratio; + int index; ++ double dts; + + // used for egl based rendering if active + EGLImageKHR egl_image; +@@ -87,6 +88,7 @@ class COpenMaxVideo + virtual unsigned GetAllowedReferences() { return 2; } + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return (const char*)m_pFormatName; } ++ virtual bool GetCodecStats(double &pts, int &droppedPics); + + // OpenMax decoder callback routines. + OMX_ERRORTYPE DecoderFillBufferDone(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE* pBuffer); +@@ -142,10 +144,11 @@ class COpenMaxVideo + + bool m_deinterlace; + EDEINTERLACEMODE m_deinterlace_request; +- bool m_deinterlace_second_field; +- + bool m_startframe; +- ++ unsigned int m_decode_frame_number; ++ double m_decoderPts; ++ unsigned int m_droppedPics; ++ bool m_skipDeinterlaceFields; + bool PortSettingsChanged(); + bool SendDecoderConfig(uint8_t *extradata, int extrasize); + bool NaluFormatStartCodes(enum AVCodecID codec, uint8_t *extradata, int extrasize); +-- +1.9.3 + + +From bacb1dad355250244121f44eb351435a83473b0d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 11 May 2014 16:13:45 +0100 +Subject: [PATCH 87/88] [rbp] Add config.txt settings to log file + +--- + xbmc/linux/RBP.cpp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 49dcbb8..9a5e9cb 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -79,11 +79,17 @@ bool CRBP::Initialize() + + void CRBP::LogFirmwareVerison() + { +- char response[160]; ++ char response[1024]; + m_DllBcmHost->vc_gencmd(response, sizeof response, "version"); + response[sizeof(response) - 1] = '\0'; + CLog::Log(LOGNOTICE, "Raspberry PI firmware version: %s", response); + CLog::Log(LOGNOTICE, "ARM mem: %dMB GPU mem: %dMB MPG2:%d WVC1:%d", m_arm_mem, m_gpu_mem, m_codec_mpg2_enabled, m_codec_wvc1_enabled); ++ m_DllBcmHost->vc_gencmd(response, sizeof response, "get_config int"); ++ response[sizeof(response) - 1] = '\0'; ++ CLog::Log(LOGNOTICE, "Config:\n%s", response); ++ m_DllBcmHost->vc_gencmd(response, sizeof response, "get_config str"); ++ response[sizeof(response) - 1] = '\0'; ++ CLog::Log(LOGNOTICE, "Config:\n%s", response); + } + + void CRBP::GetDisplaySize(int &width, int &height) +-- +1.9.3 + + +From 7e618ab0d68cc203afc4b540a1c73ab59e85599a Mon Sep 17 00:00:00 2001 +From: Alex Deryskyba +Date: Thu, 8 May 2014 18:54:54 +0300 +Subject: [PATCH 88/88] Reset display region when video stream properties + change + +Currently when video stream properties change, e.g. when user switches to next or previous Live TV channel, and has the same frame width and height, the COMXVideo::SetVideoRect() method is not called, causing the video to play back with default source and destination rectangles, not respecting the user-defined zoom settings. + +This commit fixes the issue. +--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 61b884e..eaa1e34 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -781,6 +781,9 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f + return; + } + ++ m_src_rect.SetRect(0, 0, 0, 0); ++ m_dst_rect.SetRect(0, 0, 0, 0); ++ + g_renderManager.RegisterRenderUpdateCallBack((const void*)this, RenderUpdateCallBack); + } + +-- +1.9.3