Skip to content

Commit

Permalink
Add some documents. The same as QtAV's wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Mar 3, 2013
1 parent 15bec57 commit d03b868
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 0 deletions.
38 changes: 38 additions & 0 deletions doc/CompileWithMSVC.md
Original file line number Diff line number Diff line change
@@ -0,0 1,38 @@
## Build FFmpeg

The difficulty is compiling FFmpeg with msvc. The method can be found on the internet. But there is an easier way. When compiling the latest version of FFmpeg with mingw gcc, the *.lib are also created and installed in /usr/local/bin, which can be linked by msvc.
For other libraries compiled with mingw gcc, we can link them in a similar way. I introduce how to use the portaudio library created by mingw gcc. If you compile portaudio with mingw gcc, portaudio.lib file will not be created. So we should create it manually. But the def file can be found in lib/.lib, it will not be installed by default. There is a powerful tool named _dlltool_, with which we can create a lib from a def file for vc, using the following command
`dlltool -m i386 -d libportaudio-2.dll.def -l portaudio.lib -D libportaudio-2.dll`
Then put portaudio.lib into /usr/local/lib and it will be found when linking.
The compiled libraries with msvc support can be found [here](https://sourceforge.net/projects/qtav/files/depends)

## Build In Visual Studio

I don't put any vs project file in QtAV, because it's easy to create by qmake.

Open cmd

qmake -r BUILD_DIR=�%\out -tp vc QtAV.pro

If you are in sh environment

qmake -r BUILD_DIR=$PWD/out -tp vc QtAV.pro

Then the sln and vcxproj(vcproj) files will be created. Open QtAV.sln in your Visual Studio, Compile it.

Another solution is using Qt vs plugin. It will help you to load qmake projects.

## Build In QtCreator

QtCreator will detect VC compiler if it is installed. So it's easy to build in QtCreator


## Build in Command Line VC

I have got VC compiler and win sdk from latest VS2012 Update1. You can download it from http://qtbuild.googlecode.com/files/vs2012-x86.7z

The environment is small but has the almost complete functionality. At least it can build Qt.

# ISSUES

If you want to build a debug version, you may get some link errors. It's not your problem, my qmake projects have some little problem. Just fix it manually yourself.
20 changes: 20 additions & 0 deletions doc/MultiplePlayersSynchronization.md
Original file line number Diff line number Diff line change
@@ -0,0 1,20 @@
## Hypothesis

The players' playing states are not changed when syncing, e.g. speed, play or pause state.

## KEY

Sending and Recieving the sync requests takes time. The delay must be computed

## Solution



### Players in 1 Process

Use AVClock. It's easy.

### Players in Network

Pass 2 value. One is aboslute time when sending the sync request. Another is the play time of the video.
This method also works for players in 1 process
Empty file.
19 changes: 19 additions & 0 deletions doc/NativePaintingInQWidget.md
Original file line number Diff line number Diff line change
@@ -0,0 1,19 @@
Sometimes, we may want paint in QWidget without QPainter, for example, using DirectX api. This document will tell you how to reach it.

###0. setAttribute(Qt::WA_PaintOnScreen, true)

Document says that if you want to use native painting, the attribute should be true. Otherwise you will see the fuck flicker.

###1. Let paint engine be 0

Thus QPainter is disabled. Otherwise you will see the fuck flicker again.
This page is helpful: http://lists.trolltech.com/qt4-preview-feedback/2005-04/thread00609-0.html
It seems that let paintEngine() return 0 is from here.

###2. Reimplement `paintEvent`

Oberviously, you should do something here. You can begin the painting in paintEvent

###3. Reimplement `showEvent`

This is important if you change the `WindowStaysOnTopHint` flag. As far as i know, some paint engines use the resource depend on the window. If window changes, resource must be recreated again. For example, render target in direct2d, device context in gdi . If the window flag `WindowStaysOnTopHint` changes, the widget will hide then show again, maybe that's the reason. If you forget this step, then the widget will never update again after the `WindowStaysOnTopHint` changes.
45 changes: 45 additions & 0 deletions doc/UseQtAVinYourProjects.md
Original file line number Diff line number Diff line change
@@ -0,0 1,45 @@
It's easy to include QtAV in your project. Because it's pro file are well designed. For more information about the pro file i use, see my another project: https://github.com/wang-bin/LibProjWizard4QtCreator

You can see examples in QtAV to know how to use QtAV, or follow the steps below

## Steps
1. Create a subdirs type project in directory myproject
myproject/myplayer.pro
`
TEMPLATE = subdirs
`
`
SUBDIRS = libQtAV myplayer
`
`
myplayer.depends = libQtAV
`
`
libQtAV.file = QtAV/src/libQtAV.pro
`
2. Clone/Put QtAV to myproject
the directory now is
> myproject/myplayer/myplayer.pro
> myproject/QtAV/src/libQtAV.pro
> myproject/QtAV/src/libQtAV.pri
3. Add libQtAV.pri in you project
in myproject/myplayer.pro, add
`
include(../QtAV/src/libQtAV.pri)
`
4. generate Makefile

qmake


>> If you have problem when building with `qmake`, try `qmake -r BUILD_DIR=some_dir`
>> YOU MUST use parameter **_-r_** and **_BUILD_DIR=some_dir_**, or the dependence will be broken when building due to my pro structure.
>> If you are using QtCreator to build the project, you should go to _Projects_->_Build Steps_->_qmake_->_Additional arguments_, add BUILD_DIR=your/buid/dir
5. make
you player binary will be created in $$BUILD_DIR/bin, BUILD_DIR is your shadow build dir. If you are in windows, the QtAV dll also be there

### ISSUES

If you want to build a debug version, you may get some link errors. It's not your problem, my qmake projects have some little problem. Just fix it manually yourself

0 comments on commit d03b868

Please sign in to comment.