Last modified 11 years ago Last modified on 08/21/09 18:32:59

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=FLASH_CONTENT_BASIC_R1, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block



This task is about embedding flash in Sophie. The purpose of this revision is to perform a research on embedding flash. As a result a simple demo of c++ - java communication displaying flash will be present.

Task requirements

  • perform research for a suitable library
  • write a simple demo

Task result

A simple demo for the communication between java and c++ displaying a .swf file.

Implementation idea

Use swfdec library. Possibly gnash if swfdec turns to be improper.

swfdec home page

How to demo

Run the created demo.


The idea is to create a few classes in both the c++ and java sides and implement communication between them.

  • In the java part:
    • Create a class SwfdecCommunicator that will implement the communication between the java and c++ code:
      • create a construct that takes a string - path to the c++ executable as its only argument
      • create a method sendCommand that sends a command to the c++ executable and returns the result as a BufferedImage. For the purposes of this demo there are only two possible commands - one with code -1 meaning "terminate" and another with code 1 meaning "get next frame".
    • Create a class FlashMovieDemo that will play the flash movie in a JFrame. This class will extend javax.awt.Component so that it can be added as a component in the Jframe object.
      • create a main method that will perform the creation of the JFrame and will take care that it is repainted accordingly.
  • In the c++ part:
    • Create a class SwfdecCommunicator that will hold the SwfdecPlayer object needed to decode the swf file.
      • create a constructor that takes as its only argument the url to the swf file. This method will create the SwfdecPalyer and take care that it is properly initialized.
      • create a method setSize that sets the size of the player
      • create a method outputToCairo that renders the current frame to a cairo object
      • create a method advance that will advance the player to the next frame
    • Create a class CairoHandler that handles the cairo object and takes care that it is properly destroyed. Make SwfdecCommunicator it's friend class so that it can render to the CairoHandlers cairo object.
    • Create a main function that performs the demo.



(Place the testing results here.)


(Write comments for this or later revisions here.)