Android Multimedia System Business and android multimedia business
Please support originality, respect originality, reprinted please note the Source: http://blog.csdn.net/kangweijian (from kangweijian csdn blog)
Main business Media Player structure of Android Multimedia Applications
A media player is the most important part in multimedia. A media player involves the following content:
- Media player in the local media framework
- PVPlayer (core code)
- Audio/Video Encoding/decoding module (optional)
- Audio Output Stage
- Video output (Surface system or Overlay)
- Android. media. MediaPlayer
- Android. view. Surface class
- Android. widget. VideoView class
- Music application package and Camera application package (MovieView class for video playback)
- The typical data stream running status in the Android Media Player is that the upper-layer Java application sets the media URI (which can be a media file or streaming media) to the media player as input, after the Java framework, JNI, and local framework, it is always set to the PVPlayer. In this process, only the URL of the media URI is transmitted, and no data stream is transmitted. After being parsed by PVPlayer, the media is divided into audio streams (MP3, AMR, AAC, etc.) and video streams (H263, H264, MPEG4, etc ), after processing and synchronizing the codec (AVSync), it is converted to the original data (the audio is generally PCM, and the video is generally in YUV or RGB format ). Raw audio and video data will be sent to the audio and video output links.
- In the implementation process, the Media Player may have some changes: When only audio data is available, only audio decoding is required, and audio and video synchronization is not required: hardware decoding can be used as a plug-in for PVPlayer encoding and decoding. The standard implementation is that after decoding, the original audio and video data is transmitted from the user control to the audio and video output, however, if the hardware decoder is used, the raw audio and video data can be directly input to the hardware device without the user control. As the output device of the video, it can be based on the general Surface interface or Overlay System in Android.
Camera System Structure
Cameras are relatively independent in multimedia. The camera involves the following content:
The camera system of Android has two main services: ViewFinder and photo taking. The viewfinder implements the Preview function. The output of the photos is the photo file, and the Preview output is the Android Surface. Generally, a camera only needs to encode JPEG data without video stream encoding. Therefore, it usually does not pass through PacketVideo.
Recorder System Structure
The recorder system only designs the audio part, and its structure is relatively simple. The recorder involves the following content:
Camera System Structure
A video camera is a complex part of multimedia. The camera involves the following content:
- Media recorder in the local media framework;
- PVAuthor (core of implementation );
- Audio/Video Encoding module (optional );
- Audio input stage;
- The Local interface of Camera (as the video input link );
- Video output (Surface system or Overlay );
- Android. media. MediaRecorder class;
- Android. view. Surface class;
- Android. widget. VideoView class;
- Music package and Camera package.
- The Android camera system has three services: video preview, video recording, and audio recording. The video preview function of the camera system is basically the same as that of the camera. During the recording process, video preview, recording, and audio recording are performed simultaneously. After the original video data is sent from the hardware abstraction layer of Camera, it will be sent to both the video output system and PVAuthor. The original audio data is obtained from the audio input device and sent to the cards PVAuthor. After PVAuthor synchronizes and encodes the audio data, adds the header information of the media file and writes it to the media file. In this process, you can also use the hardware-implemented plug-in module to improve the system performance.
- The process of media recording is basically the opposite of that of media playback, but video preview is not involved.
- The Java application of the Camera is VideoCamera in the Camera package. The video playback application is also included in the Camera package and implemented based on VideoView.
Explanation of Android system principles and development points by5.5.2.23 evening
Please support originality, respect originality, reprinted please note the Source: http://blog.csdn.net/kangweijian (from kangweijian csdn blog)