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

From Apache OpenOffice Wiki
Jump to: navigation, search
(Kai's Mail)
(Kai's Mail)
Line 167: Line 167:
 
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 174: Line 174:
 
(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>
 
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 180: Line 180:
 
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>
 
Please feel free to ask if you have any detailed questions.
 
Please feel free to ask if you have any detailed questions.
 
+
<p>
With best regards
+
With best regards,
 
Kai"
 
Kai"
 
</blockquote>
 
</blockquote>

Revision as of 08:07, 19 September 2006

Contributors

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

Introduction

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.

This approach was agreed with the author of avmedia module (Kai Ahrens, Kai's Mail).

Important links

Starting point : http://developer.apple.com/documentation/QuickTime/APIREF/index.html

http://developer.apple.com/documentation/QuickTime/APIREF/MovieFunctions.htm

  • Complete list of usefull functions :

http://developer.apple.com/documentation/QuickTime/APIREF/GettingandPlayingMovies.htm

Current files are here :

http://eric.bachard.free.fr/mac/aquavcl/patches/player_aqua/avmedia/source/

Note : this is work in progress and some files are still windows implementation.

Design

Use Radek Doulik and Cedric Bosdonnat work

OOoCon presentation : http://eric.bachard.free.fr/mac/OOoCon2006/GStreamer-in-OpenOffice.org.odp

Concerned module : avmedia

The native sound implementation will use already existing windows implementation as model, replacing current avmedia implementation.

[work in progress]

Todo list :

Use existing windows iimplementation.

1) Create new tree in avmedia :

avmedia/source/macosx

Containing :

new makefile.mk

C++ files ( not sure the list is complete, to be confirmed ) : macosxframegrabber.cxx, macosxmanager.cxx, macosxplayer.cxx, macosxwindow.cxx, macosxuno.cxx

headers will be put into avmedia/inc

(confirmed : is avmedia/inc the best place ?)

macosxframegrabber.hxx, macosxmanager.hxx, macosxplayer.hxx, macosxwindow.hxx, macosxuno.hxx, macosxplayerhelpers.hxx

2) Other modifications :

avmedia/source/xine/makefile.mk

-> MAYBE NOT: not build libxine if defined QUARTZ (maybe MACOSX ?) -> just adding a dummy rule in the makefile

-> 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.

avmedia/prj/build.lst

-> add new part avmedia/source/macosx to be built

Space naming convention :

NO: Use aqua for the new classes, and AquaPlayer as prefix for everything.

 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. 


- 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) :
using avmedia::aqua:: 
Player::Player()    // Ctor
Player::~PLayer() // Dtor
bool Player::create()
const Player::getVideoWindow()
void Player::setNotifyWnd()
void Player::setDDrawParams()
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 ?
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 :
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


[To be continued]

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]

Component Design

[FIXME]

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. <p> 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. <p> Please feel free to ask if you have any detailed questions. <p> With best regards, Kai" </blockquote>

Personal tools