Go to the documentation of this file.
20 #ifndef GNASH_PLAYER_H
21 #define GNASH_PLAYER_H
32 #include <boost/intrusive_ptr.hpp>
79 void run(
int argc,
char* argv[],
80 const std::string& infile,
const std::string&
url =
"");
87 #ifdef GNASH_FPS_DEBUG
95 void setFpsPrintTime(
float time)
100 #endif // def GNASH_FPS_DEBUG
134 float oldtimeout = _exitTimeout;
140 _params[
name] = value;
168 _startFullscreen =
x;
176 _audioDump = filespec;
196 _screenshots = screenshots;
203 _screenshotFile = file;
210 _screenshotQuality = quality;
218 std::string _hwaccel;
223 std::string _renderer;
228 CallbacksHandler(
Gui& gui,
const Player& player)
243 void notify(
const std::string& event,
const std::string& arg);
252 std::shared_ptr<CallbacksHandler> _callbacksHandler;
270 static unsigned int silentStream(
void* udata, std::int16_t* stream,
271 unsigned int len,
bool& atEOF);
283 std::unique_ptr<Gui> getGui();
285 void setFlashVars(
const std::string& varstr);
287 typedef std::map<std::string, std::string, StringNoCaseLessThan> Params;
299 unsigned long _windowID;
304 std::string _baseurl;
321 std::shared_ptr<sound::sound_handler> _soundHandler;
323 std::shared_ptr<media::MediaHandler> _mediaHandler;
329 std::shared_ptr<RunResources> _runResources;
332 std::shared_ptr<Gui> _gui;
338 boost::intrusive_ptr<movie_definition> _movieDef;
340 unsigned long _maxAdvances;
348 boost::intrusive_ptr<movie_definition> load_movie();
350 #ifdef GNASH_FPS_DEBUG
361 bool _startFullscreen;
365 std::string _audioDump;
370 std::string _screenshots;
375 std::string _screenshotFile;
380 int _screenshotQuality;
void setScreenShots(const std::string &screenshots)
This should be a comma-separated list of frames.
Definition: Player.h:195
int verbosityLevel() const
Definition: rc.h:112
static LogFile & getDefaultInstance()
Definition: log.cpp:77
void setScreenShotQuality(int quality)
Set the quality for screenshot output.
Definition: Player.h:209
Abstract base class for FS handlers.
Definition: HostInterface.h:200
bool useActionDump() const
Definition: rc.h:74
VGPath path
Definition: testr_gtk.cpp:84
boost::variant< HostMessage, CustomMessage > Message
Definition: HostInterface.h:213
int getTimerDelay() const
Definition: rc.h:83
DSOEXPORT void registerFSCommandCallback(FsCallback *handler)
Definition: movie_root.h:718
static DSOEXPORT boost::intrusive_ptr< movie_definition > makeMovie(const URL &url, const RunResources &runResources, const char *real_url=nullptr, bool startLoaderThread=true, const std::string *postdata=nullptr)
Create a gnash::movie_definition from the given URL.
Definition: MovieFactory.cpp:109
std::string name
Definition: LocalConnection_as.cpp:149
@ EXTERNALINTERFACE_PAN
Definition: HostInterface.h:176
@ d
Definition: GnashKey.h:150
void setWindowId(unsigned long x)
Definition: Player.h:114
std::map< std::string, std::string > VariableMap
Definition: gui.h:390
Top-level gnash exception.
Definition: GnashException.h:31
float setScale(float s)
Definition: Player.cpp:224
@ NOTIFY_ERROR
Definition: HostInterface.h:166
int getControlFD() const
Definition: Player.h:159
void setCookiesIn(const std::string &filename)
Definition: Player.h:163
void log_debug(StringType msg, Args... args)
Definition: log.h:301
static DSOEXPORT std::string makeInvoke(const std::string &method, const std::vector< as_value > &args)
Definition: ExternalInterface.cpp:302
@ i
Definition: GnashKey.h:155
#define _(String)
Definition: log.h:44
void setLogFilename(const std::string &fname)
Set log filename.
Definition: log.cpp:274
static void setCookiesIn(const std::string &cookiesin)
Set CookiesIn variable to cookiefile path.
Definition: NetworkAdapter.h:96
void setParam(const std::string &name, const std::string &value)
Definition: Player.h:139
void setMedia(const std::string &media)
Definition: Player.h:151
void setControlFD(int fd)
Definition: Player.h:155
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
Parent class from which all GUI implementations will depend.
Definition: gui.h:88
An exception from SoundHandler subsystem.
Definition: GnashException.h:70
int getHostFD() const
Definition: Player.h:147
@ g
Definition: GnashKey.h:153
Abstract base class for hosting app handler.
Definition: HostInterface.h:208
void setAllowScriptAccess(AllowScriptAccessMode mode)
The mode is one of never, always, with sameDomain the default.
Definition: movie_root.cpp:1237
static void parse_querystring(const std::string &query_string, std::map< std::string, std::string > &target_map)
Parse a query string filling the provided map.
Definition: URL.cpp:354
@ s
Definition: GnashKey.h:165
@ SCRIPT_ACCESS_NEVER
Definition: movie_root.h:481
@ n
Definition: GnashKey.h:160
void setHostFD(int fd)
Definition: Player.h:143
void setDoSound(bool b)
Definition: Player.h:120
@ EXTERNALINTERFACE_STOPPLAY
Definition: HostInterface.h:180
float setExitTimeout(float n)
Definition: Player.h:133
const std::string & getDebugLog() const
Definition: rc.h:116
@ EXTERNALINTERFACE_ZOOM
Definition: HostInterface.h:181
@ SCREEN_COLOR
Definition: HostInterface.h:160
std::unique_ptr< Gui > createFLTKGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_fltk.cpp:40
std::unique_ptr< Gui > createKDEGui(unsigned long xid, float scale, bool loop, RunResources &r)
void setStartFullscreen(bool x)
Definition: Player.h:167
@ SET_CLIPBOARD
Definition: HostInterface.h:130
void log_error(StringType msg, Args... args)
Definition: log.h:283
AllowScriptAccessMode
The possibile values of AllowScriptAccess.
Definition: movie_root.h:480
void setStageScaleMode(ScaleMode sm)
Sets the Stage object's align mode.
Definition: movie_root.cpp:1303
@ SCRIPT_ACCESS_SAME_DOMAIN
Definition: movie_root.h:482
std::unique_ptr< Gui > createSDLGui(unsigned long xid, float scale, bool loop, RunResources &r)
void setDoRender(bool b)
Definition: Player.h:118
size_t getXPosition() const
Definition: Player.h:109
static DSOEXPORT void clear()
Clear the MovieFactory resources.
Definition: MovieFactory.cpp:157
void setWidth(size_t w)
Definition: Player.h:102
void setScreenShotFile(const std::string &file)
Set the filename for screenshot output.
Definition: Player.h:202
void write(SimpleBuffer &buf, const std::string &str)
Write a string to an AMF buffer.
Definition: AMF.cpp:161
@ SHOW_MENU
Definition: HostInterface.h:117
Definition: NamingPolicy.h:54
size_t getHeight() const
Definition: Player.h:106
void setActionDump(int x)
Definition: log.h:135
@ SET_DISPLAYSTATE
Definition: HostInterface.h:124
DisplayState
The possible values of Stage.displayState.
Definition: movie_root.h:444
@ EXTERNALINTERFACE_ISPLAYING
Definition: HostInterface.h:175
@ EXTERNALINTERFACE_PLAY
Definition: HostInterface.h:177
void setMaxAdvances(unsigned long ul)
Definition: Player.h:122
T * get(as_object *o)
Extract the DisplayObject attached to an object.
Definition: as_object.h:842
void setDelay(unsigned int d)
Definition: Player.h:85
@ h
Definition: GnashKey.h:154
A case-insensitive string equality operator.
Definition: StringPredicates.h:42
short stringToStageAlign(const std::string &str)
Definition: movie_root.cpp:2406
@ p
Definition: GnashKey.h:162
void setDoLoop(bool b)
Definition: Player.h:116
void run(int argc, char *argv[], const std::string &infile, const std::string &url="")
Play the movie at the given url/path.
Definition: Player.cpp:385
DSOEXPORT void registerEventCallback(HostInterface *handler)
Definition: movie_root.h:732
@ SCALEMODE_NOSCALE
Definition: movie_root.h:452
void setHeight(size_t h)
Definition: Player.h:105
Handles screen dumps.
Definition: ScreenShotter.h:37
@ PLAYER_TYPE
Definition: HostInterface.h:154
std::vector< size_t > FrameList
Definition: ScreenShotter.h:40
void setStageAlignment(short s)
Definition: movie_root.cpp:1229
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
@ DISPLAYSTATE_FULLSCREEN
Definition: movie_root.h:446
bool useParserDump() const
Definition: rc.h:77
A custom form of communication with the host application.
Definition: HostInterface.h:67
ActionScript value type.
Definition: as_value.h:95
std::unique_ptr< Gui > createRISCOSGui(unsigned long xid, float scale, bool loop, RunResources &r)
@ PIXEL_ASPECT_RATIO
Definition: HostInterface.h:148
std::unique_ptr< Gui > createAOS4Gui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_aos4.cpp:40
@ SCALEMODE_SHOWALL
Definition: movie_root.h:451
std::unique_ptr< Gui > createGTKGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_gtk.cpp:41
std::unique_ptr< Gui > createQt4Gui(unsigned long xid, float scale, bool loop, RunResources &r)
sound_handler * create_sound_handler_mkit(media::MediaHandler *m)
Definition: sound_handler_mkit.cpp:269
Player()
Definition: Player.cpp:197
std::unique_ptr< Gui > createAQUAGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_aqua.cpp:40
void addLocalSandboxPath(const std::string &dir)
Add a directory to the local sandbox list.
Definition: rc.h:181
void hideMenu(bool x)
Definition: Player.h:171
@ SCRIPT_ACCESS_ALWAYS
Definition: movie_root.h:483
bool ignoreFSCommand() const
Definition: rc.h:294
std::string url
Definition: gnash.cpp:59
LogFile & dbglogfile
Definition: fileio.cpp:76
@ f
Definition: GnashKey.h:152
@ SCREEN_RESOLUTION
Definition: HostInterface.h:136
@ UPDATE_STAGE
Definition: HostInterface.h:110
void setHostFD(int fd)
Definition: movie_root.h:686
static RcInitFile & getDefaultInstance()
Return the default instance of RC file.
Definition: rc.cpp:61
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:151
void setXPosition(int xPos)
Definition: Player.h:108
void setAudioDumpfile(const std::string &filespec)
Definition: Player.h:175
Built-in forms of communication with the host application.
Definition: HostInterface.h:86
@ RESIZE_STAGE
Definition: HostInterface.h:104
static GnashFactory & instance()
Get the GnashFactory singleton.
Definition: GnashFactory.h:78
void setBaseUrl(const std::string &baseurl)
Set the base url for this run.
Definition: Player.h:129
sound_handler * create_sound_handler_aos4(media::MediaHandler *m)
Definition: sound_handler_ahi.cpp:259
@ SHOW_MOUSE
Definition: HostInterface.h:98
void setHWAccel(const std::string &x)
Definition: Player.h:187
~Player()
Definition: Player.cpp:866
@ EXTERNALINTERFACE_SETZOOMRECT
Definition: HostInterface.h:179
@ SCALEMODE_EXACTFIT
Definition: movie_root.h:453
sound_handler * create_sound_handler_sdl(media::MediaHandler *m)
Definition: sound_handler_sdl.cpp:234
bool startStopped() const
Return true if user is willing to start the gui in "stop" mode.
Definition: rc.h:103
@ EXTERNALINTERFACE_REWIND
Definition: HostInterface.h:178
Uniform Resource Locator.
Definition: URL.h:35
void setRenderer(const std::string &x)
Definition: Player.h:182
IOChannel * make_stream(int fd, const char *cachefilename)
Returns a read-only IOChannel that fetches data from an file descriptor open for read.
Definition: noseek_fd_adapter.cpp:364
std::unique_ptr< Gui > createDumpGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_dump.cpp:40
ScaleMode
The possibile values of Stage.scaleMode.
Definition: movie_root.h:450
void setControlFD(int fd)
Definition: movie_root.h:693
size_t getWidth() const
Definition: Player.h:103
void log_unimpl(StringType msg, Args... args)
Definition: log.h:289
std::unique_ptr< Gui > createFBGui(unsigned long windowid, float scale, bool do_loop, RunResources &r)
Definition: fb.cpp:141
bool useWriteLog() const
Definition: rc.h:80
size_t getYPosition() const
Definition: Player.h:112
Null GUI, used when rendering is disabled.
Definition: NullGui.h:34
@ DISPLAYSTATE_NORMAL
Definition: movie_root.h:445
std::int32_t x
Definition: BitmapData_as.cpp:434
std::unique_ptr< Gui > createHaikuGui(unsigned long xid, float scale, bool loop, RunResources &r)
std::string str() const
Return the full absolute URL as a string.
Definition: URL.cpp:272
void setVerbosity()
Definition: log.h:123
void setWriteDisk(bool b)
Set whether to write logs to file.
Definition: log.cpp:281
void addDefaultLoaders(TagLoadersTable &table)
Add the default parsing functions for SWF files to a TagLoadersTable.
Definition: DefaultTagLoaders.cpp:107
@ b
Definition: GnashKey.h:148
@ SCREEN_DPI
Definition: HostInterface.h:142
@ e
Definition: GnashKey.h:151
@ QUERY
Definition: HostInterface.h:172
void setParserDump(int x)
Definition: log.h:151
@ SCALEMODE_NOBORDER
Definition: movie_root.h:454
int getVerbosity() const
Definition: log.h:131
void setYPosition(int yPos)
Definition: Player.h:111