From d2e11342fa3cc311e5011d0b2ce03907ac8c0d3d Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 7 Jul 2014 15:51:28 +0200 Subject: [PATCH] projects/RPi/patches/xbmc-master: update RPi support patch Signed-off-by: Stephan Raue --- .../xbmc-master/xbmc-master-newclock3.patch | 3619 +++++++++++------ 1 file changed, 2411 insertions(+), 1208 deletions(-) diff --git a/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch b/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch index 4d28fc7311..42e1b668fe 100644 --- a/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch +++ b/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch @@ -1,899 +1,8 @@ -From 35419e975b9616f614faf987889361755b9a49d9 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Thu, 14 Nov 2013 19:48:41 +0000 -Subject: [PATCH 01/82] 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 -produced a vector of operands (leaf nodes) and operators in postfix -(reverse-Polish) form, and evaluated all leaf nodes every time the expression -was evaluated. But this ignores the fact that in many cases, once one operand -of an AND or OR operation has been evaluated, there is no need to evaluate the -other operand because its value can have no effect on the ultimate result. It -is also worth noting that AND and OR operations are associative, meaning they -can be rearranged at runtime to better suit the selected skin. - -This patch rewrites the expression parsing and evaluation code. Now the -internal repreentation is in the form of a tree where leaf nodes represent a -single infobool, and branch nodes represent either an AND or an OR operation -on two or more child nodes. - -Expressions are rewritten at parse time into a form which favours the -formation of groups of associative nodes. These groups are then reordered at -evaluation time such that nodes whose value renders the evaluation of the -remainder of the group unnecessary tend to be evaluated first (these are -true nodes for OR subexpressions, or false nodes for AND subexpressions). -The end effect is to minimise the number of leaf nodes that need to be -evaluated in order to determine the value of the expression. The runtime -adaptability has the advantage of not being customised for any particular skin. - -The modifications to the expression at parse time fall into two groups: -1) Moving logical NOTs so that they are only applied to leaf nodes. - For example, rewriting ![A+B]|C as !A|!B|C allows reordering such that - any of the three leaves can be evaluated first. -2) Combining adjacent AND or OR operations such that each path from the root - to a leaf encounters a strictly alternating pattern of AND and OR - operations. So [A|B]|[C|D+[[E|F]|G] becomes A|B|C|[D+[E|F|G]]. - -I measured the effect while the Videos window of the default skin was open -(but idle) on a Raspberry Pi, and this reduced the CPU usage by 2.8% from -41.9% to 39.1%: - - Before After - Mean StdDev Mean StdDev Confidence Change -IdleCPU% 41.9 0.5 39.1 0.9 100.0% +7.0% ---- - xbmc/interfaces/info/InfoExpression.cpp | 313 +++++++++++++++++++++----------- - xbmc/interfaces/info/InfoExpression.h | 63 ++++++- - 2 files changed, 269 insertions(+), 107 deletions(-) - -diff --git a/xbmc/interfaces/info/InfoExpression.cpp b/xbmc/interfaces/info/InfoExpression.cpp -index f4d32c1..db461dd 100644 ---- a/xbmc/interfaces/info/InfoExpression.cpp -+++ b/xbmc/interfaces/info/InfoExpression.cpp -@@ -22,6 +22,9 @@ - #include - #include "utils/log.h" - #include "GUIInfoManager.h" -+#include -+#include -+#include - - using namespace std; - using namespace INFO; -@@ -40,21 +43,89 @@ void InfoSingle::Update(const CGUIListItem *item) - InfoExpression::InfoExpression(const std::string &expression, int context) - : InfoBool(expression, context) - { -- Parse(expression); -+ if (!Parse(expression)) -+ CLog::Log(LOGERROR, "Error parsing boolean expression %s", expression.c_str()); - } - - void InfoExpression::Update(const CGUIListItem *item) - { -- Evaluate(item, m_value); -+ m_value = m_expression_tree->Evaluate(item); - } - --#define OPERATOR_LB 5 --#define OPERATOR_RB 4 --#define OPERATOR_NOT 3 --#define OPERATOR_AND 2 --#define OPERATOR_OR 1 -+/* Expressions are rewritten at parse time into a form which favours the -+ * formation of groups of associative nodes. These groups are then reordered at -+ * evaluation time such that nodes whose value renders the evaluation of the -+ * remainder of the group unnecessary tend to be evaluated first (these are -+ * true nodes for OR subexpressions, or false nodes for AND subexpressions). -+ * The end effect is to minimise the number of leaf nodes that need to be -+ * evaluated in order to determine the value of the expression. The runtime -+ * adaptability has the advantage of not being customised for any particular skin. -+ * -+ * The modifications to the expression at parse time fall into two groups: -+ * 1) Moving logical NOTs so that they are only applied to leaf nodes. -+ * For example, rewriting ![A+B]|C as !A|!B|C allows reordering such that -+ * any of the three leaves can be evaluated first. -+ * 2) Combining adjacent AND or OR operations such that each path from the root -+ * to a leaf encounters a strictly alternating pattern of AND and OR -+ * operations. So [A|B]|[C|D+[[E|F]|G] becomes A|B|C|[D+[E|F|G]]. -+ */ -+ -+bool InfoExpression::InfoLeaf::Evaluate(const CGUIListItem *item) -+{ -+ return m_invert ^ m_info->Get(item); -+} - --short InfoExpression::GetOperator(const char ch) const -+InfoExpression::InfoAssociativeGroup::InfoAssociativeGroup( -+ bool and_not_or, -+ const InfoSubexpressionPtr &left, -+ const InfoSubexpressionPtr &right) -+ : m_and_not_or(and_not_or) -+{ -+ AddChild(right); -+ AddChild(left); -+} -+ -+void InfoExpression::InfoAssociativeGroup::AddChild(const InfoSubexpressionPtr &child) -+{ -+ m_children.push_front(child); // largely undoes the effect of parsing right-associative -+} -+ -+void InfoExpression::InfoAssociativeGroup::Merge(InfoAssociativeGroup *other) -+{ -+ m_children.splice(m_children.end(), other->m_children); -+} -+ -+bool InfoExpression::InfoAssociativeGroup::Evaluate(const CGUIListItem *item) -+{ -+ /* Handle either AND or OR by using the relation -+ * A AND B == !(!A OR !B) -+ * to convert ANDs into ORs -+ */ -+ std::list::iterator last = m_children.end(); -+ std::list::iterator it = m_children.begin(); -+ bool result = m_and_not_or ^ (*it)->Evaluate(item); -+ while (!result && ++it != last) -+ { -+ result = m_and_not_or ^ (*it)->Evaluate(item); -+ if (result) -+ { -+ /* Move this child to the head of the list so we evaluate faster next time */ -+ InfoSubexpressionPtr p = *it; -+ m_children.erase(it); -+ m_children.push_front(p); -+ } -+ } -+ return m_and_not_or ^ result; -+} -+ -+/* Expressions are parsed using the shunting-yard algorithm. Binary operators -+ * (AND/OR) are treated as right-associative so that we don't need to make a -+ * special case for the unary NOT operator. This has no effect upon the answers -+ * generated, though the initial sequence of evaluation of leaves may be -+ * different from what you might expect. -+ */ -+ -+InfoExpression::operator_t InfoExpression::GetOperator(char ch) - { - if (ch == '[') - return OPERATOR_LB; -@@ -67,122 +138,160 @@ short InfoExpression::GetOperator(const char ch) const - else if (ch == '|') - return OPERATOR_OR; - else -- return 0; -+ return OPERATOR_NONE; - } - --void InfoExpression::Parse(const std::string &expression) -+void InfoExpression::OperatorPop(std::stack &operator_stack, bool &invert, std::stack &node_types, std::stack &nodes) - { -- stack operators; -- std::string operand; -- for (unsigned int i = 0; i < expression.size(); i++) -+ operator_t op2 = operator_stack.top(); -+ operator_stack.pop(); -+ if (op2 == OPERATOR_NOT) - { -- if (GetOperator(expression[i])) -+ invert = !invert; -+ } -+ else -+ { -+ // At this point, it can only be OPERATOR_AND or OPERATOR_OR -+ if (invert) -+ op2 = (operator_t) (OPERATOR_AND ^ OPERATOR_OR ^ op2); -+ node_type_t new_type = op2 == OPERATOR_AND ? NODE_AND : NODE_OR; -+ -+ InfoSubexpressionPtr right = nodes.top(); -+ nodes.pop(); -+ InfoSubexpressionPtr left = nodes.top(); -+ -+ node_type_t right_type = node_types.top(); -+ node_types.pop(); -+ node_type_t left_type = node_types.top(); -+ -+ // Combine associative operations into the same node where possible -+ if (left_type == new_type && right_type == new_type) -+ (static_cast(left.get()))->Merge(static_cast(right.get())); -+ else if (left_type == new_type) -+ (static_cast(left.get()))->AddChild(right); -+ else - { -- // cleanup any operand, translate and put into our expression list -- if (!operand.empty()) -+ nodes.pop(); -+ node_types.pop(); -+ if (right_type == new_type) - { -- InfoPtr info = g_infoManager.Register(operand, m_context); -- if (info) -- { -- m_listItemDependent |= info->ListItemDependent(); -- m_postfix.push_back(m_operands.size()); -- m_operands.push_back(info); -- } -- operand.clear(); -+ (static_cast(right.get()))->AddChild(left); -+ nodes.push(right); - } -- // handle closing parenthesis -- if (expression[i] == ']') -- { -- while (!operators.empty()) -- { -- char oper = operators.top(); -- operators.pop(); -+ else -+ nodes.push(boost::make_shared(new_type == NODE_AND, left, right)); -+ node_types.push(new_type); -+ } -+ } -+} -+ -+void InfoExpression::ProcessOperator(operator_t op, std::stack &operator_stack, bool &invert, std::stack &node_types, std::stack &nodes) -+{ -+ // Handle any higher-priority stacked operators, except when the new operator is left-bracket. -+ // For a right-bracket, this will stop with the matching left-bracket at the top of the operator stack. -+ if (op != OPERATOR_LB) -+ { -+ while (operator_stack.size() > 0 && operator_stack.top() > op) -+ OperatorPop(operator_stack, invert, node_types, nodes); -+ } -+ if (op == OPERATOR_RB) -+ operator_stack.pop(); // remove the matching left-bracket -+ else -+ operator_stack.push(op); -+ if (op == OPERATOR_NOT) -+ invert = !invert; -+} - -- if (oper == '[') -- break; -+bool InfoExpression::ProcessOperand(std::string &operand, bool invert, std::stack &node_types, std::stack &nodes) -+{ -+ InfoPtr info = g_infoManager.Register(operand, m_context); -+ if (!info) -+ return false; -+ m_listItemDependent |= info->ListItemDependent(); -+ nodes.push(boost::make_shared(info, invert)); -+ node_types.push(NODE_LEAF); -+ operand.clear(); -+ return true; -+} - -- m_postfix.push_back(-GetOperator(oper)); // negative denotes operator -- } -+bool InfoExpression::Parse(const std::string &expression) -+{ -+ const char *s = expression.c_str(); -+ std::string operand; -+ std::stack operator_stack; -+ bool invert = false; -+ std::stack node_types; -+ std::stack nodes; -+ // The next two are for syntax-checking purposes -+ bool after_binaryoperator = true; -+ int bracket_count = 0; -+ -+ char c; -+ // Skip leading whitespace - don't want it to count as an operand if that's all there is -+ do -+ { -+ c = *s++; -+ } while (c == ' ' || c == '\t' || c == '\r' || c == '\n'); -+ s--; -+ while ((c = *s++) != '\0') -+ { -+ operator_t op; -+ if ((op = GetOperator(c)) != OPERATOR_NONE) -+ { -+ // Character is an operator -+ if ((!after_binaryoperator && (c == '!' || c == '[')) || -+ (after_binaryoperator && (c == ']' || c == '+' || c == '|'))) -+ { -+ CLog::Log(LOGERROR, "Misplaced %c", c); -+ return false; - } -- else -+ if (c == '[') -+ bracket_count++; -+ else if (c == ']' && bracket_count-- == 0) -+ { -+ CLog::Log(LOGERROR, "Unmatched ]"); -+ return false; -+ } -+ if (operand.size() > 0 && !ProcessOperand(operand, invert, node_types, nodes)) - { -- // all other operators we pop off the stack any operator -- // that has a higher priority than the one we have. -- while (!operators.empty() && GetOperator(operators.top()) > GetOperator(expression[i])) -- { -- // only handle parenthesis once they're closed. -- if (operators.top() == '[' && expression[i] != ']') -- break; -- -- m_postfix.push_back(-GetOperator(operators.top())); // negative denotes operator -- operators.pop(); -- } -- operators.push(expression[i]); -+ CLog::Log(LOGERROR, "Bad operand '%s'", operand.c_str()); -+ return false; - } -+ ProcessOperator(op, operator_stack, invert, node_types, nodes); -+ if (c == '+' || c == '|') -+ after_binaryoperator = true; -+ // Skip trailing whitespace - don't want it to count as an operand if that's all there is -+ do -+ { -+ c = *s++; -+ } while (c == ' ' || c == '\t' || c == '\r' || c == '\n'); -+ s--; - } - else - { -- operand += expression[i]; -+ // Character is part of operand -+ operand += c; -+ after_binaryoperator = false; - } - } -- -- if (!operand.empty()) -+ if (bracket_count > 0) - { -- InfoPtr info = g_infoManager.Register(operand, m_context); -- if (info) -- { -- m_listItemDependent |= info->ListItemDependent(); -- m_postfix.push_back(m_operands.size()); -- m_operands.push_back(info); -- } -+ CLog::Log(LOGERROR, "Unmatched ["); -+ return false; - } -- -- // finish up by adding any operators -- while (!operators.empty()) -+ if (after_binaryoperator) - { -- m_postfix.push_back(-GetOperator(operators.top())); // negative denotes operator -- operators.pop(); -+ CLog::Log(LOGERROR, "Missing operand"); -+ return false; - } -- -- // test evaluate -- bool test; -- if (!Evaluate(NULL, test)) -- CLog::Log(LOGERROR, "Error evaluating boolean expression %s", expression.c_str()); --} -- --bool InfoExpression::Evaluate(const CGUIListItem *item, bool &result) --{ -- stack save; -- for (vector::const_iterator it = m_postfix.begin(); it != m_postfix.end(); ++it) -+ if (operand.size() > 0 && !ProcessOperand(operand, invert, node_types, nodes)) - { -- short expr = *it; -- if (expr == -OPERATOR_NOT) -- { // NOT the top item on the stack -- if (save.empty()) return false; -- bool expr = save.top(); -- save.pop(); -- save.push(!expr); -- } -- else if (expr == -OPERATOR_AND) -- { // AND the top two items on the stack -- if (save.size() < 2) return false; -- bool right = save.top(); save.pop(); -- bool left = save.top(); save.pop(); -- save.push(left && right); -- } -- else if (expr == -OPERATOR_OR) -- { // OR the top two items on the stack -- if (save.size() < 2) return false; -- bool right = save.top(); save.pop(); -- bool left = save.top(); save.pop(); -- save.push(left || right); -- } -- else if (expr >= 0) // operand -- save.push(m_operands[expr]->Get(item)); -- } -- if (save.size() != 1) -+ CLog::Log(LOGERROR, "Bad operand '%s'", operand.c_str()); - return false; -- result = save.top(); -+ } -+ while (operator_stack.size() > 0) -+ OperatorPop(operator_stack, invert, node_types, nodes); -+ -+ m_expression_tree = nodes.top(); - return true; - } -- -diff --git a/xbmc/interfaces/info/InfoExpression.h b/xbmc/interfaces/info/InfoExpression.h -index 4e0faee..0a91399 100644 ---- a/xbmc/interfaces/info/InfoExpression.h -+++ b/xbmc/interfaces/info/InfoExpression.h -@@ -21,6 +21,8 @@ - #pragma once - - #include -+#include -+#include - #include "InfoBool.h" - - class CGUIListItem; -@@ -50,12 +52,63 @@ class InfoExpression : public InfoBool - - virtual void Update(const CGUIListItem *item); - private: -- void Parse(const std::string &expression); -- bool Evaluate(const CGUIListItem *item, bool &result); -- short GetOperator(const char ch) const; -+ typedef enum -+ { -+ OPERATOR_NONE = 0, -+ OPERATOR_LB, // 1 -+ OPERATOR_RB, // 2 -+ OPERATOR_OR, // 3 -+ OPERATOR_AND, // 4 -+ OPERATOR_NOT, // 5 -+ } operator_t; - -- std::vector m_postfix; ///< the postfix form of the expression (operators and operand indicies) -- std::vector m_operands; ///< the operands in the expression -+ typedef enum -+ { -+ NODE_LEAF, -+ NODE_AND, -+ NODE_OR, -+ } node_type_t; -+ -+ // An abstract base class for nodes in the expression tree -+ class InfoSubexpression -+ { -+ public: -+ virtual ~InfoSubexpression(void) {}; // so we can destruct derived classes using a pointer to their base class -+ virtual bool Evaluate(const CGUIListItem *item) = 0; -+ }; -+ -+ typedef boost::shared_ptr InfoSubexpressionPtr; -+ -+ // A leaf node in the expression tree -+ class InfoLeaf : public InfoSubexpression -+ { -+ public: -+ InfoLeaf(InfoPtr info, bool invert) : m_info(info), m_invert(invert) {}; -+ virtual bool Evaluate(const CGUIListItem *item); -+ private: -+ InfoPtr m_info; -+ bool m_invert; -+ }; -+ -+ // A branch node in the expression tree -+ class InfoAssociativeGroup : public InfoSubexpression -+ { -+ public: -+ InfoAssociativeGroup(bool and_not_or, const InfoSubexpressionPtr &left, const InfoSubexpressionPtr &right); -+ void AddChild(const InfoSubexpressionPtr &child); -+ void Merge(InfoAssociativeGroup *other); -+ virtual bool Evaluate(const CGUIListItem *item); -+ private: -+ bool m_and_not_or; -+ std::list m_children; -+ }; -+ -+ static operator_t GetOperator(char ch); -+ static void OperatorPop(std::stack &operator_stack, bool &invert, std::stack &node_types, std::stack &nodes); -+ static void ProcessOperator(operator_t op, std::stack &operator_stack, bool &invert, std::stack &node_types, std::stack &nodes); -+ bool ProcessOperand(std::string &operand, bool invert, std::stack &node_types, std::stack &nodes); -+ bool Parse(const std::string &expression); -+ InfoSubexpressionPtr m_expression_tree; - }; - - }; --- -1.9.3 - - -From 3ea2259e88b2b1b5036b6db81ec7b16bf505497f Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Mon, 24 Mar 2014 22:26:21 +0000 -Subject: [PATCH 02/82] 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. - ---- - xbmc/interfaces/info/InfoExpression.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/interfaces/info/InfoExpression.cpp b/xbmc/interfaces/info/InfoExpression.cpp -index db461dd..7c54064 100644 ---- a/xbmc/interfaces/info/InfoExpression.cpp -+++ b/xbmc/interfaces/info/InfoExpression.cpp -@@ -44,7 +44,10 @@ InfoExpression::InfoExpression(const std::string &expression, int context) - : InfoBool(expression, context) - { - if (!Parse(expression)) -+ { - CLog::Log(LOGERROR, "Error parsing boolean expression %s", expression.c_str()); -+ m_expression_tree = boost::make_shared(g_infoManager.Register("false", 0), false); -+ } - } - - void InfoExpression::Update(const CGUIListItem *item) --- -1.9.3 - - -From 89f7abbd454aa88156ba54da164bde33992f7d5b Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Tue, 26 Nov 2013 20:09:48 +0000 -Subject: [PATCH 03/82] Add caching of infolabels - -The functions CGUIInfoLabel::GetLabel and CGUIInfoLabel::GetItemLabel take -a number of strings returned from CGUIInfoManager::GetImage or -CGUIInfoManager::GetLabel, and combine them with various constant strings -which were determined during CGUIInfoLabel::Parse. - -Rather than perform all the string operations on every call, this patch -changes to use a two-pass process: first it queries all the GetImage/GetLabel -strings, and then only if at least one of them has changed does it bother -rebuilding the resultant string - otherwise it re-uses the copy built on a -preceding call. - -CGUIInfoLabel::GetLabel/GetItemLabel are also changed to return string -references, rather than forcing an additional string copy. - -I have measured the effect while the Videos window of the default skin was -open (but idle) on a Raspberry Pi, and this reduced the CPU usage by 0.8% -from 36.2% to 35.4%: - - Before After - Mean StdDev Mean StdDev Confidence Change -IdleCPU% 36.2 0.5 35.4 0.5 99.9% +2.2% ---- - xbmc/guilib/GUIInfoTypes.cpp | 102 +++++++++++++++++++++++++++++++++---------- - xbmc/guilib/GUIInfoTypes.h | 11 ++++- - 2 files changed, 87 insertions(+), 26 deletions(-) - -diff --git a/xbmc/guilib/GUIInfoTypes.cpp b/xbmc/guilib/GUIInfoTypes.cpp -index 6977e0f..d78c26a 100644 ---- a/xbmc/guilib/GUIInfoTypes.cpp -+++ b/xbmc/guilib/GUIInfoTypes.cpp -@@ -136,37 +136,64 @@ void CGUIInfoLabel::SetLabel(const CStdString &label, const CStdString &fallback - Parse(label, context); - } - --CStdString CGUIInfoLabel::GetLabel(int contextWindow, bool preferImage, CStdString *fallback /*= NULL*/) const -+const std::string &CGUIInfoLabel::GetLabel(int contextWindow, bool preferImage, CStdString *fallback /*= NULL*/) const - { -- CStdString label; -- for (unsigned int i = 0; i < m_info.size(); i++) -+ for (unsigned int i = 0, j = 0; i < m_info.size(); i++) - { - const CInfoPortion &portion = m_info[i]; - if (portion.m_info) - { -- CStdString infoLabel; -+ std::string infoLabel; - if (preferImage) - infoLabel = g_infoManager.GetImage(portion.m_info, contextWindow, fallback); - if (infoLabel.empty()) - infoLabel = g_infoManager.GetLabel(portion.m_info, contextWindow, fallback); -- if (!infoLabel.empty()) -- label += portion.GetLabel(infoLabel); -+ if (j == m_labelPortions.size()) -+ m_labelPortions.push_back(infoLabel); -+ else if (infoLabel != m_labelPortions[j]) -+ { -+ m_labelPortions[j] = infoLabel; -+ m_labelDirty = true; -+ } -+ j++; - } -- else -- { // no info, so just append the prefix -- label += portion.m_prefix; -+ } -+ if (m_labelDirty) -+ { -+ m_label.clear(); -+ for (unsigned int i = 0, j= 0; i < m_info.size(); i++) -+ { -+ const CInfoPortion &portion = m_info[i]; -+ if (portion.m_info) -+ { -+ if (!m_labelPortions[j].empty()) -+ m_label += portion.GetLabel(m_labelPortions[j]); -+ j++; -+ } -+ else -+ { // no info, so just append the prefix -+ m_label += portion.m_prefix; -+ } - } -+ if (m_label.empty()) // empty label, use the fallback -+ m_label = m_fallback; -+ m_labelDirty = false; - } -- if (label.empty()) // empty label, use the fallback -- return m_fallback; -- return label; -+ return m_label; - } - --CStdString CGUIInfoLabel::GetItemLabel(const CGUIListItem *item, bool preferImages, CStdString *fallback /*= NULL*/) const -+const std::string &CGUIInfoLabel::GetItemLabel(const CGUIListItem *item, bool preferImages, CStdString *fallback /*= NULL*/) const - { -- if (!item->IsFileItem()) return ""; -- CStdString label; -- for (unsigned int i = 0; i < m_info.size(); i++) -+ if (!item->IsFileItem()) -+ { -+ if (m_itemLabelDirty) -+ { -+ m_itemLabel = ""; -+ m_itemLabelDirty = false; -+ } -+ return m_itemLabel; -+ } -+ for (unsigned int i = 0, j = 0; i < m_info.size(); i++) - { - const CInfoPortion &portion = m_info[i]; - if (portion.m_info) -@@ -176,17 +203,38 @@ CStdString CGUIInfoLabel::GetItemLabel(const CGUIListItem *item, bool preferImag - infoLabel = g_infoManager.GetItemImage((const CFileItem *)item, portion.m_info, fallback); - else - infoLabel = g_infoManager.GetItemLabel((const CFileItem *)item, portion.m_info, fallback); -- if (!infoLabel.empty()) -- label += portion.GetLabel(infoLabel); -+ if (j == m_itemLabelPortions.size()) -+ m_itemLabelPortions.push_back(infoLabel); -+ else if (infoLabel != m_itemLabelPortions[j]) -+ { -+ m_itemLabelPortions[j] = infoLabel; -+ m_itemLabelDirty = true; -+ } -+ j++; - } -- else -- { // no info, so just append the prefix -- label += portion.m_prefix; -+ } -+ if (m_itemLabelDirty) -+ { -+ m_itemLabel.clear(); -+ for (unsigned int i = 0, j = 0; i < m_info.size(); i++) -+ { -+ const CInfoPortion &portion = m_info[i]; -+ if (portion.m_info) -+ { -+ if (!m_itemLabelPortions[j].empty()) -+ m_itemLabel += portion.GetLabel(m_itemLabelPortions[j]); -+ j++; -+ } -+ else -+ { // no info, so just append the prefix -+ m_itemLabel += portion.m_prefix; -+ } - } -+ if (m_itemLabel.empty()) -+ m_itemLabel = m_fallback; -+ m_itemLabelDirty = false; - } -- if (label.empty()) -- return m_fallback; -- return label; -+ return m_itemLabel; - } - - bool CGUIInfoLabel::IsEmpty() const -@@ -277,6 +325,12 @@ const static infoformat infoformatmap[] = {{ "$INFO[", FORMATINFO }, - void CGUIInfoLabel::Parse(const CStdString &label, int context) - { - m_info.clear(); -+ m_labelDirty = true; -+ m_label.clear(); -+ m_labelPortions.clear(); -+ m_itemLabelDirty = true; -+ m_itemLabel.clear(); -+ m_itemLabelPortions.clear(); - // Step 1: Replace all $LOCALIZE[number] with the real string - CStdString work = ReplaceLocalize(label); - // Step 2: Replace all $ADDON[id number] with the real string -diff --git a/xbmc/guilib/GUIInfoTypes.h b/xbmc/guilib/GUIInfoTypes.h -index 8c1c1dc..418b2c4 100644 ---- a/xbmc/guilib/GUIInfoTypes.h -+++ b/xbmc/guilib/GUIInfoTypes.h -@@ -83,7 +83,7 @@ class CGUIInfoLabel - \param fallback if non-NULL, is set to an alternate value to use should the actual value be not appropriate. Defaults to NULL. - \return label (or image). - */ -- CStdString GetLabel(int contextWindow, bool preferImage = false, CStdString *fallback = NULL) const; -+ const std::string &GetLabel(int contextWindow, bool preferImage = false, CStdString *fallback = NULL) const; - - /*! - \brief Gets a label (or image) for a given listitem from the info manager. -@@ -92,7 +92,7 @@ class CGUIInfoLabel - \param fallback if non-NULL, is set to an alternate value to use should the actual value be not appropriate. Defaults to NULL. - \return label (or image). - */ -- CStdString GetItemLabel(const CGUIListItem *item, bool preferImage = false, CStdString *fallback = NULL) const; -+ const std::string &GetItemLabel(const CGUIListItem *item, bool preferImage = false, CStdString *fallback = NULL) const; - - bool IsConstant() const; - bool IsEmpty() const; -@@ -132,6 +132,13 @@ class CGUIInfoLabel - - CStdString m_fallback; - std::vector m_info; -+ -+ mutable bool m_labelDirty; -+ mutable std::string m_label; -+ mutable std::vector m_labelPortions; -+ mutable bool m_itemLabelDirty; -+ mutable std::string m_itemLabel; -+ mutable std::vector m_itemLabelPortions; - }; - - #endif --- -1.9.3 - - -From 431ad06ca8c0299645f6fc79a6960199589748c7 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Tue, 10 Dec 2013 01:12:31 +0000 -Subject: [PATCH 04/82] De-duplication of string cache for non-item and item - labels - ---- - xbmc/guilib/GUIInfoTypes.cpp | 50 +++++++++++++++++++++++++------------------- - xbmc/guilib/GUIInfoTypes.h | 4 +--- - 2 files changed, 29 insertions(+), 25 deletions(-) - -diff --git a/xbmc/guilib/GUIInfoTypes.cpp b/xbmc/guilib/GUIInfoTypes.cpp -index d78c26a..8bd131f 100644 ---- a/xbmc/guilib/GUIInfoTypes.cpp -+++ b/xbmc/guilib/GUIInfoTypes.cpp -@@ -121,7 +121,7 @@ void CGUIInfoColor::Parse(const CStdString &label, int context) - m_color = g_colorManager.GetColor(label); - } - --CGUIInfoLabel::CGUIInfoLabel() -+CGUIInfoLabel::CGUIInfoLabel() : m_labelDirty(true) - { - } - -@@ -178,7 +178,10 @@ const std::string &CGUIInfoLabel::GetLabel(int contextWindow, bool preferImage, - if (m_label.empty()) // empty label, use the fallback - m_label = m_fallback; - m_labelDirty = false; -+ m_isLabelOfListItem = false; - } -+ else -+ assert(m_isLabelOfListItem == false); - return m_label; - } - -@@ -186,12 +189,15 @@ const std::string &CGUIInfoLabel::GetItemLabel(const CGUIListItem *item, bool pr - { - if (!item->IsFileItem()) - { -- if (m_itemLabelDirty) -+ if (m_labelDirty) - { -- m_itemLabel = ""; -- m_itemLabelDirty = false; -+ m_label = ""; -+ m_labelDirty = false; -+ m_isLabelOfListItem = true; - } -- return m_itemLabel; -+ else -+ assert(m_isLabelOfListItem == true); -+ return m_label; - } - for (unsigned int i = 0, j = 0; i < m_info.size(); i++) - { -@@ -203,38 +209,41 @@ const std::string &CGUIInfoLabel::GetItemLabel(const CGUIListItem *item, bool pr - infoLabel = g_infoManager.GetItemImage((const CFileItem *)item, portion.m_info, fallback); - else - infoLabel = g_infoManager.GetItemLabel((const CFileItem *)item, portion.m_info, fallback); -- if (j == m_itemLabelPortions.size()) -- m_itemLabelPortions.push_back(infoLabel); -- else if (infoLabel != m_itemLabelPortions[j]) -+ if (j == m_labelPortions.size()) -+ m_labelPortions.push_back(infoLabel); -+ else if (infoLabel != m_labelPortions[j]) - { -- m_itemLabelPortions[j] = infoLabel; -- m_itemLabelDirty = true; -+ m_labelPortions[j] = infoLabel; -+ m_labelDirty = true; - } - j++; - } - } -- if (m_itemLabelDirty) -+ if (m_labelDirty) - { -- m_itemLabel.clear(); -+ m_label.clear(); - for (unsigned int i = 0, j = 0; i < m_info.size(); i++) - { - const CInfoPortion &portion = m_info[i]; - if (portion.m_info) - { -- if (!m_itemLabelPortions[j].empty()) -- m_itemLabel += portion.GetLabel(m_itemLabelPortions[j]); -+ if (!m_labelPortions[j].empty()) -+ m_label += portion.GetLabel(m_labelPortions[j]); - j++; - } - else - { // no info, so just append the prefix -- m_itemLabel += portion.m_prefix; -+ m_label += portion.m_prefix; - } - } -- if (m_itemLabel.empty()) -- m_itemLabel = m_fallback; -- m_itemLabelDirty = false; -+ if (m_label.empty()) -+ m_label = m_fallback; -+ m_labelDirty = false; -+ m_isLabelOfListItem = true; - } -- return m_itemLabel; -+ else -+ assert(m_isLabelOfListItem == true); -+ return m_label; - } - - bool CGUIInfoLabel::IsEmpty() const -@@ -328,9 +337,6 @@ void CGUIInfoLabel::Parse(const CStdString &label, int context) - m_labelDirty = true; - m_label.clear(); - m_labelPortions.clear(); -- m_itemLabelDirty = true; -- m_itemLabel.clear(); -- m_itemLabelPortions.clear(); - // Step 1: Replace all $LOCALIZE[number] with the real string - CStdString work = ReplaceLocalize(label); - // Step 2: Replace all $ADDON[id number] with the real string -diff --git a/xbmc/guilib/GUIInfoTypes.h b/xbmc/guilib/GUIInfoTypes.h -index 418b2c4..6d9ebf7 100644 ---- a/xbmc/guilib/GUIInfoTypes.h -+++ b/xbmc/guilib/GUIInfoTypes.h -@@ -133,12 +133,10 @@ class CGUIInfoLabel - CStdString m_fallback; - std::vector m_info; - -+ mutable bool m_isLabelOfListItem; - mutable bool m_labelDirty; - mutable std::string m_label; - mutable std::vector m_labelPortions; -- mutable bool m_itemLabelDirty; -- mutable std::string m_itemLabel; -- mutable std::vector m_itemLabelPortions; - }; - - #endif --- -1.9.3 - - -From aac04a3876e7a79c126cc55f52d64ecfa6820c3b Mon Sep 17 00:00:00 2001 +From edcac7d62db15484a0fbd441bf26fe31b9c0f8ff Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 05/82] Move the reference-counting of Begin and End calls from - DX and GL source files into GUIFontTTF.cpp. +Subject: [PATCH 001/102] Move the reference-counting of Begin and End calls + from DX and GL source files into GUIFontTTF.cpp. --- xbmc/guilib/GUIFontTTF.cpp | 21 ++++++++ @@ -905,7 +14,7 @@ Subject: [PATCH 05/82] Move the reference-counting of Begin and End calls from 6 files changed, 117 insertions(+), 115 deletions(-) diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 9c8e516..90b9c4a 100644 +index 7014d35..a6b73e5 100644 --- a/xbmc/guilib/GUIFontTTF.cpp +++ b/xbmc/guilib/GUIFontTTF.cpp @@ -309,6 +309,27 @@ bool CGUIFontTTFBase::Load(const CStdString& strFilename, float height, float as @@ -1247,10 +356,10 @@ index a0dacba..6736cf7 100644 1.9.3 -From 0bc34394428f3d54a73e4e2e5c6b0daf2f157a60 Mon Sep 17 00:00:00 2001 +From 9c2224de3667c4fb7de55f3c08a4b43de9b1c64e Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 06/82] Convert CGUIFontTTFBase::m_vertex to be managed as a +Subject: [PATCH 002/102] 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. @@ -1263,7 +372,7 @@ Subject: [PATCH 06/82] Convert CGUIFontTTFBase::m_vertex to be managed as a 4 files changed, 18 insertions(+), 39 deletions(-) diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 90b9c4a..3f219d9 100644 +index a6b73e5..3f219d9 100644 --- a/xbmc/guilib/GUIFontTTF.cpp +++ b/xbmc/guilib/GUIFontTTF.cpp @@ -139,8 +139,7 @@ CGUIFontTTFBase::CGUIFontTTFBase(const CStdString& strFileName) @@ -1317,7 +426,7 @@ index 90b9c4a..3f219d9 100644 - if (!m_vertex) - { - free(old); -- CLog::Log(LOGSEVERE, "%s: can't allocate %"PRIdS" bytes for texture", __FUNCTION__ , m_vertex_size * sizeof(SVertex)); +- CLog::Log(LOGSEVERE, "%s: can't allocate %" PRIdS" bytes for texture", __FUNCTION__ , m_vertex_size * sizeof(SVertex)); - return; - } - } @@ -1432,10 +541,10 @@ index 93b7ea6..a4e8571 100644 1.9.3 -From 72b54640a2f27eeeee4df247365974f4fd1a66fd Mon Sep 17 00:00:00 2001 +From f23877edf693b70df11026c47f6e2d7343063447 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 07/82] CGUIFontTTFBase::RenderCharacter can now append to +Subject: [PATCH 003/102] CGUIFontTTFBase::RenderCharacter can now append to arbitrary vectors of vertices rather than only CGUIFontTTFBase::m_vertex --- @@ -1511,10 +620,10 @@ index 35e3cf9..4a6a696 100644 1.9.3 -From 96abf97cc233118b46670fc78a28d09f4c1c5335 Mon Sep 17 00:00:00 2001 +From 2ff7c7b3e9e883df75cbf2370a666c402a9ac94a Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 08/82] Add a cache of font glyph bounding box vertices. This +Subject: [PATCH 004/102] 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 @@ -2174,10 +1283,10 @@ index f351c99..9036ba9 100644 1.9.3 -From 87a615ec2b918f622cdeb4d97ac383473d533c19 Mon Sep 17 00:00:00 2001 +From 87d36e7f4d045a70075c0e084e9869a89b0ab51f Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 09/82] Lay the groundwork for hardware clipping. +Subject: [PATCH 005/102] 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 @@ -2442,10 +1551,10 @@ index 98e398a..81ee49e 100644 1.9.3 -From 2c2cd66f778cfe80f5addf0e31524f5adf401725 Mon Sep 17 00:00:00 2001 +From f6889534ebe503adc35ebb3b37d19ec48ae1b1f7 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 10/82] Increase font cache hit rate by keying on the +Subject: [PATCH 006/102] 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 @@ -2649,10 +1758,10 @@ index 7cb4669..78445ab 100644 1.9.3 -From aa09af31e58262051e8571223cc6fcefaf8d1697 Mon Sep 17 00:00:00 2001 +From cb2bda9a1951835142835f34fa99d001766dd637 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 11/82] Rewrite of scrolling text code. +Subject: [PATCH 007/102] 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 @@ -2676,7 +1785,7 @@ than an integral multiple of the scroll increment. 6 files changed, 58 insertions(+), 100 deletions(-) diff --git a/xbmc/guilib/GUIFadeLabelControl.cpp b/xbmc/guilib/GUIFadeLabelControl.cpp -index d594c04..86ee73a 100644 +index 844f960..5859d9f 100644 --- a/xbmc/guilib/GUIFadeLabelControl.cpp +++ b/xbmc/guilib/GUIFadeLabelControl.cpp @@ -109,18 +109,14 @@ void CGUIFadeLabelControl::Process(unsigned int currentTime, CDirtyRegionList &d @@ -2918,7 +2027,7 @@ index c55db48..09cf9b3 100644 static const int defaultSpeed = 60; private: diff --git a/xbmc/guilib/GUIRSSControl.cpp b/xbmc/guilib/GUIRSSControl.cpp -index 712e118..203c138 100644 +index 8d985cf..a8e20fc 100644 --- a/xbmc/guilib/GUIRSSControl.cpp +++ b/xbmc/guilib/GUIRSSControl.cpp @@ -119,7 +119,9 @@ void CGUIRSSControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyre @@ -2932,7 +2041,7 @@ index 712e118..203c138 100644 else { if (m_strRSSTags != "") -@@ -177,7 +179,7 @@ void CGUIRSSControl::Render() +@@ -174,7 +176,7 @@ void CGUIRSSControl::Render() if (m_pReader) { m_pReader->CheckForUpdates(); @@ -2942,7 +2051,7 @@ index 712e118..203c138 100644 } CGUIControl::Render(); diff --git a/xbmc/utils/RssReader.cpp b/xbmc/utils/RssReader.cpp -index 12bbeb5..505a02d 100644 +index a22d364..013ddb8 100644 --- a/xbmc/utils/RssReader.cpp +++ b/xbmc/utils/RssReader.cpp @@ -54,7 +54,7 @@ CRssReader::CRssReader() : CThread("RSSReader") @@ -2971,10 +2080,10 @@ index 2c6f366..b74faf2 100644 1.9.3 -From 08ae1b29d2987df3738787df1267ddfe898df472 Mon Sep 17 00:00:00 2001 +From 49a538250c27fc99507e0a49a688e13827633c9d Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 12/82] Move the application of the translation offsets into +Subject: [PATCH 008/102] 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 @@ -3170,10 +2279,10 @@ index cb56987..f6aa081 100644 1.9.3 -From 96e5d3e05b9ac2cef47d2e2a6fc13c407f1f672e Mon Sep 17 00:00:00 2001 +From a68d88009e7ae9b5484285332bc23aa22c73d17d Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 13/82] Rather than applying the translation offsets to the +Subject: [PATCH 009/102] 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. @@ -3320,10 +2429,10 @@ index 81ee49e..d2f9cd1 100644 1.9.3 -From a831b39d8b967665371ccc99a9e8ee1679d8ae54 Mon Sep 17 00:00:00 2001 +From 6b25456e32488065307ee21d19e53fa9f74bdf20 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 14/82] Enable hardware clipping. +Subject: [PATCH 010/102] Enable hardware clipping. --- xbmc/guilib/GUIFontTTF.cpp | 4 ++-- @@ -3399,10 +2508,10 @@ index fbffaa0..b7618e1 100644 1.9.3 -From c65c7b0f23d31b1677b0cd60355eb28d05865977 Mon Sep 17 00:00:00 2001 +From 490473747496cc5919c6118e0e57906bbf7da652 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 15/82] Move the vertex data across to a vertex buffer object +Subject: [PATCH 011/102] Move the vertex data across to a vertex buffer object just prior to drawing. --- @@ -3456,12 +2565,12 @@ index b7618e1..0df3749 100644 1.9.3 -From aff1d0b71b7a455daba6bbd29496fcdc9169e37e Mon Sep 17 00:00:00 2001 +From b65cab61e361360be10816d2f872204e38cc46f2 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 16/82] 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. +Subject: [PATCH 012/102] 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. --- xbmc/guilib/GUIFontCache.cpp | 6 ++++ @@ -3734,10 +2843,10 @@ index 6736cf7..168fb21 100644 1.9.3 -From a91376b246a7faabbeed9fec5b2510f1ec9917fc Mon Sep 17 00:00:00 2001 +From bafbd11e1fbcb62c9eec8d567897c356ddca2893 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 16 Jan 2014 16:29:42 +0000 -Subject: [PATCH 17/82] Switch from glDrawArrays() to glDrawElements(). This +Subject: [PATCH 013/102] 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. @@ -3960,10 +3069,10 @@ index 6de3532..258a293 100644 1.9.3 -From de5a34228b32d0c909dbbb083e1be84ecffef6e4 Mon Sep 17 00:00:00 2001 +From a2ba9f0ea636a5b9644d69874c4141b4595500a3 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 16:17:57 +0000 -Subject: [PATCH 18/82] Update Windows project files +Subject: [PATCH 014/102] Update Windows project files --- project/VS2010Express/XBMC.vcxproj | 2 ++ @@ -3971,10 +3080,10 @@ Subject: [PATCH 18/82] Update Windows project files 2 files changed, 8 insertions(+) diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj -index 79e0219..936d5a1 100644 +index 3d2b67b..2498cb2 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj -@@ -425,6 +425,7 @@ +@@ -426,6 +426,7 @@ @@ -3982,7 +3091,7 @@ index 79e0219..936d5a1 100644 -@@ -1740,6 +1741,7 @@ +@@ -1745,6 +1746,7 @@ @@ -3991,10 +3100,10 @@ index 79e0219..936d5a1 100644 diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters -index 29f0879..e5a18dd 100644 +index c630d26..aa7d063 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters -@@ -1006,6 +1006,9 @@ +@@ -1003,6 +1003,9 @@ guilib @@ -4018,17 +3127,17 @@ index 29f0879..e5a18dd 100644 1.9.3 -From d152a2347c58841fb80b74a829496793048e0b6b Mon Sep 17 00:00:00 2001 +From f3abd7d186d1561aeedc9f561f4f473cfc924f05 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 16:49:45 +0000 -Subject: [PATCH 19/82] Update XCode project file +Subject: [PATCH 015/102] Update XCode project file --- XBMC.xcodeproj/project.pbxproj | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj -index 6adc55d..ebe3151 100644 +index 94f85ee..990dfdb 100644 --- a/XBMC.xcodeproj/project.pbxproj +++ b/XBMC.xcodeproj/project.pbxproj @@ -168,6 +168,9 @@ @@ -4041,7 +3150,7 @@ index 6adc55d..ebe3151 100644 32C631281423A90F00F18420 /* JpegIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32C631261423A90F00F18420 /* JpegIO.cpp */; }; 36A9443D15821E2800727135 /* DatabaseUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443B15821E2800727135 /* DatabaseUtils.cpp */; }; 36A9444115821E7C00727135 /* SortUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443F15821E7C00727135 /* SortUtils.cpp */; }; -@@ -4016,6 +4019,8 @@ +@@ -4020,6 +4023,8 @@ 1DAFDB7B16DFDCA7007F8C68 /* PeripheralBusCEC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralBusCEC.h; sourceTree = ""; }; 1DE0443315828F4B005DDB4D /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Exception.cpp; path = commons/Exception.cpp; sourceTree = ""; }; 1DE0443415828F4B005DDB4D /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = commons/Exception.h; sourceTree = ""; }; @@ -4050,7 +3159,7 @@ index 6adc55d..ebe3151 100644 32C631261423A90F00F18420 /* JpegIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JpegIO.cpp; sourceTree = ""; }; 32C631271423A90F00F18420 /* JpegIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JpegIO.h; sourceTree = ""; }; 36A9443B15821E2800727135 /* DatabaseUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseUtils.cpp; sourceTree = ""; }; -@@ -6526,6 +6531,8 @@ +@@ -6533,6 +6538,8 @@ 18B7C76A1294222E009E7A26 /* GUIFixedListContainer.cpp */, 18B7C7101294222D009E7A26 /* GUIFixedListContainer.h */, 18B7C76B1294222E009E7A26 /* GUIFont.cpp */, @@ -4059,26 +3168,26 @@ index 6adc55d..ebe3151 100644 18B7C7111294222D009E7A26 /* GUIFont.h */, 18B7C76C1294222E009E7A26 /* GUIFontManager.cpp */, 18B7C7121294222D009E7A26 /* GUIFontManager.h */, -@@ -11846,6 +11853,7 @@ - 7CCDACC119275D790074CF51 /* NptAppleAutoreleasePool.mm in Sources */, - 7CCDACCA19275D790074CF51 /* NptAppleLogConfig.mm in Sources */, - 7CAA469019427AED00008885 /* PosixDirectory.cpp in Sources */, +@@ -11858,6 +11865,7 @@ + DF033D381946612400BFC82E /* AEDeviceEnumerationOSX.cpp in Sources */, + 7C525DF5195E2D8100BE3482 /* SaveFileStateJob.cpp in Sources */, + 7C908894196358A8003D0619 /* auto_buffer.cpp in Sources */, + 2FD7EC5F18A14FE50047F86C /* GUIFontCache.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -@@ -13039,6 +13047,7 @@ - 7CCDACC319275D790074CF51 /* NptAppleAutoreleasePool.mm in Sources */, - 7CCDACCC19275D790074CF51 /* NptAppleLogConfig.mm in Sources */, +@@ -13052,6 +13060,7 @@ 7CAA469219427AED00008885 /* PosixDirectory.cpp in Sources */, + 7C525DF7195E2D8100BE3482 /* SaveFileStateJob.cpp in Sources */, + 7C908896196358A8003D0619 /* auto_buffer.cpp in Sources */, + 2FD7EC6118A14FE50047F86C /* GUIFontCache.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -@@ -14234,6 +14243,7 @@ - 7CCDACC219275D790074CF51 /* NptAppleAutoreleasePool.mm in Sources */, - 7CCDACCB19275D790074CF51 /* NptAppleLogConfig.mm in Sources */, +@@ -14248,6 +14257,7 @@ 7CAA469119427AED00008885 /* PosixDirectory.cpp in Sources */, + 7C525DF6195E2D8100BE3482 /* SaveFileStateJob.cpp in Sources */, + 7C908895196358A8003D0619 /* auto_buffer.cpp in Sources */, + 2FD7EC6018A14FE50047F86C /* GUIFontCache.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -4087,10 +3196,10 @@ index 6adc55d..ebe3151 100644 1.9.3 -From 53f2f931d8afcb8a0abe5e5b34da5d511ab866e2 Mon Sep 17 00:00:00 2001 +From 366e8c48c165265b4f9d22b8e2b26fdddfa6467a Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 17:44:34 +0000 -Subject: [PATCH 20/82] Clang seems to be more picky than gcc about some C++ +Subject: [PATCH 016/102] Clang seems to be more picky than gcc about some C++ template syntax --- @@ -4158,10 +3267,10 @@ index 895fa72..bd84b9a 100644 1.9.3 -From 54348adfcc7842d56e3e981c8935d2ae56dd3540 Mon Sep 17 00:00:00 2001 +From 88806afd0c118a2ca1e8f0dbf8ee425137aacfc3 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 18:52:14 +0000 -Subject: [PATCH 21/82] Fix header to hopefully permit iOS builds to work +Subject: [PATCH 017/102] 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 @@ -4190,10 +3299,10 @@ index 53bce09..86330cc 100644 1.9.3 -From b8a96321efe1da06cac9129e545bc4aafff4457f Mon Sep 17 00:00:00 2001 +From b981367182fb888f1cf0d8e5d335e3526af896c4 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 8 Apr 2014 18:14:55 +0100 -Subject: [PATCH 22/82] Fix font display in stereoscopic modes +Subject: [PATCH 018/102] 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 @@ -4234,10 +3343,10 @@ index d476409..8466a81 100644 1.9.3 -From 65fb9cd6861394a8eac22722213e434dc1b55007 Mon Sep 17 00:00:00 2001 +From cffae5d7f38dfbbaa427e61c0e5a56fe00852380 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 10 Jan 2014 12:10:43 +0000 -Subject: [PATCH 23/82] [rbp] Don't override dvdplayer with omxplayer. +Subject: [PATCH 019/102] [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. @@ -4270,10 +3379,10 @@ index 27f0bec..fc12bb7 100644 1.9.3 -From b4cc530053b9329b3641faf31e39873fb6962a4a Mon Sep 17 00:00:00 2001 +From f3e06268a61b2fd42401fd810f9d6144adc7f6ab Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 10 Jan 2014 15:37:41 +0000 -Subject: [PATCH 24/82] [players] Use default players rather than hard coded +Subject: [PATCH 020/102] [players] Use default players rather than hard coded DVDPlayer/PAPlayer --- @@ -4332,20 +3441,20 @@ index 57dfcdd..7be9799 100644 1.9.3 -From bb81bc7ab31a99c134f4710c681dd8c652caae1f Mon Sep 17 00:00:00 2001 +From afe6ac464be227de30cc4177c50091231d607af9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 11 Jan 2014 18:23:42 +0000 -Subject: [PATCH 25/82] [rbp] Don't force dvdplayer for airplay +Subject: [PATCH 021/102] [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 472463d..9f86eb7 100644 +index a2b930e..74a3b30 100644 --- a/xbmc/network/AirPlayServer.cpp +++ b/xbmc/network/AirPlayServer.cpp -@@ -906,9 +906,11 @@ int CAirPlayServer::CTCPClient::ProcessRequest( CStdString& responseHeader, +@@ -903,9 +903,11 @@ int CAirPlayServer::CTCPClient::ProcessRequest( CStdString& responseHeader, CFileItem fileToPlay(location, false); fileToPlay.SetProperty("StartPercent", position*100.0f); ServerInstance->AnnounceToClients(EVENT_LOADING); @@ -4361,10 +3470,10 @@ index 472463d..9f86eb7 100644 1.9.3 -From a8da5af90041ba129025e0047a73030e8c4bb30d Mon Sep 17 00:00:00 2001 +From 5d75c8ba10041c285e9628e8d014530971d284f0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Jan 2014 13:11:06 +0000 -Subject: [PATCH 26/82] [rbp] Give plugins omxplayer when they request +Subject: [PATCH 022/102] [rbp] Give plugins omxplayer when they request dvdplayer on pi --- @@ -4372,10 +3481,10 @@ Subject: [PATCH 26/82] [rbp] Give plugins omxplayer when they request 1 file changed, 4 insertions(+) diff --git a/xbmc/interfaces/legacy/ModuleXbmc.cpp b/xbmc/interfaces/legacy/ModuleXbmc.cpp -index cf6693c..1170189 100644 +index db54d79..96031b2 100644 --- a/xbmc/interfaces/legacy/ModuleXbmc.cpp +++ b/xbmc/interfaces/legacy/ModuleXbmc.cpp -@@ -530,7 +530,11 @@ namespace XBMCAddon +@@ -527,7 +527,11 @@ namespace XBMCAddon int getPLAYLIST_MUSIC() { return PLAYLIST_MUSIC; } int getPLAYLIST_VIDEO() { return PLAYLIST_VIDEO; } int getPLAYER_CORE_AUTO() { return EPC_NONE; } @@ -4391,10 +3500,10 @@ index cf6693c..1170189 100644 1.9.3 -From 2decce910e8af54e880810ec18e8aa473ef39d36 Mon Sep 17 00:00:00 2001 +From f1001b59dba7124ecaf64588d953dbbb232e38e1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Jan 2014 18:04:07 +0000 -Subject: [PATCH 27/82] [rbp] Allow ALSA to be chosen in addition to Pi sink +Subject: [PATCH 023/102] [rbp] Allow ALSA to be chosen in addition to Pi sink Needs --enable-alsa in ./configure step and alsa support on platform --- @@ -4404,7 +3513,7 @@ Needs --enable-alsa in ./configure step and alsa support on platform 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in -index 1766ce1..cb4728b 100644 +index efd0574..a537a1c 100644 --- a/configure.in +++ b/configure.in @@ -705,7 +705,6 @@ case $use_platform in @@ -4485,10 +3594,10 @@ index e42d973..715b4f1 100644 1.9.3 -From 04d854f558aacb7c65bdc094da6c7451d4bd1502 Mon Sep 17 00:00:00 2001 +From 9e7fee9ceb9a58256985b22d5dec8e9b217a81c3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 16 Jan 2014 01:39:29 +0000 -Subject: [PATCH 28/82] [omxcodec] Add hardware decode to dvdplayer for Pi +Subject: [PATCH 024/102] [omxcodec] Add hardware decode to dvdplayer for Pi Hijack the abandoned OpenMaxVideo codec --- @@ -4514,10 +3623,10 @@ Hijack the abandoned OpenMaxVideo codec delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMax.h diff --git a/configure.in b/configure.in -index cb4728b..66ddeb9 100644 +index a537a1c..62516d6 100644 --- a/configure.in +++ b/configure.in -@@ -1947,9 +1947,24 @@ if test "$host_vendor" = "apple" ; then +@@ -1968,9 +1968,24 @@ if test "$host_vendor" = "apple" ; then USE_OPENMAX=0 AC_MSG_NOTICE($openmax_disabled) elif test "$target_platform" = "target_raspberry_pi"; then @@ -4616,10 +3725,10 @@ index 642cded..5a6a2be 100644 #ifdef HAVE_VIDEOTOOLBOXDECODER struct __CVBuffer *cvBufferRef; diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 6832721..3503988 100644 +index ca9aa84..1816407 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -912,7 +912,7 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -914,7 +914,7 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) #endif #ifdef HAVE_LIBOPENMAX else if(pic.format == RENDER_FMT_OMXEGL) @@ -7369,10 +6478,10 @@ index e06c41d..9079c13 100644 // defined(HAVE_LIBOPENMAX) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 4093974..0634880 100644 +index af0e493..d01089e 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -2981,7 +2981,9 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) +@@ -2974,7 +2974,9 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) hint.aspect = aspect; hint.forced_aspect = true; } @@ -7544,10 +6653,10 @@ index 1efb313..b4c8626 100644 1.9.3 -From ff14d4f702b268f92b6267a4691f32e799f4bfcf Mon Sep 17 00:00:00 2001 +From a594ae2a26c942405520ebda5d9cbe2db40bad59 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 20 Jan 2014 16:03:40 +0000 -Subject: [PATCH 29/82] [omxcodec] Enable for dvd menus +Subject: [PATCH 025/102] [omxcodec] Enable for dvd menus --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 ++++ @@ -7572,10 +6681,10 @@ index 5d37395..6d1810f 100644 1.9.3 -From 98c9b16254ae852ffe20af8767654ae31eaa65af Mon Sep 17 00:00:00 2001 +From 87b8052d31c20b3173c2a676b0f7d3068687f6bf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 22:27:44 +0000 -Subject: [PATCH 30/82] [omxcodec] Add omx specific texture +Subject: [PATCH 026/102] [omxcodec] Add omx specific texture create/upload/delete functions --- @@ -7653,10 +6762,10 @@ index 5a6a2be..52df291 100644 1.9.3 -From ba4aaea1e8a0e03adffc0e057b9a43ee8519a6d6 Mon Sep 17 00:00:00 2001 +From f2c59b5ce9460a04c52e014cf15c9e835f9c9933 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 22:50:43 +0000 -Subject: [PATCH 31/82] [omxcodec] Add shared pointer to delay shutdown of +Subject: [PATCH 027/102] [omxcodec] Add shared pointer to delay shutdown of codec until buffers are returned --- @@ -7837,10 +6946,10 @@ index 9079c13..0975e8a 100644 1.9.3 -From 4b5259e36cdf7d007c866f862e7275d1e9334b5f Mon Sep 17 00:00:00 2001 +From 43aaae9490318a6cc33d5546df73cf4138b0779a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 23:11:31 +0000 -Subject: [PATCH 32/82] [omxcodec] Fix for aspect ratio in non-square pixel +Subject: [PATCH 028/102] [omxcodec] Fix for aspect ratio in non-square pixel modes --- @@ -7929,10 +7038,10 @@ index 0975e8a..9138a20 100644 1.9.3 -From 88238401f7bd76f30e629975c72a0e1e27941c28 Mon Sep 17 00:00:00 2001 +From c67d107b1e9fdb03ed4c9fa812b7dc41d56e0473 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 23:19:22 +0000 -Subject: [PATCH 33/82] [omxcodec] Report error when codec not enabled +Subject: [PATCH 029/102] [omxcodec] Report error when codec not enabled --- xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp | 10 +++++++++- @@ -7977,10 +7086,10 @@ index 7e23c87..2ae722b 100644 1.9.3 -From a58f2444e59b8a7cf642ae0b459a93ad55c32e23 Mon Sep 17 00:00:00 2001 +From 84fd054b518469989f566fb5a007b1a3fbcb8f8e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Feb 2014 17:29:37 +0000 -Subject: [PATCH 34/82] [omxcodec] Add deinterlace support +Subject: [PATCH 030/102] [omxcodec] Add deinterlace support --- xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 2 +- @@ -8217,10 +7326,10 @@ index 9138a20..c8ad4d8 100644 1.9.3 -From de38627cc8686c8044545342b1816cfc182676a9 Mon Sep 17 00:00:00 2001 +From f64991ff2b74d5600cc7dd1e2959fc4b2a4f60bc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Feb 2014 11:46:33 +0000 -Subject: [PATCH 35/82] [rbp/settings] Allow av sync type to be enabled +Subject: [PATCH 031/102] [rbp/settings] Allow av sync type to be enabled It works for dvdplayer --- @@ -8249,10 +7358,10 @@ index 2b7d0a6..1429256 100644 1.9.3 -From 33222c103c68a49c3e6a9326a0413cbfdca12b80 Mon Sep 17 00:00:00 2001 +From 4dfa451d32f3302babeaefdbe7b6d29bb65353d4 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 36/82] Improved file buffering in CArchive +Subject: [PATCH 032/102] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -8315,10 +7424,10 @@ index 6ed0f8f..8506d95 100644 1.9.3 -From 8751a0a0f51afa2ddf14e04f3742512aef1069f3 Mon Sep 17 00:00:00 2001 +From e1da30ac65ceedef2eb5bf3e795507f8f3c593b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 16 Feb 2014 17:38:05 +0000 -Subject: [PATCH 37/82] [omxcodec] Only do essential calls in texture thread +Subject: [PATCH 033/102] [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 @@ -8668,10 +7777,10 @@ index c8ad4d8..f234f6d 100644 1.9.3 -From 5031e939e8df53f54e2534c6b08cf01d799d59cd Mon Sep 17 00:00:00 2001 +From dc58ddd6e648ba0be7a0b0c97fcff9fa10b799e5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 38/82] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 034/102] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -8679,10 +7788,10 @@ Subject: [PATCH 38/82] [hifiberry] Hack: force it to be recognised as IEC958 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -index 8cbf6e5..a8ad933 100644 +index 7cb049c..649bcb1 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -@@ -932,6 +932,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev +@@ -1296,6 +1296,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev if (snd_card_get_name(cardNr, &cardName) == 0) info.m_displayName = cardName; @@ -8697,20 +7806,20 @@ index 8cbf6e5..a8ad933 100644 1.9.3 -From 3ec3d6ea28dadd7cefec19e5c4e9d30af2478382 Mon Sep 17 00:00:00 2001 +From 05a408c7f18de9f3b47806223538b05c4ad23358 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Mar 2014 18:50:23 +0000 -Subject: [PATCH 39/82] [dvdplayer] Use inexact seeking like omxplayer +Subject: [PATCH 035/102] [dvdplayer] Use inexact seeking like omxplayer --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 0634880..768f51f 100644 +index d01089e..8122d2a 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1898,7 +1898,11 @@ void CDVDPlayer::CheckAutoSceneSkip() +@@ -1892,7 +1892,11 @@ void CDVDPlayer::CheckAutoSceneSkip() /* * Seeking is NOT flushed so any content up to the demux point is retained when playing forwards. */ @@ -8722,7 +7831,7 @@ index 0634880..768f51f 100644 /* * Seek doesn't always work reliably. Last physical seek time is recorded to prevent looping * if there was an error with seeking and it landed somewhere unexpected, perhaps back in the -@@ -1916,7 +1920,11 @@ void CDVDPlayer::CheckAutoSceneSkip() +@@ -1910,7 +1914,11 @@ void CDVDPlayer::CheckAutoSceneSkip() /* * Seeking is NOT flushed so any content up to the demux point is retained when playing forwards. */ @@ -8734,7 +7843,7 @@ index 0634880..768f51f 100644 /* * Each commercial break is only skipped once so poorly detected commercial breaks can be * manually re-entered. Start and end are recorded to prevent looping and to allow seeking back -@@ -3119,9 +3127,12 @@ void CDVDPlayer::UpdateClockMaster() +@@ -3111,9 +3119,12 @@ void CDVDPlayer::UpdateClockMaster() void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) { double startpts; @@ -8751,60 +7860,10 @@ index 0634880..768f51f 100644 1.9.3 -From f451883f443aad6156fe67621bb029e444480eac Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 13 Mar 2014 16:08:46 +0000 -Subject: [PATCH 40/82] [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. - -Many users end up downmixing this 7.1 stream back to 2.0. -Much better to tell the codec we only need the 2.0 stream. -It saves about 50% of the CPU required ---- - xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp -index bb3bea4..dab9f27 100644 ---- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp -+++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp -@@ -25,6 +25,7 @@ - #include "utils/log.h" - - #include "cores/AudioEngine/Utils/AEUtil.h" -+#include "settings/Settings.h" - - // the size of the audio_render output port buffers - #define AUDIO_DECODE_OUTPUT_BUFFER (32*1024) -@@ -86,6 +87,16 @@ bool COMXAudioCodecOMX::Open(CDVDStreamInfo &hints) - m_pCodecContext->block_align = hints.blockalign; - m_pCodecContext->bit_rate = hints.bitrate; - m_pCodecContext->bits_per_coded_sample = hints.bitspersample; -+ enum AEStdChLayout layout = (enum AEStdChLayout)CSettings::Get().GetInt("audiooutput.channels"); -+ if (hints.codec == AV_CODEC_ID_TRUEHD) -+ { -+ if (layout == AE_CH_LAYOUT_2_0) -+ m_pCodecContext->request_channel_layout = AV_CH_LAYOUT_STEREO; -+ else if (layout <= AE_CH_LAYOUT_5_1) -+ m_pCodecContext->request_channel_layout = AV_CH_LAYOUT_5POINT1; -+ } -+ if (m_pCodecContext->request_channel_layout) -+ CLog::Log(LOGNOTICE,"COMXAudioCodecOMX::Open() Requesting channel layout of %d", (unsigned)m_pCodecContext->request_channel_layout); - - // vorbis has variable sized planar output, so skip concatenation - if (hints.codec == AV_CODEC_ID_VORBIS) --- -1.9.3 - - -From 881f62fcbc398b75eaae7516a04d47cd5bb27b57 Mon Sep 17 00:00:00 2001 +From b27b04e4b4a043271832668f92b5119067d10c18 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 41/82] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 036/102] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -8831,11 +7890,11 @@ index e9ba7d3..0fdc3c2 100644 1.9.3 -From 6ff163cde8381e808ef65ffe6fc88f2d94fd2108 Mon Sep 17 00:00:00 2001 +From 1e240825884ba363c4f340e3bcefde0e18436098 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 15:28:57 +0100 -Subject: [PATCH 42/82] [omxcodec] Clamp video texture at edges to avoid image - wrapping +Subject: [PATCH 037/102] [omxcodec] Clamp video texture at edges to avoid + image wrapping --- xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 2 ++ @@ -8858,10 +7917,10 @@ index 51f56aa..2929a37 100644 1.9.3 -From f67916b281a03d25e57a325983446317e412dff3 Mon Sep 17 00:00:00 2001 +From a107ddc2b9b85151e7bf77ff7401531e55866eff Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 30 Mar 2014 15:54:34 +0100 -Subject: [PATCH 43/82] [omxplayer] Make the sharpness control act as a +Subject: [PATCH 038/102] [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] @@ -8870,10 +7929,10 @@ This fixes scaling kernel as Mitchell Netravali, and varies sharpness over range 1 file changed, 338 insertions(+) diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index 49e0fed..12e887e 100644 +index a4cfa1f..668a72a 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp -@@ -1051,6 +1051,334 @@ bool COMXPlayer::IsBetterStream(COMXCurrentStream& current, CDemuxStream* stream +@@ -1043,6 +1043,334 @@ bool COMXPlayer::IsBetterStream(COMXCurrentStream& current, CDemuxStream* stream return false; } @@ -9208,7 +8267,7 @@ index 49e0fed..12e887e 100644 void COMXPlayer::Process() { bool bOmxWaitVideo = false; -@@ -1183,6 +1511,8 @@ void COMXPlayer::Process() +@@ -1175,6 +1503,8 @@ void COMXPlayer::Process() SetCaching(CACHESTATE_FLUSH); EDEINTERLACEMODE current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; @@ -9217,7 +8276,7 @@ index 49e0fed..12e887e 100644 while (!m_bAbortRequest) { -@@ -1214,6 +1544,13 @@ void COMXPlayer::Process() +@@ -1206,6 +1536,13 @@ void COMXPlayer::Process() current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; } @@ -9231,7 +8290,7 @@ index 49e0fed..12e887e 100644 m_video_fifo = (int)(100.0*(m_omxPlayerVideo.GetDecoderBufferSize()-m_omxPlayerVideo.GetDecoderFreeSpace())/m_omxPlayerVideo.GetDecoderBufferSize()); m_audio_fifo = (int)(100.0*audio_fifo/m_omxPlayerAudio.GetCacheTotal()); -@@ -4577,6 +4914,7 @@ void COMXPlayer::GetRenderFeatures(std::vector &renderFeatures) +@@ -4574,6 +4911,7 @@ void COMXPlayer::GetRenderFeatures(std::vector &renderFeatures) renderFeatures.push_back(RENDERFEATURE_CROP); renderFeatures.push_back(RENDERFEATURE_PIXEL_RATIO); renderFeatures.push_back(RENDERFEATURE_ZOOM); @@ -9243,11 +8302,11 @@ index 49e0fed..12e887e 100644 1.9.3 -From 35048ec10fafe1316ca5937401b0f9eee4d92ccf Mon Sep 17 00:00:00 2001 +From b0f1716de6047490c4c502bc5023219489c34ba7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 44/82] [omxplayer] Don't propagate 3d flags based on supported - 3d modes +Subject: [PATCH 039/102] [omxplayer] Don't propagate 3d flags based on + supported 3d modes --- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 ++++------------------------- @@ -9302,10 +8361,10 @@ index 2fdbe18..e6bf2d0 100644 1.9.3 -From 0f0e8c2566ecd3140c381a52cc0196fffccec9a8 Mon Sep 17 00:00:00 2001 +From 605211b04a4bcbd6a7e5b98fdd748c01d2455fbc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 45/82] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 040/102] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -9349,10 +8408,10 @@ index 5bffdf5..7e4fdd4 100644 1.9.3 -From b9f95119543d59f7d3b0f80696215d0c66d4fe91 Mon Sep 17 00:00:00 2001 +From b02ed2e1e04e2d082ff8421b7e2fcb80e15e6e62 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 46/82] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 041/102] [graphics] Allow switching to a more suitable 3D resolution --- @@ -9442,10 +8501,10 @@ index 0a27643..df55e92 100644 1.9.3 -From 17042a6427baa1152d593b23edf0340127390529 Mon Sep 17 00:00:00 2001 +From fb3ce65df80a323c9809ddb795aba36a3fbb9a1e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 47/82] [3D] Support switching to 3D resolutions +Subject: [PATCH 042/102] [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. @@ -9530,10 +8589,10 @@ index 83c3adb..8076e76 100644 1.9.3 -From 52e2bf4a422d1210622f69b411ff69f585d7d1de Mon Sep 17 00:00:00 2001 +From cee7c61f26e7ef4eee06450a549bcc6d1595a252 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 48/82] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 043/102] [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. @@ -9721,18 +8780,18 @@ index 90b57e1..5b26b20 100644 1.9.3 -From cacb2609b8e021320d4c5bb949da71ec6a8ad726 Mon Sep 17 00:00:00 2001 +From 50b494ec8d7c50d1b62e4c98a2e442ad72d70700 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 21:07:51 +0100 -Subject: [PATCH 49/82] [PiSink] More attempts to reduce underrun audio +Subject: [PATCH 044/102] [PiSink] More attempts to reduce underrun audio glitches with multichannl and high samplerate --- - xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 73 ++++++++++++------------------- - 1 file changed, 27 insertions(+), 46 deletions(-) + xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 78 ++++++++++++------------------- + 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -index 811ea0d..7c04919 100644 +index 19a9411..0a09275 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp @@ -186,7 +186,7 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device) @@ -9753,7 +8812,7 @@ index 811ea0d..7c04919 100644 omx_err = m_omx_render.SetParameter(OMX_IndexParamPortDefinition, &port_param); if (omx_err != OMX_ErrorNone) -@@ -308,59 +308,40 @@ double CAESinkPi::GetCacheTotal() +@@ -306,61 +306,43 @@ double CAESinkPi::GetCacheTotal() unsigned int CAESinkPi::AddPackets(uint8_t **data, unsigned int frames, unsigned int offset) { @@ -9768,14 +8827,18 @@ index 811ea0d..7c04919 100644 OMX_BUFFERHEADERTYPE *omx_buffer = NULL; - while (sent < frames) + -+ double delay = GetDelay(); ++ AEDelayStatus status; ++ GetDelay(status); ++ double delay = status.GetDelay(); + if (delay <= 0.0 && m_submitted) + CLog::Log(LOGNOTICE, "%s:%s Underrun (delay:%.2f frames:%d)", CLASSNAME, __func__, delay, frames); + + omx_buffer = m_omx_render.GetInputBuffer(1000); + if (omx_buffer == NULL) { -- double delay = GetDelay(); +- AEDelayStatus status; +- GetDelay(status); +- double delay = status.GetDelay(); - double ideal_submission_time = AUDIO_PLAYBUFFER - delay; - // ideal amount of audio we'd like submit (to make delay match AUDIO_PLAYBUFFER) - int timeout = 1000; @@ -9831,7 +8894,8 @@ index 811ea0d..7c04919 100644 + if (omx_err != OMX_ErrorNone) + CLog::Log(LOGERROR, "%s:%s frames=%d err=%x", CLASSNAME, __func__, frames, omx_err); + m_submitted++; -+ delay = GetDelay(); ++ GetDelay(status); ++ delay = status.GetDelay(); + if (delay > AUDIO_PLAYBUFFER) + Sleep((int)(1000.0f * (delay - AUDIO_PLAYBUFFER))); + return frames; @@ -9842,10 +8906,10 @@ index 811ea0d..7c04919 100644 1.9.3 -From 6b5217b28809feb2c8edce446c6a8ba129938bb1 Mon Sep 17 00:00:00 2001 +From ba6de3c9448a90c35df2b4bccf12f354c8422a55 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 22 Apr 2014 12:23:23 +0100 -Subject: [PATCH 50/82] [omxplayer] Make dvdplayer the default for dvd images +Subject: [PATCH 045/102] [omxplayer] Make dvdplayer the default for dvd images --- xbmc/cores/omxplayer/omxplayer_advancedsettings.xml | 2 +- @@ -9867,11 +8931,11 @@ index 77c6a15..51c0daf 100644 1.9.3 -From eeafafa8332a89f51aea392c9721d6b889074bd3 Mon Sep 17 00:00:00 2001 +From 4f6bde16d4768b34732df62ca04418b123d027b5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 51/82] [cec] Don't suspend pi on tv switch off - it can't wake - up +Subject: [PATCH 046/102] [cec] Don't suspend pi on tv switch off - it can't + wake up --- system/peripherals.xml | 2 +- @@ -9894,10 +8958,10 @@ index a906628..9b5271a 100644 1.9.3 -From f9e7b3b8bbc34c23b8379c248ea14842c1b11570 Mon Sep 17 00:00:00 2001 +From b7433fb3abf84933605135201fa4499aed15b1b7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Jun 2013 01:25:57 +0100 -Subject: [PATCH 53/82] [rbp/omxplayer] Do we need discontinuity handling? +Subject: [PATCH 048/102] [rbp/omxplayer] Do we need discontinuity handling? So far I've not seen what this is needed for and it does cause problems for some files. --- @@ -9905,10 +8969,10 @@ So far I've not seen what this is needed for and it does cause problems for some 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index 12e887e..a811169 100644 +index 668a72a..ebb59d5 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp -@@ -2395,6 +2395,7 @@ static void UpdateLimits(double& minimum, double& maximum, double dts) +@@ -2387,6 +2387,7 @@ static void UpdateLimits(double& minimum, double& maximum, double dts) void COMXPlayer::CheckContinuity(COMXCurrentStream& current, DemuxPacket* pPacket) { @@ -9920,11 +8984,11 @@ index 12e887e..a811169 100644 1.9.3 -From 2d38d635a6c27c8c2bdffc7ce24e7d511e2c7c18 Mon Sep 17 00:00:00 2001 +From 66a9d175627a9a298aa7f41c81428ccc48c7dd8d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 24 Oct 2013 00:53:26 +0100 -Subject: [PATCH 54/82] [rbp/omxplayer] Avoid marking non-monotonic timestamps - as unknown +Subject: [PATCH 049/102] [rbp/omxplayer] Avoid marking non-monotonic + timestamps as unknown Following a single spurious timestamp that is in the future, all subsequent timestamps will be marked unknown causing out of sync. @@ -9965,10 +9029,10 @@ index 77731a9..5f9d028 100644 1.9.3 -From 8080b6e1199e3fb90e4ff2115831b706a50403a5 Mon Sep 17 00:00:00 2001 +From 953b12e91da05a8202f7fbc69ab0b818f25964da Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 13 Dec 2013 16:25:23 +0000 -Subject: [PATCH 56/82] Add time taken to resample to log +Subject: [PATCH 051/102] Add time taken to resample to log --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 7 +++++++ @@ -9976,10 +9040,10 @@ Subject: [PATCH 56/82] Add time taken to resample to log 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 2f71051..ce74b9d 100644 +index 4ee53ec..a4337f1 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -2586,7 +2586,14 @@ void CActiveAE::ResampleSounds() +@@ -2610,7 +2610,14 @@ void CActiveAE::ResampleSounds() { if (!(*it)->IsConverted()) { @@ -10012,17 +9076,17 @@ index 9324e1e..4405f66 100644 1.9.3 -From 0d756bfa2225ef9e050cfd4c048ff73506893a1b Mon Sep 17 00:00:00 2001 +From 6145eb43d0dfda3fcbb739dbed4af84d2c272a00 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 57/82] logging: Add microsecond timer to log messages +Subject: [PATCH 052/102] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xbmc/utils/log.cpp b/xbmc/utils/log.cpp -index 6d7c6c8..45f68bc 100644 +index dd6ef26..8edf2fd 100644 --- a/xbmc/utils/log.cpp +++ b/xbmc/utils/log.cpp @@ -32,6 +32,7 @@ @@ -10037,8 +9101,8 @@ index 6d7c6c8..45f68bc 100644 void CLog::Log(int loglevel, const char *format, ... ) { -- static const char* prefixFormat = "%02.2d:%02.2d:%02.2d T:%"PRIu64" %7s: "; -+ static const char* prefixFormat = "%02.2d:%02.2d:%02.2d %10.6f T:%"PRIu64" %7s: "; +- static const char* prefixFormat = "%02.2d:%02.2d:%02.2d T:%" PRIu64" %7s: "; ++ static const char* prefixFormat = "%02.2d:%02.2d:%02.2d %10.6f T:%" PRIu64" %7s: "; CSingleLock waitLock(critSec); int extras = (loglevel >> LOGMASKBIT) << LOGMASKBIT; loglevel = loglevel & LOGMASK; @@ -10076,10 +9140,10 @@ index 6d7c6c8..45f68bc 100644 1.9.3 -From ffeee013ca4f3e7476247e06765cb69bd2150ebf Mon Sep 17 00:00:00 2001 +From d7817a5e964c2e85ab49b74ac73b0d28491702d0 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:49:17 +1300 -Subject: [PATCH 58/82] adds GetTvShowSeasons +Subject: [PATCH 053/102] adds GetTvShowSeasons --- xbmc/video/VideoDatabase.cpp | 30 ++++++++++++++++++++++++------ @@ -10087,10 +9151,10 @@ Subject: [PATCH 58/82] adds GetTvShowSeasons 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp -index 927e8ff..b759970 100644 +index 8ac7e41..6d28a42 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp -@@ -4031,7 +4031,7 @@ bool CVideoDatabase::RemoveArtForItem(int mediaId, const MediaType &mediaType, c +@@ -4060,7 +4060,7 @@ bool CVideoDatabase::RemoveArtForItem(int mediaId, const MediaType &mediaType, c return result; } @@ -10099,7 +9163,7 @@ index 927e8ff..b759970 100644 { try { -@@ -4042,19 +4042,37 @@ bool CVideoDatabase::GetTvShowSeasonArt(int showId, map +@@ -4071,19 +4071,37 @@ bool CVideoDatabase::GetTvShowSeasonArt(int showId, map CStdString sql = PrepareSQL("select idSeason,season from seasons where idShow=%i", showId); m_pDS2->query(sql.c_str()); @@ -10143,10 +9207,10 @@ index 927e8ff..b759970 100644 return true; } diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h -index 7bf6d85..80334c6 100644 +index 093a48e..9db34f4 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h -@@ -720,6 +720,7 @@ class CVideoDatabase : public CDatabase +@@ -738,6 +738,7 @@ class CVideoDatabase : public CDatabase std::string GetArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType); bool RemoveArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType); bool RemoveArtForItem(int mediaId, const MediaType &mediaType, const std::set &artTypes); @@ -10158,20 +9222,20 @@ index 7bf6d85..80334c6 100644 1.9.3 -From 9460558427955f172fd4476db0f8ab49ef8bd8c8 Mon Sep 17 00:00:00 2001 +From e66f4c004028a0abdb10f630f7e5c3aec2c1d9c1 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:50:10 +1300 -Subject: [PATCH 59/82] move AddSeason() public. +Subject: [PATCH 054/102] move AddSeason() public. --- xbmc/video/VideoDatabase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h -index 80334c6..a519620 100644 +index 9db34f4..eaf2e36 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h -@@ -731,6 +731,7 @@ class CVideoDatabase : public CDatabase +@@ -749,6 +749,7 @@ class CVideoDatabase : public CDatabase virtual bool GetFilter(CDbUrl &videoUrl, Filter &filter, SortDescription &sorting); @@ -10179,22 +9243,22 @@ index 80334c6..a519620 100644 int AddSet(const CStdString& strSet); void ClearMovieSet(int idMovie); void SetMovieSet(int idMovie, int idSet); -@@ -761,7 +762,6 @@ class CVideoDatabase : public CDatabase +@@ -779,7 +780,6 @@ class CVideoDatabase : public CDatabase - int AddTvShow(const CStdString& strPath); + int AddTvShow(); int AddMusicVideo(const CStdString& strFilenameAndPath); - int AddSeason(int showID, int season); - // link functions - these two do all the work - void AddLinkToActor(const char *table, int actorID, const char *secondField, int secondID, const CStdString &role, int order); + /*! \brief Adds a path to the tvshow link table. + \param idShow the id of the show. -- 1.9.3 -From f2b89ac91ae42e69619d19596248e12e987c1842 Mon Sep 17 00:00:00 2001 +From a621b135be3841fa8a3b20f8c63c2d3f81a8d8c2 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:48:24 +1300 -Subject: [PATCH 60/82] adds GetArt function to (video) scraper, allowing art +Subject: [PATCH 055/102] adds GetArt function to (video) scraper, allowing art to be fetched given the video identifier. --- @@ -10205,7 +9269,7 @@ Subject: [PATCH 60/82] adds GetArt function to (video) scraper, allowing art 4 files changed, 53 insertions(+) diff --git a/xbmc/addons/Scraper.cpp b/xbmc/addons/Scraper.cpp -index 44f6693..a67b243 100644 +index 8ab526c..9c32bb5 100644 --- a/xbmc/addons/Scraper.cpp +++ b/xbmc/addons/Scraper.cpp @@ -925,6 +925,44 @@ EPISODELIST CScraper::GetEpisodeList(XFILE::CCurlFile &fcurl, const CScraperUrl @@ -10220,14 +9284,14 @@ index 44f6693..a67b243 100644 + ADDON::TranslateContent(Content()).c_str(), Version().asString().c_str()); + + video.Reset(); -+ vector vcsIn; ++ vector vcsIn; + CScraperUrl scurl; + vcsIn.push_back(id); -+ vector vcsOut = RunNoThrow("GetArt", scurl, fcurl, &vcsIn); ++ vector vcsOut = RunNoThrow("GetArt", scurl, fcurl, &vcsIn); + + // parse XML output + bool fRet(false); -+ for (CStdStringArray::const_iterator i = vcsOut.begin(); i != vcsOut.end(); ++i) ++ for (vector::const_iterator i = vcsOut.begin(); i != vcsOut.end(); ++i) + { + CXBMCTinyXML doc; + doc.Parse(*i, TIXML_ENCODING_UTF8); @@ -10254,7 +9318,7 @@ index 44f6693..a67b243 100644 bool CScraper::GetVideoDetails(XFILE::CCurlFile &fcurl, const CScraperUrl &scurl, bool fMovie/*else episode*/, CVideoInfoTag &video) diff --git a/xbmc/addons/Scraper.h b/xbmc/addons/Scraper.h -index 40a90e5..b7e431c 100644 +index 717a480..d27747a 100644 --- a/xbmc/addons/Scraper.h +++ b/xbmc/addons/Scraper.h @@ -18,6 +18,8 @@ @@ -10312,11 +9376,11 @@ index 22ac229..75bc341 100644 1.9.3 -From 911317ea7f8d20a8960fe7d651eaea451525c690 Mon Sep 17 00:00:00 2001 +From a42f7ed37045b85d7ae79a79230438d6834e8d13 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:14 +1300 -Subject: [PATCH 61/82] refresh season art if a new season is found that isn't - recorded in the database yet. Fixes #14339 +Subject: [PATCH 056/102] refresh season art if a new season is found that + isn't recorded in the database yet. Fixes #14339 --- xbmc/video/VideoInfoScanner.cpp | 33 ++++++++++++++++++++++++++++++++- @@ -10324,10 +9388,10 @@ Subject: [PATCH 61/82] refresh season art if a new season is found that isn't 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp -index 3f1d2e8..bc4d47c 100644 +index b5a5864..e0056bd 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp -@@ -1342,6 +1342,10 @@ namespace VIDEO +@@ -1361,6 +1361,10 @@ namespace VIDEO pDlgProgress->Progress(); } @@ -10338,7 +9402,7 @@ index 3f1d2e8..bc4d47c 100644 EPISODELIST episodes; bool hasEpisodeGuide = false; -@@ -1390,6 +1394,8 @@ namespace VIDEO +@@ -1409,6 +1413,8 @@ namespace VIDEO } if (AddVideo(&item, CONTENT_TVSHOWS, file->isFolder, true, &showInfo) < 0) return INFO_ERROR; @@ -10347,7 +9411,7 @@ index 3f1d2e8..bc4d47c 100644 continue; } -@@ -1519,6 +1525,8 @@ namespace VIDEO +@@ -1538,6 +1544,8 @@ namespace VIDEO if (AddVideo(&item, CONTENT_TVSHOWS, file->isFolder, useLocal, &showInfo) < 0) return INFO_ERROR; @@ -10356,7 +9420,7 @@ index 3f1d2e8..bc4d47c 100644 } else { -@@ -1527,9 +1535,27 @@ namespace VIDEO +@@ -1546,9 +1554,27 @@ namespace VIDEO file->cDate.GetAsLocalizedDate().c_str(), file->strTitle.c_str()); } } @@ -10384,7 +9448,7 @@ index 3f1d2e8..bc4d47c 100644 CStdString CVideoInfoScanner::GetnfoFile(CFileItem *item, bool bGrabAny) const { CStdString nfoFile; -@@ -1798,6 +1824,11 @@ namespace VIDEO +@@ -1817,6 +1843,11 @@ namespace VIDEO } for (int season = -1; season <= maxSeasons; season++) { @@ -10396,7 +9460,7 @@ index 3f1d2e8..bc4d47c 100644 map art; if (useLocal) { -@@ -1851,7 +1882,7 @@ namespace VIDEO +@@ -1870,7 +1901,7 @@ namespace VIDEO art.insert(make_pair(artTypes.front(), image)); } @@ -10406,7 +9470,7 @@ index 3f1d2e8..bc4d47c 100644 } diff --git a/xbmc/video/VideoInfoScanner.h b/xbmc/video/VideoInfoScanner.h -index b7f657a..841309d 100644 +index 2f0d60f..94fca85 100644 --- a/xbmc/video/VideoInfoScanner.h +++ b/xbmc/video/VideoInfoScanner.h @@ -228,6 +228,8 @@ namespace VIDEO @@ -10422,10 +9486,10 @@ index b7f657a..841309d 100644 1.9.3 -From cfa00408a9c8d09cbdbb27e9ee12a17ac327d3a7 Mon Sep 17 00:00:00 2001 +From fbb40d3e32c9f0181c39e025d8ef05fbfdb0b31f Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:34 +1300 -Subject: [PATCH 62/82] REMOVEME: updated thetvdb.com scraper to support art +Subject: [PATCH 057/102] REMOVEME: updated thetvdb.com scraper to support art updates --- @@ -10536,10 +9600,10 @@ index 39e604d..60a0e96 100644 1.9.3 -From 5d66491fd31e2ae838a8b59da165c8982273a2d3 Mon Sep 17 00:00:00 2001 +From 8d71a5c0f9f90c5450c1a644c3f8d510494bef4f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 22 Mar 2014 16:40:01 +0000 -Subject: [PATCH 63/82] Enable PYTHONOPTIMIZE for Pi +Subject: [PATCH 058/102] Enable PYTHONOPTIMIZE for Pi --- xbmc/interfaces/python/XBPython.cpp | 4 ++++ @@ -10564,10 +9628,10 @@ index 0d6dabc..c3fd0f1 100644 1.9.3 -From c23f5a8f3a9a6e7d28936b018d88434a8890d172 Mon Sep 17 00:00:00 2001 +From 4d75c729f34c7a3240c7ba2f4ba4f685b98772f5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Apr 2014 18:07:45 +0100 -Subject: [PATCH 64/82] [rpi] Make ActiveAE thread higher priority to make +Subject: [PATCH 059/102] [rpi] Make ActiveAE thread higher priority to make audio underrun less likely --- @@ -10575,10 +9639,10 @@ Subject: [PATCH 64/82] [rpi] Make ActiveAE thread higher priority to make 1 file changed, 6 insertions(+) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index ce74b9d..ddd9b62 100644 +index a4337f1..3ac182a 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -2144,6 +2144,12 @@ void CActiveAE::LoadSettings() +@@ -2168,6 +2168,12 @@ void CActiveAE::LoadSettings() bool CActiveAE::Initialize() { Create(); @@ -10595,10 +9659,10 @@ index ce74b9d..ddd9b62 100644 1.9.3 -From 6e2092ce8cf8356a6584b1cb5442317dbd24f7d0 Mon Sep 17 00:00:00 2001 +From 8ac8fd1742b9ee3cf118806f13798760f19cab63 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 65/82] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 060/102] [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. @@ -10687,11 +9751,11 @@ index 0000000..8f5f989 1.9.3 -From 7955c0cb26e663ed12e6798fcfb696f391aadf77 Mon Sep 17 00:00:00 2001 +From 5a4f696fb8f2406f3caafbe88447db0ed3368283 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:55:28 +0100 -Subject: [PATCH 66/82] [ffmpeg] vc-1: Optimise parser (with special attention - to ARM) +Subject: [PATCH 061/102] [ffmpeg] vc-1: Optimise parser (with special + attention to ARM) Backport from upstream ffmpeg --- @@ -12047,10 +11111,11 @@ index f514ae6..863ee41 100644 1.9.3 -From e3ac86b34ef35e0463c6475c03e653da70cdc3da Mon Sep 17 00:00:00 2001 +From 7ed755d1a64b291f94f367e457755bd9f0640b2d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 16:53:32 +0100 -Subject: [PATCH 67/82] [ffmpeg] truehd: Optimise with special attention to ARM +Subject: [PATCH 062/102] [ffmpeg] truehd: Optimise with special attention to + ARM Backport from upstream ffmpeg --- @@ -14091,10 +13156,10 @@ index 863ee41..b56fbdd 100644 1.9.3 -From 53d16d23e1b49769b5385646b81dcd0f089b0f4d Mon Sep 17 00:00:00 2001 +From cdb3f7900819d86cff4baa2dcd3867cb7f4d823e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 May 2014 16:13:45 +0100 -Subject: [PATCH 68/82] [rbp] Add config.txt settings to log file +Subject: [PATCH 063/102] [rbp] Add config.txt settings to log file --- xbmc/linux/RBP.cpp | 8 +++++++- @@ -14127,10 +13192,10 @@ index 49dcbb8..9a5e9cb 100644 1.9.3 -From 72025619f8b7a33a20028ca959ece3bea2716ec8 Mon Sep 17 00:00:00 2001 +From 21731d0cbe70622a6510bc6feda029d1615db981 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 12 May 2014 23:06:43 +0100 -Subject: [PATCH 69/82] [omxcodec] Updates to work better with dropping and +Subject: [PATCH 064/102] [omxcodec] Updates to work better with dropping and lateness detection --- @@ -14422,10 +13487,10 @@ index f234f6d..adf53b5 100644 1.9.3 -From 9a0f4cb20b373b074497192fe3141786c61db81a Mon Sep 17 00:00:00 2001 +From 089ed035143c22d05c5360d05a18b250b92192a7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH 70/82] [omxplayer] Add ability to log more timestamp info in +Subject: [PATCH 065/102] [omxplayer] Add ability to log more timestamp info in extra debug settings --- @@ -14466,10 +13531,10 @@ index 4bf5d83..3fb7cc3 100644 #ifdef __GNUC__ #define ATTRIB_LOG_FORMAT __attribute__((format(printf,3,4))) diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index a811169..d074dbe 100644 +index ebb59d5..4e0662f 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp -@@ -1554,27 +1554,28 @@ void COMXPlayer::Process() +@@ -1546,27 +1546,28 @@ void COMXPlayer::Process() m_video_fifo = (int)(100.0*(m_omxPlayerVideo.GetDecoderBufferSize()-m_omxPlayerVideo.GetDecoderFreeSpace())/m_omxPlayerVideo.GetDecoderBufferSize()); m_audio_fifo = (int)(100.0*audio_fifo/m_omxPlayerAudio.GetCacheTotal()); @@ -14517,7 +13582,7 @@ index a811169..d074dbe 100644 if (audio_pts != DVD_NOPTS_VALUE) { audio_fifo_low = m_HasAudio && audio_fifo < threshold; -@@ -1590,13 +1591,12 @@ void COMXPlayer::Process() +@@ -1582,13 +1583,12 @@ void COMXPlayer::Process() if (!m_HasVideo && m_HasAudio) video_fifo_high = true; @@ -14584,10 +13649,10 @@ index e6bf2d0..aa5ea43 100644 || m_speed < 0) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index edbbcad..b9fc3ae 100644 +index 59b4d9e..e597a4e 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -1395,6 +1395,9 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se +@@ -1386,6 +1386,9 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se #ifdef HAVE_LIBCEC list.push_back(std::make_pair(g_localizeStrings.Get(679), LOGCEC)); #endif @@ -14601,10 +13666,10 @@ index edbbcad..b9fc3ae 100644 1.9.3 -From d9a51561c7cc6eb38c40b494b7f50fe5a7e85b78 Mon Sep 17 00:00:00 2001 +From 55725e4e4177382834f003c144aebf50000bf389 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 71/82] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 066/102] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -14831,10 +13896,10 @@ index 820ea44..6639804 100644 if (omx_err != OMX_ErrorNone) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index b9fc3ae..4c9aea4 100644 +index e597a4e..0530467 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -1398,6 +1398,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se +@@ -1389,6 +1389,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se #ifdef TARGET_RASPBERRY_PI list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER)); #endif @@ -14849,10 +13914,10 @@ index b9fc3ae..4c9aea4 100644 1.9.3 -From f98b36b22f3c7152e218ae22dacb3e7ac8024a52 Mon Sep 17 00:00:00 2001 +From 0cdbd90db8f90e1f6dd9703b1c7646e7813d7d1f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 28 May 2014 18:30:51 +0100 -Subject: [PATCH 72/82] [omxcodec] Reduce GPU memory use by 2 video frames +Subject: [PATCH 067/102] [omxcodec] Reduce GPU memory use by 2 video frames --- xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp | 14 ++++++++++++++ @@ -14887,10 +13952,10 @@ index 612ae21..494fdf5 100644 1.9.3 -From 100cd97b3ef5c514f012e6ee0d688775a471e66f Mon Sep 17 00:00:00 2001 +From 5f1289e7a8f03c67a50e626f87517daf15e35f25 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:15:10 +0100 -Subject: [PATCH 73/82] [pi] Fix for logged resolutions +Subject: [PATCH 068/102] [pi] Fix for logged resolutions --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 15 +++++---------- @@ -14958,10 +14023,10 @@ index 5b26b20..a3edf0e 100644 1.9.3 -From d3c05867d1ae056fbc53249a858b6787525b993d Mon Sep 17 00:00:00 2001 +From 22f4be7399f9b9fc57cd735b498699a736cce6a7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 74/82] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 069/102] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -14969,7 +14034,7 @@ Subject: [PATCH 74/82] [settings] Experiment: Report DESKTOP resolution in 1 file changed, 3 insertions(+) diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp -index 246a047..0204839 100644 +index bb31f15..eae549b 100644 --- a/xbmc/settings/DisplaySettings.cpp +++ b/xbmc/settings/DisplaySettings.cpp @@ -650,6 +650,9 @@ void CDisplaySettings::SettingOptionsResolutionsFiller(const CSetting *setting, @@ -14986,10 +14051,10 @@ index 246a047..0204839 100644 1.9.3 -From c02792997861e0dff7d1f7cc81180f8eb46384c8 Mon Sep 17 00:00:00 2001 +From b8f5d4e406cf9934aa4e8a37880122d78c01f9b9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 7 Jun 2014 16:55:41 +0100 -Subject: [PATCH 75/82] [omx] Remove logging for texture jobs +Subject: [PATCH 070/102] [omx] Remove logging for texture jobs This causes a lot of log spam which hasn't proved useful so far. --- @@ -15034,21 +14099,21 @@ index 262a004..d529b20 100644 1.9.3 -From 8ecc8fbdc4aedff11b0c930078ba6519f26b5d20 Mon Sep 17 00:00:00 2001 +From a0a6be81a50eabf6e4f02df6ce11298c73287b74 Mon Sep 17 00:00:00 2001 From: Matthias Kortstiege Date: Sun, 1 Jun 2014 18:47:20 +0200 -Subject: [PATCH 76/82] changed: avoid useless filesytem io while searching for - subtitles +Subject: [PATCH 071/102] changed: avoid useless filesytem io while searching + for subtitles --- xbmc/Util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp -index 82cbf4b..4340700 100644 +index b33f142..4eabca6 100644 --- a/xbmc/Util.cpp +++ b/xbmc/Util.cpp -@@ -1983,7 +1983,7 @@ void CUtil::ScanForExternalSubtitles(const CStdString& strMovie, std::vector Date: Wed, 4 Jun 2014 19:10:27 +0100 -Subject: [PATCH 77/82] [pisink] Support planar formats +Subject: [PATCH 072/102] [pisink] Support planar formats --- xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 35 ++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -index 7c04919..bf9cb7a 100644 +index 0a09275..5a45653 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp @@ -180,7 +180,9 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device) @@ -15109,7 +14174,7 @@ index 7c04919..bf9cb7a 100644 m_pcm_input.nChannels = channels; m_pcm_input.nSamplingRate = m_format.m_sampleRate; -@@ -308,14 +316,18 @@ double CAESinkPi::GetCacheTotal() +@@ -306,14 +314,18 @@ double CAESinkPi::GetCacheTotal() unsigned int CAESinkPi::AddPackets(uint8_t **data, unsigned int frames, unsigned int offset) { @@ -15127,9 +14192,9 @@ index 7c04919..bf9cb7a 100644 + const int chans = AE_IS_PLANAR(m_format.m_dataFormat) ? 1 : channels; + const int pitch = chans * sample_size; + - double delay = GetDelay(); - if (delay <= 0.0 && m_submitted) - CLog::Log(LOGNOTICE, "%s:%s Underrun (delay:%.2f frames:%d)", CLASSNAME, __func__, delay, frames); + AEDelayStatus status; + GetDelay(status); + double delay = status.GetDelay(); @@ -332,8 +344,13 @@ unsigned int CAESinkPi::AddPackets(uint8_t **data, unsigned int frames, unsigned assert(omx_buffer->nFilledLen <= omx_buffer->nAllocLen); omx_buffer->nTimeStamp = ToOMXTime(0); @@ -15145,7 +14210,7 @@ index 7c04919..bf9cb7a 100644 omx_err = m_omx_render.EmptyThisBuffer(omx_buffer); if (omx_err != OMX_ErrorNone) CLog::Log(LOGERROR, "%s:%s frames=%d err=%x", CLASSNAME, __func__, frames, omx_err); -@@ -367,8 +384,13 @@ void CAESinkPi::EnumerateDevicesEx(AEDeviceInfoList &list, bool force) +@@ -370,8 +387,13 @@ void CAESinkPi::EnumerateDevicesEx(AEDeviceInfoList &list, bool force) for (unsigned int i=0; i Date: Mon, 30 Dec 2013 12:02:14 +0000 -Subject: [PATCH 78/82] [rbp] Hardware accelerated resampling +Subject: [PATCH 073/102] [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. @@ -15195,7 +14260,7 @@ Requires updated firmware create mode 100644 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp -index 8250eef..972e1be 100644 +index 03946c3..5feeefb 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp @@ -18,6 +18,10 @@ @@ -15209,7 +14274,7 @@ index 8250eef..972e1be 100644 #include "ActiveAEResample.h" #include "utils/log.h" -@@ -359,3 +363,4 @@ int CActiveAEResample::GetAVChannelIndex(enum AEChannel aechannel, uint64_t layo +@@ -360,3 +364,4 @@ int CActiveAEResample::GetAVChannelIndex(enum AEChannel aechannel, uint64_t layo { return av_get_channel_layout_channel_index(layout, GetAVChannel(aechannel)); } @@ -15920,7 +14985,7 @@ index 0000000..47a9e08 + +} diff --git a/xbmc/cores/AudioEngine/Makefile.in b/xbmc/cores/AudioEngine/Makefile.in -index c27d207..ebc74fa 100644 +index 581249e..20c05bb 100644 --- a/xbmc/cores/AudioEngine/Makefile.in +++ b/xbmc/cores/AudioEngine/Makefile.in @@ -31,6 +31,7 @@ SRCS += Engines/ActiveAE/ActiveAESink.cpp @@ -15932,7 +14997,7 @@ index c27d207..ebc74fa 100644 ifeq (@USE_ANDROID@,1) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -index bf9cb7a..277f7b9 100644 +index 5a45653..2733054 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp @@ -78,9 +78,9 @@ static void SetAudioProps(bool stream_channels, uint32_t channel_map) @@ -16009,10 +15074,10 @@ index 99e407a..8d3c86a 100644 1.9.3 -From baf8fa8c24bfab7ff414b923e4d93740c7d4748a Mon Sep 17 00:00:00 2001 +From e32cc71fee0020cee3013e5ecf2f9b02cb25d45b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 1 Jun 2014 12:15:17 +0100 -Subject: [PATCH 79/82] [resamplepi] Support planar formats +Subject: [PATCH 074/102] [resamplepi] Support planar formats --- .../Engines/ActiveAE/ActiveAEResamplePi.cpp | 101 ++++++++++++--------- @@ -16211,3 +15276,2141 @@ index 9a1e549..1604030 100644 -- 1.9.3 + +From 0c7fcb56fea44e24064788e2c6910ad961ed17c6 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 15 Jun 2014 13:20:53 +0100 +Subject: [PATCH 075/102] gles: Avoid crash when capturing snapshot when using + dvdplayer + +Note: snapshot will be blank, but that's better than crashing +--- + xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp +index 2929a37..53873f6 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp +@@ -1598,7 +1598,9 @@ bool CLinuxRendererGLES::RenderCapture(CRenderCapture* capture) + return false; + + // If rendered directly by the hardware ++#ifndef TARGET_RASPBERRY_PI + if (m_renderMethod & RENDER_BYPASS) ++#endif + { + capture->BeginRender(); + capture->EndRender(); +-- +1.9.3 + + +From d7bcc5ae49d12b97a9da7c5572d5f555c98859ec Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 16 Jun 2014 19:05:14 +0100 +Subject: [PATCH 076/102] sqlite: Bump to 3080500 + +--- + tools/depends/target/sqlite3/Makefile | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tools/depends/target/sqlite3/Makefile b/tools/depends/target/sqlite3/Makefile +index 87f7eaa..8fe61e8 100644 +--- a/tools/depends/target/sqlite3/Makefile ++++ b/tools/depends/target/sqlite3/Makefile +@@ -3,7 +3,9 @@ DEPS= ../../Makefile.include Makefile + + # lib name, version + LIBNAME=sqlite +-VERSION=3071000 ++VERSION=3080500 ++BASE_URL=https://www.sqlite.org/2014 ++ + SOURCE=$(LIBNAME)-autoconf-$(VERSION) + ARCHIVE=$(SOURCE).tar.gz + +-- +1.9.3 + + +From 2b4f3f978406571d6dfb690ca4e282e3ee0c4b14 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 16 Jun 2014 19:06:00 +0100 +Subject: [PATCH 077/102] [experimental] Disable quiet-noise generation + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +index 488a0df..d9f4a43 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +@@ -870,6 +870,7 @@ void CActiveAESink::SwapInit(CSampleBuffer* samples) + + void CActiveAESink::GenerateNoise() + { ++#ifndef TARGET_RASPBERRY_PI + int nb_floats = m_sampleOfSilence.pkt->max_nb_samples; + nb_floats *= m_sampleOfSilence.pkt->config.channels; + +@@ -907,6 +908,7 @@ void CActiveAESink::GenerateNoise() + (uint8_t**)&noise, m_sampleOfSilence.pkt->max_nb_samples, 1.0); + + _aligned_free(noise); ++#endif + } + + void CActiveAESink::SetSilenceTimer() +-- +1.9.3 + + +From 05d761fea469710297870c52ac2e154cbcda5d9a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 16 Jun 2014 19:07:21 +0100 +Subject: [PATCH 078/102] [omxcodec] Adjust asserts + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp +index 494fdf5..23aaa9f 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp +@@ -795,7 +795,7 @@ int COpenMaxVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + // 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); ++ assert(m_dts_queue.size() < 64); + pthread_mutex_unlock(&m_omx_output_mutex); + } + #endif +@@ -1037,9 +1037,12 @@ OMX_ERRORTYPE COpenMaxVideo::DecoderFillBufferDone( + 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(); ++ if (!m_dts_queue.empty()) ++ { ++ buffer->dts = m_dts_queue.front(); ++ m_dts_queue.pop(); ++ } ++ else assert(0); + pthread_mutex_unlock(&m_omx_output_mutex); + } + #endif +-- +1.9.3 + + +From 41df02172c24c4426e2dd755207710de63987623 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:24:42 +0200 +Subject: [PATCH 079/102] Added some vc_tv_* functions that were missing in + DllBCM. + +--- + xbmc/linux/DllBCM.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/xbmc/linux/DllBCM.h b/xbmc/linux/DllBCM.h +index b92fdb8..9c7e293 100644 +--- a/xbmc/linux/DllBCM.h ++++ b/xbmc/linux/DllBCM.h +@@ -48,6 +48,9 @@ class DllBcmHostInterface + virtual void bcm_host_init() = 0; + virtual void bcm_host_deinit() = 0; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) = 0; ++ virtual int vc_tv_power_off() = 0; ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) = 0; ++ virtual int vc_tv_hdmi_power_on_preferred() = 0; + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) = 0; + virtual int vc_tv_hdmi_power_on_best_3d(uint32_t width, uint32_t height, uint32_t frame_rate, +@@ -92,6 +95,12 @@ class DllBcmHost : public DllDynamic, DllBcmHostInterface + { return ::bcm_host_deinit(); }; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) + { return ::graphics_get_display_size(display_number, width, height); }; ++ virtual int vc_tv_power_off() ++ { return ::vc_tv_power_off(); } ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) ++ { return ::vc_tv_sdtv_power_on(mode, options); } ++ virtual int vc_tv_hdmi_power_on_preferred() ++ { return ::vc_tv_hdmi_power_on_preferred(); } + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) + { return ::vc_tv_hdmi_power_on_best(width, height, frame_rate, scan_mode, match_flags); }; +-- +1.9.3 + + +From 8e14d993da8f0614b70dabdbb59fcb4cc79b6bc5 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:29:03 +0200 +Subject: [PATCH 080/102] Added private utility function to map a float display + aspect, to the respective SDTV_ASPECT_* enum value. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index a3edf0e..5ae2b59 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -410,6 +410,25 @@ static void SetResolutionString(RESOLUTION_INFO &res) + res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "", + res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : ""); + } ++ ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect) ++{ ++ SDTV_ASPECT_T aspect; ++ const float delta = 1e-3; ++ if(fabs(get_display_aspect_ratio(SDTV_ASPECT_16_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_16_9; ++ } ++ else if(fabs(get_display_aspect_ratio(SDTV_ASPECT_14_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_14_9; ++ } ++ else ++ { ++ aspect = SDTV_ASPECT_4_3; ++ } ++ return aspect; ++} + #endif + + bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) +-- +1.9.3 + + +From 73eebd2deb7924d492f9ba2b817dc52edf849a60 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 19:50:58 +0200 +Subject: [PATCH 081/102] Changed SDTV resolutions to be treated similarly to + HDMI resolutions in SetNativeResolution. This means that the SDTV interface + is powered up and set to the right mode. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 36 ++++++++++++++++++++----- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h | 1 - + 2 files changed, 29 insertions(+), 8 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 5ae2b59..712fe9c 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -220,7 +220,7 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + DestroyDispmaxWindow(); + +- if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + { + sem_init(&m_tv_synced, 0, 0); + m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); +@@ -274,6 +274,33 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + m_desktopRes = res; + } ++ else if(!GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ { ++ sem_init(&m_tv_synced, 0, 0); ++ m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); ++ ++ SDTV_OPTIONS_T options; ++ options.aspect = get_sdtv_aspect_from_display_aspect((float)res.iScreenWidth / (float)res.iScreenHeight); ++ ++ int success = m_DllBcmHost->vc_tv_sdtv_power_on((SDTV_MODE_T)GETFLAGS_MODE(res.dwFlags), &options); ++ ++ if (success == 0) ++ { ++ CLog::Log(LOGDEBUG, "EGL set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ ++ sem_wait(&m_tv_synced); ++ } ++ else ++ { ++ CLog::Log(LOGERROR, "EGL failed to set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ } ++ m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); ++ sem_destroy(&m_tv_synced); ++ ++ m_desktopRes = res; ++ } + + m_dispman_display = m_DllBcmHost->vc_dispmanx_display_open(0); + +@@ -439,8 +466,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + if(!m_DllBcmHost) + return false; + +- m_fixedMode = false; +- + /* read initial desktop resolution before probe resolutions. + * probing will replace the desktop resolution when it finds the same one. + * we raplace it because probing will generate more detailed +@@ -483,7 +508,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iHeight = tv_state.display.sdtv.height; + m_desktopRes.iScreenWidth = tv_state.display.sdtv.width; + m_desktopRes.iScreenHeight= tv_state.display.sdtv.height; +- m_desktopRes.dwFlags = D3DPRESENTFLAG_INTERLACED; ++ m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1); + m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; + 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); + } +@@ -506,9 +531,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); + } + +- if(resolutions.size() < 2) +- m_fixedMode = true; +- + DLOG("CEGLNativeTypeRaspberryPI::ProbeResolutions\n"); + return true; + #else +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +index 59401f5..a0acb1a 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +@@ -59,7 +59,6 @@ class CEGLNativeTypeRaspberryPI : public CEGLNativeType + DISPMANX_ELEMENT_HANDLE_T m_dispman_element; + TV_GET_STATE_RESP_T m_tv_state; + sem_t m_tv_synced; +- bool m_fixedMode; + RESOLUTION_INFO m_desktopRes; + int m_width; + int m_height; +-- +1.9.3 + + +From 6edef341b2d0207ef9d817c844731c46a25b54f1 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 19:54:59 +0200 +Subject: [PATCH 082/102] Added methods SuspendVideoOutput() and + ResumeVideoOutput() to CRBP class, which can be used to power down the + Raspberry PI's video interface, and restore it at a later point. + +--- + xbmc/linux/RBP.cpp | 15 +++++++++++++++ + xbmc/linux/RBP.h | 3 +++ + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 3 +++ + 3 files changed, 21 insertions(+) + +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 9a5e9cb..87619e9 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -165,4 +165,19 @@ void CRBP::Deinitialize() + m_initialized = false; + m_omx_initialized = false; + } ++ ++void CRBP::SuspendVideoOutput() ++{ ++ CLog::Log(LOGDEBUG, "Raspberry PI suspending video output\n"); ++ char response[80]; ++ m_DllBcmHost->vc_gencmd(response, sizeof response, "display_power 0"); ++} ++ ++void CRBP::ResumeVideoOutput() ++{ ++ char response[80]; ++ m_DllBcmHost->vc_gencmd(response, sizeof response, "display_power 1"); ++ CLog::Log(LOGDEBUG, "Raspberry PI resuming video output\n"); ++} ++ + #endif +diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h +index 2aae579..f06687c 100644 +--- a/xbmc/linux/RBP.h ++++ b/xbmc/linux/RBP.h +@@ -57,6 +57,9 @@ class CRBP + unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); + DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } + ++ void SuspendVideoOutput(); ++ void ResumeVideoOutput(); ++ + private: + DllBcmHost *m_DllBcmHost; + bool m_initialized; +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 712fe9c..40d303e 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -58,7 +58,10 @@ + # define DLOG(fmt, args...) + #endif + ++#if defined(TARGET_RASPBERRY_PI) + static void SetResolutionString(RESOLUTION_INFO &res); ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect); ++#endif + + CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() + { +-- +1.9.3 + + +From 42be8acb22868ef82db0b30d15dc2c0114656ea3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 11 Aug 2013 15:03:36 +0100 +Subject: [PATCH 083/102] PowerManager (and its IPowerSyscall instance) now + gets called from CApplication::OnKey() and can process and suppress key + presses. This is a requirement to implement a virtual sleep state. + +--- + xbmc/Application.cpp | 7 +++++++ + xbmc/powermanagement/IPowerSyscall.h | 7 +++++++ + xbmc/powermanagement/PowerManager.cpp | 6 ++++++ + xbmc/powermanagement/PowerManager.h | 3 +++ + 4 files changed, 23 insertions(+) + +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index c9690fc..ce52040 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -2347,6 +2347,13 @@ bool CApplication::OnKey(const CKey& key) + // special handling if the screensaver is active + CAction action = CButtonTranslator::GetInstance().GetAction(iWin, key); + ++ // give the PowerManager a chance to process a keypress, and ++ // suppress further processing. we need this for virtual sleep. ++ if (g_powerManager.ProcessAction(action)) ++ { ++ return true; ++ } ++ + // a key has been pressed. + // reset Idle Timer + m_idleTimer.StartZero(); +diff --git a/xbmc/powermanagement/IPowerSyscall.h b/xbmc/powermanagement/IPowerSyscall.h +index 7f9e7ed..711abea 100644 +--- a/xbmc/powermanagement/IPowerSyscall.h ++++ b/xbmc/powermanagement/IPowerSyscall.h +@@ -20,6 +20,9 @@ + * + */ + ++// forward declaration ++class CAction; ++ + class IPowerEventsCallback + { + public: +@@ -60,6 +63,10 @@ class IPowerSyscall + \param callback the callback to signal to + */ + virtual bool PumpPowerEvents(IPowerEventsCallback *callback) = 0; ++ ++ // this is an optional part of the interface, so we provide a no-op implementation here. ++ // return true to suppress further processing of the CAction. ++ virtual bool ProcessAction(const CAction& action) { return false; } + }; + + class CPowerSyscallWithoutEvents : public IPowerSyscall +diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp +index fe72016..b392f76 100644 +--- a/xbmc/powermanagement/PowerManager.cpp ++++ b/xbmc/powermanagement/PowerManager.cpp +@@ -232,6 +232,12 @@ void CPowerManager::ProcessEvents() + nesting--; + } + ++bool CPowerManager::ProcessAction(const CAction& action) ++{ ++ return m_instance->ProcessAction(action); ++} ++ ++ + void CPowerManager::OnSleep() + { + CAnnouncementManager::Get().Announce(System, "xbmc", "OnSleep"); +diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h +index 0b1f10a..e42b143 100644 +--- a/xbmc/powermanagement/PowerManager.h ++++ b/xbmc/powermanagement/PowerManager.h +@@ -58,6 +58,8 @@ class CNullPowerSyscall : public IPowerSyscall + + + virtual bool PumpPowerEvents(IPowerEventsCallback *callback) { return false; } ++ ++ virtual bool ProcessAction(const CAction& action) { return false; } + }; + + // This class will wrap and handle PowerSyscalls. +@@ -87,6 +89,7 @@ class CPowerManager : public IPowerEventsCallback + + static void SettingOptionsShutdownStatesFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t, void *data); + ++ bool ProcessAction(const CAction& action); + private: + void OnSleep(); + void OnWake(); +-- +1.9.3 + + +From 5e7c6707827476ddf7875f551eb1895de0046986 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Wed, 17 Apr 2013 13:23:01 +0200 +Subject: [PATCH 084/102] Added CPowerSyscallVirtualSleep class, which acts as + a base class for devices that have no native standby mode, and need to fake + it in some way. + +--- + xbmc/powermanagement/Makefile | 1 + + xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 84 +++++++++++++++++++++++ + xbmc/powermanagement/PowerSyscallVirtualSleep.h | 56 +++++++++++++++ + 3 files changed, 141 insertions(+) + create mode 100644 xbmc/powermanagement/PowerSyscallVirtualSleep.cpp + create mode 100644 xbmc/powermanagement/PowerSyscallVirtualSleep.h + +diff --git a/xbmc/powermanagement/Makefile b/xbmc/powermanagement/Makefile +index 0b4c029..16056af 100644 +--- a/xbmc/powermanagement/Makefile ++++ b/xbmc/powermanagement/Makefile +@@ -1,5 +1,6 @@ + SRCS=DPMSSupport.cpp \ + PowerManager.cpp \ ++ PowerSyscallVirtualSleep.cpp \ + + LIB=powermanagement.a + +diff --git a/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp b/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp +new file mode 100644 +index 0000000..6a1e47b +--- /dev/null ++++ b/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp +@@ -0,0 +1,84 @@ ++/* ++ * Copyright (C) 2013 Team XBMC ++ * http://www.xbmc.org ++ * ++ * This Program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This Program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with XBMC; see the file COPYING. If not, see ++ * . ++ * ++ */ ++ ++#include "PowerSyscallVirtualSleep.h" ++#include "guilib/Key.h" ++#include "utils/log.h" ++#include "utils/StringUtils.h" ++ ++bool CPowerSyscallVirtualSleep::Suspend() ++{ ++ if (m_virtualSleepState == VIRTUAL_SLEEP_STATE_AWAKE) ++ { ++ if (VirtualSleep()) ++ { ++ m_virtualSleepState = VIRTUAL_SLEEP_STATE_WILL_SLEEP; ++ return true; ++ } ++ } ++ ++ return false; ++} ++ ++bool CPowerSyscallVirtualSleep::PumpPowerEvents(IPowerEventsCallback *callback) ++{ ++ if (m_virtualSleepState == VIRTUAL_SLEEP_STATE_WILL_WAKE) ++ { ++ callback->OnWake(); ++ m_virtualSleepState = VIRTUAL_SLEEP_STATE_AWAKE; ++ return true; ++ } ++ else if (m_virtualSleepState == VIRTUAL_SLEEP_STATE_WILL_SLEEP) ++ { ++ callback->OnSleep(); ++ m_virtualSleepState = VIRTUAL_SLEEP_STATE_ASLEEP; ++ return true; ++ } ++ ++ return false; ++} ++ ++bool CPowerSyscallVirtualSleep::ProcessAction(const CAction& action) ++{ ++ if (m_virtualSleepState != VIRTUAL_SLEEP_STATE_ASLEEP) ++ return false; ++ ++ // device is in virtual sleep, only one of the power keys will ++ // wake it up again. ++ if (action.GetID() == ACTION_BUILT_IN_FUNCTION) ++ { ++ CStdString name = action.GetName(); ++ StringUtils::ToLower(name); ++ if(name.Equals("xbmc.suspend()") || ++ name.Equals("shutdown") || ++ name.Equals("suspend") || ++ name.Equals("hibernate")) ++ { ++ if(VirtualWake()) ++ { ++ m_virtualSleepState = VIRTUAL_SLEEP_STATE_WILL_WAKE; ++ return false; ++ } ++ } ++ } ++ ++ // wasn't a power key, suppress this and stay asleep ++ return true; ++} +diff --git a/xbmc/powermanagement/PowerSyscallVirtualSleep.h b/xbmc/powermanagement/PowerSyscallVirtualSleep.h +new file mode 100644 +index 0000000..ef6e682 +--- /dev/null ++++ b/xbmc/powermanagement/PowerSyscallVirtualSleep.h +@@ -0,0 +1,56 @@ ++/* ++ * Copyright (C) 2013 Team XBMC ++ * http://www.xbmc.org ++ * ++ * This Program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This Program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with XBMC; see the file COPYING. If not, see ++ * . ++ * ++ */ ++ ++#ifndef _POWER_SYSCALL_VIRTUAL_SLEEP_H_ ++#define _POWER_SYSCALL_VIRTUAL_SLEEP_H_ ++#include "IPowerSyscall.h" ++ ++// Systems that have no native standby mode, can base their ++// IPowerSyscall implementation on this class, and need only ++// implement VirtualSleep()/VirtualWake(). ++class CPowerSyscallVirtualSleep : public IPowerSyscall ++{ ++public: ++ CPowerSyscallVirtualSleep() : m_virtualSleepState(VIRTUAL_SLEEP_STATE_AWAKE) {} ++ virtual ~CPowerSyscallVirtualSleep() {} ++ ++ virtual bool CanSuspend() { return true; } ++ virtual bool Suspend(); ++ ++ virtual bool PumpPowerEvents(IPowerEventsCallback *callback); ++ ++ virtual bool ProcessAction(const CAction& action); ++ ++ virtual bool VirtualSleep() = 0; ++ virtual bool VirtualWake() = 0; ++ ++protected: ++ // keep track of virtual sleep state for devices that support it ++ typedef enum { ++ VIRTUAL_SLEEP_STATE_AWAKE = 0, ++ VIRTUAL_SLEEP_STATE_ASLEEP, ++ VIRTUAL_SLEEP_STATE_WILL_WAKE, ++ VIRTUAL_SLEEP_STATE_WILL_SLEEP, ++ } VirtualSleepState; ++ ++ VirtualSleepState m_virtualSleepState; ++}; ++ ++#endif // _POWER_SYSCALL_VIRTUAL_SLEEP_H_ +-- +1.9.3 + + +From bd85dcc014d0cfdbebeb1c118af5e33b7ac377a9 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Wed, 17 Apr 2013 13:24:22 +0200 +Subject: [PATCH 085/102] Added power management support for the Raspberry Pi. + Since it doesn't support true standby, we fake it by turning video on or off, + and ignoring remote inputs during the standby phase. + +--- + xbmc/powermanagement/PowerManager.cpp | 4 ++ + xbmc/powermanagement/linux/Makefile | 1 + + .../linux/RaspberryPIPowerSyscall.cpp | 38 +++++++++++++++++ + .../linux/RaspberryPIPowerSyscall.h | 49 ++++++++++++++++++++++ + 4 files changed, 92 insertions(+) + create mode 100644 xbmc/powermanagement/linux/RaspberryPIPowerSyscall.cpp + create mode 100644 xbmc/powermanagement/linux/RaspberryPIPowerSyscall.h + +diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp +index b392f76..7dd691c 100644 +--- a/xbmc/powermanagement/PowerManager.cpp ++++ b/xbmc/powermanagement/PowerManager.cpp +@@ -38,6 +38,8 @@ + + #if defined(TARGET_DARWIN) + #include "osx/CocoaPowerSyscall.h" ++#elif defined(TARGET_RASPBERRY_PI) ++#include "linux/RaspberryPIPowerSyscall.h" + #elif defined(TARGET_ANDROID) + #include "android/AndroidPowerSyscall.h" + #elif defined(TARGET_POSIX) +@@ -74,6 +76,8 @@ void CPowerManager::Initialize() + { + #if defined(TARGET_DARWIN) + m_instance = new CCocoaPowerSyscall(); ++#elif defined(TARGET_RASPBERRY_PI) ++ m_instance = new CRaspberryPIPowerSyscall(); + #elif defined(TARGET_ANDROID) + m_instance = new CAndroidPowerSyscall(); + #elif defined(TARGET_POSIX) +diff --git a/xbmc/powermanagement/linux/Makefile b/xbmc/powermanagement/linux/Makefile +index fc6f8b5..10809da 100644 +--- a/xbmc/powermanagement/linux/Makefile ++++ b/xbmc/powermanagement/linux/Makefile +@@ -1,6 +1,7 @@ + SRCS=ConsoleDeviceKitPowerSyscall.cpp \ + ConsoleUPowerSyscall.cpp \ + HALPowerSyscall.cpp \ ++ RaspberryPIPowerSyscall.cpp \ + UPowerSyscall.cpp \ + LogindUPowerSyscall.cpp + +diff --git a/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.cpp b/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.cpp +new file mode 100644 +index 0000000..10deeb8 +--- /dev/null ++++ b/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.cpp +@@ -0,0 +1,38 @@ ++/* ++ * Copyright (C) 2013 Team XBMC ++ * http://www.xbmc.org ++ * ++ * This Program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This Program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with XBMC; see the file COPYING. If not, see ++ * . ++ * ++ */ ++ ++#if defined(TARGET_RASPBERRY_PI) ++ ++#include "RaspberryPIPowerSyscall.h" ++#include "RBP.h" ++ ++bool CRaspberryPIPowerSyscall::VirtualSleep() ++{ ++ g_RBP.SuspendVideoOutput(); ++ return true; ++} ++ ++bool CRaspberryPIPowerSyscall::VirtualWake() ++{ ++ g_RBP.ResumeVideoOutput(); ++ return true; ++} ++ ++#endif +diff --git a/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.h b/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.h +new file mode 100644 +index 0000000..fd1d67c +--- /dev/null ++++ b/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.h +@@ -0,0 +1,49 @@ ++#pragma once ++/* ++ * Copyright (C) 2013 Team XBMC ++ * http://www.xbmc.org ++ * ++ * This Program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This Program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with XBMC; see the file COPYING. If not, see ++ * . ++ * ++ */ ++ ++#ifndef _RASPBERRY_PI_POWER_SYSCALL_H_ ++#define _RASPBERRY_PI_POWER_SYSCALL_H_ ++ ++#if defined(TARGET_RASPBERRY_PI) ++#include "powermanagement/PowerSyscallVirtualSleep.h" ++ ++class CRaspberryPIPowerSyscall : public CPowerSyscallVirtualSleep ++{ ++public: ++ CRaspberryPIPowerSyscall() : CPowerSyscallVirtualSleep() {} ++ virtual ~CRaspberryPIPowerSyscall() {} ++ ++ virtual bool Powerdown() { return false; } ++ virtual bool Hibernate() { return false; } ++ virtual bool Reboot() { return false; } ++ ++ virtual bool CanPowerdown() { return false; } ++ virtual bool CanHibernate() { return false; } ++ virtual bool CanReboot() { return true; } ++ ++ virtual int BatteryLevel() { return 0; } ++ ++ virtual bool VirtualSleep(); ++ virtual bool VirtualWake(); ++}; ++#endif // TARGET_RASPBERRY_PI ++ ++#endif // _RASPBERRY_PI_POWER_SYSCALL_H_ +-- +1.9.3 + + +From ab50d8fcfe9c0e0fdb749ce7456a2ddbf58a8b45 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 3 Mar 2014 16:16:29 +0000 +Subject: [PATCH 086/102] [power] hack - don't kill lirc or cec + +--- + xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 37 +++++++++++++++++++++++ + xbmc/powermanagement/PowerManager.cpp | 4 +-- + 2 files changed, 39 insertions(+), 2 deletions(-) + +diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +index 6950f0c..4c8416f 100644 +--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp ++++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +@@ -183,12 +183,49 @@ void CPeripheralCecAdapter::Announce(AnnouncementFlag flag, const char *sender, + } + else if (flag == System && !strcmp(sender, "xbmc") && !strcmp(message, "OnSleep")) + { ++#if 1 ++ bool bSendStandbyCommands(false); ++ { ++ CSingleLock lock(m_critSection); ++ bSendStandbyCommands = m_iExitCode != EXITCODE_REBOOT && ++ m_iExitCode != EXITCODE_RESTARTAPP && ++ !m_bDeviceRemoved && ++ (!m_bGoingToStandby || GetSettingBool("standby_tv_on_pc_standby")) && ++ GetSettingBool("enabled"); ++ ++ if (m_bGoingToStandby) ++ m_bActiveSourceBeforeStandby = m_cecAdapter->IsLibCECActiveSource(); ++ } ++ ++ if (bSendStandbyCommands) ++ { ++ if (m_cecAdapter->IsLibCECActiveSource()) ++ { ++ if (!m_configuration.powerOffDevices.IsEmpty()) ++ { ++ CLog::Log(LOGDEBUG, "%s - sending standby commands", __FUNCTION__); ++ m_standbySent = CDateTime::GetCurrentDateTime(); ++ m_cecAdapter->StandbyDevices(); ++ } ++ else if (m_configuration.bSendInactiveSource == 1) ++ { ++ CLog::Log(LOGDEBUG, "%s - sending inactive source commands", __FUNCTION__); ++ m_cecAdapter->SetInactiveView(); ++ } ++ } ++ else ++ { ++ CLog::Log(LOGDEBUG, "%s - XBMC is not the active source, not sending any standby commands", __FUNCTION__); ++ } ++ } ++#else + // this will also power off devices when we're the active source + { + CSingleLock lock(m_critSection); + m_bGoingToStandby = true; + } + StopThread(); ++#endif + } + else if (flag == System && !strcmp(sender, "xbmc") && !strcmp(message, "OnWake")) + { +diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp +index 7dd691c..17f118a 100644 +--- a/xbmc/powermanagement/PowerManager.cpp ++++ b/xbmc/powermanagement/PowerManager.cpp +@@ -248,7 +248,7 @@ void CPowerManager::OnSleep() + CLog::Log(LOGNOTICE, "%s: Running sleep jobs", __FUNCTION__); + + // stop lirc +-#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE) ++#if 0 //defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE) + CLog::Log(LOGNOTICE, "%s: Stopping lirc", __FUNCTION__); + CBuiltins::Execute("LIRC.Stop"); + #endif +@@ -284,7 +284,7 @@ void CPowerManager::OnWake() + #endif + + // restart lirc +-#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE) ++#if 0 // defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE) + CLog::Log(LOGNOTICE, "%s: Restarting lirc", __FUNCTION__); + CBuiltins::Execute("LIRC.Start"); + #endif +-- +1.9.3 + + +From 18db33d3f1fe0f10f1dec1979f27d08c72a1a5b2 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 3 Mar 2014 16:47:54 +0000 +Subject: [PATCH 087/102] [power] hack - wake on any action + +--- + xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp b/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp +index 6a1e47b..a717a09 100644 +--- a/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp ++++ b/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp +@@ -62,14 +62,14 @@ bool CPowerSyscallVirtualSleep::ProcessAction(const CAction& action) + + // device is in virtual sleep, only one of the power keys will + // wake it up again. +- if (action.GetID() == ACTION_BUILT_IN_FUNCTION) ++ //if (action.GetID() == ACTION_BUILT_IN_FUNCTION) + { + CStdString name = action.GetName(); + StringUtils::ToLower(name); +- if(name.Equals("xbmc.suspend()") || ++ /*if(name.Equals("system.suspend") || + name.Equals("shutdown") || + name.Equals("suspend") || +- name.Equals("hibernate")) ++ name.Equals("hibernate"))*/ + { + if(VirtualWake()) + { +-- +1.9.3 + + +From 61a6f6564b85012f9c6666b3d9f5ccb2299ae138 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 3 Mar 2014 17:30:07 +0000 +Subject: [PATCH 088/102] [power] hack - Make suspend toggle suspend state + +--- + xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp b/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp +index a717a09..d39c3ed 100644 +--- a/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp ++++ b/xbmc/powermanagement/PowerSyscallVirtualSleep.cpp +@@ -33,6 +33,11 @@ bool CPowerSyscallVirtualSleep::Suspend() + return true; + } + } ++ else if (VirtualWake()) ++ { ++ m_virtualSleepState = VIRTUAL_SLEEP_STATE_WILL_WAKE; ++ return false; ++ } + + return false; + } +-- +1.9.3 + + +From 9d8ab89dc5dec5b3d2c7a42f0875eda5761b3320 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 4 Mar 2014 19:33:44 +0000 +Subject: [PATCH 089/102] [power] Add back in powerdown and reboot + +--- + .../linux/RaspberryPIPowerSyscall.cpp | 34 ++++++++++++++++++++++ + .../linux/RaspberryPIPowerSyscall.h | 6 ++-- + 2 files changed, 37 insertions(+), 3 deletions(-) + +diff --git a/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.cpp b/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.cpp +index 10deeb8..220bca9 100644 +--- a/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.cpp ++++ b/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.cpp +@@ -20,7 +20,11 @@ + + #if defined(TARGET_RASPBERRY_PI) + ++#include "system.h" + #include "RaspberryPIPowerSyscall.h" ++#if defined(HAS_DBUS) ++#include "LogindUPowerSyscall.h" ++#endif + #include "RBP.h" + + bool CRaspberryPIPowerSyscall::VirtualSleep() +@@ -35,4 +39,34 @@ bool CRaspberryPIPowerSyscall::VirtualWake() + return true; + } + ++bool CRaspberryPIPowerSyscall::Powerdown() ++{ ++ int s = false; ++#if defined(HAS_DBUS) ++ if (CLogindUPowerSyscall::HasLogind()) ++ { ++ IPowerSyscall *m_instance = new CLogindUPowerSyscall; ++ if (m_instance->CanPowerdown()) ++ s = m_instance->Powerdown(); ++ delete m_instance; ++ } ++#endif ++ return s; ++} ++ ++bool CRaspberryPIPowerSyscall::Reboot() ++{ ++ int s = false; ++#if defined(HAS_DBUS) ++ if (CLogindUPowerSyscall::HasLogind()) ++ { ++ IPowerSyscall *m_instance = new CLogindUPowerSyscall; ++ if (m_instance->CanReboot()) ++ s = m_instance->Reboot(); ++ delete m_instance; ++ } ++#endif ++ return s; ++} ++ + #endif +diff --git a/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.h b/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.h +index fd1d67c..062132e 100644 +--- a/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.h ++++ b/xbmc/powermanagement/linux/RaspberryPIPowerSyscall.h +@@ -31,11 +31,11 @@ class CRaspberryPIPowerSyscall : public CPowerSyscallVirtualSleep + CRaspberryPIPowerSyscall() : CPowerSyscallVirtualSleep() {} + virtual ~CRaspberryPIPowerSyscall() {} + +- virtual bool Powerdown() { return false; } ++ virtual bool Powerdown(); + virtual bool Hibernate() { return false; } +- virtual bool Reboot() { return false; } ++ virtual bool Reboot(); + +- virtual bool CanPowerdown() { return false; } ++ virtual bool CanPowerdown() { return true; } + virtual bool CanHibernate() { return false; } + virtual bool CanReboot() { return true; } + +-- +1.9.3 + + +From 251012ede3883268a585bc4d3fe11c4d9e782d67 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 18 Jun 2014 23:11:28 +0100 +Subject: [PATCH 090/102] [rbp] Reduce GPU memory use when limited + +Switching from default triple buffered output to double buffered saves 8M with 1080p GUI. +This may slightly reduce framerate, but is likely to be minimal. + +Assume if gpu_mem is set below the default 128M that this memory reduction is wanted +--- + xbmc/linux/RBP.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 87619e9..9f72a36 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -72,6 +72,9 @@ bool CRBP::Initialize() + if (vc_gencmd(response, sizeof response, "codec_enabled WVC1") == 0) + m_codec_wvc1_enabled = strcmp("WVC1=enabled", response) == 0; + ++ if (m_gpu_mem < 128) ++ setenv("V3D_DOUBLE_BUFFER", "1", 1); ++ + g_OMXImage.Initialize(); + m_omx_image_init = true; + return true; +-- +1.9.3 + + +From a8bb89d0dba9cac1bd738043355e3364a098f089 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 19 Jun 2014 18:44:10 +0100 +Subject: [PATCH 091/102] ActiveAE: Add queries to determine number of channels + output + +--- + xbmc/cores/AudioEngine/AEFactory.cpp | 14 ++++++++++++++ + xbmc/cores/AudioEngine/AEFactory.h | 2 ++ + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 17 +++++++++++++++++ + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 2 ++ + xbmc/cores/AudioEngine/Interfaces/AE.h | 12 ++++++++++++ + 5 files changed, 47 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/AEFactory.cpp b/xbmc/cores/AudioEngine/AEFactory.cpp +index fe8d51c..cccf7f1 100644 +--- a/xbmc/cores/AudioEngine/AEFactory.cpp ++++ b/xbmc/cores/AudioEngine/AEFactory.cpp +@@ -216,6 +216,20 @@ bool CAEFactory::SupportsSilenceTimeout() + return false; + } + ++bool CAEFactory::IsStereoConfig() ++{ ++ if(AE) ++ return AE->IsStereoConfig(); ++ return false; ++} ++ ++bool CAEFactory::IsNotHDAudioConfig() ++{ ++ if(AE) ++ return AE->IsNotHDAudioConfig(); ++ return false; ++} ++ + /** + * Returns true if current AudioEngine supports at lest two basic quality levels + * @return true if quality setting is supported, otherwise false +diff --git a/xbmc/cores/AudioEngine/AEFactory.h b/xbmc/cores/AudioEngine/AEFactory.h +index 1d8bf36..658997b 100644 +--- a/xbmc/cores/AudioEngine/AEFactory.h ++++ b/xbmc/cores/AudioEngine/AEFactory.h +@@ -54,6 +54,8 @@ class CAEFactory + static std::string GetDefaultDevice(bool passthrough); + static bool SupportsRaw(AEDataFormat format, int samplerate); + static bool SupportsSilenceTimeout(); ++ static bool IsStereoConfig(); ++ static bool IsNotHDAudioConfig(); + + /** + * Returns true if current AudioEngine supports at lest two basic quality levels +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 3ac182a..5820a5d 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -2251,6 +2251,23 @@ bool CActiveAE::SupportsSilenceTimeout() + return true; + } + ++bool CActiveAE::IsStereoConfig() ++{ ++ std:string device = CSettings::Get().GetString("audiooutput.audiodevice"); ++ int numChannels = (m_sink.GetDeviceType(device) == AE_DEVTYPE_IEC958) ? AE_CH_LAYOUT_2_0 : CSettings::Get().GetInt("audiooutput.channels"); ++ bool passthrough = CSettings::Get().GetInt("audiooutput.config") == AE_CONFIG_FIXED ? false : CSettings::Get().GetBool("audiooutput.passthrough"); ++ return numChannels == AE_CH_LAYOUT_2_0 && ! (passthrough && ++ CSettings::Get().GetBool("audiooutput.ac3passthrough") && ++ CSettings::Get().GetBool("audiooutput.ac3transcode")); ++} ++ ++bool CActiveAE::IsNotHDAudioConfig() ++{ ++ std:string device = CSettings::Get().GetString("audiooutput.audiodevice"); ++ int numChannels = (m_sink.GetDeviceType(device) == AE_DEVTYPE_IEC958) ? AE_CH_LAYOUT_2_0 : CSettings::Get().GetInt("audiooutput.channels"); ++ return numChannels <= AE_CH_LAYOUT_5_1; ++} ++ + bool CActiveAE::SupportsQualityLevel(enum AEQuality level) + { + if (level == AE_QUALITY_LOW || level == AE_QUALITY_MID || level == AE_QUALITY_HIGH) +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +index bfb65d6..5467aa4 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +@@ -229,6 +229,8 @@ class CActiveAE : public IAE, private CThread + virtual std::string GetDefaultDevice(bool passthrough); + virtual bool SupportsRaw(AEDataFormat format, int samplerate); + virtual bool SupportsSilenceTimeout(); ++ virtual bool IsStereoConfig(); ++ virtual bool IsNotHDAudioConfig(); + virtual bool SupportsQualityLevel(enum AEQuality level); + virtual bool IsSettingVisible(const std::string &settingId); + virtual void KeepConfiguration(unsigned int millis); +diff --git a/xbmc/cores/AudioEngine/Interfaces/AE.h b/xbmc/cores/AudioEngine/Interfaces/AE.h +index 3379bf6..eaa3a19 100644 +--- a/xbmc/cores/AudioEngine/Interfaces/AE.h ++++ b/xbmc/cores/AudioEngine/Interfaces/AE.h +@@ -211,6 +211,18 @@ class IAE + */ + virtual bool SupportsSilenceTimeout() { return false; } + ++ /** ++ * Returns true if the AudioEngine is currently configured for stereo audio ++ * @returns true if the AudioEngine is currently configured for stereo audio ++ */ ++ virtual bool IsStereoConfig() { return false; } ++ ++ /** ++ * Returns true if the AudioEngine is currently configured for 5.1 or less ++ * @returns true if the AudioEngine is currently configured for 5.1 or less ++ */ ++ virtual bool IsNotHDAudioConfig() { return false; } ++ + virtual void RegisterAudioCallback(IAudioCallback* pCallback) {} + + virtual void UnregisterAudioCallback() {} +-- +1.9.3 + + +From 9b8f061b96f56dafb0bf4a198ad99556e740a84a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 13 Mar 2014 16:08:46 +0000 +Subject: [PATCH 092/102] [omxplayer] Make use of audio decode fast paths 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. + +Many users end up downmixing this 7.1 stream back to 2.0. +Much better to tell the codec we only need the 2.0 stream. + +When playing a 94s duration video file on an overclocked Pi, the audio decode took: +7.1 channels: 39.6s +5.1 channels: 36.5s +2.0 channels: 23.0s + +So, it's almost twice as fast to decode TrueHD when only stereo is required. +--- + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +index bb3bea4..814fe1d 100644 +--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp ++++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +@@ -25,6 +25,7 @@ + #include "utils/log.h" + + #include "cores/AudioEngine/Utils/AEUtil.h" ++#include "cores/AudioEngine/AEFactory.h" + + // the size of the audio_render output port buffers + #define AUDIO_DECODE_OUTPUT_BUFFER (32*1024) +@@ -86,6 +87,15 @@ bool COMXAudioCodecOMX::Open(CDVDStreamInfo &hints) + m_pCodecContext->block_align = hints.blockalign; + m_pCodecContext->bit_rate = hints.bitrate; + m_pCodecContext->bits_per_coded_sample = hints.bitspersample; ++ if (hints.codec == AV_CODEC_ID_TRUEHD) ++ { ++ if (CAEFactory::IsStereoConfig()) ++ m_pCodecContext->request_channel_layout = AV_CH_LAYOUT_STEREO; ++ else if (CAEFactory::IsNotHDAudioConfig()) ++ m_pCodecContext->request_channel_layout = AV_CH_LAYOUT_5POINT1; ++ } ++ if (m_pCodecContext->request_channel_layout) ++ CLog::Log(LOGNOTICE,"COMXAudioCodecOMX::Open() Requesting channel layout of %x", (unsigned)m_pCodecContext->request_channel_layout); + + // vorbis has variable sized planar output, so skip concatenation + if (hints.codec == AV_CODEC_ID_VORBIS) +-- +1.9.3 + + +From b4e5c374bfcab5cb3dce973ef84cb5e1d3f3c8d5 Mon Sep 17 00:00:00 2001 +From: Matthias Kortstiege +Date: Sun, 29 Jun 2014 11:10:07 +0200 +Subject: [PATCH 095/102] no need to compute slow hash on changes in case the + fast one already succeeded + +--- + xbmc/video/VideoInfoScanner.cpp | 51 +++++++++++++++++++++-------------------- + 1 file changed, 26 insertions(+), 25 deletions(-) + +diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp +index e0056bd..a0b1a00 100644 +--- a/xbmc/video/VideoInfoScanner.cpp ++++ b/xbmc/video/VideoInfoScanner.cpp +@@ -267,40 +267,41 @@ namespace VIDEO + CStdString fastHash = GetFastHash(strDirectory, regexps); + if (m_database.GetPathHash(strDirectory, dbHash) && !fastHash.empty() && fastHash == dbHash) + { // fast hashes match - no need to process anything +- CLog::Log(LOGDEBUG, "VideoInfoScanner: Skipping dir '%s' due to no change (fasthash)", CURL::GetRedacted(strDirectory).c_str()); + hash = fastHash; +- bSkip = true; + } +- if (!bSkip) ++ else + { // need to fetch the folder + CDirectory::GetDirectory(strDirectory, items, g_advancedSettings.m_videoExtensions); + items.Stack(); +- // compute hash +- GetPathHash(items, hash); +- if (hash != dbHash && !hash.empty()) ++ ++ // check whether to re-use previously computed fast hash ++ if (!CanFastHash(items, regexps) || fastHash.empty()) ++ GetPathHash(items, hash); ++ else ++ hash = fastHash; ++ } ++ ++ if (hash == dbHash || (hash.empty() && !dbHash.empty())) ++ { ++ if (hash.empty() && !dbHash.empty()) + { +- if (dbHash.empty()) +- CLog::Log(LOGDEBUG, "VideoInfoScanner: Scanning dir '%s' as not in the database", CURL::GetRedacted(strDirectory).c_str()); +- else +- CLog::Log(LOGDEBUG, "VideoInfoScanner: Rescanning dir '%s' due to change (%s != %s)", CURL::GetRedacted(strDirectory).c_str(), dbHash.c_str(), hash.c_str()); ++ CLog::Log(LOGDEBUG, "VideoInfoScanner: Skipping dir '%s' as it's empty or doesn't exist - adding to clean list", CURL::GetRedacted(strDirectory).c_str()); ++ if (m_bClean) ++ m_pathsToClean.insert(m_database.GetPathId(strDirectory)); + } + else +- { // they're the same or the hash is empty (dir empty/dir not retrievable) +- if (hash.empty() && !dbHash.empty()) +- { +- CLog::Log(LOGDEBUG, "VideoInfoScanner: Skipping dir '%s' as it's empty or doesn't exist - adding to clean list", CURL::GetRedacted(strDirectory).c_str()); +- if (m_bClean) +- m_pathsToClean.insert(m_database.GetPathId(strDirectory)); +- } +- else +- CLog::Log(LOGDEBUG, "VideoInfoScanner: Skipping dir '%s' due to no change", CURL::GetRedacted(strDirectory).c_str()); +- bSkip = true; +- if (m_handle) +- OnDirectoryScanned(strDirectory); ++ { ++ CLog::Log(LOGDEBUG, "VideoInfoScanner: Skipping dir '%s' due to no change%s", CURL::GetRedacted(strDirectory).c_str(), !fastHash.empty() ? " (fasthash)" : ""); + } +- // update the hash to a fast hash if needed +- if (CanFastHash(items, regexps) && !fastHash.empty()) +- hash = fastHash; ++ ++ bSkip = true; ++ } ++ else ++ { ++ if (dbHash.empty()) ++ CLog::Log(LOGDEBUG, "VideoInfoScanner: Scanning dir '%s' as not in the database", CURL::GetRedacted(strDirectory).c_str()); ++ else ++ CLog::Log(LOGDEBUG, "VideoInfoScanner: Rescanning dir '%s' due to change (%s != %s)", CURL::GetRedacted(strDirectory).c_str(), dbHash.c_str(), hash.c_str()); + } + } + else if (content == CONTENT_TVSHOWS) +-- +1.9.3 + + +From cd7b60465faeea8c911e8b779bb4eb861ab97e4f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 27 Jun 2014 00:01:05 +0100 +Subject: [PATCH 096/102] [rbp] Resume video output on startup + +--- + xbmc/linux/RBP.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 9f72a36..f789bf1 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -75,6 +75,9 @@ bool CRBP::Initialize() + if (m_gpu_mem < 128) + setenv("V3D_DOUBLE_BUFFER", "1", 1); + ++ // in case xbcm was restarted when suspended ++ ResumeVideoOutput(); ++ + g_OMXImage.Initialize(); + m_omx_image_init = true; + return true; +-- +1.9.3 + + +From cf66a3902ad562b29323f901f05821ccf0dc2209 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 27 Jun 2014 00:36:29 +0100 +Subject: [PATCH 097/102] [omxplayer] Experimental support for anaglyph + rendering of 3d videos + +Requires updated firmware +--- + xbmc/cores/omxplayer/OMXPlayer.cpp | 12 ++++++++-- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 32 ++++++++++++++++++++++++++- + xbmc/cores/omxplayer/OMXVideo.cpp | 39 +++++++++++++++++++++------------ + xbmc/cores/omxplayer/OMXVideo.h | 3 ++- + xbmc/rendering/RenderSystem.cpp | 4 ++++ + 5 files changed, 72 insertions(+), 18 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp +index 4e0662f..6cebdc4 100644 +--- a/xbmc/cores/omxplayer/OMXPlayer.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayer.cpp +@@ -1503,6 +1503,8 @@ void COMXPlayer::Process() + SetCaching(CACHESTATE_FLUSH); + + EDEINTERLACEMODE current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; ++ RENDER_STEREO_MODE current_stereomode = g_graphicsContext.GetStereoMode(); ++ + float current_sharpness = CMediaSettings::Get().GetCurrentVideoSettings().m_Sharpness; + SetSharpness(current_sharpness); + +@@ -1525,8 +1527,13 @@ void COMXPlayer::Process() + float threshold = 0.1f; + bool audio_fifo_low = false, video_fifo_low = false, audio_fifo_high = false, video_fifo_high = false; + +- // if deinterlace setting has changed, we should close and open video +- if (current_deinterlace != CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode) ++ // if deinterlace or stereomode setting has changed, we should close and open video ++ RENDER_STEREO_MODE stereomode = g_graphicsContext.GetStereoMode(); ++ ++ if ((current_deinterlace != CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode) || ++ (current_stereomode != stereomode && ++ (current_stereomode == RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN || current_stereomode == RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA) != ++ (stereomode == RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN || stereomode == RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA))) + { + int iStream = m_CurrentVideo.id, source = m_CurrentVideo.source; + CloseVideoStream(false); +@@ -1534,6 +1541,7 @@ void COMXPlayer::Process() + if (m_State.canseek) + m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), true, true, true, true, true)); + current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; ++ current_stereomode = stereomode; + } + + // if sharpness setting has changed, we should update it +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index aa5ea43..4d06f1d 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -549,7 +549,29 @@ bool OMXPlayerVideo::OpenDecoder() + else + m_fForcedAspectRatio = 0.0; + +- bool bVideoDecoderOpen = m_omxVideo.Open(m_hints, m_av_clock, CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode, m_hdmi_clock_sync); ++ ++ unsigned flags = GetStereoModeFlags(GetStereoMode()); ++ RENDER_STEREO_MODE video_stereo_mode = (flags & CONF_FLAGS_STEREO_MODE_SBS) ? RENDER_STEREO_MODE_SPLIT_VERTICAL : ++ (flags & CONF_FLAGS_STEREO_MODE_TAB) ? RENDER_STEREO_MODE_SPLIT_HORIZONTAL : RENDER_STEREO_MODE_OFF; ++ bool stereo_invert = (flags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; ++ OMX_IMAGEFILTERANAGLYPHTYPE anaglyph = OMX_ImageFilterAnaglyphNone; ++ ++ if (g_graphicsContext.GetStereoMode() == RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN) ++ { ++ if (video_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) ++ anaglyph = OMX_ImageFilterAnaglyphSBStoRedCyan; ++ else if (video_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) ++ anaglyph = OMX_ImageFilterAnaglyphTABtoRedCyan; ++ } ++ else if (g_graphicsContext.GetStereoMode() == RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA) ++ { ++ if (video_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) ++ anaglyph = OMX_ImageFilterAnaglyphSBStoGreenMagenta; ++ else if (video_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) ++ anaglyph = OMX_ImageFilterAnaglyphTABtoGreenMagenta; ++ } ++ ++ bool bVideoDecoderOpen = m_omxVideo.Open(m_hints, m_av_clock, CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode, anaglyph, m_hdmi_clock_sync); + m_omxVideo.RegisterResolutionUpdateCallBack((void *)this, ResolutionUpdateCallBack); + + if(!bVideoDecoderOpen) +@@ -694,6 +716,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + video_stereo_mode = RENDER_STEREO_MODE_OFF; + display_stereo_mode = RENDER_STEREO_MODE_OFF; + } ++ else if (display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN || display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA) ++ { ++ SrcRect.x2 *= 2.0f; ++ } + else if (stereo_invert) + { + SrcRect.x1 += m_hints.width / 2; +@@ -710,6 +736,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + video_stereo_mode = RENDER_STEREO_MODE_OFF; + display_stereo_mode = RENDER_STEREO_MODE_OFF; + } ++ else if (display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN || display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA) ++ { ++ SrcRect.y2 *= 2.0f; ++ } + else if (stereo_invert) + { + SrcRect.y1 += m_hints.height / 2; +diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp +index 6639804..07c4643 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXVideo.cpp +@@ -113,6 +113,7 @@ COMXVideo::COMXVideo() : m_video_codec_name("") + m_extrasize = 0; + m_deinterlace = false; + m_deinterlace_request = VS_DEINTERLACEMODE_OFF; ++ m_anaglyph = OMX_ImageFilterAnaglyphNone; + m_hdmi_clock_sync = false; + m_drop_state = false; + m_decoded_width = 0; +@@ -227,9 +228,9 @@ bool COMXVideo::PortSettingsChanged() + else + m_deinterlace = interlace.eMode != OMX_InterlaceProgressive; + +- CLog::Log(LOGDEBUG, "%s::%s - %dx%d@%.2f interlace:%d deinterlace:%d", CLASSNAME, __func__, ++ CLog::Log(LOGDEBUG, "%s::%s - %dx%d@%.2f interlace:%d deinterlace:%d anaglyph:%d", CLASSNAME, __func__, + port_image.format.video.nFrameWidth, port_image.format.video.nFrameHeight, +- port_image.format.video.xFramerate / (float)(1<<16), interlace.eMode, m_deinterlace); ++ port_image.format.video.xFramerate / (float)(1<<16), interlace.eMode, m_deinterlace, m_anaglyph); + + // let OMXPlayerVideo know about resolution so it can inform RenderManager + if (m_res_callback) +@@ -256,7 +257,7 @@ bool COMXVideo::PortSettingsChanged() + if(!m_omx_sched.Initialize("OMX.broadcom.video_scheduler", OMX_IndexParamVideoInit)) + return false; + +- if(m_deinterlace) ++ if(m_deinterlace || m_anaglyph) + { + if(!m_omx_image_fx.Initialize("OMX.broadcom.image_fx", OMX_IndexParamImageInit)) + return false; +@@ -296,16 +297,24 @@ bool COMXVideo::PortSettingsChanged() + } + } + +- if(m_deinterlace) ++ if(m_deinterlace || m_anaglyph) + { + OMX_CONFIG_IMAGEFILTERPARAMSTYPE image_filter; + OMX_INIT_STRUCTURE(image_filter); + + image_filter.nPortIndex = m_omx_image_fx.GetOutputPort(); +- image_filter.nNumParams = 1; +- image_filter.nParams[0] = 3; +- image_filter.eImageFilter = OMX_ImageFilterDeInterlaceAdvanced; +- ++ if (m_anaglyph != OMX_ImageFilterAnaglyphNone) ++ { ++ image_filter.nNumParams = 1; ++ image_filter.nParams[0] = m_anaglyph; ++ image_filter.eImageFilter = OMX_ImageFilterAnaglyph; ++ } ++ else ++ { ++ image_filter.nNumParams = 1; ++ image_filter.nParams[0] = 3; ++ image_filter.eImageFilter = OMX_ImageFilterDeInterlaceAdvanced; ++ } + omx_err = m_omx_image_fx.SetConfig(OMX_IndexConfigCommonImageFilterParameters, &image_filter); + if(omx_err != OMX_ErrorNone) + { +@@ -314,7 +323,7 @@ bool COMXVideo::PortSettingsChanged() + } + } + +- if(m_deinterlace) ++ if(m_deinterlace || m_anaglyph) + { + m_omx_tunnel_decoder.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_image_fx, m_omx_image_fx.GetInputPort()); + m_omx_tunnel_image_fx.Initialize(&m_omx_image_fx, m_omx_image_fx.GetOutputPort(), &m_omx_sched, m_omx_sched.GetInputPort()); +@@ -341,7 +350,7 @@ bool COMXVideo::PortSettingsChanged() + return false; + } + +- if(m_deinterlace) ++ if(m_deinterlace || m_anaglyph) + { + omx_err = m_omx_tunnel_image_fx.Establish(); + if(omx_err != OMX_ErrorNone) +@@ -383,7 +392,7 @@ bool COMXVideo::PortSettingsChanged() + return true; + } + +-bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE deinterlace, bool hdmi_clock_sync) ++bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE deinterlace, OMX_IMAGEFILTERANAGLYPHTYPE anaglyph, bool hdmi_clock_sync) + { + CSingleLock lock (m_critSection); + bool vflip = false; +@@ -523,6 +532,7 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de + break; + } + m_deinterlace_request = deinterlace; ++ m_anaglyph = anaglyph; + + if(!m_omx_decoder.Initialize(decoder_name, OMX_IndexParamVideoInit)) + return false; +@@ -734,7 +744,7 @@ void COMXVideo::Close() + dump_omx_buffer(NULL); + m_omx_tunnel_clock.Deestablish(); + m_omx_tunnel_decoder.Deestablish(); +- if(m_deinterlace) ++ if(m_deinterlace || m_anaglyph) + m_omx_tunnel_image_fx.Deestablish(); + m_omx_tunnel_sched.Deestablish(); + +@@ -742,7 +752,7 @@ void COMXVideo::Close() + + m_omx_sched.Deinitialize(); + m_omx_decoder.Deinitialize(); +- if(m_deinterlace) ++ if(m_deinterlace || m_anaglyph) + m_omx_image_fx.Deinitialize(); + m_omx_render.Deinitialize(); + +@@ -755,6 +765,7 @@ void COMXVideo::Close() + + m_video_codec_name = ""; + m_deinterlace = false; ++ m_anaglyph = OMX_ImageFilterAnaglyphNone; + m_av_clock = NULL; + + m_res_ctx = NULL; +@@ -878,7 +889,7 @@ void COMXVideo::Reset(void) + + m_setStartTime = true; + m_omx_decoder.FlushInput(); +- if(m_deinterlace) ++ if(m_deinterlace || m_anaglyph) + m_omx_image_fx.FlushInput(); + } + +diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h +index 226000e..e2e79c2 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.h ++++ b/xbmc/cores/omxplayer/OMXVideo.h +@@ -49,7 +49,7 @@ class COMXVideo + + // Required overrides + bool SendDecoderConfig(); +- bool Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE deinterlace = VS_DEINTERLACEMODE_OFF, bool hdmi_clock_sync = false); ++ bool Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE deinterlace = VS_DEINTERLACEMODE_OFF, OMX_IMAGEFILTERANAGLYPHTYPE anaglyph = OMX_ImageFilterAnaglyphNone, bool hdmi_clock_sync = false); + bool PortSettingsChanged(); + void RegisterResolutionUpdateCallBack(void *ctx, ResolutionUpdateCallBackFn callback) { m_res_ctx = ctx; m_res_callback = callback; } + void Close(void); +@@ -94,6 +94,7 @@ class COMXVideo + + bool m_deinterlace; + EDEINTERLACEMODE m_deinterlace_request; ++ OMX_IMAGEFILTERANAGLYPHTYPE m_anaglyph; + bool m_hdmi_clock_sync; + ResolutionUpdateCallBackFn m_res_callback; + void *m_res_ctx; +diff --git a/xbmc/rendering/RenderSystem.cpp b/xbmc/rendering/RenderSystem.cpp +index e5a98f6..3ee28e0 100644 +--- a/xbmc/rendering/RenderSystem.cpp ++++ b/xbmc/rendering/RenderSystem.cpp +@@ -73,6 +73,10 @@ bool CRenderSystemBase::SupportsStereo(RENDER_STEREO_MODE mode) const + case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: + case RENDER_STEREO_MODE_SPLIT_VERTICAL: + case RENDER_STEREO_MODE_MONO: ++#ifdef TARGET_RASPBERRY_PI ++ case RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN: ++ case RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA: ++#endif + return true; + default: + return false; +-- +1.9.3 + + +From 2ec74d1273d13709bde43877856dfba84cb3e808 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 2 Jul 2014 12:24:01 +0100 +Subject: [PATCH 098/102] [settings] Add update flag to omx acceleration + +--- + system/settings/settings.xml | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index 7d1d51f..5b67ee6 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -740,6 +740,9 @@ + + 2 + true ++ ++ ++ + + + +-- +1.9.3 + + +From 300cf12bc8ebd2e5114581820fe55474b3c39ffc Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 1 Jul 2014 00:38:54 +0100 +Subject: [PATCH 099/102] [omx] Avoid hang following jpegs that failed to + decode + +There's a few instanced of xbmc hanging following a jpeg that failed to decode on GPU: +http://forum.stmlabs.com/showthread.php?tid=14839 +https://github.com/raspberrypi/firmware/issues/288 +http://openelec.tv/forum/120-news-announcements/70709-openelec-4-0-released?start=15#105219 + +It should fail and continue with software decode. It hangs on the OMX_FreeBuffer call. +Looks like image_decode component should be returned to idle state before freeing buffers +when operation did not complete successfully +--- + xbmc/cores/omxplayer/OMXImage.cpp | 78 ++++++++++++++++++++++++++------------- + xbmc/cores/omxplayer/OMXImage.h | 4 ++ + 2 files changed, 56 insertions(+), 26 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXImage.cpp b/xbmc/cores/omxplayer/OMXImage.cpp +index d529b20..f5fe546 100644 +--- a/xbmc/cores/omxplayer/OMXImage.cpp ++++ b/xbmc/cores/omxplayer/OMXImage.cpp +@@ -902,6 +902,7 @@ COMXImageDec::COMXImageDec() + { + m_decoded_buffer = NULL; + OMX_INIT_STRUCTURE(m_decoded_format); ++ m_success = false; + } + + COMXImageDec::~COMXImageDec() +@@ -916,15 +917,20 @@ void COMXImageDec::Close() + { + CSingleLock lock(m_OMXSection); + +- if(m_omx_decoder.IsInitialized()) +- { +- m_omx_decoder.FlushInput(); +- m_omx_decoder.FreeInputBuffers(); +- } +- if(m_omx_resize.IsInitialized()) ++ if (!m_success) + { +- m_omx_resize.FlushOutput(); +- m_omx_resize.FreeOutputBuffers(); ++ if(m_omx_decoder.IsInitialized()) ++ { ++ m_omx_decoder.SetStateForComponent(OMX_StateIdle); ++ m_omx_decoder.FlushInput(); ++ m_omx_decoder.FreeInputBuffers(); ++ } ++ if(m_omx_resize.IsInitialized()) ++ { ++ m_omx_resize.SetStateForComponent(OMX_StateIdle); ++ m_omx_resize.FlushOutput(); ++ m_omx_resize.FreeOutputBuffers(); ++ } + } + if(m_omx_tunnel_decode.IsInitialized()) + m_omx_tunnel_decode.Deestablish(); +@@ -1177,6 +1183,7 @@ bool COMXImageDec::Decode(const uint8_t *demuxer_content, unsigned demuxer_bytes + + memcpy( (char*)pixels, m_decoded_buffer->pBuffer, stride * height); + ++ m_success = true; + Close(); + return true; + } +@@ -1191,6 +1198,7 @@ COMXImageEnc::COMXImageEnc() + CSingleLock lock(m_OMXSection); + OMX_INIT_STRUCTURE(m_encoded_format); + m_encoded_buffer = NULL; ++ m_success = false; + } + + COMXImageEnc::~COMXImageEnc() +@@ -1416,6 +1424,7 @@ COMXImageReEnc::COMXImageReEnc() + m_encoded_buffer = NULL; + m_pDestBuffer = NULL; + m_nDestAllocSize = 0; ++ m_success = false; + } + + COMXImageReEnc::~COMXImageReEnc() +@@ -1431,15 +1440,24 @@ void COMXImageReEnc::Close() + { + CSingleLock lock(m_OMXSection); + +- if(m_omx_decoder.IsInitialized()) +- { +- m_omx_decoder.FlushInput(); +- m_omx_decoder.FreeInputBuffers(); +- } +- if(m_omx_encoder.IsInitialized()) ++ if (!m_success) + { +- m_omx_encoder.FlushOutput(); +- m_omx_encoder.FreeOutputBuffers(); ++ if(m_omx_decoder.IsInitialized()) ++ { ++ m_omx_decoder.SetStateForComponent(OMX_StateIdle); ++ m_omx_decoder.FlushInput(); ++ m_omx_decoder.FreeInputBuffers(); ++ } ++ if(m_omx_resize.IsInitialized()) ++ { ++ m_omx_resize.SetStateForComponent(OMX_StateIdle); ++ } ++ if(m_omx_encoder.IsInitialized()) ++ { ++ m_omx_encoder.SetStateForComponent(OMX_StateIdle); ++ m_omx_encoder.FlushOutput(); ++ m_omx_encoder.FreeOutputBuffers(); ++ } + } + if(m_omx_tunnel_decode.IsInitialized()) + m_omx_tunnel_decode.Deestablish(); +@@ -1856,14 +1874,15 @@ bool COMXImageReEnc::ReEncode(COMXImageFile &srcFile, unsigned int maxWidth, uns + } + } + +- Close(); +- + if(m_omx_decoder.BadState()) + return false; + + pDestBuffer = m_pDestBuffer; + CLog::Log(LOGDEBUG, "%s::%s : %s %dx%d -> %dx%d\n", CLASSNAME, __func__, srcFile.GetFilename(), srcFile.GetWidth(), srcFile.GetHeight(), maxWidth, maxHeight); + ++ m_success = true; ++ Close(); ++ + return true; + } + +@@ -1875,6 +1894,7 @@ bool COMXImageReEnc::ReEncode(COMXImageFile &srcFile, unsigned int maxWidth, uns + + COMXTexture::COMXTexture() + { ++ m_success = false; + } + + COMXTexture::~COMXTexture() +@@ -1886,15 +1906,20 @@ void COMXTexture::Close() + { + CSingleLock lock(m_OMXSection); + +- if(m_omx_decoder.IsInitialized()) +- { +- m_omx_decoder.FlushInput(); +- m_omx_decoder.FreeInputBuffers(); +- } +- if(m_omx_egl_render.IsInitialized()) ++ if (!m_success) + { +- m_omx_egl_render.FlushOutput(); +- m_omx_egl_render.FreeOutputBuffers(); ++ if(m_omx_decoder.IsInitialized()) ++ { ++ m_omx_decoder.SetStateForComponent(OMX_StateIdle); ++ m_omx_decoder.FlushInput(); ++ m_omx_decoder.FreeInputBuffers(); ++ } ++ if(m_omx_egl_render.IsInitialized()) ++ { ++ m_omx_egl_render.SetStateForComponent(OMX_StateIdle); ++ m_omx_egl_render.FlushOutput(); ++ m_omx_egl_render.FreeOutputBuffers(); ++ } + } + if (m_omx_tunnel_decode.IsInitialized()) + m_omx_tunnel_decode.Deestablish(); +@@ -2196,6 +2221,7 @@ bool COMXTexture::Decode(const uint8_t *demuxer_content, unsigned demuxer_bytes, + eos = true; + } + } ++ m_success = true; + Close(); + return true; + } +diff --git a/xbmc/cores/omxplayer/OMXImage.h b/xbmc/cores/omxplayer/OMXImage.h +index ec7a229..62e931a 100644 +--- a/xbmc/cores/omxplayer/OMXImage.h ++++ b/xbmc/cores/omxplayer/OMXImage.h +@@ -135,6 +135,7 @@ class COMXImageDec + OMX_BUFFERHEADERTYPE *m_decoded_buffer; + OMX_PARAM_PORTDEFINITIONTYPE m_decoded_format; + CCriticalSection m_OMXSection; ++ bool m_success; + }; + + class COMXImageEnc +@@ -153,6 +154,7 @@ class COMXImageEnc + OMX_BUFFERHEADERTYPE *m_encoded_buffer; + OMX_PARAM_PORTDEFINITIONTYPE m_encoded_format; + CCriticalSection m_OMXSection; ++ bool m_success; + }; + + class COMXImageReEnc +@@ -176,6 +178,7 @@ class COMXImageReEnc + CCriticalSection m_OMXSection; + void *m_pDestBuffer; + unsigned int m_nDestAllocSize; ++ bool m_success; + }; + + class COMXTexture +@@ -200,6 +203,7 @@ class COMXTexture + + OMX_BUFFERHEADERTYPE *m_egl_buffer; + CCriticalSection m_OMXSection; ++ bool m_success; + }; + + extern COMXImage g_OMXImage; +-- +1.9.3 + + +From 1fe4b152bde3a10c2e1499fb038088105f23eb0a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 2 Jul 2014 20:41:29 +0100 +Subject: [PATCH 100/102] [pi] Reduce time textures are held for when memory is + low + +--- + xbmc/Application.cpp | 9 +++++++++ + xbmc/linux/RBP.cpp | 10 ++++++++++ + xbmc/linux/RBP.h | 1 + + 3 files changed, 20 insertions(+) + +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index ce52040..c6c20e4 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -348,6 +348,10 @@ + #include "utils/AMLUtils.h" + #endif + ++#if defined(TARGET_RASPBERRY_PI) ++#include "linux/RBP.h" ++#endif ++ + #include "cores/FFmpeg.h" + + using namespace std; +@@ -5154,6 +5158,11 @@ void CApplication::ProcessSlow() + if (!m_pPlayer->IsPlayingVideo()) + g_largeTextureManager.CleanupUnusedImages(); + ++#ifdef TARGET_RASPBERRY_PI ++ if (g_RBP.GetGpuMemFree() < 64) ++ g_TextureManager.FreeUnusedTextures(); ++ else ++#endif + g_TextureManager.FreeUnusedTextures(5000); + + #ifdef HAS_DVD_DRIVE +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index f789bf1..65c95a3 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -83,6 +83,16 @@ bool CRBP::Initialize() + return true; + } + ++int CRBP::GetGpuMemFree() ++{ ++ int reloc_mem = 0; ++ char response[80] = ""; ++ ++ if (vc_gencmd(response, sizeof response, "get_mem reloc") == 0) ++ vc_gencmd_number_property(response, "reloc", &reloc_mem); ++ return reloc_mem; ++} ++ + void CRBP::LogFirmwareVerison() + { + char response[1024]; +diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h +index f06687c..bf6dfdb 100644 +--- a/xbmc/linux/RBP.h ++++ b/xbmc/linux/RBP.h +@@ -50,6 +50,7 @@ class CRBP + void Deinitialize(); + int GetArmMem() { return m_arm_mem; } + int GetGpuMem() { return m_gpu_mem; } ++ int GetGpuMemFree(); + bool GetCodecMpg2() { return m_codec_mpg2_enabled; } + bool GetCodecWvc1() { return m_codec_wvc1_enabled; } + void GetDisplaySize(int &width, int &height); +-- +1.9.3 + + +From 845be398a669796dab1867168595e2b14e5f2916 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 2 Jul 2014 21:03:59 +0100 +Subject: [PATCH 101/102] [omx] Restrict the number of outstanding jpeg calls + to gpu + +Allowing more than one outstanding call to gpu for texture encode/decode can be beneficial as processing +can be overlapped with vchiq message transfer. + +Experimentally, 3 outstanding operations is optimal. + +Allowing more that this ties up memory on GPU without any performance benefit, so avoid submitting more jobs +--- + xbmc/cores/omxplayer/OMXImage.cpp | 35 +++++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +diff --git a/xbmc/cores/omxplayer/OMXImage.cpp b/xbmc/cores/omxplayer/OMXImage.cpp +index f5fe546..a3704da 100644 +--- a/xbmc/cores/omxplayer/OMXImage.cpp ++++ b/xbmc/cores/omxplayer/OMXImage.cpp +@@ -49,6 +49,33 @@ + #define EXIF_TAG_ORIENTATION 0x0112 + + ++// A helper for restricting threads calling GPU functions to limit memory use ++static XbmcThreads::ConditionVariable g_count_cond; ++static CCriticalSection g_count_lock; ++static int g_count_val; ++ ++static void limit_calls_enter(int &count, int allowed) ++{ ++ //printf("%s in=%d\n", __func__, m_count_val); ++ CSingleLock lock(g_count_lock); ++ while (count >= allowed) ++ { ++ g_count_cond.wait(lock); ++ } ++ count++; ++ //printf("%s out=%d\n", __func__, m_count_val); ++} ++ ++static void limit_calls_leave(int &count) ++{ ++ //printf("%s in=%d\n", __func__, m_count_val); ++ CSingleLock lock(g_count_lock); ++ count--; ++ g_count_cond.notifyAll(); ++ //printf("%s out=%d\n", __func__, m_count_val); ++} ++ ++ + #ifdef CLASSNAME + #undef CLASSNAME + #endif +@@ -900,6 +927,7 @@ bool COMXImageFile::ReadFile(const CStdString& inputFile) + + COMXImageDec::COMXImageDec() + { ++ limit_calls_enter(g_count_val, 3); + m_decoded_buffer = NULL; + OMX_INIT_STRUCTURE(m_decoded_format); + m_success = false; +@@ -911,6 +939,7 @@ COMXImageDec::~COMXImageDec() + + OMX_INIT_STRUCTURE(m_decoded_format); + m_decoded_buffer = NULL; ++ limit_calls_leave(g_count_val); + } + + void COMXImageDec::Close() +@@ -1195,6 +1224,7 @@ bool COMXImageDec::Decode(const uint8_t *demuxer_content, unsigned demuxer_bytes + + COMXImageEnc::COMXImageEnc() + { ++ limit_calls_enter(g_count_val, 3); + CSingleLock lock(m_OMXSection); + OMX_INIT_STRUCTURE(m_encoded_format); + m_encoded_buffer = NULL; +@@ -1209,6 +1239,7 @@ COMXImageEnc::~COMXImageEnc() + m_encoded_buffer = NULL; + if(m_omx_encoder.IsInitialized()) + m_omx_encoder.Deinitialize(); ++ limit_calls_leave(g_count_val); + } + + bool COMXImageEnc::Encode(unsigned char *buffer, int size, unsigned width, unsigned height, unsigned int pitch) +@@ -1421,6 +1452,7 @@ bool COMXImageEnc::CreateThumbnailFromSurface(unsigned char* buffer, unsigned in + + COMXImageReEnc::COMXImageReEnc() + { ++ limit_calls_enter(g_count_val, 3); + m_encoded_buffer = NULL; + m_pDestBuffer = NULL; + m_nDestAllocSize = 0; +@@ -1434,6 +1466,7 @@ COMXImageReEnc::~COMXImageReEnc() + free (m_pDestBuffer); + m_pDestBuffer = NULL; + m_nDestAllocSize = 0; ++ limit_calls_leave(g_count_val); + } + + void COMXImageReEnc::Close() +@@ -1894,12 +1927,14 @@ bool COMXImageReEnc::ReEncode(COMXImageFile &srcFile, unsigned int maxWidth, uns + + COMXTexture::COMXTexture() + { ++ limit_calls_enter(g_count_val, 3); + m_success = false; + } + + COMXTexture::~COMXTexture() + { + Close(); ++ limit_calls_leave(g_count_val); + } + + void COMXTexture::Close() +-- +1.9.3 + + +From edd99869f9079a7f6fb783485eee0a77f461d253 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 5 Jul 2014 19:26:46 +0100 +Subject: [PATCH 102/102] [omxplayer] Explictly choose deinterlace method for + 1080i + +As the 1080i deinterlace doesn't require the 3 frames of context we can save ~6MB by requesting it explicitly +--- + xbmc/cores/omxplayer/OMXVideo.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp +index 07c4643..e2a3d27 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXVideo.cpp +@@ -313,7 +313,10 @@ bool COMXVideo::PortSettingsChanged() + { + image_filter.nNumParams = 1; + image_filter.nParams[0] = 3; +- image_filter.eImageFilter = OMX_ImageFilterDeInterlaceAdvanced; ++ if (port_image.format.video.nFrameWidth * port_image.format.video.nFrameHeight > 576 * 720) ++ image_filter.eImageFilter = OMX_ImageFilterDeInterlaceFast; ++ else ++ image_filter.eImageFilter = OMX_ImageFilterDeInterlaceAdvanced; + } + omx_err = m_omx_image_fx.SetConfig(OMX_IndexConfigCommonImageFilterParameters, &image_filter); + if(omx_err != OMX_ErrorNone) +-- +1.9.3 +