Android Multimedia System Business and android multimedia business

Source: Internet
Author: User

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:

  • Local Camera framework;
  • Image Encoding module (optional );
  • Video output (Surface system or Overlay );
  • Android. hardware. Camera class;
  • Android. view. Surface class;
  • The Camera application package.

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:

  • Media recorder section in the local media framework
  • PVAuthor (core of Implementation)
  • Audio Encoding module (optional)
  • Audio input stage
  • Android. media. MediaRecorder class
  • SoundRecorder package

  • Android recorder has a single function. Its data stream is usually obtained from the audio input and encoded by PVAuthor, encode and add the media header to form an audio media file. You can also use hardware encoding for recording.

  • The Java app SoundRecorder of the recorder has the function of playing after the recording is completed. Therefore, you need to call either the Java framework media recorder or the media player.
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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.