From f249193e505f76dbe2e7ddbd5aa6a46fa4d7ba48 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Fri, 5 Apr 2013 20:34:46 +0800 Subject: [PATCH] update documents and README --- README.md | 4 --- doc/BuildQtAV-zh_CN.md | 5 +++- doc/BuildQtAV.md | 5 +++- doc/UseQtAVinYourProjects-zh_CN.md | 41 +++++++++++++++++++++++++++ doc/UseQtAVinYourProjects.md | 45 +++++++++++++----------------- doc/UsingPipe.md | 11 ++++++++ 6 files changed, 80 insertions(+), 31 deletions(-) create mode 100644 doc/UseQtAVinYourProjects-zh_CN.md create mode 100644 doc/UsingPipe.md diff --git a/README.md b/README.md index acf54d0b4..df66a0b9c 100644 --- a/README.md +++ b/README.md @@ -71,10 +71,6 @@ Then qmake will create a cache file _.qmake.cache_ in your build dir. Cache file _WARNING_: If you are in windows mingw with sh.exe environment, you may need run qmake twice. -##### Known Issues - -Debug library name may be wrong, you should manually rename the generated library to the name that compiler complains. - #### How To Write a Player diff --git a/doc/BuildQtAV-zh_CN.md b/doc/BuildQtAV-zh_CN.md index 83919cc72..0d03813fe 100644 --- a/doc/BuildQtAV-zh_CN.md +++ b/doc/BuildQtAV-zh_CN.md @@ -40,7 +40,10 @@ windows 无sh.exe的环境下的 gcc make qmake 在第一次运行的时候会检测所依赖的库, 你要保证这些库能被找到。 -然后 qmake 会在编译目录生成一个 cache 文件 _.qmake.cache_ . cache 文件包含了检测结果,比如 portaudio 是否支持。 如果你想重新检测, 则需要删除 _**.qmake.cache**_ 再运行 qmake +然后 qmake 会在编译目录生成一个 cache 文件 _.qmake.cache_ . cache 文件包含了检测结果,比如 portaudio 是否支持。 如果你想重新检测, 则可以删除 _**.qmake.cache**_ 再运行 qmake, 也可以直接给 qmake 加个额外参数 + + qmake QtAV_source_dir/QtAV.pro CONFIG+=recheck + _WARNING_: If you are in windows mingw with sh.exe environment, you may need run qmake twice. I have not find out the reason! diff --git a/doc/BuildQtAV.md b/doc/BuildQtAV.md index b48592873..1f0b88bdd 100644 --- a/doc/BuildQtAV.md +++ b/doc/BuildQtAV.md @@ -40,7 +40,10 @@ It's strongly recommend not to build in source dir. make qmake will run check the required libraries at the first time, so you must make sure those libraries can be found by compiler. -Then qmake will create a cache file _.qmake.cache_ in your build dir. Cache file stores the check results, for example, whether portaudio is available. If you want to recheck, delete _**.qmake.cache**_ and run qmake again +Then qmake will create a cache file _.qmake.cache_ in your build dir. Cache file stores the check results, for example, whether portaudio is available. If you want to recheck, you can either delete _**.qmake.cache**_ and run qmake again, or run + + qmake QtAV_source_dir/QtAV.pro CONFIG+=recheck + _WARNING_: If you are in windows mingw with sh.exe environment, you may need run qmake twice. I have not find out the reason! diff --git a/doc/UseQtAVinYourProjects-zh_CN.md b/doc/UseQtAVinYourProjects-zh_CN.md new file mode 100644 index 000000000..0e29adbe5 --- /dev/null +++ b/doc/UseQtAVinYourProjects-zh_CN.md @@ -0,0 +1,41 @@ +在你的项目中包含 QtAV 非常容易. 因为 QtAV 的qmake工程是精心设计的. (可以参考: https://github.com/wang-bin/LibProjWizard4QtCreator) + +你可以参考 QtAV 里的例子来了解如何使用 QtAV, 或者也可以使用以下步骤 + + +###1. 新建一个 subdirs 类型的工程myproject及一个直接调用QtAV的player子工程 + +myproject/myproject.pro + + TEMPLATE = subdirs + SUBDIRS += libQtAV myplayer + myplayer.depends += libQtAV + libQtAV.file = QtAV/src/libQtAV.pro + +###2. 把 QtAV 放到myproject + +可以在 myproject/ 目录下使用 `git clone git@github.com:wang-bin/QtAV.git`, 或者复制 QtAV 代码到 myproject/. 建议使用git,这样方便获取最新代码. + +现在的目录变为 + +> myproject/myproject.pro +> myproject/myplayer/myplayer.pro +> myproject/QtAV/src/libQtAV.pro +> myproject/QtAV/src/libQtAV.pri + +###3. 在player工程中包含 libQtAV.pri + +在 myproject/myplayer/myplayer.pro, add + + include(../QtAV/src/libQtAV.pri) + +###4. 生成 Makefile + +`qmake -r BUILD_DIR=some_dir` + + 必须使用参数 **_-r_** 和 **_BUILD_DIR=some_dir_**, 否则可能会出现依赖问题. + + 如果使用 QtCreator 来构建, 你可以点 _Projects_->_Build Steps_->_qmake_->_Additional arguments_, 添加 BUILD_DIR=your/buid/dir + +###5. make +player 会生成在 $$BUILD_DIR/bin. 在windows下, QtAV 的 dll文件也会在那里生成 diff --git a/doc/UseQtAVinYourProjects.md b/doc/UseQtAVinYourProjects.md index 2d050881a..87ad13f1c 100644 --- a/doc/UseQtAVinYourProjects.md +++ b/doc/UseQtAVinYourProjects.md @@ -3,43 +3,38 @@ It's easy to include QtAV in your project. Because it's pro file are well design 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 -` +###1. Create a subdirs type project and a player project + +myproject/myproject.pro + TEMPLATE = subdirs -` -` SUBDIRS += libQtAV myplayer -` -` myplayer.depends += libQtAV -` -` libQtAV.file = QtAV/src/libQtAV.pro -` -2. Clone/Put QtAV to myproject + +###2. Put QtAV to myproject + +You can use `git clone git@github.com:wang-bin/QtAV.git` in myproject/, or copy QtAV to myproject/. It's recommend to use git so that you can checkout the latest code easily. + the directory now is + +> myproject/myproject.pro > 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 +###3. Add libQtAV.pri in you player project +in myproject/myplayer/myplayer.pro, add - qmake + include(../QtAV/src/libQtAV.pri) +###4. generate Makefile ->> 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 +`qmake -r BUILD_DIR=some_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 + YOU MUST use parameter **_-r_** and **_BUILD_DIR=some_dir_**, or the dependence will be broken when building due to my pro structure. -### ISSUES + 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 -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 \ No newline at end of file +###5. make +you player binary will be created in $$BUILD_DIR/bin. If you are in windows, the QtAV dll also be there \ No newline at end of file diff --git a/doc/UsingPipe.md b/doc/UsingPipe.md new file mode 100644 index 000000000..08d7859cf --- /dev/null +++ b/doc/UsingPipe.md @@ -0,0 +1,11 @@ +FFmpeg supports playing media streams from pipe. Pipe is a protocol in FFmpeg. To use it, you just need to replace the file name with 'pipe:'. for example + + cat hello.avi |player pipe: + +It also supports streams from file number + + pipe:number + +'number' can be 0, 1, 2, .... 0 is stdin, 1 is stdout and 2 is stderr. If 'number' is empty, it means stdin. + +FFmpeg is powerful, do you think so? \ No newline at end of file