|
Ginga
0.13.6.1771-df200
The iTV middleware.
|
#include "ginga.h"#include <config.h>#include "aux-glib.h"#include <math.h>#include <stdlib.h>#include <gdk/gdk.h>#include <gst/app/gstappsink.h>#include <gst/gst.h>#include <gst/video/video.h>#include <algorithm>#include <list>#include <map>#include <set>#include <string>#include <vector>

Go to the source code of this file.
Classes | |
| class | UserData |
Macros | |
| #define | GINGA_PRAGMA_DIAG PRAGMA_DIAG |
| #define | GINGA_PRAGMA_DIAG_PUSH PRAGMA_DIAG_PUSH |
| #define | GINGA_PRAGMA_DIAG_POP PRAGMA_DIAG_POP |
| #define | GINGA_PRAGMA_DIAG_IGNORE PRAGMA_DIAG_IGNORE |
| #define | GINGA_PRAGMA_DIAG_WARNING PRAGMA_DIAG_WARNING |
| #define | GINGA_NAMESPACE_BEGIN namespace ginga {/*}*/ |
| #define | GINGA_NAMESPACE_END /*{*/} |
| #define | unused(...) G_GNUC_UNUSED __VA_ARGS__ |
| #define | cast(a, b) (dynamic_cast<a>((b))) |
| #define | instanceof(a, b) (cast (a,(b)) != nullptr) |
| #define | tryinsert(a, b, fn) |
| #define | MAP_GET_IMPL(m, a, b) |
| #define | MAP_SET_IMPL(m, a, b) |
| #define | GINGA_STRFUNC (__ginga_strfunc (G_STRFUNC)).c_str () |
| #define | __ginga_log(fn, fmt, ...) fn ("%s: " fmt, GINGA_STRFUNC, ## __VA_ARGS__) |
| #define | TRACE(fmt, ...) __ginga_log (g_debug, fmt, ## __VA_ARGS__) |
| #define | WARNING(fmt, ...) __ginga_log (g_warning, fmt, ## __VA_ARGS__) |
| #define | ERROR(fmt, ...) __ginga_log (g_error, fmt, ## __VA_ARGS__) |
| #define | CRITICAL(fmt, ...) __ginga_log (g_critical, fmt, ## __VA_ARGS__) |
| #define | ERROR_NOT_IMPLEMENTED(fmt, ...) ERROR ("not implemented: " fmt, ## __VA_ARGS__) |
| #define | GINGA_TIME_NONE GST_CLOCK_TIME_NONE |
| #define | GINGA_TIME_IS_VALID(t) GST_CLOCK_TIME_IS_VALID ((t)) |
| #define | GINGA_STIME_NONE GST_CLOCK_STIME_NONE |
| #define | GINGA_STIME_IS_VALID(t) GST_CLOCK_STIME_IS_VALID ((t)) |
| #define | GINGA_SECOND GST_SECOND |
| #define | GINGA_MSECOND GST_MSECOND |
| #define | GINGA_USECOND GST_USECOND |
| #define | GINGA_NSECOND GST_NSECOND |
| #define | GINGA_TIME_AS_SECONDS(t) GST_TIME_AS_SECONDS ((t)) |
| #define | GINGA_TIME_AS_MSECONDS(t) GST_TIME_AS_MSECONDS ((t)) |
| #define | GINGA_TIME_AS_USECONDS(t) GST_TIME_AS_USECONDS ((t)) |
| #define | GINGA_TIME_AS_NSECONDS(t) GST_TIME_AS_NSECONDS ((t)) |
| #define | GINGA_TIME_DIFF(s, e) GST_CLOCK_DIFF ((s), (e)) |
| #define | GINGA_TIME_FORMAT GST_TIME_FORMAT |
| #define | GINGA_TIME_ARGS(t) GST_TIME_ARGS ((t)) |
| #define | GINGA_STIME_FORMAT GST_STIME_FORMAT |
| #define | GINGA_STIME_ARGS(t) GST_STIME_ARGS ((t)) |
| #define | xstrcaseeq(s1, s2) (xstrcasecmp ((s1), (s2)) == 0) |
Typedefs | |
| typedef GdkRGBA | Color |
| typedef GdkRectangle | Rect |
| typedef GstClockTime | Time |
| typedef void(* | UserDataCleanFunc) (void *) |
Functions | |
| string | __ginga_strfunc (const string &) |
| Parses G_STRFUNC string to generate a log prefix. More... | |
| bool | try_parse_bool (const string &, bool *) |
| Parses boolean string. More... | |
| bool | parse_bool (const string &) |
| bool | try_parse_color (const string &, Color *) |
| Parses color string. More... | |
| Color | parse_color (const string &) |
| bool | try_parse_list (const string &, char, size_t, size_t, list< string > *) |
| Parses list of string items. More... | |
| list< string > | parse_list (const string &, char, size_t, size_t) |
| bool | try_parse_time (const string &, Time *) |
| Time | parse_time (const string &) |
| int | parse_percent (const string &, int, int, int) |
| Parses number or percent string to an integer. More... | |
| guint8 | parse_pixel (const string &) |
| Parses pixel string to an integer. More... | |
| bool | _xstrtod (const string &, double *) |
| Converts string to a floating-point number. More... | |
| bool | _xstrtoll (const string &, gint64 *, guint) |
| Converts string to a 64-bit integer. More... | |
| bool | _xstrtoull (const string &, guint64 *, guint) |
| Converts string to an unsigned 64-bit integer. More... | |
| double | xstrtod (const string &) |
| gint | xstrtoint (const string &, guint8) |
| gint8 | xstrtoint8 (const string &, guint8) |
| gint64 | xstrtoint64 (const string &, guint8) |
| guint | xstrtouint (const string &, guint8) |
| guint8 | xstrtouint8 (const string &, guint8) |
| guint64 | xstrtouint64 (const string &, guint8) |
| bool | xstrispercent (const string &) |
| Checks if string is a percent value. More... | |
| double | xstrtodorpercent (const string &, bool *) |
| Converts number or percent string to floating-point number. More... | |
| int | xstrcasecmp (const string &, const string &) |
| Compares two strings ignoring case. More... | |
| bool | xstrhasprefix (const string &, const string &) |
| Tests string prefix. More... | |
| bool | xstrhassuffix (const string &, const string &) |
| Tests string suffix. More... | |
| int | G_GNUC_PRINTF (2, 3) xstrassign(string & |
| int const char string | G_GNUC_PRINTF (1, 2) xstrbuild(const char * |
| int const char string string | xstrstrip (string) |
| Removes leading and trailing whitespace from string. More... | |
| list< string > | xstrsplit (const string &, char) |
| Splits strings according to separator. More... | |
| string | xpathbasename (string) |
| Returns the basename of path. More... | |
| string | xpathdirname (string) |
| Returns the dirname of path. More... | |
| bool | xpathisabs (const string &) |
| Checks if path is absolute. More... | |
| bool | xpathisuri (const string &) |
| Checks if path is an URI. More... | |
| string | xpathmakeabs (string) |
| Makes path absolute. More... | |
| string | xpathbuild (const string &, const string &) |
| Builds a path from the given components. More... | |
| string | xpathbuildabs (const string &, const string &) |
| Builds an absolute path from the given components. More... | |
| #define __ginga_log | ( | fn, | |
| fmt, | |||
| ... | |||
| ) | fn ("%s: " fmt, GINGA_STRFUNC, ## __VA_ARGS__) |
| #define cast | ( | a, | |
| b | |||
| ) | (dynamic_cast<a>((b))) |
Referenced by Document::addObject(), NclLink::contains(), NclNode::derefer(), Document::evalAction(), NclPort::getFinalInterface(), NclPort::getFinalNode(), NclComposition::getMapInterface(), NclComposition::getNestedNode(), NclNode::getProperty(), NclNode::hasProperty(), ncl_pop_causalConnector(), ncl_pop_context(), ncl_pop_ncl(), ncl_push_context(), ncl_push_link(), ncl_push_media(), ncl_push_port(), ncl_push_property(), ncl_push_simpleConditionOrAction(), Formatter::obtainEvent(), Formatter::obtainExecutionObject(), Formatter::obtainFormatterEventFromBind(), ParserXercesC::parseBind(), ParserXercesC::parseMedia(), ParserXercesC::parseSwitch(), ParserState::popContext(), ParserState::popNcl(), ParserState::pushArea(), ParserState::pushContext(), ParserState::pushLink(), ParserState::pushMedia(), ParserState::pushProperty(), Formatter::redraw(), ParserState::resolveInterfaceRef(), NclNode::setProperty(), ParserXercesC::solveNodeReferences(), and Formatter::start().
| #define CRITICAL | ( | fmt, | |
| ... | |||
| ) | __ginga_log (g_critical, fmt, ## __VA_ARGS__) |
| #define ERROR | ( | fmt, | |
| ... | |||
| ) | __ginga_log (g_error, fmt, ## __VA_ARGS__) |
| #define GINGA_MSECOND GST_MSECOND |
| #define GINGA_NAMESPACE_BEGIN namespace ginga {/*}*/ |
| #define GINGA_NAMESPACE_END /*{*/} |
Referenced by Composition::addChild(), Switch::addRule(), PlayerVideo::cb_NewSample(), NclNode::derefer(), PlayerText::doSetProperty(), Media::doStop(), Object::doStop(), ParserXercesC::fatalError(), NclEntity::getDocument(), NclArea::getEnd(), Event::getEventTransitionAsString(), NclPort::getFinalInterface(), NclMedia::getInstSameInstances(), NclContext::getLinks(), NclComposition::getMapInterface(), Predicate::getParent(), GingaCefClient::GetRenderHandler(), NclSwitch::getRules(), NclDocument::getSettingsNodes(), NclMediaRefer::initReferred(), NclBind::isReserved(), NclAnchor::NclAnchor(), NclAreaLambda::NclAreaLambda(), Formatter::obtainFormatterLink(), Parser::parseFile(), ParserLibXML::parseFile(), PlayerLua::pwdRestore(), Player::redrawDebuggingInfo(), PlayerSvg::reload(), PlayerImage::reload(), ParserXercesC::resetErrors(), MediaSettings::scheduleFocusUpdate(), Document::setData(), UserData::setData(), NclLink::setGhostBind(), Context::setLinksStatus(), NclProperty::setValue(), and AnimInfo::update().
| #define GINGA_NSECOND GST_NSECOND |
| #define GINGA_PRAGMA_DIAG PRAGMA_DIAG |
| #define GINGA_PRAGMA_DIAG_IGNORE PRAGMA_DIAG_IGNORE |
| #define GINGA_PRAGMA_DIAG_POP PRAGMA_DIAG_POP |
| #define GINGA_PRAGMA_DIAG_PUSH PRAGMA_DIAG_PUSH |
| #define GINGA_PRAGMA_DIAG_WARNING PRAGMA_DIAG_WARNING |
| #define GINGA_SECOND GST_SECOND |
Referenced by Formatter::redraw(), and try_parse_time().
| #define GINGA_STIME_ARGS | ( | t | ) | GST_STIME_ARGS ((t)) |
| #define GINGA_STIME_FORMAT GST_STIME_FORMAT |
| #define GINGA_STIME_IS_VALID | ( | t | ) | GST_CLOCK_STIME_IS_VALID ((t)) |
| #define GINGA_STIME_NONE GST_CLOCK_STIME_NONE |
| #define GINGA_STRFUNC (__ginga_strfunc (G_STRFUNC)).c_str () |
| #define GINGA_TIME_ARGS | ( | t | ) | GST_TIME_ARGS ((t)) |
Referenced by Media::endTransition(), Formatter::redraw(), Media::sendTickEvent(), Object::toString(), and Event::toString().
| #define GINGA_TIME_AS_MSECONDS | ( | t | ) | GST_TIME_AS_MSECONDS ((t)) |
Referenced by Player::redrawDebuggingInfo().
| #define GINGA_TIME_AS_NSECONDS | ( | t | ) | GST_TIME_AS_NSECONDS ((t)) |
| #define GINGA_TIME_AS_SECONDS | ( | t | ) | GST_TIME_AS_SECONDS ((t)) |
| #define GINGA_TIME_AS_USECONDS | ( | t | ) | GST_TIME_AS_USECONDS ((t)) |
| #define GINGA_TIME_DIFF | ( | s, | |
| e | |||
| ) | GST_CLOCK_DIFF ((s), (e)) |
| #define GINGA_TIME_FORMAT GST_TIME_FORMAT |
Referenced by Media::endTransition(), Formatter::redraw(), Media::sendTickEvent(), Object::toString(), and Event::toString().
| #define GINGA_TIME_IS_VALID | ( | t | ) | GST_CLOCK_TIME_IS_VALID ((t)) |
Referenced by Media::sendTickEvent(), Object::sendTickEvent(), Media::setProperty(), Object::setProperty(), and Object::toString().
| #define GINGA_TIME_NONE GST_CLOCK_TIME_NONE |
| #define GINGA_USECOND GST_USECOND |
| #define instanceof | ( | a, | |
| b | |||
| ) | (cast (a,(b)) != nullptr) |
Referenced by Document::addObject(), NclLink::contains(), NclNode::derefer(), Document::evalAction(), NclPort::getFinalInterface(), NclPort::getFinalNode(), NclComposition::getMapInterface(), NclComposition::getNestedNode(), NclDocument::getSettingsNodes(), NclEntity::NclEntity(), Formatter::obtainEvent(), Formatter::obtainExecutionObject(), Formatter::obtainFormatterEventFromBind(), ParserXercesC::parseBind(), ParserXercesC::parsePort(), ParserState::popMedia(), ParserXercesC::posCompileContext(), ParserXercesC::posCompileSwitch(), Formatter::resize(), ParserState::resolveInterfaceRef(), ParserXercesC::solveNodeReferences(), and Formatter::start().
| #define MAP_GET_IMPL | ( | m, | |
| a, | |||
| b | |||
| ) |
Referenced by NclBind::getParameter(), and Event::getParameter().
| #define MAP_SET_IMPL | ( | m, | |
| a, | |||
| b | |||
| ) |
Referenced by NclBind::setParameter(), and Event::setParameter().
| #define TRACE | ( | fmt, | |
| ... | |||
| ) | __ginga_log (g_debug, fmt, ## __VA_ARGS__) |
Referenced by PlayerVideo::cb_Bus(), Switch::endTransition(), Media::endTransition(), Context::endTransition(), Document::evalPredicate(), Formatter::obtainExecutionObject(), PlayerVideo::pause(), Player::pause(), ParserState::popAssessmentStatement(), ParserState::pushCompoundStatement(), Player::reload(), PlayerVideo::resume(), Player::resume(), Media::sendKeyEvent(), Media::sendTickEvent(), Player::setCurrentFocus(), Formatter::setOptionBackground(), Formatter::setOptionDebug(), Formatter::setOptionExperimental(), Formatter::setOptionOpenGL(), Formatter::setOptionSize(), PlayerVideo::start(), PlayerLua::start(), Formatter::start(), Player::start(), PlayerVideo::stop(), PlayerLua::stop(), and Player::stop().
| #define tryinsert | ( | a, | |
| b, | |||
| fn | |||
| ) |
Referenced by Object::addAlias(), Composition::addChild(), NclContext::addLink(), and Context::addPort().
| #define unused | ( | ... | ) | G_GNUC_UNUSED __VA_ARGS__ |
| #define WARNING | ( | fmt, | |
| ... | |||
| ) | __ginga_log (g_warning, fmt, ## __VA_ARGS__) |
Referenced by GL::beginDraw(), PlayerVideo::cb_Bus(), Player::createPlayer(), and PlayerAnimator::update().
| #define xstrcaseeq | ( | s1, | |
| s2 | |||
| ) | (xstrcasecmp ((s1), (s2)) == 0) |
Referenced by ParserXercesC::parseCompositeRule(), ParserXercesC::parseRule(), and try_parse_bool().
| typedef GdkRGBA Color |
| typedef GdkRectangle Rect |
| typedef GstClockTime Time |
| typedef void(* UserDataCleanFunc) (void *) |
| string __ginga_strfunc | ( | const string & | strfunc | ) |
Parses G_STRFUNC string to generate a log prefix.
| strfunc | String generated by G_STRFUNC macro. |
References g_assert().
| bool _xstrtod | ( | const string & | s, |
| double * | dp | ||
| ) |
| bool _xstrtoll | ( | const string & | s, |
| gint64 * | ip, | ||
| guint | base | ||
| ) |
| bool _xstrtoull | ( | const string & | s, |
| guint64 * | ip, | ||
| guint | base | ||
| ) |
| int G_GNUC_PRINTF | ( | 2 | , |
| 3 | |||
| ) |
| int const char string G_GNUC_PRINTF | ( | 1 | , |
| 2 | |||
| ) | const |
| bool parse_bool | ( | const string & | ) |
Referenced by PlayerVideo::doSetProperty(), and Player::doSetProperty().
| Color parse_color | ( | const string & | ) |
Referenced by Player::doSetProperty(), PlayerAnimator::schedule(), and Formatter::setOptionBackground().
| list<string> parse_list | ( | const string & | , |
| char | , | ||
| size_t | , | ||
| size_t | |||
| ) |
References ERROR, try_parse_list(), and unlikely.
Referenced by PlayerAnimator::schedule().
| int parse_percent | ( | const string & | s, |
| int | base, | ||
| int | min, | ||
| int | max | ||
| ) |
Parses number or percent string to an integer.
| s | Number or percent string. |
| base | Base value used to convert percent to integer. |
| min | Minimum resulting integer. |
| max | Maximum resulting integer. |
References xstrtodorpercent().
Referenced by PlayerAnimator::doSchedule(), Player::doSetProperty(), parse_pixel(), ParserXercesC::parseRegion(), and ParserState::pushRegion().
| guint8 parse_pixel | ( | const string & | s | ) |
Parses pixel string to an integer.
| s | Pixel string. |
References parse_percent().
Referenced by Player::doSetProperty().
| Time parse_time | ( | const string & | ) |
Referenced by Player::doSetProperty(), Media::endTransition(), ParserXercesC::parseArea(), and ParserState::pushArea().
| bool try_parse_bool | ( | const string & | s, |
| bool * | result | ||
| ) |
Parses boolean string.
| s | Boolean string. |
| result | Variable to store the resulting boolean. |
References tryset, and xstrcaseeq.
Referenced by parser_syntax_parse_bool().
| bool try_parse_color | ( | const string & | s, |
| Color * | result | ||
| ) |
Parses color string.
| s | Color string. |
| result | Variable to store the resulting color. |
References tryset.
Referenced by PlayerText::doSetProperty().
| bool try_parse_list | ( | const string & | s, |
| char | sep, | ||
| size_t | min, | ||
| size_t | max, | ||
| list< string > * | result | ||
| ) |
Parses list of string items.
| s | List string. |
| sep | Separator. |
| min | Minimum number of items. |
| max | Maximum number of items. |
| result | Variable to store the resulting items. |
References n, xstrsplit(), and xstrstrip().
Referenced by Player::doSetProperty(), and parse_list().
| bool try_parse_time | ( | const string & | s, |
| Time * | result | ||
| ) |
Parses time string ("Ns" or "NN:NN:NN").
| s | Time string. |
| result | Variable to store the resulting time. |
References g_free(), GINGA_SECOND, and tryset.
| string xpathbasename | ( | string | ) |
| string xpathbuild | ( | const string & | , |
| const string & | |||
| ) |
| string xpathbuildabs | ( | const string & | , |
| const string & | |||
| ) |
Builds an absolute path from the given components.
References xpathbuild(), and xpathmakeabs().
Referenced by ncl_push_media(), ParserXercesC::parse1(), ParserXercesC::parseImportBase(), ParserXercesC::parseMedia(), and ParserState::pushMedia().
| string xpathdirname | ( | string | ) |
Returns the dirname of path.
References g_free().
Referenced by ncl_push_media(), ParserXercesC::parse0(), ParserXercesC::parseImportBase(), ParserState::pushMedia(), and Player::redrawDebuggingInfo().
| bool xpathisabs | ( | const string & | ) |
Checks if path is absolute.
Referenced by ncl_push_media(), ParserXercesC::parse1(), ParserXercesC::parseMedia(), ParserState::pushMedia(), and xpathmakeabs().
| bool xpathisuri | ( | const string & | ) |
Checks if path is an URI.
References g_free().
Referenced by ncl_push_media(), ParserXercesC::parse1(), ParserXercesC::parseMedia(), and ParserState::pushMedia().
| string xpathmakeabs | ( | string | ) |
Makes path absolute.
References g_free(), and xpathisabs().
Referenced by ParserXercesC::parse0(), and xpathbuildabs().
| int xstrcasecmp | ( | const string & | s1, |
| const string & | s2 | ||
| ) |
Compares two strings ignoring case.
| s1 | First string. |
| s2 | Second string. |
| bool xstrhasprefix | ( | const string & | s, |
| const string & | prefix | ||
| ) |
Tests string prefix.
| s | String. |
| prefix | Prefix. |
Referenced by Player::createPlayer(), parser_syntax_reserved_role_table_index(), and Media::sendKeyEvent().
| bool xstrhassuffix | ( | const string & | s, |
| const string & | suffix | ||
| ) |
Tests string suffix.
| s | String. |
| suffix | Suffix. |
| bool xstrispercent | ( | const string & | s | ) |
Checks if string is a percent value.
| s | Value string. |
| list<string> xstrsplit | ( | const string & | s, |
| char | sep | ||
| ) |
Splits strings according to separator.
| s | String. |
| sep | Separator. |
Referenced by try_parse_list().
| int const char string string xstrstrip | ( | string | ) |
Removes leading and trailing whitespace from string.
References g_free().
Referenced by Parser::parseBuffer(), Parser::parseFile(), and try_parse_list().
| double xstrtod | ( | const string & | ) |
References _xstrtod(), and g_assert().
| double xstrtodorpercent | ( | const string & | s, |
| bool * | perc | ||
| ) |
Converts number or percent string to floating-point number.
| s | Number or percent string. |
| perc | Variable to store whether the converted value is a number or percent value. |
References tryset.
Referenced by PlayerVideo::doSetProperty(), and parse_percent().
| gint xstrtoint | ( | const string & | , |
| guint8 | |||
| ) |
Referenced by Player::doSetProperty(), and ParserXercesC::parseRegion().
| gint64 xstrtoint64 | ( | const string & | , |
| guint8 | |||
| ) |
| gint8 xstrtoint8 | ( | const string & | , |
| guint8 | |||
| ) |
| guint xstrtouint | ( | const string & | , |
| guint8 | |||
| ) |
| guint64 xstrtouint64 | ( | const string & | , |
| guint8 | |||
| ) |
| guint8 xstrtouint8 | ( | const string & | , |
| guint8 | |||
| ) |