提交 b54b0be3 编写于 作者: W wusongqing

update docs against 5569

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 6819dad0
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
## When to Use ## When to Use
You can use OpenSL ES to develop the audio recording function in OpenHarmony. Currently, only some You can use OpenSL ES to develop the audio recording function in OpenHarmony. Currently, only some [OpenSL ES APIs](https://gitee.com/openharmony/third_party_opensles/blob/master/api/1.0.1/OpenSLES.h) are implemented. If an API that has not been implemented is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned.
[OpenSL ES APIs](https://gitee.com/openharmony/third_party_opensles/blob/master/api/1.0.1/OpenSLES.h) are implemented. If an API that has not been implemented yet is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned.
## How to Develop ## How to Develop
...@@ -27,8 +24,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform ...@@ -27,8 +24,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
(*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE); (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE);
``` ```
3. Obtain the **engineEngine** instance of the **SL_IID_ENGINE** interface. 3. Obtain the **engineEngine** instance of the **SL_IID_ENGINE** interface.
```c++ ```c++
...@@ -36,8 +31,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform ...@@ -36,8 +31,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
result = (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineItf); result = (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineItf);
``` ```
4. Configure the recorder information (including the input source **audiosource** and output source **audiosink**), and create a **pcmCapturerObject** instance. 4. Configure the recorder information (including the input source **audiosource** and output source **audiosink**), and create a **pcmCapturerObject** instance.
```c++ ```c++
...@@ -81,21 +74,19 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform ...@@ -81,21 +74,19 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
``` ```
5. Obtain the **recordItf** instance of the **SL_IID_RECORD** interface. 5. Obtain the **recordItf** instance of the **SL_IID_RECORD** interface.
``` ```c++
SLRecordItf recordItf; SLRecordItf recordItf;
(*pcmCapturerObject)->GetInterface(pcmCapturerObject, SL_IID_RECORD, &recordItf); (*pcmCapturerObject)->GetInterface(pcmCapturerObject, SL_IID_RECORD, &recordItf);
``` ```
6. Obtain the **bufferQueueItf** instance of the **SL_IID_OH_BUFFERQUEUE** interface. 6. Obtain the **bufferQueueItf** instance of the **SL_IID_OH_BUFFERQUEUE** interface.
``` ```c++
SLOHBufferQueueItf bufferQueueItf; SLOHBufferQueueItf bufferQueueItf;
(*pcmCapturerObject)->GetInterface(pcmCapturerObject, SL_IID_OH_BUFFERQUEUE, &bufferQueueItf); (*pcmCapturerObject)->GetInterface(pcmCapturerObject, SL_IID_OH_BUFFERQUEUE, &bufferQueueItf);
``` ```
7. Register the **BufferQueueCallback** function. 7. Register the **BufferQueueCallback** function.
```c++ ```c++
...@@ -120,7 +111,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform ...@@ -120,7 +111,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
(*bufferQueueItf)->RegisterCallback(bufferQueueItf, BufferQueueCallback, wavFile_); (*bufferQueueItf)->RegisterCallback(bufferQueueItf, BufferQueueCallback, wavFile_);
``` ```
8. Start audio recording. 8. Start audio recording.
```c++ ```c++
...@@ -145,7 +135,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform ...@@ -145,7 +135,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
} }
``` ```
9. Stop audio recording. 9. Stop audio recording.
```c++ ```c++
......
# OpenSL ES Audio Playback Development # OpenSL ES Audio Playback Development
## When to Use ## When to Use
You can use OpenSL ES to develop the audio playback function in OpenHarmony. Currently, only some [OpenSL ES APIs](https://gitee.com/openharmony/third_party_opensles/blob/master/api/1.0.1/OpenSLES.h) are implemented. If an API that has not been implemented is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned. You can use OpenSL ES to develop the audio playback function in OpenHarmony. Currently, only some [OpenSL ES APIs](https://gitee.com/openharmony/third_party_opensles/blob/master/api/1.0.1/OpenSLES.h) are implemented. If an API that has not been implemented is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned.
## How to Develop ## How to Develop
To use OpenSL ES to develop the audio playback function in OpenHarmony, perform the following steps: To use OpenSL ES to develop the audio playback function in OpenHarmony, perform the following steps:
...@@ -20,8 +16,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform ...@@ -20,8 +16,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
#include <OpenSLES_Platform.h> #include <OpenSLES_Platform.h>
``` ```
2. Use the **slCreateEngine** API to obtain an **engine** instance. 2. Use the **slCreateEngine** API to obtain an **engine** instance.
```c++ ```c++
...@@ -30,8 +24,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform ...@@ -30,8 +24,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
(*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE); (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE);
``` ```
3. Obtain the **engineEngine** instance of the **SL_IID_ENGINE** interface. 3. Obtain the **engineEngine** instance of the **SL_IID_ENGINE** interface.
```c++ ```c++
...@@ -39,8 +31,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform ...@@ -39,8 +31,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
(*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine); (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine);
``` ```
4. Configure the player and create an **AudioPlayer** instance. 4. Configure the player and create an **AudioPlayer** instance.
```c++ ```c++
...@@ -66,8 +56,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform ...@@ -66,8 +56,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
(*pcmPlayerObject)->Realize(pcmPlayerObject, SL_BOOLEAN_FALSE); (*pcmPlayerObject)->Realize(pcmPlayerObject, SL_BOOLEAN_FALSE);
``` ```
5. Obtain the **bufferQueueItf** instance of the **SL_IID_OH_BUFFERQUEUE** interface. 5. Obtain the **bufferQueueItf** instance of the **SL_IID_OH_BUFFERQUEUE** interface.
``` ```
...@@ -75,8 +63,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform ...@@ -75,8 +63,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
(*pcmPlayerObject)->GetInterface(pcmPlayerObject, SL_IID_OH_BUFFERQUEUE, &bufferQueueItf); (*pcmPlayerObject)->GetInterface(pcmPlayerObject, SL_IID_OH_BUFFERQUEUE, &bufferQueueItf);
``` ```
6. Open an audio file and register the **BufferQueueCallback** function. 6. Open an audio file and register the **BufferQueueCallback** function.
```c++ ```c++
...@@ -101,8 +87,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform ...@@ -101,8 +87,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
(*bufferQueueItf)->RegisterCallback(bufferQueueItf, BufferQueueCallback, wavFile_); (*bufferQueueItf)->RegisterCallback(bufferQueueItf, BufferQueueCallback, wavFile_);
``` ```
7. Obtain the **playItf** instance of the **SL_PLAYSTATE_PLAYING** interface and start playback. 7. Obtain the **playItf** instance of the **SL_PLAYSTATE_PLAYING** interface and start playback.
```c++ ```c++
...@@ -111,8 +95,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform ...@@ -111,8 +95,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
(*playItf)->SetPlayState(playItf, SL_PLAYSTATE_PLAYING); (*playItf)->SetPlayState(playItf, SL_PLAYSTATE_PLAYING);
``` ```
8. Stop audio playback. 8. Stop audio playback.
```c++ ```c++
......
...@@ -8,8 +8,6 @@ During video recording, audio and video signals are captured, encoded, and saved ...@@ -8,8 +8,6 @@ During video recording, audio and video signals are captured, encoded, and saved
![en-us_image_video_recorder_state_machine](figures/en-us_image_video_recorder_state_machine.png) ![en-us_image_video_recorder_state_machine](figures/en-us_image_video_recorder_state_machine.png)
**Figure 2** Layer 0 diagram of video recording **Figure 2** Layer 0 diagram of video recording
![en-us_image_video_recorder_zero](figures/en-us_image_video_recorder_zero.png) ![en-us_image_video_recorder_zero](figures/en-us_image_video_recorder_zero.png)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册