Difference between revisions of "Mac OS X Porting - Native Audio and Video"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Design)
(restoring content - vandalism)
 
(45 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
===Contributors===
 
===Contributors===
  
Eric Bachard  (ericb at openoffice dot org )
+
* Eric Bachard  (ericb at openoffice dot org )
 +
* Mox Soini: [[User:Mox|Mox]]
  
 
=== Introduction===
 
=== Introduction===
 
+
Page under construction
+
'''Kai's Mail'''
 
+
 
Work started discussing with Kai Ahrens (author of avmedia).
 
Work started discussing with Kai Ahrens (author of avmedia).
 
As adviced by Kai we will reuse Windows implementation (copied/pasted from Kai's mail):
 
As adviced by Kai we will reuse Windows implementation (copied/pasted from Kai's mail):
  
"... Beside the
+
<blockquote>
'common' avmedia part, that is the same on all platforms and used from
+
"... Beside the 'common' avmedia part, that is the same on all platforms and used from
 
the high level application side, there are several backend (actually
 
the high level application side, there are several backend (actually
 
two, one for Windows and one for JMF backends) implementations already
 
two, one for Windows and one for JMF backends) implementations already
 
realized or to be realized like a Xine, GStreamer etc. backend..."
 
realized or to be realized like a Xine, GStreamer etc. backend..."
 
+
<p>
 
"...What you did so far, is absolutely the right way. Taking the existing
 
"...What you did so far, is absolutely the right way. Taking the existing
 
Windows implementation and fill it with the appropriate Quicktime or
 
Windows implementation and fill it with the appropriate Quicktime or
Line 22: Line 22:
 
(avmedia/source/viewer/mediawindowbase_impl.cxx) accordingly to get your
 
(avmedia/source/viewer/mediawindowbase_impl.cxx) accordingly to get your
 
new component initialized instead of the existing ones.
 
new component initialized instead of the existing ones.
 
+
</p><p>
 
Having a 'status' struct is already realized within
 
Having a 'status' struct is already realized within
 
mediawindowbase_impl.cxx and the corresponding methods
 
mediawindowbase_impl.cxx and the corresponding methods
Line 28: Line 28:
 
MediaWindowBaseImpl::executeMediaItem , I think, but maybe
 
MediaWindowBaseImpl::executeMediaItem , I think, but maybe
 
I didn't get you right here.
 
I didn't get you right here.
 
+
</p><p>
 
Please feel free to ask if you have any detailed questions.
 
Please feel free to ask if you have any detailed questions.
 +
</p><p>
 +
With best regards,
 +
Kai"</p>
 +
</blockquote>
  
With best regards
 
Kai"
 
  
===Important links===
+
Recently, Radek Doulik and Cedric Bosdonnat did a conference at OOoCon, about GStreamer work on Linux
  
Starting point : http://developer.apple.com/documentation/QuickTime/APIREF/index.html
+
Use Radek Doulik and Cedric Bosdonnat gstreamer work: [http://marketing.openoffice.org/ooocon2006/schedule/wednesday.html OOoCon 2006 presentation], [http://eric.bachard.free.fr/mac/OOoCon2006/GStreamer-in-OpenOffice.org.odp slides (ODP)]
  
http://developer.apple.com/documentation/QuickTime/APIREF/MovieFunctions.htm
 
  
* Complete list of usefull functions :
 
  
http://developer.apple.com/documentation/QuickTime/APIREF/GettingandPlayingMovies.htm
+
As part of native OpenOffice.org for Mac OS X, a Quicktime backend for avmedia module will be created, to support native audio and video on Mac OS X. Although this implementation concentrates on Mac OS X, it should be possible to make Quicktime backend work on Windows-platform too.
  
Current files are here :
+
===Tasks===
  
http://eric.bachard.free.fr/mac/aquavcl/patches/player_aqua/avmedia/source/
+
OOo scope: avmedia module
  
Note : this is work in progress and some files are still windows implementation.
+
'''PRECONDITION:''' avmedia work depends on '''platform-independent UNO VCL API'''. This API is as of Feb 2007 not fully implemented in Mac OS X AQUA implementation of VCL. Until this API is completed, it is not possible to have working implementation of Quicktime avmedia module.
  
=== Design ===
 
  
Use Radek Doulik and Cedric Bosdonnat work
+
The main issue used for this  task will be [http://www.openoffice.org/issues/show_bug.cgi?id=66170 #i66170#]. Everything concerning this task will be commited using this issue number.
  
OOoCon presentation : http://eric.bachard.free.fr/mac/OOoCon2006/GStreamer-in-OpenOffice.org.odp
+
All contributions are welcome, and all people interested for this task are invited to contribute.
  
Concerned module : avmedia
+
===Rules for contributions===
  
The native sound implementation will use already existing windows implementation as model, replacing current avmedia implementation.
+
1) expected work
  
[work in progress]
+
Code only is not sufficient: to improve our efficiency and to make this code maintainable, we must document it, and we have to do that in the same time we write it.
  
Todo list :
+
e.g.  UML Diagrams, Design patterns used. More generally, anything about Design is very welcome.
  
Use existing windows iimplementation.
 
  
1) Create new tree in avmedia :
+
2) About code
  
avmedia/source/macosx
+
The conditions to be respected are : accepted JCA, and provide code respecting LGPL license used for OpenOffice.org.
  
Containing :
 
  
new makefile.mk
+
3) Implementation starting point:
 +
* Look at Win and Java backends in avmedia module and
 +
* Go through [http://developer.apple.com/documentation/QuickTime/APIREF/ Quicktime API reference], especially [http://developer.apple.com/documentation/QuickTime/APIREF/MovieFunctions.htm the Movie functions], [http://developer.apple.com/documentation/QuickTime/Reference/QTRef_MovieManager/Reference/reference.html Movie Reference]
 +
* Complete list of [http://developer.apple.com/documentation/QuickTime/APIREF/GettingandPlayingMovies.htm useful Quicktime functions]
  
C++ files ( not sure the list is complete, to be confirmed ) :
+
4) '''Known issues''':  
macosxframegrabber.cxx, macosxmanager.cxx, macosxplayer.cxx, macosxwindow.cxx, macosxuno.cxx
+
Quicktime will not be able to play all windows .avi and .wma files, because it does not support them. We may need xine or some other player backend to see some of the OOo documents created on Windows/Linux OOo.
  
headers will be put into avmedia/inc
+
For other backends, make sure that we don't build backends that we don't need (i.e. if defined QUARTZ/MACOSX)
  
(confirmed : is avmedia/inc the best place ?)
+
affected files (at least): avmedia/source/xine/makefile.mk
+
macosxframegrabber.hxx, macosxmanager.hxx, macosxplayer.hxx, macosxwindow.hxx, macosxuno.hxx, macosxplayerhelpers.hxx
+
  
2) Other modifications :
+
===Status===
  
avmedia/source/xine/makefile.mk
+
EricB started the work and proposed patches : [http://eric.bachard.free.fr/mac/aquavcl/patches/player_aqua/avmedia/source/ Aqua player implementation].
  
-> MAYBE NOT: ''not build libxine if defined QUARTZ (maybe MACOSX ?) -> just adding a dummy rule in the makefile''
+
Mox proposed an initial structure for the quicktime backend has been put up to [http://www.openoffice.org/issues/show_bug.cgi?id=69665 issue 69665]. It is based on the stub of Xine -backend, OOo milestone m184.
  
-> Quicktime will not be able to play all windows .avi and .wma files, because it does not support them. We may need xine or some other player backend to see some of the OOo documents created on Windows OOo.
+
'''[FIXME]''' : document this code
  
avmedia/prj/build.lst
 
  
-> add new part avmedia/source/macosx to be built
+
* create manager ( using UNO services)  [ done ]
 
+
** create uno layer [ done ]
Space naming convention :
+
** implement correct service name / implementation name using UNO  [ done ]
 
+
** create player (using QuickTime API)  [ work in progress ]
NO: ''Use aqua for the new classes, and AquaPlayer as prefix for everything.''
+
<code>
+
  This is not good. Use '''Quicktime''' or '''QT''' for all things, also for directory and files:
+
  '''avmedia/source/quicktime/'''... Why? Because Quicktime can be used also on Windows! (remember iTunes?)
+
  And this is not Aqua technology. There is no reason to "brand" this as Mac OS X thing, when also other
+
  platforms can use it.
+
</code>
+
 
+
 
+
- create manager ( using UNO services)  [ done ]
+
- create uno layer [ done ]
+
- implement correct service name / implementation name using UNO  [ work in progress ]
+
- create player (using QuickTime API)  [ work in progress ]
+
 
    
 
    
Missing (to be adapted for QuickTime) :
+
* Missing (to be adapted for QuickTime) :
 
+
using avmedia::quicktime::  
using avmedia::aqua::  
+
  
 
  Player::Player()    // Ctor
 
  Player::Player()    // Ctor
Line 120: Line 103:
 
  const Player::getVideoWindow()
 
  const Player::getVideoWindow()
 
  void Player::setNotifyWnd()
 
  void Player::setNotifyWnd()
  void Player::setDDrawParams()
+
  void Player::setDDrawParams() // maybe not needed
 
  long Player::processEvent()
 
  long Player::processEvent()
 
  void Player::start()
 
  void Player::start()
Line 141: Line 124:
 
  [FIXME] Other methods to be implemented ?
 
  [FIXME] Other methods to be implemented ?
  
Done (using existing Windows implementation) :
 
- all headers are defined
 
- usefull functions are identifed in Apple's API
 
  
  Found in System/Library/Framework/QuickTime.framework/Headers/Movies.h :
+
* all headers are defined [ Done (using existing Xine/Win implementation) ]
 +
* usefull functions are identifed in Apple's API
 +
 
 +
Found in /System/Library/Framework/QuickTime.framework/Headers/Movies.h :
  
 
  '''DisposeMovie()'''
 
  '''DisposeMovie()'''
Line 166: Line 149:
 
  [FIXME] not complete
 
  [FIXME] not complete
  
+
 
[To be continued]
+
  
 
Other work in progress :
 
Other work in progress :
- discuss with ka about new implementation and fix dark points
+
* discuss with ka about new implementation and fix dark points
- new implementation of  -already defined- methods used in the player
+
* new implementation of  -already defined- methods used in the player
 
+
* Todo : find infos about framegrabber.cxx ?
Todo : find infos about framegrabber.cxx ?
+
  
 
===Component Context===
 
===Component Context===
  
[FIXME]
+
[FIXME] use Radek and Cedric description, very interesting
  
 
===Component Design===
 
===Component Design===
  
[FIXME]
+
[FIXME] use Radek and Cedric description, very interesting
 +
 
  
[[User:Ericb|Ericb]] 19:32, 4 June 2006 (CEST)
 
  
 
[[Category:Porting]]
 
[[Category:Porting]]
 
[[Category:Aqua]]
 
[[Category:Aqua]]
 
[[Category:MacOSX]]
 
[[Category:MacOSX]]

Latest revision as of 15:23, 30 January 2011

Contributors

  • Eric Bachard (ericb at openoffice dot org )
  • Mox Soini: Mox

Introduction

Kai's Mail Work started discussing with Kai Ahrens (author of avmedia). As adviced by Kai we will reuse Windows implementation (copied/pasted from Kai's mail):

"... Beside the 'common' avmedia part, that is the same on all platforms and used from the high level application side, there are several backend (actually two, one for Windows and one for JMF backends) implementations already realized or to be realized like a Xine, GStreamer etc. backend..."

"...What you did so far, is absolutely the right way. Taking the existing Windows implementation and fill it with the appropriate Quicktime or whatever pieces. After finishing your new backend you should adjust the code in MediaWindowBaseImpl::createPlayer (avmedia/source/viewer/mediawindowbase_impl.cxx) accordingly to get your new component initialized instead of the existing ones.

Having a 'status' struct is already realized within mediawindowbase_impl.cxx and the corresponding methods MediaWindowBaseImpl::updateMediaItem and MediaWindowBaseImpl::executeMediaItem , I think, but maybe I didn't get you right here.

Please feel free to ask if you have any detailed questions.

With best regards,

Kai"


Recently, Radek Doulik and Cedric Bosdonnat did a conference at OOoCon, about GStreamer work on Linux

Use Radek Doulik and Cedric Bosdonnat gstreamer work: OOoCon 2006 presentation, slides (ODP)


As part of native OpenOffice.org for Mac OS X, a Quicktime backend for avmedia module will be created, to support native audio and video on Mac OS X. Although this implementation concentrates on Mac OS X, it should be possible to make Quicktime backend work on Windows-platform too.

Tasks

OOo scope: avmedia module

PRECONDITION: avmedia work depends on platform-independent UNO VCL API. This API is as of Feb 2007 not fully implemented in Mac OS X AQUA implementation of VCL. Until this API is completed, it is not possible to have working implementation of Quicktime avmedia module.


The main issue used for this task will be #i66170#. Everything concerning this task will be commited using this issue number.

All contributions are welcome, and all people interested for this task are invited to contribute.

Rules for contributions

1) expected work

Code only is not sufficient: to improve our efficiency and to make this code maintainable, we must document it, and we have to do that in the same time we write it.

e.g. UML Diagrams, Design patterns used. More generally, anything about Design is very welcome.


2) About code

