[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r12175: fix crash when auto-detectin
From: |
Rob Savoye |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r12175: fix crash when auto-detecting the driver, and minor reformatting changes from branch. |
Date: |
Tue, 04 May 2010 14:58:55 -0600 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 12175 [merge]
committer: Rob Savoye <address@hidden>
branch nick: trunk
timestamp: Tue 2010-05-04 14:58:55 -0600
message:
fix crash when auto-detecting the driver, and minor reformatting changes from
branch.
modified:
gui/Makefile.am
gui/gtk.cpp
gui/gtk_glue_agg_xv.cpp
gui/gui.cpp
libbase/dsodefs.h
libbase/log.h
libvaapi/VaapiContext.cpp
libvaapi/VaapiContext.h
libvaapi/VaapiDisplay.cpp
libvaapi/VaapiDisplay.h
libvaapi/VaapiDisplayGLX.h
libvaapi/VaapiDisplayX11.h
libvaapi/VaapiException.h
libvaapi/VaapiGlobalContext.cpp
libvaapi/VaapiGlobalContext.h
libvaapi/VaapiImage.cpp
libvaapi/VaapiImage.h
libvaapi/VaapiImageFormat.cpp
libvaapi/VaapiImageFormat.h
libvaapi/VaapiSubpicture.cpp
libvaapi/VaapiSubpicture.h
libvaapi/VaapiSurface.cpp
libvaapi/VaapiSurface.h
libvaapi/VaapiSurfaceGLX.cpp
libvaapi/VaapiSurfaceGLX.h
libvaapi/VaapiSurfaceProxy.cpp
libvaapi/VaapiSurfaceProxy.h
libvaapi/vaapi_common.h
libvaapi/vaapi_utils.cpp
libvaapi/vaapi_utils.h
macros/ffmpeg.m4
plugin/npapi/pluginScriptObject.cpp
=== modified file 'gui/Makefile.am'
--- a/gui/Makefile.am 2010-04-04 22:53:17 +0000
+++ b/gui/Makefile.am 2010-05-04 13:50:10 +0000
@@ -102,6 +102,7 @@
$(JPEG_LIBS) \
$(PNG_LIBS) \
$(LIRC_LIBS) \
+ $(INTLLIB) \
$(MYSQL_LIBS) \
$(BOOST_LIBS) \
$(PTHREAD_LIBS) \
=== modified file 'gui/gtk.cpp'
--- a/gui/gtk.cpp 2010-04-04 22:55:35 +0000
+++ b/gui/gtk.cpp 2010-05-04 15:22:59 +0000
@@ -43,6 +43,10 @@
#include "vaapi_utils.h"
#endif
+#ifdef HAVE_VA_VA_X11_H
+#include "va/va_x11.h"
+#endif
+
#ifdef HAVE_X11
#include <X11/keysym.h>
#include <gdk/gdkx.h>
@@ -228,6 +232,10 @@
log_debug("DRI extension found");
dri = true;
}
+ if (checkX11Extension("DRI2")) {
+ log_debug("DRI2 extension found");
+ dri = true;
+ }
bool glx = false;
// See if our X11 server supports the GLX extension, otherwise
// there is no point in trying to use OpenGL.
@@ -253,16 +261,17 @@
#ifdef HAVE_VA_VA_X11_H
if (hwaccel == "vaapi") {
- char *driver_name = NULL;
- struct VADisplayContext *pDisplayContext = (struct VADisplayContext
*)GDK_DISPLAY();
+ char *driver_name;
+ struct VADisplayContext *pDisplayContext = (struct VADisplayContext
*)vaGetDisplay(GDK_DISPLAY());
+
if (pDisplayContext->vaGetDriverName(pDisplayContext, &driver_name) ==
0) {
if ((strcmp(driver_name, "nvidia" ) == 0) || (strcmp(driver_name,
"vdpau" ) == 0) || (strcmp(driver_name, "s3g" ) == 0)) {
- log_debug("found supported vaapi driver for %s", driver_name);
+ log_debug("Found supported vaapi driver for %s", driver_name);
} else {
log_error("No vaapi driver found for %s!", driver_name);
}
} else {
- log_error("Coildn't get the VAAPI driver name!");
+ log_error("Couldn't get the VAAPI driver name!");
}
}
#endif
=== modified file 'gui/gtk_glue_agg_xv.cpp'
--- a/gui/gtk_glue_agg_xv.cpp 2010-02-23 17:06:43 +0000
+++ b/gui/gtk_glue_agg_xv.cpp 2010-05-04 13:48:28 +0000
@@ -333,11 +333,9 @@
XvFreeAdaptorInfo(adaptor_info);
if (_xv_port != std::numeric_limits<XvPortID>::max()) {
- const char fourcc[] = {(_xv_format.id & 0xFF),
- (_xv_format.id >> 8) & 0xFF,
- (_xv_format.id >> 16) & 0xFF,
- (_xv_format.id >> 24) & 0xFF, 0};
- log_debug(_("GTK-AGG: Selected format %s for Xv rendering."), fourcc);
+ std::stringstream ss;
+ ss << _xv_format.id;
+ log_debug(_("GTK-AGG: Selected format %s for Xv rendering."),
ss.str());
get_max_xv_image(display, _xv_port, &_xv_max_width, &_xv_max_height);
}
=== modified file 'gui/gui.cpp'
--- a/gui/gui.cpp 2010-04-21 23:14:08 +0000
+++ b/gui/gui.cpp 2010-05-04 20:58:55 +0000
@@ -174,7 +174,7 @@
Gui::~Gui()
{
if ( _movieDef.get() ) log_debug("~Gui - _movieDef refcount: %d",
_movieDef->get_ref_count());
-
+
#ifdef GNASH_FPS_DEBUG
if ( fps_timer_interval ) {
std::cerr << "Total frame advances/drops: "
@@ -182,7 +182,7 @@
}
#endif
}
-
+
void
Gui::setFullscreen()
{
@@ -223,236 +223,234 @@
bool
Gui::showMouse(bool /* show */)
{
- LOG_ONCE(log_unimpl(_("Mouse show/hide not yet supported in this
GUI")));
- return true;
+ LOG_ONCE(log_unimpl(_("Mouse show/hide not yet supported in this GUI")));
+ return true;
}
-
+
void
Gui::showMenu(bool /* show */)
{
- LOG_ONCE(log_unimpl(_("menushow not yet supported in this GUI")));
+ LOG_ONCE(log_unimpl(_("menushow not yet supported in this GUI")));
}
-
+
void
Gui::allowScale(bool allow)
{
- if (!_stage) {
- log_error("Gui::allowScale called before a movie_root was
available");
- return;
- }
-
- if (allow) _stage->setStageScaleMode(movie_root::showAll);
- else _stage->setStageScaleMode(movie_root::noScale);
+ if (!_stage) {
+ log_error("Gui::allowScale called before a movie_root was available");
+ return;
+ }
+
+ if (allow) _stage->setStageScaleMode(movie_root::showAll);
+ else _stage->setStageScaleMode(movie_root::noScale);
}
-
+
void
Gui::toggleFullscreen()
{
/// Sends request to Gnash core to change display state.
- if (_fullscreen) {
- _stage->setStageDisplayState(movie_root::DISPLAYSTATE_NORMAL);
- }
- else {
-
_stage->setStageDisplayState(movie_root::DISPLAYSTATE_FULLSCREEN);
- }
+ if (_fullscreen) {
+ _stage->setStageDisplayState(movie_root::DISPLAYSTATE_NORMAL);
+ }
+ else {
+ _stage->setStageDisplayState(movie_root::DISPLAYSTATE_FULLSCREEN);
+ }
}
void
Gui::restart()
{
- _stage->reset();
- _started = false;
- start();
+ _stage->reset();
+ _started = false;
+ start();
}
void
Gui::updateStageMatrix()
{
- if ( ! VM::isInitialized() )
- {
- // When VM initializes, we'll get a call to resize_view, which
- // would call us again.
- //log_debug("Can't update stage matrix till VM is initialized");
- return;
- }
-
- assert(_stage); // when VM is initialized this should hold
-
- float swfwidth = _movieDef->get_width_pixels();
- float swfheight = _movieDef->get_height_pixels();
-
- // Fetch scale mode
- movie_root::ScaleMode scaleMode = _stage->getStageScaleMode();
- switch (scaleMode)
- {
- case movie_root::noScale:
- _xscale = _yscale = 1.0f;
- break;
-
- case movie_root::showAll:
- {
-
- // set new scale value ( user-pixel / pseudo-pixel ). Do
- // not divide by zero, or we end up with an invalid
- // stage matrix that returns nan values.
- _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
- _yscale = (swfheight == 0.0f) ? 1.0f : _height /
swfheight;
-
- // Scale proportionally, using smallest scale
- if (_xscale < _yscale) _yscale = _xscale;
- else if (_yscale < _xscale) _xscale = _yscale;
-
- break;
- }
-
- case movie_root::noBorder:
- {
-
- // set new scale value ( user-pixel / pseudo-pixel )
- _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
- _yscale = (swfheight == 0.0f) ? 1.0f : _height /
swfheight;
-
- // Scale proportionally, using biggest scale
- if (_xscale > _yscale) _yscale = _xscale;
- else if (_yscale > _xscale) _xscale = _yscale;
-
- break;
- }
-
- case movie_root::exactFit:
- {
- // NOTE: changing aspect ratio is valid!
- _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
- _yscale = (swfheight == 0.0f) ? 1.0f : _height /
swfheight;
- //LOG_ONCE( log_unimpl("Stage.scaleMode=exactFit") );
- break;
- }
-
- default:
- {
- log_error("Invalid scaleMode %d", scaleMode);
- break;
- }
- }
-
- _xoffset=0;
- _yoffset=0;
-
- // Fetch align mode
- movie_root::StageAlign align = _stage->getStageAlignment();
- movie_root::StageHorizontalAlign halign = align.first;
- movie_root::StageVerticalAlign valign = align.second;
-
- // Handle horizontal alignment
- switch ( halign )
- {
- case movie_root::STAGE_H_ALIGN_L:
- {
- // _xoffset=0 is fine
- break;
- }
-
- case movie_root::STAGE_H_ALIGN_R:
- {
- // Offsets in pixels
- float defWidth = swfwidth *= _xscale;
- float diffWidth = _width-defWidth;
- _xoffset = diffWidth;
- break;
- }
-
- case movie_root::STAGE_V_ALIGN_C:
- {
- // Offsets in pixels
- float defWidth = swfwidth *= _xscale;
- float diffWidth = _width-defWidth;
- _xoffset = diffWidth/2.0;
- break;
- }
-
- default:
- {
- log_error("Invalid horizontal align %d", valign);
- break;
- }
- }
-
- // Handle vertical alignment
- switch ( valign )
- {
- case movie_root::STAGE_V_ALIGN_T:
- {
- // _yoffset=0 is fine
- break;
- }
-
- case movie_root::STAGE_V_ALIGN_B:
- {
- float defHeight = swfheight *= _yscale;
- float diffHeight = _height-defHeight;
- _yoffset = diffHeight;
- break;
- }
-
- case movie_root::STAGE_V_ALIGN_C:
- {
- float defHeight = swfheight *= _yscale;
- float diffHeight = _height-defHeight;
- _yoffset = diffHeight/2.0;
- break;
- }
-
- default:
- {
- log_error("Invalid vertical align %d", valign);
- break;
- }
- }
-
- //log_debug("updateStageMatrix: scaleMode:%d, valign:%d, halign:%d",
- //scaleMode, valign, halign);
-
- // TODO: have a generic set_matrix ?
- if (_renderer.get()) {
- _renderer->set_scale(_xscale, _yscale);
- _renderer->set_translation(_xoffset, _yoffset);
- }
- else
- {
- //log_debug("updateStageMatrix: could not signal updated stage
- //matrix to renderer (no renderer registered)");
- }
-
- // trigger redraw
- //_redraw_flag |= (_width!=width) || (_height!=height);
- _redraw_flag = true; // this fixes bug #21971
+ if ( ! VM::isInitialized() ) {
+ // When VM initializes, we'll get a call to resize_view, which
+ // would call us again.
+ //log_debug("Can't update stage matrix till VM is initialized");
+ return;
+ }
+
+ assert(_stage); // when VM is initialized this should hold
+
+ float swfwidth = _movieDef->get_width_pixels();
+ float swfheight = _movieDef->get_height_pixels();
+
+ // Fetch scale mode
+ movie_root::ScaleMode scaleMode = _stage->getStageScaleMode();
+ switch (scaleMode) {
+ case movie_root::noScale:
+ _xscale = _yscale = 1.0f;
+ break;
+
+ case movie_root::showAll:
+ {
+
+ // set new scale value ( user-pixel / pseudo-pixel ). Do
+ // not divide by zero, or we end up with an invalid
+ // stage matrix that returns nan values.
+ _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+ _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+
+ // Scale proportionally, using smallest scale
+ if (_xscale < _yscale) {
+ _yscale = _xscale;
+ } else if (_yscale < _xscale) {
+ _xscale = _yscale;
+ }
+
+ break;
+ }
+
+ case movie_root::noBorder:
+ {
+
+ // set new scale value ( user-pixel / pseudo-pixel )
+ _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+ _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+
+ // Scale proportionally, using biggest scale
+ if (_xscale > _yscale) {
+ _yscale = _xscale;
+ } else if (_yscale > _xscale) {
+ _xscale = _yscale;
+ }
+
+ break;
+ }
+
+ case movie_root::exactFit:
+ {
+ // NOTE: changing aspect ratio is valid!
+ _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+ _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+ //LOG_ONCE( log_unimpl("Stage.scaleMode=exactFit") );
+ break;
+ }
+
+ default:
+ {
+ log_error("Invalid scaleMode %d", scaleMode);
+ break;
+ }
+ }
+
+ _xoffset=0;
+ _yoffset=0;
+
+ // Fetch align mode
+ movie_root::StageAlign align = _stage->getStageAlignment();
+ movie_root::StageHorizontalAlign halign = align.first;
+ movie_root::StageVerticalAlign valign = align.second;
+
+ // Handle horizontal alignment
+ switch ( halign ) {
+ case movie_root::STAGE_H_ALIGN_L:
+ {
+ // _xoffset=0 is fine
+ break;
+ }
+
+ case movie_root::STAGE_H_ALIGN_R:
+ {
+ // Offsets in pixels
+ float defWidth = swfwidth *= _xscale;
+ float diffWidth = _width-defWidth;
+ _xoffset = diffWidth;
+ break;
+ }
+
+ case movie_root::STAGE_V_ALIGN_C:
+ {
+ // Offsets in pixels
+ float defWidth = swfwidth *= _xscale;
+ float diffWidth = _width-defWidth;
+ _xoffset = diffWidth/2.0;
+ break;
+ }
+
+ default:
+ {
+ log_error("Invalid horizontal align %d", valign);
+ break;
+ }
+ }
+
+ // Handle vertical alignment
+ switch ( valign ) {
+ case movie_root::STAGE_V_ALIGN_T:
+ {
+ // _yoffset=0 is fine
+ break;
+ }
+
+ case movie_root::STAGE_V_ALIGN_B:
+ {
+ float defHeight = swfheight *= _yscale;
+ float diffHeight = _height-defHeight;
+ _yoffset = diffHeight;
+ break;
+ }
+
+ case movie_root::STAGE_V_ALIGN_C:
+ {
+ float defHeight = swfheight *= _yscale;
+ float diffHeight = _height-defHeight;
+ _yoffset = diffHeight/2.0;
+ break;
+ }
+
+ default:
+ {
+ log_error("Invalid vertical align %d", valign);
+ break;
+ }
+ }
+
+ //log_debug("updateStageMatrix: scaleMode:%d, valign:%d, halign:%d",
+ //scaleMode, valign, halign);
+
+ // TODO: have a generic set_matrix ?
+ if (_renderer.get()) {
+ _renderer->set_scale(_xscale, _yscale);
+ _renderer->set_translation(_xoffset, _yoffset);
+ } else {
+ //log_debug("updateStageMatrix: could not signal updated stage
+ //matrix to renderer (no renderer registered)");
+ }
+
+ // trigger redraw
+ //_redraw_flag |= (_width!=width) || (_height!=height);
+ _redraw_flag = true; // this fixes bug #21971
}
-
-
+
+
void
Gui::resize_view(int width, int height)
{
- assert(width>0);
- assert(height>0);
-
- if ( VM::isInitialized() )
- {
-
- if ( _stage && _started )
- {
- _stage->set_display_viewport(0, 0, width, height);
- }
-
- }
-
- _width = width;
- _height = height;
- _validbounds.setTo(0, 0, _width, _height);
-
- updateStageMatrix();
-
- if ( _stage && _started ) display(_stage);
+ assert(width>0);
+ assert(height>0);
+
+ if ( VM::isInitialized() ) {
+ if ( _stage && _started ) {
+ _stage->set_display_viewport(0, 0, width, height);
+ }
+ }
+
+ _width = width;
+ _height = height;
+ _validbounds.setTo(0, 0, _width, _height);
+
+ updateStageMatrix();
+
+ if ( _stage && _started ) {
+ display(_stage);
+ }
}
@@ -474,74 +472,62 @@
void
Gui::notify_mouse_moved(int ux, int uy)
{
- movie_root* m = _stage;
-
- if ( ! _started ) return;
-
- if ( _stopped ) return;
-
- // A stage pseudopixel is user pixel / _xscale wide
- boost::int32_t x = (ux-_xoffset) / _xscale;
-
- // A stage pseudopixel is user pixel / _xscale high
- boost::int32_t y = (uy-_yoffset) / _yscale;
-
+ movie_root* m = _stage;
+
+ if ( ! _started ) return;
+
+ if ( _stopped ) return;
+
+ // A stage pseudopixel is user pixel / _xscale wide
+ boost::int32_t x = (ux-_xoffset) / _xscale;
+
+ // A stage pseudopixel is user pixel / _xscale high
+ boost::int32_t y = (uy-_yoffset) / _yscale;
+
#ifdef DEBUG_MOUSE_COORDINATES
- log_debug(_("mouse @ %d,%d"), x, y);
+ log_debug(_("mouse @ %d,%d"), x, y);
#endif
-
- if ( m->notify_mouse_moved(x, y) )
- {
- // any action triggered by the
- // event required screen refresh
- display(m);
- }
-
- DisplayObject* activeEntity = m->getActiveEntityUnderPointer();
- if ( activeEntity )
- {
- if ( activeEntity->isSelectableTextField() )
- {
- setCursor(CURSOR_INPUT);
- }
- else if ( activeEntity->allowHandCursor() )
- {
- setCursor(CURSOR_HAND);
- }
- else
- {
- setCursor(CURSOR_NORMAL);
- }
- }
- else
- {
- setCursor(CURSOR_NORMAL);
- }
-
+
+ if ( m->notify_mouse_moved(x, y) ) {
+ // any action triggered by the
+ // event required screen refresh
+ display(m);
+ }
+
+ DisplayObject* activeEntity = m->getActiveEntityUnderPointer();
+ if ( activeEntity ) {
+ if ( activeEntity->isSelectableTextField() ) {
+ setCursor(CURSOR_INPUT);
+ } else if ( activeEntity->allowHandCursor() ) {
+ setCursor(CURSOR_HAND);
+ } else {
+ setCursor(CURSOR_NORMAL);
+ }
+ } else {
+ setCursor(CURSOR_NORMAL);
+ }
+
#ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS
- _xpointer = ux;
- _ypointer = uy;
+ _xpointer = ux;
+ _ypointer = uy;
#endif
-
-
}
void
Gui::notify_mouse_clicked(bool mouse_pressed, int mask)
{
- movie_root* m = _stage;
- assert(m);
-
+ movie_root* m = _stage;
+ assert(m);
+
if ( ! _started ) return;
-
+
if ( _stopped ) return;
-
- if ( m->notify_mouse_clicked(mouse_pressed, mask) )
- {
- // any action triggered by the
- // event required screen refresh
- display(m);
- }
+
+ if ( m->notify_mouse_clicked(mouse_pressed, mask) ) {
+ // any action triggered by the
+ // event required screen refresh
+ display(m);
+ }
}
void
@@ -561,134 +547,139 @@
Gui::notify_key_event(gnash::key::code k, int modifier, bool pressed)
{
- /* Handle GUI shortcuts */
- if (pressed)
- {
- if (k == gnash::key::ESCAPE) {
- if (isFullscreen()) {
-
_stage->setStageDisplayState(movie_root::DISPLAYSTATE_NORMAL);
- }
- }
-
- if (modifier & gnash::key::GNASH_MOD_CONTROL) {
- switch (k)
- {
+ // Handle GUI shortcuts
+ if (pressed) {
+ if (k == gnash::key::ESCAPE) {
+ if (isFullscreen()) {
+ _stage->setStageDisplayState(movie_root::DISPLAYSTATE_NORMAL);
+ }
+ }
+
+ if (modifier & gnash::key::GNASH_MOD_CONTROL) {
+ switch (k)
+ {
case gnash::key::o:
case gnash::key::O:
takeScreenShot();
break;
- case gnash::key::r:
- case gnash::key::R:
- restart();
- break;
- case gnash::key::p:
- case gnash::key::P:
- pause();
- break;
- case gnash::key::l:
- case gnash::key::L:
- refreshView();
- break;
- case gnash::key::q:
- case gnash::key::Q:
- case gnash::key::w:
- case gnash::key::W:
- quit();
- break;
- case gnash::key::f:
- case gnash::key::F:
- toggleFullscreen();
- break;
- case gnash::key::h:
- case gnash::key::H:
-
showUpdatedRegions(!showUpdatedRegions());
- break;
- case gnash::key::MINUS:
- {
- // Max interval allowed: 1 second (1FPS)
- const size_t ni =
std::min<size_t>(_interval + 2, 1000u);
- setInterval(ni);
- break;
- }
- case gnash::key::PLUS:
- {
- // Min interval allowed: 1/100 second
(100FPS)
- const size_t ni =
std::max<size_t>(_interval - 2, 10u);
- setInterval(ni);
- break;
- }
- case gnash::key::EQUALS:
- {
- if (_stage) {
- const float fps =
_stage->frameRate();
- // Min interval allowed: 1/100
second (100FPS)
- const size_t ni = 1000.0/fps;
- setInterval(ni);
- }
- break;
- }
- default:
- break;
- }
-
+ case gnash::key::r:
+ case gnash::key::R:
+ restart();
+ break;
+ case gnash::key::p:
+ case gnash::key::P:
+ pause();
+ break;
+ case gnash::key::l:
+ case gnash::key::L:
+ refreshView();
+ break;
+ case gnash::key::q:
+ case gnash::key::Q:
+ case gnash::key::w:
+ case gnash::key::W:
+ quit();
+ break;
+ case gnash::key::f:
+ case gnash::key::F:
+ toggleFullscreen();
+ break;
+ case gnash::key::h:
+ case gnash::key::H:
+ showUpdatedRegions(!showUpdatedRegions());
+ break;
+ case gnash::key::MINUS:
+ {
+ // Max interval allowed: 1 second (1FPS)
+ const size_t ni = std::min<size_t>(_interval + 2,
1000u);
+ setInterval(ni);
+ break;
+ }
+ case gnash::key::PLUS:
+ {
+ // Min interval allowed: 1/100 second (100FPS)
+ const size_t ni = std::max<size_t>(_interval - 2, 10u);
+ setInterval(ni);
+ break;
+ }
+ case gnash::key::EQUALS:
+ {
+ if (_stage) {
+ const float fps = _stage->frameRate();
+ // Min interval allowed: 1/100 second (100FPS)
+ const size_t ni = 1000.0/fps;
+ setInterval(ni);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
#ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS
- if ( _keyboardMouseMovements )
- {
- int step = _keyboardMouseMovementsStep;
+ if ( _keyboardMouseMovements ) {
+ int step = _keyboardMouseMovementsStep;
// x5 if SHIFT is pressed
- if (modifier & gnash::key::GNASH_MOD_SHIFT)
step *= 5;
- switch (k)
- {
- case gnash::key::UP:
- {
- int newx = _xpointer;
- int newy = _ypointer-step;
- if ( newy < 0 ) newy=0;
- notify_mouse_moved(newx, newy);
- break;
- }
- case gnash::key::DOWN:
- {
- int newx = _xpointer;
- int newy = _ypointer+step;
- if ( newy >= _height ) newy =
_height-1;
- notify_mouse_moved(newx, newy);
- break;
- }
- case gnash::key::LEFT:
- {
- int newx = _xpointer-step;
- int newy = _ypointer;
- if ( newx < 0 ) newx = 0;
- notify_mouse_moved(newx, newy);
- break;
- }
- case gnash::key::RIGHT:
- {
- const int newy = _ypointer;
- int newx = _xpointer + step;
- if ( newx >= _width ) newx =
_width-1;
- notify_mouse_moved(newx, newy);
- break;
- }
- default:
- break;
- }
- }
+ if (modifier & gnash::key::GNASH_MOD_SHIFT) step *= 5;
+ switch (k) {
+ case gnash::key::UP:
+ {
+ int newx = _xpointer;
+ int newy = _ypointer-step;
+ if ( newy < 0 ) {
+ newy=0;
+ }
+ notify_mouse_moved(newx, newy);
+ break;
+ }
+ case gnash::key::DOWN:
+ {
+ int newx = _xpointer;
+ int newy = _ypointer+step;
+ if ( newy >= _height ) {
+ newy = _height-1;
+ }
+ notify_mouse_moved(newx, newy);
+ break;
+ }
+ case gnash::key::LEFT:
+ {
+ int newx = _xpointer-step;
+ int newy = _ypointer;
+ if ( newx < 0 ) {
+ newx = 0;
+ }
+ notify_mouse_moved(newx, newy);
+ break;
+ }
+ case gnash::key::RIGHT:
+ {
+ const int newy = _ypointer;
+ int newx = _xpointer + step;
+ if ( newx >= _width ) {
+ newx = _width-1;
+ }
+ notify_mouse_moved(newx, newy);
+ break;
+ }
+ default:
+ break;
+ }
+ }
#endif // ENABLE_KEYBOARD_MOUSE_MOVEMENTS
- }
- }
-
+ }
+ }
+
if (!_started) return;
-
+
if (_stopped) return;
-
- if (_stage->notify_key_event(k, pressed)) {
- // any action triggered by the
- // event required screen refresh
- display(_stage);
- }
-
+
+ if (_stage->notify_key_event(k, pressed)) {
+ // any action triggered by the
+ // event required screen refresh
+ display(_stage);
+ }
+
}
bool
@@ -697,147 +688,144 @@
assert(m == _stage); // why taking this arg ??
assert(_started);
-
- InvalidatedRanges changed_ranges;
- bool redraw_flag;
-
- // Should the frame be rendered completely, even if it did not change?
+
+ InvalidatedRanges changed_ranges;
+ bool redraw_flag;
+
+ // Should the frame be rendered completely, even if it did not change?
#ifdef FORCE_REDRAW
- redraw_flag = true;
+ redraw_flag = true;
#else
- redraw_flag = _redraw_flag || want_redraw();
+ redraw_flag = _redraw_flag || want_redraw();
#endif
-
- // reset class member if we do a redraw now
- if (redraw_flag) _redraw_flag=false;
-
- // Find out the surrounding frame of all characters which
- // have been updated. This just checks what region of the stage has
changed
- // due to ActionScript code, the timeline or user events. The GUI can
still
- // choose to render a different part of the stage.
- //
- if (!redraw_flag) {
-
- // choose snapping ranges factor
- changed_ranges.setSnapFactor(1.3f);
-
- // Use multi ranges only when GUI/Renderer supports it
- // (Useless CPU overhead, otherwise)
- changed_ranges.setSingleMode(!want_multiple_regions());
-
- // scan through all sprites to compute invalidated bounds
- m->add_invalidated_bounds(changed_ranges, false);
-
- // grow ranges by a 2 pixels to avoid anti-aliasing issues
- changed_ranges.growBy(40.0f / _xscale);
-
- // optimize ranges
- changed_ranges.combineRanges();
-
- }
+
+ // reset class member if we do a redraw now
+ if (redraw_flag) {
+ _redraw_flag=false;
+ }
+
+ // Find out the surrounding frame of all characters which
+ // have been updated. This just checks what region of the stage has changed
+ // due to ActionScript code, the timeline or user events. The GUI can still
+ // choose to render a different part of the stage.
+ //
+ if (!redraw_flag) {
+ // choose snapping ranges factor
+ changed_ranges.setSnapFactor(1.3f);
+
+ // Use multi ranges only when GUI/Renderer supports it
+ // (Useless CPU overhead, otherwise)
+ changed_ranges.setSingleMode(!want_multiple_regions());
+
+ // scan through all sprites to compute invalidated bounds
+ m->add_invalidated_bounds(changed_ranges, false);
+
+ // grow ranges by a 2 pixels to avoid anti-aliasing issues
+ changed_ranges.growBy(40.0f / _xscale);
+
+ // optimize ranges
+ changed_ranges.combineRanges();
+
+ }
// TODO: Remove this and want_redraw to avoid confusion!?
- if (redraw_flag) {
- changed_ranges.setWorld();
- }
-
- // DEBUG ONLY:
- // This is a good place to inspect the invalidated bounds state. Enable
- // the following block (and parts of it) if you need to.
+ if (redraw_flag) {
+ changed_ranges.setWorld();
+ }
+
+ // DEBUG ONLY:
+ // This is a good place to inspect the invalidated bounds state. Enable
+ // the following block (and parts of it) if you need to.
#if 0
- {
- // This may print a huge amount of information, but is useful to analyze
- // the (visible) object structure of the movie and the flags of the
- // characters. For example, a characters should have set the
- // m_child_invalidated flag if at least one of it's childs has the
- // invalidated flag set.
- log_debug("DUMPING CHARACTER TREE");
-
- InfoTree tr;
- InfoTree::iterator top = tr.begin();
- _stage->getMovieInfo(tr, top);
-
- for (InfoTree::iterator i = tr.begin(), e = tr.end();
- i != e; ++i) {
- std::cout << std::string(tr.depth(i) * 2, ' ') << i->first << ": " <<
- i->second << std::endl;
+ {
+ // This may print a huge amount of information, but is useful to
analyze
+ // the (visible) object structure of the movie and the flags of the
+ // characters. For example, a characters should have set the
+ // m_child_invalidated flag if at least one of it's childs has the
+ // invalidated flag set.
+ log_debug("DUMPING CHARACTER TREE");
+
+ InfoTree tr;
+ InfoTree::iterator top = tr.begin();
+ _stage->getMovieInfo(tr, top);
+
+ for (InfoTree::iterator i = tr.begin(), e = tr.end();
+ i != e; ++i) {
+ std::cout << std::string(tr.depth(i) * 2, ' ') << i->first << ": "
<<
+ i->second << std::endl;
+ }
+
+
+ // less verbose, and often necessary: see the exact coordinates of the
+ // invalidated bounds (mainly to see if it's NULL or something else).
+ std::cout << "Calculated changed ranges: " << changed_ranges << "\n";
}
-
-
- // less verbose, and often necessary: see the exact coordinates of the
- // invalidated bounds (mainly to see if it's NULL or something else).
- std::cout << "Calculated changed ranges: " << changed_ranges << "\n";
- }
#endif
-
- // Avoid drawing of stopped movies
- if ( ! changed_ranges.isNull() ) // use 'else'?
- {
- // Tell the GUI(!) that we only need to update this
- // region. Note the GUI can do whatever it wants with
- // this information. It may simply ignore the bounds
- // (which will normally lead into a complete redraw),
- // or it may extend or shrink the bounds as it likes. So,
- // by calling set_invalidated_bounds we have no guarantee
- // that only this part of the stage is rendered again.
+
+ // Avoid drawing of stopped movies
+ if ( ! changed_ranges.isNull() ) { // use 'else'?
+ // Tell the GUI(!) that we only need to update this
+ // region. Note the GUI can do whatever it wants with
+ // this information. It may simply ignore the bounds
+ // (which will normally lead into a complete redraw),
+ // or it may extend or shrink the bounds as it likes. So,
+ // by calling set_invalidated_bounds we have no guarantee
+ // that only this part of the stage is rendered again.
#ifdef REGION_UPDATES_DEBUGGING_FULL_REDRAW
- // redraw the full screen so that only the
- // *new* invalidated region is visible
- // (helps debugging)
- InvalidatedRanges world_ranges;
- world_ranges.setWorld();
- setInvalidatedRegions(world_ranges);
+ // redraw the full screen so that only the
+ // *new* invalidated region is visible
+ // (helps debugging)
+ InvalidatedRanges world_ranges;
+ world_ranges.setWorld();
+ setInvalidatedRegions(world_ranges);
#else
- setInvalidatedRegions(changed_ranges);
+ setInvalidatedRegions(changed_ranges);
#endif
-
- // TODO: should this be called even if we're late ?
- beforeRendering();
-
- // Render the frame, if not late.
- // It's up to the GUI/renderer combination
- // to do any clipping, if desired.
- m->display();
-
- // show invalidated region using a red rectangle
- // (Flash debug style)
- IF_DEBUG_REGION_UPDATES (
- if (_renderer.get() && !changed_ranges.isWorld())
- {
+
+ // TODO: should this be called even if we're late ?
+ beforeRendering();
+
+ // Render the frame, if not late.
+ // It's up to the GUI/renderer combination
+ // to do any clipping, if desired.
+ m->display();
+
+ // show invalidated region using a red rectangle
+ // (Flash debug style)
+ IF_DEBUG_REGION_UPDATES (
+ if (_renderer.get() && !changed_ranges.isWorld()) {
+ for (size_t rno = 0; rno < changed_ranges.size(); rno++) {
+ const geometry::Range2d<int>& bounds =
+ changed_ranges.getRange(rno);
+
+ point corners[4];
+ float xmin = bounds.getMinX();
+ float xmax = bounds.getMaxX();
+ float ymin = bounds.getMinY();
+ float ymax = bounds.getMaxY();
- for (size_t rno = 0; rno < changed_ranges.size();
rno++) {
-
- const geometry::Range2d<int>& bounds =
- changed_ranges.getRange(rno);
-
- point corners[4];
- float xmin = bounds.getMinX();
- float xmax = bounds.getMaxX();
- float ymin = bounds.getMinY();
- float ymax = bounds.getMaxY();
-
- corners[0].x = xmin;
- corners[0].y = ymin;
- corners[1].x = xmax;
- corners[1].y = ymin;
- corners[2].x = xmax;
- corners[2].y = ymax;
- corners[3].x = xmin;
- corners[3].y = ymax;
- SWFMatrix no_transform;
- _renderer->draw_poly(corners, 4,
- rgba(0,0,0,0), rgba(255,0,0,255),
no_transform, false);
-
- }
- }
- );
-
- // show frame on screen
- renderBuffer();
+ corners[0].x = xmin;
+ corners[0].y = ymin;
+ corners[1].x = xmax;
+ corners[1].y = ymin;
+ corners[2].x = xmax;
+ corners[2].y = ymax;
+ corners[3].x = xmin;
+ corners[3].y = ymax;
+ SWFMatrix no_transform;
+ _renderer->draw_poly(corners, 4,
+ rgba(0,0,0,0), rgba(255,0,0,255),
no_transform, false);
+
+ }
+ }
+ );
+
+ // show frame on screen
+ renderBuffer();
- };
-
- return true;
+ };
+
+ return true;
}
void
@@ -846,14 +834,16 @@
if ( ! _stopped ) return;
_stopped = false;
- if ( ! _started ) start();
- else
- {
+ if ( ! _started ) {
+ start();
+ } else {
assert (_stage);
// @todo since we registered the sound handler, shouldn't we know
// already what it is ?!
sound::sound_handler* s = _stage->runResources().soundHandler();
- if ( s ) s->unpause();
+ if ( s ) {
+ s->unpause();
+ }
log_debug("Starting virtual clock");
_virtualClock.resume();
=== modified file 'libbase/dsodefs.h'
--- a/libbase/dsodefs.h 2010-01-11 06:41:38 +0000
+++ b/libbase/dsodefs.h 2010-05-04 19:55:50 +0000
@@ -24,36 +24,36 @@
#endif
#if defined(_MSC_VER) || defined(WIN32) || defined(_WIN32)
- // #ifdef BUILDING_DLL
- #ifdef DLL_EXPORT
- #define DSOEXPORT __declspec(dllexport)
- #else
- // Temporarily commented because of VC++ compiler problems
- #define DSOEXPORT // __declspec(dllimport)
- #endif
+// #ifdef BUILDING_DLL
+#ifdef DLL_EXPORT
+#define DSOEXPORT __declspec(dllexport)
+#else
+// Temporarily commented because of VC++ compiler problems
+#define DSOEXPORT // __declspec(dllimport)
+#endif
- #define DSOLOCAL
+#define DSOLOCAL
#elif defined(__OS2__)
- #ifdef BUILDING_DLL
- #define DSOEXPORT __declspec(dllexport)
- #else
- // Temporarily commented because of VC++ compiler problems
- #define DSOEXPORT // __declspec(dllimport)
- #endif
-
- #define DSOLOCAL
-
-#else
- #ifdef HAVE_GNUC_VISIBILITY
- #define DSOEXPORT __attribute__ ((visibility("default")))
- #define DSOLOCAL __attribute__ ((visibility("hidden")))
- #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) /* Sun Studio >= 8 */
- #define DSOEXPORT __global
- #define DSOLOCAL __hidden
- #else
- #define DSOEXPORT
- #define DSOLOCAL
- #endif
-#endif
-
-#endif /* DSODEFS_H */
+#ifdef BUILDING_DLL
+#define DSOEXPORT __declspec(dllexport)
+#else
+// Temporarily commented because of VC++ compiler problems
+#define DSOEXPORT // __declspec(dllimport)
+#endif
+
+#define DSOLOCAL
+
+#else
+#ifdef HAVE_GNUC_VISIBILITY
+#define DSOEXPORT __attribute__ ((visibility("default")))
+#define DSOLOCAL __attribute__ ((visibility("hidden")))
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) /* Sun Studio >= 8 */
+#define DSOEXPORT __global
+#define DSOLOCAL __hidden
+#else
+#define DSOEXPORT
+#define DSOLOCAL
+#endif
+#endif
+
+#endif // DSODEFS_H
=== modified file 'libbase/log.h'
--- a/libbase/log.h 2010-04-16 14:18:46 +0000
+++ b/libbase/log.h 2010-05-04 19:15:00 +0000
@@ -407,26 +407,26 @@
// Only print function tracing messages when multiple -v
// options have been supplied.
__Host_Function_Report__(void) {
- log_debug("entering");
+ log_trace("entering");
}
__Host_Function_Report__(char *_func) {
func = _func;
- log_debug("%s enter", func);
+ log_trace("%s enter", func);
}
__Host_Function_Report__(const char *_func) {
func = _func;
if (func) {
- log_debug("%s enter", func);
+ log_trace("%s enter", func);
} else {
- log_debug("No Function Name! enter");
+ log_trace("No Function Name! enter");
}
}
~__Host_Function_Report__(void) {
if (LogFile::getDefaultInstance().getVerbosity() > LogFile::LOG_DEBUG) {
- log_debug("%s returning", func);
+ log_trace("%s returning", func);
}
}
};
@@ -451,10 +451,10 @@
#define GNASH_REPORT_RETURN
#else
#define GNASH_REPORT_FUNCTION \
- gnash::log_debug("entering")
+ gnash::log_trace("entering")
#define GNASH_REPORT_RETURN \
- gnash::log_debug("returning")
+ gnash::log_trace("returning")
#endif
}
=== modified file 'libvaapi/VaapiContext.cpp'
--- a/libvaapi/VaapiContext.cpp 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiContext.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiContext.cpp: VA context abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -32,6 +32,8 @@
/// Translates VAProfile to VaapiCodec
static VaapiCodec get_codec(VAProfile profile)
{
+ GNASH_REPORT_FUNCTION;
+
switch (profile) {
case VAProfileMPEG2Simple:
case VAProfileMPEG2Main:
@@ -82,6 +84,8 @@
, _entrypoint(entrypoint)
, _picture_width(0), _picture_height(0)
{
+ GNASH_REPORT_FUNCTION;
+
log_debug("VaapiContext::VaapiContext(): profile %d, entrypoint %d\n",
profile, entrypoint);
if (!construct()) {
@@ -94,6 +98,7 @@
VaapiContext::~VaapiContext()
{
+ GNASH_REPORT_FUNCTION;
log_debug("VaapiContext::~VaapiContext(): context 0x%08x\n", _context);
destruct();
@@ -186,6 +191,8 @@
void VaapiContext::destroyContext()
{
+ GNASH_REPORT_FUNCTION;
+
VAStatus status;
if (_context != VA_INVALID_ID) {
@@ -230,8 +237,7 @@
_surfaces.push(surface);
}
-} // gnash namespace
-
+} // end of gnash namespace
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiContext.h'
--- a/libvaapi/VaapiContext.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiContext.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiContext.h: VA context abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -20,8 +20,11 @@
#ifndef GNASH_VAAPICONTEXT_H
#define GNASH_VAAPICONTEXT_H
+
+#include <queue>
+
+#include "log.h"
#include "vaapi_common.h"
-#include <queue>
namespace gnash {
@@ -41,13 +44,13 @@
class VaapiContextData {
public:
virtual ~VaapiContextData()
- { }
+ { /* do nothing */ }
};
/// VA context abstraction
class VaapiContext {
typedef boost::shared_ptr<VaapiSurface> VaapiSurfaceSP;
-
+
VADisplay _display;
VAConfigID _config;
VAContextID _context;
@@ -72,8 +75,7 @@
bool initDecoder(unsigned int width, unsigned int height);
/// Return VA context
- VAContextID get() const
- { return _context; }
+ VAContextID get() const { return _context; }
/// Get a free surface
boost::shared_ptr<VaapiSurface> acquireSurface();
@@ -82,12 +84,10 @@
void releaseSurface(boost::shared_ptr<VaapiSurface> surface);
/// Set user data
- void setData(std::auto_ptr<VaapiContextData> user_data)
- { _user_data = user_data; }
+ void setData(std::auto_ptr<VaapiContextData> user_data) { _user_data =
user_data; }
/// Get user data
- VaapiContextData *getData() const
- { return _user_data.get(); }
+ VaapiContextData *getData() const { return _user_data.get(); }
};
} // gnash namespace
=== modified file 'libvaapi/VaapiDisplay.cpp'
--- a/libvaapi/VaapiDisplay.cpp 2010-03-10 20:53:12 +0000
+++ b/libvaapi/VaapiDisplay.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiDisplay.cpp: VA display abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -36,6 +36,7 @@
VaapiDisplay::~VaapiDisplay()
{
+ GNASH_REPORT_FUNCTION;
if (_display) {
vaTerminate(_display);
}
@@ -63,8 +64,7 @@
return true;
}
-} // gnash namespace
-
+} // end of gnash namespace
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiDisplay.h'
--- a/libvaapi/VaapiDisplay.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiDisplay.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiDisplay.h: VA display abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -34,13 +34,12 @@
explicit VaapiDisplay(VADisplay display);
virtual ~VaapiDisplay();
- VADisplay get() const
- { return _display; }
+ VADisplay get() const { return _display; }
};
} // gnash namespace
-#endif /* GNASH_VAAPIDISPLAY_H */
+#endif // GNASH_VAAPIDISPLAY_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiDisplayGLX.h'
--- a/libvaapi/VaapiDisplayGLX.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiDisplayGLX.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiDisplayGLX.h: VA/GLX display representation
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -20,21 +20,22 @@
#ifndef GNASH_VAAPIDISPLAYGLX_H
#define GNASH_VAAPIDISPLAYGLX_H
+#include "log.h"
#include <va/va_glx.h>
#include "VaapiDisplayX11.h"
namespace gnash {
-
-/// VA/GLX display representation
-struct VaapiDisplayGLX : public X11Display, VaapiDisplay {
- VaapiDisplayGLX()
- : VaapiDisplay(vaGetDisplayGLX(X11Display::get()))
- { }
-};
+
+ /// VA/GLX display representation
+ struct VaapiDisplayGLX : public X11Display, VaapiDisplay {
+ VaapiDisplayGLX()
+ : VaapiDisplay(vaGetDisplayGLX(X11Display::get()))
+ { /* do nothing */ }
+ };
} // gnash namespace
-#endif /* GNASH_VAAPIDISPLAY_H */
+#endif // GNASH_VAAPIDISPLAY_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiDisplayX11.h'
--- a/libvaapi/VaapiDisplayX11.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiDisplayX11.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiDisplayX11.h: VA/X11 display representation
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -30,14 +30,11 @@
Display *_x_display;
public:
- X11Display()
- { _x_display = XOpenDisplay(NULL); }
-
- ~X11Display()
- { if (_x_display) XCloseDisplay(_x_display); }
-
- Display *get() const
- { return _x_display; }
+ X11Display() { _x_display = XOpenDisplay(NULL); }
+
+ ~X11Display() { if (_x_display) XCloseDisplay(_x_display); }
+
+ Display *get() const { return _x_display; }
};
/// VA/X11 display representation
@@ -49,7 +46,7 @@
} // gnash namespace
-#endif /* GNASH_VAAPIDISPLAY_H */
+#endif // GNASH_VAAPIDISPLAY_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiException.h'
--- a/libvaapi/VaapiException.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiException.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiException.h: VA exception abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -24,24 +24,24 @@
#include <string>
namespace gnash {
-
-/// VA exception abstraction
-struct VaapiException: public std::runtime_error {
- VaapiException(const std::string & str)
- : std::runtime_error(str)
- { }
-
- VaapiException()
- : std::runtime_error("Video Acceleration error")
- { }
-
- virtual ~VaapiException() throw()
- { }
+
+ /// VA exception abstraction
+ struct VaapiException: public std::runtime_error {
+ VaapiException(const std::string & str)
+ : std::runtime_error(str)
+ { /* do nothing */ }
+
+ VaapiException()
+ : std::runtime_error("Video Acceleration error")
+ { /* do nothing */ }
+
+ virtual ~VaapiException() throw()
+ { /* do nothing */ }
};
} // gnash namespace
-#endif /* GNASH_VAAPIEXCEPTION_H */
+#endif // GNASH_VAAPIEXCEPTION_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiGlobalContext.cpp'
--- a/libvaapi/VaapiGlobalContext.cpp 2010-04-04 22:55:35 +0000
+++ b/libvaapi/VaapiGlobalContext.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiGlobalContext.cpp: VA API global context
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -155,7 +155,7 @@
return vaapi_global_context.get();
}
-} // gnash namespace
+} // end of gnash namespace
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiGlobalContext.h'
--- a/libvaapi/VaapiGlobalContext.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiGlobalContext.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiGlobalContext.h: VA API global context
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -20,8 +20,10 @@
#ifndef GNASH_VAAPIGLOBALCONTEXT_H
#define GNASH_VAAPIGLOBALCONTEXT_H
+#include <vector>
+
+#include "log.h"
#include "vaapi_common.h"
-#include <vector>
#include "VaapiDisplay.h"
#include "VaapiImageFormat.h"
@@ -66,8 +68,7 @@
/// Get the VA display
//
/// @return The VA display
- VADisplay display() const
- { return _display->get(); }
+ VADisplay display() const { return _display->get(); }
};
} // gnash namespace
=== modified file 'libvaapi/VaapiImage.cpp'
--- a/libvaapi/VaapiImage.cpp 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiImage.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiImage.cpp: VA image abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -172,7 +172,7 @@
return _image.pitches[plane];
}
-} // gnash namespace
+} // end of gnash namespace
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiImage.h'
--- a/libvaapi/VaapiImage.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiImage.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiImage.h: VA image abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -54,24 +54,19 @@
~VaapiImage();
/// Get VA image ID
- VAImageID get() const
- { return _image.image_id; }
+ VAImageID get() const { return _image.image_id; }
/// Get image format
- VaapiImageFormat format() const
- { return _format; }
+ VaapiImageFormat format() const { return _format; }
/// Get image width
- unsigned int width() const
- { return _image.width; }
+ unsigned int width() const { return _image.width; }
/// Get image height
- unsigned int height() const
- { return _image.height; }
+ unsigned int height() const { return _image.height; }
/// Check whether the VA image is mapped
- bool isMapped() const
- { return _image_data != NULL; }
+ bool isMapped() const { return _image_data != NULL; }
/// Map image data
bool map();
@@ -80,8 +75,7 @@
bool unmap();
/// Get number of planes
- unsigned int getPlaneCount() const
- { return _image.num_planes; }
+ unsigned int getPlaneCount() const { return _image.num_planes; }
/// Get pixels for the specified plane
boost::uint8_t *getPlane(int plane) const;
@@ -92,7 +86,7 @@
} // gnash namespace
-#endif /* GNASH_VAAPIIMAGE_H */
+#endif // GNASH_VAAPIIMAGE_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiImageFormat.cpp'
--- a/libvaapi/VaapiImageFormat.cpp 2010-03-02 23:26:48 +0000
+++ b/libvaapi/VaapiImageFormat.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiImageFormat.cpp: VA image format abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -42,7 +42,7 @@
// Return image format from a VA image format
VaapiImageFormat vaapi_get_image_format(VAImageFormat const &format)
{
- /* XXX: check RGB formats and endianess */
+ // XXX: check RGB formats and endianess
return static_cast<VaapiImageFormat>(format.fourcc);
}
=== modified file 'libvaapi/VaapiImageFormat.h'
--- a/libvaapi/VaapiImageFormat.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiImageFormat.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiImageFormat.h: VA image format abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -71,7 +71,7 @@
/// Return image format from a VA image format
VaapiImageFormat vaapi_get_image_format(VAImageFormat const &format);
-#endif /* GNASH_VAAPIIMAGEFORMAT_H */
+#endif // GNASH_VAAPIIMAGEFORMAT_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiSubpicture.cpp'
--- a/libvaapi/VaapiSubpicture.cpp 2010-03-02 23:26:48 +0000
+++ b/libvaapi/VaapiSubpicture.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiSubpicture.cpp: VA subpicture abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -89,7 +89,6 @@
} // end of gnash namespace
-
// local Variables:
// mode: C++
// indent-tabs-mode: nil
=== modified file 'libvaapi/VaapiSubpicture.h'
--- a/libvaapi/VaapiSubpicture.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiSubpicture.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiSubpicture.h: VA subpicture abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -45,13 +45,12 @@
~VaapiSubpicture();
/// Return VA subpicture id
- VASubpictureID get() const
- { return _subpicture; }
+ VASubpictureID get() const { return _subpicture; }
};
} // gnash namespace
- #endif /* GNASH_VAAPISUBPICTURE_H */
+#endif // GNASH_VAAPISUBPICTURE_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiSurface.cpp'
--- a/libvaapi/VaapiSurface.cpp 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiSurface.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiSurface.cpp: VA surface abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -18,6 +18,7 @@
//
#include <algorithm>
+#include <boost/cstdint.hpp>
#include "log.h"
#include "VaapiSurface.h"
@@ -43,7 +44,7 @@
~VaapiSurfaceImpl();
};
-VaapiSurfaceImpl::VaapiSurfaceImpl(const VaapiSurface *surface,
+ VaapiSurfaceImpl::VaapiSurfaceImpl(const VaapiSurface */* surface */,
unsigned int width, unsigned int height)
: VaapiSurfaceImplBase(width, height)
{
@@ -201,8 +202,7 @@
return true;
}
-} // gnash namespace
-
+} // end of gnash namespace
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiSurface.h'
--- a/libvaapi/VaapiSurface.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiSurface.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiSurface.h: VA surface abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -45,24 +45,20 @@
unsigned int _height;
protected:
- void reset(uintptr_t surface)
- { _surface = surface; }
+ void reset(uintptr_t surface) { _surface = surface; }
public:
VaapiSurfaceImplBase(unsigned int width, unsigned int height);
virtual ~VaapiSurfaceImplBase() { }
/// Get VA surface
- uintptr_t surface() const
- { return _surface; }
+ uintptr_t surface() const { return _surface; }
/// Get surface width
- unsigned int width() const
- { return _width; }
+ unsigned int width() const { return _width; }
/// Get surface height
- unsigned int height() const
- { return _height; }
+ unsigned int height() const { return _height; }
};
/// VA surface abstraction
@@ -74,27 +70,22 @@
VaapiContext *_context;
/// Set parent VA context
- void setContext(VaapiContext *context)
- { _context = context; }
+ void setContext(VaapiContext *context) { _context = context; }
public:
VaapiSurface(unsigned int width, unsigned int height);
/// Return parent VA context
- VaapiContext *getContext() const
- { return _context; }
+ VaapiContext *getContext() const { return _context; }
/// Return VA surface id
- VASurfaceID get() const
- { return static_cast<VASurfaceID>(_impl->surface()); }
+ VASurfaceID get() const { return
static_cast<VASurfaceID>(_impl->surface()); }
/// Get surface width
- unsigned int width() const
- { return _impl->width(); }
+ unsigned int width() const { return _impl->width(); }
/// Get surface height
- unsigned int height() const
- { return _impl->height(); }
+ unsigned int height() const { return _impl->height(); }
/// Clear surface with black color
void clear();
@@ -110,7 +101,7 @@
} // gnash namespace
-#endif /* GNASH_VAAPISURFACE_H */
+#endif // GNASH_VAAPISURFACE_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiSurfaceGLX.cpp'
--- a/libvaapi/VaapiSurfaceGLX.cpp 2010-03-02 23:26:48 +0000
+++ b/libvaapi/VaapiSurfaceGLX.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiSurfaceGLX.cpp: VA/GLX surface abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -203,7 +203,7 @@
VaapiSurfaceGLXImpl::~VaapiSurfaceGLXImpl()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
log_debug("VaapiSurface::~VaapiSurface(): surface %p\n", surface());
@@ -264,8 +264,7 @@
return dynamic_cast<VaapiSurfaceGLXImpl *>(_impl.get())->update(surface);
}
-} // gnash namespace
-
+} // end of gnash namespace
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiSurfaceGLX.h'
--- a/libvaapi/VaapiSurfaceGLX.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiSurfaceGLX.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiSurfaceGLX.h: VA/GLX surface abstraction
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -34,16 +34,13 @@
VaapiSurfaceGLX(GLenum target, GLuint texture);
/// Return VA surface id
- void *get() const
- { return reinterpret_cast<void *>(_impl->surface()); }
+ void *get() const { return reinterpret_cast<void *>(_impl->surface()); }
/// Get surface width
- unsigned int width() const
- { return _impl->width(); }
+ unsigned int width() const { return _impl->width(); }
/// Get surface height
- unsigned int height() const
- { return _impl->height(); }
+ unsigned int height() const { return _impl->height(); }
/// Update VA/GLX surface from VA surface
bool update(boost::shared_ptr<VaapiSurface> surface);
@@ -51,7 +48,7 @@
} // gnash namespace
-#endif /* GNASH_VAAPISURFACEGLX_H */
+#endif // GNASH_VAAPISURFACEGLX_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiSurfaceProxy.cpp'
--- a/libvaapi/VaapiSurfaceProxy.cpp 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiSurfaceProxy.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiSurfaceProxy.cpp: VA surface proxy
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -30,7 +30,7 @@
{
log_debug("VaapiSurfaceProxy::VaapiSurfaceProxy(): surface 0x%08x\n",
_surface->get());
}
-
+
VaapiSurfaceProxy::~VaapiSurfaceProxy()
{
log_debug("VaapiSurfaceProxy::~VaapiSurfaceProxy(): surface 0x%08x\n",
_surface->get());
@@ -38,8 +38,7 @@
_context->releaseSurface(_surface);
}
-} // gnash namespace
-
+} // end of gnash namespace
// local Variables:
// mode: C++
=== modified file 'libvaapi/VaapiSurfaceProxy.h'
--- a/libvaapi/VaapiSurfaceProxy.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/VaapiSurfaceProxy.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// VaapiSurfaceProxy.h: VA surface proxy
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -40,17 +40,15 @@
~VaapiSurfaceProxy();
/// Return VA surface
- boost::shared_ptr<VaapiSurface> get() const
- { return _surface; }
+ boost::shared_ptr<VaapiSurface> get() const { return _surface; }
/// Return VA context
- boost::shared_ptr<VaapiContext> getContext() const
- { return _context; }
+ boost::shared_ptr<VaapiContext> getContext() const { return _context; }
};
} // gnash namespace
-#endif /* GNASH_VAAPISURFACEPROXY_H */
+#endif // GNASH_VAAPISURFACEPROXY_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/vaapi_common.h'
--- a/libvaapi/vaapi_common.h 2010-03-02 15:37:35 +0000
+++ b/libvaapi/vaapi_common.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// vaapi_common.h: VA API common (internal) includes and definitions
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -26,12 +26,12 @@
#include <va/va.h>
#include <memory>
-#include <stdint.h> /* XXX: uintptr_t */
+#include <stdint.h>
#include <boost/cstdint.hpp>
#include <boost/shared_ptr.hpp>
#include "dsodefs.h"
-#endif /* GNASH_VAAPI_COMMON_H */
+#endif // GNASH_VAAPI_COMMON_H
// local Variables:
// mode: C++
=== modified file 'libvaapi/vaapi_utils.cpp'
--- a/libvaapi/vaapi_utils.cpp 2010-03-02 15:37:35 +0000
+++ b/libvaapi/vaapi_utils.cpp 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// vaapi_utils.cpp: VA API utilities
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -23,7 +23,6 @@
namespace gnash {
-
static bool g_vaapi_is_enabled = false;
// Enable video acceleration (with VA API)
@@ -113,8 +112,7 @@
return "<unknown>";
}
-} // gnash namespace
-
+} // end of gnash namespace
// local Variables:
// mode: C++
=== modified file 'libvaapi/vaapi_utils.h'
--- a/libvaapi/vaapi_utils.h 2010-03-02 16:39:49 +0000
+++ b/libvaapi/vaapi_utils.h 2010-05-04 14:21:15 +0000
@@ -1,6 +1,6 @@
// vaapi_utils.h: VA API utilities
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// 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
@@ -47,7 +47,7 @@
} // gnash namespace
-#endif /* GNASH_VAAPI_UTILS_H */
+#endif // GNASH_VAAPI_UTILS_H
// local Variables:
// mode: C++
=== modified file 'macros/ffmpeg.m4'
--- a/macros/ffmpeg.m4 2010-04-05 19:54:56 +0000
+++ b/macros/ffmpeg.m4 2010-05-04 20:37:38 +0000
@@ -270,6 +270,10 @@
else
have_ffmpeg_vaapi=no
fi
+ if test -z "$ffmpeg_num_version" -o "$ffmpeg_num_version" -gt 52450; then
+ dnl 52.45.0 (r20957) or higher required for VAAPI support
+ AC_DEFINE(FFMPEG_VAAPI, 1, [Define if ffmpeg supports VAAPI.])
+ fi
else
AC_MSG_WARN([Could not check ffmpeg version (can't find avcodec.h file)])
# ffmpeg_version_check=ok # this is NOT ok, why would it be ?!
=== modified file 'plugin/npapi/pluginScriptObject.cpp'
--- a/plugin/npapi/pluginScriptObject.cpp 2010-04-22 19:45:32 +0000
+++ b/plugin/npapi/pluginScriptObject.cpp 2010-05-04 20:38:42 +0000
@@ -122,7 +122,7 @@
NPIdentifier id = NPN_GetStringIdentifier(name.c_str());
NPVariant strvar;
- STRINGN_TO_NPVARIANT(val.c_str(), val.size(), strvar);
+ STRINGN_TO_NPVARIANT(val.c_str(), static_cast<int>(val.size()), strvar);
SetProperty(id, strvar);
}
@@ -663,7 +663,7 @@
// plugin support.
NPVariant value;
if (name == "$version") {
- STRINGZ_TO_NPVARIANT(strdup("LNX 10,0,r999"), value);
+ STRINGN_TO_NPVARIANT("LNX 10,0,r999", 13, value);
} else {
log_error("Couldn't send GetVariable request, network problems.");
NULL_TO_NPVARIANT(value);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r12175: fix crash when auto-detecting the driver, and minor reformatting changes from branch.,
Rob Savoye <=