wiki:FLASH_CONTENT_BASIC_R1
Last modified 3 years ago Last modified on 08/21/09 18:32:59

Pages linking to FLASH_CONTENT_BASIC_R1:
FLASH_CONTENT_BASIC_R3
FLASH_CONTENT_BASIC_R2
TASK_INDEX

Ticket Summary Owner Status Type Component Priority Effort Importance
#1031 FLASH_CONTENT_BASIC_R1 izomorphius closed planned_task ALIEN_ELEMENTS 3 2 0

Reported by Astea, 4 years ago.

Description

wiki page: FLASH_CONTENT_BASIC_R1 - effort: 2d

Analysis_owners

izomorphius, boyan

Analysis_reviewers

dido

Analysis_score

4

Design_owners

izomorphius

Design_reviewers

meddle

Design_score

3.5

Imp._owners

izomorphius

Imp._reviewers

meddle

Imp._score

3.5

Test_score

0

Analysis

Overview

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.

Design

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.

Implementation

http://sophie2.org/trac/browser/branches/private/ivo/swfdec-test

Testing

(Place the testing results here.)

Comments

(Write comments for this or later revisions here.)