The conditions to be respected are : accepted JCA, and provide code respecting LGPL license used for OpenOffice.org.


3) Implementation starting point:

4) Known issues: Quicktime will not be able to play all windows .avi and .wma files, because it does not support them. We may need xine or some other player backend to see some of the OOo documents created on Windows/Linux OOo.

For other backends, make sure that we don't build backends that we don't need (i.e. if defined QUARTZ/MACOSX)

affected files (at least): avmedia/source/xine/makefile.mk

Status

EricB started the work and proposed patches : Aqua player implementation.

Mox proposed an initial structure for the quicktime backend has been put up to issue 69665. It is based on the stub of Xine -backend, OOo milestone m184.

[FIXME] : document this code


  • create manager ( using UNO services) [ done ]
    • create uno layer [ done ]
    • implement correct service name / implementation name using UNO [ done ]
    • create player (using QuickTime API) [ work in progress ]
  • Missing (to be adapted for QuickTime) :

using avmedia::quicktime::

Player::Player()    // Ctor
Player::~PLayer() // Dtor
bool Player::create()
const Player::getVideoWindow()
void Player::setNotifyWnd()
void Player::setDDrawParams()  // maybe not needed
long Player::processEvent()
void Player::start()
void Player::stop()
sal_Bool Player::isPlaying()
double Player::getDuration()
void Player::setMediaTime()
double Player::getMediaTime()
void Player::setStopTime()
double Player::getStopTime()
void Player::setRate()
void Player::getRate()
void Player::setPlaybackLoop()
void Player::isPlaybackLoop()
void Player::setMute()
sal_Bool Player::isMute()
void Player::setVolumeDB()
sal_Int16 Player::getVolumeDB()

[FIXME] Other methods to be implemented ?


  • all headers are defined [ Done (using existing Xine/Win implementation) ]
  • usefull functions are identifed in Apple's API

Found in /System/Library/Framework/QuickTime.framework/Headers/Movies.h :

DisposeMovie()
Frees any memory being used by a movie, including the memory used by the movie's tracks and media structures.
EnterMovies()
Initializes the Movie Toolbox and creates a private storage area for your application.
GetMovieDuration()
Returns the duration of a movie.
GetMovieRate()
Returns a movie's playback rate.
GetMovieTime
Returns a movie's current time both as a time value and in a time structure. 
GetMovieVolume
Returns a movie's current volume setting.
IsMovieDone
Determines if a particular movie has completely finished playing.
SetMovieGWorld
Establishes a movie's display coordinate system by setting the graphics world for displaying the movie.

[FIXME] not complete


Other work in progress :

  • discuss with ka about new implementation and fix dark points
  • new implementation of -already defined- methods used in the player
  • Todo : find infos about framegrabber.cxx ?

Component Context

[FIXME] use Radek and Cedric description, very interesting

Component Design

[FIXME] use Radek and Cedric description, very interesting

Personal tools